blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
listlengths 1
1
| author
stringlengths 0
161
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d08ec54de4b05b156e2f8bd3bf52eb9964f86024
|
ec3a90d7281fde124c9cd3191d3de1e8d627b4f4
|
/designmodel/src/com/jkx/designmodel/adapter/Main.java
|
20d3ed16b840fa766cac69f8012b303b64416d69
|
[] |
no_license
|
MrWangLong/RepositoryOfMax
|
3a4e25dab184affbf8376f888d50ae9784b2c474
|
b6973ceaa9a9508086223c0c9684c0c126a28401
|
refs/heads/master
| 2021-04-09T16:24:37.390256 | 2019-03-15T08:18:39 | 2019-03-15T08:18:39 | 125,871,676 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 364 |
java
|
package com.jkx.designmodel.adapter;
public class Main {
public static void main(String[] args) {
IPrint print = new PrintBanner("Adapter");
print.printWeak();
print.printStrong();
System.out.println("----------------------------------------------");
Print print2 = new PrintAdapter("Banner");
print2.printWeak();
print2.printStrong();
}
}
|
[
"[email protected]"
] | |
504faee8f9c84ba053c080d24d3c2c31a233a80d
|
766dd0dc285920f1a446c52d1291e6dddf67d4f8
|
/LastRemaining/LastRemainingTest.java
|
281e5a91f89001727db332ef2b456b2289e100da
|
[] |
no_license
|
H-Always/Algorithm-Repository
|
d24f088fda6bc6254c0cce1428cdb9e8ed282262
|
95134983954c65751113f06c068b3341042bc1e0
|
refs/heads/master
| 2022-01-22T11:48:33.392858 | 2022-01-20T09:14:58 | 2022-01-20T09:14:58 | 208,715,710 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 303 |
java
|
/**
* @ClassName: LastRemainingTest
* @Description: 算法测试
* @Author: 余霜
* @Date: 2020/03/30 22:18
* @Version: V1.0
**/
public class LastRemainingTest {
public static void main(String[] args) {
LastRemaining ys = new LastRemaining();
ys.lastRemaining(8,3);
}
}
|
[
"[email protected]"
] | |
dd9284f9d9d22b2a260f4c4ad45e79e4e23ac481
|
30f66a61865458458947055888d17f53f102456d
|
/server/center/src/main/java/com/linlongyx/sanguo/webgame/proto/binary/struct/DestinyRankData.java
|
c0782c86c7676a2d9ff332a0853fc630e6eaeed8
|
[] |
no_license
|
NeverMoreShadowFiend/xxsg
|
0f833d963098b0d66aa1161ecefc7f6cc2fa9610
|
51b0b7620c450ab076d0e4dd362969ee0a2ecd97
|
refs/heads/master
| 2022-12-11T09:44:28.737852 | 2020-09-23T02:10:34 | 2020-09-23T02:10:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,812 |
java
|
/* */ package com.linlongyx.sanguo.webgame.proto.binary.struct;
/* */
/* */ import com.linlongyx.core.utils.StringUtil;
/* */ import com.linlongyx.sanguo.webgame.proto.ProtocolUtil;
/* */ import io.netty.buffer.ByteBuf;
/* */ import java.io.Serializable;
/* */
/* */
/* */
/* */
/* */ public class DestinyRankData
/* */ implements Serializable
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ public long playerId;
/* */ public String playerName;
/* */ public String head;
/* */ public long fightValue;
/* */ public int destinyPoint;
/* */ public int quality;
/* */ public int rank;
/* */
/* */ public void serial(ByteBuf out) {
/* 24 */ ProtocolUtil.writeLong(out, this.playerId);
/* 25 */ ProtocolUtil.writeUTFBinary(out, this.playerName);
/* 26 */ ProtocolUtil.writeUTFBinary(out, this.head);
/* 27 */ ProtocolUtil.writeLong(out, this.fightValue);
/* 28 */ ProtocolUtil.writeInt(out, this.destinyPoint);
/* 29 */ ProtocolUtil.writeInt(out, this.quality);
/* 30 */ ProtocolUtil.writeInt(out, this.rank);
/* */ }
/* */
/* */
/* */ public void unserial(ByteBuf in) {
/* 35 */ this.playerId = ProtocolUtil.readUTFBinLong(in);
/* 36 */ this.playerName = ProtocolUtil.readUTFStr(in);
/* 37 */ this.head = ProtocolUtil.readUTFStr(in);
/* 38 */ this.fightValue = ProtocolUtil.readUTFBinLong(in);
/* 39 */ this.destinyPoint = ProtocolUtil.readUTFBinInt(in);
/* 40 */ this.quality = ProtocolUtil.readUTFBinInt(in);
/* 41 */ this.rank = ProtocolUtil.readUTFBinInt(in);
/* */ }
/* */
/* */
/* */ public DestinyRankData clone() throws CloneNotSupportedException {
/* 46 */ DestinyRankData clone = (DestinyRankData)super.clone();
/* 47 */ return clone;
/* */ }
/* */
/* */
/* */ public void reset() {
/* 52 */ this.playerId = 0L;
/* 53 */ this.playerName = null;
/* 54 */ this.head = null;
/* 55 */ this.fightValue = 0L;
/* 56 */ this.destinyPoint = 0;
/* 57 */ this.quality = 0;
/* 58 */ this.rank = 0;
/* */ }
/* */
/* */
/* */ public String toString() {
/* 63 */ String retVal = "{\"playerId\":" + this.playerId + ",\"playerName\":" + StringUtil.str2Str(this.playerName) + ",\"head\":" + StringUtil.str2Str(this.head) + ",\"fightValue\":" + this.fightValue + ",\"destinyPoint\":" + this.destinyPoint + ",\"quality\":" + this.quality + ",\"rank\":" + this.rank + "}";
/* 64 */ return retVal;
/* */ }
/* */ }
/* Location: D:\xxsg_52gmsy\center\target\classes\!\com\linlongyx\sanguo\webgame\proto\binary\struct\DestinyRankData.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/
|
[
"[email protected]"
] | |
b6ec5fe8aecc840a743d50be3ebd933fb1ce9370
|
10ad0656a599251fb4b0a6ebb982d1c9dfeeff38
|
/app/src/main/java/trendmicro/com/tangoindoornavigation/ui/MainActivity.java
|
a7a5ceaac47997636e99592b430974a1c22377dc
|
[] |
no_license
|
zhangxuelei86/Google-Tango-AR-Indoor-Navigation-Test-Android
|
b30aa79796b36dd99b87024a35ffc3f7fa8e1126
|
5ef51fa5fcd6283735ee68b99771f2d06e1a8ebe
|
refs/heads/master
| 2021-10-26T11:59:08.864471 | 2019-04-12T14:38:07 | 2019-04-12T14:38:07 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 13,641 |
java
|
package trendmicro.com.tangoindoornavigation.ui;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
import android.widget.ToggleButton;
import com.google.atap.tangoservice.Tango;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.List;
import trendmicro.com.tangoindoornavigation.R;
import trendmicro.com.tangoindoornavigation.db.ADFDao;
import trendmicro.com.tangoindoornavigation.db.BuildingDao;
import trendmicro.com.tangoindoornavigation.db.PointDao;
import trendmicro.com.tangoindoornavigation.db.dto.ADFInfo;
import trendmicro.com.tangoindoornavigation.db.dto.BuildingInfo;
import trendmicro.com.tangoindoornavigation.db.dto.PointInfo;
public class MainActivity extends Activity implements View.OnClickListener {
private static final String TAG = MainActivity.class.getSimpleName();
// The unique key string for storing the user's input.
public static final String USE_AREA_LEARNING = "trendmicro.com.tangoindoornavigation.ui.usearealearning";
public static final String LOAD_ADF = "trendmicro.com.tangoindoornavigation.ui.loadadf";
public static final String BUILDING = "trendmicro.com.tangoindoornavigation.ui.building";
public static final String LOAD_ADF_UUID = "trendmicro.com.tangoindoornavigation.ui.loadadfuuid";
// Permission request action.
public static final int REQUEST_CODE_TANGO_PERMISSION = 0;
// UI elements.
private ToggleButton mLearningModeToggleButton;
private ToggleButton mLoadAdfToggleButton;
private Button mStartButton;
private Button mADListButton;
private Button mReconstructionButton;
private Button mPointReconstructionButton;
private Button mBuildingButton;
private Button mConfigurationButton;
private Spinner mADFSpinner;
private Spinner mBuildingSpinner;
private boolean mIsUseAreaLearning;
private boolean mIsLoadAdf;
private boolean mIsPermissionGot = false;
private HashMap<Integer, ADFInfo> mSpinnerADFMap = new HashMap<Integer, ADFInfo>();
private HashMap<Integer, BuildingInfo> mSpinnerBuildingMap = new HashMap<Integer, BuildingInfo>();
private ArrayAdapter<String> mADFAdapter;
private ArrayList mADFSpinnerArray = new ArrayList();
private ArrayAdapter<String> mBuildingAdapter;
private ArrayList mBuildingSpinnerArray = new ArrayList();;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initUI();
startActivityForResult(
Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_ADF_LOAD_SAVE), REQUEST_CODE_TANGO_PERMISSION);
}
@Override
public void onResume() {
super.onResume();
Log.i(TAG, "onResume in : mIsPermissionGot = " + mIsPermissionGot);
if (mIsPermissionGot) {
updateUI();
}
}
@Override
public void onPause() {
super.onPause();
}
private void initUI() {
setContentView(R.layout.activity_main);
setTitle(R.string.app_name);
// Set up UI elements.
mLearningModeToggleButton = (ToggleButton) findViewById(R.id.learning_mode);
mLoadAdfToggleButton = (ToggleButton) findViewById(R.id.load_adf);
mStartButton = (Button) findViewById(R.id.start);
mADListButton = (Button) findViewById(R.id.AdfListView);
mReconstructionButton = (Button) findViewById(R.id.reconstructionView);
mPointReconstructionButton = (Button) findViewById(R.id.point_reconstructionView);
mBuildingButton = (Button) findViewById(R.id.building_view);
mConfigurationButton = (Button) findViewById(R.id.configuration);
mADFSpinner = (Spinner) findViewById(R.id.uuid);
mBuildingSpinner = (Spinner) findViewById(R.id.buildings);
mLearningModeToggleButton.setOnClickListener(this);
mLoadAdfToggleButton.setOnClickListener(this);
mStartButton.setOnClickListener(this);
mADListButton.setOnClickListener(this);
mReconstructionButton.setOnClickListener(this);
mPointReconstructionButton.setOnClickListener(this);
mBuildingButton.setOnClickListener(this);
mConfigurationButton.setOnClickListener(this);
mIsUseAreaLearning = mLearningModeToggleButton.isChecked();
mIsLoadAdf = mLoadAdfToggleButton.isChecked();
mBuildingAdapter =new ArrayAdapter<String>(getApplicationContext(),R.layout.spinner_dropdown_item, mBuildingSpinnerArray);
mBuildingAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mBuildingSpinner.setAdapter(mBuildingAdapter);
mADFAdapter = new ArrayAdapter<String>(getApplicationContext(),R.layout.spinner_dropdown_item, mADFSpinnerArray);
mADFAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mADFSpinner.setAdapter(mADFAdapter);
mBuildingSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Log.i(TAG, "onItemSelected in : " + position);
int buildingId = Integer.parseInt(mSpinnerBuildingMap.get(position).getId());
ADFDao adfDao = new ADFDao(getApplicationContext());
Log.i(TAG, "buildingId : " + buildingId);
List<ADFInfo> listADF = adfDao.queryADFsByBuildingId(buildingId);
Log.i(TAG, "listADF.toString() : " + listADF.toString());
mADFSpinnerArray.clear();
mSpinnerADFMap.clear();
mADFAdapter.clear();
for (int i = 0; i < listADF.size(); i++) {
mSpinnerADFMap.put(i, listADF.get(i));
mADFSpinnerArray.add("(" + listADF.get(i).getFloor() + " F) " + listADF.get(i).getADFName());
}
mADFAdapter.notifyDataSetChanged();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
Log.i(TAG, "onNothingSelected in");
}
});
}
@Override
public void onClick(View v) {
Log.i(TAG, "onClick in : " + v.toString());
if (v == null) {
Log.e(TAG, "v is null. skip.");
return;
}
switch (v.getId()) {
case R.id.load_adf:
loadAdfClicked();
break;
case R.id.learning_mode:
learningModeClicked();
break;
case R.id.start:
startAreaDescriptionActivity();
break;
case R.id.AdfListView:
startAdfListView();
break;
case R.id.reconstructionView:
startReconstructionActivity();
break;
case R.id.point_reconstructionView:
startPointsReconstructionActivity();
break;
case R.id.building_view:
startBuildingActivity();
break;
case R.id.configuration:
startConfigurationActivity();
break;
default:
Log.e(TAG, "Unknown click event. skip.");
break;
}
}
public void loadAdfClicked() {
mIsLoadAdf = mLoadAdfToggleButton.isChecked();
}
public void learningModeClicked() {
mIsUseAreaLearning = mLearningModeToggleButton.isChecked();
}
private void startAreaDescriptionActivity() {
Intent startAdIntent = new Intent(this, AreaDescriptionActivity.class);
startAdIntent.putExtra(USE_AREA_LEARNING, mIsUseAreaLearning);
startAdIntent.putExtra(LOAD_ADF, mIsLoadAdf);
if (mSpinnerADFMap.size() > 0) {
startAdIntent.putExtra(LOAD_ADF_UUID, mSpinnerADFMap.get(mADFSpinner.getSelectedItemPosition()).getUUID());
} else {
startAdIntent.putExtra(LOAD_ADF_UUID, "");
}
if (mSpinnerBuildingMap.size() > 0) {
Log.i(TAG, "mBuildingSpinner = " + mSpinnerBuildingMap.get(mBuildingSpinner.getSelectedItemPosition()).getId());
startAdIntent.putExtra(BUILDING, mSpinnerBuildingMap.get(mBuildingSpinner.getSelectedItemPosition()).getId());
} else {
startAdIntent.putExtra(BUILDING, "0");
}
startActivity(startAdIntent);
}
private void startPointsReconstructionActivity() {
Intent startPointsReconstructionIntent = new Intent(this, AreaPointsConstructionActivity.class);
startPointsReconstructionIntent.putExtra(USE_AREA_LEARNING, mIsUseAreaLearning);
startPointsReconstructionIntent.putExtra(LOAD_ADF, mIsLoadAdf);
if (mSpinnerADFMap.size() > 0) {
startPointsReconstructionIntent.putExtra(LOAD_ADF_UUID, mSpinnerADFMap.get(mADFSpinner.getSelectedItemPosition()).getUUID());
} else {
startPointsReconstructionIntent.putExtra(LOAD_ADF_UUID, "");
}
if (mSpinnerBuildingMap.size() > 0) {
Log.i(TAG, "mBuildingSpinner = " + mSpinnerBuildingMap.get(mBuildingSpinner.getSelectedItemPosition()).getId());
startPointsReconstructionIntent.putExtra(BUILDING, mSpinnerBuildingMap.get(mBuildingSpinner.getSelectedItemPosition()).getId());
} else {
startPointsReconstructionIntent.putExtra(BUILDING, "0");
}
startActivity(startPointsReconstructionIntent);
}
private void startReconstructionActivity() {
Intent startReconstructionIntent = new Intent(this, ReconstructionActivity.class);
startActivity(startReconstructionIntent);
}
private void startAdfListView() {
Intent startAdfListViewIntent = new Intent(this, AdfUuidListViewActivity.class);
startActivity(startAdfListViewIntent);
}
private void startBuildingActivity() {
Intent startBuildingIntent = new Intent(this, BuildingActivity.class);
startActivity(startBuildingIntent);
}
private void startConfigurationActivity() {
Intent startConfigurationIntent = new Intent(this, ConfigurationActivity.class);
startActivity(startConfigurationIntent);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// The result of the permission activity.
//
// Note that when the permission activity is dismissed, the MainActivity's
// onResume() callback is called. Because the Tango Service is connected in the onResume()
// function, we do not call connect here.
//
// Check which request we're responding to.
if (requestCode == REQUEST_CODE_TANGO_PERMISSION) {
// Make sure the request was successful.
if (resultCode == RESULT_CANCELED) {
Toast.makeText(this, R.string.arealearning_permission, Toast.LENGTH_SHORT).show();
finish();
} else if (resultCode == RESULT_OK) {
mIsPermissionGot = true;
}
}
}
private void updateUI() {
BuildingDao buildingDao = new BuildingDao(getApplicationContext());
List<BuildingInfo> buildingList= buildingDao.queryAllBuildings();
Log.i(TAG, "buildingList.toString() : " + buildingList.toString());
mBuildingSpinnerArray.clear();
mSpinnerBuildingMap.clear();
mBuildingAdapter.clear();
if (buildingList.size() > 0) {
for (int i = 0; i < buildingList.size(); i++) {
mSpinnerBuildingMap.put(i, buildingList.get(i));
mBuildingSpinnerArray.add(buildingList.get(i).getBuildingName());
}
}
mBuildingAdapter.notifyDataSetChanged();
if (mBuildingSpinner.getSelectedItemPosition() != -1 && mSpinnerBuildingMap.get(mBuildingSpinner.getSelectedItemPosition()) != null) {
int buildingId = Integer.parseInt(mSpinnerBuildingMap.get(mBuildingSpinner.getSelectedItemPosition()).getId());
ADFDao adfDao = new ADFDao(getApplicationContext());
Log.i(TAG, "buildingId : " + buildingId);
List<ADFInfo> listADF = adfDao.queryADFsByBuildingId(buildingId);
Log.i(TAG, "listADF.toString() : " + listADF.toString());
mADFSpinnerArray.clear();
mSpinnerADFMap.clear();
mADFAdapter.clear();
for (int i = 0; i < listADF.size(); i++) {
mSpinnerADFMap.put(i, listADF.get(i));
mADFSpinnerArray.add("(" + listADF.get(i).getFloor() + " F) " + listADF.get(i).getADFName());
}
mADFAdapter.notifyDataSetChanged();
}
ADFDao adfDao = new ADFDao(getApplicationContext());
List<ADFInfo> listADF = adfDao.queryAllADFs();
Log.i(TAG, "[updateUI]pointList.size() = " + listADF.size());
for (ADFInfo adfInfo : listADF) {
Log.i(TAG, "[updateUI]adfInfo = " + adfInfo.toString());
}
PointDao pointDao = new PointDao(getApplicationContext());
List<PointInfo> pointList = pointDao.queryAllPoints();
Log.i(TAG, "[updateUI]pointList.size() = " + pointList.size());
for (PointInfo point : pointList) {
//Log.i(TAG, "[updateUI]pointInfo = " + point.toString());
}
}
}
|
[
"[email protected]"
] | |
d3384c91ce94f495d967f1457a23b8bee9e30ff5
|
42fdea3f80011e05f24385ab9bf4cf9f603ba5dc
|
/updatebot-core/src/main/java/io/fabric8/updatebot/model/GitHubProjects.java
|
5b6baac7b4cea49450e24c42b2f3eb5a8dd6fde2
|
[
"Apache-2.0"
] |
permissive
|
fabric8-updatebot/updatebot
|
31148d3a6b16264b12336de27f17cfb83a808ec7
|
27f4bc8e4327719edb86af32cb887c8073d1f1be
|
refs/heads/master
| 2021-09-05T10:16:24.239479 | 2017-11-22T22:39:16 | 2017-11-22T22:39:16 | 104,516,152 | 34 | 6 |
Apache-2.0
| 2022-08-06T17:13:40 | 2017-09-22T20:30:07 |
Java
|
UTF-8
|
Java
| false | false | 2,375 |
java
|
/*
* Copyright 2016 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.fabric8.updatebot.model;
import io.fabric8.utils.Objects;
import java.util.ArrayList;
import java.util.List;
/**
*/
public class GitHubProjects extends DtoSupport {
private List<GithubOrganisation> organisations;
@Override
public String toString() {
return "GitHubProjects{" +
"organisations=" + organisations +
'}';
}
public GithubOrganisation organisation(String name) {
GithubOrganisation answer = findOrganisation(name);
if (answer == null) {
if (organisations == null) {
organisations = new ArrayList<>();
}
answer = new GithubOrganisation(name);
organisations.add(answer);
}
return answer;
}
public GithubOrganisation findOrganisation(String name) {
if (organisations != null) {
for (GithubOrganisation organisation : organisations) {
if (Objects.equal(name, organisation.getName())) {
return organisation;
}
}
}
return null;
}
public List<GithubOrganisation> getOrganisations() {
return organisations;
}
public void setOrganisations(List<GithubOrganisation> organisations) {
this.organisations = organisations;
}
public GitRepositoryConfig getRepositoryDetails(String cloneUrl) {
if (organisations != null) {
for (GithubOrganisation organisation : organisations) {
GitRepositoryConfig answer = organisation.getRepositoryDetails(cloneUrl);
if (answer != null) {
return answer;
}
}
}
return null;
}
}
|
[
"[email protected]"
] | |
4a1489559befdb33180d66d9c607ddbabd0b0a49
|
3d8d97c38acea5eba0325210412ee1b3c075914d
|
/src/main/java/hprose/server/Topic.java
|
7d74350778921da061546630647dd701cf0e086f
|
[
"MIT"
] |
permissive
|
mikeqian/hprose-java
|
356148a7b55c6b6dda70f2cb4b4a5f78cd00ffab
|
a6c21e81108c301a5aca8a8d87786e6ec412452d
|
refs/heads/master
| 2020-04-05T23:37:42.459289 | 2016-06-21T06:33:40 | 2016-06-21T06:33:40 | 61,007,754 | 1 | 0 | null | 2016-06-19T03:48:13 | 2016-06-13T04:47:38 |
Java
|
UTF-8
|
Java
| false | false | 1,626 |
java
|
/**********************************************************\
| |
| hprose |
| |
| Official WebSite: http://www.hprose.com/ |
| http://www.hprose.org/ |
| |
\**********************************************************/
/**********************************************************\
* *
* Topic.java *
* *
* push topic class for Java. *
* *
* LastModified: May 3, 2016 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
package hprose.server;
import hprose.util.concurrent.Promise;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
class Topic {
public Future timer;
public Promise request;
public final ConcurrentLinkedQueue<Message> messages = new ConcurrentLinkedQueue<Message>();
public final AtomicInteger count = new AtomicInteger(1);
public final int heartbeat;
public Topic(int heartbeat) {
this.heartbeat = heartbeat;
}
}
|
[
"[email protected]"
] | |
5803246bff7363f02673837401ef6667d54c3c68
|
6224b0d929e0761d82e8cd4dbf2dce5674e8571b
|
/src/main/java/com/ceiba/demo/dao/RegistroRepository.java
|
198c1b9c92df7b8fc3557eb697312806886dd26b
|
[] |
no_license
|
andresarredondoh/ParkingBack
|
461bbab88c0c7445a137796251a7b885ee394222
|
4e488dce8695f249d86ed41744193fbbed714b0a
|
refs/heads/master
| 2020-04-16T05:35:47.536109 | 2019-01-21T18:09:13 | 2019-01-21T18:09:13 | 165,312,193 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 280 |
java
|
package com.ceiba.demo.dao;
import org.springframework.data.jpa.repository.JpaRepository;
import com.ceiba.demo.model.Registro;
public interface RegistroRepository extends JpaRepository<Registro, Long>{
@SuppressWarnings("unchecked" )
Registro save(Registro registro);
}
|
[
"[email protected]"
] | |
9f6583f9b94b7201077586701f9c7fd6ae6449b2
|
da6bfbc438e7ad638292914a64f9361f378ca45f
|
/src/com/servlet/CheckCodeServlet.java
|
7fced6ff7cfc1e5649952fcea01b37041c4b4f90
|
[] |
no_license
|
nolsson151/SSD
|
ef2b298c96e3b7d1c511e6406b858f29ee8c7cff
|
8b6ddd1adc75c3bbc47ca9b0d890475a6631910c
|
refs/heads/master
| 2020-04-10T00:32:49.907519 | 2018-12-11T13:57:22 | 2018-12-11T13:57:22 | 160,688,574 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,239 |
java
|
package com.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.utils.CodeChecker;
@WebServlet("/Check")
public class CheckCodeServlet extends HttpServlet{
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String message = request.getParameter("message");
CodeChecker cc = new CodeChecker();
List<String> report = cc.report(message);
if(report.isEmpty())
{
RequestDispatcher rd = getServletContext().getRequestDispatcher("/home.jsp");
PrintWriter out = response.getWriter();
out.println("<font color=red>No vulernabilies found!</font>");
rd.include(request, response);
}
else {
request.setAttribute("report", report);
request.getRequestDispatcher("/test.jsp").forward(request, response);
}
}
}
|
[
"[email protected]"
] | |
be1f066db7ee75d6abb8c54d876c34cd6223d825
|
e0d39cd43501040a4fde74104a0a7471070a12d6
|
/unison/unison-lastmile-sdk/src/main/java/com/tremolosecurity/lastmile/custom/CustomLastMile.java
|
a5e97176808dc4430e001f3c1908a027555c0962
|
[
"Apache-2.0"
] |
permissive
|
etsangsplk/OpenUnison
|
cfc87320673b37e5ba62470dd7cd2f39c1083eb7
|
9e40c5c7bbf821ecb6f24425148adc57d3bd7e17
|
refs/heads/master
| 2022-12-23T01:51:50.798964 | 2020-08-21T00:18:50 | 2020-08-21T00:18:50 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,096 |
java
|
/*
Copyright 2015 Tremolo Security, 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 com.tremolosecurity.lastmile.custom;
import javax.servlet.FilterConfig;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.tremolosecurity.lastmile.LastMile;
public interface CustomLastMile {
public void postValidate(HttpServletRequest request,HttpServletResponse response,LastMile lastMile) throws Exception;
public void afterInit(FilterConfig config) throws ServletException;
}
|
[
"[email protected]"
] | |
1a073945400531b2daaaf99edc7cb471a7c22499
|
ca0e9689023cc9998c7f24b9e0532261fd976e0e
|
/src/com/tencent/mm/ui/c/b.java
|
28e5644f61e01ffc313bd056b8a3bc2b0d386222
|
[] |
no_license
|
honeyflyfish/com.tencent.mm
|
c7e992f51070f6ac5e9c05e9a2babd7b712cf713
|
ce6e605ff98164359a7073ab9a62a3f3101b8c34
|
refs/heads/master
| 2020-03-28T15:42:52.284117 | 2016-07-19T16:33:30 | 2016-07-19T16:33:30 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,474 |
java
|
package com.tencent.mm.ui.c;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import com.tencent.mm.pluginsdk.k.a.a;
import com.tencent.mm.ui.i;
import java.util.ArrayList;
public final class b
extends i
{
public a kAe = null;
private ArrayList kvD = new ArrayList();
public b(Context paramContext)
{
super(paramContext, null);
Gl();
}
public final void Gk()
{
kvD.clear();
if (kAe == null) {
return;
}
c localc = new c(kAe);
kvD.add(localc);
notifyDataSetChanged();
}
protected final void Gl()
{
Gk();
}
public final int getCount()
{
return kvD.size();
}
public final View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
{
c localc = (c)kvD.get(paramInt);
if (paramView == null)
{
paramView = View.inflate(context, 2131361870, null);
paramViewGroup = new d();
kAg = paramView;
kAh = ((Button)paramView.findViewById(2131165527));
paramView.setTag(paramViewGroup);
}
for (;;)
{
if (localc.a(paramViewGroup) != 0) {
paramView = null;
}
return paramView;
paramViewGroup = (d)paramView.getTag();
}
}
public final c qr(int paramInt)
{
return (c)kvD.get(paramInt);
}
}
/* Location:
* Qualified Name: com.tencent.mm.ui.c.b
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"[email protected]"
] | |
91efed4ebcf14809d231fff2b63d14b3eab365b4
|
33cee9020390b8c4be057f5a78e629680b109385
|
/algorithms/src/main/java/LinkedStack.java
|
afb2cba5e376f58587b8cf5d5b859fbe9924f7d4
|
[] |
no_license
|
saraandstuart/algorithms-princeton-part1
|
0ef15652afa5513781c903f3070433c3d813e28c
|
5d0c4e4850a5f42e7a3ab931128ea4fe1d81810b
|
refs/heads/master
| 2021-07-04T19:16:23.361607 | 2019-06-02T09:44:03 | 2019-06-02T09:44:03 | 28,904,452 | 0 | 0 | null | 2020-10-13T13:29:15 | 2015-01-07T07:54:56 |
Java
|
UTF-8
|
Java
| false | false | 5,134 |
java
|
import java.util.Iterator;
import java.util.NoSuchElementException;
import edu.princeton.cs.algs4.StdIn;
import edu.princeton.cs.algs4.StdOut;
/**
* The <tt>LinkedStack</tt> class represents a last-in-first-out (LIFO) stack of
* generic items.
* It supports the usual <em>push</em> and <em>pop</em> operations, along with methods
* for peeking at the top item, testing if the stack is empty, and iterating through
* the items in LIFO order.
* <p>
* This implementation uses a singly-linked list with a non-static nested class for
* linked-list nodes. See {@link Stack} for a version that uses a static nested class.
* The <em>push</em>, <em>pop</em>, <em>peek</em>, <em>size</em>, and <em>is-empty</em>
* operations all take constant time in the worst case.
* <p>
* For additional documentation, see <a href="/algs4/13stacks">Section 1.3</a> of
* <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
*
* @author Robert Sedgewick
* @author Kevin Wayne
*/
public class LinkedStack<Item> implements Iterable<Item> {
private int N; // size of the stack
private Node first; // top of stack
// helper linked list class
private class Node {
private Item item;
private Node next;
}
/**
* Initializes an empty stack.
*/
public LinkedStack() {
first = null;
N = 0;
assert check();
}
/**
* Is this stack empty?
* @return true if this stack is empty; false otherwise
*/
public boolean isEmpty() {
return first == null;
}
/**
* Returns the number of items in the stack.
* @return the number of items in the stack
*/
public int size() {
return N;
}
/**
* Adds the item to this stack.
* @param item the item to add
*/
public void push(Item item) {
Node oldfirst = first;
first = new Node();
first.item = item;
first.next = oldfirst;
N++;
assert check();
}
/**
* Removes and returns the item most recently added to this stack.
* @return the item most recently added
* @throws java.util.NoSuchElementException if this stack is empty
*/
public Item pop() {
if (isEmpty()) throw new NoSuchElementException("Stack underflow");
Item item = first.item; // save item to return
first = first.next; // delete first node
N--;
assert check();
return item; // return the saved item
}
/**
* Returns (but does not remove) the item most recently added to this stack.
* @return the item most recently added to this stack
* @throws java.util.NoSuchElementException if this stack is empty
*/
public Item peek() {
if (isEmpty()) throw new NoSuchElementException("Stack underflow");
return first.item;
}
/**
* Returns a string representation of this stack.
* @return the sequence of items in the stack in LIFO order, separated by spaces
*/
public String toString() {
StringBuilder s = new StringBuilder();
for (Item item : this)
s.append(item + " ");
return s.toString();
}
/**
* Returns an iterator to this stack that iterates through the items in LIFO order.
* @return an iterator to this stack that iterates through the items in LIFO order.
*/
public Iterator<Item> iterator() { return new ListIterator(); }
// an iterator, doesn't implement remove() since it's optional
private class ListIterator implements Iterator<Item> {
private Node current = first;
public boolean hasNext() { return current != null; }
public void remove() { throw new UnsupportedOperationException(); }
public Item next() {
if (!hasNext()) throw new NoSuchElementException();
Item item = current.item;
current = current.next;
return item;
}
}
// check internal invariants
private boolean check() {
if (N == 0) {
if (first != null) return false;
}
else if (N == 1) {
if (first == null) return false;
if (first.next != null) return false;
}
else {
if (first.next == null) return false;
}
// check internal consistency of instance variable N
int numberOfNodes = 0;
for (Node x = first; x != null; x = x.next) {
numberOfNodes++;
}
if (numberOfNodes != N) return false;
return true;
}
/**
* Unit tests the <tt>LinkedStack</tt> data type.
*/
public static void main(String[] args) {
LinkedStack<String> s = new LinkedStack<String>();
while (!StdIn.isEmpty()) {
String item = StdIn.readString();
if (!item.equals("-")) s.push(item);
else if (!s.isEmpty()) StdOut.print(s.pop() + " ");
}
StdOut.println("(" + s.size() + " left on stack)");
}
}
|
[
"[email protected]"
] | |
c4991404bbaaa48b609636b01cfa815df7b28915
|
7b460a0a8f94f76f60a544814b846ee802b2d497
|
/HexGame/src/MoveInterface.java
|
14e9e0db2abddbbc14399f1b0967f3cc144e9afc
|
[] |
no_license
|
yungcheeze/IP
|
bd152b8cda28ee9ee04332eebeb37d1954e5e4b0
|
a3ed4b5c5a8550f13eefa5258eeb8dbff8da76bd
|
refs/heads/master
| 2016-09-13T08:06:34.546645 | 2016-05-02T01:46:14 | 2016-05-02T01:46:14 | 57,232,035 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,290 |
java
|
/**
* Represents a move a player wishes to make
*
* DO NOT CHANGE THIS FILE
*
* @author Stephen McGough
* @version 0.1
*/
public interface MoveInterface
{
/**
* Set the position that the Player wishes to use - both x and y coordinate.
*
* @param x the x coordinate
* @param y the y coordinate
* @return true indicating value set correctly
*
* @throws InvalidPositionException The position is invalid. E.g. both x and y are negative.
*/
public boolean setPosition(int x, int y) throws InvalidPositionException;
/**
* Has the player conceded in this move?
* i.e. have they yielded to the fact that their opponent has won before all required
* moves are made.
*
* @return true if the player has conceded.
*/
public boolean hasConceded();
/**
* Get the x coordinate of the move.
*
* @return the x coordinate.
*/
public int getXPosition();
/**
* Get the y coordnate of the move.
*
* @return the y coordinate.
*/
public int getYPosition();
/**
* Indicate that the player has conceded in this move.
*
* @return true indicating conceded is set.
*/
public boolean setConceded();
}
|
[
"[email protected]"
] | |
f53373a2675541e04034bc92483682d0f4c12fdd
|
35120118a6c5c795ad698afe1576cd580b3a1528
|
/app/Global.java
|
1189473685117877a79be31a7e9581e0a5ce608d
|
[] |
no_license
|
ilkelma/zentasks
|
5e74f9a2e2b10730ae65acf5ee3282a92e5b43fd
|
91d86586ae969607131ffcb276135d30312c653f
|
refs/heads/master
| 2021-01-23T13:58:45.419300 | 2013-03-22T20:06:37 | 2013-03-22T20:06:37 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 325 |
java
|
import play.*;
import play.libs.*;
import com.avaje.ebean.Ebean;
import models.*;
import java.util.*;
public class Global extends GlobalSettings {
@Override
public void onStart(Application app) {
// Check if the DB is empty
if(User.find.findRowCount() == 0) {
Ebean.save((List) Yaml.load("test-data.yml"));
}
}
}
|
[
"[email protected]"
] | |
e60de9a5901864b46719d82f4589b1e71d918a15
|
0ce426afac7f8452125193d855bb3d7fd4c27df7
|
/hardware-server/src/main/java/com/hardware/server/service/charging/constant/MessageFieldConst.java
|
135cfd618ff0d2caf7bae424c253f6049fa0f6a2
|
[] |
no_license
|
lp9937/hardware
|
d3810b5f1a541bbe4112281a401f4771395e4817
|
0413f48d3ee48f638328221d1f31047f45c70ce1
|
refs/heads/master
| 2023-01-31T08:21:13.664921 | 2020-12-17T02:57:58 | 2020-12-17T02:57:58 | 313,794,866 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,741 |
java
|
package com.hardware.server.service.charging.constant;
public final class MessageFieldConst {
/**
* 起始字段的值
*/
public static final int START_FIELD_VALUE=0xAAF5;
/**
* 版本字段的值
*/
public static final byte VERSION_FIELD_VALUE=0x10;
/**
* 起始字段占用字节数
*/
public static final int START_FIELD_LENGTH=2;
/**
* 长度字段占用字节数
*/
public static final int LENGTH_FIELD_LENGTH=2;
/**
* 消息头长度
* 2字节起始字段+2字节长度字段+1字节版本字段+1字节序列号字段+2命令字段
*/
public static final int HEAD_LENGTH =8;
/**
* 校验字段占用字节数
*/
public static final int CHECK_FIELD_LENGTH=1;
/**
* 充电桩编码字段占用字节数
*/
public static final int CODE_FIELD_LENGTH =32;
/**
* 时间字段占用字节数
*/
public static final int DATETIME_FIELD_LENGTH=8;
/**
* 心跳响应消息体占用字节数
* 预留字段1(占2字节)+预留字段2(占2字节)+心跳应答(占2字节)
*/
public static final int HEARTBEAT_RESPONSE_MESSAGE_BODY_LENGTH=6;
/**
* 签到响应消息体占用字节数
* 预留字段1(占2字节)+预留字段2(占2字节)
*/
public static final int SIGN_IN_RESPONSE_MESSAGE_BODY_LENGTH=4;
/**
* 充电/预约卡号字段占用字节数
*/
public static final int CARD_NUMBER_FIELD_LENGTH=32;
/**
* 状态响应消息消息体长度
*/
public static final int STATE_RESPONSE_MESSAGE_BODY_LENGTH=45;
/**
* 开启充电控制命令消息体长度
*/
public static final int START_CHARGING_CONTROL_MESSAGE_BODY_LENGTH=67;
/**
* 开启充电控制命令响应消息体长度
*/
public static final int START_CHARGING_CONTROL_RESPONSE_MESSAGE_BODY_LENGTH=41;
/**
* 控制命令消息体长度,不包含命令参数的长度
*/
public static final int CONTROL_COMMAND_MESSAGE_BODY_LENGTH=12;
/**
* 车辆VIN长度
*/
public static final int VEHICLE_VIN_FILED_LENGTH=17;
/**
* 车牌号字段长度
*/
public static final int LICENSE_PLATE_NUMBER_FILED_LENGTH=8;
/**
* 时段电量字段长度
*/
public static final int PERIOD_ELECTRICITY_FILED_LENGTH=48;
/**
* 电费计价策略命令,定义最大6个时间时段
*/
public static final int ELECTRICITY_PRICE_STRATEGY_UNIT_FILED_LENGTH=6;
/**
* 电费计价策略命令消息体长度
*/
public static final int ELECTRICITY_PRICE_STRATEGY_MESSAGE_BODY_LENGTH=48;
private MessageFieldConst(){
}
}
|
[
"[email protected]"
] | |
eaa3d74c6875b0155e25b2ed925a46a4826332d8
|
741894993028282e8653053c6c9a986586baa9fa
|
/src/main/java/com/example/demo/controller/AccountManager.java
|
4f61bfc5313874fdd6333e405835da795d3aeb08
|
[] |
no_license
|
BlueJack1984/Hello-World
|
56f14e5030eae536cb1161002f7f76ae37618bd5
|
051eaf0e124d69bf34478e6aee7db2b596ca5a75
|
refs/heads/master
| 2021-05-04T14:13:34.813608 | 2018-11-02T13:07:32 | 2018-11-02T13:07:32 | 120,194,269 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 167 |
java
|
package com.example.demo.controller;
public class AccountManager {
public static final String ACCESS_KEY = "";
public static final String SECRET_KEY = "";
}
|
[
"[email protected]"
] | |
43b3c5c22114606238c051defc510c27dae90e35
|
47e6efab737f5dac55fc65b26b644a2d0bb1870c
|
/ObserverPattern_Behavioral/src/com/ezhil/ObserverPatternDemo.java
|
9cc222f8c9928090553f91ea6449f6e9bc80b0de
|
[] |
no_license
|
trainig2020/Ezhilarasi_DesignPatterns
|
1d86006e89f62e3e4a50f4deb1282c3a4aa0fb8d
|
b1cecef2772e2d3ed203b3feb1b77d7e43a476bf
|
refs/heads/master
| 2022-12-24T14:36:55.498141 | 2020-09-24T14:36:30 | 2020-09-24T14:36:30 | 297,668,624 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 440 |
java
|
package com.ezhil;
public class ObserverPatternDemo {
public static void main(String[] args) {
Subject subject = new Subject();
new HexaObserver(subject);
new OctalObserver(subject);
new BinaryObserver(subject);
System.out.println("First state change: 15");
subject.setState(15);
System.out.println("Second state change: 10");
subject.setState(10);
}
}
|
[
"[email protected]"
] | |
9e4105313d435534137af02260c04b603d9cc10a
|
f06239af9a874bc34eff6cd331498f1e23e29a8d
|
/src/main/java/org/oddjob/arooa/design/view/Standards.java
|
c44bee41bc75fbdd903b1d76d059e7d4b1fcb49e
|
[
"Apache-2.0"
] |
permissive
|
robjg/arooa
|
70950665a2d5ecae3134df350832c44b8eb45e02
|
35f56775fc0e98ba3fb0f9c71134bc9c7a6ad584
|
refs/heads/master
| 2023-07-05T10:42:30.565054 | 2023-07-04T06:29:29 | 2023-07-04T06:29:29 | 1,803,585 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,734 |
java
|
/*
* (c) Rob Gordon 2005
*/
package org.oddjob.arooa.design.view;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
/**
*
*/
public class Standards {
// file actions
public static final Integer NEW_EXPLORER_MNEMONIC_KEY = new Integer(KeyEvent.VK_E);
public static final KeyStroke NEW_EXPLORER_ACCELERATOR_KEY = KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK);
public static final Integer NEW_MNEMONIC_KEY = new Integer(KeyEvent.VK_N);
public static final KeyStroke NEW_ACCELERATOR_KEY = KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK);
public static final Integer OPEN_MNEMONIC_KEY = new Integer(KeyEvent.VK_O);
public static final KeyStroke OPEN_ACCELERATOR_KEY = KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK);
public static final Integer CLOSE_MNEMONIC_KEY = new Integer(KeyEvent.VK_C);
public static final KeyStroke CLOSE_ACCELERATOR_KEY = KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.CTRL_MASK);
public static final Integer RELOAD_MNEMONIC_KEY = new Integer(KeyEvent.VK_R);
public static final KeyStroke RELOAD_ACCELERATOR_KEY = KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.CTRL_MASK);
public static final Integer SAVE_MNEMONIC_KEY = new Integer(KeyEvent.VK_S);
public static final KeyStroke SAVE_ACCELERATOR_KEY = KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK);
public static final Integer SAVEAS_MNEMONIC_KEY = new Integer(KeyEvent.VK_A);
public static final KeyStroke SAVEAS_ACCELERATOR_KEY = KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK);
public static final Integer EXIT_MNEMONIC_KEY = new Integer(KeyEvent.VK_X);
}
|
[
"[email protected]"
] | |
2483350e3eff328d75f66f39cd67b8fbe1bd1c09
|
bede819f2f70eae2bb19e3501bacbc3141d9ec10
|
/src/main/java/jake/elkboot/Interceptor/RequestInterceptor.java
|
a6115838529676ea8dec9b83e92838854e60dcd6
|
[] |
no_license
|
XMUTLZY/elk-boot
|
93d3a451c2425c5518961ab2b0e3c1f8b9f1920d
|
728a37367dc73ec8007887127ba3ffcd92532a8c
|
refs/heads/master
| 2022-12-17T15:25:23.547606 | 2020-09-15T07:56:20 | 2020-09-15T07:56:20 | 295,655,487 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 790 |
java
|
package jake.elkboot.Interceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
public class RequestInterceptor extends HandlerInterceptorAdapter {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
logger.info("time:{} 访问:{}", LocalDateTime.now(), ((HandlerMethod) handler).getMethod());
return super.preHandle(request, response, handler);
}
}
|
[
"[email protected]"
] | |
105dc369ef7790f832bcc1f30b197854cc97bb69
|
f474a82411a1b03f59bbf6babc3abbfbfb0581ea
|
/Lesson22/MusicPlayer.java
|
1cd20d27f978ea3e9cadb31652fd98028d389269
|
[] |
no_license
|
chip-dale/myJavaLearning
|
1a72c77bcb69a0d99696b02b8795ab36d83c4348
|
8d748572b282e37a7adb12e028abff11ce4829bb
|
refs/heads/master
| 2023-06-01T03:39:27.810447 | 2021-06-27T21:59:09 | 2021-06-27T21:59:09 | 347,133,349 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 211 |
java
|
public interface MusicPlayer {
Song play();
Song pause();
Song stop();
Song next();
Song previous();
Song[] searchByGenre(Genre genre);
Song[] searchByName(String name);
}
|
[
"[email protected]"
] | |
b84a7d5a33d634e50789f1403aff1e06cfb1645e
|
107e6fa4e58836a6370857c910541d4e83f76ca6
|
/src/main/java/com/cpaas/portal/util/message/properties/MessagePropertiesLoader.java
|
6a03b6bc512209b337b314e5aab8efa385624cc3
|
[] |
no_license
|
ProgramGodsland/messageutil
|
2d04648294db9a6d4c3170aeb2eed44d938cc099
|
2cf2dde5faa3fc4ddbee68881520d2598b4dec8c
|
refs/heads/master
| 2020-04-10T06:00:35.879885 | 2018-12-10T19:17:41 | 2018-12-10T19:17:41 | 160,843,556 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,854 |
java
|
/**
* GENBAND ("GENBAND") CONFIDENTIAL
*
* Copyright (c) 2012-2018 [GENBAND], All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of GENBAND. The
* intellectual and technical concepts contained herein are proprietary to COMPANY and may be
* covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or
* copyright law. Dissemination of this information or reproduction of this material is strictly
* forbidden unless prior written permission is obtained from GENBAND. Access to the source code
* contained herein is hereby forbidden to anyone except current GENBAND employees, managers or
* contractors who have executed
*
* Confidentiality and Non-disclosure agreements explicitly covering such access.
*
* The copyright notice above does not evidence any actual or intended publication or disclosure of
* this source code, which includes information that is confidential and/or proprietary, and is a
* trade secret, of GENBAND. ANY REPRODUCTION, MODIFICATION, DISTRIBUTION, PUBLIC PERFORMANCE, OR
* PUBLIC DISPLAY OF OR THROUGH USE OF THIS SOURCE CODE WITHOUT THE EXPRESS WRITTEN CONSENT OF
* COMPANY IS STRICTLY PROHIBITED, AND IN VIOLATION OF APPLICABLE LAWS AND INTERNATIONAL TREATIES.
* THE RECEIPT OR POSSESSION OF THIS SOURCE CODE AND/OR RELATED INFORMATION DOES NOT CONVEY OR IMPLY
* ANY RIGHTS TO REPRODUCE, DISCLOSE OR DISTRIBUTE ITS CONTENTS, OR TO MANUFACTURE, USE, OR SELL
* ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART.
**/
package com.cpaas.portal.util.message.properties;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/**
* @author irene
*
*/
@Component
public class MessagePropertiesLoader {
private static Logger log = LoggerFactory.getLogger(MessagePropertiesLoader.class);
private MessageProperties msgProp = new MessageProperties();
@PostConstruct
private void init() {
loadRabbitmqServiceName();
loadRabbitmqHost();
loadRabbitmqUsername();
loadRabbitmqPassword();
loadRabbitmqPort();
loadRabbitmqManagementPort();
loadRabbitmqMessageTTL();
loadRabbitmqChannelPoolSize();
}
public MessageProperties getMsgProp() {
return msgProp;
}
private void loadRabbitmqServiceName() {
System.err.println("service name: " + System.getenv("SERVICE_NAME"));
String rabbitmqServiceName =
null == msgProp.getRabbitmqServiceName() ? System.getenv("SERVICE_NAME")
: msgProp.getRabbitmqServiceName();
if (null == rabbitmqServiceName) {
rabbitmqServiceName = new String("kandy-thee");
}
log.info("Rabbitmq service name: " + rabbitmqServiceName);
msgProp.setRabbitmqServiceName(rabbitmqServiceName);
}
private void loadRabbitmqHost() {
String rabbitmqHost = null == msgProp.getRabbitmqHost() ? System.getenv("RABBIT_HOST")
: msgProp.getRabbitmqHost();
if (null == rabbitmqHost) {
rabbitmqHost = new String("172.28.249.154");
}
log.info("Rabbitmq host: " + rabbitmqHost);
msgProp.setRabbitmqHost(rabbitmqHost);
}
private void loadRabbitmqUsername() {
String rabbitmqUsername = null == msgProp.getRabbitUsername() ? System.getenv("RABBIT_USERNAME")
: msgProp.getRabbitUsername();
if (null == rabbitmqUsername) {
rabbitmqUsername = new String("guest");
}
log.info("Rabbitmq username: " + rabbitmqUsername);
msgProp.setRabbitUsername(rabbitmqUsername);
}
private void loadRabbitmqPassword() {
String rabbitmqPasswd = null == msgProp.getRabbitPasswd() ? System.getenv("RABBIT_PASSWD")
: msgProp.getRabbitPasswd();
if (null == rabbitmqPasswd) {
rabbitmqPasswd = new String("guest");
}
log.info("Rabbitmq password: " + rabbitmqPasswd);
msgProp.setRabbitPasswd(rabbitmqPasswd);
}
private void loadRabbitmqPort() {
final String rabbitPort = 0 == msgProp.getRabbitmqPort() ? System.getenv("RABBIT_PORT")
: String.valueOf(msgProp.getRabbitmqPort());
final int rabbitmqPort = null == rabbitPort ? 32158 : Integer.parseInt(rabbitPort);
log.info("Rabbitmq port: " + rabbitmqPort);
msgProp.setRabbitmqPort(rabbitmqPort);
}
private void loadRabbitmqManagementPort() {
final String rabbitmqManagementPort =
0 == msgProp.getRabbitManagementPort() ? System.getenv("RABBIT_MANAGEMENT_PORT")
: String.valueOf(msgProp.getRabbitManagementPort());
final int rabbitManagementPort =
null == rabbitmqManagementPort ? 32160 : Integer.parseInt(rabbitmqManagementPort);
log.info("Rabbitmq management port: " + rabbitmqManagementPort);
msgProp.setRabbitManagementPort(rabbitManagementPort);
}
private void loadRabbitmqMessageTTL() {
final String rabbitTTL =
0 == msgProp.getRabbitmqMessageTTL() ? System.getenv("RABBIT_MESSAGE_TTL")
: String.valueOf(msgProp.getRabbitmqMessageTTL());
final int rabbitmqTTL = null == rabbitTTL ? 60000 : Integer.parseInt(rabbitTTL);
log.info("Rabbitmq message TTL: " + rabbitmqTTL);
msgProp.setRabbitmqMessageTTL(rabbitmqTTL);
}
private void loadRabbitmqChannelPoolSize() {
final String rabbitmqChannelPoolSize =
0 == msgProp.getRabbitmqChannelPoolSize() ? System.getenv("RABBIT_CHANNEL_POOL_SIZE")
: String.valueOf(msgProp.getRabbitmqChannelPoolSize());
final int rabbitChannelPoolSize =
null == rabbitmqChannelPoolSize ? 15 : Integer.parseInt(rabbitmqChannelPoolSize);
log.info("Rabbitmq channel pool size: " + rabbitmqChannelPoolSize);
msgProp.setRabbitmqChannelPoolSize(rabbitChannelPoolSize);
}
}
|
[
"[email protected]"
] | |
cf6715ac3a88dc4da502bf3620a444b0cdb12c93
|
130b9069fc23733940513ad945388a2873394080
|
/src/AeroGUI/test/classes/PriceTest.java
|
3ebc7122f2d1058b9adf8cdaa64e691ec7471756
|
[] |
no_license
|
linze/AeroGUI
|
900a11220f0e8a28a45325f37b393c20eebfd800
|
94bb2773c94f587b0ad75aadc36587bf58f8da32
|
refs/heads/master
| 2021-01-15T18:50:05.748419 | 2011-05-03T19:58:30 | 2011-05-03T19:58:30 | 1,586,475 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,944 |
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package classes;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author notrace
*/
public class PriceTest {
public PriceTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getQuantity method, of class Price.
*/
@Test
public void testGetQuantity() {
System.out.println("getQuantity");
Price instance = new Price();
double expResult = 0.0;
double result = instance.getQuantity();
assertTrue(expResult == instance.getQuantity());
}
/**
* Test of setQuantity method, of class Price.
*/
@Test
public void testSetQuantity() {
System.out.println("setQuantity");
double quantity = 3;
Price instance = new Price();
instance.setQuantity(quantity);
assertTrue(instance.getQuantity() == quantity);
}
/**
* Test of getCurrency method, of class Price.
*/
@Test
public void testGetCurrency() {
System.out.println("getCurrency");
Price instance = new Price();
String expResult = "EUR";
String result = instance.getCurrency();
assertEquals(expResult, result);
}
/**
* Test of setCurrency method, of class Price.
*/
@Test
public void testSetCurrency() {
System.out.println("setCurrency");
String currency = "DOL";
Price instance = new Price();
instance.setCurrency(currency);
assertEquals(instance.getCurrency(), currency);
}
}
|
[
"[email protected]"
] | |
ea5a75b14dae2f47659d1483a818f6cda19a1c33
|
8898bd9c5a635991e89aa4034f2eb1ed42c0f804
|
/java_2/practicaTT/ejercicio2/FiguraGeometrica.java
|
1bc6572e3b04878d0806b0bd8b5a09fb33956b72
|
[] |
no_license
|
manuelvassallo1/it-bootcamp-meli
|
00a4c0ca2fd2627411acfbfc2f092c7ee10e65c3
|
1dddbc70f0859993ef315146686786a844ca6449
|
refs/heads/main
| 2023-07-16T08:52:39.049383 | 2021-08-30T15:01:57 | 2021-08-30T15:01:57 | 394,433,236 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 315 |
java
|
package java_2.practicaTT.ejercicio2;
public abstract class FiguraGeometrica {
private double valorArea;
public double getValorArea() {
return this.valorArea;
}
public void setValorArea(double valorArea) {
this.valorArea = valorArea;
}
public abstract double area();
}
|
[
"[email protected]"
] | |
3c3299e32606432659f255a0a2d869c69af8e7ba
|
5f4c25014425c4ef684012f5b3e6916a082f6770
|
/app/src/main/java/com/zxn/groupedadapterdemo/activity/Grid1Activity.java
|
5f79a5bed35efc2b9d663ee7d9e99e2c29d4d880
|
[
"Apache-2.0"
] |
permissive
|
AsaLynn/GroupedRVAdapter
|
486ef9aa7b238a1473cf680c3b76d4c83a049f1f
|
d8399c49b3e10d96fa6096ef597d259e36d54d40
|
refs/heads/master
| 2023-02-01T18:50:30.254250 | 2020-12-17T11:29:41 | 2020-12-17T11:29:41 | 320,823,240 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,304 |
java
|
package com.zxn.groupedadapterdemo.activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;
import com.zxn.groupedadapter.adapter.GroupedRecyclerViewAdapter;
import com.zxn.groupedadapter.decoration.GroupedGridItemDecoration;
import com.zxn.groupedadapter.holder.BaseViewHolder;
import com.zxn.groupedadapter.layoutmanger.GroupedGridLayoutManager;
import com.zxn.groupedadapterdemo.R;
import com.zxn.groupedadapterdemo.adapter.GroupedListAdapter;
import com.zxn.groupedadapterdemo.decoration.CustomGridItemDecoration;
import com.zxn.groupedadapterdemo.model.GroupModel;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
/**
* 子项为Grid布局的分组列表。给RecyclerView的LayoutManager
* 设置为{@link GroupedGridLayoutManager}即可。
*/
public class Grid1Activity extends AppCompatActivity {
private RecyclerView rvList;
private RecyclerView.ItemDecoration itemDecoration;
private GroupedListAdapter adapter;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_group_list);
rvList = (RecyclerView) findViewById(R.id.rv_list);
adapter = new GroupedListAdapter(this, GroupModel.getGroups(10, 10));
adapter.setOnHeaderClickListener(new GroupedRecyclerViewAdapter.OnHeaderClickListener() {
@Override
public void onHeaderClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder, int groupPosition) {
Toast.makeText(Grid1Activity.this, "组头:groupPosition = " + groupPosition,
Toast.LENGTH_LONG).show();
}
});
adapter.setOnFooterClickListener(new GroupedRecyclerViewAdapter.OnFooterClickListener() {
@Override
public void onFooterClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder, int groupPosition) {
Toast.makeText(Grid1Activity.this, "组尾:groupPosition = " + groupPosition,
Toast.LENGTH_LONG).show();
}
});
adapter.setOnChildClickListener(new GroupedRecyclerViewAdapter.OnChildClickListener() {
@Override
public void onChildClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder,
int groupPosition, int childPosition) {
Toast.makeText(Grid1Activity.this, "子项:groupPosition = " + groupPosition
+ ", childPosition = " + childPosition,
Toast.LENGTH_LONG).show();
}
});
rvList.setAdapter(adapter);
//直接使用GroupedGridLayoutManager实现子项的Grid效果
GroupedGridLayoutManager gridLayoutManager = new GroupedGridLayoutManager(this, 2, adapter);
rvList.setLayoutManager(gridLayoutManager);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.option_ment, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// 移除前面的ItemDecoration
removeItemDecoration();
switch (item.getItemId()) {
case R.id.none:
itemDecoration = null;
return true;
case R.id.space:
// 空白分割线,只需要设置分割线大小,不需要设置样式
itemDecoration = new GroupedGridItemDecoration(adapter, 20, null,
20, null, 20, null, 20, null);
rvList.addItemDecoration(itemDecoration);
return true;
case R.id.ordinary:
// 普通分割线,设置分割线大小和头、尾、子项的分割线样式
itemDecoration = new GroupedGridItemDecoration(adapter,
20, getResources().getDrawable(R.drawable.green_divider),
20, getResources().getDrawable(R.drawable.purple_divider),
20, getResources().getDrawable(R.drawable.pink_divider),
20, getResources().getDrawable(R.drawable.orange_divider));
rvList.addItemDecoration(itemDecoration);
return true;
case R.id.custom:
// 自定义分割线,可以根据需要设置每个item的分割线大小和样式
itemDecoration = new CustomGridItemDecoration(this, adapter);
rvList.addItemDecoration(itemDecoration);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void removeItemDecoration() {
if (itemDecoration != null) {
rvList.removeItemDecoration(itemDecoration);
}
}
public static void openActivity(Context context) {
Intent intent = new Intent(context, Grid1Activity.class);
context.startActivity(intent);
}
}
|
[
"[email protected]"
] | |
e26fd532babbdee16730526da435fc66397e3be1
|
70fa962f1e3d2c43d18d843f31ee8e2e9917d01e
|
/TDAT1005/Øvinger/Øving12/src/dyrehage/Rovdyrfabrikk.java
|
6558aaea22bd58ac081e137e00d9e87ba87cd037
|
[] |
no_license
|
Dereandor/School
|
8854265f0aa0320e16ae07d971ff8eee441ec54a
|
56fd1906d70110963350ffcd251e27c9736d88c7
|
refs/heads/master
| 2022-04-11T18:19:01.789286 | 2020-04-01T11:24:57 | 2020-04-01T11:24:57 | 150,786,511 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 936 |
java
|
package dyrehage;
public class Rovdyrfabrikk {
public SkandinaviskeRovdyr nyBinne(String navn, int ankommetDato, int fDato, String adresse){
return new Hunnindivid("Brunbjoern", "Ursus arctos", "Ursidae", ankommetDato, navn, fDato, true, adresse, 0);
}
public SkandinaviskeRovdyr nyHannbjoern(String navn, int ankommetDato, int fDato, String adresse){
return new Hannindivid("Brunbjoern", "Ursus arctos", "Ursidae", ankommetDato, navn, fDato, true, adresse);
}
public SkandinaviskeRovdyr nyUlvetispe(String navn, int ankommetDato, int fDato, String adresse) {
return new Hunnindivid("Ulv", "Canis lupus", "Canidae", ankommetDato, navn, fDato, true, adresse, 0);
}
public SkandinaviskeRovdyr nyUlvehann(String navn, int ankommetDato, int fDato, String adresse) {
return new Hannindivid("Ulv", "Canis lupus", "Canidae", ankommetDato, navn, fDato, true, adresse);
}
}
|
[
"[email protected]"
] | |
3cec1aee1339b8cd91d16f7bea55ba1297057f66
|
9a26f9597e22ed60ebe5918f7f37ea2ec72e0aa7
|
/app/src/main/java/ir/acharkit/android/demo/fragment/UseFragmentThree.java
|
ddc5e0985b029754d9874b2ea5d47addc9dc4925
|
[
"Apache-2.0"
] |
permissive
|
hamidionline/acharkit-android
|
39c8df680341fdaf636e7ee6e79e07bc04c892dd
|
711994d62e5e9b8015dec625190d6747aa64802e
|
refs/heads/master
| 2020-03-10T20:53:13.916599 | 2018-04-14T14:15:15 | 2018-04-14T14:59:08 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,376 |
java
|
package ir.acharkit.android.demo.fragment;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import ir.acharkit.android.app.AbstractFragment;
import ir.acharkit.android.component.BottomTab;
import ir.acharkit.android.component.DialogView;
import ir.acharkit.android.component.Progress;
import ir.acharkit.android.component.progress.LoadingIndicatorProgress;
import ir.acharkit.android.demo.R;
import ir.acharkit.android.demo.UseFragment;
import ir.acharkit.android.demo.test.TestBottomTab;
/**
* Author: Alireza Tizfahm Fard
* Date: 10/19/2017
* Email: [email protected]
*/
public class UseFragmentThree extends AbstractFragment {
private View layout;
private TextView test_fragment;
private String tags;
private DialogView.Builder builder;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
layout = inflater.inflate(R.layout.fragment_use, container, false);
test_fragment = layout.findViewById(R.id.test_fragment);
test_fragment.setText(getTags());
test_fragment.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new UseFragment().actionFragment(R.id.frameLayout, AbstractFragment.TYPE_REPLACE, true);
}
});
// showDialog();
return layout;
}
private void showDialog() {
final Progress progress = new Progress(getActivity())
.setProgress(new LoadingIndicatorProgress(getActivity()))
.setColor(0xFFFF00FF);
progress.load();
builder = new DialogView.Builder(getActivity());
builder.setBackgroundColor(0xFF232323, 8)
.setFont("OpenSans.ttf", Typeface.NORMAL)
.setTitle("title", 5, 0xFFFFFFFF)
.setMessage("message", 5, 0xFFFFFFFF)
.setProgressbar(progress)
.setButtonsViewOrientation(LinearLayout.VERTICAL)
.addButton("button1", 5, 0xFF0A8A12, 0xFFFFFFFF, onClickListenerOne(), Gravity.CENTER, 8)
.setCancelable(true)
.setCanceledOnTouchOutside(false)
.show();
}
private View.OnClickListener onClickListenerOne() {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
UseFragment fragment = new UseFragment();
fragment.setTags("hello");
((TestBottomTab) getActivity()).presentFragment(fragment, true);
}
};
}
@Override
public void onResume() {
super.onResume();
BottomTab.getBottomTab().setChangeResume(2);
}
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags;
}
}
|
[
"[email protected]"
] | |
047522c853a1b095819301ecc8b1ec049e7dc2bf
|
eea375b3a65de1818f99e2cdf10dc2a76aadf0a3
|
/MaterialTest/app/src/main/java/com/example/yucong/materialtest/MainActivity.java
|
d4ba1ec21070b5e49146c7251664744dc67a759a
|
[] |
no_license
|
yucongy1014551596/projects
|
76c19f037e2256ddfabe778f2d290e34199f5c1f
|
3a0c6d32c4f9c4377cf63235f81991a880ddf11e
|
refs/heads/master
| 2020-04-06T12:43:30.930267 | 2018-12-26T08:57:42 | 2018-12-26T08:57:42 | 157,467,751 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,215 |
java
|
package com.example.yucong.materialtest;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class MainActivity extends AppCompatActivity {
private DrawerLayout drawerLayout;
private SwipeRefreshLayout swipeRefreshLayouts;
private Fruit[] fruits = {new Fruit("Apple", R.drawable.apple), new Fruit("Banana", R.drawable.banana),
new Fruit("Orange", R.drawable.orange), new Fruit("Watermelon", R.drawable.watermelon),
new Fruit("Pear", R.drawable.pear), new Fruit("Grape", R.drawable.grape),
new Fruit("Pineapple", R.drawable.pineapple), new Fruit("Strawberry", R.drawable.strawberry),
new Fruit("Cherry", R.drawable.cherry), new Fruit("Mango", R.drawable.mango)};
private List<Fruit> fruitList = new ArrayList<>();
FruitAdapter fruitAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar= findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
drawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout);
NavigationView navView = (NavigationView) findViewById(R.id.nav_view);
ActionBar actionBar= getSupportActionBar();
if(actionBar!=null){
actionBar.setDisplayHomeAsUpEnabled(true);//让导航按钮显示出来
// actionBar.setHomeAsUpIndicator(R.drawable.ic_menu);//导航按钮图标
}
navView.setCheckedItem(R.id.nav_call); //滑动菜单栏里面的页面展示
navView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(MenuItem item) {
drawerLayout.closeDrawers();
return true;
}
});
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Toast.makeText(MainActivity.this,"Fab click",Toast.LENGTH_LONG).show();
//告诉用户发生了什么 用户可以选择 CoordinatorLayout负责监视本包下所有的控件
Snackbar.make(v,"data delete",Snackbar.LENGTH_SHORT).setAction("undo", new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this,"data restory",Toast.LENGTH_LONG).show();
}
}).show();
}
});
/**
*
*/
initFruits();
RecyclerView recyclerView= (RecyclerView)findViewById(R.id.recycle_view);
GridLayoutManager layoutManager=new GridLayoutManager(this,2);//布局管理器
recyclerView.setLayoutManager(layoutManager);
fruitAdapter= new FruitAdapter(fruitList);
recyclerView.setAdapter(fruitAdapter);
// 下拉刷新
swipeRefreshLayouts= (SwipeRefreshLayout)findViewById(R.id.swipe_fresh);
swipeRefreshLayouts.setColorSchemeResources(R.color.colorPrimary);//设置滚动条颜色
swipeRefreshLayouts.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
refreshsFruits();
}
});
}
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(R.menu.toolbar,menu);
return true;
}
/**
* 对ToolBar上面点击事件的监听
* @param item
* @return
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
drawerLayout.openDrawer(GravityCompat.START);
break;
case R.id.backup:
Toast.makeText(this, "You clicked Backup", Toast.LENGTH_SHORT).show();
break;
case R.id.delete:
Toast.makeText(this, "You clicked Delete", Toast.LENGTH_SHORT).show();
break;
case R.id.settings:
Toast.makeText(this, "You clicked Settings", Toast.LENGTH_SHORT).show();
break;
default:
}
return true;
}
private void initFruits() {
fruitList.clear();
for (int i = 0; i < 50; i++) {
Random random = new Random();
int index = random.nextInt(fruits.length);
fruitList.add(fruits[index]);
}
}
/**
* 刷新事件处理方法
*/
private void refreshsFruits(){
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
/**
* 返回主线程 重新获取数据 通知数据发生变化 刷新事件结束
*/
runOnUiThread(new Runnable() {
@Override
public void run() {
initFruits();
fruitAdapter.notifyDataSetChanged();
swipeRefreshLayouts.setRefreshing(false);
}
});
}
}).start();
}
}
|
[
"[email protected]"
] | |
0b41c7d94123d94cfba9222f672ddf9b5c6ec493
|
98e39db0a5354c037df4f13ba0adcc5a24c46f60
|
/bar3/src/main/java/com/bar3/hibernateDemo/CpuBox.java
|
4cc6bce958e51813fde50453f84bf381ad5d325c
|
[] |
no_license
|
shl556/ThreeFrameworkDemo
|
9edcc19e402c401c7958708a31bf99ddf95b8b21
|
037ecb1d94b3484c4f5121679ea9020c5f953559
|
refs/heads/master
| 2021-01-09T20:43:00.605057 | 2016-06-04T09:00:20 | 2016-06-04T09:00:20 | 60,401,482 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 965 |
java
|
package com.bar3.hibernateDemo;
// Generated 2016-2-7 13:50:38 by Hibernate Tools 4.3.1
/**
* CpuBox generated by hbm2java
*/
public class CpuBox implements java.io.Serializable {
private String type;
private GraphicsCard graphicsCard;
private Vendor vendor;
public CpuBox() {
}
public CpuBox(Vendor vendor) {
this.vendor = vendor;
}
public CpuBox(String type, GraphicsCard graphicsCard, Vendor vendor) {
this.type = type;
this.graphicsCard = graphicsCard;
this.vendor = vendor;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
public GraphicsCard getGraphicsCard() {
return this.graphicsCard;
}
public void setGraphicsCard(GraphicsCard graphicsCard) {
this.graphicsCard = graphicsCard;
}
public Vendor getVendor() {
return this.vendor;
}
public void setVendor(Vendor vendor) {
this.vendor = vendor;
}
}
|
[
"[email protected]"
] | |
38d7a2b50ee83973a398b536b50d8e2e077f0c6c
|
5be066b561651e6e1f540d7daf6d3558f3fa6e96
|
/src/test/java/API_Batch10/StatusCodeValidation.java
|
67cb8aad9ac2fd5e1f1618c34bacc2ab752003ec
|
[] |
no_license
|
avanalitekin/API_Testing
|
1093b1f36b4ee8a1d9a0f99579a4fb7011d713f6
|
90fe183af9fb4b7d91302c529bdc28bbc5048215
|
refs/heads/master
| 2020-06-19T05:07:23.699717 | 2019-07-12T12:21:49 | 2019-07-12T12:21:49 | 196,574,601 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 561 |
java
|
package API_Batch10;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import io.restassured.RestAssured;
public class StatusCodeValidation {
@BeforeClass
public void setUp() {
RestAssured.baseURI = "https://uinames.com/api";
}
@Test
public void testOK() {
RestAssured.given()
.log().all()
.when()
.get()
.then()
.log().all()
.statusCode(200);
}
// @Test
public void notFoundTest() {
RestAssured.given()
.log().all()
.when()
.get("/aflafa;lf")
.then()
.log().all()
.statusCode(404);
}
}
|
[
"[email protected]"
] | |
83896eee12ed908fb64ce85fab5129caea631170
|
e471fb7c7fd5ef15ffa5363f8da5dc3779bd9092
|
/miner/src/PoolClient.java
|
2bf71dfa9edef53c23367d7c8d2e3c8947e9c71a
|
[
"Apache-2.0"
] |
permissive
|
naveenkaratekid/snowblossom
|
771f12ba2aea4a15a1269a3cd9e58fe23dfe23ad
|
292fb38677d76f6af89e3edb6e6636ebe579c688
|
refs/heads/master
| 2020-04-05T22:15:42.855316 | 2018-11-09T16:50:44 | 2018-11-09T16:50:44 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,724 |
java
|
package snowblossom.miner;
import com.google.protobuf.ByteString;
import duckutil.Config;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.stub.StreamObserver;
import snowblossom.lib.*;
import snowblossom.proto.*;
import snowblossom.mining.proto.*;
import snowblossom.mining.proto.MiningPoolServiceGrpc.MiningPoolServiceStub;
import snowblossom.mining.proto.MiningPoolServiceGrpc.MiningPoolServiceBlockingStub;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
import java.text.DecimalFormat;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Random;
import java.util.concurrent.atomic.AtomicLong;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.TreeMap;
import java.util.Queue;
import java.util.Map;
import java.io.File;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.MinMaxPriorityQueue;
import org.junit.Assert;
import io.grpc.Server;
import io.grpc.ServerBuilder;
import snowblossom.client.WalletUtil;
/**
* Maintains connections with a list of pools. Supports pool failover.
*/
public class PoolClient implements PoolClientFace
{
private static final Logger logger = Logger.getLogger("snowblossom.miner");
private volatile WorkUnit last_work_unit;
private MiningPoolServiceStub asyncStub;
protected MiningPoolServiceBlockingStub blockingStub;
private final NetworkParams params;
private Config config;
private PoolClientOperator op;
private String host;
public PoolClient(Config config, PoolClientOperator op) throws Exception
{
this(config.get("pool_host"), config, op);
}
public PoolClient(String host, Config config, PoolClientOperator op) throws Exception
{
this.host = host;
this.config = config;
this.op = op;
params = NetworkParams.loadFromConfig(config);
if ((!config.isSet("mine_to_address")) && (!config.isSet("mine_to_wallet")))
{
throw new RuntimeException("Config must either specify mine_to_address or mine_to_wallet");
}
if ((config.isSet("mine_to_address")) && (config.isSet("mine_to_wallet")))
{
throw new RuntimeException("Config must either specify mine_to_address or mine_to_wallet, not both");
}
}
private ManagedChannel channel;
@Override
public void subscribe() throws Exception
{
if (channel != null)
{
channel.shutdownNow();
channel = null;
}
int port = config.getIntWithDefault("pool_port", 23380);
channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build();
asyncStub = MiningPoolServiceGrpc.newStub(channel);
blockingStub = MiningPoolServiceGrpc.newBlockingStub(channel);
AddressSpecHash to_addr = getMineToAddress();
String address_str = AddressUtil.getAddressString(params.getAddressPrefix(), to_addr);
String client_id = null;
if (config.isSet("mining_client_id"))
{
client_id = config.get("mining_client_id");
}
GetWorkRequest.Builder req = GetWorkRequest.newBuilder();
if (client_id != null) req.setClientId(client_id);
req.setPayToAddress(address_str);
asyncStub.getWork( req.build(), new WorkUnitEater());
logger.info("Subscribed to work");
}
private AddressSpecHash getMineToAddress() throws Exception
{
if (config.isSet("mine_to_address"))
{
String address = config.get("mine_to_address");
AddressSpecHash to_addr = new AddressSpecHash(address, params);
return to_addr;
}
if (config.isSet("mine_to_wallet"))
{
File wallet_path = new File(config.get("mine_to_wallet"));
WalletDatabase wallet = WalletUtil.loadWallet(wallet_path, false, params);
if (wallet.getAddressesCount() == 0)
{
throw new RuntimeException("Wallet has no addresses");
}
LinkedList<AddressSpec> specs = new LinkedList<AddressSpec>();
specs.addAll(wallet.getAddressesList());
Collections.shuffle(specs);
AddressSpec spec = specs.get(0);
AddressSpecHash to_addr = AddressUtil.getHashForSpec(spec);
return to_addr;
}
return null;
}
@Override
public void stop()
{
terminate = true;
}
@Override
public boolean isTerminated()
{
return terminate;
}
private volatile boolean terminate = false;
@Override
public WorkUnit getWorkUnit()
{
WorkUnit wu = last_work_unit;
if (wu == null) return null;
if (wu.getHeader().getTimestamp() + 45000 < System.currentTimeMillis())
{
return null;
}
return wu;
}
public class WorkUnitEater implements StreamObserver<WorkUnit>
{
public void onCompleted() {}
public void onError(Throwable t)
{
logger.info("Error talking to mining pool: " + t);
}
public void onNext(WorkUnit wu)
{
int last_block = -1;
WorkUnit wu_old = last_work_unit;
if (wu_old != null)
{
last_block = wu_old.getHeader().getBlockHeight();
}
last_work_unit = wu;
op.notifyNewWorkUnit(wu);
// If the block number changes, clear the queues
if (last_block != wu.getHeader().getBlockHeight())
{
op.notifyNewBlock(wu.getHeader().getBlockHeight());
}
}
}
@Override
public SubmitReply submitWork(WorkUnit wu, BlockHeader header)
{
WorkSubmitRequest.Builder req = WorkSubmitRequest.newBuilder();
req.setWorkId(wu.getWorkId());
req.setHeader(header);
SubmitReply reply = blockingStub.submitWork( req.build());
return reply;
}
}
|
[
"[email protected]"
] | |
ba7e732c843979f173b01c62c6da5e46832fcd0f
|
b9f1b4a62dcb8dfb2574ea3e7e5d19499923b789
|
/src/main/java/com/lendiko/plangernator/LoanRepaymentPlanGenerator.java
|
5fda0a0b42ffd97946ceab9152906026bffaed84
|
[] |
no_license
|
swathi-ks/plan-generator
|
a550930e84d20dfffcc63b3457f511ec9f3c3431
|
b44147802215e6e9b162e854a733b7c9d5446350
|
refs/heads/master
| 2020-04-24T14:53:15.543799 | 2019-02-22T09:09:45 | 2019-02-22T09:09:45 | 172,042,184 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,957 |
java
|
package com.lendiko.plangernator;
import java.util.LinkedList;
import java.text.ParseException;
import java.util.HashMap;
import java.text.SimpleDateFormat;
import java.util.Map;
import java.util.Scanner;
import java.util.Calendar;
import static com.lendiko.plangernator.LoanRepaymentPlanGeneratorUtils.getDoubleWithTwoPrecisionSet;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.List;
/**
* Plan generator class for loan repayment amount
*
* @author Swathi KS.
* @since 20/02/2019.
*/
public class LoanRepaymentPlanGenerator {
/***
* Calculates the loan repayment amount plan with user input provided
* @param loanAmount
* @param interestRate
* @param durationInMonths
* @param date
* @throws ParseException
* @throws JsonProcessingException
*/
public static void calculateRepaymentAmountPlan(double loanAmount, double interestRate, int durationInMonths, String date) throws ParseException, JsonProcessingException {
List borrowerRePaymentAmountList = new LinkedList<RepaymentAmountItems>();
double monthlyInterest, remainingOutstandingPrincipal, principal;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
Calendar cal = Calendar.getInstance();
sdf.setCalendar(cal);
cal.setTime(sdf.parse(date));
interestRate = interestRate / 100; //Converting % into actual decimal value
double monthlyRate = interestRate / 12;
double initialOutstandingPrincipal = loanAmount;
double borrowerPaymentAmount = (loanAmount * monthlyRate) / (1 - Math.pow(1 + monthlyRate, -durationInMonths));
for (int i = 1; i <= durationInMonths; i++) {
monthlyInterest = ((interestRate * 30 * initialOutstandingPrincipal) / 360);
principal = borrowerPaymentAmount - monthlyInterest;
remainingOutstandingPrincipal = initialOutstandingPrincipal - principal;
borrowerRePaymentAmountList.add(new RepaymentAmountItems(getDoubleWithTwoPrecisionSet(borrowerPaymentAmount), sdf.format(cal.getTime()), getDoubleWithTwoPrecisionSet(initialOutstandingPrincipal), getDoubleWithTwoPrecisionSet(monthlyInterest), getDoubleWithTwoPrecisionSet(principal), remainingOutstandingPrincipal > 0 ? getDoubleWithTwoPrecisionSet(remainingOutstandingPrincipal) : "0"));
initialOutstandingPrincipal = remainingOutstandingPrincipal;
cal.add(Calendar.MONTH, 1);
}
System.out.println("\nResponse : " + "\n" + LoanRepaymentPlanGeneratorUtils.getLoanItemsAsJson(borrowerRePaymentAmountList));
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Map payloadMap = new HashMap<String,Object>();
System.out.print("Please enter below details for loan repayment plan calculation\n");
System.out.print("Total loan principal amount : ");
double loanAmount = scanner.nextDouble();
payloadMap.put("loanAmount", String.valueOf(loanAmount));
System.out.print("Nominal interest rate : ");
double interestRate = scanner.nextDouble();
payloadMap.put("nominalRate", getDoubleWithTwoPrecisionSet(interestRate));
System.out.print("Duration(Number of instalments in months) : ");
int durationInMonths = scanner.nextInt();
payloadMap.put("duration", durationInMonths);
System.out.print("Date of Disbursement/Payout : ");
String date = scanner.next();
payloadMap.put("startDate", date);
try {
System.out.println("\nPayload : " + "\n" + LoanRepaymentPlanGeneratorUtils.getLoanItemsAsJson(payloadMap));
calculateRepaymentAmountPlan(loanAmount, interestRate, durationInMonths, date);
} catch (ParseException | JsonProcessingException e) {
System.err.print("Error while calculating the loan repayment amount plan");
}
}
}
|
[
"[email protected]"
] | |
841ea430ed0dcb47e98c670b05ac95c086d7089b
|
dd7571c5fdcdbd35a1eda71480b96ce6d6385955
|
/Connor_Cederholm/Hand-Ins/Discord/Feb 7/public class FebSevenPrac{
|
a3be01526479667ccebecd6224cc5875e30c30b7
|
[] |
no_license
|
FRCStudents/AP2017
|
231cc8ebd7f1313bc834cbb82dea502efaf31c53
|
7ef3f661dae397ae2e00c3fe880d0afcdf5688a8
|
refs/heads/master
| 2021-01-20T01:27:59.386535 | 2018-04-04T21:03:21 | 2018-04-04T21:03:21 | 89,280,515 | 6 | 3 | null | 2017-09-06T13:03:06 | 2017-04-24T19:44:05 |
Java
|
UTF-8
|
Java
| false | false | 30 |
public class FebSevenPrac{
}
|
[
"[email protected]"
] | ||
efea11a55c36e69e73a9d5837665a3a560283c82
|
06b0a0ffb4418e66c0852135fe214d22a89c0140
|
/bigdata-flink/src/main/java/ylqdh/bigdata/flink/test/SinkToMysql.java
|
f2e7bbb567cd0c4a448f32b24325213007200f16
|
[] |
no_license
|
1shi123de1/bigdata-flink
|
5751e36fc10a17b4d4c9925fef33fb7316e7f1c9
|
ef93139093e54ffe15581a40a2e41f58f113102f
|
refs/heads/master
| 2022-06-22T22:21:33.728523 | 2020-05-25T06:31:55 | 2020-05-25T06:31:55 | 232,254,751 | 0 | 0 | null | 2022-06-21T02:35:44 | 2020-01-07T06:06:15 |
Java
|
UTF-8
|
Java
| false | false | 1,998 |
java
|
package ylqdh.bigdata.flink.test;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.functions.sink.RichSinkFunction;
import org.apache.flink.streaming.api.functions.sink.SinkFunction;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* @ClassName SinkToMysql
* @Description TODO
* @Author ylqdh
* @Date 2020/2/24 14:58
*/
public class SinkToMysql extends RichSinkFunction<StudentPOJO> {
Connection connection = null;
PreparedStatement pstmt = null;
private Connection getConnection() {
Connection conn = null;
try {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://172.16.1.46:3306/test";
conn = DriverManager.getConnection(url,"root","123456");
} catch (SQLException e) {
e.printStackTrace();
}catch (ClassNotFoundException ce) {
ce.printStackTrace();
}
return conn;
}
/*
在open 方法中建立connection
*/
@Override
public void open(Configuration parameters) throws Exception {
connection = getConnection();
String sql = "insert into flink_student(id,name,age) value (?,?,?)";
pstmt = connection.prepareStatement(sql);
System.out.println("open");
}
/*
每条记录插入时调用一次
*/
@Override
public void invoke(StudentPOJO value, Context context) throws Exception {
System.out.println("invoke~~~~~~~");
pstmt.setInt(1,value.getId());
pstmt.setString(2,value.getName());
pstmt.setInt(3,value.getAge());
pstmt.execute();
}
/*
在close方法中释放资源
*/
@Override
public void close() throws Exception {
if (pstmt != null) {
pstmt.close();
}
if (connection != null) {
connection.close();
}
}
}
|
[
"[email protected]"
] | |
e35b15ebe3644f1b8189bd678600668201292c7e
|
ee3db8c34dc91d6e8add03d603b3de412de96f5a
|
/viz/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/attrdialog/WatchStatusDlg.java
|
a46de3438f8246e83ab26d2a495817f179a3129b
|
[] |
no_license
|
Unidata/awips2-ncep
|
a9aa3a26d83e901cbfaac75416ce586fc56b77d7
|
0abdb2cf11fcc3b9daf482f282c0491484ea312c
|
refs/heads/unidata_18.2.1
| 2023-07-24T03:53:47.775210 | 2022-07-12T14:56:56 | 2022-07-12T14:56:56 | 34,419,331 | 2 | 5 | null | 2023-03-06T22:22:27 | 2015-04-22T22:26:52 |
Java
|
UTF-8
|
Java
| false | false | 14,914 |
java
|
/*
* gov.noaa.nws.ncep.ui.pgen.attrDialog.WatchStatusDlg
*
* 20 January 2010
*
* This code has been developed by the NCEP/SIB for use in the AWIPS2 system.
*/
package gov.noaa.nws.ncep.ui.pgen.attrdialog;
import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import java.util.TimeZone;
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
import gov.noaa.nws.ncep.ui.pgen.elements.Line;
import gov.noaa.nws.ncep.ui.pgen.elements.WatchBox;
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
import gov.noaa.nws.ncep.ui.pgen.elements.DECollection;
import gov.noaa.nws.ncep.ui.pgen.tools.PgenToolUtils;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.geotools.referencing.GeodeticCalculator;
import org.geotools.referencing.datum.DefaultEllipsoid;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Implementation of a watch status dialog.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 03/10 #159 B. Yin Initial Creation.
* 12/13 TTR 800 B. Yin Use UTC time class.
*
* </pre>
*
* @author B. Yin
*/
public class WatchStatusDlg extends CaveJFACEDialog{
//minutes to round issue time
private static final int ITIME_RND = 5;
//instance of the Watch element working on
private WatchBox wb;
//top level container of all widgets
private Composite top;
//Watch number
private Text watchNumber;
//discussion reference number
private Button refBtn;
private Text refTxt;
//Status Message Dialog
private WatchStatusMsgDlg statusMsgDlg;
//Direction combo
private Combo dirCombo;
private static String dir[] = { "RIGHT", "LEFT", "NORTH", "SOUTH", "EAST", "WEST",
"NORTHEAST", "SOUTHEAST", "NORTHWEST", "SOUTHWEST",
"NORTH AND EAST", "SOUTH AND EAST", "NORTH AND WEST", "SOUTH AND WEST" };
//valid date and time
private DateTime validDate;
private UTCTimeText validTime;
//expiration check box and date/time widgets
private Button expBtn;
private DateTime expDate;
private UTCTimeText expTime;
private Text lnTxt;
//forecaster name
private Text forecaster;
//issue time
private Calendar issueTime;
/**
* Protected constructor
* @param parentShell
*/
protected WatchStatusDlg(Shell parentShell, WatchBox wb ) {
super(parentShell);
this.wb = wb;
}
/**
* Creates the dialog area
*/
@Override
public Control createDialogArea(Composite parent) {
//top level container
top = (Composite) super.createDialogArea(parent);
// set title
this.getShell().setText("Watch Status");
// Create the main layout for the shell.
GridLayout mainLayout = new GridLayout(1, false);
mainLayout.marginHeight = 3;
mainLayout.marginWidth = 3;
mainLayout.verticalSpacing = 3;
top.setLayout(mainLayout);
Composite wnComp = new Composite(top, SWT.NONE);
wnComp.setLayout(new GridLayout(4, false));
//Create watch number
Label wnLbl = new Label(wnComp, SWT.LEFT);
wnLbl.setText("Watch:");
watchNumber = new Text(wnComp, SWT.SINGLE | SWT.RIGHT | SWT.BORDER );
watchNumber.addVerifyListener(new VerifyListener(){
@Override
public void verifyText(VerifyEvent e) {
e.doit = PgenUtil.validatePositiveInteger(e);
if ( ! e.doit ) Display.getCurrent().beep();
}
});
//Create FromLine
if ( wb != null && wb.hasStatusLine() ) {
Label dirLbl = new Label(wnComp, SWT.LEFT);
dirLbl.setText("Continues To The");
dirCombo = new Combo( wnComp, SWT.DROP_DOWN | SWT.READ_ONLY );
for ( String str : dir ) {
dirCombo.add( str );
}
dirCombo.select( 0 );
Composite lnComp = new Composite(top, SWT.NONE);
lnComp.setLayout(new GridLayout(2, false));
Label lnLbl = new Label(lnComp, SWT.LEFT);
lnLbl.setText("Of The Line");
lnTxt = new Text(lnComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
lnTxt.setLayoutData(new GridData(350,20));
}
else {
Label dirLbl = new Label(wnComp, SWT.LEFT);
dirLbl.setText("Continues Across Entire Area");
}
AttrDlg.addSeparator(top);
//create reference discussion number
Composite refComp = new Composite(top, SWT.NONE);
refComp.setLayout(new GridLayout(2, false));
refBtn = new Button( refComp, SWT.CHECK);
refBtn.setText("Reference Mesoscale Discussion#:");
refTxt = new Text(refComp, SWT.SINGLE | SWT.RIGHT | SWT.BORDER );
refTxt.addVerifyListener(new VerifyListener(){
@Override
public void verifyText(VerifyEvent e) {
e.doit = PgenUtil.validatePositiveInteger(e);
if ( ! e.doit ) Display.getCurrent().beep();
}
});
//Expiration date/time
Composite expDt = new Composite(top, SWT.NONE);
expDt.setLayout( new GridLayout(3, false) );
expBtn = new Button( expDt, SWT.CHECK);
expBtn.setText("Final Status - Expiration Time:");
expDate = new DateTime(expDt, SWT.BORDER | SWT.DATE );
//expTime = new DateTime(expDt, SWT.BORDER | SWT.TIME | SWT.SHORT );
expTime = new UTCTimeText(expDt, SWT.SINGLE | SWT.BORDER | SWT.CENTER);
//FormData fd2 = new FormData();
//fd2.top = new FormAttachment(refComp, 2, SWT.BOTTOM);
//fd2.left = new FormAttachment(expDate, 5, SWT.RIGHT);
//expTime.setLayoutData(fd2);
expTime.setUTCTimeTextField(expDt, Calendar.getInstance(), null, 5, false);
//Valid date/time
Label validLbl = new Label( expDt, SWT.NONE);
validLbl.setText("Status Valid Until:");
validDate = new DateTime(expDt, SWT.BORDER | SWT.DATE );
validTime = new UTCTimeText(expDt, SWT.BORDER | SWT.TIME | SWT.SHORT );
validTime.setUTCTimeTextField(expDt, Calendar.getInstance(), null, 5, false);
//forecaster
Composite fcstComp = new Composite(top, SWT.NONE);
fcstComp.setLayout( new GridLayout(2, false) );
Label fcstLbl = new Label( fcstComp, SWT.NONE);
fcstLbl.setText("Forecaster:");
forecaster = new Text(fcstComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
forecaster.setLayoutData( new GridData( 150, 15 ) );
AttrDlg.addSeparator(top);
return top;
}
@Override
/**
* Set the location of the dialog and initialize the widgets
*/
public int open(){
if ( this.getShell() == null ){
this.create();
}
// this.getShell().setLocation(this.getShell().getParent().getLocation());
this.getButton(IDialogConstants.OK_ID).setText("Format");
if ( wb.getIssueFlag() != 0 )
initDlg();
return super.open();
}
/**
* Initialize the dialog (set values of watch number, etc.)
*/
private void initDlg(){
watchNumber.setText(String.valueOf(wb.getWatchNumber()));
if ( lnTxt != null ) lnTxt.setText(generateFromLine());
if ( wb.getStatusForecaster() != null ){
forecaster.setText(wb.getStatusForecaster());
}
else {
forecaster.setText(wb.getForecaster());
}
Calendar exp = wb.getExpTime();
if ( exp != null ){
expDate.setDate(exp.get(Calendar.YEAR), exp.get(Calendar.MONTH), exp.get(Calendar.DAY_OF_MONTH));
expTime.setTime(exp.get(Calendar.HOUR_OF_DAY), exp.get(Calendar.MINUTE));
}
Calendar valid = this.generateIssueAndValidTime();
validDate.setDate(valid.get(Calendar.YEAR), valid.get(Calendar.MONTH), valid.get(Calendar.DAY_OF_MONTH));
validTime.setTime(valid.get(Calendar.HOUR_OF_DAY), valid.get(Calendar.MINUTE));
}
/**
* Loop through all status lines and construct the from line text
* @return - FromLine text
*/
private String generateFromLine(){
String ln = "";
//get the Watch collection and look for status lines
AbstractDrawableComponent adc = wb.getParent();
if ( adc instanceof DECollection && adc.getName().equalsIgnoreCase("Watch")){
Iterator<AbstractDrawableComponent> it = ((DECollection)adc).getComponentIterator();
//get anchor point list
List<Station> anchors = PgenStaticDataProvider.getProvider().getAnchorTbl().getStationList();
//loop through status lines and construct from lines.
while ( it.hasNext() ){
AbstractDrawableComponent elem = it.next();
if ( elem instanceof Line && elem.getPgenType().equalsIgnoreCase("POINTED_ARROW")){
//add "AND" for additional lines
if ( !ln.isEmpty() ) ln += " AND ";
for(Coordinate pt : elem.getPoints()){
Station st = WatchBox.getNearestAnchorPt(pt, anchors);
GeodeticCalculator gc = new GeodeticCalculator(DefaultEllipsoid.WGS84);
gc.setStartingGeographicPoint(st.getLongitude(), st.getLatitude() );
gc.setDestinationGeographicPoint(pt.x, pt.y );
long dist = Math.round( gc.getOrthodromicDistance()/PgenUtil.SM2M);
long dir = Math.round(gc.getAzimuth());
if ( dir < 0 ) dir += 360;
ln += dist + " " + WatchBox.dirs[(int)Math.round(dir/22.5)]+ " " + st.getStid()+ " TO ";
}
//remove the last " TO "
if (ln.length() >= 4 ) ln = ln.substring(0, ln.length() - 4 );
}
}
}
return ln;
}
/**
* Get the watch number from the dialog
* @return - watch number
*/
public int getWatchNumber(){
if ( watchNumber.getText() == null ){
return 0;
}
else {
return Integer.valueOf(watchNumber.getText());
}
}
/**
* Get the discussion reference number
* @return - reference number
*/
public int getDiscussionNumber(){
if ( refTxt.getText() == null || refTxt.getText().isEmpty()){
return 0;
}
else {
return Integer.valueOf(refTxt.getText());
}
}
/**
* Get the working watch element
* @return - watch box element
*/
public WatchBox getWatchBox(){
return wb;
}
/**
* Get expiration time
* @return - Calendar expiration time
*/
private Calendar getExpirationTime(){
if ( expBtn.getSelection() ){
Calendar expiration = Calendar.getInstance( TimeZone.getTimeZone("GMT") );
expiration.set(expDate.getYear(), expDate.getMonth(), expDate.getDay(),
expTime.getHours(), expTime.getMinutes(), 0);
expiration.set(Calendar.MILLISECOND, 0);
return expiration;
}
else {
return getValidTime();
}
}
/**
* Get expiration time from dialog
* @return
*/
private Calendar getValidTime(){
Calendar expiration = Calendar.getInstance( TimeZone.getTimeZone("GMT") );
expiration.set(validDate.getYear(), validDate.getMonth(), validDate.getDay(),
validTime.getHours(), validTime.getMinutes(), 0);
expiration.set(Calendar.MILLISECOND, 0);
return expiration;
}
/*
*
* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
*/
@Override
protected void okPressed() {
//apply values from the dialog to watch box element
applyOnWB();
//open status message window
statusMsgDlg = new WatchStatusMsgDlg(this.getParentShell(), this );
statusMsgDlg.setBlockOnOpen(false);
statusMsgDlg.setMessage(generateStatusMsg());
statusMsgDlg.open();
}
/**
* Apply values from the dialog to the watch box element
*/
public void applyOnWB(){
wb.setWatchNumber(getWatchNumber());
int dNum = 0;
if ( refBtn.getSelection() ){
dNum = getDiscussionNumber();
}
Calendar eTime = null;
if ( expBtn.getSelection() ){
eTime = getExpirationTime();
}
wb.setIssueTime( issueTime );
wb.addStatus(getContinueText(), dNum, getValidTime(), eTime, forecaster.getText());
}
/**
* Generate watch status message
* @return - status message
*/
private String generateStatusMsg(){
String msg ="";
Calendar exp;
if ( expBtn.getSelection() ){
exp = this.getExpirationTime();
}
else {
exp = this.getValidTime();
}
msg += "WOUS20 KWNS " + String.format("%1$td%1$tH%1$tM", issueTime) +"\n" +
"WWASPC" + "\n" +
"SPC WW-A " + String.format("%1$td%1$tH%1$tM\n", exp) +"\n";
String stateLine = "";
for ( String st : wb.getStates() ){
stateLine += st + "Z000-";
}
stateLine += String.format("%1$td%1$tH%1$tM", exp) + "-" + "\n";
msg += stateLine + "\n" +
"STATUS REPORT ON WW " + getWatchNumber() + "\n\n" +
PgenToolUtils.wrapWatchText("THE SEVERE WEATHER THREAT " + getContinueText(), 65) + "\n\n";
if ( expBtn.getSelection() ){
msg += "WW " + wb.getWatchNumber() +" WILL BE ALLOWED TO EXPIRE AT " +
String.format("%1$td%1$tH%1$tM", exp) + "Z." + "\n\n";
}
if ( refBtn.getSelection() ){
msg += "FOR ADDITIONAL INFORMATION SEE MESOSCALE DISCUSSION " +
String.format("%1$04d", this.getDiscussionNumber()) +"\n\n" +
".." + forecaster.getText().toUpperCase() + ".." +
String.format("%1$tm/%1$td/%1$ty", exp) +
"\n\n";
}
msg += "ATTN...WFO...";
for ( String wfo : wb.getWFOs() ){
msg += wfo + "...";
}
msg += "\n\n&&\n\n" + "STATUS REPORT FOR WT " + wb.getWatchNumber() +"\n\n";
msg += "SEVERE WEATHER THREAT CONTINUES FOR THE FOLLOWING AREAS\n\n";
for ( String state : wb.getStates()){
msg += wb.createCountyInfo(state, exp);
msg += "$$\n\n\n";
}
msg += "THE WATCH STATUS MESSAGE IS FOR GUIDANCE PURPOSES ONLY. PLEASE\n" +
"REFER TO WATCH COUNTY NOTIFICATION STATEMENTS FOR OFFICIAL\n" +
"INFORMATION ON COUNTIES...INDEPENDENT CITIES AND MARINE ZONES\n" +
"CLEARED FROM SEVERE THUNDERSTORM AND TORNADO WATCHES.\n" +
"$$\n";
return msg;
}
/**
* Construct the "Continues ..." text for the watch status message
* @return - String "continues..." text
*/
private String getContinueText(){
String fromLn = "";
if ( lnTxt != null ){
fromLn ="CONTINUES TO THE " + dirCombo.getText() + " OF THE LINE " +
lnTxt.getText();
}
else {
fromLn ="CONTINUES ACROSS ENTIRE AREA";
}
return fromLn;
}
private Calendar generateIssueAndValidTime(){
//get current time
Calendar currTime = Calendar.getInstance( TimeZone.getTimeZone("GMT") );
issueTime = (Calendar) currTime.clone();
int min = currTime.get(Calendar.MINUTE);
if ( min != 0 ){
int remainder = min % ITIME_RND;
int plusmin = ITIME_RND - remainder;
issueTime.add(Calendar.MINUTE, plusmin);
}
Calendar validTime = (Calendar) issueTime.clone();
validTime.add(Calendar.MINUTE, 60 - issueTime.get(Calendar.MINUTE) + 40);
return validTime;
}
}
|
[
"[email protected]"
] | |
91c23ca935877b316ce12782d93d172a89d365dc
|
614c0eee45a87076b5824add2fce908f79fcbeda
|
/plugin/src/main/java/hudson/plugins/findbugs/FindBugsMavenResult.java
|
d8383afa2fd9a3f7f88e31115658bbfe5f6bb5f7
|
[
"MIT"
] |
permissive
|
davidparsson/findbugs-plugin
|
b1a4f9d38d70af1cd3126babdbcd4d997cfe16d3
|
615ee32e895fc132ecbdf55ed19f7ccb0d3257c3
|
refs/heads/master
| 2020-04-05T23:47:13.151146 | 2012-09-10T15:41:04 | 2012-09-10T15:41:04 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,339 |
java
|
package hudson.plugins.findbugs;
import hudson.model.AbstractBuild;
import hudson.plugins.analysis.core.ParserResult;
import hudson.plugins.analysis.core.ResultAction;
import hudson.plugins.analysis.core.BuildResult;
/**
* Represents the aggregated results of the FindBugs analysis in m2 jobs.
*
* @author Ulli Hafner
* @deprecated not used anymore
*/
@Deprecated
public class FindBugsMavenResult extends FindBugsResult {
private static final long serialVersionUID = -4913938782537266259L;
/**
* Creates a new instance of {@link FindBugsMavenResult}.
*
* @param build
* the current build as owner of this action
* @param defaultEncoding
* the default encoding to be used when reading and parsing files
* @param result
* the parsed result with all annotations
*/
@SuppressWarnings("deprecation")
public FindBugsMavenResult(final AbstractBuild<?, ?> build, final String defaultEncoding,
final ParserResult result) {
super(build, defaultEncoding, result, MavenFindBugsResultAction.class);
}
/** {@inheritDoc} */
@SuppressWarnings("deprecation")
@Override
protected Class<? extends ResultAction<? extends BuildResult>> getResultActionType() {
return MavenFindBugsResultAction.class;
}
}
|
[
"[email protected]"
] | |
6b5f7b1dba63f56bd80bfd7f6b5b57113a1a96b7
|
98856b1121b5bf414a043c3804fade1569217ba4
|
/src/main/java/com/myprojects/gza/myGymApp/component/Redirection.java
|
d9fe88c0fd90bba53aa67f58c914cc05be96f15a
|
[] |
no_license
|
gzacharski/System-Obslugi-Silowni
|
8fd1fac648c97fb8cdfce3b392031a9ab7b682a3
|
1e79aff1811131a72291314fecbbac2e74b22f50
|
refs/heads/master
| 2022-12-17T23:59:26.226231 | 2020-09-21T21:19:54 | 2020-09-21T21:19:54 | 297,261,506 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,463 |
java
|
package com.myprojects.gza.myGymApp.component;
import java.util.Collection;
import java.util.logging.Logger;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Component;
@Component
public class Redirection {
private Logger logger=Logger.getLogger(this.getClass().getName());
public String getHomePageByUserRole(Collection<? extends GrantedAuthority> authorities) {
int priority=5;
for(GrantedAuthority grantedAuthority: authorities) {
logger.info(grantedAuthority.toString());
if(grantedAuthority.getAuthority().equals("ROLE_ADMIN")) {
priority=Math.min(1, priority);
}else if(grantedAuthority.getAuthority().equals("ROLE_MANAGER")) {
priority=Math.min(2, priority);
}else if(grantedAuthority.getAuthority().equals("ROLE_TRAINER")) {
priority=Math.min(3, priority);
}else if(grantedAuthority.getAuthority().equals("ROLE_EMPLOYEE")) {
priority=Math.min(4, priority);
}else if(grantedAuthority.getAuthority().equals("ROLE_CLIENT")) {
priority=Math.min(5, priority);
}
}
String redirectUrl=null;
switch (priority) {
case 1:
redirectUrl="/user/admin/main";
break;
case 2:
redirectUrl="/user/manager/main";
break;
case 3:
redirectUrl="/user/trainer/main";
break;
case 4:
redirectUrl="/user/employee/main";
break;
default:
redirectUrl="/user/client/main";
break;
}
return redirectUrl;
}
}
|
[
"[email protected]"
] | |
a8e78488e8d859d2800491b9a40a8150a58f9d9a
|
41898abc4b9e37589ddaff8b64b581e072fc097f
|
/services/vpc/src/main/java/com/huaweicloud/sdk/vpc/v2/VpcAsyncClient.java
|
90f6a8a2ead4ae64b429b26e62e4c41372cd215d
|
[
"Apache-2.0"
] |
permissive
|
jierui001/huaweicloud-sdk-java-v3
|
55f5ee27973bf38cef2b80d19e6d31547c506e3f
|
a14a19255d2890784a4e9cea05076d2d76ac3ebd
|
refs/heads/master
| 2022-12-27T04:54:25.594241 | 2020-09-30T02:49:42 | 2020-09-30T02:49:42 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 16,617 |
java
|
package com.huaweicloud.sdk.vpc.v2;
import com.huaweicloud.sdk.core.HcClient;
import com.huaweicloud.sdk.core.ClientBuilder;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import com.huaweicloud.sdk.vpc.v2.model.*;
public class VpcAsyncClient {
protected HcClient hcClient;
public VpcAsyncClient(HcClient hcClient) {
this.hcClient = hcClient;
}
public static ClientBuilder<VpcAsyncClient> newBuilder() {
return new ClientBuilder<>(VpcAsyncClient::new);
}
/**
* 接受对等连接请求
* 租户A名下的VPC申请和租户B的VPC建立对等连接,需要等待租户B接受该请求。此接口用于租户接受其他租户发起的对等连接请求。
*
* @param AcceptVpcPeeringRequest 请求对象
* @return CompletableFuture<AcceptVpcPeeringResponse>
*/
public CompletableFuture<AcceptVpcPeeringResponse> acceptVpcPeeringAsync(AcceptVpcPeeringRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.acceptVpcPeering);
}
/**
* 创建端口
* 创建端口。
*
* @param CreatePortRequest 请求对象
* @return CompletableFuture<CreatePortResponse>
*/
public CompletableFuture<CreatePortResponse> createPortAsync(CreatePortRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.createPort);
}
/**
* 创建安全组
* 创建安全组。
*
* @param CreateSecurityGroupRequest 请求对象
* @return CompletableFuture<CreateSecurityGroupResponse>
*/
public CompletableFuture<CreateSecurityGroupResponse> createSecurityGroupAsync(CreateSecurityGroupRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.createSecurityGroup);
}
/**
* 创建安全组规则
* 创建安全组规则。
*
* @param CreateSecurityGroupRuleRequest 请求对象
* @return CompletableFuture<CreateSecurityGroupRuleResponse>
*/
public CompletableFuture<CreateSecurityGroupRuleResponse> createSecurityGroupRuleAsync(CreateSecurityGroupRuleRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.createSecurityGroupRule);
}
/**
* 创建子网
* 创建子网。
*
* @param CreateSubnetRequest 请求对象
* @return CompletableFuture<CreateSubnetResponse>
*/
public CompletableFuture<CreateSubnetResponse> createSubnetAsync(CreateSubnetRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.createSubnet);
}
/**
* 创建对等连接
* 创建对等连接。
*
* @param CreateVpcPeeringRequest 请求对象
* @return CompletableFuture<CreateVpcPeeringResponse>
*/
public CompletableFuture<CreateVpcPeeringResponse> createVpcPeeringAsync(CreateVpcPeeringRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.createVpcPeering);
}
/**
* 删除端口
* 删除端口。
*
* @param DeletePortRequest 请求对象
* @return CompletableFuture<DeletePortResponse>
*/
public CompletableFuture<DeletePortResponse> deletePortAsync(DeletePortRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.deletePort);
}
/**
* 删除安全组
* 删除安全组。
*
* @param DeleteSecurityGroupRequest 请求对象
* @return CompletableFuture<DeleteSecurityGroupResponse>
*/
public CompletableFuture<DeleteSecurityGroupResponse> deleteSecurityGroupAsync(DeleteSecurityGroupRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.deleteSecurityGroup);
}
/**
* 删除安全组规则
* 删除安全组规则。
*
* @param DeleteSecurityGroupRuleRequest 请求对象
* @return CompletableFuture<DeleteSecurityGroupRuleResponse>
*/
public CompletableFuture<DeleteSecurityGroupRuleResponse> deleteSecurityGroupRuleAsync(DeleteSecurityGroupRuleRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.deleteSecurityGroupRule);
}
/**
* 删除子网
* 删除子网
*
* @param DeleteSubnetRequest 请求对象
* @return CompletableFuture<DeleteSubnetResponse>
*/
public CompletableFuture<DeleteSubnetResponse> deleteSubnetAsync(DeleteSubnetRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.deleteSubnet);
}
/**
* 删除对等连接
* 删除对等连接。 可以在在本端或对端任何一端删除对等连接。
*
* @param DeleteVpcPeeringRequest 请求对象
* @return CompletableFuture<DeleteVpcPeeringResponse>
*/
public CompletableFuture<DeleteVpcPeeringResponse> deleteVpcPeeringAsync(DeleteVpcPeeringRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.deleteVpcPeering);
}
/**
* 查询端口列表
* 查询提交请求的租户的所有端口,单次查询最多返回2000条数据。
*
* @param ListPortsRequest 请求对象
* @return CompletableFuture<ListPortsResponse>
*/
public CompletableFuture<ListPortsResponse> listPortsAsync(ListPortsRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.listPorts);
}
/**
* 查询安全组规则列表
* 查询安全组规则列表。
*
* @param ListSecurityGroupRulesRequest 请求对象
* @return CompletableFuture<ListSecurityGroupRulesResponse>
*/
public CompletableFuture<ListSecurityGroupRulesResponse> listSecurityGroupRulesAsync(ListSecurityGroupRulesRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.listSecurityGroupRules);
}
/**
* 查询安全组列表
* 查询安全组列表
*
* @param ListSecurityGroupsRequest 请求对象
* @return CompletableFuture<ListSecurityGroupsResponse>
*/
public CompletableFuture<ListSecurityGroupsResponse> listSecurityGroupsAsync(ListSecurityGroupsRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.listSecurityGroups);
}
/**
* 查询子网列表
* 查询子网列表
*
* @param ListSubnetsRequest 请求对象
* @return CompletableFuture<ListSubnetsResponse>
*/
public CompletableFuture<ListSubnetsResponse> listSubnetsAsync(ListSubnetsRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.listSubnets);
}
/**
* 查询对等连接列表
* 查询提交请求的租户的所有对等连接。根据过滤条件进行过滤。
*
* @param ListVpcPeeringsRequest 请求对象
* @return CompletableFuture<ListVpcPeeringsResponse>
*/
public CompletableFuture<ListVpcPeeringsResponse> listVpcPeeringsAsync(ListVpcPeeringsRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.listVpcPeerings);
}
/**
* 拒绝对等连接请求
* 租户A名下的VPC申请和租户B的VPC建立对等连接,需要等待租户B接受该请求。此接口用于租户拒绝其他租户发起的对等连接请求。
*
* @param RejectVpcPeeringRequest 请求对象
* @return CompletableFuture<RejectVpcPeeringResponse>
*/
public CompletableFuture<RejectVpcPeeringResponse> rejectVpcPeeringAsync(RejectVpcPeeringRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.rejectVpcPeering);
}
/**
* 查询端口
* 查询单个端口详情。
*
* @param ShowPortRequest 请求对象
* @return CompletableFuture<ShowPortResponse>
*/
public CompletableFuture<ShowPortResponse> showPortAsync(ShowPortRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showPort);
}
/**
* 查询配额
* 查询单租户在VPC服务下的网络资源配额,包括vpc配额、子网配额、安全组配额、安全组规则配额、弹性公网IP配额,vpn配额等。
*
* @param ShowQuotaRequest 请求对象
* @return CompletableFuture<ShowQuotaResponse>
*/
public CompletableFuture<ShowQuotaResponse> showQuotaAsync(ShowQuotaRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showQuota);
}
/**
* 查询安全组
* 查询单个安全组详情。
*
* @param ShowSecurityGroupRequest 请求对象
* @return CompletableFuture<ShowSecurityGroupResponse>
*/
public CompletableFuture<ShowSecurityGroupResponse> showSecurityGroupAsync(ShowSecurityGroupRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showSecurityGroup);
}
/**
* 查询安全组规则
* 查询单个安全组规则详情
*
* @param ShowSecurityGroupRuleRequest 请求对象
* @return CompletableFuture<ShowSecurityGroupRuleResponse>
*/
public CompletableFuture<ShowSecurityGroupRuleResponse> showSecurityGroupRuleAsync(ShowSecurityGroupRuleRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showSecurityGroupRule);
}
/**
* 查询子网
* 查询子网详情。
*
* @param ShowSubnetRequest 请求对象
* @return CompletableFuture<ShowSubnetResponse>
*/
public CompletableFuture<ShowSubnetResponse> showSubnetAsync(ShowSubnetRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showSubnet);
}
/**
* 查询对等连接
* 查询对等连接详情。
*
* @param ShowVpcPeeringRequest 请求对象
* @return CompletableFuture<ShowVpcPeeringResponse>
*/
public CompletableFuture<ShowVpcPeeringResponse> showVpcPeeringAsync(ShowVpcPeeringRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showVpcPeering);
}
/**
* 更新端口
* 更新端口。
*
* @param UpdatePortRequest 请求对象
* @return CompletableFuture<UpdatePortResponse>
*/
public CompletableFuture<UpdatePortResponse> updatePortAsync(UpdatePortRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.updatePort);
}
/**
* 更新子网
* 更新子网。
*
* @param UpdateSubnetRequest 请求对象
* @return CompletableFuture<UpdateSubnetResponse>
*/
public CompletableFuture<UpdateSubnetResponse> updateSubnetAsync(UpdateSubnetRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.updateSubnet);
}
/**
* 更新对等连接
* 更新对等连接。
*
* @param UpdateVpcPeeringRequest 请求对象
* @return CompletableFuture<UpdateVpcPeeringResponse>
*/
public CompletableFuture<UpdateVpcPeeringResponse> updateVpcPeeringAsync(UpdateVpcPeeringRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.updateVpcPeering);
}
/**
* 申请私有IP
* 申请私有IP。
*
* @param CreatePrivateipRequest 请求对象
* @return CompletableFuture<CreatePrivateipResponse>
*/
public CompletableFuture<CreatePrivateipResponse> createPrivateipAsync(CreatePrivateipRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.createPrivateip);
}
/**
* 删除私有IP
* 删除私有IP。
*
* @param DeletePrivateipRequest 请求对象
* @return CompletableFuture<DeletePrivateipResponse>
*/
public CompletableFuture<DeletePrivateipResponse> deletePrivateipAsync(DeletePrivateipRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.deletePrivateip);
}
/**
* 查询私有IP列表
* 查询指定子网下的私有IP列表。
*
* @param ListPrivateipsRequest 请求对象
* @return CompletableFuture<ListPrivateipsResponse>
*/
public CompletableFuture<ListPrivateipsResponse> listPrivateipsAsync(ListPrivateipsRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.listPrivateips);
}
/**
* 查询网络IP使用情况
* 显示一个指定网络中的IPv4地址使用情况。 包括此网络中的IP总数以及已用IP总数,以及网络下每一个子网的IP地址总数和可用IP地址总数。 > 须知 - 系统预留地址指的是子网的第1个以及最后4个地址,一般用于网关、DHCP等服务。 - 这里以及下文描述的IP地址总数、已用IP地址总数不包含系统预留地址。 - 在分配IP时,用户可以指定系统预留的IP地址。但是不论IP是如何分配的,只要是处于系统预留IP地址段的IP均不会被统计到已用IP地址数目和IP地址总数中。
*
* @param ShowNetworkIpAvailabilitiesRequest 请求对象
* @return CompletableFuture<ShowNetworkIpAvailabilitiesResponse>
*/
public CompletableFuture<ShowNetworkIpAvailabilitiesResponse> showNetworkIpAvailabilitiesAsync(ShowNetworkIpAvailabilitiesRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showNetworkIpAvailabilities);
}
/**
* 查询私有IP
* 指定ID查询私有IP。
*
* @param ShowPrivateipRequest 请求对象
* @return CompletableFuture<ShowPrivateipResponse>
*/
public CompletableFuture<ShowPrivateipResponse> showPrivateipAsync(ShowPrivateipRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showPrivateip);
}
/**
* 创建VPC
* 创建虚拟私有云。
*
* @param CreateVpcRequest 请求对象
* @return CompletableFuture<CreateVpcResponse>
*/
public CompletableFuture<CreateVpcResponse> createVpcAsync(CreateVpcRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.createVpc);
}
/**
* 创建VPC路由
* 创建路由
*
* @param CreateVpcRouteRequest 请求对象
* @return CompletableFuture<CreateVpcRouteResponse>
*/
public CompletableFuture<CreateVpcRouteResponse> createVpcRouteAsync(CreateVpcRouteRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.createVpcRoute);
}
/**
* 删除VPC
* 删除虚拟私有云。
*
* @param DeleteVpcRequest 请求对象
* @return CompletableFuture<DeleteVpcResponse>
*/
public CompletableFuture<DeleteVpcResponse> deleteVpcAsync(DeleteVpcRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.deleteVpc);
}
/**
* 删除VPC路由
* 删除路由
*
* @param DeleteVpcRouteRequest 请求对象
* @return CompletableFuture<DeleteVpcRouteResponse>
*/
public CompletableFuture<DeleteVpcRouteResponse> deleteVpcRouteAsync(DeleteVpcRouteRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.deleteVpcRoute);
}
/**
* 查询VPC路由列表
* 查询提交请求的租户的所有路由列表,并根据过滤条件进行过滤。
*
* @param ListVpcRoutesRequest 请求对象
* @return CompletableFuture<ListVpcRoutesResponse>
*/
public CompletableFuture<ListVpcRoutesResponse> listVpcRoutesAsync(ListVpcRoutesRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.listVpcRoutes);
}
/**
* 查询VPC列表
* 查询虚拟私有云列表。
*
* @param ListVpcsRequest 请求对象
* @return CompletableFuture<ListVpcsResponse>
*/
public CompletableFuture<ListVpcsResponse> listVpcsAsync(ListVpcsRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.listVpcs);
}
/**
* 查询VPC
* 查询虚拟私有云。
*
* @param ShowVpcRequest 请求对象
* @return CompletableFuture<ShowVpcResponse>
*/
public CompletableFuture<ShowVpcResponse> showVpcAsync(ShowVpcRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showVpc);
}
/**
* 查询VPC路由
* 查询路由详情
*
* @param ShowVpcRouteRequest 请求对象
* @return CompletableFuture<ShowVpcRouteResponse>
*/
public CompletableFuture<ShowVpcRouteResponse> showVpcRouteAsync(ShowVpcRouteRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.showVpcRoute);
}
/**
* 更新VPC
* 更新虚拟私有云。
*
* @param UpdateVpcRequest 请求对象
* @return CompletableFuture<UpdateVpcResponse>
*/
public CompletableFuture<UpdateVpcResponse> updateVpcAsync(UpdateVpcRequest request) {
return hcClient.asyncInvokeHttp(request, VpcMeta.updateVpc);
}
}
|
[
"[email protected]"
] | |
9b87d8d891c6c53bb115bab81d49c52d72b3593e
|
a2430097767fb99664bea844b78c067d9322b8a4
|
/Swarm/gov/usgs/swarm/heli/HelicorderViewPanelListener.java
|
779bebc1cc8e2377a426e4d2c8bfade8dbc27b26
|
[] |
no_license
|
sorenoid/swarm-hypo
|
40a5fa39d4d80892c3d1267cabcefbc3d723232b
|
d93bd03d4c2a002870a15361233dc72fc65c9f7e
|
refs/heads/master
| 2021-01-19T07:58:35.565495 | 2017-04-07T22:02:04 | 2017-04-07T22:02:04 | 87,589,477 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 330 |
java
|
package gov.usgs.swarm.heli;
import java.util.EventListener;
/**
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2006/06/14 19:19:31 dcervelli
* Major 1.3.4 changes.
*
* @author Dan Cervelli
*/
public interface HelicorderViewPanelListener extends EventListener
{
public void insetCreated(double st, double et);
}
|
[
"[email protected]"
] | |
c0a55e4fa96804902a59366367d88a9cf870f36a
|
6df4cce39b712f8d81707b5572428a41c7e576bf
|
/src/com/javarush/test/level18/lesson05/task05/Solution.java
|
2e9dea1bed8febc405309c6333606c45bc73b056
|
[] |
no_license
|
gorbunovVladimir/JavaRushHomeWork
|
4a2dede78809bad2e381ba2a371e2669e10ac774
|
d41e14521aacc054114fe2a5e8cda37d8faa14d1
|
refs/heads/master
| 2021-01-10T10:47:39.461898 | 2016-04-05T15:48:38 | 2016-04-05T15:48:38 | 51,866,099 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,355 |
java
|
package com.javarush.test.level18.lesson05.task05;
/* DownloadException
1 Считывать с консоли имена файлов.
2 Если файл меньше 1000 байт, то:
2.1 Закрыть все потоки ввода-вывода
2.2 выбросить исключение DownloadException
*/
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws DownloadException, IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
/*FileInputStream fileInputStream = new FileInputStream(reader.readLine());
if (fileInputStream.available()<1000)
{ reader.close();fileInputStream.close();
throw new DownloadException();}*/
String inFile = reader.readLine();
while (!inFile.equals(""))
{
FileInputStream in = new FileInputStream(inFile);
if (in.available() < 1000)
{
in.close();
throw new DownloadException();
} else
{
in.close();
inFile = reader.readLine();
}
}
}
public static class DownloadException extends Exception{
}
}
|
[
"[email protected]"
] | |
10c794aa8cfcc0c5833b3d703e9afc821766bb8e
|
b987feda5fadf218d2c018d82f42632779ee56fe
|
/ansuru-ams-web/src/main/java/com/ansuru/ams/web/security/dto/request/RequestWebLogin.java
|
1627959e3c6ddbc87d7b36eba349465b5559fc5f
|
[] |
no_license
|
abcde10156/ansuru-ams
|
305e4d670a6fcb9cd68f2fa95fab1ee8e1369f62
|
e987d3aa480622f4218125b2853f7dfbdaf33634
|
refs/heads/master
| 2023-01-11T04:00:21.842194 | 2019-09-17T05:56:35 | 2019-09-17T05:56:35 | 207,078,107 | 0 | 0 | null | 2022-12-10T02:46:42 | 2019-09-08T07:36:46 |
Java
|
UTF-8
|
Java
| false | false | 647 |
java
|
package com.ansuru.ams.web.security.dto.request;
import com.ansuru.ams.common.dto.Request;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
public class RequestWebLogin extends Request {
@Length(max=6, min=3, message = "请输入3到6位数字")
public String username;
public String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
|
[
"[email protected]"
] | |
44ef9d25248b8dafeb92c1fbc06f75b839c4d33f
|
c2df730583c4a071f38e684161554b52d9eb5385
|
/src/main/java/com/waytous/cloud/biz/config/LoggingAspectConfiguration.java
|
a5ebaa71a112509cc19bc8f5bed8cf06756ef268
|
[] |
no_license
|
50centsl/cloud-biz-application
|
8eba7f2aaa86edd1ac65d712256e59c5a3171682
|
4817aa55700f0765a55dd683026759b87799babb
|
refs/heads/main
| 2023-09-03T20:22:41.645251 | 2021-10-08T10:10:25 | 2021-10-08T10:10:25 | 414,937,630 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 497 |
java
|
package com.waytous.cloud.biz.config;
import com.waytous.cloud.biz.aop.logging.LoggingAspect;
import org.springframework.context.annotation.*;
import org.springframework.core.env.Environment;
import tech.jhipster.config.JHipsterConstants;
@Configuration
@EnableAspectJAutoProxy
public class LoggingAspectConfiguration {
@Bean
@Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)
public LoggingAspect loggingAspect(Environment env) {
return new LoggingAspect(env);
}
}
|
[
"[email protected]"
] | |
0cbb0d297051617a92009b8ed0cd8fab0019e451
|
b45673f501ca7c891c8109a714cdf01cde455430
|
/AOOP/src/lab05_CommandPattern/CommandButton.java
|
a04f5047abe7f512265064670810b4fd77f18489
|
[] |
no_license
|
kmdngmn/DesignPattern
|
1e9afed125d412727b2a85470fcd7e5b2380ffda
|
03bcf957eb10022d6c525d80eb1d0e2bebb5c660
|
refs/heads/master
| 2020-11-25T20:09:59.117899 | 2019-12-23T02:24:50 | 2019-12-23T02:24:50 | 228,822,817 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 485 |
java
|
package lab05_CommandPattern;
import java.awt.Dimension;
import java.awt.event.ActionListener;
import javax.swing.JButton;
public class CommandButton extends JButton {
public void createButton(String title, ActionListener listener, int width, int height) {
setText(title);
addActionListener(listener);
Dimension buttonDimension = new Dimension(width, height);
setMaximumSize(buttonDimension);
setMinimumSize(buttonDimension);
setPreferredSize(buttonDimension);
}
}
|
[
"[email protected]"
] | |
d05ee80e3e01e0643eb37e656280fa0fac32e9f2
|
bdd0aa718680ea26f007727db07e829b1b516a3f
|
/petshop/src/com/Login/Login.java
|
ddb1f0495c2e6ed72a13852bcbfec2574dbb67e3
|
[] |
no_license
|
Heavy9428/Stuff
|
67cec77ae72ffb8e02ee91aa00a98f6e730b485a
|
5d83923614000a4b28132a60019bb619197be427
|
refs/heads/master
| 2020-03-26T07:42:40.360394 | 2018-10-15T22:36:17 | 2018-10-15T22:36:17 | 143,023,882 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,282 |
java
|
package com.Login;
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 javax.swing.JOptionPane;
/**
* Servlet implementation class Login
*/
@WebServlet("/Login")
public class Login extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Login() {
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
doGet(request, response);
/**
* Will try to connect to the User class and
* will request the name and password parameter from the
* Login.jsp file and then calls UserDoa to verify if
* they are able to login or not
*/
try {
User user = new User();
user.setUser(request.getParameter("name"));
user.setPassword(request.getParameter("password"));
user = UserDoa.login(user);
/**
* Checks to see if the User flag is set to true if so
* it sets the user attribute and redirects the user
* to the Loggedin screen if it is not
* valid they are told it is incorrect and redirected to
* the login screen
*/
if(user.isValid()) {
HttpSession session = request.getSession(true);
session.setAttribute("currentSessionUser",user);
response.sendRedirect("Loggedin.jsp");
}
else {
JOptionPane.showMessageDialog(null, "Incorrect Username or Password");
response.sendRedirect("Login.jsp");
}
}
catch(Exception e) {
e.printStackTrace();
}
}
}
|
[
"[email protected]"
] | |
d6ce7e7bc9b0d918c2a86bc97e229d43a44ca3c0
|
274593bf1b6fd5d913a1df1a769c205867ef7185
|
/java-frontend/src/main/java/frontend/Frontend.java
|
399902926890346fee1e6050ca37682a5185435b
|
[] |
no_license
|
chanseokoh/skaffold-jib-demo
|
c292a0e2f37019292b35148b3cc6d6d191320229
|
2b53c1309969c9466a2b52152abad611be2303a1
|
refs/heads/master
| 2020-04-09T06:44:35.382153 | 2018-12-26T17:24:44 | 2018-12-26T17:24:44 | 160,125,269 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 836 |
java
|
package frontend;
import static spark.Spark.get;
import static spark.Spark.port;
import static spark.Spark.staticFiles;
import java.util.Locale;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
public class Frontend {
public static void main(String[] args) {
port(8080);
staticFiles.location("/static");
get(
"/nodejs",
(req, res) -> {
System.out.println("Accessing /nodejs");
HttpResponse<String> name = Unirest.get("http://nodejs-backend").asString();
return name.getBody();
});
get(
"/groovy",
(req, res) -> {
System.out.println("Accessing /groovy");
HttpResponse<String> name = Unirest.get("http://groovy-backend").asString();
return name.getBody();
});
}
}
|
[
"[email protected]"
] | |
e235d3c528dfa173532d3b360ca89af98d00e33f
|
c4b89e7b3e3f14bb68e5e1db90eed049b8eacb5a
|
/main/src/mockit/internal/annotations/ClassStubbing.java
|
79f202302e4bf3ccf80bbbd25d24132501bf8960
|
[
"MIT"
] |
permissive
|
borisbrodski/jmockit
|
b5063e150c25f0382979bd1b1db70cea971242d3
|
0634f8fdc9d82bef59d351815b206468adab525c
|
refs/heads/master
| 2023-07-11T16:33:00.474048 | 2013-01-21T11:28:51 | 2013-01-21T11:28:51 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,748 |
java
|
/*
* Copyright (c) 2006-2012 Rogério Liesenfeld
* This file is subject to the terms of the MIT license (see LICENSE.txt).
*/
package mockit.internal.annotations;
import mockit.external.asm4.*;
import mockit.internal.*;
import mockit.internal.filtering.*;
import mockit.internal.startup.*;
import mockit.internal.state.*;
public final class ClassStubbing
{
private final Class<?> realClass;
private final MockingConfiguration stubbingConfiguration;
public ClassStubbing(Class<?> realClass)
{
this.realClass = realClass;
stubbingConfiguration = null;
}
public ClassStubbing(Class<?> realClass, boolean filtersNotInverted, String... filters)
{
this.realClass = realClass;
stubbingConfiguration = filters.length == 0 ? null : new MockingConfiguration(filters, filtersNotInverted);
}
public void stubOut()
{
byte[] modifiedClassFile = stubOutClass();
String classDesc = Type.getInternalName(realClass);
TestRun.mockFixture().addRedefinedClass(classDesc, realClass, modifiedClassFile);
}
private byte[] stubOutClass()
{
if (realClass.isInterface() || realClass.isArray()) {
throw new IllegalArgumentException("Not a modifiable class: " + realClass.getName());
}
ClassReader rcReader = ClassFile.createReaderFromLastRedefinitionIfAny(realClass);
ClassVisitor rcWriter = new StubOutModifier(rcReader, stubbingConfiguration);
rcReader.accept(rcWriter, 0);
byte[] modifiedClassFile = rcWriter.toByteArray();
Startup.redefineMethods(realClass, modifiedClassFile);
return modifiedClassFile;
}
public void stubOutAtStartup() { stubOutClass(); }
}
|
[
"[email protected]@4d38ed0c-b8d3-11de-a71d-8f2b2e058ad8"
] |
[email protected]@4d38ed0c-b8d3-11de-a71d-8f2b2e058ad8
|
d530a1ce12e2b62c7ff1ecadbfa7e242c2a1a0df
|
d9ebdfc1d654a5e9c0c175b90c519d05ca0e93ab
|
/src/main/java/bai1/Author.java
|
83ac1ad3343a4f9361fef3fea4a80ec80f27126f
|
[] |
no_license
|
CodeLean-VN/demo-java2
|
bbd2f658e24d6c1844b85f075c082d0ae7596cc0
|
837e0794680c82f06bd1c21ef18ab0a9524ca9d7
|
refs/heads/master
| 2022-08-02T15:32:49.012195 | 2020-06-01T02:12:24 | 2020-06-01T02:12:24 | 267,732,920 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 798 |
java
|
package bai1;
public class Author {
private String name;
private String email;
private boolean gender;
public Author() {
}
public Author(String name, String email, boolean gender) {
this.name = name;
this.email = email;
this.gender = gender;
}
public String getEmail() {
return email;
}
public String getName() {
return name;
}
public void setEmail(String email) {
this.email = email;
}
public void setGender(boolean gender) {
this.gender = gender;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return super.toString(); //To change body of generated methods, choose Tools | Templates.
}
}
|
[
"[email protected]"
] | |
0d71cbb1bd977b8a8e4c04bd6f691419be6a1cac
|
4e8d52f594b89fa356e8278265b5c17f22db1210
|
/WebServiceArtifacts/CI_CI_PERSONAL_DATA/com/oracle/xmlns/enterprise/tools/schemas/m475145/PROPGVTPREVAGCYEMPLTypeShape.java
|
c58f46da870968c94cc49fa0501b1c3907295009
|
[] |
no_license
|
ouniali/WSantipatterns
|
dc2e5b653d943199872ea0e34bcc3be6ed74c82e
|
d406c67efd0baa95990d5ee6a6a9d48ef93c7d32
|
refs/heads/master
| 2021-01-10T05:22:19.631231 | 2015-05-26T06:27:52 | 2015-05-26T06:27:52 | 36,153,404 | 1 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,385 |
java
|
package com.oracle.xmlns.enterprise.tools.schemas.m475145;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
* <p>Java class for PROP_GVT_PREV_AGCY_EMPLTypeShape complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="PROP_GVT_PREV_AGCY_EMPLTypeShape">
* <simpleContent>
* <extension base="<http://xmlns.oracle.com/Enterprise/Tools/schemas/M475145.V1>PROP_GVT_PREV_AGCY_EMPLTypeDef">
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PROP_GVT_PREV_AGCY_EMPLTypeShape", propOrder = {
"value"
})
public class PROPGVTPREVAGCYEMPLTypeShape {
@XmlValue
protected String value;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
}
|
[
"[email protected]"
] | |
06fb9555b559a32f999d479d7235b895f6e7c6c8
|
54e0c69df09c66ad508beafb6c79b2695045c40b
|
/src/main/java/kr/co/davizn/controller/IndexController.java
|
09333403383403e8cd1782470a147e3ea0b0acef
|
[] |
no_license
|
DaviznDeveloper/hyelim3
|
646b2c02f8a2a1d31037ccb4595c1a51470b1b4c
|
2458c4237ec75c0d33c65f5e17cdf748b8840f2a
|
refs/heads/master
| 2021-01-01T03:47:52.137746 | 2016-05-19T10:00:09 | 2016-05-19T10:00:09 | 59,191,779 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 368 |
java
|
package kr.co.davizn.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class IndexController {
@RequestMapping("index.dvn")
public String index(){
//이전
//return "index.jsp";
//Tiles 적용
return "home.index"; //return view (UrlBase)
}
}
|
[
"[email protected]"
] | |
f92fd82934eaacb0a356841c84ec80aef73844ef
|
03438fc719a7e73b8e3c3099dad45909f61eb48a
|
/src/com/java/lab4/bai4/Main.java
|
89af8471c9e96800c992a47fe81226e1d5aa4f9b
|
[] |
no_license
|
hoangnghiem205/java-programing
|
fe526556731a88ab08f038364f93f1b5d01dd931
|
5836a6949d3da863a22638491d827b487aa403c0
|
refs/heads/master
| 2021-08-23T10:20:44.809958 | 2017-11-12T07:02:12 | 2017-11-12T07:02:12 | 103,109,249 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 644 |
java
|
package com.java.lab4.bai4;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Nhap vao chuoi bat ky:");
String str = input.nextLine();
//Loại bỏ khoảng trắng thừa ở đầu và cuối
str = str.trim();
//chia nhỏ chuỗi thành mảng các từ phần tách nhau bởi dấu cách
String[] tokens = str.split(" ");
System.out.println("So tu: " + tokens.length);
for (String tok : tokens) {
System.out.println(" - " + tok);
}
}
}
|
[
"[email protected]"
] | |
e43da0c6ad756a6718d625db059f2dc272352777
|
72c779e393da9cd262ee14c7c4a8098caf6473e1
|
/src/datos/Employee.java
|
aaf6edfbfd36c125a91a572fe05944d1af8f241c
|
[] |
no_license
|
josep09/MyRep
|
93d78fb2d84933111d6a24831aedb678317f7890
|
49f176370f38d1bd397e973f89e7f5374ad82ce0
|
refs/heads/master
| 2021-01-19T02:38:09.196021 | 2016-07-29T15:55:07 | 2016-07-29T15:55:07 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 705 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package datos;
import java.util.Date;
/**
*
* @author Labing
*/
public abstract class Employee extends Person {
protected Date HiringDate;
public Employee(Date HiringDate, String id, String name) {
super(id, name);
this.HiringDate = HiringDate;
}
public Date getHiringDate() {
return HiringDate;
}
public void setHiringDate(Date HiringDate) {
this.HiringDate = HiringDate;
}
public abstract float paySalary();
}
|
[
"Labing@Labing-PC"
] |
Labing@Labing-PC
|
ce348b38161a50777a5c0c078e23db497f96c6a9
|
48bc25f3617e233099e29ab8ebbc6354d8c0e490
|
/app/src/main/java/com/vrublack/pocketpicasso/MainActivity.java
|
8f10895c85c98e5c86ce9c656555de709392d442
|
[] |
no_license
|
vrublack/PocketPicassoAndroid
|
4693d3d36d289e9c4f0f892f076eac2546760ac6
|
ba81785d97948e2d2671800c758cfffbde74bc48
|
refs/heads/master
| 2021-01-13T16:30:32.648005 | 2017-01-21T21:04:21 | 2017-01-21T21:04:21 | 79,398,548 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,189 |
java
|
package com.vrublack.pocketpicasso;
import android.Manifest;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.Switch;
import com.google.firebase.iid.FirebaseInstanceId;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class MainActivity extends AppCompatActivity
{
private static final int REQUEST_CAMERA = 0;
private static final int SELECT_FILE = 1;
private String userChoosenTask;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
{
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 0);
}
startService(new Intent(this, StyleService.class));
Button uploadLatest = (Button) findViewById(R.id.upload_latest);
uploadLatest.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
final String cameraFolder = Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera";
File latest = Util.getLatestFilefromDir(cameraFolder);
ServerHandler sh = new ServerHandler(MainActivity.this);
sh.uploadImage(latest);
}
});
Button chooseImage = (Button) findViewById(R.id.choose_image);
chooseImage.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
selectImage();
}
});
Switch autoUpload = (Switch) findViewById(R.id.auto_upload);
autoUpload.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
Util.setPref(MainActivity.this, "auto-upload", isChecked);
}
});
}
private void selectImage()
{
final CharSequence[] items = {"Take Photo", "Choose from Library"};
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("Add Photo");
builder.setItems(items, new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int item)
{
boolean result = checkPermission(MainActivity.this);
if (items[item].equals("Take Photo"))
{
userChoosenTask = "Take Photo";
if (result)
cameraIntent();
} else if (items[item].equals("Choose from Library"))
{
userChoosenTask = "Choose from Library";
if (result)
galleryIntent();
}
}
});
builder.show();
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static boolean checkPermission(final Context context)
{
int currentAPIVersion = Build.VERSION.SDK_INT;
if (currentAPIVersion >= android.os.Build.VERSION_CODES.M)
{
if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)
{
if (ActivityCompat.shouldShowRequestPermissionRationale((Activity) context, Manifest.permission.READ_EXTERNAL_STORAGE))
{
android.support.v7.app.AlertDialog.Builder alertBuilder = new android.support.v7.app.AlertDialog.Builder(context);
alertBuilder.setCancelable(true);
alertBuilder.setTitle("Permission necessary");
alertBuilder.setMessage("External storage permission is necessary");
alertBuilder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener()
{
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void onClick(DialogInterface dialog, int which)
{
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
}
});
android.support.v7.app.AlertDialog alert = alertBuilder.create();
alert.show();
} else
{
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
}
return false;
} else
{
return true;
}
} else
{
return true;
}
}
private void galleryIntent()
{
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);//
startActivityForResult(Intent.createChooser(intent, "Select File"), SELECT_FILE);
}
private void cameraIntent()
{
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, REQUEST_CAMERA);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK)
{
File f = null;
if (requestCode == SELECT_FILE)
f = onSelectFromGalleryResult(data);
else if (requestCode == REQUEST_CAMERA)
f = onCaptureImageResult(data);
if (f != null)
{
ServerHandler sh = new ServerHandler(MainActivity.this);
sh.uploadImage(f);
} else
{
Debug.d("f is null");
}
}
}
private File onCaptureImageResult(Intent data)
{
Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
return writeToFile(thumbnail);
}
@SuppressWarnings("deprecation")
private File onSelectFromGalleryResult(Intent data)
{
Bitmap bm = null;
if (data != null)
{
try
{
bm = MediaStore.Images.Media.getBitmap(getApplicationContext().getContentResolver(), data.getData());
return writeToFile(bm);
} catch (IOException e)
{
e.printStackTrace();
}
}
return null;
}
private static File writeToFile(Bitmap bmp)
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.JPEG, 90, bytes);
File destination = new File(Environment.getExternalStorageDirectory(),
System.currentTimeMillis() + ".jpg");
FileOutputStream fo;
try
{
destination.createNewFile();
fo = new FileOutputStream(destination);
fo.write(bytes.toByteArray());
fo.close();
} catch (FileNotFoundException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
return destination;
}
}
|
[
"[email protected]"
] | |
011dd7fb0a71d305e3a7bee5b2f0f8db5f8b404a
|
aca457909ef8c4eb989ba23919de508c490b074a
|
/DialerJADXDecompile/civ.java
|
972dd9cd6bf71ae72d23bb208b8c68b8319e6501
|
[] |
no_license
|
KHikami/ProjectFiCallingDeciphered
|
bfccc1e1ba5680d32a4337746de4b525f1911969
|
cc92bf6d4cad16559a2ecbc592503d37a182dee3
|
refs/heads/master
| 2021-01-12T17:50:59.643861 | 2016-12-08T01:20:34 | 2016-12-08T01:23:04 | 71,650,754 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 233 |
java
|
public final class civ {
public static final bwi[] a;
static {
a = new bwi[]{new ciw(bwi.a("0\u0082\u0002\u00a70\u0082\u0002e\u00a0\u0003\u0002\u0001\u0002\u0002\u0004P\u0005|B0\u000b\u0006\u0007*\u0086"))};
}
}
|
[
"[email protected]"
] | |
17b62b5ae5af61fe5ff1d35da14eab07fb297624
|
b4edaaad624cc11e9208496db3ce3944270f8d30
|
/app소스/Webox/app/src/main/java/kr/webox/app01/Intro_Activity.java
|
7a2321f418fcadebbcef2f7931febd6b476c1a37
|
[
"MIT"
] |
permissive
|
MobileSeoul/2016seoul-10
|
f933c65e96b845dec94dc13e12d0dd52fe404844
|
83acd6e300bcbc11d6178dd30d65d56f33234e9a
|
refs/heads/master
| 2021-07-06T01:58:58.376510 | 2017-09-28T05:23:02 | 2017-09-28T05:23:02 | 105,101,583 | 2 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 653 |
java
|
package kr.webox.app01;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
/**
* Created by jwkim on 2016-10-25.
*/
public class Intro_Activity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.intro_layout);
new Handler().postDelayed(new Runnable(){
public void run(){
Intent t = new Intent(Intro_Activity.this, MainActivity.class);
finish();
startActivity(t);
}
}, 3000);
}
}
|
[
"[email protected]"
] | |
946753f10077e0c64be535d3d1e3480a0842773c
|
87c003c517a21ab32e4e809ae72a1f9d198d710b
|
/app/src/test/java/com/sfstudio/flashlight/ExampleUnitTest.java
|
8848d98f68f12918b00011775f5e412999f42163
|
[] |
no_license
|
MadCoderr/FlashLight
|
977649afdcb59ec733b144985584c8802f9a3f66
|
75e581ca29aa387bcf04be5d7dee81dd7c0dd5ad
|
refs/heads/master
| 2020-12-24T20:00:50.612458 | 2017-03-27T13:28:17 | 2017-03-27T13:28:17 | 86,227,924 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 401 |
java
|
package com.sfstudio.flashlight;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
f9f1a9411cb742dc98f0ebcaf964c3b4cfa6867c
|
1779748ffc07b60ef99e9b8c479d7882aa8f3c9e
|
/src/main/java/org/zhangzhewen/algorithm/bit/数组异或操作1486.java
|
bd3d1a05a6fcf6ec2f64e9804bb59eb47e589fa7
|
[] |
no_license
|
zhangzhewen-idea/algorithm
|
cf2a18331d0da55e0cf7d08b80c01232559542b8
|
5b87b7cd216e6b3520cd6f80b69375829481f7f6
|
refs/heads/master
| 2023-04-13T07:13:05.385783 | 2023-04-06T07:29:31 | 2023-04-06T07:29:31 | 136,726,632 | 0 | 0 | null | 2021-06-15T16:07:09 | 2018-06-09T13:42:34 |
Java
|
UTF-8
|
Java
| false | false | 1,300 |
java
|
package org.zhangzhewen.algorithm.bit;
/**
* 数组异或操作1486
* <p>
* 1486. 数组异或操作
* 给你两个整数,n 和 start 。
* <p>
* 数组 nums 定义为:nums[i] = start + 2*i(下标从 0 开始)且 n == nums.length 。
* <p>
* 请返回 nums 中所有元素按位异或(XOR)后得到的结果。
* <p>
* <p>
* <p>
* 示例 1:
* <p>
* 输入:n = 5, start = 0
* 输出:8
* 解释:数组 nums 为 [0, 2, 4, 6, 8],其中 (0 ^ 2 ^ 4 ^ 6 ^ 8) = 8 。
* "^" 为按位异或 XOR 运算符。
* 示例 2:
* <p>
* 输入:n = 4, start = 3
* 输出:8
* 解释:数组 nums 为 [3, 5, 7, 9],其中 (3 ^ 5 ^ 7 ^ 9) = 8.
* 示例 3:
* <p>
* 输入:n = 1, start = 7
* 输出:7
* 示例 4:
* <p>
* 输入:n = 10, start = 5
* 输出:2
* <p>
* <p>
* 提示:
* <p>
* 1 <= n <= 1000
* 0 <= start <= 1000
* n == nums.length
*
* @author zhangzhewen
* @date 2020/10/28
*/
public class 数组异或操作1486 {
public static void main(String[] args) {
System.out.println(new 数组异或操作1486().xorOperation(5, 0));
}
public int xorOperation(int n, int start) {
int res = start;
for (int i = 1; i < n; i++) {
res ^= start+i * 2;
}
return res;
}
}
|
[
"[email protected]"
] | |
331b4d65fefca09f12d82095ffc5709de6af7d69
|
1473e6e4e7b85a3ac0b5f0b8a3aad675565b75ac
|
/src/main/java/org/cloudfoundry/samples/fibonacci/domain/FibonacciRequest.java
|
afbab42cb47626771aebc15bea6fdbf456f1308c
|
[
"BSD-3-Clause"
] |
permissive
|
vmware-archive/fibonacci
|
3141af2c890ea1e2d4fef7a0d7243003d4795b87
|
166f498b05747e2399feb500cdfb560b0474eb17
|
refs/heads/master
| 2023-02-08T18:19:02.120987 | 2021-01-04T21:53:03 | 2021-01-04T21:53:03 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 645 |
java
|
package org.cloudfoundry.samples.fibonacci.domain;
public class FibonacciRequest {
private Integer value;
private Integer id;
private String sessionId;
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
@Override
public String toString() {
return "FibonacciRequest [value=" + value + ", id=" + id + ", sessionId=" + sessionId + "]";
}
}
|
[
"[email protected]"
] | |
242efbb86bff39e88d7bbf281e6c8d224bff4d94
|
b75c691cbb6d0d4d0cf95fe16040771785fddb80
|
/backend/src/test/java/com/github/plawrynowicz/exampleproject/backend/dao/Dao.java
|
2ca020b180b70518f1991cf4c53343a16be35db4
|
[] |
no_license
|
plawrynowicz/test-examples
|
71db8642e2e2d1896a6643907f9320d799401982
|
a633143c33354b508d1dea9ec4adc653af6180c5
|
refs/heads/main
| 2023-03-19T03:21:03.401274 | 2021-03-16T15:53:54 | 2021-03-16T15:53:54 | 348,162,682 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 335 |
java
|
package com.github.plawrynowicz.exampleproject.backend.dao;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Getter
public class Dao {
private final ActionTypeDao actionTypeDao;
private final DocumentDao documentDao;
private final StrategyDroolsResultDao strategyDroolsResultDao;
}
|
[
"[email protected]"
] | |
e392918aa737e9cf5d7454efadda9abd0d90e73a
|
65c5041d5cca6ae0bb79d8597a86dcb2251124af
|
/src/com/bearkchan/web/servlet/OrderServlet.java
|
01ff2e799b8fa4aea8bede848607b75b4533c0ec
|
[] |
no_license
|
bearkchan/BearShop
|
9a60dc3e3e005ff444dcff3b0f061522fc86b5f1
|
1ca3e77a13ecab133daee7283603117837d88588
|
refs/heads/master
| 2021-03-30T21:58:17.673385 | 2018-03-16T04:50:59 | 2018-03-16T04:50:59 | 124,822,274 | 4 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 11,427 |
java
|
package com.bearkchan.web.servlet;
import com.bearkchan.domain.*;
import com.bearkchan.service.OrderService;
import com.bearkchan.service.ProductService;
import com.bearkchan.utils.CommonUtils;
import com.bearkchan.utils.PaymentUtil;
import org.apache.commons.beanutils.BeanUtils;
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 java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
@WebServlet(name = "OrderServlet", urlPatterns = "/order")
public class OrderServlet extends BaseServlet {
// 提交订单
public void submitOrder(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession();
// 判断用户是否登陆,若果未登录下面代码不执行
User user = (User) session.getAttribute("user");
if (user == null) {
// 没有登陆
response.sendRedirect(request.getContextPath() + "/login.jsp");
return;//跳转之后后面的代码不再执行。
}
// 封装好一个Order对象,传递给service层
Order order = new Order();
// 1. private String oid;//该订单的订单号
String oid = CommonUtils.getUUID();
order.setOid(oid);
// 2. private Date ordertime;//下单时间
order.setOrdertime(new Date());
// 3. private double total;//该订单的总金额
Cart cart = (Cart) session.getAttribute("cart");
if (cart != null) {
double total = cart.getTotal();
order.setTotal(total);
// 4. private int state;//订单的支付状态1代表已付款,0代表未付款
order.setState(0);
// 5. private String addr;//收货地址
order.setAddr(null);
// 6. private String name;//收货人
order.setName(null);
// 7. private String telephone;//收货人电话
order.setTelephone(null);
// 8. private User user;//该订单属于哪个用户
order.setUser(user);
//
//
// // 该订单中有多少订单项
// 9.List<OrderItem> orderItems = new ArrayList<OrderItem>();
// 获得购物车中购物项的集合map
Map<String, CartItem> cartItems = cart.getCartItems();
for (Map.Entry<String, CartItem> entry : cartItems.entrySet()) {
// 取出每一个购物项
CartItem cartItem = entry.getValue();
OrderItem orderItem = new OrderItem();
orderItem.setItemid(CommonUtils.getUUID());
orderItem.setCount(cartItem.getBuyNum());
orderItem.setSubtotal(cartItem.getSubtotal());
orderItem.setProduct(cartItem.getProduct());
orderItem.setOrder(order);
// 将该订单项添加到订单的订单集合中
order.getOrderItems().add(orderItem);
}
// Order对象封装完毕
// 转递数据到service层
OrderService service = new OrderService();
service.submitOrder(order);
session.setAttribute("order", order);
// 页面跳转
response.sendRedirect(request.getContextPath() + "/order_info.jsp");
}
}
// 更新收货人信息+在线支付
public void confirmOrder(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Map<String, String[]> properties = request.getParameterMap();
Order order = new Order();
try {
BeanUtils.populate(order, properties);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
OrderService service = new OrderService();
service.updateOrderAdrr(order);
// 2.选择银行
//只接入一个接口,这个接口已经集成所有的银行接口了 ,这个接口是第三方支付平台提供的
//接入的是易宝支付
// 获得 支付必须基本数据
String orderid = request.getParameter("oid");
//String money = order.getTotal()+"";//支付金额
String money = "0.01";//支付金额
// 银行
String pd_FrpId = request.getParameter("pd_FrpId");
// 发给支付公司需要哪些数据
String p0_Cmd = "Buy";
String p1_MerId = ResourceBundle.getBundle("merchantInfo").getString("p1_MerId");
String p2_Order = orderid;
String p3_Amt = money;
String p4_Cur = "CNY";
String p5_Pid = "";
String p6_Pcat = "";
String p7_Pdesc = "";
// 支付成功回调地址 ---- 第三方支付公司会访问、用户访问
// 第三方支付可以访问网址
String p8_Url = ResourceBundle.getBundle("merchantInfo").getString("callback");
String p9_SAF = "";
String pa_MP = "";
String pr_NeedResponse = "1";
// 加密hmac 需要密钥
String keyValue = ResourceBundle.getBundle("merchantInfo").getString(
"keyValue");
String hmac = PaymentUtil.buildHmac(p0_Cmd, p1_MerId, p2_Order, p3_Amt,
p4_Cur, p5_Pid, p6_Pcat, p7_Pdesc, p8_Url, p9_SAF, pa_MP,
pd_FrpId, pr_NeedResponse, keyValue);
String url = "https://www.yeepay.com/app-merchant-proxy/node?pd_FrpId=" + pd_FrpId +
"&p0_Cmd=" + p0_Cmd +
"&p1_MerId=" + p1_MerId +
"&p2_Order=" + p2_Order +
"&p3_Amt=" + p3_Amt +
"&p4_Cur=" + p4_Cur +
"&p5_Pid=" + p5_Pid +
"&p6_Pcat=" + p6_Pcat +
"&p7_Pdesc=" + p7_Pdesc +
"&p8_Url=" + p8_Url +
"&p9_SAF=" + p9_SAF +
"&pa_MP=" + pa_MP +
"&pr_NeedResponse=" + pr_NeedResponse +
"&hmac=" + hmac;
//重定向到第三方支付平台
response.sendRedirect(url);
}
public void callBack(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 获得回调所有数据
String p1_MerId = request.getParameter("p1_MerId");
String r0_Cmd = request.getParameter("r0_Cmd");
String r1_Code = request.getParameter("r1_Code");
String r2_TrxId = request.getParameter("r2_TrxId");
String r3_Amt = request.getParameter("r3_Amt");
String r4_Cur = request.getParameter("r4_Cur");
String r5_Pid = request.getParameter("r5_Pid");
String r6_Order = request.getParameter("r6_Order");
String r7_Uid = request.getParameter("r7_Uid");
String r8_MP = request.getParameter("r8_MP");
String r9_BType = request.getParameter("r9_BType");
String rb_BankId = request.getParameter("rb_BankId");
String ro_BankOrderId = request.getParameter("ro_BankOrderId");
String rp_PayDate = request.getParameter("rp_PayDate");
String rq_CardNo = request.getParameter("rq_CardNo");
String ru_Trxtime = request.getParameter("ru_Trxtime");
// 身份校验 --- 判断是不是支付公司通知你
String hmac = request.getParameter("hmac");
String keyValue = ResourceBundle.getBundle("merchantInfo").getString(
"keyValue");
// 自己对上面数据进行加密 --- 比较支付公司发过来hamc
boolean isValid = PaymentUtil.verifyCallback(hmac, p1_MerId, r0_Cmd,
r1_Code, r2_TrxId, r3_Amt, r4_Cur, r5_Pid, r6_Order, r7_Uid,
r8_MP, r9_BType, keyValue);
if (isValid) {
// 响应数据有效
if (r9_BType.equals("1")) {
OrderService service = new OrderService();
service.updateOrderState(r6_Order);
// 浏览器重定向
response.setContentType("text/html;charset=utf-8");
response.getWriter().println("<h1>付款成功!等待商城进一步操作!等待收货...</h1>");
} else if (r9_BType.equals("2")) {
// 服务器点对点 --- 支付公司通知你
System.out.println("付款成功!");
// 修改订单状态 为已付款
// 回复支付公司
response.getWriter().print("success");
}
} else {
// 数据无效
System.out.println("数据被篡改!");
}
}
public void myOrders(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession();
//判断用户是否登陆,若果未登录下面代码不执行
User user = (User) session.getAttribute("user");
if (user == null) {
//没有登陆
response.sendRedirect(request.getContextPath() + "/login.jsp");
return;//跳转之后后面的代码不再执行。
}
OrderService service = new OrderService();
//查询该用户的所有订单信息(单表的查询orders表)
//集合中的每一个order对象的数据是不完整的,缺少OrderItems集合
List<Order> orderList = service.findAllOrders(user.getUid());
//循环所有的订单,为每个订单填充订单项集合信息
if (orderList != null) {
for (Order order :
orderList) {
//获得每一个订单的oid
String oid = order.getOid();
//查询该订单的所有订单项----mapList封装的是多个订单项和该订单项中商品的信息
List<Map<String, Object>> mapList = service.findAllOrderItemByOid(oid);
//将mapList转换成List<OrderItem> orderItems
for (Map<String, Object> map : mapList) {
try {
//从map中取出count subtotal封装到OrderItem中
OrderItem item = new OrderItem();
BeanUtils.populate(item, map);
//从map中取出pimage pname shop_price 封装到Product中
Product product = new Product();
BeanUtils.populate(product, map);
//将product封装到OrderItem
item.setProduct(product);
//将orderItem封装到order中的OrderItemList中
order.getOrderItems().add(item);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
// orderList封装完整
request.setAttribute("orderList",orderList);
request.getRequestDispatcher("/order_list.jsp").forward(request,response);
}
}
|
[
"[email protected]"
] | |
5ddf5d69abc5f9cc217acc94c41691ebae82c9ed
|
3c4b16058014f7b9a29752a0850aa66825288d77
|
/my_project/src/com/test/member/MemberUpdate.java
|
90bff998aa665be8b7fb343d1fe8f927b930bcaf
|
[] |
no_license
|
wlsgud8541/singleProject
|
cd8e7a3d8d24b8470bc52886775555e197288809
|
1c04fba7af490e2f20f59421e757a111601bbfdc
|
refs/heads/master
| 2020-04-28T15:14:50.955392 | 2019-03-13T07:18:39 | 2019-03-13T07:18:39 | 175,366,204 | 0 | 0 | null | null | null | null |
UHC
|
Java
| false | false | 3,838 |
java
|
package com.test.member;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import com.project.login.Login_M;
import com.project.logindb.UserDB;
import com.project.logindb.UserDBSave;
public class MemberUpdate extends JFrame implements ActionListener{
JPanel m_t_panel, m_b_panel;
JLabel l_m_name, l_m_id_num, l_m_addr, l_m_call;
JTextField t_m_name, t_m_id, t_m_addr, t_m_call;
JButton m_select_button,m_update_button ,m_cancle_button;
BorderLayout bl;
UserDBSave udbs=new UserDBSave();
UserDB ud;
public MemberUpdate() {
setTitle("회원정보수정");
setSize(300, 300);
Toolkit kit = Toolkit.getDefaultToolkit();
Dimension screenSize = kit.getScreenSize();
setLocation(screenSize.width / 2 - 150, screenSize.height / 2 - 150);
setLayout(bl = new BorderLayout());
m_t_panel = new JPanel(new GridLayout(0, 2));
m_b_panel = new JPanel(new GridLayout(1, 2));
l_m_name = new JLabel(" 이 름");
l_m_id_num = new JLabel(" 주민등록번호");
l_m_addr = new JLabel(" 주 소");
l_m_call = new JLabel(" 전 화 번 호");
t_m_name = new JTextField(10);
t_m_id = new JTextField(10);
t_m_addr = new JTextField(10);
t_m_call = new JTextField(10);
m_select_button = new JButton("검색하기");
m_update_button = new JButton("수정하기");
m_cancle_button = new JButton("취소하기");
m_select_button.addActionListener(this);
m_update_button.addActionListener(this);
m_cancle_button.addActionListener(this);
m_t_panel.add(l_m_name);
m_t_panel.add(t_m_name);
m_t_panel.add(l_m_id_num);
m_t_panel.add(t_m_id);
m_t_panel.add(l_m_addr);
m_t_panel.add(t_m_addr);
m_t_panel.add(l_m_call);
m_t_panel.add(t_m_call);
m_b_panel.add(m_select_button);
m_b_panel.add(m_update_button);
m_b_panel.add(m_cancle_button);
add(m_t_panel, BorderLayout.CENTER);
add(m_b_panel, BorderLayout.SOUTH);
// 기본설정
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
//t_m_name, t_m_id, t_m_addr, t_m_call
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource()==m_select_button) {
try {
ud=new UserDB();
udbs=ud.searchUser(t_m_name.getText());
searchUser();
} catch (Exception e1) {
e1.printStackTrace();
}
}else if (e.getSource()==m_update_button) {
try {
UserUpdate();
} catch (Exception e1) {
e1.printStackTrace();
}
}else if (e.getSource()==m_cancle_button) {
setVisible(false);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
dispose();
}
});
new Login_M();
}
}
private void UserUpdate() {
udbs=new UserDBSave();
udbs.setName(t_m_name.getText());
udbs.setIdnum(t_m_id.getText());
udbs.setAddr(t_m_addr.getText());
udbs.setCall(t_m_call.getText());
try {
ud=new UserDB();
ud.UserUpdate(udbs);
JOptionPane.showMessageDialog(null, "수정 완료");
t_m_name.setText(null);
t_m_id.setText(null);
t_m_addr.setText(null);
t_m_call.setText(null);
} catch (Exception e) {
e.printStackTrace();
}
}
private void searchUser() throws Exception {
JOptionPane.showMessageDialog(null, "검색되었습니다.");
t_m_name.setText(udbs.getName());
t_m_id.setText(udbs.getIdnum());
t_m_addr.setText(udbs.getAddr());
t_m_call.setText(udbs.getCall());
}
}
|
[
"[email protected]"
] | |
92d91b9f797c01b5e32ddfcf32e9e9b8667940a3
|
9631307e16dbfcecc61f9fa51692312c13c3aa9c
|
/app/src/test/java/net/hutek/intent_example/ExampleUnitTest.java
|
92546d8241234d24b55f532aa093fe6cadf3bbc6
|
[] |
no_license
|
Woo-Hyun-Choi/Intent_Example
|
a47affaff60d15eb230362094babd2fc7d85c11c
|
59ad0e36153dd3a81653aaf4bbd25b4738e1e028
|
refs/heads/master
| 2023-06-26T16:53:18.861820 | 2021-07-30T09:00:57 | 2021-07-30T09:00:57 | 390,998,975 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 385 |
java
|
package net.hutek.intent_example;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
e0627bdef9405c60377d033f784df75680ca466c
|
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
|
/aliyun-java-sdk-dms-enterprise/src/main/java/com/aliyuncs/dms_enterprise/transform/v20181101/GetDataExportDownloadURLResponseUnmarshaller.java
|
f49a61f08b58071f610d930ebca7d78c8ca9d374
|
[
"Apache-2.0"
] |
permissive
|
aliyun/aliyun-openapi-java-sdk
|
a263fa08e261f12d45586d1b3ad8a6609bba0e91
|
e19239808ad2298d32dda77db29a6d809e4f7add
|
refs/heads/master
| 2023-09-03T12:28:09.765286 | 2023-09-01T09:03:00 | 2023-09-01T09:03:00 | 39,555,898 | 1,542 | 1,317 |
NOASSERTION
| 2023-09-14T07:27:05 | 2015-07-23T08:41:13 |
Java
|
UTF-8
|
Java
| false | false | 2,075 |
java
|
/*
* 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.aliyuncs.dms_enterprise.transform.v20181101;
import com.aliyuncs.dms_enterprise.model.v20181101.GetDataExportDownloadURLResponse;
import com.aliyuncs.dms_enterprise.model.v20181101.GetDataExportDownloadURLResponse.DownloadURLResult;
import com.aliyuncs.transform.UnmarshallerContext;
public class GetDataExportDownloadURLResponseUnmarshaller {
public static GetDataExportDownloadURLResponse unmarshall(GetDataExportDownloadURLResponse getDataExportDownloadURLResponse, UnmarshallerContext _ctx) {
getDataExportDownloadURLResponse.setRequestId(_ctx.stringValue("GetDataExportDownloadURLResponse.RequestId"));
getDataExportDownloadURLResponse.setErrorCode(_ctx.stringValue("GetDataExportDownloadURLResponse.ErrorCode"));
getDataExportDownloadURLResponse.setErrorMessage(_ctx.stringValue("GetDataExportDownloadURLResponse.ErrorMessage"));
getDataExportDownloadURLResponse.setSuccess(_ctx.booleanValue("GetDataExportDownloadURLResponse.Success"));
DownloadURLResult downloadURLResult = new DownloadURLResult();
downloadURLResult.setHasResult(_ctx.booleanValue("GetDataExportDownloadURLResponse.DownloadURLResult.HasResult"));
downloadURLResult.setTipMessage(_ctx.stringValue("GetDataExportDownloadURLResponse.DownloadURLResult.TipMessage"));
downloadURLResult.setURL(_ctx.stringValue("GetDataExportDownloadURLResponse.DownloadURLResult.URL"));
getDataExportDownloadURLResponse.setDownloadURLResult(downloadURLResult);
return getDataExportDownloadURLResponse;
}
}
|
[
"[email protected]"
] | |
f02a5fb7dea433c4e463fd10c5262c46b12de60d
|
c643dd4d27f5d8bbb136d96d21eb3d33bea68d71
|
/reed-rpc/src/main/java/serialzation/ReedSerializer.java
|
487abc92ff38d393d3e50d409b803a7d0097ae36
|
[] |
no_license
|
oneOneTow/reed
|
288b040809459c99ce829bf524bf01078a80895d
|
90a51e375a738e36dea70f7ef9c17b086d261cae
|
refs/heads/master
| 2022-07-15T15:32:00.739244 | 2020-05-12T15:06:09 | 2020-05-12T15:06:09 | 256,546,249 | 0 | 0 | null | 2020-04-17T15:51:27 | 2020-04-17T15:51:26 | null |
UTF-8
|
Java
| false | false | 1,117 |
java
|
package serialzation;
import static io.protostuff.runtime.RuntimeSchema.getSchema;
import exception.ReedException;
import io.protostuff.LinkedBuffer;
import io.protostuff.ProtostuffIOUtil;
import io.protostuff.Schema;
import io.protostuff.runtime.RuntimeSchema;
/**
* reed default serializer use protostuff
*
* @author jgs
* @date 2020/3/15 1:24
*/
public class ReedSerializer implements Serializer {
public byte[] serialize(Object o) {
Schema<Object> schema = RuntimeSchema.getSchema(Object.class);
LinkedBuffer buffer = LinkedBuffer.allocate(512);
byte[] protostuff = null;
try {
protostuff = ProtostuffIOUtil.toByteArray(o, schema, buffer);
} finally {
buffer.clear();
return protostuff;
}
}
public <T> T deserialize(byte[] bytes, String classO) {
try {
Class<T> clazz = (Class<T>) Class.forName(classO);
T returnO = (T) clazz.newInstance();
Schema<T> schema = getSchema(clazz);
ProtostuffIOUtil.mergeFrom(bytes, returnO, schema);
return returnO;
} catch (Exception e) {
throw new ReedException(e);
}
}
}
|
[
"[email protected]"
] | |
2d25220f4c420d0fe4ac20514cdd514c3e980c05
|
ec2b8969f42adf885d3dacae0b071c164ac686a7
|
/app/src/main/java/com/service/Sendservice.java
|
10936d72533fc926b6e1f385ee2c7a4caf8522de
|
[] |
no_license
|
yufan666/frpc433
|
ba09f87dce9a744fd00db493ff0a4d1d16ed378a
|
ff2fb5ab7f04e659460401669386725e1fcf7045
|
refs/heads/master
| 2022-04-20T03:08:15.705591 | 2020-04-16T09:20:07 | 2020-04-16T09:20:07 | 256,166,245 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,397 |
java
|
package com.service;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.SystemClock;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.TwoLineListItem;
import com.activity.MyApplication;
import com.hoho.android.usbserial.BuildConfig;
import com.hoho.android.usbserial.driver.UsbSerialDriver;
import com.hoho.android.usbserial.driver.UsbSerialPort;
import com.hoho.android.usbserial.driver.UsbSerialProber;
import java.util.ArrayList;
import java.util.List;
public class Sendservice extends Service {
private final String TAG = Sendservice.class.getSimpleName();
private UsbManager mUsbManager;
private UsbSerialPort mSerialPort;
private static final int MESSAGE_REFRESH = 101;
private static final long REFRESH_TIMEOUT_MILLIS = 5000;
public static final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB";
private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_REFRESH:
refreshDeviceList();
mHandler.sendEmptyMessageDelayed(MESSAGE_REFRESH, REFRESH_TIMEOUT_MILLIS);
break;
default:
super.handleMessage(msg);
break;
}
}
};
private BroadcastReceiver mUsbReceiver;
private List<UsbSerialPort> mEntries = new ArrayList<UsbSerialPort>();
// private ArrayAdapter<UsbSerialPort> mAdapter;
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
mUsbReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if(intent.getAction().equals(INTENT_ACTION_GRANT_USB)) {
if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
} else {
Toast.makeText(context, "USB permission denied", Toast.LENGTH_SHORT).show();
}
}
}
};
// mAdapter = new ArrayAdapter<UsbSerialPort>(this,
// android.R.layout.simple_expandable_list_item_2, mEntries) {
// @Override
// public View getView(int position, View convertView, ViewGroup parent) {
// final TwoLineListItem row;
// if (convertView == null){
// final LayoutInflater inflater =
// (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// row = (TwoLineListItem) inflater.inflate(android.R.layout.simple_list_item_2, null);
// } else {
// row = (TwoLineListItem) convertView;
// }
//
// final UsbSerialPort port = mEntries.get(position);
// final UsbSerialDriver driver = port.getDriver();
// final UsbDevice device = driver.getDevice();
//
// final String title = String.format("Vendor %4X Product %4X", device.getVendorId(), device.getProductId());
// row.getText1().setText(title);
//
// final String subtitle = driver.getClass().getSimpleName();
// row.getText2().setText(subtitle);
//
// return row;
// }
//
// };
final List<UsbSerialDriver> drivers =
UsbSerialProber.getDefaultProber().findAllDrivers(mUsbManager);
final List<UsbSerialPort> result = new ArrayList<UsbSerialPort>();
for (final UsbSerialDriver driver : drivers) {
final List<UsbSerialPort> ports = driver.getPorts();
Log.d(TAG, String.format("+ %s: %s port%s",
driver, Integer.valueOf(ports.size()), ports.size() == 1 ? "" : "s"));
result.addAll(ports);
}
mEntries.clear();
mEntries.addAll(result);
mHandler.sendEmptyMessage(MESSAGE_REFRESH);
registerReceiver(mUsbReceiver, new IntentFilter(INTENT_ACTION_GRANT_USB));
}
@Override
public void onDestroy() {
super.onDestroy();
mHandler.removeMessages(MESSAGE_REFRESH);
unregisterReceiver(mUsbReceiver);
}
private void refreshDeviceList() {
new AsyncTask<Void, Void, List<UsbSerialPort>>() {
@Override
protected List<UsbSerialPort> doInBackground(Void... params) {
Log.d(TAG, "Refreshing device list ...");
SystemClock.sleep(1000);
final List<UsbSerialDriver> drivers =
UsbSerialProber.getDefaultProber().findAllDrivers(mUsbManager);
final List<UsbSerialPort> result = new ArrayList<UsbSerialPort>();
for (final UsbSerialDriver driver : drivers) {
final List<UsbSerialPort> ports = driver.getPorts();
Log.d(TAG, String.format("+ %s: %s port%s",
driver, Integer.valueOf(ports.size()), ports.size() == 1 ? "" : "s"));
result.addAll(ports);
}
return result;
}
@Override
protected void onPostExecute(List<UsbSerialPort> result) {
mEntries.clear();
mEntries.addAll(result);
// mAdapter.notifyDataSetChanged();
Toast.makeText(Sendservice.this,""+String.format("%s device(s) found",Integer.valueOf(mEntries.size())),Toast.LENGTH_SHORT).show();
Log.d(TAG, "Done refreshing, " + mEntries.size() + " entries found.");
if (mEntries.size() >= 1) {
UsbSerialPort mSerialPort = mEntries.get(0);
UsbDevice device = mSerialPort.getDriver().getDevice();
if (!mUsbManager.hasPermission(device)) {
PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(Sendservice.this, 0, new Intent(INTENT_ACTION_GRANT_USB), 0);
mUsbManager.requestPermission(device, usbPermissionIntent);
} else {
MyApplication.sPort=mSerialPort;
System.out.println("--------------------"+mEntries.size());
}
}
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
System.out.println("--------------------"+mEntries.size());
Toast.makeText(Sendservice.this,""+String.format("%s device(s) found",Integer.valueOf(mEntries.size())),Toast.LENGTH_SHORT).show();
}
}
|
[
"[email protected]"
] | |
76070f050250320e7488443a43eeb9e0aa217ba7
|
508c8088d0149e5247194d0b292c1ad3af680f75
|
/Test/Day11/src/demo/DemoHeart.java
|
b39ff687b602f7c2f6843e0825b20bfc38302130
|
[] |
no_license
|
hechen136/new
|
c6f3cbf7601f5522aefa134d58bff89bd5e9c7d1
|
dcee4a9aaa95909e1fc9a75ef968ecf0f5716419
|
refs/heads/master
| 2020-04-29T03:40:55.578516 | 2019-03-15T13:31:36 | 2019-03-15T13:31:36 | 175,819,599 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 219 |
java
|
package demo;
public class DemoHeart {
public static void main(String[] args) {
Body.Heart heart = new Body().new Heart();
heart.beat();
Body body = new Body();
body.eyes();
}
}
|
[
"[email protected]"
] | |
5017a12a246d23f30c86acb105bf9ebfc22f3cde
|
0565885aa67e16033b5e6526397d10b03787e1ac
|
/fulfillment-dp-master/fulfillment-dp-api/src/main/java/com/mallcai/fulfillment/dp/api/request/DeliveryOrderMultiPkgDTO.java
|
7a1a5d3171088f8a70b8af3fb25a23c36efa9841
|
[] |
no_license
|
youngzil/fulfillment-center
|
e05b364f160a6e84f84ee3ef1a3bdc3cfafcdad2
|
9b86b810b1e40cfe77e82ff972f99b645f598b57
|
refs/heads/master
| 2020-09-22T10:56:25.810905 | 2019-12-01T13:19:13 | 2019-12-01T13:19:13 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 683 |
java
|
package com.mallcai.fulfillment.dp.api.request;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 支持多包裹发货 请求数据
* @author gaoguoming
* @date 2019-10-28 20:06:49
*/
@Data
public class DeliveryOrderMultiPkgDTO implements Serializable {
private static final long serialVersionUID = -5535391104707869569L;
/**
* 订单编号
*/
private String orderNo;
/**
* 门店id(商家自配送传0,表示城市级别)
*/
private Long storeId;
/**
* 城市id
*/
private Integer cityId;
/**
* 配送单列表
*/
private List<DistOrderInfo> distOrderInfoList;
}
|
[
"[email protected]"
] | |
833d51d2c82e3c4d92dc71e35ae326344678eece
|
8acb868c29178c122fc26c3ee82f731e0e69870a
|
/entities/Triangle.java
|
8fc7a9254a09cfa3b154b6038adb3d7787072ef3
|
[] |
no_license
|
leltonborges/Java
|
b6a1cbb0c788ea7008992381e2d993c835e3f7d8
|
734633ce19415af55dcc67bee9c8cbdc7e35177e
|
refs/heads/master
| 2020-08-12T10:22:03.765103 | 2019-10-13T02:53:50 | 2019-10-13T02:53:50 | 214,750,190 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 531 |
java
|
package entities;
public class Triangle {
private double a;
private double b;
private double c;
public void setA(double x) {
this.a = x;
}
public double getA() {
return a;
}
public void setB(double y) {
this.b = y;
}
public double getB() {
return b;
}
public void setC(double z) {
this.c = z;
}
public double getC() {
return c;
}
public double areaTriangle() {
return 0;
}
public String toString() {
return
"Lado a: "+getA()+
"\nLado b: "+getB()+
"\nLado c: "+getC();
}
}
|
[
"[email protected]"
] | |
c452ce264bafb5d3fd57b28cd9635de3bacf48cf
|
9b31cecefd137e6ef8e7b26c566e70325ef0b59b
|
/app/src/main/java/com/example/android/androidquizapp/level/LevelSelectionActivity.java
|
bf55f4d83864853a5af2f35a0704d39a9d2865b5
|
[] |
no_license
|
yakutyazlm/AndroidQuizApp-1
|
91184a43be5c337bf4958c0a7d2eac9d2f061ca1
|
193152983e4b5cfafe5d7fed8acf4a6bb81346c6
|
refs/heads/master
| 2020-12-04T07:43:37.100382 | 2018-03-08T20:55:57 | 2018-03-08T20:55:57 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,167 |
java
|
package com.example.android.androidquizapp.level;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.example.android.androidquizapp.R;
import com.example.android.androidquizapp.utils.QueryUtils;
/**
* The {@link LevelSelectionActivity} class represents a level selection screen.
* This screen old's a list of {@link android.support.v7.widget.CardView} items representing the levels.
*
* @author Fábio Gouveia
* @version 1.0
*
* @see Level
* @see LevelSelectionCardAdapter
*/
public class LevelSelectionActivity extends AppCompatActivity {
private SharedPreferences userPreferences;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_level_selection);
//Get application shared preferences.
userPreferences = getSharedPreferences(QueryUtils.PREFERENCES_FILE, MODE_PRIVATE);
//Initialize our costume toolbar.
Toolbar toolBar = findViewById(R.id.level_selection_toolbar);
toolBar.setTitleTextColor(getResources().getColor(R.color.colorPrimaryText));
//Set our costume toolbar to be the default supported toolbar.
setSupportActionBar(toolBar);
//Initialize a recycler view to deal with the different level cards.
RecyclerView difficultyLevelList = findViewById(R.id.difficulty_level_list);
//Initialize a layout manager required to work with a RecyclerView.
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false) {
@Override
public boolean canScrollVertically() {
return false;
}
};
//Check device orientation to know how to display the cards and how the recycler layout manager should act
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
//Set recycler view linear layout manager orientation to horizontal
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
}
//Instantiate a difficulty level adapter to help us dealing with cards inside of it
LevelSelectionCardAdapter levelSelectionCardAdapter = new LevelSelectionCardAdapter(this, QueryUtils.createLevels(this));
//Setting recycler view layout manager
difficultyLevelList.setLayoutManager(linearLayoutManager);
//Setting recycler view adapter
difficultyLevelList.setAdapter(levelSelectionCardAdapter);
}
/*
*
* We don´t want the user to return for the initial animation screen, so because is a override void method
* we leave it blank, so when the method is called nothing happen.
*/
@Override
public void onBackPressed() {
//Leave blank, so the user can´t go back to the slide, if you want the user
//to go back, uncomment the sentence bellow.
//super.onBackPressed();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//Inflate our resource menu layout
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
//Initialize menu checkable items
MenuItem showSlideCheckableItem = menu.findItem(R.id.play_initial_slide_checkbox);
MenuItem playSoundCheckableItem = menu.findItem(R.id.play_sound_effects_checkbox);
//Change show animation checkbox to checked state depending on user preferences.
if (userPreferences.getBoolean(QueryUtils.PLAY_INITIAL_SLIDE_KEY, true)) {
//User want's to see the animation on application start
showSlideCheckableItem.setChecked(true);
} else {
showSlideCheckableItem.setChecked(false);
}
//Change play sound effects checkbox to checked state depending on user preferences.
if (userPreferences.getBoolean(QueryUtils.PLAY_SOUND_EFFECTS_KEY, true)) {
//User want's to see the animation on application start
playSoundCheckableItem.setChecked(true);
} else {
playSoundCheckableItem.setChecked(false);
}
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.main_menu_progress:
this.startActivity(new Intent(this, LevelStatisticsActivity.class));
animateOpenStatisticsActivityTransition();
break;
case R.id.play_initial_slide_checkbox:
//When user click's the check box is checked
if(item.isChecked()){
//If the box is checked when the user click's, so the user want's to un-check the box and stop showing the initial slide show
userPreferences.edit().putBoolean(QueryUtils.PLAY_INITIAL_SLIDE_KEY, false).apply();
invalidateOptionsMenu();//Refresh options menu
}else{
//If the box is unchecked when the user click's, so the user want's to check the box and start's showing the initial slide show
userPreferences.edit().putBoolean(QueryUtils.PLAY_INITIAL_SLIDE_KEY, true).apply();
invalidateOptionsMenu();//Refresh options menu
}
break;
case R.id.play_sound_effects_checkbox:
//When user click's the check box is checked
if (item.isChecked()) {
//If the box is checked when the user click's, so the user want's to un-check the box and stop playing sound effects
userPreferences.edit().putBoolean(QueryUtils.PLAY_SOUND_EFFECTS_KEY, false).apply();
invalidateOptionsMenu();//Refresh options menu
} else {
//If the box is unchecked when the user click's, so the user want's to check the box and start's playing sound effects
userPreferences.edit().putBoolean(QueryUtils.PLAY_SOUND_EFFECTS_KEY, true).apply();
invalidateOptionsMenu();//Refresh options menu
}
break;
default:
return super.onOptionsItemSelected(item);
}
return true;
}
/**
* This method help us overriding android pending transitions between activities when leave this activity to the level selection activity
**/
private void animateOpenStatisticsActivityTransition(){
overridePendingTransition(R.anim.enter_activity_animation, R.anim.exit_activity_animation);
}
}
|
[
"[email protected]"
] | |
c1db12e1e7c9a698bc8eec476a3f788e789d506e
|
20a8b4655c8eb8e8cdbc8466eeba86440a24e78d
|
/app/src/main/java/com/shopping_point/user_shopping_point/view/CartActivity.java
|
6d36d54287a9c0bc5ab582e0b71569d81cd8fb3e
|
[
"MIT"
] |
permissive
|
sahilm9620/AR-Shopping-Application
|
4dcca74aca6a004c53dda0e2403a884be78e7101
|
06ccf8433916f5e8032b8869e9ace1511b19bd58
|
refs/heads/master
| 2023-05-16T08:29:11.417092 | 2021-06-09T17:38:26 | 2021-06-09T17:38:26 | 295,432,740 | 4 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,479 |
java
|
package com.shopping_point.user_shopping_point.view;
import androidx.lifecycle.ViewModelProviders;
import android.content.Intent;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import android.view.View;
import com.shopping_point.user_shopping_point.R;
import com.shopping_point.user_shopping_point.ViewModel.CartViewModel;
import com.shopping_point.user_shopping_point.adapter.CartAdapter;
import com.shopping_point.user_shopping_point.databinding.ActivityCartBinding;
import com.shopping_point.user_shopping_point.model.Product;
import com.shopping_point.user_shopping_point.storage.LoginUtils;
import java.util.List;
import static com.shopping_point.user_shopping_point.storage.LanguageUtils.loadLocale;
import static com.shopping_point.user_shopping_point.utils.Constant.PRODUCT;
import static com.shopping_point.user_shopping_point.utils.InternetUtils.isNetworkConnected;
public class CartActivity extends AppCompatActivity {
private ActivityCartBinding binding;
private CartAdapter cartAdapter;
private List<Product> favoriteList;
private CartViewModel cartViewModel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
loadLocale(this);
binding = DataBindingUtil.setContentView(this, R.layout.activity_cart);
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(getResources().getString(R.string.cart));
setUpRecyclerView();
getProductsInCart();
}
private void setUpRecyclerView() {
binding.productsInCart.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
binding.productsInCart.setHasFixedSize(true);
cartViewModel = ViewModelProviders.of(this).get(CartViewModel.class);
}
private void getProductsInCart() {
if (isNetworkConnected(this)) {
cartViewModel.getProductsInCart(LoginUtils.getInstance(this).getUserInfo().getId()).observe(this, cartApiResponse -> {
if (cartApiResponse != null) {
favoriteList = cartApiResponse.getProductsInCart();
if (favoriteList.size() == 0) {
binding.noBookmarks.setVisibility(View.VISIBLE);
binding.emptyCart.setVisibility(View.VISIBLE);
} else {
binding.productsInCart.setVisibility(View.VISIBLE);
}
cartAdapter = new CartAdapter(getApplicationContext(), favoriteList, product -> {
Intent intent = new Intent(CartActivity.this, DetailsActivity.class);
// Pass an object of product class
intent.putExtra(PRODUCT, (product));
startActivity(intent);
}, this);
}
binding.loadingIndicator.setVisibility(View.GONE);
binding.productsInCart.setAdapter(cartAdapter);
cartAdapter.notifyDataSetChanged();
});
} else {
binding.emptyCart.setVisibility(View.VISIBLE);
binding.loadingIndicator.setVisibility(View.GONE);
binding.emptyCart.setText(getString(R.string.no_internet_connection));
}
}
}
|
[
"[email protected]"
] | |
70feb6e3aa8c17eaab9804dabc842a880be14675
|
a700dc6db8d194e535572cb3907b49c7d99731e0
|
/src/main/java/com/trusthub/cobranca/domain/dto/excel/Celulas.java
|
747d30b6b5d98fec6dd79f6cfc3331bf99e80779
|
[] |
no_license
|
reinaldojun/cobranca-relatorios
|
05b75b0dcec82551912397a29514b71f5e53a4f3
|
d285e6b133b28d09d5d59c9cbed8639508d86609
|
refs/heads/master
| 2022-07-09T19:41:24.440333 | 2019-07-23T12:17:57 | 2019-07-23T12:17:57 | 198,423,386 | 0 | 0 | null | 2022-06-29T17:31:52 | 2019-07-23T12:11:31 |
Java
|
UTF-8
|
Java
| false | false | 186 |
java
|
package com.trusthub.cobranca.domain.dto.excel;
import java.util.List;
import lombok.Data;
@Data
public class Celulas {
private Integer linha;
private List<Colunas> colunas;
}
|
[
"[email protected]"
] | |
9e4eb4c691a4e69b22efd372b2a486c2e70a7482
|
c985661f59d0ccc3963b23821e53252b4d565b21
|
/src/haromszog/Haromszog.java
|
d3456d97223feb9d1d09ca0b2a164969b4b708a7
|
[] |
no_license
|
pischta/JFK15Gyak
|
8d62542435039e1d165962bcf0f5542d14cdd4a5
|
32b91e4ee7356ca3dd1afcfab49f4156e363a153
|
refs/heads/master
| 2021-01-13T04:47:21.042928 | 2017-01-12T17:10:32 | 2017-01-12T17:10:32 | 78,742,059 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,911 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package haromszog;
class Haromszog implements Comparable<Haromszog>{//szakértő
private int a,b,c;
public Haromszog(int a, int b, int c) {//konstruktor
if(a<=0)
throw new IllegalArgumentException("Hiba! a<=0.");//Miért nagy I-val kell kezdeni??
if(b<=0)
throw new IllegalArgumentException("Hiba! b<=0.");
if(c<=0)
throw new IllegalArgumentException("Hiba! c<=0.");
if(!megszerkeszthető(a, b, c))
throw new IllegalArgumentException("Hiba: nincs háromszög!");
this.a = a;//arra hivatkozok, amilyen névvel lesz elnevezve az osztály(?)
this.b = b;//a h1 és a h2... helyettesítődik majd be
this.c = c;
}
private static boolean megszerkeszthető(int a, int b, int c){
return (a+b>c && a+c>b && b+c>a);
}
public int getA() {
return a;
}
public int getB() {
return b;
}
public int getC() {
return c;
}
public int kerület(){
return a+b+c;
}
public double terület(){//Hérón képlet: wikipédián
double s=kerület()/2.0;
return Math.sqrt(s*(s-a)*(s-b)*(s-c));
}
@Override
public String toString() {
return "Háromsszög{a="+a+", b="+b+"c="+c+
", K="+kerület()+
", Terület="+extra.Format.left(terület(), 0, 2)+"}";
}
public boolean equals(Haromszog h){
int k1=this.kerület(), k2=h.kerület();
double t1=this.terület(),t2=h.terület();
return (k1==k2 && t1==t2);
}
@Override
public int compareTo(Haromszog h) {
if(this.kerület()==h.kerület())//ha a kerületük egyenlő, akkor a területük alapján rendez
return (int)Math.signum(this.terület()-h.terület());
return this.kerület()-h.kerület();
}
}
|
[
"pt@pischta-samu"
] |
pt@pischta-samu
|
ebd7527ddbbfe966512b3909a7c59916b7b957a8
|
3e9f0f2573a497b9a195f288a19904183e7b489c
|
/library-service/src/main/java/com/omniwyse/library/dto/DeliveryTypeDto.java
|
646dcee92346585768fe22297a6648e4e83e1bb0
|
[] |
no_license
|
aashisharya/library-service
|
cf7aaff31a2465498ababe9b4cb1f592bd157894
|
dd096d57ecd998e09a0920a56d3f49a43f128505
|
refs/heads/master
| 2021-05-14T18:59:39.000195 | 2018-01-05T05:56:39 | 2018-01-05T05:56:39 | 116,098,142 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 330 |
java
|
package com.omniwyse.library.dto;
public class DeliveryTypeDto {
private long id;
private String type;
public long getId() {
return id;
}
public String getType() {
return type;
}
public void setId(long id) {
this.id = id;
}
public void setType(String type) {
this.type = type;
}
}
|
[
"ibaseadministrator@DESKTOP-L55UC7C"
] |
ibaseadministrator@DESKTOP-L55UC7C
|
7d71a6e76791159ef84d0e6521918c6350c635cd
|
54edb94da787989ea2c584d7ce9bfe8f77d021b4
|
/app/src/main/java/com/example/apsystem/dummy/DummyContent.java
|
21bfbc15177886ffc239a52225ac9c4d53def865
|
[] |
no_license
|
aarongellado/APSystem
|
92ae7a5f767940977fdbe2d18e4236a9f1f99be5
|
99ff271e34478252e894410c612dd2f4f1ff3c15
|
refs/heads/master
| 2023-04-24T09:13:19.547885 | 2021-05-12T12:43:11 | 2021-05-12T12:43:11 | 366,713,421 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,941 |
java
|
package com.example.apsystem.dummy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Helper class for providing sample content for user interfaces created by
* Android template wizards.
* <p>
* TODO: Replace all uses of this class before publishing your app.
*/
public class DummyContent {
/**
* An array of sample (dummy) items.
*/
public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
/**
* A map of sample (dummy) items, by ID.
*/
public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
private static final int COUNT = 25;
static {
// Add some sample items.
for (int i = 1; i <= COUNT; i++) {
addItem(createDummyItem(i));
}
}
private static void addItem(DummyItem item) {
ITEMS.add(item);
ITEM_MAP.put(item.id, item);
}
private static DummyItem createDummyItem(int position) {
return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position));
}
private static String makeDetails(int position) {
StringBuilder builder = new StringBuilder();
builder.append("Details about Item: ").append(position);
for (int i = 0; i < position; i++) {
builder.append("\nMore details information here.");
}
return builder.toString();
}
/**
* A dummy item representing a piece of content.
*/
public static class DummyItem {
public final String id;
public final String content;
public final String details;
public DummyItem(String id, String content, String details) {
this.id = id;
this.content = content;
this.details = details;
}
@Override
public String toString() {
return content;
}
}
}
|
[
"[email protected]"
] | |
4b415045600ff2109b66fa37066c726cfab64134
|
e98d42a598c362e413981f930550977502841a6c
|
/src/main/java/com/epam/jwd/core_final/service/impl/DefaultMissionService.java
|
78e9451c3f44b4d623085b4440d032d27f0edb3c
|
[] |
no_license
|
kir-ostapchuk/jwd-core-final
|
64b8890c54b4a272dae29b8364c2b839f93f6e66
|
6c8bf0c985c800f5062ae0169865d0cabbe20c02
|
refs/heads/master
| 2023-02-15T23:11:20.560508 | 2021-01-10T19:50:45 | 2021-01-10T19:50:45 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,542 |
java
|
package com.epam.jwd.core_final.service.impl;
import com.epam.jwd.core_final.context.ApplicationContext;
import com.epam.jwd.core_final.context.impl.NassaContext;
import com.epam.jwd.core_final.criteria.Criteria;
import com.epam.jwd.core_final.domain.CrewMember;
import com.epam.jwd.core_final.domain.FlightMission;
import com.epam.jwd.core_final.domain.MissionResult;
import com.epam.jwd.core_final.domain.Role;
import com.epam.jwd.core_final.domain.Spaceship;
import com.epam.jwd.core_final.exception.InvalidStateException;
import com.epam.jwd.core_final.factory.impl.FlightMissionFactory;
import com.epam.jwd.core_final.service.MissionService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Random;
import java.util.stream.Collectors;
public enum DefaultMissionService implements MissionService {
INSTANCE;
private static final ApplicationContext NASSA_CONTEXT = NassaContext.INSTANCE;
@Override
public List<FlightMission> findAllMissions() {
return new ArrayList<>(NASSA_CONTEXT.retrieveBaseEntityList(FlightMission.class));
}
@Override
public List<FlightMission> findAllMissionsByCriteria(Criteria<FlightMission> criteria) {
return new ArrayList<>(NASSA_CONTEXT.retrieveBaseEntityList(FlightMission.class)).stream()
.filter(criteria::matches)
.collect(Collectors.toList());
}
@Override
public Optional<FlightMission> findMissionByCriteria(Criteria<FlightMission> criteria) {
return new ArrayList<>(NASSA_CONTEXT.retrieveBaseEntityList(FlightMission.class)).stream()
.filter(criteria::matches)
.findFirst();
}
@Override
public FlightMission updateFlightMissionDetails(FlightMission flightMission) {
Random random = new Random();
MissionResult missionResult = MissionResult.resolveMissionResultById(random.nextInt(5) + 1);
flightMission.setMissionResult(missionResult);
Spaceship spaceship = flightMission.getAssignedSpaceShip();
List<CrewMember> crewMembers = flightMission.getAssignedCrew();
if (missionResult.equals(MissionResult.COMPLETED) || missionResult.equals(MissionResult.CANCELLED)) {
DefaultSpaceshipService.INSTANCE.findAllSpaceships().stream()
.filter(s -> s.equals(spaceship))
.findFirst()
.ifPresent(s -> s.setReadyForNextMissions(true));
for (CrewMember crewMember : DefaultCrewService.INSTANCE.findAllCrewMembers()) {
if (crewMembers.contains(crewMember)) {
crewMember.setReadyForNextMissions(true);
}
}
}
return flightMission;
}
@Override
public FlightMission createMission(FlightMission flightMission) throws InvalidStateException {
FlightMission newFlightMission = FlightMissionFactory.INSTANCE.create(
flightMission.getName(), flightMission.getStartDate(),
flightMission.getStartDate(), flightMission.getDistance());
Spaceship spaceshipToAssign = findSpaceshipToAssign(newFlightMission);
spaceshipToAssign.setReadyForNextMissions(false);
DefaultSpaceshipService.INSTANCE.findAllSpaceships().stream()
.filter(s -> s.equals(spaceshipToAssign))
.findFirst()
.ifPresent(s -> s.setReadyForNextMissions(false));
newFlightMission.setAssignedSpaceShip(spaceshipToAssign);
List<CrewMember> crewToAssign = findCrewToAssign(newFlightMission);
for (CrewMember crewMember : DefaultCrewService.INSTANCE.findAllCrewMembers()) {
for (CrewMember crewMemberToAssign : crewToAssign) {
if (crewMember.equals(crewMemberToAssign)) {
crewMember.setReadyForNextMissions(false);
crewMemberToAssign.setReadyForNextMissions(false);
}
}
}
newFlightMission.setAssignedCrew(crewToAssign);
NASSA_CONTEXT.addEntityToStorage(newFlightMission, FlightMission.class);
return newFlightMission;
}
private Spaceship findSpaceshipToAssign(FlightMission flightMission) throws InvalidStateException {
return new ArrayList<>(NASSA_CONTEXT.retrieveBaseEntityList(Spaceship.class)).stream()
.filter(spaceship -> spaceship.getFlightDistance() >= flightMission.getDistance())
.filter(spaceship -> spaceship.getReadyForNextMissions().equals(true))
.findFirst()
.orElseThrow(() -> new InvalidStateException("Cannot assign spaceship to mission"));
}
private List<CrewMember> findCrewToAssign(FlightMission flightMission) throws InvalidStateException {
ArrayList<CrewMember> crewMembers = new ArrayList<>(NASSA_CONTEXT.retrieveBaseEntityList(CrewMember.class));
Map<Role, Short> assignedCrew = flightMission.getAssignedSpaceShip().getCrew();
List<CrewMember> neededCrew = new ArrayList<>();
for (Role role : assignedCrew.keySet()) {
neededCrew.addAll(crewMembers.stream()
.filter(crewMember -> crewMember.getRole().equals(role))
.limit(assignedCrew.get(role))
.collect(Collectors.toList()));
}
if (neededCrew.isEmpty()) {
throw new InvalidStateException("Cannot assign crew to mission");
}
return neededCrew;
}
}
|
[
"[email protected]"
] | |
b39c14273000d4f119c5c473ffdccd3e22102e19
|
d0d1fb9b51d3f23c6767a42289b103e78191b502
|
/industries-common/src/main/java/com/youedata/cd/common/util/IndexUtil.java
|
8c6f33412fc05c26a74706e6e3863b7070489fed
|
[] |
no_license
|
fanxiaofei123/code
|
4639d5c7d89dcefeba0f6d7164aa3612951aa3c0
|
c16721dfe68b9e6daa439c9ee4eae86c9d219c91
|
refs/heads/master
| 2020-03-16T16:23:26.985079 | 2018-05-09T16:21:17 | 2018-05-09T16:21:17 | 132,782,666 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 588 |
java
|
package com.youedata.cd.common.util;
public class IndexUtil {
public static String assembleTimeCondition(String validTimeStr) {
String vTimeCondition = "";
if(YoueStringUtils.isEmpty(validTimeStr)) {
return vTimeCondition;
}
if (DateUtil.isYear(validTimeStr)) {
vTimeCondition = "%Y";
} else if (DateUtil.isMonth(validTimeStr)){
vTimeCondition = "%m";
} else if (DateUtil.isYearAndMonth(validTimeStr)) {
vTimeCondition = "%Y-%m";
} else if (DateUtil.isDate(validTimeStr)) {
vTimeCondition = "%Y-%m-%d";
}
return vTimeCondition;
}
}
|
[
"[email protected]"
] | |
1012a69bf63c8454051137d2248da8c35f340409
|
7ac68ee038e6c5377b02809a943482feb5a29ca0
|
/src/test/java/test_classes/test_for_mozilla.java
|
99bbb29d603bf0733d6b6935a94ee5300255364e
|
[] |
no_license
|
varda123/assign
|
3daa6e085a18e2c2f7f1ac6a14cc7d34ed98a446
|
e2e8df6afbdb514390380d81b5c4eb4cd74f121c
|
refs/heads/master
| 2020-03-23T05:33:51.944061 | 2018-07-16T14:41:32 | 2018-07-16T14:41:32 | 141,151,731 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 476 |
java
|
package test_classes;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.Test;
import action_classes.action_demo;
import base_classes.Driver;
public class test_for_mozilla {
Driver driverObject;
action_demo actionObject;
@Test
public void testingForMozilla()
{
driverObject=new Driver();
WebDriver driver=driverObject.getDriver();
System.out.println(driver);
actionObject=new action_demo(driver);
System.out.println("successfully passed");
}
}
|
[
"[email protected]"
] | |
c3d732d9b210232660d9ffad8058cb37ecdfbcd0
|
850496ebbb409a1f4f1258cdcd6459336079b45a
|
/src/main/java/de/skiptag/whenjs/js/RhinoRunner.java
|
9ba4ada0387f9bbb4d08e4c8c3804a11bbc59468
|
[] |
no_license
|
cgrotz/whenjs-rhino-example
|
416f805090677d706ebe6d5d602f5b36b9f571d5
|
da6c504012dfd6756fa5e86783d6816fb099b634
|
refs/heads/master
| 2021-01-13T01:29:07.100350 | 2013-06-11T09:39:00 | 2013-06-11T09:39:00 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,760 |
java
|
package de.skiptag.whenjs.js;
import java.util.Map;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
import org.mozilla.javascript.commonjs.module.Require;
import org.mozilla.javascript.commonjs.module.RequireBuilder;
import com.google.common.collect.Maps;
public class RhinoRunner {
private ResourceLoader resourceLoader;
public static ThreadLocal<ScriptableObject> scope = new ThreadLocal<>();
private String scriptName;
public RhinoRunner(String scriptName) {
this.resourceLoader = new ResourceLoader();
this.scriptName = scriptName;
}
private void addConsoleToScope(ScriptableObject scope) {
Object console = Context.javaToJS(new Console(), scope);
ScriptableObject.putProperty(scope, "console", console);
}
private Require createAndInstallRequire(Context cx, ScriptableObject scope) {
RequireBuilder rb = new RequireBuilder();
rb.setSandboxed(false);
rb.setModuleScriptProvider(new ModuleScriptProvider(resourceLoader));
Require require = rb.createRequire(cx, scope);
return require;
}
@SuppressWarnings("unused")
public void start() throws Exception {
Context cx = Context.enter();
cx.setOptimizationLevel(2);
try {
scope.set(cx.initStandardObjects());
addConsoleToScope(scope.get());
scope.get().defineFunctionProperties(new String[] { "setTimeout" }, ConstantMethods.class,
ScriptableObject.DONTENUM);
Require require = createAndInstallRequire(cx, scope.get());
Scriptable script = require.requireMain(cx, scriptName);
} finally {
Context.exit();
}
}
public static ScriptableObject getScope() {
return scope.get();
}
}
|
[
"[email protected]"
] | |
39969d9c95b1e7736129cf7534d4534f3e1fbe44
|
6459899d8e246273affb39df61883f7679f579f7
|
/android/app/src/main/java/com/module02lessons/MainApplication.java
|
da2c0eb308f91c85fc43f9eb5a5236bc0251e2b8
|
[] |
no_license
|
tarcisiopgs/react-native-lessons-module-02
|
f6f4b27743d9cba5cfa18f6e0afc07160dd9abb3
|
f23a15cbe4bdcaf79cb8399348488ce10158f4ea
|
refs/heads/master
| 2022-12-12T13:40:51.745561 | 2019-05-30T23:20:36 | 2019-05-30T23:20:36 | 188,895,937 | 0 | 0 | null | 2022-12-09T04:08:52 | 2019-05-27T19:05:11 |
JavaScript
|
UTF-8
|
Java
| false | false | 1,355 |
java
|
package com.module02lessons;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage(),
new AsyncStoragePackage(),
new RNGestureHandlerPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
|
[
"[email protected]"
] | |
6aa165fab99b388319ddd03560ab21e91b933e56
|
3b76056bebbf834d29cbf82ed57fd273d442f39f
|
/pptviewer/app/src/main/java/org/openxmlformats/schemas/presentationml/x2006/main/STPlaceholderType.java
|
769b1bfb07c200d58a017548d8a5f7a5a4771dd8
|
[] |
no_license
|
PetarPeric/pptviewer
|
52dc428e2eb2bc3e3d82deaff11d8be0fc06cf96
|
533c0b504e5139779fbf61fa75c403b0b3190399
|
refs/heads/master
| 2020-03-27T19:56:32.669031 | 2018-10-10T10:39:27 | 2018-10-10T10:39:27 | 147,023,279 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,864 |
java
|
/*
* XML Type: ST_PlaceholderType
* Namespace: http://schemas.openxmlformats.org/presentationml/2006/main
* Java type: org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType
*
* Automatically generated - do not modify.
*/
package org.openxmlformats.schemas.presentationml.x2006.main;
/**
* An XML ST_PlaceholderType(@http://schemas.openxmlformats.org/presentationml/2006/main).
*
* This is an atomic type that is a restriction of org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType.
*/
public interface STPlaceholderType extends org.apache.xmlbeans.XmlToken
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)
org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(STPlaceholderType.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707").resolveHandle("stplaceholdertypeca72type");
org.apache.xmlbeans.StringEnumAbstractBase enumValue();
void set(org.apache.xmlbeans.StringEnumAbstractBase e);
static final Enum TITLE = Enum.forString("title");
static final Enum BODY = Enum.forString("body");
static final Enum CTR_TITLE = Enum.forString("ctrTitle");
static final Enum SUB_TITLE = Enum.forString("subTitle");
static final Enum DT = Enum.forString("dt");
static final Enum SLD_NUM = Enum.forString("sldNum");
static final Enum FTR = Enum.forString("ftr");
static final Enum HDR = Enum.forString("hdr");
static final Enum OBJ = Enum.forString("obj");
static final Enum CHART = Enum.forString("chart");
static final Enum TBL = Enum.forString("tbl");
static final Enum CLIP_ART = Enum.forString("clipArt");
static final Enum DGM = Enum.forString("dgm");
static final Enum MEDIA = Enum.forString("media");
static final Enum SLD_IMG = Enum.forString("sldImg");
static final Enum PIC = Enum.forString("pic");
static final int INT_TITLE = Enum.INT_TITLE;
static final int INT_BODY = Enum.INT_BODY;
static final int INT_CTR_TITLE = Enum.INT_CTR_TITLE;
static final int INT_SUB_TITLE = Enum.INT_SUB_TITLE;
static final int INT_DT = Enum.INT_DT;
static final int INT_SLD_NUM = Enum.INT_SLD_NUM;
static final int INT_FTR = Enum.INT_FTR;
static final int INT_HDR = Enum.INT_HDR;
static final int INT_OBJ = Enum.INT_OBJ;
static final int INT_CHART = Enum.INT_CHART;
static final int INT_TBL = Enum.INT_TBL;
static final int INT_CLIP_ART = Enum.INT_CLIP_ART;
static final int INT_DGM = Enum.INT_DGM;
static final int INT_MEDIA = Enum.INT_MEDIA;
static final int INT_SLD_IMG = Enum.INT_SLD_IMG;
static final int INT_PIC = Enum.INT_PIC;
/**
* Enumeration value class for org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType.
* These enum values can be used as follows:
* <pre>
* enum.toString(); // returns the string value of the enum
* enum.intValue(); // returns an int value, useful for switches
* // e.g., case Enum.INT_TITLE
* Enum.forString(s); // returns the enum value for a string
* Enum.forInt(i); // returns the enum value for an int
* </pre>
* Enumeration objects are immutable singleton objects that
* can be compared using == object equality. They have no
* public constructor. See the constants defined within this
* class for all the valid values.
*/
static final class Enum extends org.apache.xmlbeans.StringEnumAbstractBase
{
/**
* Returns the enum value for a string, or null if none.
*/
public static Enum forString(java.lang.String s)
{ return (Enum)table.forString(s); }
/**
* Returns the enum value corresponding to an int, or null if none.
*/
public static Enum forInt(int i)
{ return (Enum)table.forInt(i); }
private Enum(java.lang.String s, int i)
{ super(s, i); }
static final int INT_TITLE = 1;
static final int INT_BODY = 2;
static final int INT_CTR_TITLE = 3;
static final int INT_SUB_TITLE = 4;
static final int INT_DT = 5;
static final int INT_SLD_NUM = 6;
static final int INT_FTR = 7;
static final int INT_HDR = 8;
static final int INT_OBJ = 9;
static final int INT_CHART = 10;
static final int INT_TBL = 11;
static final int INT_CLIP_ART = 12;
static final int INT_DGM = 13;
static final int INT_MEDIA = 14;
static final int INT_SLD_IMG = 15;
static final int INT_PIC = 16;
public static final org.apache.xmlbeans.StringEnumAbstractBase.Table table =
new org.apache.xmlbeans.StringEnumAbstractBase.Table
(
new Enum[]
{
new Enum("title", INT_TITLE),
new Enum("body", INT_BODY),
new Enum("ctrTitle", INT_CTR_TITLE),
new Enum("subTitle", INT_SUB_TITLE),
new Enum("dt", INT_DT),
new Enum("sldNum", INT_SLD_NUM),
new Enum("ftr", INT_FTR),
new Enum("hdr", INT_HDR),
new Enum("obj", INT_OBJ),
new Enum("chart", INT_CHART),
new Enum("tbl", INT_TBL),
new Enum("clipArt", INT_CLIP_ART),
new Enum("dgm", INT_DGM),
new Enum("media", INT_MEDIA),
new Enum("sldImg", INT_SLD_IMG),
new Enum("pic", INT_PIC),
}
);
private static final long serialVersionUID = 1L;
private java.lang.Object readResolve() { return forInt(intValue()); }
}
/**
* A factory class with static methods for creating instances
* of this type.
*/
}
|
[
"[email protected]"
] | |
d4c00b2e633227228319aac845a62370f868fdc9
|
b88420efd383adf656684c656386d038dba0e818
|
/nabl2.solver/src/main/java/mb/nabl2/stratego/MessageTerms.java
|
d82124881860038f4e472557d0a05cf7672741da
|
[
"Apache-2.0"
] |
permissive
|
Taeir/nabl
|
cbbfc3c7bc86cd99fdaf2eedf98d7735b1061eb9
|
820b2c1086eb301e5775706782db0d506ee62ee8
|
refs/heads/master
| 2020-04-02T00:22:57.436878 | 2019-05-29T13:44:43 | 2019-05-29T13:44:43 | 153,801,718 | 0 | 0 |
Apache-2.0
| 2018-10-19T15:09:13 | 2018-10-19T15:09:12 | null |
UTF-8
|
Java
| false | false | 799 |
java
|
package mb.nabl2.stratego;
import static mb.nabl2.terms.build.TermBuild.B;
import org.metaborg.util.iterators.Iterables2;
import com.google.common.collect.ImmutableList;
import mb.nabl2.constraints.messages.IMessageInfo;
import mb.nabl2.terms.ITerm;
import mb.nabl2.terms.unification.IUnifier;
public class MessageTerms {
public static ITerm toTerms(Iterable<? extends IMessageInfo> messages, IUnifier unifier) {
return B.newList(
Iterables2.stream(messages).map(mi -> toTerm(mi, unifier)).collect(ImmutableList.toImmutableList()));
}
public static ITerm toTerm(IMessageInfo message, IUnifier unifier) {
return B.newTuple(message.getOriginTerm(),
B.newString(message.getContent().apply(unifier::findRecursive).toString()));
}
}
|
[
"[email protected]"
] | |
5d3025e2b062cdebbac148912d5664d2237ac305
|
dabb105e502db3ee7b6423a6fb94e6a037983170
|
/src/business/custom/impl/BusinessLayer.java
|
d5c7e48048f1193fd8957a5bd6132ad406549df9
|
[] |
no_license
|
weeroshara/Hotel_Management_System_With_Layeard_And_Hibernate
|
ab283164b6ea8ccc4f4d737c9c84cf86b0881eb8
|
807a1dd2029b8d8592e604d6b17a830344bcc0ba
|
refs/heads/master
| 2022-12-08T03:19:32.330148 | 2020-08-25T17:41:23 | 2020-08-25T17:41:23 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,275 |
java
|
package business.custom.impl;
import dao.DAOFactory;
import dao.DAOType;
import dao.SupperDAO;
import dao.custom.CustomerDAO;
import db.HibernateUtil;
import entity.Customer;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.CustomerTM;
import java.util.ArrayList;
import java.util.List;
public class BusinessLayer {
CustomerDAO customerDAO = DAOFactory.getInstance().getDAO(DAOType.CUSTOMER);
public List<CustomerTM> getAllCustomers(){
Session session = HibernateUtil.getSesionFactory().openSession();
Transaction tx=null;
List<CustomerTM> customerTMS=new ArrayList<>();
try {
tx=session.beginTransaction();
List<Customer> allCustomers = customerDAO.findAll();
for (Customer allCustomer : allCustomers) {
customerTMS.add(new CustomerTM(allCustomer.getNic(),allCustomer.getName(), allCustomer.getPhomeNumber(), allCustomer.getNoOfMembors()));
}
tx.commit();
}catch (Throwable th) {
th.printStackTrace();
tx.rollback();
}
return customerTMS;
// try {
// CustomerDAO customerDAO = DAOFactory.getInstance().getDAO(DAOType.CUSTOMER);
// List<Customer> allCustomers = customerDAO.findAll();
// List<CustomerTM> customerTMS=new ArrayList<>();
//
// for (Customer allCustomer : allCustomers) {
// customerTMS.add(new CustomerTM(allCustomer.getNic(),allCustomer.getName(), allCustomer.getPhomeNumber(), allCustomer.getNoOfMembors()));
// }
// return customerTMS;
// } catch (Exception e) {
// e.printStackTrace();
// return null;
// }
/*
CustomerDAO customerDao =DAOFactory.getInstance().getDao(DAOType.CUSTOMER);
List<Customer> allCustomersList =customerDao.findAll();
List<CustomerTM> customerTMS=new ArrayList<>();
for (Object allCustomers : allCustomersList) {
Customer allCustomer=(Customer)allCustomers;
customerTMS.add(new CustomerTM(allCustomer.getId(),allCustomer.getName(),allCustomer.getAddress()));
}
return customerTMS;
*/
}
//public Cus
}
|
[
"[email protected]"
] | |
fc11d2bc90d2f683065802c7078c6b4258724688
|
66237833741109858e3c6da3cf041a5d86f09726
|
/app/src/test/java/com/kson/ksonuploadfile/ExampleUnitTest.java
|
075fbb915bd41db2494cf439f7edb59681700994
|
[] |
no_license
|
KsonCode/KsonUploadFile
|
45c5b41f4fe88e8dd264d38a6c14bc4dcd142b7e
|
30a35b2481e29fa8ca7de751bdb495504d7c5e2b
|
refs/heads/master
| 2020-04-17T10:23:57.394594 | 2019-01-19T02:58:17 | 2019-01-19T02:58:17 | 166,499,702 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 384 |
java
|
package com.kson.ksonuploadfile;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
0cfb6267b09cf025e9b37684e04eb2d9ed091a6b
|
b92926502610b6c7593a3d261c975ecf8ab068cf
|
/app/src/main/java/ninja/taskbook/controller/profile/ProfileFragment.java
|
8ac56c22a190e006ddb3d870ec3eae676d5395c3
|
[] |
no_license
|
avgx/TaskBook.Android
|
193dfa4e7c4a36f020c3b2be7773f7862b4c6270
|
919a12e180d4233ddbaaa82790151244003eb153
|
refs/heads/master
| 2020-12-30T23:33:38.899830 | 2016-04-20T14:46:18 | 2016-04-20T14:46:18 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,157 |
java
|
package ninja.taskbook.controller.profile;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.apache.thrift.TException;
import ninja.taskbook.R;
import ninja.taskbook.model.network.thrift.manager.ThriftManager;
import ninja.taskbook.model.network.thrift.service.TaskBookService;
import ninja.taskbook.model.network.thrift.service.ThriftUserInfo;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.schedulers.Schedulers;
//----------------------------------------------------------------------------------------------------
public class ProfileFragment extends Fragment {
//----------------------------------------------------------------------------------------------------
TextView mNameTextView;
TextView mNicknameTextView;
//----------------------------------------------------------------------------------------------------
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
//----------------------------------------------------------------------------------------------------
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.profile, container, false);
// Name
mNameTextView = (TextView)rootView.findViewById(R.id.name_text_view);
mNameTextView.setText("name");
// Nickname
mNicknameTextView = (TextView)rootView.findViewById(R.id.nickname_text_view);
mNicknameTextView.setText("nickname");
// Load
loadProfileData();
return rootView;
}
//----------------------------------------------------------------------------------------------------
private void loadProfileData() {
Observable.just(0)
.map(new Func1<Integer, ThriftUserInfo>() {
@Override
public ThriftUserInfo call(Integer userId) {
try {
TaskBookService.Client client = (TaskBookService.Client)ThriftManager.createClient(ThriftManager.ClientTypeEnum.CLIENT.toString());
if (client != null)
return client.userInfo(userId);
} catch (TException e) {
e.printStackTrace();
}
return null;
}
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<ThriftUserInfo>() {
@Override
public void call(ThriftUserInfo result) {
mNameTextView.setText(result.getUserName());
mNicknameTextView.setText(result.getUserNickname());
}
});
}
}
|
[
"[email protected]"
] | |
6ee09fa04c91790d294f614a610d4c0acd4c8b19
|
4c98e0ba19382820ac497507ae223149dc472588
|
/src/main/java/com/sunil/api/ServletInitializer.java
|
e1316fdd318c4e8b6cea1c069f0a0892b7bc192c
|
[] |
no_license
|
sunilkumarvuppala/Spring-REST-template
|
4aabb99b59c2328adeefad99b64fdeef61ebf827
|
ce48e6a834fee808baf4ac008f3abcd08cf12df3
|
refs/heads/master
| 2021-06-13T22:37:58.406051 | 2017-04-27T18:51:31 | 2017-04-27T18:51:31 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 582 |
java
|
package com.sunil.api;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class ServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer{
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[]{WebConfig.class, JPAConfig.class, SwaggerConfig.class};
}
@Override
protected Class<?>[] getServletConfigClasses() {
return null;
}
@Override
protected String[] getServletMappings() {
return new String[]{"/api/*"};
}
}
|
[
"[email protected]"
] | |
fc70873c60a05feeb4ab77db455dcd2c06eaa9f0
|
874ac0a79e9d8001dfb9be8d4ab2c20460b851fe
|
/ax-java/src/main/java/com/g2forge/alexandria/java/concurrent/HConcurrent.java
|
114cc1784320fb22e49968c51bc9a053d33ef29e
|
[
"Unlicense",
"Apache-2.0"
] |
permissive
|
gdgib/alexandria
|
e644bcfcc99f67a244d823aed6af22bbb6f54266
|
e47cdd4b15b45ec668f09af8adfa3fccc68d0e27
|
refs/heads/master
| 2023-06-08T13:52:10.133484 | 2021-03-01T17:28:51 | 2021-03-01T17:28:51 | 118,267,424 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,234 |
java
|
package com.g2forge.alexandria.java.concurrent;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import com.g2forge.alexandria.annotations.note.Note;
import com.g2forge.alexandria.annotations.note.NoteType;
import com.g2forge.alexandria.java.core.marker.Helpers;
import lombok.experimental.UtilityClass;
@Helpers
@UtilityClass
public class HConcurrent {
private static <I, O> O internal(final Function<I, O> function, final I input, final Object[] locks, int offset) {
if (offset == locks.length - 1) return sync(function, input, locks[offset]);
else if (locks[offset] == null) return internal(function, input, locks, offset + 1);
else synchronized (locks[offset]) {
return internal(function, input, locks, offset + 1);
}
}
public static <I> void sync(final Consumer<I> consumer, final I input, final Object lock) {
if (lock == null) consumer.accept(input);
else synchronized (lock) {
consumer.accept(input);
}
}
public static <I, O> O sync(final Function<I, O> function, final I input, final Object lock) {
if (lock == null) return function.apply(input);
else synchronized (lock) {
return function.apply(input);
}
}
@Deprecated
@Note(type = NoteType.TODO, value = "This method makes it really easy to introduce deadlock, need to figure out whether to keep it around.")
public static <I, O> O sync(final Function<I, O> function, final I input, final Object... locks) {
if ((locks == null) || (locks.length < 1)) return function.apply(input);
else return internal(function, input, locks, 0);
}
public static void sync(final Runnable runnable, final Object lock) {
if (lock == null) runnable.run();
else synchronized (lock) {
runnable.run();
}
}
public static <O> O sync(final Supplier<O> supplier, final Object lock) {
if (lock == null) return supplier.get();
else synchronized (lock) {
return supplier.get();
}
}
public static void wait(int millis) {
wait(new Object(), millis);
}
public static void wait(Object object, int millis) {
synchronized (object) {
try {
object.wait(millis);
} catch (InterruptedException exception) {
Thread.currentThread().interrupt();
}
}
}
}
|
[
"[email protected]"
] | |
2fdf6c2bf686cbc97d2fdbea2fe1d77dc1ac2099
|
583063956ef4e1a699051369de497a34becdaf06
|
/CicadasCMS/CicadasCms/src/main/java/com/zhiliao/component/quartz/QuartzConfiguration.java
|
ffb5332e44d59cbffd2496ca0a3d3b10c1fa5c2b
|
[
"Apache-2.0"
] |
permissive
|
nhfc99/Springbootdemo
|
95e9d511318ddd61b05fdd3c549eb4ba984a3fe1
|
9e5f8524136a43f34ac8c2e73bf770a89880909d
|
refs/heads/master
| 2022-10-22T00:12:21.302452 | 2020-07-31T10:45:29 | 2020-07-31T10:45:29 | 181,144,765 | 0 | 0 | null | 2022-10-12T20:38:09 | 2019-04-13T08:48:34 |
TSQL
|
UTF-8
|
Java
| false | false | 2,413 |
java
|
package com.zhiliao.component.quartz;
import org.quartz.SchedulerException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import java.io.IOException;
import java.util.Properties;
/**
* 设置调度工厂,并返回调度管理器
*/
@Configuration
public class QuartzConfiguration {
// @Autowired
// @Qualifier("quartzDataSource")
// private DataSource dataSource;
//
// @Autowired
// @Qualifier("quartzTransactionManager")
// private DataSourceTransactionManager transactionManager;
@Bean
public SchedulerFactoryBean getSchedulerFactoryBean() throws IOException, SchedulerException {
SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
schedulerFactoryBean.setSchedulerName("CRMscheduler");
// schedulerFactoryBean .setDataSource(dataSource);
// schedulerFactoryBean .setTransactionManager(transactionManager);
schedulerFactoryBean.setQuartzProperties(this.quartzProperties());
schedulerFactoryBean.setApplicationContextSchedulerContextKey("applicationContextKey");
schedulerFactoryBean.setOverwriteExistingJobs(true);
schedulerFactoryBean.setAutoStartup(true);
schedulerFactoryBean.setStartupDelay(30);
return schedulerFactoryBean;
}
public Properties quartzProperties() throws IOException {
Properties prop = new Properties();
prop.put("quartz.scheduler.instanceName", "CRMscheduler");
prop.put("org.quartz.scheduler.instanceId", "AUTO");
prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
prop.put("org.quartz.threadPool.threadCount", "20");
prop.put("org.quartz.threadPool.threadPriority", "5");
// prop.put("org.quartz.jobStore.class","org.quartz.impl.jdbcjobstore.JobStoreTX");
// prop.put("org.quartz.jobStore.isClustered","true");
// prop.put("org.quartz.jobStore.clusterCheckinInterval","10000");
// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime","1");
// prop.put("org.quartz.jobStore.misfireThreshold","120000");
// prop.put("org.quartz.jobStore.tablePrefix","qrtz_");
return prop;
}
}
|
[
"[email protected]"
] | |
aad3ffdc68ef93162555fb0778fb8fb9c0d903f7
|
ec62562f1a3ef58ed205e76efa8a11e343beb3db
|
/src/Screen/Screen.java
|
810bb1457e18c7d0a5fad2bf8b9a853ea69d8ecd
|
[] |
no_license
|
ClaudiaRogoz/Projectiles-POO
|
b9f03200e9f141281080994812295adb2f5ffe68
|
8696ce29427c3da7b7d7b478a158499e4003bb23
|
refs/heads/master
| 2021-01-16T18:20:53.123285 | 2015-04-09T17:41:05 | 2015-04-09T17:41:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,731 |
java
|
package Screen;
import ProcessingManagers.DrawManager;
import Shapes.Point;
/**
* Class that represents the screen to be projected on
*/
public class Screen {
private char[][] matrix;
/**
* Builds the necessary data of the screen
*
* @param sizeX screen size on X axis
* @param sizeY screen size on Y axis
*/
public Screen(int sizeX, int sizeY) {
// TODO
setMatrix(new char[sizeX][sizeY]);
for (int i = 0; i< sizeX ; i++)
for (int j = 0;j < sizeY ; j++)
matrix[i][j] = '.';
}
/**
* Draws a line on the screen between the given points
*
* @param startPoint the first end of the line
* @param endPoint the second end of the line
* @param symbol the symbol the line is drawn with
*/
public void drawLineOnScreen(Point startPoint, Point endPoint,
char symbol) {
DrawManager.drawLine(matrix, startPoint, endPoint, symbol);
}
/**
* Draws multiple lines, each defined by startPoints[index] and
* endPoints[index]
*
* @param startPoints array of first ends of the lines
* @param endPoints array of second ends of the lines
* @param symbol the symbol with which ALL lines are drawn
*/
public void drawMultipleLinesOnScreen(Point[] startPoints,
Point[] endPoints, char symbol) {
for (int i = 0; i< startPoints.length ; i++){
DrawManager.drawLine(matrix, startPoints[i], endPoints[i], symbol);
}
}
/*
* Returns the matrix
*
* @return matrix
*/
public char[][] getMatrix() {
return matrix;
}
/*
* Sets the current matrix
*
* @param matrix matrix to be set to
*/
public void setMatrix(char[][] matrix) {
this.matrix = matrix;
}
}
|
[
"[email protected]"
] | |
cee414ea1baa7c3f48715660cc7fd1ecf019bdad
|
6afe8f14f8a4a83c5a569489e66201e6d1694bb4
|
/spring/document-upload/src/main/java/io/ashimjk/document/upload/api/DocumentResource.java
|
1fb25cc7b58cf58d73ab00bcfd4f07857a0799ff
|
[
"MIT"
] |
permissive
|
ashimjk/ajk-research
|
64e70a47e04fb7574a3aa865411a518655953345
|
a4061a6451229e0a49dac8818e51370c9bda53e4
|
refs/heads/master
| 2023-01-13T00:50:41.310847 | 2020-05-02T18:10:08 | 2020-05-02T18:10:08 | 183,064,897 | 2 | 0 |
MIT
| 2023-01-07T22:10:27 | 2019-04-23T17:34:13 |
Java
|
UTF-8
|
Java
| false | false | 1,014 |
java
|
package io.ashimjk.document.upload.api;
import io.ashimjk.document.upload.contracts.entity.UploadedDocumentEntity;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class DocumentResource {
private String parentModuleRef;
private String moduleRef;
private String fileId;
private String fileName;
private String fileType;
private LocalDateTime creationDate;
private String category;
public static DocumentResource create(UploadedDocumentEntity document) {
DocumentResource resource = new DocumentResource();
resource.setParentModuleRef(document.getModuleParentReference());
resource.setModuleRef(document.getModuleReference());
resource.setFileId(document.getReference());
resource.setCreationDate(document.getCreationDate());
resource.setCategory(document.getCategory());
resource.setFileName(document.getFileName());
resource.setFileType(document.getFileType());
return resource;
}
}
|
[
"[email protected]"
] | |
75d973dbaf4e1e4330c535834b9a151af5fc3a8e
|
4915e003f611f83be1b3fed2732ea2fc059f9c30
|
/MallSDK/src/main/java/com/iec/core/app/utils/ToHtmlUtils.java
|
096c0bc540c6503dea3109c81fd80447394494fb
|
[] |
no_license
|
cwt13579/MallParent
|
afdbfb86ba43b5f7893fddb003e9827517a105db
|
65d259b46dd69b11378a1ae27da96ef085d7de8d
|
refs/heads/master
| 2021-05-16T17:32:51.524441 | 2017-09-10T07:01:35 | 2017-09-10T07:01:35 | 103,008,532 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,280 |
java
|
package com.iec.core.app.utils;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Map;
import org.apache.log4j.Logger;
/**
* 根据url生成html文件
* @author LiuSQ
*
*/
public class ToHtmlUtils {
private final static Logger logger = Logger.getLogger(ToHtmlUtils.class);
private static Map<String,String> paramMap = ToHtmlProperties.getloadProManager().getMap();
/**
* 生成静态页
* @param srcUrl 源url
* @param destPath 目标生成路径
* @return
*/
public static boolean toHtml(String srcUrl,String destPath){
logger.info("==========create html params srcUrl "+srcUrl);
logger.info("==========create html params destPath "+destPath);
BufferedReader reader = null;
BufferedWriter writer = null;
try {
/****建立连接****/
URL url = new URL(srcUrl);
URLConnection uu = url.openConnection();
/****读取一行 写入一行****/
//读取流
reader = new BufferedReader(new InputStreamReader(uu.getInputStream(),"utf-8"));
//写入流
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(destPath),"utf-8"));
String line = null;
while((line=reader.readLine()) != null){
line = line.replaceAll(paramMap.get("local_url"),paramMap.get("server_url"));
writer.write(line);
writer.newLine();
}
return true;
} catch (MalformedURLException e) {
e.printStackTrace();
logger.error(e);
return false;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
logger.error(e);
return false;
} catch (FileNotFoundException e) {
e.printStackTrace();
logger.error(e);
return false;
} catch (IOException e) {
e.printStackTrace();
logger.error(e);
return false;
} catch(Exception e){
e.printStackTrace();
logger.error(e);
return false;
}finally{
try {
if(reader != null){
reader.close();
reader = null;
}
if(writer != null){
writer.close();
writer = null;
}
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
}
public static void main(String[] args){
//toHtml("http://mcs.iecmall.com:8081/Merchant/getServiceList.do?UI=allAppListUI&serv_type=0","E://123.html");
/*String s = "/McsWeb/Merchant/pushMessage.do";
System.out.println(StringUtils.substringBefore(StringUtils.substringAfterLast(s,"/"),"."));
System.out.println(StringUtils.substringAfterLast(StringUtils.substringBeforeLast(s,"/"), "/") );*/
/* String s = "http://mcs.berchina.com:8081/";
System.out.println(System.getProperty("user.dir"));*/
String line = "http://127.0.0.1:80/McsWeb/js/xmlhttp.js";
line = line.replaceAll("127.0.0.1","iuy");
System.out.println(line);
}
}
|
[
"[email protected]"
] | |
6fd3738b8559c415d0b7282f9042943cca029230
|
2785a80b93332fb4ee0df8a4a28f9cd4d8fde1f3
|
/just/src/test/java/vending/machine/TestVendingMachine.java
|
f006f7f065f9a85433ab3d1519d27b50e9f6b879
|
[] |
no_license
|
JaeGyu/just
|
7836f02eda99f0d9ee1c4916dfd18bf91205cf93
|
69ceb2c0c27da5a84e7459906298e12f0fd4ee46
|
refs/heads/master
| 2021-01-16T23:27:45.054118 | 2017-04-19T07:24:44 | 2017-04-19T07:24:44 | 54,477,136 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,044 |
java
|
package vending.machine;
import static org.junit.Assert.*;
import org.junit.Test;
public class TestVendingMachine {
/*
* 자판기
* 메뉴
* 1. 비타500 800원
* 2. 맥스웰 700원
* 3. 파워에이드 1000원
* 4. 게토레이드 1200원
* 5. 삼다수 800원
*
* 불량 돈을 넣으면 뱉어냄
* 돈이 투입되면 구입 할 수 있는 음료수들을 알 수 있음
* 재고가 있을 경우에만 위의 요구사항이 됨
* 재고가 없는 음료수는 재고 없음으로 표시됨
* 거스름 반환 레버를 돌리면 투입한 돈과 남아 있는 돈은 반환 됨
*
* 돈은 10000원 이상은 투입 못함(이상한 돈으로 분류 됨)
*
* */
@Test
public void test() throws Exception {
}
/*
* 테스트 시나리오
* 1. vm에 음료수를 추가한다.
* 2. 위에서 추가한 음료수가 vm에 적재 되었는지 조회 해본다.
* */
@Test
public void testVendingMachine() throws Exception{
VendingMachine vm = new VendingMachine();
}
}
|
[
"[email protected]"
] | |
5f3c7b1d05f011f5604643de5a2e81ddedb8502b
|
0c92d5fdf947dd30d8fbe5dc51f806f4518b806d
|
/service/service_userCenter/src/main/java/com/yxy/service_userCenter/bean/ServiceTablescore.java
|
0ef111a874c2f2de33edab4dd5c77af777cb336d
|
[] |
no_license
|
YXY-121/BIGMOON
|
9cb40d6e86e04e721fa72e4bb1011a88c52d7978
|
ff74e751d8e2d15846b7493d9688dc78b970980a
|
refs/heads/master
| 2022-07-15T21:12:53.034064 | 2021-02-21T01:56:51 | 2021-02-21T01:56:51 | 230,357,167 | 0 | 1 | null | 2022-07-07T20:56:21 | 2019-12-27T02:15:33 |
Java
|
UTF-8
|
Java
| false | false | 1,001 |
java
|
package com.yxy.service_userCenter.bean;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author yxy
* @since 2021-02-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ServiceTablescore对象", description="")
public class ServiceTablescore implements Serializable {
private static final long serialVersionUID=1L;
@TableField("lessonName")
private String lessonName;
@TableField("userId")
private String userId;
@TableField("attributeName")
private String attributeName;
@TableField("score")
private Float score;
@TableField("year")
private int year;
}
|
[
"[email protected]"
] | |
c94b443df5e21ba497ffcb6cd1df546199cb4c5a
|
fe2d2726cd8b18f486161e1748b960f250202cd9
|
/Text2Speech/src/java/Home2ControlServlet.java
|
0cf83d0d97dcb1af881546480787ee70c3c0e9fe
|
[] |
no_license
|
bangpc/Text2Speech_FPTAI
|
5d730a0cdcfcadc13f8c6571b0f8dab7f468a940
|
2f24b72583f1c2db207724df07d0fad0d488e175
|
refs/heads/master
| 2020-08-21T11:19:54.968629 | 2020-02-17T07:41:17 | 2020-02-17T07:41:17 | 216,148,144 | 3 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,489 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author BangPC
*/
public class Home2ControlServlet extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("utf-8");
try (PrintWriter out = response.getWriter()) {
if (request.getParameter("start") != null) {
if (request.getParameter("name").isEmpty()) {
request.setAttribute("error", "Hãy nhập tên của bạn để tiếp tục");
RequestDispatcher rd = request.getRequestDispatcher("HomePage.jsp");
rd.forward(request, response);
}if(!request.getParameter("name").isEmpty()){
request.setAttribute("start_name", request.getParameter("name"));
RequestDispatcher rd = request.getRequestDispatcher("ControlSevlet");
rd.forward(request, response);
}
}
if (request.getParameter("start") == null) {
RequestDispatcher rd = request.getRequestDispatcher("HomePage.jsp");
rd.forward(request, response);
}
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
|
[
"[email protected]"
] | |
13ef7446c33c59a122a17f100b6c436d5bf6a978
|
95421c391f3ba0993cc60cee4cc0a90b072b90e9
|
/chapter_001/src/main/java/ru/job4j/calculator/Fit.java
|
5382f2f2e3cdd71e4ccd2199f850f05052702440
|
[] |
no_license
|
evgenia9360/job4j
|
7f6cf5d3cb139036553ec18700fad6714758e9ca
|
531a25c887363f34d9c92ad1c7b2b2744b722191
|
refs/heads/master
| 2021-07-16T10:27:21.425178 | 2019-11-30T13:23:35 | 2019-11-30T13:23:35 | 217,848,145 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,179 |
java
|
package ru.job4j.calculator;
/**
* Калькулятор соответствия веса и роста.
*/
public class Fit {
/**
* Формула идеального веса мужчины и женщины.
*
* @param height рост в метрах.
* @return идеальный вес.
*/
public static double manWeight(double height) {
/**
* Формула идеального веса мужчины.
*/
return (height - 100) * 1.15;
}
public static double womanWeight(double height) {
/**
* формула идеального веса женщины.
*/
return (height - 110) * 1.15;
}
/**
* Вывод в консоль с новой строки идеального веса мужчины и женщины для заданного роста.
*
* @param args параметры.
*/
public static void main(String[] args) {
double man = manWeight(180);
double woman = womanWeight(164);
System.out.println("Man 180 is " + man);
System.out.println("Woman 164 is " + woman);
}
}
|
[
"[email protected]"
] | |
1c4e45bfe7427011eaa27e77d5ee265390088349
|
b1afc6f585b00f5dc1b53d0f95e26ee238a93fa8
|
/app/src/main/java/com/example/akash/splashactivityex/SplashActivity.java
|
ba05d5d5c47324f3a0bf5b423d2425dfe520bda9
|
[] |
no_license
|
AkashDhanwani/SplashAct
|
fe7b2914ca0a1c27bb9b874480be6d93ff5d5a18
|
f1344d2a8cffd02c94d0eb36989a0a6c0991394f
|
refs/heads/master
| 2021-08-31T07:10:21.525895 | 2017-12-20T16:14:29 | 2017-12-20T16:14:29 | 114,690,517 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,205 |
java
|
package com.example.akash.splashactivityex;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
public class SplashActivity extends AppCompatActivity {
ImageView iv1;
Animation animation;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
iv1 = findViewById(R.id.iv1);
iv1 = (ImageView) findViewById(R.id.iv1);
animation = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.custom);
iv1.startAnimation(animation);
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(4000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Intent i = new Intent(getApplicationContext(),MainActivity.class);
startActivity(i);
finish();
}
}).start();
}
}
|
[
"[email protected]"
] | |
7323e44befdf0b1d7ea506a5dfadfdbbaa78bb39
|
62b36b279296d999fbab6df95309c05b45262f86
|
/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/CoreRoutingFileSystem.java
|
734b4775891a6a691034aa9b0570ca8920afbd20
|
[
"Apache-2.0"
] |
permissive
|
huwensen/intellij-community
|
2e84b5d447f0e8b227024190be5912b5feceec7c
|
abb490446a7f9abbc55f100b166cadee7dba60ae
|
refs/heads/master
| 2023-07-23T19:14:15.258542 | 2023-07-17T21:40:16 | 2023-07-18T02:33:37 | 201,616,287 | 1 | 0 |
Apache-2.0
| 2019-08-10T10:41:04 | 2019-08-10T10:41:03 | null |
UTF-8
|
Java
| false | false | 5,079 |
java
|
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.platform.core.nio.fs;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.UserPrincipalLookupService;
import java.nio.file.spi.FileSystemProvider;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
public class CoreRoutingFileSystem extends FileSystem {
private final CoreRoutingFileSystemProvider myProvider;
private final FileSystem myLocalFS;
private volatile FileSystem myMountedFS;
private volatile CoreRoutingFileSystemDelegate myDelegate;
private static volatile String ourMountedFSPrefix;
public CoreRoutingFileSystem(CoreRoutingFileSystemProvider provider, FileSystem localFS) {
myProvider = provider;
myLocalFS = localFS;
}
public void initialize(@NotNull String filesystemClassName, @Nullable Class<? extends CoreRoutingFileSystemDelegate> routingFilesystemDelegateClass) {
myMountedFS = CoreRoutingFileSystemProvider.createInstanceWithContextClassLoader(
filesystemClassName,
new Class[]{FileSystemProvider.class},
myProvider);
if (routingFilesystemDelegateClass != null) {
try {
myDelegate = routingFilesystemDelegateClass.getConstructor().newInstance();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
}
public static void setMountedFSPrefix(@NotNull String mountedFSPrefix) {
ourMountedFSPrefix = mountedFSPrefix;
}
public boolean isInitialized() {
return myMountedFS != null;
}
@Override
public FileSystemProvider provider() {
return myProvider;
}
@Override
public void close() {
throw new UnsupportedOperationException();
}
@Override
public boolean isOpen() {
return myLocalFS.isOpen() || myMountedFS != null && myMountedFS.isOpen();
}
@Override
public boolean isReadOnly() {
return myLocalFS.isReadOnly() && (myMountedFS == null || myMountedFS.isReadOnly());
}
@Override
public String getSeparator() {
return myLocalFS.getSeparator();
}
@Override
public Iterable<Path> getRootDirectories() {
Iterable<Path> roots = concat(myLocalFS.getRootDirectories(), myMountedFS == null ? Collections.emptyList() : myMountedFS.getRootDirectories());
return new Iterable<Path>() {
@Override
public Iterator<Path> iterator() {
Iterator<Path> iterator = roots.iterator();
return new Iterator<Path>() {
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public Path next() {
return CoreRoutingFileSystemProvider.path(CoreRoutingFileSystem.this, iterator.next());
}
};
}
};
}
@Override
public Iterable<FileStore> getFileStores() {
return concat(myLocalFS.getFileStores(), myMountedFS == null ? Collections.emptyList() : myMountedFS.getFileStores());
}
@Override
public Set<String> supportedFileAttributeViews() {
Set<String> result = new HashSet<>(myLocalFS.supportedFileAttributeViews());
if (myMountedFS != null) result.addAll(myMountedFS.supportedFileAttributeViews());
return result;
}
@Override
public Path getPath(String first, String... more) {
FileSystem fs = myMountedFS != null && isMountedFSFile(first) ? myMountedFS : myLocalFS;
Path result = CoreRoutingFileSystemProvider.path(this, fs.getPath(first, more));
CoreRoutingFileSystemDelegate delegate = myDelegate;
return delegate == null ? result : delegate.wrap(result);
}
@Override
public PathMatcher getPathMatcher(String syntaxAndPattern) {
return myLocalFS.getPathMatcher(syntaxAndPattern);
}
@Override
public UserPrincipalLookupService getUserPrincipalLookupService() {
return myLocalFS.getUserPrincipalLookupService();
}
@Override
public WatchService newWatchService() throws IOException {
return myLocalFS.newWatchService();
}
public boolean isMountedFSPath(CorePath path) {
if (path.isMountedFS()) return true;
CoreRoutingFileSystemDelegate delegate = myDelegate;
return delegate != null && delegate.isMountedFSPath(path);
}
public static boolean isMountedFSFile(String virtualFilePath) {
return CoreRoutingFileSystemProvider.normalizePath(virtualFilePath).startsWith(ourMountedFSPrefix);
}
private static <T> Iterable<T> concat(Iterable<T> first, Iterable<T> second) {
Stream<T> firstStream = StreamSupport.stream(first.spliterator(), false);
Stream<T> secondStream = StreamSupport.stream(second.spliterator(), false);
Stream<T> concat = Stream.concat(firstStream, secondStream);
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return concat.iterator();
}
};
}
}
|
[
"[email protected]"
] | |
e7e0eb8601dd7744a70e1e2b938aaeb8dcecdb45
|
7bea7fb60b5f60f89f546a12b43ca239e39255b5
|
/src/com/sun/source/tree/AnnotationTree.java
|
21c26d5e12947486cb20b2878a865af2de3f4197
|
[] |
no_license
|
sorakeet/fitcorejdk
|
67623ab26f1defb072ab473f195795262a8ddcdd
|
f946930a826ddcd688b2ddbb5bc907d2fc4174c3
|
refs/heads/master
| 2021-01-01T05:52:19.696053 | 2017-07-15T01:33:41 | 2017-07-15T01:33:41 | 97,292,673 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 365 |
java
|
/**
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.sun.source.tree;
import java.util.List;
@jdk.Exported
public interface AnnotationTree extends ExpressionTree{
Tree getAnnotationType();
List<? extends ExpressionTree> getArguments();
}
|
[
"panxiaoping@9af151c5-2e68-9a40-a710-8967c58c11f7"
] |
panxiaoping@9af151c5-2e68-9a40-a710-8967c58c11f7
|
852dcb13372f9a98dd0d078fadbf9d7fe624daf5
|
8d37e54d4cf58eff381575021bde456e09a85ef0
|
/comsumer-service/src/main/java/com/example/service/BlogServiceFallBack.java
|
9629420755d4c82e8cca0e0027fe078620d9ef69
|
[] |
no_license
|
LordFu/cloud-demo
|
dc86639394e56299008c6acb759674463e46b139
|
d50a7dc27d459565c5991d327bd92663c9acbe28
|
refs/heads/master
| 2020-08-27T20:14:21.777993 | 2019-10-25T07:50:43 | 2019-10-25T07:50:43 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 607 |
java
|
package com.example.service;
import com.example.bean.Blog;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 这是blogservice的熔断降级处理类,用于处理blogservice由于访问服务失败导致的阻塞的降级方案
*/
@Service//feign的熔断器类需要交个IOC容器管理因此需要添加注解
public class BlogServiceFallBack implements BlogService {
@Override
public Blog fingByTitle(String title) {
return new Blog("服务器挂了", "");
}
@Override
public List<Blog> findLis() {
return new ArrayList<>();
}
}
|
[
"[email protected]"
] | |
d52a9b859c87f282dc494199633b5ac14547d765
|
097c4edd313674ae22472655937de7da5c49e524
|
/src/main/java/com/kodilla/course/springhibernatecourse/csvconverter/ProductProcessor.java
|
2b2d195996af9e97498aa29d316f844167fe12c2
|
[] |
no_license
|
kszubra/kodilla-spring-hibernate-course
|
b8f6fdc850a85268019a8a66ed739fdb19daac36
|
1467f3f4c93a5d55ae406140ac8c109c66d11451
|
refs/heads/master
| 2023-08-22T04:59:36.324860 | 2021-10-20T14:34:24 | 2021-10-20T14:34:24 | 415,352,757 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 445 |
java
|
package com.kodilla.course.springhibernatecourse.csvconverter;
import org.springframework.batch.item.ItemProcessor;
public class ProductProcessor implements ItemProcessor<Product, Product> {
@Override
public Product process(Product item) throws Exception {
//cena zostanie podniesiona o 10% i zaokrąglona do liczb całkowitych
return new Product(item.getId(), item.getQuantity(), (int)(item.getPrice()*1.1));
}
}
|
[
"[email protected]"
] | |
181d0d42cb87f2339f610ef3e489b5a1e25a6165
|
ff6ed2f1c816ab509bd506030b95046962a0c34d
|
/src/main/java/com/lightmatter/util/TablesConstants.java
|
c6e4ac8a07780678aaacee874d1afd24f6534567
|
[] |
no_license
|
houyafei/sqlite_mybatis_template
|
906a92acfec49fb92cc2be7de1e04dc6b73e6d43
|
99da1bea875cce5721cb5e25739d72b7cc88b424
|
refs/heads/master
| 2022-11-16T21:56:29.865720 | 2020-07-13T01:12:54 | 2020-07-13T01:12:54 | 279,183,152 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 440 |
java
|
package com.lightmatter.util;
public class TablesConstants {
public static final String STUDENTS_TABLE_SQL ="" +
"CREATE TABLE IF NOT EXISTS student " +
" (" +
" id INTEGER not null primary key AUTOINCREMENT," +
" username varchar(40)," +
" password varchar(40)," +
" age INTEGER,"+
" tag varchar(255)"+
" );";
}
|
[
"[email protected]"
] | |
b18a3df06c53759695673ff0843d819f038003b8
|
aab24f7dd38c2f9fa6c8c8b9e5364c4b81b02b6b
|
/src/main/java/elemica/shipment/service/TariffService.java
|
9688b0043daafae2c90de953bbf7ceacfc861fb9
|
[] |
no_license
|
mailtoyankappa/ElEMICA
|
fa63ed8cc9a307259ad331b8880a370097279b61
|
be61ac6cb65b343e6988a6a638a60509b7536e2f
|
refs/heads/master
| 2023-06-01T05:32:37.319028 | 2021-07-12T04:39:31 | 2021-07-12T04:39:31 | 385,124,701 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,416 |
java
|
package elemica.shipment.service;
import elemica.shipment.models.ShipmentEntity;
import elemica.shipment.models.Tariff;
import elemica.shipment.models.VehicleEntity;
import elemica.shipment.repository.ShipmentEntityRepository;
import elemica.shipment.repository.TariffEntityRepository;
import elemica.shipment.repository.VehicleEntityRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.Comparator;
import java.util.List;
@Service
public class TariffService {
@Autowired
TariffEntityRepository tariffEntityRepository;
@Autowired
ShipmentEntityRepository shipmentEntityRepository;
@Autowired
VehicleEntityRepository vehicleEntityRepository;
@Transactional
public Tariff createShipment(Tariff tariff){
return createShipmentAndPersist(tariff);
}
public Tariff createShipmentAndPersist(Tariff tariff){
ShipmentEntity shipmentEntity = shipmentEntityRepository.getShipmentDetailsByName(tariff.getShipmentName());
List<VehicleEntity> vehicleEntity = vehicleEntityRepository.getVehicleDetailsByWeightCapacity(Integer.parseInt(shipmentEntity.getWeight().toString()));
Tariff finalTariff = calculateRateAndAssignDiscount(vehicleEntity, shipmentEntity, tariff);
Tariff entity = (Tariff) tariffEntityRepository.save(tariff);
return entity;
}
public <T> List<T> listShipment(){
return (List<T>) tariffEntityRepository.findAll();
}
public Tariff calculateRateAndAssignDiscount(List<VehicleEntity> vehicleEntities, ShipmentEntity shipmentEntity, Tariff tariff){
List<Tariff> finalTariff = (List<Tariff>) new Tariff();
Tariff result = new Tariff();
for(VehicleEntity vehicleEntity: vehicleEntities) {
Tariff tariff1 = new Tariff();
tariff1.setShipmentName(tariff.getShipmentName());
tariff1.setRatePerKG(tariff.getRatePerKG());
boolean eligibility = false;
double avg;
int diff, sum;
int weightCapacity = Integer.parseInt(vehicleEntity.getWeightCapacity().toString());
int shipmentWeight = Integer.parseInt(shipmentEntity.getWeight().toString());
int ratePerKG = Integer.parseInt(tariff.getRatePerKG().toString());
if(weightCapacity>=shipmentWeight) {
diff = Math.subtractExact(weightCapacity, shipmentWeight);
sum = Math.addExact(weightCapacity, shipmentWeight) / 2;
avg = Math.floorDiv(diff, sum);
if (avg<=30) {
eligibility = true;
tariff1.setDiscount(30);
}else {
tariff1.setDiscount(0);
}
}
tariff1.setCost(calcCost(shipmentWeight, ratePerKG, eligibility));
finalTariff.add(tariff1);
}
result = finalTariff.stream()
.min(Comparator.comparingInt(Tariff::getCost))
.get();
return result;
}
public int calcCost(int shipmentWeight, int ratePerKG, boolean eligibility){
int sum, discount;
sum = shipmentWeight * ratePerKG;
if(eligibility==true) {
discount = (sum * 30)/100;
sum = sum - discount;
}
return sum;
}
}
|
[
"[email protected]"
] | |
428f38a49c554882103a8a74a596ed5322ff919b
|
35f976528f65cdf2f813d1a8defbcddc647044ad
|
/src/main/java/com/example/javaWapp/HelloApplication.java
|
df7c7239df715728b5945958b49d2d4a51cdcc78
|
[] |
no_license
|
chanelle740/Student-management-system
|
e1c3dd651c05e246a179e459830bde6fb06532eb
|
16998a9933f123b234691db374eb8a64e58aa6f9
|
refs/heads/master
| 2023-05-02T07:47:25.108686 | 2021-05-26T12:24:23 | 2021-05-26T12:24:23 | 366,817,897 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 184 |
java
|
package com.example.javaWapp;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath("/api")
public class HelloApplication extends Application {
}
|
[
"[email protected]"
] | |
a7d589d16192a80423c8e5db3ee745613c61e928
|
af7d797ce14aa4a83709e53e8595246c00e5eb0a
|
/src/main/java/kr/co/ducktube/dao/HomeDao.java
|
7abff88994f38654914c0dfd40d4d2ddfdce2312
|
[] |
no_license
|
meaw2002/mw1Ducktube
|
a8c2b508e90cfd3e74183d095239f01d9d261732
|
04e147deeba7476065729c992e586af3ba51f4e2
|
refs/heads/master
| 2020-03-21T15:15:13.818486 | 2018-06-26T07:29:13 | 2018-06-26T07:29:13 | 138,702,047 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 770 |
java
|
package kr.co.ducktube.dao;
import java.util.List;
import kr.co.ducktube.vo.criteria.HomeCriteria;
import kr.co.ducktube.vo.criteria.LibraryCriteria;
import kr.co.ducktube.vo.page.LibrarySummary;
import kr.co.ducktube.vo.page.PopularListSummary;
import kr.co.ducktube.vo.table.User;
public interface HomeDao {
void playlistPreviewUpdate(HomeCriteria criteria);
void addPlaylistVideo(HomeCriteria criteria);
Integer getPlaylistVideoCount(int playlistNo);
void addPlaylist(HomeCriteria criteria);
void addWatchLater(HomeCriteria criteria);
LibrarySummary checkPlaylistVideo(HomeCriteria criteria);
LibrarySummary checkWatchLater(HomeCriteria criteria);
List<PopularListSummary> getPopularList(LibraryCriteria criteria);
User getUserByEmail(String email);
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.