blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f4714c622e69bce2855336486d47d1d77fae3586 | 86abb891438a71d2ed054447d3b7b157f4ae6257 | /Term Project/src/FileWriterReader/CustomFileReader.java | 6b5116d4c8c07a11273df0fe13ad03cfbdf7a96b | [] | no_license | ShanjinurIslam/Object-Oriented-Programming | 8e4142a62d53e401d7b491bd7fad08c74a96fe9a | 8f48bf14ab2d2308310d39b518ff9add756a3a6b | refs/heads/master | 2020-07-02T15:28:15.422305 | 2019-08-10T03:28:16 | 2019-08-10T03:28:16 | 201,572,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,045 | java | package FileWriterReader;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
/**
* Created by Spondon on 12/12/2016.
*/
public class CustomFileReader implements AutoCloseable {
private File file ;
private BufferedReader in ;
private String targetString ;
public CustomFileReader(File file) throws Exception {
this.file = file ;
in = new BufferedReader(new FileReader(file)) ;
}
public boolean isPresent(String targetString) throws Exception{
String tem ;
this.targetString = targetString ;
while ((tem=in.readLine())!=null){
if(tem.equals(targetString)){
return true ;
}
}
return false ;
}
public String copy() throws Exception{
String tem ;
String sout ="" ;
while ((tem=in.readLine())!=null){
sout += tem + "\n" ;
}
return sout ;
}
@Override
public void close() throws Exception {
in.close();
}
}
| [
"[email protected]"
] | |
a7571131213410b4fd87e29b3f196842e6ec1951 | 50b56568d6d31140464ce645228ade7fa08f5c22 | /src/test/java/org/wildfly/util/xml/to/cli/subsystem/SimpleSubsystemRemove.java | 1088f2cf5de2edb39b1234e10d30f09a6c92d922 | [] | no_license | kabir/wildfly-xml-to-cli | 916b67e66fa1470fd647e38e42274f87a3c5ede5 | a228f950027234203dcc9412d1be1d4f412a9e01 | refs/heads/master | 2022-09-28T15:32:45.690412 | 2019-07-22T19:47:11 | 2019-07-23T07:14:01 | 197,612,383 | 0 | 0 | null | 2022-09-02T21:15:24 | 2019-07-18T15:23:28 | Java | UTF-8 | Java | false | false | 896 | java | package org.wildfly.util.xml.to.cli.subsystem;
import org.jboss.as.controller.AbstractRemoveStepHandler;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.dmr.ModelNode;
import org.jboss.logging.Logger;
/**
* Handler responsible for adding the subsystem resource to the model
*
* @author <a href="[email protected]">Kabir Khan</a>
*/
class SimpleSubsystemRemove extends AbstractRemoveStepHandler {
static final SimpleSubsystemRemove INSTANCE = new SimpleSubsystemRemove();
private final Logger log = Logger.getLogger(SimpleSubsystemRemove.class);
private SimpleSubsystemRemove() {
}
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
super.performRuntime(context, operation, model);
}
}
| [
"[email protected]"
] | |
2bf3a77eca40e0d73505d96a3a96fb354bd2ea0a | a5e51767d0f67ae13ed13c03b8822817ba4b0167 | /src/de/bsd/zwitscher/MultiSelectListActivity.java | 0b9f5d82f076df53f24e86c5c7051e5249793fb0 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | annamharikrishna01/ZwitscherA | c47fce5bd887c875666f0ddec0ebcfc9b4884b73 | 55c501a1a08bc648ee561263fb9497a8c71a57a7 | refs/heads/master | 2020-12-25T04:35:46.135880 | 2013-07-26T07:36:52 | 2013-07-26T07:36:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,177 | java | package de.bsd.zwitscher;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import java.util.List;
/**
* Show a list with multiple items where the
* user can select some from
*
* @author Heiko W. Rupp
*/
public class MultiSelectListActivity extends ListActivity implements AdapterView.OnItemClickListener {
private String mode;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = getIntent().getExtras();
List<String> data = bundle.getStringArrayList("data");
boolean[] checked = bundle.getBooleanArray("checked");
mode = bundle.getString("mode");
final ListView listView = getListView();
if (mode.equals("single")) {
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_single_choice, data));
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
listView.setOnItemClickListener(this);
}
else {
Button okButton = new Button(this);
okButton.setText("ok");
okButton.setEnabled(true);
okButton.setVisibility(View.VISIBLE);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SparseBooleanArray positions = getListView().getCheckedItemPositions();
int count = getListView().getCheckedItemCount();
long[] items = new long[count];
int pos = 0;
for (int i = 0; i < getListView().getCount(); i++) {
if (positions.get(i))
items[pos++] = i;
}
Intent intent = prepareReturnedIntent();
intent.putExtra("data", items);
finish();
}
});
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
listView.addFooterView(okButton); // Needs to be called before setAdapter
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_multiple_choice, data));
for (int i = 0; i < checked.length; i++) {
getListView().setItemChecked(i,checked[i]); // does not check
}
}
listView.setItemsCanFocus(false);
}
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ListView listView = getListView();
String item = (String) listView.getItemAtPosition(position);
Intent intent = prepareReturnedIntent();
intent.putExtra("data", item);
finish();
}
private Intent prepareReturnedIntent() {
Intent intent = new Intent();
intent.putExtra("mode",mode);
setResult(RESULT_OK,intent);
return intent;
}
} | [
"[email protected]"
] | |
9eac49d28572d7e0628115a7169715234e8e1359 | cf5116f8c02250b392b5c0172f600aa044662986 | /management/src/main/java/com/babeeta/butterfly/application/management/dao/impl/StatDaoImpl.java | 6b20493c392a95cbe75d5bd0fe3385f30d073620 | [] | no_license | jfatty/application-1.5.22 | 69ecfb828cbb1682451385d50c82d6305c1cbe15 | e7553193ba455cfeb099a49dd74f62a887a3f5ed | refs/heads/master | 2021-05-31T11:03:17.044608 | 2016-04-01T06:22:43 | 2016-04-01T06:22:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java | package com.babeeta.butterfly.application.management.dao.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.babeeta.butterfly.application.management.dao.StatDao;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.Mongo;
public class StatDaoImpl implements StatDao {
private DBCollection statCollection;
private static final SimpleDateFormat SDF=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public StatDaoImpl(Mongo mongo) {
statCollection = mongo.getDB("stat").getCollection("stat");
}
public void ensureIndex() {
BasicDBObject indexOptions = new BasicDBObject().append("background",
true).append("unique", true);
statCollection.ensureIndex(new BasicDBObject().append("rate", 1)
.append("createTime", -1), indexOptions);
}
@Override
public List<Map> getStats(String rate, int limit) {
DBCursor cursor=statCollection.find(new BasicDBObject().append("rate", rate)).sort(
new BasicDBObject().append("createTime", -1)).limit(limit);
List<Map> list=new ArrayList<Map>();
while(cursor.hasNext()){
DBObject obj=cursor.next();
Iterator<String> keyIt=obj.keySet().iterator();
Map map=new LinkedHashMap();
while(keyIt.hasNext()){
String key=keyIt.next();
if(key.equals("createTime")){
map.put(key, SDF.format(obj.get(key)));
}else if(key.equals("_id")){
continue;
}else{
map.put(key, obj.get(key));
}
}
list.add(map);
}
return list;
}
}
| [
"[email protected]"
] | |
9bb6c82a18e20925919c5d37970a4e2238a108a5 | ee370fe8600269233f2379d2f7409d1d20e91a64 | /src/pieces/Piece.java | eecfb1fd081f76401cdf68b06446e4e70153c9d3 | [] | no_license | Kalak30/Chess | b68025ed2b9cd875902d4b4865657afc44865033 | 6de0cc0ea308d2a67ae560a413b4b89a5b67ec56 | refs/heads/master | 2020-03-29T04:53:42.944516 | 2018-09-22T23:14:00 | 2018-09-22T23:14:00 | 149,553,879 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,460 | java | package pieces;
import game.Handler;
import java.awt.*;
import java.util.ArrayList;
import java.util.Map;
/**
* Abstract class to store the basics of each piece.
* Cannot be instantiated.
*/
public abstract class Piece{
/**
* Static variables to store the default width and default height of a piece
*/
public static final int DEFAULT_WIDTH = 64, DEFAULT_HEIGHT = 64;
/**
* integer to store the current column of the game board the piece is on
*/
protected int column;
/**
* integer to store the current row of the game board the piece is on
*/
protected int row;
/**
* Position in the piece list in the board class. Unique to each piece
*/
protected Integer id;
/**
* static int to store the total amount of pieces have been created
*/
public static int totalPieces = 0;
/**
* Boolean to store if the piece has moved. Once moved never is set to false again
*/
protected boolean hasMoved;
/**
* An instance of the handler class
*/
protected Handler handler;
/**
* String to store the color of the piece
*/
public String color;
/**
* String to store the type(King,Queen,...) of the piece
*/
public String type;
protected int value;
/**
* Basic constructor for a piece. Initializes the above variables.
* @param handler Handler for information about the board and the game class
* @param color Color of the piece
* @param type whether it is a queen or king or any other piece
* @param column column the piece will start on
* @param row row the piece will start on
*/
public Piece(Handler handler, String color, String type, int column, int row){
this.handler = handler;
this.color = color;
this.type = type;
this.column = column;
this.row = row;
hasMoved = false;
id = totalPieces;
totalPieces++;
}
public void moveTo(Point p){
handler.getBoard().setSelectedPiece(id);
handler.getBoard().moveSelectedPiece(p);
}
public void setPos(Point p){
column = p.x;
row = p.y;
}
public Point getPos(){
return new Point(column,row);
}
public boolean isMoveOnBoard(Point p){
if(p.x >= 0 && p.x < 8 && p.y >= 0 && p.y < 8) {
return true;
}
else
return false;
}
/**
* Returns if the piece has moved during this game or not
* @return hasMoved
*/
public boolean isHasMoved() {
return hasMoved;
}
/**
* Sets the hasMoved variable for the piece
* @param hasMoved Boolean value - should only every be true;
*/
public void setHasMoved(boolean hasMoved) {
this.hasMoved = hasMoved;
}
/**
* Gets the current column on the board the piece is at
* @return column
*/
public int getPieceColumn() {
return column;
}
/**
* Gets the current row on the board the piece is at
* @return row
*/
public int getPieceRow(){
return row;
}
/**
* Sets column to the column parameter that is given
* @param column integer where 0 <= column < 8
*/
public void setColumn(int column) {
this.column = column;
}
/**
* Sets row to the row parameter that is giveen
* @param row integer where 0 <= row < 8
*/
public void setRow(int row) {
this.row = row;
}
/**
* Returns true if this piece's color is equal to the players color, false
* if it isn't
*/
public boolean isPlayers(){
return color == handler.getBoard().getPlayerColor();
}
/**
* Abstract method to be used in rendering the piece
* @param g graphics Component that is used to draw the piece
*/
public abstract void render(Graphics g);
/**
* Abstract method to return a list of possible points the piece could move to.
* @return possibleMovements
*/
public abstract ArrayList<Move> getMovement();
public String getColor() {
return color;
}
public Integer getId() {
return id;
}
public String toString(){
return "Column: " + column + " Row: "+ row;
}
public int getValue() {
return value;
}
public void setId(Integer id) {
this.id = id;
}
}
| [
"[email protected]"
] | |
19e903840149b921646d5c90451411c4d8f2bc67 | e0003ea761b368a094fedbb844c0c73ec856a809 | /src/main/java/com/services/impl/GaodeDataResolverImpl.java | 6772e46da50c8070d9eaed9c45377972e8ed61fd | [] | no_license | eddypei/gaodePbf | 0f84d9e1b7f74c56037e1c726a1a689547cc6a1e | 3e78ebd321e400b1308a6cd4f5d8fbe3f49177f4 | refs/heads/master | 2020-07-05T16:28:34.190951 | 2018-07-05T01:22:15 | 2018-07-05T01:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,606 | java | package com.services.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.bean.*;
import com.services.GaodeDataResolver;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Hashtable;
import java.util.Map;
@Service
public class GaodeDataResolverImpl implements GaodeDataResolver {
private double[] resolutions = new double[]{156543.0339, 78271.516953125, 39135.7584765625, 19567.87923828125, 9783.939619140625, 4891.9698095703125, 2445.9849047851562, 1222.9924523925781, 611.4962261962891, 305.74811309814453, 152.87405654907226, 76.43702827453613, 38.218514137268066, 19.109257068634033, 9.554628534317016, 4.777314267158508, 2.388657133579254, 1.194328566789627, 0.5971642833948135};
private GaoDeMapUtil util = null;
public GaodeDataResolverImpl() {
util = new GaoDeMapUtil(this.resolutions);
}
public final String ToJson(Object obj) {
return com.alibaba.fastjson.JSON.toJSONString(obj);
}
static Map<String, String> roadMap = new Hashtable<String, String>();
static Map<String, String> regionMap = new Hashtable<>();
public static String getRegionCatagroy(Object code){
if(regionMap.containsKey(code)){
return regionMap.get(code);
}
return null;
}
public static String getRoadCatagroy(Object code){
if(roadMap.containsKey(code)){
return roadMap.get(code);
}
return null;
}
static {
roadMap.put("roads:guideBoards", "道路标牌");
roadMap.put("roads:roadsBeingBuilt", "在建道路");
roadMap.put("roads:railway", "铁路");
roadMap.put("roads:highWay", "高速公路");
roadMap.put("roads:highSpeedRailway", "高铁");
roadMap.put("roads:nationalRoad", "国道");
roadMap.put("roads:ringRoad", "城市环线");
roadMap.put("roads:subway", "地铁");
roadMap.put("roads:secondaryRoad", "二级公路");
roadMap.put("roads:levelThreeRoad", "三级公路");
roadMap.put("roads:provincialRoad", "省道");
roadMap.put("roads:other", "其他线路");
roadMap.put("roads:levelFourRoad", "四级公路");
roadMap.put("roads:subwayBeingBuilt", "在建地铁");
roadMap.put("roads:overPass", "天桥");
roadMap.put("roads:underPass", "地道");
regionMap.put("", "陆地");
regionMap.put("regions:green", "绿地");
regionMap.put("regions:edu", "教育体育");
regionMap.put("regions:public", "公共设施");
regionMap.put("regions:traffic", "交通枢纽");
regionMap.put("regions:scenicSpot", "景区");
regionMap.put("regions:culture", "文化");
regionMap.put("regions:health", "医疗卫生");
regionMap.put("regions:sports", "运动场所");
regionMap.put("regions:business", "商业场所");
regionMap.put("regions:parkingLot", "停车场");
regionMap.put("regions:subway", "地铁设施");
regionMap.put("water","水系");
}
public JSONObject covertGaodeToNPGIS(String result, int zoom, int row, int col) {
GaoDeRoad gaodeRoad = null;
GaoDeImg gaodeImg = null;
XYZ xyz = new XYZ();
xyz.setZ(zoom);
xyz.setX(row);
xyz.setY(col);
Pix lp = util.getPixPosition(0, 0, zoom, col, row);
gaodeRoad = new GaoDeRoad();
gaodeRoad.setKey(zoom + "_" + row + "_" + col + "_region,building,road");
gaodeRoad.setXyz(xyz);
gaodeImg = new GaoDeImg();
gaodeImg.setKey(zoom + "_" + row + "_" + col);
gaodeImg.setXyz(xyz);
if (!DotNetToJavaStringHelper.isNullOrEmpty(result)) {
String[] c = result.split("\\|");
for (String r : c) {
if (r == null || r.equals("")) {
continue;
}
JSONArray g = null;
try {
g = com.alibaba.fastjson.JSON.parseArray(r);
} catch (Exception e) {
}
if (g != null && g.size() > 0) {
String[] l = g.get(0).toString().split("-");
String m = l[3];
ArrayList<JSONObject> data = new ArrayList<JSONObject>();
ArrayList<GaoDeLabel> labelData = new ArrayList<GaoDeLabel>();
GaoDeMapUtil h = util;
for (int j = g.size() - 1; j >= 1; j--) {
JSONArray p = (JSONArray) ((g.get(j) instanceof JSONArray) ? g.get(j) : null);
switch (m) {
case "road":
h.roadLine(data, p, m, j - 1);
break;
case "region":
h.region(data, p, m);
break;
case "building":
h.building(data, p, m);
break;
case "poilabel":
case "roadlabel":
String[] s = null;
String fillStyle = null;
String strokeStyle = null;
String icon = null;
if (p.get(1) != null) {
s = p.get(1).toString().split("[&]", -1);
fillStyle = h.getRgb(s[2]);
strokeStyle = h.getRgb(s[3]);
icon = s[0];
} else {
continue;
}
JSONArray pk = (JSONArray) ((p.get(0) instanceof JSONArray) ? p.get(0) : null);
Object labels = p.get(m.equals("roadlabel") ? 3 : 4);
for (int k = 0; k < pk.size(); k++) {
JSONArray w = (JSONArray) ((pk.get(k) instanceof JSONArray) ? pk.get(k) : null);
GaoDeLabel O = h.poiFill(w, l);
O.setFontSize(s[1]);
O.setPoiType(p.get(m.equals("roadlabel") ? 4 : 6));
O.setLabels(labels);
if (!"roadlabel".equals(m.toString()) && "labels:pois".equals(labels.toString())) {
O.setCode(p.get(5));
} else {
String temp = "";
switch (labels.toString()) {
case "labels:city":
temp = "城市";
break;
case "labels:aois":
temp = "区域标注";
break;
case "labels:district":
temp = "区县";
break;
case "labels:town":
temp = "乡镇";
break;
case "labels:village":
temp = "村庄";
break;
case "water":
temp = "水系";
break;
default:
if (roadMap.containsKey(labels.toString())) {
temp = roadMap.get(labels.toString());
}
break;
}
O.setCode(labels);
O.setCatagroy(temp);
}
O.setfillStyle(fillStyle);
O.setStrokeStyle(strokeStyle);
h.poiLabelIcon(w, O, icon, s);
if (m.equals("poilabel") && !s[4].equals("")) {
O.setBgColor(h.getRgb(s[4]));
}
labelData.add(O);
}
// break;
}
}
if (m.equals("road") || m.equals("region") || m.equals("building")) {
data.sort(new Comparator<JSONObject>() {
@Override
public int compare(JSONObject o1, JSONObject o2) {
return o1.getDouble("rank") - o2.getDouble("rank") > 0 ? 1 : 0;
//return 1;//x.rank - y.rank;
}
});
switch (m) {
case "road":
gaodeRoad.setRoad(data);
break;
case "region":
gaodeRoad.setRegion(data);
break;
case "building":
gaodeRoad.setBuilding(data);
break;
}
} else if (m.equals("poilabel") || m.equals("roadlabel")) {
if (m.equals("poilabel")) {
gaodeImg.setPoilabel(labelData);
} else {
gaodeImg.setRoadlabel(labelData);
}
}
}
}
}
JSONObject obj = new JSONObject();
JSONObject limg = new JSONObject();
JSONObject region_building_road = new JSONObject();
limg.put("poilabel", this.ToJson(gaodeImg.getPoilabel()));
limg.put("roadlabel", this.ToJson(gaodeImg.getRoadlabel()));
region_building_road.put("building", this.ToJson(gaodeRoad.getBuilding()));
region_building_road.put("region", this.ToJson(gaodeRoad.getRegion()));
region_building_road.put("road", this.ToJson(gaodeRoad.getRoad()));
obj.put("limg", limg);
obj.put("region_building_road", region_building_road);
return obj;
}
}
| [
"[email protected]"
] | |
18c1aac7ac9b173ead385ec6817c6722b9f77c49 | 12a5c729344523e41682b78413c33f8d05fece9c | /webofneeds/won-utils/won-utils-conversation/src/main/java/won/protocol/agreement/effect/Claims.java | 714bcb6c41879a26af1150d43cbd43556303d8c0 | [
"Zlib",
"EPL-1.0",
"LZMA-exception",
"bzip2-1.0.6",
"CPL-1.0",
"CDDL-1.0",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | researchstudio-sat/webofneeds | 04ebba7e73430c1454cd9f3d7324bc24f0fe7012 | c64a0889e7ac0f81c1f3a6a2d2b3f01372457686 | refs/heads/master | 2022-05-06T04:57:47.753441 | 2021-12-21T14:32:08 | 2021-12-21T14:32:08 | 6,154,058 | 62 | 22 | Apache-2.0 | 2021-06-10T10:47:02 | 2012-10-10T08:08:56 | Java | UTF-8 | Java | false | false | 518 | java | package won.protocol.agreement.effect;
import java.net.URI;
public class Claims extends MessageEffect {
private URI claimedMessageUri;
public Claims(URI messageUri, URI claimedMessageUri) {
super(messageUri, MessageEffectType.CLAIMS);
this.claimedMessageUri = claimedMessageUri;
}
public URI getClaimedMessageUri() {
return claimedMessageUri;
}
@Override
public String toString() {
return "Claims [claimedMessageUri=" + claimedMessageUri + "]";
}
}
| [
"[email protected]"
] | |
25205d29523089330f3e55bdfb2419f9b5ce3742 | b29afb6e32701bfc5b816bc92fe7383acc4b4b8e | /Account-prize-checker/src/main/java/com/adonayg/util/PrizeChecker.java | af37f302a4f6c17a31a9ef3463768046ac2724b2 | [] | no_license | Adonayg/Microservices | bbfb52007f4aaae95e18244c9edcc386fa07c2a5 | 665fdd9369187702a98c7ce1fce2cf59e88a2408 | refs/heads/master | 2020-04-09T05:01:02.645373 | 2019-02-14T18:53:05 | 2019-02-14T18:53:05 | 160,047,378 | 0 | 0 | null | 2019-02-14T18:53:06 | 2018-12-02T12:57:27 | Java | UTF-8 | Java | false | false | 865 | java | package com.adonayg.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.adonayg.domain.Prize;
@Component
public class PrizeChecker {
@Value("${prize.base}")
private int basePrize;
@Value("${prize.multiplier}")
private int multiplier;
@Value("${message.win}")
private String winMessage;
@Value("${message.lose}")
private String loseMessage;
public Prize checkPrize(String accountNumber) {
String letter = accountNumber.substring(0, 1);
switch (letter) {
case PrizeConstants.basePrize:
return new Prize(winMessage + String.valueOf(basePrize), true);
case PrizeConstants.multiplierPrize:
return new Prize(winMessage + String.valueOf(multiplier * basePrize), true);
default:
return new Prize(loseMessage, false);
}
}
}
| [
"[email protected]"
] | |
83d3979a7f18bad8b9ef8e774dea81db9675e08f | 4315d17092fced341b323751af7b03886a9c5cdc | /20180925/温宗儒-161220133/src/backstage/creature/Audience/Snake.java | b8dfa9a26e83e7a1f17a1f47824ad61f5560bebf | [] | no_license | TianChenjiang/java-2018f-homework | d62eb85148a3a3a41fae7d9d2da09c759c315aad | bbacb26264cc0e4555f8b2c6f581c85a17fca1ed | refs/heads/master | 2020-03-28T13:46:59.758231 | 2018-12-31T09:40:52 | 2018-12-31T09:40:52 | 148,428,329 | 3 | 0 | null | 2018-12-31T09:40:53 | 2018-09-12T05:51:46 | Java | UTF-8 | Java | false | false | 324 | java | package backstage.creature.Audience;
import backstage.creature.Creature;
public class Snake extends Creature {
public Snake(){
name = "蛇精";
imageUrl = "/common/images/audience/snake.jpg";
}
public void cheer(){
System.out.println("蛇精助威:“小的们加油!”");
}
}
| [
"[email protected]"
] | |
1a23a136cfa2af4c6e2c470b6d918926aafe54c4 | ae6588fac8d054ef278a0e8e2a8a7e65bd1bedf0 | /jfinal_hadoop_webdisk/src/com/hadoop/gy404/service/DirOperateService.java | 4e77c20f8c5f470807d5c786cd319941edbedb57 | [] | no_license | FashtimeDotCom/angularjs-bootstrap-jfinal-hadoop-netdisk | 4e0272f6ceed4bd381f5254e1257578cd7ac0db8 | 729ded732f35cd0072115f6ebc331b1e85832415 | refs/heads/master | 2021-01-18T14:34:21.426743 | 2014-07-09T10:40:27 | 2014-07-09T10:40:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java | package com.hadoop.gy404.service;
import java.io.IOException;
import java.sql.Timestamp;
import com.hadoop.gy404.model.Dir;
import com.hadoop.gy404.tools.hadoop.HDFSConfig;
import com.hadoop.gy404.tools.hadoop.HDFSOperation;
import com.jfinal.core.Controller;
public class DirOperateService {
private HDFSOperation hdfsoperation;//hdfs file oper class
public DirOperateService() throws IOException{
hdfsoperation =new HDFSOperation();
}
//get all dir info(获取所有文件夹信息)
public void getAllDir(Controller c) {
String sql="select * from dir order by createtime";
c.setAttr("dirlist", Dir.dao.find(sql));
c.renderJson();
}
//add dir(添加文件夹)
public void addDir(Controller c,String name){
String isexist="select * from dir where name=?";
if(Dir.dao.findFirst(isexist, name)!=null)
c.renderJson("message",name+"-the dir name exist, please change other name.(文件夹已经存在,请更换文件夹名称!)");
else{
String dirname=HDFSConfig.getHDFSPath()+name;
if(hdfsoperation.mkdir(dirname)){
new Dir().set("name", name).set("hdfspath", dirname)
.set("createtime", new Timestamp(System.currentTimeMillis()))
.set("updatetime", new Timestamp(System.currentTimeMillis())).save();
c.setAttr("message","dir create success!(文件夹创建成功!)");
c.setAttr("status", 1);
c.renderJson();
}
else{
c.setAttr("status", 0);
c.setAttr("message","dir create error!(文件夹创建失败!)");
c.renderJson();
}
}
}
}
| [
"[email protected]"
] | |
80a53c45964b03d72ed452f9d68fc884037b2b8d | 5f2fb08c46b2acdfe52583cf95925325b36c6820 | /jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/MessageEvent.java | ffdabe546aaeafcf1b5461b2a743f366b3fabfc3 | [] | no_license | 309925753/xinfuyouyue | 7324fb7062c126156ee350a0e14b8b18bed7afe6 | 0bc8f8bb387d2203b74af05bfcc6733cde51cda2 | refs/heads/master | 2022-11-30T23:46:53.082249 | 2020-05-19T11:48:55 | 2020-05-19T11:48:55 | 287,436,362 | 3 | 6 | null | null | null | null | UTF-8 | Java | false | false | 624 | java | package fm.jiecao.jcvideoplayer_lib;
/**
* Created by Administrator on 2017/3/17 0017.
* 1. 视频播放控件 已准备,通知朋友圈页面停止播放录音,防止同时播放两种声音
* 2. 我的同事 其他页面调用api成功,通知同事页面刷新UI
* 3. 消息群发 收到回执后,通知群发页面,当群发页面收到所有人回执时,在隐藏等待符
* 4. 视频播放完成,通知单聊界面,判断是否为阅后即焚视频
*/
public class MessageEvent {
public final String message;
public MessageEvent(String message) {
this.message = message;
}
} | [
"[email protected]"
] | |
8fad3badfd4a46aad564009737fcbba413e9ee03 | 8111d31b49e42b31cce365b4971a46cf18d96a9d | /day01/src/com/bianyiit/domain/Student.java | f03c6fd0fcad5f3343d338d1468a6f8ca65a266f | [] | no_license | flyhigh19/github_firstPush | 1e72b55f1ee57e64d82f2ae68d542d20dc055790 | 0e43a321046382acf63d8792468276abeedf9a13 | refs/heads/master | 2022-10-18T06:50:57.121444 | 2020-06-09T13:57:46 | 2020-06-09T13:57:46 | 270,888,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package com.bianyiit.domain;
public class Student {
private int id;
private String username;
private String password;
public Student() {
}
public Student(int id, String username, String password) {
this.id = id;
this.username = username;
this.password = password;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
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;
}
@Override
public String toString() {
return "Student{" +
"id=" + id +
", username='" + username + '\'' +
", password='" + password + '\'' +
'}';
}
}
| [
"[email protected]"
] | |
40b96082c75cdc99a1e99a2b94de8c659cbae3c5 | 13645e8eadeb91f6f02947317fcbc9659802ccec | /app/src/main/java/com/example/librarymanagementsystem/user/UserLogin.java | dd11a145b8afce546f78fea7ab8b0f7e97424e6b | [] | no_license | dhanashree2200/Library-Management-System | 53fb6c7434c6e58a04856cccf6934674190688b6 | cdfc8bf948b57eda6f842de6b6215bc35e3c6185 | refs/heads/master | 2023-04-02T23:13:07.877879 | 2021-04-16T06:26:00 | 2021-04-16T06:26:00 | 358,497,727 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,574 | java | package com.example.librarymanagementsystem.user;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;
import androidx.core.app.NavUtils;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.example.librarymanagementsystem.DatabaseHandler;
import com.example.librarymanagementsystem.DbModel;
import com.example.librarymanagementsystem.R;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import java.util.List;
public class UserLogin extends AppCompatActivity {
TextView register;
CardView userLogin;
TextInputEditText userID,userPass;
TextInputLayout idEL,passEL;
SharedPreferences sharedpreferences;
Toolbar tb;
public static final String MyPREFERENCES = "UserLogin" ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_login);
// getSupportActionBar().setDisplayHomeAsUpEnabled(true);
register=findViewById(R.id.register);
userLogin=findViewById(R.id.adminLoginSuccess);
userID=findViewById(R.id.uID1);
userPass=findViewById(R.id.uPass1);
idEL=findViewById(R.id.uID);
passEL=findViewById(R.id.uPass);
tb=findViewById(R.id.toolBar);
tb.setNavigationIcon(R.drawable.arrow_back);
tb.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavUtils.navigateUpFromSameTask(UserLogin.this);
}
});
sharedpreferences = getSharedPreferences(MyPREFERENCES, MODE_PRIVATE);
String name=sharedpreferences.getString("Name",null);
if(name!=null){
startActivity(new Intent(UserLogin.this, UserMainPage.class));
}
userLogin.setOnClickListener(new Userlogin());
register.setOnClickListener(new UserRegistration());
}
class UserRegistration implements View.OnClickListener{
@Override
public void onClick(View v) {
startActivity(new Intent(UserLogin.this, UserRegisration.class));
}
}
class Userlogin implements View.OnClickListener{
@Override
public void onClick(View v) {
int f=0;
DatabaseHandler db=new DatabaseHandler(UserLogin.this);
List<DbModel> list=db.getAllStud();
for (DbModel stud:list){
if(stud.getStud_id().equals(userID.getText().toString()) && stud.getStud_pass().equals(userPass.getText().toString())){
f=1;
Log.d("TAG", " ");
Toast.makeText(UserLogin.this, "Success", Toast.LENGTH_LONG).show();
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString("Name", userID.getText().toString());
editor.putString("Password", userPass.getText().toString());
editor.apply();
}
}
if(f==0) Toast.makeText(UserLogin.this, "No such user found", Toast.LENGTH_LONG).show();
if(f==1) startActivity(new Intent(UserLogin.this,UserMainPage.class));
}
}
} | [
"[email protected]"
] | |
1df21c0a9ebbaf3fc47e7d6f990753ff39d9212c | e3741a855164fbece2494348d40e99798f1b064b | /app/src/main/java/org/androidtown/multimemoapp/common/TitleBitmapButton.java | 72214ca2dfa213a6559b5f3d4b958d7b7e09107e | [] | no_license | sellester/MultiMemoApp | 1fe6392a4c42f0ccaebff4fbc0a48265b2161a2e | 72a35236675ba1a7c3a2c67d78674279f26fcd3d | refs/heads/master | 2020-04-23T15:54:44.257687 | 2019-02-26T07:14:51 | 2019-02-26T07:14:51 | 171,280,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,223 | java | package org.androidtown.multimemoapp.common;
import org.androidtown.multimemoapp.R;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.support.v7.widget.AppCompatButton;
import android.util.AttributeSet;
import android.view.MotionEvent;
public class TitleBitmapButton extends AppCompatButton {
/**
* Base Context
*/
Context context;
/**
* Paint instance
*/
Paint paint;
/**
* Default Color
*/
int defaultColor = 0xffffffff;
/**
* Default Size
*/
float defaultSize = 18F;
/**
* Default ScaleX
*/
float defaultScaleX = 1.0F;
/**
* Default Typeface
*/
Typeface defaultTypeface = Typeface.DEFAULT;
/**
* Title Text
*/
String titleText = "";
/**
* Icon Status : 0 - Normal, 1 - Clicked
*/
int iconStatus = 0;
/**
* Icon Clicked Bitmap
*/
Bitmap iconNormalBitmap;
/**
* Icon Clicked Bitmap
*/
Bitmap iconClickedBitmap;
public static final int BITMAP_ALIGN_CENTER = 0;
public static final int BITMAP_ALIGN_LEFT = 1;
public static final int BITMAP_ALIGN_RIGHT = 2;
int backgroundBitmapNormal = R.drawable.title_button;
int backgroundBitmapClicked = R.drawable.title_button_clicked;
/**
* Alignment
*/
int bitmapAlign = BITMAP_ALIGN_CENTER;
/**
* Padding for Left or Right
*/
int bitmapPadding = 10;
/**
* Flag for paint changed
*/
boolean paintChanged = false;
private boolean selected;
private int tabId;
public TitleBitmapButton(Context context) {
super(context);
this.context = context;
init();
}
public TitleBitmapButton(Context context, AttributeSet atts) {
super(context, atts);
this.context = context;
init();
}
public void setTabId(int id) {
tabId = id;
}
public void setSelected(boolean flag) {
selected = flag;
if (selected) {
setBackgroundResource(backgroundBitmapClicked);
paintChanged = true;
defaultColor = Color.BLACK;
} else {
setBackgroundResource(backgroundBitmapNormal);
paintChanged = true;
defaultColor = Color.WHITE;
}
}
public boolean isSelected() {
return selected;
}
/**
* Initialize
*/
public void init() {
setBackgroundResource(backgroundBitmapNormal);
paint = new Paint();
paint.setColor(defaultColor);
paint.setAntiAlias(true);
paint.setTextScaleX(defaultScaleX);
paint.setTextSize(defaultSize);
paint.setTypeface(defaultTypeface);
selected = false;
}
/**
* Set icon bitmap
*
* @param icon
*/
public void setIconBitmap(Bitmap iconNormal, Bitmap iconClicked) {
iconNormalBitmap = iconNormal;
iconClickedBitmap = iconClicked;
}
public void setBackgroundBitmap(int resNormal, int resClicked) {
backgroundBitmapNormal = resNormal;
backgroundBitmapClicked = resClicked;
setBackgroundResource(backgroundBitmapNormal);
}
/**
* Handles touch event, move to main screen
*/
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_UP:
if (selected) {
} else {
setBackgroundResource(backgroundBitmapNormal);
iconStatus = 0;
paintChanged = true;
defaultColor = Color.WHITE;
// fire event
//khc 100913 - 아래코드 제거시 탭 이동현상 없어짐.
//MainScreenActivity.getInstance().tabSelected(tabId);
}
break;
case MotionEvent.ACTION_DOWN:
if (selected) {
} else {
setBackgroundResource(backgroundBitmapClicked);
iconStatus = 1;
paintChanged = true;
defaultColor = Color.BLACK;
}
break;
}
// repaint the screen
invalidate();
return true;
}
/**
* Draw the text
*/
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
int curWidth = getWidth();
int curHeight = getHeight();
// apply paint attributes
if (paintChanged) {
paint.setColor(defaultColor);
paint.setTextScaleX(defaultScaleX);
paint.setTextSize(defaultSize);
paint.setTypeface(defaultTypeface);
paintChanged = false;
}
// bitmap
Bitmap iconBitmap = iconNormalBitmap;
if (iconStatus == 1) {
iconBitmap = iconClickedBitmap;
}
if (iconBitmap != null) {
int iconWidth = iconBitmap.getWidth();
int iconHeight = iconBitmap.getHeight();
int bitmapX = 0;
if (bitmapAlign == BITMAP_ALIGN_CENTER) {
bitmapX = (curWidth-iconWidth)/2;
} else if(bitmapAlign == BITMAP_ALIGN_LEFT) {
bitmapX = bitmapPadding;
} else if(bitmapAlign == BITMAP_ALIGN_RIGHT) {
bitmapX = curWidth-bitmapPadding;
}
canvas.drawBitmap(iconBitmap, bitmapX, (curHeight-iconHeight)/2, paint);
}
// text
Rect bounds = new Rect();
paint.getTextBounds(titleText, 0, titleText.length(), bounds);
float textWidth = ((float)curWidth - bounds.width())/2.0F;
float textHeight = ((float)curHeight + bounds.height())/2.0F+4.0F;
canvas.drawText(titleText, textWidth, textHeight, paint);
}
public String getTitleText() {
return titleText;
}
public void setTitleText(String titleText) {
this.titleText = titleText;
}
public int getDefaultColor() {
return defaultColor;
}
public void setDefaultColor(int defaultColor) {
this.defaultColor = defaultColor;
paintChanged = true;
}
public float getDefaultSize() {
return defaultSize;
}
public void setDefaultSize(float defaultSize) {
this.defaultSize = defaultSize;
paintChanged = true;
}
public float getDefaultScaleX() {
return defaultScaleX;
}
public void setDefaultScaleX(float defaultScaleX) {
this.defaultScaleX = defaultScaleX;
paintChanged = true;
}
public Typeface getDefaultTypeface() {
return defaultTypeface;
}
public void setDefaultTypeface(Typeface defaultTypeface) {
this.defaultTypeface = defaultTypeface;
paintChanged = true;
}
public int getBitmapAlign() {
return bitmapAlign;
}
public void setBitmapAlign(int bitmapAlign) {
this.bitmapAlign = bitmapAlign;
}
public int getBitmapPadding() {
return bitmapPadding;
}
public void setBitmapPadding(int bitmapPadding) {
this.bitmapPadding = bitmapPadding;
}
}
| [
"[email protected]"
] | |
1bffa96438b806aa7dbbb1f7e9661ae7088ec5b2 | 705dfdc5147fc433be370e41a8cdc026fdffcfd8 | /src/main/java/cn/jsfund/devtools/service/impl/EventGroupServiceImpl.java | 9698e81bab25be6ef5e04c1c3d94801189062b30 | [
"Apache-2.0"
] | permissive | hutx/devtools | 7bda4756f8d146afbc6e01102dfb2902cd6dbc35 | bb8700230733fdad9ff215bb0473415189c40f95 | refs/heads/mybatis_plus | 2022-11-07T20:45:53.528352 | 2019-10-15T09:40:27 | 2019-10-15T09:40:27 | 215,231,697 | 0 | 0 | Apache-2.0 | 2022-10-12T20:32:46 | 2019-10-15T07:12:37 | JavaScript | UTF-8 | Java | false | false | 532 | java | package cn.jsfund.devtools.service.impl;
import cn.jsfund.devtools.entity.EventGroup;
import cn.jsfund.devtools.mapper.EventGroupMapper;
import cn.jsfund.devtools.service.IEventGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 事件分组 服务实现类
* </p>
*
* @author hutx
* @since 2019-01-05
*/
@Service
public class EventGroupServiceImpl extends ServiceImpl<EventGroupMapper, EventGroup> implements IEventGroupService {
}
| [
"[email protected]"
] | |
d5cd483ef193e8a9067ee0cfb46a520041484843 | 421459319bcf4374794cc65f573b0708a43e1558 | /PdP/Woche_10/UsePoint.java | 0bebe8b09c4f2a77f41085bad79e29cfa2bd2b35 | [] | no_license | CaptainUnbrauchbar/programming-assignments | 08a4545e6e6afadbf96bc37ef21e523c34066feb | b7d3b2317c7b6557dd317c3248fbe1abc384568f | refs/heads/master | 2022-11-25T22:42:20.706243 | 2020-08-09T23:15:39 | 2020-08-09T23:15:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 880 | java | /**
* UsePoint.java
*
* Ein Programm, das Objekte der Klasse Point erzeugt und manipuliert.
*/
class UsePoint {
public static void main(String[] args) {
// Erzeugen von zwei Exemplaren des Typs Point mit den Namen p und q;
// p soll an den Koordinaten (30,10) erzeugt werden,
// q mit dem parameterlosen Konstruktor am Koordinatenursprung.
Point p = new Point(30,10);
Point q = new Point();
// Verschieben von q auf die Koordinaten (40,40)
q.moveTo(40,20);
// Ausgabe der Attribute von p und q
System.out.println();
System.out.println(" x-Koordinate von p: " + p.getX());
System.out.println(" y-Koordinate von p: " + p.getY());
System.out.println();
System.out.println(" x-Koordinate von q: " + q.getX());
System.out.println(" y-Koordinate von q: " + q.getY());
System.out.println();
}
}
// UsePoint
| [
"[email protected]"
] | |
0b4c36c76194cf78fa2ec4610c1eda7bee28f84c | c544cebc51939c42bef2ac996bd1533739992aea | /app/src/test/java/com/srb9181/srbrxandroid/ExampleUnitTest.java | 3ddf0653cfb8a12831c32b662f1f9148ea3f1e40 | [] | no_license | srb9181/SrbRxAndroid | 807672ca44212c34634f86fe1d96c365ea93f81e | dcf50c5e4c05dd226a555c5788575f57310068ac | refs/heads/master | 2021-01-21T03:33:57.623136 | 2017-11-23T16:16:32 | 2017-11-23T16:16:32 | 101,896,998 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.srb9181.srbrxandroid;
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]"
] | |
ffe7e8eafc648ba0492baa28c56eb915d4fbd20c | 51967281cd64a42aa86d01b204415b82cf53956a | /vcd_votedevice/src/main/java/de/tud/vcd/votedevice/tuTestElection/TUTestShowOption.java | be2ffb21ac7a82377ea3801813436ee7c2e43795 | [
"Apache-2.0"
] | permissive | SecUSo/EasyVote | 13e1ceeee11a57486404b71c56c75433597c43ca | 676b20d416999a480495c45c535f5e4bc96e50c2 | refs/heads/master | 2021-04-23T09:47:20.114468 | 2015-05-18T14:46:38 | 2015-05-18T14:46:38 | 35,817,012 | 4 | 2 | null | null | null | null | ISO-8859-1 | Java | false | false | 6,276 | java | /*******************************************************************************
* # Copyright 2015 SecUSo.org / Jurlind Budurushi / Roman Jöris
* #
* # 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 de.tud.vcd.votedevice.tuTestElection;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.Ellipse2D;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import de.tud.vcd.votedevice.municipalElection.model.Party;
import de.tud.vcd.votedevice.tuTestElection.TUTestElectionModel.VoteState;
public class TUTestShowOption extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
private Color foreground;
//private int id_maxSize;
private String name;
private boolean voted;
private VoteState voteState;
private Font font;
private Image imgBallotChecked;
private Image imgBallotUnchecked;
private ArrayList<ActionListener> al;
private String actionCommand;
private JComponent comp;
private Shape ballotShape;
public TUTestShowOption(int x, int y, int width, int height, Color foreground, VoteState vs){
this.voteState=vs;
this.foreground=foreground;
setBackground(Color.ORANGE);
setOpaque(false);
setSize(width, height);
setLocation(x, y);
//
font= new Font("SanfSerif", Font.PLAIN,24 );
actionCommand="";
comp=this;
//
// FontMetrics fm = getFontMetrics(font);
// id_maxSize=fm.stringWidth(id);
name="Name";
voted=false;
URL imageURLl =getClass().getClassLoader().getResource("ballotChecked50.gif");
imgBallotChecked=null;
if (imageURLl != null) {
try {
imgBallotChecked = ImageIO.read(imageURLl);
imgBallotChecked= imgBallotChecked.getScaledInstance(50, 50,Image.SCALE_SMOOTH);
} catch (IOException e) {
e.printStackTrace();
}
//Image image = imgBallotChecked.getImage(); // transform it
//image = image.getScaledInstance(20, 20, Image.SCALE_FAST); // scale it the smooth way
//imgBallotChecked = new ImageIcon(image); // transform it back
}
imageURLl =getClass().getClassLoader().getResource("ballotUnchecked50.gif");
imgBallotUnchecked=null;
if (imageURLl != null) {
try {
imgBallotUnchecked = ImageIO.read(imageURLl);
imgBallotUnchecked= imgBallotUnchecked.getScaledInstance(50, 50,Image.SCALE_SMOOTH);
} catch (IOException e) {
e.printStackTrace();
}
// Image image = imgBallotUnchecked.getImage(); // transform it
// image = image.getScaledInstance(20, 20, Image.SCALE_FAST); // scale it the smooth way
// imgBallotUnchecked = new ImageIcon(image); // transform it back
}
al=new ArrayList<ActionListener>();
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)
&& contains(e.getPoint())) {
//pressed = true;
//repaint();
}
}
public void mouseReleased(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && ballotShape.contains(e.getPoint()) ) {
//call all actionPerformed:
for(ActionListener a:al){
ActionEvent ae=new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, actionCommand);
a.actionPerformed(ae);
}
//pressed = false;
//repaint();
}
}
});
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
//Upcast --> more functions in Graphics2D
Graphics2D g2d=(Graphics2D)g;
// Antialiasing einschalten
g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON );
//g.drawString("FOO", 10, 5);
g2d.setColor(foreground);
//g2d.drawLine(0 , );
g2d.drawRect(0, 0 , this.getSize().width-1, this.getSize().height-1);
g2d.setFont(font);
g2d.drawString(name, 10, (int)(this.getSize().height*(0.70)));
g2d.setFont(new Font(font.getFamily(), Font.BOLD, font.getSize()));
//paint boxes
ballotShape=new Ellipse2D.Double((int)(this.getSize().width-60) , 15, 50, 50);
if (voted){
g2d.drawImage(imgBallotChecked, (int)(this.getSize().width-60) , 15, 50, 50, null, null);
}else{
g2d.drawImage(imgBallotUnchecked, (int)(this.getSize().width-60) ,15, 50, 50, null, null);
}
}
public void addActionListener(ActionListener al){
this.al.add(al);
}
public void setActionCommand(String actionCommand){
this.actionCommand=actionCommand;
//.paramString=
}
public String getActionCommmand(){
return actionCommand;
}
public void setParty(Party p) {
if (!(p == null)) {
actionCommand = p.getName();
name=p.getName();
if (name.equals("invalid")){
name="Ungültig wählen";
}
voted=p.isVoted();
setVisible(true);
} else {
name="";
actionCommand = "";
voted=false;
setVisible(false);
}
repaint();
}
public void setVoteState(VoteState vs, String text, boolean selected){
//System.out.println("SET:"+vs.toString()+": "+selected);
name=text;
actionCommand=vs.toString();
voted=selected;
repaint();
}
public VoteState getVoteState(){
return voteState;
}
}
| [
"[email protected]"
] | |
fb97677b14fcc8c417697dbacf0d3d93866904e8 | b11c565b83c90d5a8d979b31439fa1c547909a69 | /src/main/java/com/partydecoration/CarpetDecorator.java | 60dc315ea459ae6a75b91cab3809e0e2235f5065 | [] | no_license | Johan-Carrillo-UMG/analisis1-2021-final | ba17200d3a6ba048571c46029f01e347e6d24b64 | 35dcc15dced88527d8aa84f713d0bbf5c9fb37e5 | refs/heads/main | 2023-06-03T10:26:28.378526 | 2021-06-17T03:46:57 | 2021-06-17T03:46:57 | 376,362,954 | 0 | 0 | null | 2021-06-12T18:50:19 | 2021-06-12T18:50:18 | null | UTF-8 | Java | false | false | 358 | java | package com.partydecoration;
import java.util.*;
public class CarpetDecorator extends PartyDecorationsDecorate {
public CarpetDecorator() {
}
public void addCarpet(IDecoration decoration) {
if(decoration instanceof Floor){
System.out.println("1\t\t\tQ60\t\tQ60\t\t\tALFOMBRA SINTETICA");
}
return;
}
} | [
"[email protected]"
] | |
81b4843ce11aaca8b47fc0cc49009ffb89a11b89 | fe39e9e83eed8c29bbdad95f46fa8aac538a671b | /forloop/fibonaciiproj.java | 8fa24b9ce7e5cdf8461e4223c7655e3ce9d00628 | [] | no_license | bhange24/Selenium_Java1 | 88e35b40bc4cc656168100a61fc75ad7e2613ebf | e5c013879bbd1baf5e8d298800e8734b5eca97e9 | refs/heads/master | 2020-03-17T21:01:03.227150 | 2018-06-19T10:05:24 | 2018-06-19T10:05:24 | 133,939,241 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | package com.forloop;
public class fibonaciiproj {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 0;
int b = 1;
int c = a + b;
for (int i = 0; i <= 10; i++) {
c = a + b;
a = b;
b = c;
System.out.println("Series is " + c);
}
}
}
| [
"[email protected]"
] | |
0bdfbaee6480f57e8813f6bbfd4ed5e40c74f537 | e29febf27d9e26a03e1072aea99e528d07419104 | /app/src/androidTest/java/com/example/hyl/person/ExampleInstrumentedTest.java | 3ead42a63fd3adc5c4655afd8ab56c2471f0ef52 | [] | no_license | HUIZHai/Androidstudio-person | 1d48b488e126aa66d19288491e57fa860c39cd1d | f76d0a15b3f2b458368e23ec2b7fc935fa299d1c | refs/heads/master | 2020-06-15T17:58:55.379306 | 2019-07-07T06:29:50 | 2019-07-07T06:29:50 | 195,358,219 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package com.example.hyl.person;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.hyl.person", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
0252c6a32315e0dc3e9e4e661be4bd5069c8d0f2 | 24743935bf4b94a321964a1bd23134c579cec4cc | /src/fr/parisnanterre/poa/td1/ex3/Langues.java | d776e771ed5478e3cc2f07e371999e9e7b383bb0 | [] | no_license | ThibaultSartre/POA | d63528fbdc2f220c60911d09f9d18d6cf58fdb9a | 65ded8b7bf1b2cc001b2d1f53997692486ada67d | refs/heads/master | 2021-08-28T08:12:01.212048 | 2017-12-11T16:40:41 | 2017-12-11T16:40:41 | 104,227,474 | 0 | 0 | null | 2017-09-20T14:53:04 | 2017-09-20T14:38:33 | null | UTF-8 | Java | false | false | 131 | java | package fr.parisnanterre.poa.td1.ex3;
/**
* Created by thsartre on 25/09/2017.
*/
public class Langues extends Departement {
}
| [
"[email protected]"
] | |
33356d055252fa86ac660e7ca0caef414d2f5e64 | 5843c978b0bf420e977bbcaf6f6b1d1b4c9b32c3 | /src/main/java/br/com/fiap/financiamentos/service/FinanciamentoService.java | cb6494e53764617bcc1ecaf068a5cf2409d6e6dc | [] | no_license | sjose03/nac2_web_services | 37aa5576ce56776afed402320db3c868e0fc4f54 | 80ca7322a634a19615e2e564e07f138e2a6afe26 | refs/heads/master | 2023-04-27T00:56:54.318842 | 2021-05-21T02:34:17 | 2021-05-21T02:34:17 | 369,392,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package br.com.fiap.financiamentos.service;
import br.com.fiap.financiamentos.dto.Financiamento;
import java.util.List;
public interface FinanciamentoService {
List<Financiamento>listaFinanciamentos();
Financiamento salvaFinanciamento(Financiamento financiamento);
Financiamento editarFinanciamento(Long id);
}
| [
"[email protected]"
] | |
6f1351458de5964c453524e4c7e50f96b2fbc761 | e1303a844c8e4c9da0604baf9c85b67f35b19a47 | /app/src/main/java/com/openclassrooms/entrevoisins/ui/neighbour_list/ListNeighbourPagerAdapter.java | e090d1431fdb6618cbb5a2c831a58c5772411519 | [] | no_license | salihayoubi23/EntreVoisins_P3 | 9118aec6c7f5fb8983983add8bcca8e798036a5b | 4806114ebb16d2ada5fb98b9ce506837b46a77d8 | refs/heads/master | 2020-08-28T22:57:22.763345 | 2019-10-27T18:07:17 | 2019-10-27T18:07:17 | 217,845,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package com.openclassrooms.entrevoisins.ui.neighbour_list;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
public class ListNeighbourPagerAdapter extends FragmentPagerAdapter {
public ListNeighbourPagerAdapter(FragmentManager fm) {
super(fm);
}
/**
* getItem is called to instantiate the fragment for the given page.
* @param position
* @return
*/
@Override
public Fragment getItem(int position) {
return NeighbourFragment.newInstance(position);
}
/**
* get the number of pages
* @return
*/
@Override
public int getCount() {
return 2;
}
} | [
"[email protected]"
] | |
155bd6c41998bcb4ceea32e15649e979ea73669f | b111b77f2729c030ce78096ea2273691b9b63749 | /db-example-large-multi-project/project11/src/test/java/org/gradle/test/performance/mediumjavamultiproject/project11/p56/Test1125.java | a59b905ba9bdf1d780fff90f5d1b673fac521040 | [] | no_license | WeilerWebServices/Gradle | a1a55bdb0dd39240787adf9241289e52f593ccc1 | 6ab6192439f891256a10d9b60f3073cab110b2be | refs/heads/master | 2023-01-19T16:48:09.415529 | 2020-11-28T13:28:40 | 2020-11-28T13:28:40 | 256,249,773 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,026 | java | package org.gradle.test.performance.mediumjavamultiproject.project11.p56;
import org.gradle.test.performance.mediumjavamultiproject.project11.p55.Production1116;
import org.gradle.test.performance.mediumjavamultiproject.project8.p41.Production825;
import org.gradle.test.performance.mediumjavamultiproject.project9.p46.Production925;
import org.gradle.test.performance.mediumjavamultiproject.project10.p51.Production1025;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test1125 {
Production1125 objectUnderTest = new Production1125();
@Test
public void testProperty0() throws Exception {
Production1116 value = new Production1116();
objectUnderTest.setProperty0(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() throws Exception {
Production1120 value = new Production1120();
objectUnderTest.setProperty1(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() throws Exception {
Production1124 value = new Production1124();
objectUnderTest.setProperty2(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() throws Exception {
Production825 value = new Production825();
objectUnderTest.setProperty3(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() throws Exception {
Production925 value = new Production925();
objectUnderTest.setProperty4(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() throws Exception {
Production1025 value = new Production1025();
objectUnderTest.setProperty5(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() throws Exception {
String value = "value";
objectUnderTest.setProperty6(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() throws Exception {
String value = "value";
objectUnderTest.setProperty7(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() throws Exception {
String value = "value";
objectUnderTest.setProperty8(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() throws Exception {
String value = "value";
objectUnderTest.setProperty9(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty9());
}
} | [
"[email protected]"
] | |
46d2fb856cefc540adc2c06144d01480387f1ab6 | ebb160ae32e1bf46c5c1339f88de71a15c02088d | /src/main/java/com/huawei/www/bme/cbsinterface/bcservices/CustDeactivationRequestAdditionalProperty.java | 736d2b2164d2293cae91205dc85d9baf33a40030 | [] | no_license | benjamin-Ndugga/ocsconnect | 55b583c0f5135a753eaaa853042987a5ba6946a1 | 9e66bc99456dbf8c279cc973d80bc0d43d9ab47e | refs/heads/master | 2023-04-06T01:20:54.801374 | 2020-04-15T17:55:35 | 2020-05-19T13:36:39 | 352,567,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,905 | java | /**
* CustDeactivationRequestAdditionalProperty.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.huawei.www.bme.cbsinterface.bcservices;
public class CustDeactivationRequestAdditionalProperty extends com.huawei.www.bme.cbsinterface.bccommon.SimpleProperty implements java.io.Serializable {
public CustDeactivationRequestAdditionalProperty() {
}
public CustDeactivationRequestAdditionalProperty(
java.lang.String code,
java.lang.String value) {
super(
code,
value);
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof CustDeactivationRequestAdditionalProperty)) return false;
CustDeactivationRequestAdditionalProperty other = (CustDeactivationRequestAdditionalProperty) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj);
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(CustDeactivationRequestAdditionalProperty.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.huawei.com/bme/cbsinterface/bcservices", ">CustDeactivationRequest>AdditionalProperty"));
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
""
] | |
3158965790294b769970be5d61cb5bd2447dea1e | b54183ac0d3698d5d46a8f59a1d2b5d378135729 | /src/main/java/com/pinkpig/mybatis/generator/xmlmapper/elements/SelectByExamplePageWithBLOBsElementGenerator.java | 4829d58a196db5510f8ffdb3300df267c0e7d404 | [] | no_license | fengsheng990/mybatis-generator-pinkpig | e10786a9937707764ab4423f31c8981583557eba | c688f90fa5a86b572418671b08ebe35bfdba10c6 | refs/heads/master | 2020-04-20T19:47:06.431340 | 2019-02-20T15:21:22 | 2019-02-20T15:21:22 | 169,058,739 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,632 | java | /**
* Copyright 2006-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.pinkpig.mybatis.generator.xmlmapper.elements;
import com.pinkpig.mybatis.generator.plugins.ReplaceExamplePlugin;
import com.pinkpig.mybatis.generator.plugins.utils.FormatTools;
import org.mybatis.generator.api.dom.xml.Attribute;
import org.mybatis.generator.api.dom.xml.TextElement;
import org.mybatis.generator.api.dom.xml.XmlElement;
import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.AbstractXmlElementGenerator;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
public class SelectByExamplePageWithBLOBsElementGenerator extends
AbstractXmlElementGenerator {
public SelectByExamplePageWithBLOBsElementGenerator() {
super();
}
@Override
public void addElements(XmlElement parentElement) {
String fqjt = introspectedTable.getExampleType();
XmlElement answer = new XmlElement("select"); //$NON-NLS-1$
answer.addAttribute(new Attribute("id", //$NON-NLS-1$
introspectedTable.getSelectByExampleWithBLOBsStatementId()+"WithPage"));
answer.addAttribute(new Attribute(
"resultMap", introspectedTable.getBaseResultMapId())); //$NON-NLS-1$
answer.addAttribute(new Attribute("parameterType", fqjt)); //$NON-NLS-1$
context.getCommentGenerator().addComment(answer);
answer.addElement(new TextElement("select")); //$NON-NLS-1$
XmlElement ifElement = new XmlElement("if"); //$NON-NLS-1$
ifElement.addAttribute(new Attribute("test", "distinct")); //$NON-NLS-1$ //$NON-NLS-2$
ifElement.addElement(new TextElement("distinct")); //$NON-NLS-1$
answer.addElement(ifElement);
StringBuilder sb = new StringBuilder();
if (stringHasValue(introspectedTable
.getSelectByExampleQueryId())) {
sb.append('\'');
sb.append(introspectedTable.getSelectByExampleQueryId());
sb.append("' as QUERYID,"); //$NON-NLS-1$
answer.addElement(new TextElement(sb.toString()));
}
answer.addElement(getBaseColumnListElement());
answer.addElement(new TextElement(",")); //$NON-NLS-1$
answer.addElement(getBlobColumnListElement());
sb.setLength(0);
sb.append("from "); //$NON-NLS-1$
sb.append(introspectedTable
.getAliasedFullyQualifiedTableNameAtRuntime());
answer.addElement(new TextElement(sb.toString()));
answer.addElement(getUpdateByExampleIncludeElement());
ifElement = new XmlElement("if"); //$NON-NLS-1$
ifElement.addAttribute(new Attribute("test",
ReplaceExamplePlugin.getParamterName()+"."+"orderByClause != null")); //$NON-NLS-1$ //$NON-NLS-2$
ifElement.addElement(new TextElement("order by ${"+ReplaceExamplePlugin.getParamterName()+"."+"orderByClause}")); //$NON-NLS-1$
answer.addElement(ifElement);
FormatTools.addElementWithBestPosition(parentElement, answer);
}
}
| [
"[email protected]"
] | |
708f69480d4ee27a282271da4de3fa6b58d603aa | 5b9a04d3c911c16aba63258d48606d6ea364a6da | /distribution_sales/modules/sales/app/entity/sales/Sequence.java | 4584899983b892638dee091ff3a0064deed1f407 | [
"Apache-2.0"
] | permissive | yourant/repository1 | 40fa5ce602bbcad4e6f61ad6eb1330cfe966f780 | 9ab74a2dfecc3ce60a55225e39597e533975a465 | refs/heads/master | 2021-12-15T04:22:23.009473 | 2017-07-28T06:06:35 | 2017-07-28T06:06:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 939 | java | package entity.sales;
public class Sequence {
private Integer id;
private String seqName;
private Long currentValue;
private Integer increment;
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSeqName() {
return seqName;
}
public void setSeqName(String seqName) {
this.seqName = seqName;
}
public Long getCurrentValue() {
return currentValue;
}
public void setCurrentValue(Long currentValue) {
this.currentValue = currentValue;
}
public Integer getIncrement() {
return increment;
}
public void setIncrement(Integer increment) {
this.increment = increment;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
} | [
"[email protected]"
] | |
e91f72f7a87666f5a164fbbd2478aa50ea469a84 | 6b42a5c49f6394ef989a955a99e0d90081d67d8e | /source/src/com/ipx/json/Cuenta.java | 6d1ec99add5f6194d2a7ba43da74f7e75ac8302c | [] | no_license | Alucarth/goldenpos | ab8324a631ed340fade28d313e8d824371b2ee07 | 894e7d974dfb7838417923f265898c054d107366 | refs/heads/master | 2016-09-01T14:27:25.701671 | 2016-01-12T21:13:53 | 2016-01-12T21:13:53 | 49,528,666 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,517 | java | /*
* Esta clase trata una respuesta json con la siguiente estructura:
* {
"clientes": [{
"id": 1,
"name": "Pollos Copacabana",
"nit": "987654321"
}, {
"id": 2,
"name": "APLP",
"nit": "123456798"
}, {
"id": 3,
"name": "Coca Cola",
"nit": "2308379"
}],
"productos": [{
"id": 1,
"notes": "Servicios",
"cost": "253.4000"
}, {
"id": 2,
"notes": "consumo",
"cost": "300.0000"
}]
}
* se quito los clientes de la respuesta debido a excesivo trafico de datos
*/
package com.ipx.json;
import java.util.Vector;
import org.json.me.JSONException;
import org.json.me.JSONObject;
/**
*
* @author David Torrez
*/
public class Cuenta
{
private Vector productos;
private Vector sucursales;
public Cuenta(String jsonText)
{
try {
JSONObject json = new JSONObject(jsonText);
if(json.has("productos"))
{
this.productos = Products.fromJsonArray(json.getString("productos"));
}
if(json.has("sucursales"))
{
this.sucursales= Sucursal.fromJSONArray(json.getString("sucursales"));
}
} catch (JSONException ex) {
ex.printStackTrace();
}
}
public Vector getProductos()
{
return this.productos;
}
public Vector getSucursales() {
return sucursales;
}
}
| [
"[email protected]"
] | |
b5834e54d6b6390febeec25f8e393a4131abd0f9 | d54150bd7f67f70fec4c763516e2c0dd5266fe71 | /teahouse-core/src/main/java/cn/com/shopec/quartz/utils/ThemeOrderNoPayDealQuartz.java | 52593d8056dc953a5d9400f832a2338a68398d92 | [] | no_license | melonw123/xzproject | 7c44fd1c7e2dacc121cf42c081eb3f8897f54a37 | 4309ea9c0905532d793ee18a996e4e2070f86a6a | refs/heads/master | 2023-03-18T10:48:10.440207 | 2018-06-05T10:06:10 | 2018-06-05T10:06:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,215 | java | package cn.com.shopec.quartz.utils;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import cn.com.shopec.common.ResultInfo;
import cn.com.shopec.common.constants.Constant;
import cn.com.shopec.common.sendmsg.MsgConstant;
import cn.com.shopec.common.sendmsg.SendMsgCommonInterfaceService;
import cn.com.shopec.common.utils.ECDateUtils;
import cn.com.shopec.core.common.PageFinder;
import cn.com.shopec.core.common.Query;
import cn.com.shopec.core.member.dao.MemberDao;
import cn.com.shopec.core.member.model.Member;
import cn.com.shopec.core.order.common.OrderConstant;
import cn.com.shopec.core.order.model.ThemeOrder;
import cn.com.shopec.core.order.service.ThemeOrderService;
import cn.com.shopec.core.themepavilion.model.ArrayCourse;
import cn.com.shopec.core.themepavilion.model.Course;
import cn.com.shopec.core.themepavilion.service.ArrayCourseService;
import cn.com.shopec.core.themepavilion.service.CourseService;
/**
* 主题馆订单未支付定时任务处理 每30分钟执行一次
*
* @author LiHuan Date 2018年1月8日 上午11:39:56
*/
public class ThemeOrderNoPayDealQuartz {
private Log log = LogFactory.getLog(ThemeOrderNoPayDealQuartz.class);
@Resource
private MemberDao memberDao;
@Resource
private ArrayCourseService arrayCourseService;
@Resource
private ThemeOrderService themeOrderService;
@Resource
private CourseService courseService;
@Resource
private SendMsgCommonInterfaceService sendMsgCommonInterfaceService;
public void quartzStart() throws Exception {
Member member = new Member();
member.setIsBlacklist(0);// 非黑名单
List<Member> listMember = memberDao.queryMemberList(new Query(member));
if (listMember != null && listMember.size() > 0) {
for (Member memberBean : listMember) {
ThemeOrder themeOrder = new ThemeOrder();
themeOrder.setMemberNo(memberBean.getMemberNo());
themeOrder.setPayStatus(0);//未支付
List<ThemeOrder> listThemeOrder = themeOrderService.getThemeOrderList(new Query(themeOrder));
if(listThemeOrder != null && listThemeOrder.size() >0){
for (ThemeOrder theme : listThemeOrder) {
if(theme.getOrderStatus() == null){
ThemeOrder order = new ThemeOrder();
order.setThemeOrderNo(theme.getThemeOrderNo());
order.setOrderStatus(Integer.parseInt(OrderConstant.yqxOrder_code));
ResultInfo<ThemeOrder> result = themeOrderService.updateThemeOrder(order, null);
if(result.getCode().equals(Constant.SECCUESS)){
//更新订单后修改排课表
ArrayCourse arrayCourse = arrayCourseService.getArrayCourse(theme.getArrangeNo());
if(arrayCourse != null){
if(arrayCourse.getPeopleNumber() == arrayCourse.getReservation()){
ArrayCourse course = new ArrayCourse();
course.setArrayCourseNo(arrayCourse.getArrayCourseNo());
if(arrayCourse.getLineUp() >= theme.getPeopleNumber()){
course.setLineUp(arrayCourse.getLineUp() - theme.getPeopleNumber());
}
arrayCourseService.updateArrayCourse(course, null);
}else{
ArrayCourse course = new ArrayCourse();
course.setArrayCourseNo(arrayCourse.getArrayCourseNo());
if(arrayCourse.getReservation() >= theme.getPeopleNumber()){
course.setReservation(arrayCourse.getReservation() - theme.getPeopleNumber());
}
ResultInfo<ArrayCourse> resultCourse = arrayCourseService.updateArrayCourse(course, null);
//更新排课表成功之后,查询有没有排队中的订单,若有直接更新此订单为已预约
if(resultCourse.getCode().equals(Constant.SECCUESS)){
ThemeOrder themeBean = new ThemeOrder();
themeBean.setArrangeNo(theme.getArrangeNo());
themeBean.setOrderStatus(Integer.parseInt(OrderConstant.pdzOrder_code));
int pageNo = 1;
int pageSize = theme.getPeopleNumber();
PageFinder<ThemeOrder> pageLineOrder = themeOrderService.queryLineThemeOrder(new Query(pageNo, pageSize, themeBean));
if(pageLineOrder != null && pageLineOrder.getData() != null && pageLineOrder.getData().size()>0){
for (ThemeOrder to : pageLineOrder.getData()) {
//更新排队订单
ThemeOrder lineOrder = new ThemeOrder();
lineOrder.setThemeOrderNo(to.getThemeOrderNo());
lineOrder.setOrderStatus(Integer.parseInt(OrderConstant.yuyueOrder_code));
ResultInfo<ThemeOrder> themeResult = themeOrderService.updateThemeOrder(lineOrder, null);
if(themeResult.getCode().equals(OrderConstant.success_code)){
//执行短信发送
String classDate = ECDateUtils.formatDate(to.getPaymentTime(), "yyyy年MM月dd日 HH:mm:ss");
String courseName = "";
Course courseBean = courseService.getCourse(to.getCourseNo());
if(courseBean != null){
courseName = courseBean.getChineseName();
}
String msgType = MsgConstant.LINEUPTYPE;
String content = classDate+"预约成功的"+courseName+"课程";
boolean flag = false;
flag = sendMsgCommonInterfaceService.sendMsgPost(to.getMobilePhone(), content, msgType);
log.info("发送内容为:==========================》"+flag);
}else{
log.info("更新排队中的订单数据失败!");
}
}
}
}else{
log.info("更新排课表数据失败!");
}
}
}
}else{
log.info("更新未支付的主题订单失败!");
}
}
}
}
}
}
}
protected void execute(String arg0) throws Exception {
try {
log.info("--------主题馆未支付订单修改,开始时间:" + new Date());
// 执行业务方法
quartzStart();
log.info("--------主题馆未支付订单修改定时任务完成...");
} catch (Exception e) {
log.error("--------主题馆未支付订单修改,错误信息:" + e.getMessage(), e);
}
}
} | [
"[email protected]"
] | |
c2d1ea5a7ca9a9e19dfee9b5cec9b4b74cbb450e | ddef8d0a07c23ef4d89a2a5d476a1ff5ef873e0b | /DYN-IDM/springJdbcTest/src/main/java/spring/jdbc/UserDAO.java | c3929a196cc2a8ab887bc9916a99f2f57888efa0 | [] | no_license | parlovich/test | 784e5384661dc4b0398bbae2e44083bc70c7168d | 762ac16348f880b7cade8ef5acec032926968392 | refs/heads/master | 2021-01-10T19:59:29.349981 | 2014-06-18T09:14:40 | 2014-06-18T09:14:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package spring.jdbc;
import java.util.List;
import javax.sql.DataSource;
public interface UserDAO {
public void setDataSource(DataSource ds);
public void create(User user);
public User getUser(int id);
public User getUser(String login);
public List<User> listUsers();
public void delete(int id);
public void update(User user);
} | [
"[email protected]"
] | |
ce7729b36bf43c11e3cdba7d8683f73cb1639308 | 8fec61ea0e8b40dba17635accbf1f4e4fa8db90e | /ssm_crud_idea/src/main/java/com/ysw/crud/dao/EmployeeMapper.java | c8802fd1c92dd2bee94f2e456b926cac04ceaea3 | [] | no_license | y1s2w3/ssm_crud_idea | 48a31eb719d33e33dd0db4c0018ba102eb0bd8b7 | 26939f7acaa90ac854365f3f1c70211a62bd149d | refs/heads/master | 2023-05-06T15:19:08.347025 | 2021-05-26T04:23:34 | 2021-05-26T04:23:34 | 370,904,270 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | java | package com.ysw.crud.dao;
import com.ysw.crud.bean.Employee;
import com.ysw.crud.bean.EmployeeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EmployeeMapper {
long countByExample(EmployeeExample example);
int deleteByExample(EmployeeExample example);
int deleteByPrimaryKey(Integer empId);
int insert(Employee record);
int insertSelective(Employee record);
List<Employee> selectByExample(EmployeeExample example);
Employee selectByPrimaryKey(Integer empId);
// 查询带部门名称的员工信息
List<Employee> selectByExampleWithDept(EmployeeExample example);
// 根据主键,查询带部门名称的员工信息
Employee selectByPrimaryKeyWithDept(Integer empId);
int updateByExampleSelective(@Param("record") Employee record, @Param("example") EmployeeExample example);
int updateByExample(@Param("record") Employee record, @Param("example") EmployeeExample example);
int updateByPrimaryKeySelective(Employee record);
int updateByPrimaryKey(Employee record);
} | [
"[email protected]"
] | |
2e7a70bca4dbc8b7eee405117b5e6e9b41bff18a | e0e2b50412bdc5742af17607688df722f2359891 | /7.2/misc/ImageVisualizer/ImageEditor/src/org/netbeans/modules/image/ZoomOutAction.java | cf659d0c8298709f3af6117c78115071e6903870 | [] | no_license | redporrot/nbp-resources | faf4b4662779d038bc8770d3cea38b4f1653d70c | ef8a41ae6ab18dd1cd1460fa99a52757bf98916b | refs/heads/master | 2020-04-01T17:24:22.481434 | 2015-06-12T21:37:01 | 2015-06-12T21:37:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,605 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
*
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (collectively, the
* "License"). You may not use this file except in compliance with the
* License. You can obtain a copy of the License at
* http://www.netbeans.org/cddl-gplv2.html
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
* specific language governing permissions and limitations under the
* License. When distributing the software, include this License Header
* Notice in each file and include the License file at
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the
* License Header, with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Contributor(s):
*
* The Original Software is NetBeans. The Initial Developer of the Original
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
* Microsystems, Inc. All Rights Reserved.
*
* If you wish your version of this file to be governed by only the CDDL
* or only the GPL Version 2, indicate your decision by adding
* "[Contributor] elects to include this software in this distribution
* under the [CDDL or GPL Version 2] license." If you do not indicate a
* single choice of license, a recipient has the option to distribute
* your version of this file under either the CDDL, the GPL Version 2 or
* to extend the choice of license to its licensees as provided above.
* However, if you add GPL Version 2 code and therefore, elected the GPL
* Version 2 license, then the option applies only if the new code is
* made subject to such option by the copyright holder.
*/
package org.netbeans.modules.image;
import org.openide.util.actions.CallableSystemAction;
import org.openide.util.HelpCtx;
import org.openide.windows.TopComponent;
import org.openide.util.NbBundle;
/**
* Action which zooms out of an image.
*
* @author Lukas Tadial
*/
public class ZoomOutAction extends CallableSystemAction {
/** Generated serial version UID. */
static final long serialVersionUID = 1859897546585041051L;
/** Peforms action. */
public void performAction() {
TopComponent curComponent = TopComponent.getRegistry().getActivated();
if(curComponent instanceof ImageViewer)
((ImageViewer) curComponent).zoomOut();
}
/** Gets name of action. Implements superclass abstract method. */
public String getName() {
return NbBundle.getBundle(ZoomOutAction.class).getString("LBL_ZoomOut");
}
/** Gets help context for action. Implements superclass abstract method. */
public org.openide.util.HelpCtx getHelpCtx() {
return HelpCtx.DEFAULT_HELP;
}
/** Overrides superclass method. */
public boolean isEnabled() {
return true;
}
/** Gets icon resource. Overrides superclass method. */
protected String iconResource() {
return "org/netbeans/modules/image/zoomOut.gif"; // NOI18N
}
}
| [
"[email protected]"
] | |
e41240109c8c9d6e81bc9018f082f4d1c76aac6c | a292b2564e4b05ce513f2a037186d6d5801a4ba2 | /1 Two Sum/solution2.java | 2e64478507b1afc4b848ad27aef720340c5c7689 | [] | no_license | wbq2101116/LeetCode | cfcec67d307d0da088d276b3ad18bcc02c5bed10 | a1fe00e25e5afc8784fbb785a344275ee97786dc | refs/heads/master | 2021-05-08T04:30:34.892593 | 2018-04-03T05:57:50 | 2018-04-03T05:57:50 | 108,410,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 468 | java | class Solution {
public int[] twoSum(int[] nums, int target) {
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for (int i = 0; i < nums.length; i++) {
map.put(nums[i], i);
}
for (int i = 0; i < nums.length; i++) {
int complement = target - nums[i];
if (map.containsKey(complement) && map.get(complement) != i) {
return new int[] {i, map.get(complement)};
}
}
throw new IllegalArgumentException("No two sum solution");
}
}
| [
"[email protected]"
] | |
a6c69c1943eab1d9c7f398cc910c9672390f8ee9 | e2d001344ff6783b1d17da22af8cf247b0b87bfb | /a6-TheYosemiteJoe/src/a6/Sushi.java | 92096857e7c94f7c68edf231ee84f6b21afe9c1d | [] | no_license | NauticaHarvin/Comp-401-Spring-19 | b2c917bfa285afb837879f1e4618e7601ea6dc62 | f6aa7cfa93c929a8effd8936b24124e1c57ba180 | refs/heads/master | 2021-08-27T21:41:27.316597 | 2021-08-25T01:59:44 | 2021-08-25T01:59:44 | 184,714,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | package a6;
public interface Sushi {
String getName();
IngredientPortion[] getIngredients();
int getCalories();
double getCost();
boolean getHasRice();
boolean getHasShellfish();
boolean getIsVegetarian();
}
| [
"[email protected]"
] | |
d3b2bac2ad0b8bf564b0008505f99af1e6a7413f | ac5ccef81c3111deada74dfe22ca69dbfeba71cb | /src/DAO/DAOCidadeEstado.java | 9a331ddabb7aa0091db78b444f82622bc568bcb9 | [] | no_license | EdivanFranca/vegasys | 92f4700d3d28fe209d33343f15498266b4011cef | 73c7d966f207eb5175d9de928fbb08b05222c195 | refs/heads/master | 2021-05-11T20:15:58.378893 | 2018-01-14T14:09:54 | 2018-01-14T14:09:54 | 117,436,606 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,181 | java | package DAO;
import model.ModelCidadeEstado;
import conexoes.ConexaoMySql;
import java.util.ArrayList;
import model.ModelCidade;
import model.ModelEstado;
/**
*
* @author BLSoft Desenvolvimento de Sistemas
*/
public class DAOCidadeEstado extends ConexaoMySql {
/**
* recupera uma lista de CidadeEstado return ArrayList
*/
public ArrayList<ModelCidadeEstado> getListaCidadeEstadoDAO() {
ArrayList<ModelCidadeEstado> listamodelCidadeEstado = new ArrayList();
ModelCidadeEstado modelCidadeEstado = new ModelCidadeEstado();
ModelCidade modelCidade = new ModelCidade();
ModelEstado modelEstado = new ModelEstado();
try {
this.conectar();
this.executarSQL(
"SELECT "
+ "cidade.codigo,"
+ "cidade.nome,"
+ "cidade.fk_cod_estado,"
+ "estado.codigo,"
+ "estado.uf,"
+ "estado.nome "
+ " FROM"
+ " cidade inner join estado on estado.codigo = cidade.fk_cod_estado"
+ ";"
);
while (this.getResultSet().next()) {
modelCidade = new ModelCidade();
modelEstado = new ModelEstado();
modelCidadeEstado = new ModelCidadeEstado();
modelCidade.setCodigo(this.getResultSet().getInt(1));
modelCidade.setNome(this.getResultSet().getString(2));
modelCidade.setFk_cod_estado(this.getResultSet().getInt(3));
modelEstado.setCodigo(this.getResultSet().getInt(4));
modelEstado.setUf(this.getResultSet().getString(5));
modelEstado.setNome(this.getResultSet().getString(6));
modelCidadeEstado.setModelCidade(modelCidade);
modelCidadeEstado.setModelEstado(modelEstado);
listamodelCidadeEstado.add(modelCidadeEstado);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
this.fecharConexao();
}
return listamodelCidadeEstado;
}
}
| [
"C@C-PC"
] | C@C-PC |
26a657d49ecd05710e27ccfb4afd7a1792390d36 | 2bc2eadc9b0f70d6d1286ef474902466988a880f | /tags/3.0.0-M2-20091130/transports/cxf/src/main/java/org/mule/transport/cxf/CxfMessageDispatcher.java | 9dfb292d46c05648b7e44e3053ac4c85022dfb90 | [] | no_license | OrgSmells/codehaus-mule-git | 085434a4b7781a5def2b9b4e37396081eaeba394 | f8584627c7acb13efdf3276396015439ea6a0721 | refs/heads/master | 2022-12-24T07:33:30.190368 | 2020-02-27T19:10:29 | 2020-02-27T19:10:29 | 243,593,543 | 0 | 0 | null | 2022-12-15T23:30:00 | 2020-02-27T18:56:48 | null | UTF-8 | Java | false | false | 10,868 | java | /*
* $Id$
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
*
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.transport.cxf;
import org.mule.DefaultMuleMessage;
import org.mule.api.MuleEvent;
import org.mule.api.MuleMessage;
import org.mule.api.config.MuleProperties;
import org.mule.api.endpoint.EndpointURI;
import org.mule.api.endpoint.OutboundEndpoint;
import org.mule.api.transformer.TransformerException;
import org.mule.transport.AbstractMessageDispatcher;
import org.mule.transport.NullPayload;
import org.mule.transport.cxf.security.WebServiceSecurityException;
import org.mule.transport.soap.SoapConstants;
import org.mule.util.TemplateParser;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Holder;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.service.model.BindingOperationInfo;
/**
* The CxfMessageDispatcher is used for making Soap client requests to remote
* services.
*/
public class CxfMessageDispatcher extends AbstractMessageDispatcher
{
private static final String URI_REGEX = "cxf:\\[(.+?)\\]:(.+?)/\\[(.+?)\\]:(.+?)";
Pattern URI_PATTERN = Pattern.compile(URI_REGEX);
protected final CxfConnector connector;
protected ClientWrapper wrapper;
private final TemplateParser soapActionTemplateParser = TemplateParser.createMuleStyleParser();
public CxfMessageDispatcher(OutboundEndpoint endpoint)
{
super(endpoint);
this.connector = (CxfConnector) endpoint.getConnector();
}
/*
We need a way to associate an endpoint with a specific CXF service and operation, and the most sensible way to
accomplish that is to overload URI syntax:
cxf:[service_URI]:service_localname/[ep_URI]:ep_localname
And the map method to operation
*/
@Override
protected void doConnect() throws Exception
{
wrapper = new ClientWrapper(connector.getCxfBus(), endpoint);
}
@Override
protected void doDisconnect() throws Exception
{
// nothing to do
}
@Override
protected void doDispose()
{
// nothing to do
}
protected Object[] getArgs(MuleEvent event) throws TransformerException
{
Object payload;
if (wrapper.isApplyTransformersToProtocol())
{
payload = event.getMessage().getPayload();
}
else
{
payload = event.transformMessage();
}
if (wrapper.isProxy())
{
return new Object[] { event.getMessage() };
}
Object[] args;
if (payload instanceof Object[])
{
args = (Object[])payload;
}
else
{
args = new Object[]{payload};
}
MuleMessage message = event.getMessage();
Set<?> attachmentNames = message.getAttachmentNames();
if (attachmentNames != null && !attachmentNames.isEmpty())
{
List<DataHandler> attachments = new ArrayList<DataHandler>();
for (Iterator<?> i = attachmentNames.iterator(); i.hasNext();)
{
attachments.add(message.getAttachment((String)i.next()));
}
List<Object> temp = new ArrayList<Object>(Arrays.asList(args));
temp.add(attachments.toArray(new DataHandler[0]));
args = temp.toArray();
}
if (args.length == 0)
{
return null;
}
return args;
}
protected MuleMessage doSend(MuleEvent event) throws Exception
{
((ClientImpl)wrapper.getClient()).setSynchronousTimeout(event.getTimeout());
MuleMessage res;
if (!wrapper.isClientProxyAvailable())
{
res = doSendWithClient(event);
}
else
{
res = doSendWithProxy(event);
}
return res;
}
protected MuleMessage doSendWithProxy(MuleEvent event) throws Exception
{
Method method = wrapper.getMethod(event);
Map<String, Object> props = getInovcationProperties(event);
Holder<MuleMessage> holder = new Holder<MuleMessage>();
props.put("holder", holder);
// Set custom soap action if set on the event or endpoint
String soapAction = (String)event.getMessage().getProperty(SoapConstants.SOAP_ACTION_PROPERTY);
if (soapAction != null)
{
soapAction = parseSoapAction(soapAction, new QName(method.getName()), event);
props.put(org.apache.cxf.binding.soap.SoapBindingConstants.SOAP_ACTION, soapAction);
}
BindingProvider bp = wrapper.getClientProxy();
bp.getRequestContext().putAll(props);
Object response;
try
{
response = method.invoke(wrapper.getClientProxy(), getArgs(event));
}
catch (InvocationTargetException e)
{
Throwable ex = ((InvocationTargetException) e).getTargetException();
if (ex != null && ex.getMessage().contains("Security"))
{
throw new WebServiceSecurityException(event, e);
}
else
{
throw e;
}
}
// TODO: handle holders
MuleMessage muleRes = holder.value;
return buildResponseMessage(muleRes, new Object[] { response });
}
protected MuleMessage doSendWithClient(MuleEvent event) throws Exception
{
BindingOperationInfo bop = wrapper.getOperation(event);
Map<String, Object> props = getInovcationProperties(event);
// Holds the response from the transport
Holder<MuleMessage> holder = new Holder<MuleMessage>();
props.put("holder", holder);
// Set custom soap action if set on the event or endpoint
String soapAction = (String)event.getMessage().getProperty(SoapConstants.SOAP_ACTION_PROPERTY);
if (soapAction != null)
{
soapAction = parseSoapAction(soapAction, bop.getName(), event);
props.put(org.apache.cxf.binding.soap.SoapBindingConstants.SOAP_ACTION, soapAction);
event.getMessage().setProperty(SoapConstants.SOAP_ACTION_PROPERTY, soapAction);
}
Map<String, Object> ctx = new HashMap<String, Object>();
ctx.put(Client.REQUEST_CONTEXT, props);
ctx.put(Client.RESPONSE_CONTEXT, props);
// Set Custom Headers on the client
Object[] arr = event.getMessage().getPropertyNames().toArray();
String head;
for (int i = 0; i < arr.length; i++)
{
head = (String) arr[i];
if ((head != null) && (!head.startsWith("MULE")))
{
props.put((String) arr[i], event.getMessage().getProperty((String) arr[i]));
}
}
Object[] response = wrapper.getClient().invoke(bop, getArgs(event), ctx);
MuleMessage muleRes = holder.value;
return buildResponseMessage(muleRes, response);
}
private Map<String, Object> getInovcationProperties(MuleEvent event)
{
Map<String, Object> props = new HashMap<String, Object>();
props.put(MuleProperties.MULE_EVENT_PROPERTY, event);
EndpointURI uri = endpoint.getEndpointURI();
if (uri.getUser() != null)
{
props.put(BindingProvider.USERNAME_PROPERTY, uri.getUser());
props.put(BindingProvider.PASSWORD_PROPERTY, uri.getPassword());
}
return props;
}
protected MuleMessage buildResponseMessage(MuleMessage transportResponse, Object[] response)
{
// One way dispatches over an async transport result in this
if (transportResponse == null)
{
return new DefaultMuleMessage(NullPayload.getInstance(), connector.getMuleContext());
}
// Otherwise we may have a response!
MuleMessage result = null;
if (response != null && response.length <= 1)
{
if (response.length == 1)
{
result = new DefaultMuleMessage(response[0], transportResponse, connector.getMuleContext());
}
}
else
{
result = new DefaultMuleMessage(response, transportResponse, connector.getMuleContext());
}
return result;
}
protected void doDispatch(MuleEvent event) throws Exception
{
doSend(event);
}
public String parseSoapAction(String soapAction, QName method, MuleEvent event)
{
EndpointURI endpointURI = event.getEndpoint().getEndpointURI();
Map<String, String> properties = new HashMap<String, String>();
MuleMessage msg = event.getMessage();
for (Iterator<?> iterator = msg.getPropertyNames().iterator(); iterator.hasNext();)
{
String propertyKey = (String)iterator.next();
properties.put(propertyKey, msg.getProperty(propertyKey).toString());
}
properties.put(MuleProperties.MULE_METHOD_PROPERTY, method.getLocalPart());
properties.put("methodNamespace", method.getNamespaceURI());
properties.put("address", endpointURI.getAddress());
properties.put("scheme", endpointURI.getScheme());
properties.put("host", endpointURI.getHost());
properties.put("port", String.valueOf(endpointURI.getPort()));
properties.put("path", endpointURI.getPath());
properties.put("hostInfo", endpointURI.getScheme()
+ "://"
+ endpointURI.getHost()
+ (endpointURI.getPort() > -1
? ":" + String.valueOf(endpointURI.getPort()) : ""));
if (event.getService() != null)
{
properties.put("serviceName", event.getService().getName());
}
soapAction = soapActionTemplateParser.parse(properties, soapAction);
if (logger.isDebugEnabled())
{
logger.debug("SoapAction for this call is: " + soapAction);
}
return soapAction;
}
}
| [
"rossmason@bf997673-6b11-0410-b953-e057580c5b09"
] | rossmason@bf997673-6b11-0410-b953-e057580c5b09 |
6ae31219fcbc06a26df27eb0163bda20648ce47d | 7fe1b440c00d4c87a80fdd3bd2d00f23fc3cc15c | /LeetCode/src/lzq/leetcode/initial/normal/TwoKeysKeyboard.java | effb946df5767f93fa89e7f69525ec5764a51132 | [] | no_license | luzheqi1987/LeetCode | e24b2b8d90d4d65225e48d2edcb9741efd46b6b9 | c72463d9276433d7abde3af17209693071cc1cbf | refs/heads/master | 2023-01-23T22:30:01.510969 | 2022-12-29T12:45:29 | 2022-12-29T12:45:29 | 13,192,716 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,321 | java | package lzq.leetcode.initial.normal;
public class TwoKeysKeyboard {
public int minSteps(int n) {
int steps = 0;
int tmp = n;
int divided = n / 2;
while(divided > 1){
if(tmp % divided == 0){
steps += tmp / divided;
tmp = divided;
divided = divided / 2;
}else{
divided--;
}
}
steps += tmp > 1 ? tmp : 0;
return steps;
}
public static void main(String[] args) {
System.out.println((new TwoKeysKeyboard()).minSteps(1));
System.out.println((new TwoKeysKeyboard()).minSteps(2));
System.out.println((new TwoKeysKeyboard()).minSteps(3));
System.out.println((new TwoKeysKeyboard()).minSteps(4));
System.out.println((new TwoKeysKeyboard()).minSteps(5));
System.out.println((new TwoKeysKeyboard()).minSteps(6));
System.out.println((new TwoKeysKeyboard()).minSteps(7));
System.out.println((new TwoKeysKeyboard()).minSteps(8));
System.out.println((new TwoKeysKeyboard()).minSteps(9));
System.out.println((new TwoKeysKeyboard()).minSteps(10));
System.out.println((new TwoKeysKeyboard()).minSteps(11));
System.out.println((new TwoKeysKeyboard()).minSteps(12));
}
}
| [
"[email protected]"
] | |
6b4f1be7c5165826f928d118e23b82707353f032 | 9111891f3a294d6d59bc2fdee2d0700bcbeb9144 | /Mamma_code/android/Model/ReviewComment.java | 873f9fc02b0f6a4883f4a4a2f589dd9057128ef0 | [] | no_license | DongramO/Mamma_android | 2ba53326ec5cc02f7dab1b42d34cdef71e03dd38 | e93ac98342e33ef8404928d4dbcfa5e8c043d66c | refs/heads/master | 2021-08-05T13:26:40.690371 | 2017-10-31T05:09:24 | 2017-10-31T05:09:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package momma_beta.momma_bv.Model;
/**
* Created by idongsu on 2017. 5. 16..
*/
public class ReviewComment
{
public String comment;
}
| [
"[email protected]"
] | |
5e9e430d29c163959f3fd811b1b01f46a7a5d028 | 04bd85b33041a43095860d1cd9f5e43dc4b278e8 | /lib/src/main/java/Factory/Example1/Araba.java | f5d5e8845b75a17bd6e412fbe7e94f2269ae1235 | [] | no_license | otabakoglu/JavaDesignPatterns | 5c163422d83816a64c78535848ee257a457a96ee | 6a4a4071ab1b4ff600058b07a5e74394b98301f1 | refs/heads/master | 2021-01-20T02:28:28.237406 | 2017-04-28T00:13:57 | 2017-04-28T00:13:57 | 89,409,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package Factory.Example1;
/**
* Created by Rubi on 27.04.2017.
*/
public abstract class Araba {
private String marka = null;
private String model = null;
private int beygirGucu = 0;
public Araba ( String marka, String model, int beygirGucu ){
setMarka( marka );
setModel( model );
setBeygirGucu( beygirGucu );
}
public void setMarka(String marka) {
this.marka = marka;
}
public void setModel(String model) {
this.model = model;
}
public void setBeygirGucu(int beygirGucu) {
this.beygirGucu = beygirGucu;
}
public String getMarka(){
return marka;
}
public String getModel(){
return model;
}
public int getBeygirGucu(){
return beygirGucu;
}
}
| [
"[email protected]"
] | |
68556813ca6b33a97df6643a7f1c710c1e287d11 | fe7a91bc5cec069cfc5904467e2440ecc3ea38bd | /library/src/main/java/me/zhanghai/android/materialprogressbar/internal/ObjectAnimatorCompatBase.java | b97df122b7e3092686a5ac5a28958ee8ad5476cd | [
"Apache-2.0"
] | permissive | h6ah4i/MaterialProgressBar | 6aaffdacfe5b8a7cc5b2429f35e307445b213584 | e23cecf7205649a910b87d38e297f00778e15a5e | refs/heads/master | 2021-01-17T21:20:51.969680 | 2015-06-10T08:35:53 | 2015-06-10T08:35:53 | 37,072,021 | 1 | 0 | null | 2015-06-08T14:31:12 | 2015-06-08T14:31:12 | null | UTF-8 | Java | false | false | 4,654 | java | /*
* Copyright (c) 2015 Zhang Hai <[email protected]>
* All Rights Reserved.
*/
package me.zhanghai.android.materialprogressbar.internal;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.support.annotation.Size;
import android.util.Property;
class ObjectAnimatorCompatBase {
private static final int NUM_POINTS = 500;
private ObjectAnimatorCompatBase() {}
public static ObjectAnimator ofArgb(Object target, String propertyName, int... values) {
ObjectAnimator animator = ObjectAnimator.ofInt(target, propertyName, values);
animator.setEvaluator(new ArgbEvaluator());
return animator;
}
public static <T> ObjectAnimator ofArgb(T target, Property<T, Integer> property,
int... values) {
ObjectAnimator animator = ObjectAnimator.ofInt(target, property, values);
animator.setEvaluator(new ArgbEvaluator());
return animator;
}
public static ObjectAnimator ofFloat(Object target, String xPropertyName, String yPropertyName,
Path path) {
float[] xValues = new float[NUM_POINTS];
float[] yValues = new float[NUM_POINTS];
calculateXYValues(path, xValues, yValues);
PropertyValuesHolder xPvh = PropertyValuesHolder.ofFloat(xPropertyName, xValues);
PropertyValuesHolder yPvh = PropertyValuesHolder.ofFloat(yPropertyName, yValues);
return ObjectAnimator.ofPropertyValuesHolder(target, xPvh, yPvh);
}
public static <T> ObjectAnimator ofFloat(T target, Property<T, Float> xProperty,
Property<T, Float> yProperty, Path path) {
float[] xValues = new float[NUM_POINTS];
float[] yValues = new float[NUM_POINTS];
calculateXYValues(path, xValues, yValues);
PropertyValuesHolder xPvh = PropertyValuesHolder.ofFloat(xProperty, xValues);
PropertyValuesHolder yPvh = PropertyValuesHolder.ofFloat(yProperty, yValues);
return ObjectAnimator.ofPropertyValuesHolder(target, xPvh, yPvh);
}
public static ObjectAnimator ofInt(Object target, String xPropertyName, String yPropertyName,
Path path) {
int[] xValues = new int[NUM_POINTS];
int[] yValues = new int[NUM_POINTS];
calculateXYValues(path, xValues, yValues);
PropertyValuesHolder xPvh = PropertyValuesHolder.ofInt(xPropertyName, xValues);
PropertyValuesHolder yPvh = PropertyValuesHolder.ofInt(yPropertyName, yValues);
return ObjectAnimator.ofPropertyValuesHolder(target, xPvh, yPvh);
}
public static <T> ObjectAnimator ofInt(T target, Property<T, Integer> xProperty,
Property<T, Integer> yProperty, Path path) {
int[] xValues = new int[NUM_POINTS];
int[] yValues = new int[NUM_POINTS];
calculateXYValues(path, xValues, yValues);
PropertyValuesHolder xPvh = PropertyValuesHolder.ofInt(xProperty, xValues);
PropertyValuesHolder yPvh = PropertyValuesHolder.ofInt(yProperty, yValues);
return ObjectAnimator.ofPropertyValuesHolder(target, xPvh, yPvh);
}
private static void calculateXYValues(Path path, @Size(NUM_POINTS) float[] xValues,
@Size(NUM_POINTS) float[] yValues) {
PathMeasure pathMeasure = new PathMeasure(path, false /* forceClosed */);
float pathLength = pathMeasure.getLength();
float[] position = new float[2];
for (int i = 0; i < NUM_POINTS; ++i) {
float distance = (i * pathLength) / (NUM_POINTS - 1);
pathMeasure.getPosTan(distance, position, null /* tangent */);
xValues[i] = position[0];
yValues[i] = position[1];
}
}
private static void calculateXYValues(Path path, @Size(NUM_POINTS) int[] xValues,
@Size(NUM_POINTS) int[] yValues) {
PathMeasure pathMeasure = new PathMeasure(path, false /* forceClosed */);
float pathLength = pathMeasure.getLength();
float[] position = new float[2];
for (int i = 0; i < NUM_POINTS; ++i) {
float distance = (i * pathLength) / (NUM_POINTS - 1);
pathMeasure.getPosTan(distance, position, null /* tangent */);
xValues[i] = Math.round(position[0]);
yValues[i] = Math.round(position[1]);
}
}
}
| [
"[email protected]"
] | |
cbf28bc19ecb99dea860dc577fc75a0818c018ad | 393fa81e7f00680858f4a487047fd17d7af4d900 | /app/src/main/java/simone/russo/tesidilaurea/view/LoginActivity.java | 7cc0fd1a53a375fcd05385a09d4c07bd31f72cd1 | [] | no_license | simonerusso97/TesiDiLaureaTriennale | 6f41757fe5959ff9a049c1180f3b023b5c541c72 | ea6cd9dab6df3e789a79bdab0206f34b16d19c99 | refs/heads/main | 2023-08-30T09:16:00.874663 | 2021-11-04T11:45:12 | 2021-11-04T11:45:12 | 424,572,194 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 72 | java | package simone.russo.tesidilaurea.view;
public class LoginActivity {
}
| [
"[email protected]"
] | |
592f918c8c5a4abff22d1dd0a00725fc3205e55d | e7f6ec52678d4c68017a576e8f57241f0a9fc948 | /app/src/main/java/com/lvqingyang/emptyhand/Picture/DetailActivity.java | a99af925d3587d7f331069add9b2bbfa9ca2c89a | [] | no_license | biloba123/EmptyHand | 5d71c85ddc5164f65f46a7f0203b87c2366d9c5f | d7c4a691a19a77c588b777d39d3f4abb000a55d1 | refs/heads/master | 2021-01-23T03:20:39.691100 | 2018-01-20T13:07:09 | 2018-01-20T13:07:09 | 86,065,951 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,002 | java | package com.lvqingyang.emptyhand.Picture;
import android.animation.AnimatorSet;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.CardView;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.GlideDrawableImageViewTarget;
import com.lvqingyang.emptyhand.Base.BaseActivity;
import com.lvqingyang.emptyhand.R;
import com.lvqingyang.emptyhand.Tools.MyOkHttp;
import com.lvqingyang.emptyhand.Tools.MySweetAlertDialog;
import com.lvqingyang.emptyhand.Tools.TypefaceUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import rx.Observable;
import rx.Observer;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import static com.lvqingyang.emptyhand.Picture.AppConstants.drawableToBitmap;
public class DetailActivity extends BaseActivity {
//View
private ImageView mImageView;
private TextView mDayTv;
private TextView mMonthTv;
private TextView mTitleTv;
private TextView mPhotoerTv;
private TextView mContentTv;
private CoordinatorLayout mCoordinatorLayout;
private CardView mCardView;
//Data
private String mImgUrl,mTitle;
private static final String KEY_URL = "URL";
private static final String TAG = "DetailActivity";
public static void start(Context context, String url) {
Intent starter = new Intent(context, DetailActivity.class);
starter.putExtra(KEY_URL, url);
context.startActivity(starter);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
initeView();
final MySweetAlertDialog dialog=new MySweetAlertDialog(this);
dialog.loading(null);
Observable.create(new Observable.OnSubscribe<String>() {
@Override
public void call(Subscriber<? super String> subscriber) {
try {
String responce = MyOkHttp.getInstance()
.run(getIntent().getStringExtra(KEY_URL));
subscriber.onNext(responce);
subscriber.onCompleted();
} catch (Exception e) {
e.printStackTrace();
subscriber.onError(e);
}
}
})
.subscribeOn(Schedulers.io()) // 指定 subscribe() 发生在 IO 线程
.observeOn(AndroidSchedulers.mainThread()) // 指定 Subscriber 的回调发生在主线程
.subscribe(new Observer<String>() {
@Override
public void onNext(String responce) {
Log.d(TAG, "onNext: " + responce);
if (responce != null) {
Document doc = Jsoup.parse(responce);
Element detailMain = doc.getElementsByClass("detail_text_main").first();
mTitle= detailMain.select("h2").text().substring(5);
setText(mTitleTv,mTitle);
StringBuffer sb = new StringBuffer();
String date = sb.append(detailMain.select("li.r_float").text()).delete(0, 5).toString();
String[] ymd = date.split("-");
setText(mMonthTv,ymd[1]);
setText(mDayTv,ymd[2]);
Element detail=detailMain.select("div.detail_text").first();
setText(mPhotoerTv,detailMain.select("div").last().text().replace(",你来掌镜",""));
Log.d(TAG, "onNext: "+detail.select("div")+"\n-------------------------"+
detail.select("div").first()+"\n----------------------------"+detail.select("div").get(0));
String content=detail.select("div").get(0).text();
setText(mContentTv,content.substring(0,content.indexOf("摄影:")));
mImgUrl=detail.select("img").attr("abs:src");
Log.d(TAG, "onNext: "+mImgUrl);
Glide.with(DetailActivity.this)
.load(mImgUrl)
.into(new GlideDrawableImageViewTarget(mImageView) {
@Override
public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
super.onResourceReady(resource, animation);
mCardView.setVisibility(View.VISIBLE);
ColorArt colorArt = new ColorArt(drawableToBitmap(mImageView.getDrawable()));
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(mCoordinatorLayout, "backgroundColor"
, colorArt.getBackgroundColor());
objectAnimator.setEvaluator(new ArgbEvaluator());
ObjectAnimator objectAnimator1 = ObjectAnimator.ofInt(mTitleTv, "textColor"
, colorArt.getDetailColor());
objectAnimator1.setEvaluator(new ArgbEvaluator());
ObjectAnimator objectAnimator2 = ObjectAnimator.ofInt(mMonthTv, "textColor"
, colorArt.getPrimaryColor());
objectAnimator2.setEvaluator(new ArgbEvaluator());
ObjectAnimator objectAnimator3 = ObjectAnimator.ofInt(mDayTv, "textColor"
, colorArt.getSecondaryColor());
objectAnimator3.setEvaluator(new ArgbEvaluator());
AnimatorSet set = new AnimatorSet();
set.play(objectAnimator)
.with(objectAnimator1)
.with(objectAnimator2)
.with(objectAnimator3);
set.setDuration(1000);
set.start();
}
});
}
}
@Override
public void onCompleted() {
dialog.complete();
}
@Override
public void onError(Throwable e) {
Log.e(TAG, "onError: " + e);
dialog.error();
e.printStackTrace();
}
});
}
private void initeView() {
// initToolbar();
mImageView = (AppCompatImageView) findViewById(R.id.img);
mTitleTv = (TextView) findViewById(R.id.titlt);
mMonthTv = (TextView) findViewById(R.id.month);
mDayTv = (TextView) findViewById(R.id.day);
mPhotoerTv = (TextView) findViewById(R.id.photoer);
mContentTv = (TextView) findViewById(R.id.content);
mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.fristLayout);
mCardView = (CardView) findViewById(R.id.td_header);
mCardView.setVisibility(View.GONE);
findViewById(R.id.ll)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(DetailActivity.this, getString(R.string.long_click), Toast.LENGTH_SHORT).show();
}
});
mImageView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
download(mImgUrl);
return true;
}
});
}
private void setText(TextView textView,String text){
textView.setText(text);
TypefaceUtils.setTypeface(textView);
}
}
| [
"[email protected]"
] | |
887fe5f60623845e37a0cbed220f03ef50a3e930 | b3418633bf03a546a5254ea422e40de17489980c | /src/main/java/com/fhd/process/web/controller/ProcessPointControl.java | 9d45af5ca5d8fc273327a50a6dcdfc2c133ea21a | [] | no_license | vincent-dixin/Financial-Street-ERMIS | d819fd319293e55578e3067c9a5de0cd33c56a93 | 87d6bc6a4ddc52abca2c341eb476c1ea283d70e7 | refs/heads/master | 2016-09-06T13:56:46.197326 | 2015-03-30T02:47:46 | 2015-03-30T02:47:46 | 33,099,786 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,688 | java | package com.fhd.process.web.controller;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.fhd.core.dao.Page;
import com.fhd.fdc.utils.UserContext;
import com.fhd.process.business.ProcessPointBO;
import com.fhd.process.entity.ProcessPoint;
import com.fhd.process.web.form.ProcessPointForm;
import com.fhd.sys.web.form.dic.DictEntryForm;
/**
* 流程节点维护
*
* @author 宋佳
* @version
* @since Ver 1.1
* @Date 2013 3-13
*/
@Controller
public class ProcessPointControl {
@Autowired
private ProcessPointBO o_ProcessPointBO;
/**
*
* @author 宋佳
* @param processEditID
* @return
* @since fhd Ver 1.1
*/
@ResponseBody
@RequestMapping("/ProcessPoint/ProcessPoint/editProcessPoint.f")
public Map<String,Object> findProcessPointForm(String processEditID,String processId){
Map<String,Object> ProcessPointMap=o_ProcessPointBO.findProcessPointForm(processEditID,processId);
return ProcessPointMap;
}
/**
*
* @author 宋佳
* @param processEditID
* @return
* @since fhd Ver 1.1
*/
@ResponseBody
@RequestMapping("/ProcessPoint/ProcessPoint/editProcessPointforview.f")
public Map<String,Object> findProcessPointFormForView(String processEditID){
Map<String,Object> ProcessPointMap=o_ProcessPointBO.findProcessPointFormForView(processEditID);
return ProcessPointMap;
}
/**
*
* 删除流程节点
*
*
* @author 宋佳
* @param ProcessPointID
* @since fhd Ver 1.1
*/
@ResponseBody
@RequestMapping("/ProcessPoint/ProcessPoint/removeProcessPoint.f")
public void removeProcessPointByID(String ProcessPointID,HttpServletResponse response) throws IOException{
PrintWriter out = response.getWriter();
try {
if(StringUtils.isNotBlank(ProcessPointID)){
o_ProcessPointBO.removeProcessPointByID(ProcessPointID);
}
out.print("true");
} catch (Exception e) {
e.printStackTrace();
out.print("false");
} finally{
if(null != out){
out.close();
}
}
}
/**
*
* 删除父亲节点
*
*
* @author 宋佳
* @param ProcessPointID
* @since fhd Ver 1.1
*/
@ResponseBody
@RequestMapping("/processpoint/removeparentpointbyid.f")
public void removeParentPointById(String ids,HttpServletResponse response) throws IOException{
PrintWriter out = response.getWriter();
try {
if(StringUtils.isNotBlank(ids)){
o_ProcessPointBO.removeParentPointByID(ids);
}
out.print("true");
} catch (Exception e) {
e.printStackTrace();
out.print("false");
} finally{
if(null != out){
out.close();
}
}
}
/**
*
* 保存流程节点
*
* @author 宋佳
* @param ProcessPointForm
* @param parentId
* @return
* @since fhd Ver 1.1
*/
@ResponseBody
@RequestMapping("/processpoint/processpoint/saveprocesspoint.f")
public Map<String,Object> saveProcessPoint(ProcessPointForm processPointForm){
Map<String,Object> result=new HashMap<String,Object>();
o_ProcessPointBO.saveProcessPoint(processPointForm);
result.put("success", true);
return result;
}
/**
*
*自动生成编号
*
*
* @author 李克东
* @param ProcessPointEditID
* @param parentId
* @return
* @since fhd Ver 1.1
*/
@ResponseBody
@RequestMapping("/ProcessPoint/ProcessPoint/ProcessPointCode.f")
public Map<String,Object> findProcessPointCode(String processPointId,String processId){
Map<String,Object> processPointMap=o_ProcessPointBO.findProcessPointCode(processPointId, processId);
return processPointMap;
}
/**
* 根据流程ID 找到流程下所有节点
* @author 宋佳
* @param processId
* @return
*/
@ResponseBody
@RequestMapping("/process/findprocesspointlistbypage.f")
public Map<String,Object> findProcessPointListByPage(int limit, int start, String query,String processId){
Map<String,Object> resultMap;
Page<ProcessPoint> page = new Page<ProcessPoint>();
page.setPageNo((limit == 0 ? 0 : start / limit) + 1);
page.setPageSize(limit);
String companyId = UserContext.getUser().getCompanyid();
resultMap=o_ProcessPointBO.findProcessPointListByPage(page, query, processId,companyId);
return resultMap;
}
/**
* 根据节点ID 找到上级节点和节点进入条件
* @author 宋佳
* @param processId
* @return
*/
@ResponseBody
@RequestMapping("/process/findParentListByPointId.f")
public Map<String,Object> findParentListByPointId(String processPointId){
Map<String,Object> resultMap;
String companyId = UserContext.getUser().getCompanyid();
resultMap=o_ProcessPointBO.findParentListByPointId(processPointId,companyId);
return resultMap;
}
/**
* 查询出流程中所包含所有的节点,作为数据字典展示
* @param typeId
* @author 宋佳
* @return
*/
@ResponseBody
@RequestMapping("/processpoint/findallprocesspointbyprocessid.f")
public List<Map<String,String>> findAllProcessPointByProcessId(String processId,String processPointId){
List<DictEntryForm> list=o_ProcessPointBO.findAllProcessPointByProcessId(processId);
List<Map<String, String>> l=new ArrayList<Map<String, String>>();
for(DictEntryForm dictEntryForm:list)
{
Map<String,String> map=new HashMap<String,String>();
if(!dictEntryForm.getId().equals(processPointId))
{
map.put("id", dictEntryForm.getId());
map.put("name",dictEntryForm.getName());
l.add(map);
}
}
return l;
}
}
| [
"[email protected]"
] | |
1c42485f1eef001c96255db9f3a61aee622e4403 | c24c0fe370a11725974ddd451708d8aed4990649 | /app/src/main/java/com/example/paolobonomi/eattheball/Activity/Engine/Animation.java | bbc77b65c2a576d31107a29ad71fed194a1b1d67 | [] | no_license | bonomip/Orbit | 32635dbd9da644640e865edec70d594aab789c8f | 11d7b8fa0486eedbe8dc04439ab2959c6391534a | refs/heads/master | 2021-01-20T05:58:40.378711 | 2017-10-28T13:44:23 | 2017-10-28T13:44:23 | 101,475,204 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,128 | java | package com.example.paolobonomi.eattheball.Activity.Engine;
/*
* Created by Paolo Bonomi on 02/08/2017.
*/
import android.content.Context;
import android.util.Log;
import com.example.paolobonomi.eattheball.R;
import org.jbox2d.common.Vec2;
import org.joml.Matrix4f;
import javax.microedition.khronos.opengles.GL;
class Animation {
private Sprite[] sprites;
private int start;
private int end;
private boolean haveToRepeat;
private int repeat_number = 0;
private int count = 0;
private int cursor;
Animation(Context context, String file_name, int start, int end){
this.sprites = new Sprite[end-start+1];
loadSprite(context, file_name, start, end);
this.end = end;
this.start = start;
this.cursor = 0;
this.haveToRepeat = false;
}
void setRepeat(int number){
if(number < 0) {
this.haveToRepeat = false;
this.repeat_number = 0;
return;
}
this.haveToRepeat = true;
this.repeat_number = number;
this.count = 0;
}
void draw(Vec2 body_center, float body_angle, float size, Matrix4f view) {
try {
if (this.cursor < start || this.cursor > this.end)
this.cursor = start;
this.sprites[this.cursor-this.start].Draw(body_center, body_angle, size, view);
if (this.haveToRepeat) {
this.count += 1;
if (this.count == this.repeat_number) {
this.count = 0;
this.cursor += 1;
}
} else this.cursor++;
} catch (Exception e) { e.printStackTrace(); }
}
private void loadSprite(Context context, String file_name, int start, int end){
for ( int i = start; i <= end; i++ ) {
final int id = context.getResources().getIdentifier(file_name + i, "drawable", context.getPackageName());
if (id == 0)
this.sprites[i-start] = null;
else
this.sprites[i-start] = new Sprite(new Texture(context, id));
}
}
}
| [
"[email protected]"
] | |
fe9411d7dd9790f47536751d9e4ed32569c0c193 | 69dda3a38a040806a6263fd6eb7b01bbcfc7641c | /src/main/java/com/bowling/model/BowlingScoreFrameNormal.java | a20d2a975af21eb5ad046066b276b9c89394f266 | [] | no_license | smeerkahoven/bowling-problem | 18a0c76444acf4a897569bfd1d740cb13a1a80e6 | 2e6811f7c0b72f1cecb60efec88c4532e319c41e | refs/heads/master | 2021-06-20T22:24:50.044426 | 2019-09-24T03:39:04 | 2019-09-24T03:39:04 | 210,061,610 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | package com.bowling.model;
public class BowlingScoreFrameNormal extends BowlingScoreFrame {
public BowlingScoreFrameNormal() {
super();
}
}
| [
"[email protected]"
] | |
698d1fcd9d5208e6492f5cdbc0fa27a2aad6ccca | 730dafc8d7ee9522782fe47b05d279e88ce6cb44 | /exercicios de poo/src/exercicios_metodos_atributos/Patinete.java | 191df0fff12bbda00762505d32becd35f2dfc35d | [] | no_license | samilathalyta/GenerationBrasil | 0123c144262b53f18cd11edd2780ac70eb715456 | a53dfb118ef94f51c7c9c75b1d288dea17b5cf4a | refs/heads/main | 2023-08-22T19:39:00.912320 | 2021-10-25T16:33:01 | 2021-10-25T16:33:01 | 402,181,130 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,236 | java | /*Crie uma classe patinete e apresente os atributos e métodos referentes
esta classe, em seguida crie um objeto patinete, defina as instancias deste
objeto e apresente as informações deste objeto no console.
*/
package exercicios;
import java.text.NumberFormat;
public class Patinete {
private String cor;
private String carac;
private float preco;
public Patinete (String cor, String carac, float preco) {
this.cor = cor;
this.carac = carac;
this.preco = preco;
}
public String getCor() {
return cor;
}
public void setCor(String cor) {
this.cor = cor;
}
public String getCarac() {
return carac;
}
public void setCarac(String carac) {
this.carac = carac;
}
public float getPreco() {
return preco;
}
public void setPreco(float preco) {
this.preco = preco;
}
public void imprimir() {
System.out.println("\nCor do patine: " + cor + "\nCaracteristica: " + carac + "\nPreço: " + preco);
}
public String formatarNum() {
NumberFormat nf = NumberFormat.getCurrencyInstance(); //formata na moeda do pais
nf.setMinimumFractionDigits(2); // indica a quantidade de digitos dpos da virgula
String formatoMoeda = nf.format(preco); // formatação de saída
return formatoMoeda;
}
}
| [
"[email protected]"
] | |
9b65080675a83573d097e1959415b961e97f89fa | 5abf744be7f5251075c98a5b11fcef5235848a93 | /primat/src/main/java/dbs/pprl/toolbox/data_owner/preprocessing/preprocessors/fieldnormalizer/DigitRemover.java | 61bbf66f7547d5dbdb1e37f93688c244809e8b52 | [
"Apache-2.0"
] | permissive | gen-too/primat | eb4bd2f1cbfaacd3beafbd7ac20c16f838519a6e | cd8c7dcb5c5e89598f33776179c6983694d16ae1 | refs/heads/master | 2022-01-29T00:18:01.644622 | 2022-01-12T12:55:20 | 2022-01-12T12:55:20 | 174,561,483 | 6 | 0 | Apache-2.0 | 2020-08-27T07:17:44 | 2019-03-08T15:28:33 | Java | UTF-8 | Java | false | false | 292 | java | package dbs.pprl.toolbox.data_owner.preprocessing.preprocessors.fieldnormalizer;
/**
* Remove any number.
*
* @author mfranke
*
*/
public final class DigitRemover extends RegexReplacer{
private static final String REGEX = "[0-9]";
public DigitRemover() {
super(REGEX, "");
}
} | [
"[email protected]"
] | |
4ca789838982c671c4a250463b31a273f29ee62f | 353f65e4e518374cae8a3ddf56f0b1f616b13dc3 | /src/main/java/com/krishk/arplatform/MyResource.java | 0355619f4df31902c5a1902888d38ab8bd9bed6c | [] | no_license | krishkalai07/ar-platform-webappbeta | 29ea8be2a798b82d916de6bb4652574ca7cde487 | 1635b4a850f0aaa900fac5e67a36ea84a537f3e8 | refs/heads/master | 2021-07-22T12:37:43.773377 | 2017-11-01T05:19:53 | 2017-11-01T05:19:53 | 109,197,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,857 | java | package com.krishk.arplatform;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.*;
/**
* Root resource (exposed at "vq" path)
*/
@SuppressWarnings("ALL")
@Path("v1")
@Singleton
public class MyResource {
private ARTree arTree;
/**
* This constructor will be called only once, since this is a Singleton class.
* The constructor will initialize the structures.
*/
public MyResource() {
arTree = new ARTree();
}
/**
* Method handling HTTP GET requests. The returned object will be sent
* to the client as "MediaType.Application_Json" media type.
*
* @return Response of 200 if there is valid coordinates and ID.
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("locate/{id}")
public Response getLocate(@Context UriInfo uriInfo, @PathParam("id") String id) {
//System.out.println("ID: " + id);
//System.out.println(arTree);
//System.out.println("ID: " + id);
MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters();
String latitude = queryParams.getFirst("lati");
String longitude = queryParams.getFirst("long");
String elevation = queryParams.getFirst("elev");
System.out.println("lat: " + latitude + " lon: " + longitude + " elev: " + elevation);
GeoPoint point = new GeoPoint(latitude, longitude);
//System.out.println("getLocate point " + point);
arTree.locatePoint(id, point, Double.parseDouble(elevation));
return Response.status(200).entity(arTree.getLocateList().toString()).build();
}
/**
* Method handling HTTP GET request. This function refreshes the user's e-tag and structres list per request if a change is needed.
*
* @param uriInfo Allows to get the query parameter from the URL.
* @return If a change is needed, then a response of 200 with the new etag and structuresData. If not, then 200 with "Not Modified.
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("structures")
public Response getStructures(@Context UriInfo uriInfo) {
MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters();
String etag = queryParams.getFirst("etag");
// If the etags are equal, then no change is necessary, response = 304
// becuase there is no change to the data
if (etag.equals(arTree.getStructuresETag())) {
return Response.status(200).entity("Not Modified").build();
}
else {
return Response.status(200).header("ETag", arTree.getStructuresETag()).entity(arTree.getStructuresList().toString()).build();
}
}
}
//id=md5(node.name)
//E-tag = md5(concatenate(root.childrenID)) | [
"[email protected]"
] | |
b43420f35748b2d8c6db99c1cbece518059c9c9a | 1aece97371898f7628b70cfb4962cd80d0f2a84f | /app/src/main/java/org/sex/hanker/View/SwipeRefreshLayoutOnRefresh.java | 7505f0250b8ec46e2055669044ad511bf8cd3a37 | [] | no_license | rgsngdha/pp365_app | a8b6b3ca2c70d3b1d0cd54037402f1da74f1e1e0 | 0a2a41fba0127ce5d5b15cbe1518ea092d877293 | refs/heads/master | 2023-03-18T05:23:10.510186 | 2019-01-26T02:18:29 | 2019-01-26T02:18:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package org.sex.hanker.View;
import android.support.v4.widget.SwipeRefreshLayout;
/**
* Created by Administrator on 2018/3/2.
*/
public class SwipeRefreshLayoutOnRefresh implements SwipeRefreshLayout.OnRefreshListener{
private PullLoadMoreRecyclerView mPullLoadMoreRecyclerView;
public SwipeRefreshLayoutOnRefresh(PullLoadMoreRecyclerView pullLoadMoreRecyclerView) {
this.mPullLoadMoreRecyclerView = pullLoadMoreRecyclerView;
}
@Override
public void onRefresh() {
if (!mPullLoadMoreRecyclerView.isRefresh()) {
mPullLoadMoreRecyclerView.setIsRefresh(true);
mPullLoadMoreRecyclerView.refresh();
}
}
}
| [
"[email protected]"
] | |
839c4059284f65489f3ffc1b9a33dfe639c4f9f9 | c2841192ebd5cfc81b8b952839bc44dead422f6c | /EasyServices/src/main/java/com/upc/entity/Ciudad.java | 3db8ba0922750161725799de77cd6d02d93764d1 | [] | no_license | miguelb10/EasyServices | a785b5f0001ee496c4cac6cc020121afcc0622a5 | 49628515a274d475a1cb073c4b4f424812705d86 | refs/heads/master | 2020-03-19T08:13:57.735347 | 2018-07-01T07:06:57 | 2018-07-01T07:06:57 | 136,186,592 | 1 | 0 | null | 2018-06-28T00:01:13 | 2018-06-05T14:05:27 | HTML | UTF-8 | Java | false | false | 1,292 | java | package com.upc.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
// default package
// Generated 17-may-2018 13:26:54 by Hibernate Tools 5.3.0.Beta2
/**
* Ciudad generated by hbm2java
*/
@Entity
@Table(name = "ciudad")
public class Ciudad {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int idciudad;
@ManyToOne
@JoinColumn(name="iddepartamento")
private Departamento departamento;
private String nombre;
private String descripcion;
public Ciudad() {
super();
}
public Integer getIdciudad() {
return this.idciudad;
}
public void setIdciudad(Integer idciudad) {
this.idciudad = idciudad;
}
public Departamento getDepartamento() {
return this.departamento;
}
public void setDepartamento(Departamento departamento) {
this.departamento = departamento;
}
public String getNombre() {
return this.nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getDescripcion() {
return this.descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
}
| [
"[email protected]"
] | |
b861710a388ce4dabd9ad691d12b5434a8a1654d | d590201b89a9f9fa761fa4be6ff7e38d5580963d | /android.studio.todolist-master/app/src/main/java/dao/UsuarioDAO.java | dc6d57aa586260256f27669d2f1678218c75ddf1 | [] | no_license | joelcn/test | 95037942a6ca44378e9b3fd572c01b46b4c54688 | eafdd89a46b7dd8b94fa973667504e156e2ae229 | refs/heads/master | 2020-06-15T15:33:42.401533 | 2016-12-01T13:22:50 | 2016-12-01T13:22:50 | 75,282,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,346 | java | package dao;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;
import java.util.List;
import model.Usuario;
public class UsuarioDAO {
private DatabaseHelper databaseHelper;
private SQLiteDatabase database;
public UsuarioDAO(Context context){
databaseHelper = new DatabaseHelper(context);
}
private SQLiteDatabase getDatabase(){
if (database == null){
database = databaseHelper.getWritableDatabase();
}
return database;
}
private Usuario criarUsuario(Cursor cursor){
Usuario model = new Usuario(
cursor.getInt(cursor.getColumnIndex(DatabaseHelper.Usuarios._ID)),
cursor.getString(cursor.getColumnIndex(DatabaseHelper.Usuarios.NOME)),
cursor.getString(cursor.getColumnIndex(DatabaseHelper.Usuarios.LOGIN)),
cursor.getString(cursor.getColumnIndex(DatabaseHelper.Usuarios.SENHA)),
cursor.getString(cursor.getColumnIndex(DatabaseHelper.Usuarios.CREATED_AT))
);
return model;
}
public List<Usuario> listarUsuarios(){
Cursor cursor = getDatabase().query(DatabaseHelper.Usuarios.TABELA,
DatabaseHelper.Usuarios.COLUNAS, null, null, null, null, null);
List<Usuario> usuarios = new ArrayList<Usuario>();
while(cursor.moveToNext()){
Usuario model = criarUsuario(cursor);
usuarios.add(model);
}
cursor.close();
return usuarios;
}
public long salvarUsuario(Usuario usuario){
ContentValues valores = new ContentValues();
valores.put(DatabaseHelper.Usuarios.NOME, usuario.getNome());
valores.put(DatabaseHelper.Usuarios.LOGIN, usuario.getLogin());
valores.put(DatabaseHelper.Usuarios.SENHA, usuario.getSenha());
valores.put(DatabaseHelper.Usuarios.CREATED_AT, usuario.getCreated_at());
if(usuario.get_id() != null){
return getDatabase().update(DatabaseHelper.Usuarios.TABELA, valores,
"_id = ?", new String[]{ usuario.get_id().toString() });
}
return getDatabase().insert(DatabaseHelper.Usuarios.TABELA, null, valores);
}
public boolean removerUsuario(int id){
return getDatabase().delete(DatabaseHelper.Usuarios.TABELA,
"_id = ?", new String[]{ Integer.toString(id) }) > 0;
}
public Usuario buscarUsuarioPorId(int id){
Cursor cursor = getDatabase().query(DatabaseHelper.Usuarios.TABELA,
DatabaseHelper.Usuarios.COLUNAS, "_id = ?", new String[]{ Integer.toString(id) }, null, null, null);
if(cursor.moveToNext()){
Usuario model = criarUsuario(cursor);
cursor.close();
return model;
}
return null;
}
public boolean logar(String usuario, String senha){
Cursor cursor = getDatabase().query(DatabaseHelper.Usuarios.TABELA,
null, "LOGIN = ? AND SENHA = ?", new String[]{usuario, senha}, null,null,null);
if(cursor.moveToFirst()){
return true;
}
return false;
}
public void fechar(){
databaseHelper.close();
database = null;
}
}
| [
"[email protected]"
] | |
140a3de1521cb2afe4f96642ba09a7b605d7061d | c4cbe1b11807e1c34c9d5006743e54d51df9ed59 | /src/main/java/org/usfirst/frc/team2855/robot/commands/ArmOut.java | f0e69b0f3c4dc13fb5dd4192e14b589f634cea12 | [] | no_license | BEASTBot2855/Robot2019 | afa8300c134a6d2ada095b3bf06503735d1dc08c | 90d6ac88ec697c52aaa43ba61dda0efd8410c502 | refs/heads/master | 2020-04-23T07:47:34.533610 | 2019-03-19T19:52:04 | 2019-03-19T19:52:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,541 | java | package org.usfirst.frc.team2855.robot.commands;
import org.usfirst.frc.team2855.robot.Robot;
import org.usfirst.frc.team2855.robot.RobotMap;
import org.usfirst.frc.team2855.robot.subsystems.HPanelArm;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
* tells arm solenoid to push gear arm out
*/
public class ArmOut extends Command {
private static DigitalInput hatchLimitSwitch0 = RobotMap.hatchLimitSwitch0;
public ArmOut() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
requires(Robot.hPanelArm);
}
// Called just before this Command runs the first time
protected void initialize() {
SmartDashboard.putString("Panel Arm Status", "Going Out");
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
Robot.hPanelArm.HPanelUp();
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
if(!hatchLimitSwitch0.get()) {
HPanelArm.wasLastIn = false;
return true;
} else
return false;
}
// Called once after isFinished returns true
protected void end() {
Robot.hPanelArm.HPanelStop();
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
end();
}
}
| [
"[email protected]"
] | |
80505909fe253a225bf1ea7adbc9fcee08eb2f99 | eef7304bde1aa75c49c1fe10883d5d4b8241e146 | /aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/ListObjectChildrenResult.java | 21b7e16cf9e88ad9206b802c550661dea13defaf | [
"Apache-2.0"
] | permissive | C2Devel/aws-sdk-java | 0dc80a890aac7d1ef6b849bb4a2e3f4048ee697e | 56ade4ff7875527d0dac829f5a26e6c089dbde31 | refs/heads/master | 2021-07-17T00:54:51.953629 | 2017-10-05T13:55:54 | 2017-10-05T13:57:31 | 105,878,846 | 0 | 2 | null | 2017-10-05T10:51:57 | 2017-10-05T10:51:57 | null | UTF-8 | Java | false | false | 6,426 | java | /*
* Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.clouddirectory.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/clouddirectory-2016-05-10/ListObjectChildren" target="_top">AWS
* API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListObjectChildrenResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* <p>
* Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code> as the
* value.
* </p>
*/
private java.util.Map<String, String> children;
/**
* <p>
* The pagination token.
* </p>
*/
private String nextToken;
/**
* <p>
* Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code> as the
* value.
* </p>
*
* @return Children structure, which is a map with key as the <code>LinkName</code> and
* <code>ObjectIdentifier</code> as the value.
*/
public java.util.Map<String, String> getChildren() {
return children;
}
/**
* <p>
* Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code> as the
* value.
* </p>
*
* @param children
* Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code>
* as the value.
*/
public void setChildren(java.util.Map<String, String> children) {
this.children = children;
}
/**
* <p>
* Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code> as the
* value.
* </p>
*
* @param children
* Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code>
* as the value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListObjectChildrenResult withChildren(java.util.Map<String, String> children) {
setChildren(children);
return this;
}
public ListObjectChildrenResult addChildrenEntry(String key, String value) {
if (null == this.children) {
this.children = new java.util.HashMap<String, String>();
}
if (this.children.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.children.put(key, value);
return this;
}
/**
* Removes all the entries added into Children.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListObjectChildrenResult clearChildrenEntries() {
this.children = null;
return this;
}
/**
* <p>
* The pagination token.
* </p>
*
* @param nextToken
* The pagination token.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
* <p>
* The pagination token.
* </p>
*
* @return The pagination token.
*/
public String getNextToken() {
return this.nextToken;
}
/**
* <p>
* The pagination token.
* </p>
*
* @param nextToken
* The pagination token.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListObjectChildrenResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getChildren() != null)
sb.append("Children: ").append(getChildren()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListObjectChildrenResult == false)
return false;
ListObjectChildrenResult other = (ListObjectChildrenResult) obj;
if (other.getChildren() == null ^ this.getChildren() == null)
return false;
if (other.getChildren() != null && other.getChildren().equals(this.getChildren()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getChildren() == null) ? 0 : getChildren().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public ListObjectChildrenResult clone() {
try {
return (ListObjectChildrenResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
e5e8288ee40d743145cd0fbbbba84dd67cfee67e | 918052a02e0ab3ad46d5df7f87516f30cbc7bebb | /struts2hibernate/src/main/java/com/demo/struts2/common/AuthorizationInterceptor.java | 0e16c6e83927dc32e6fc22ab18d695d7b3b0c6c3 | [] | no_license | eqinson2/java_learning | 660ff8baea6808dcedfafa2e853e0b8fe0938596 | f4dec895395167f24972a6297e82ee6c37d6918c | refs/heads/master | 2020-05-30T21:45:15.733931 | 2015-07-29T09:02:24 | 2015-07-29T09:02:24 | 39,777,511 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 793 | java | package com.demo.struts2.common;
import java.util.Map;
import com.demo.struts2.util.Constants;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class AuthorizationInterceptor extends AbstractInterceptor {
private static final long serialVersionUID = 2575538469018873724L;
public String intercept(ActionInvocation invocation) throws Exception {
Map<String, Object> session = invocation.getInvocationContext().getSession();
String username = (String) session.get(Constants.USERNAME_KEY);
if (null != username && !username.equals("")) {
return invocation.invoke();
} else {
System.out.println("AuthorizationInterceptor.intercept");
return Action.LOGIN;
}
}
}
| [
"[email protected]"
] | |
5151861498dd5962492351573dac820375d8ed2e | 47a1b286d852e9013dbb0b566f6f838f69aa7a7a | /src/engine/colliders/Collidable.java | e5d4e94686df31066dc7dc9170ff294daa5ed395 | [] | no_license | Aycion/Untitled-Boat-Game | 9b393d4ff5cdc0ec03a451d5b167154bbd04b96a | 02f3e8c90d23b5ee05466a56a3f7f9129eed53df | refs/heads/master | 2020-09-24T13:41:12.830266 | 2020-01-08T00:52:52 | 2020-01-08T00:52:52 | 225,770,875 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 87 | java | package engine.colliders;
public interface Collidable {
Collider getCollider();
}
| [
"[email protected]"
] | |
2c1da806132c883aa9518fe2088a98966592a35f | 9994f405df09ee239ea07e55d20ba852077c5c98 | /SD_FP_01/src/SD_FP01_ex3_ServerSocket.java | ed531825df64567bd83ab2819ef00f98f36cc545 | [] | no_license | JessicaCoelho21/SD | 10a1fecf0051d7a6b317ba5abab6a55ba8978b9f | 7d484a501585a4ef89279b8226c58279e291c467 | refs/heads/master | 2023-03-04T03:58:47.125071 | 2021-02-19T14:58:53 | 2021-02-19T14:58:53 | 303,689,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 992 | java | import java.net.*;
import java.io.*;
public class SD_FP01_ex3_ServerSocket {
public static void main (String[] args) throws IOException{
ServerSocket serverSocket = null;
Socket clientSocket = null;
PrintWriter out = null;
try {
serverSocket = new ServerSocket(7);
clientSocket = serverSocket.accept();
out = new PrintWriter(clientSocket.getOutputStream(), true);
} catch (IOException e) {
System.out.println("Exception caught when trying to listen to port or listening for a connection");
}
BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
//mensagem enviada do cliente para o servidor
out.println(inputLine);
}
out.close();
in.close();
serverSocket.close();
clientSocket.close();
}
}
| [
"[email protected]"
] | |
31a09bf31aef1f8d53e90d51b7f105cbe4020ae9 | f13f5f654bb050767df7b8355cdbad052d95c08a | /app/src/main/java/com/youzheng/tongxiang/huntingjob/Model/entity/jianli/BaseJianliBean.java | 37fd0cf7214aeb65b17d8f933213a1cbf7b62296 | [] | no_license | yangyuqi/HuntingForJob | a2cf339846e1d5b26ae6dd1222e142033fd168e8 | 85db5e1321ef0dae3eba5ae884efd607984fc624 | refs/heads/master | 2021-05-03T07:08:27.361121 | 2018-04-02T09:33:52 | 2018-04-02T09:33:52 | 120,603,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,984 | java | package com.youzheng.tongxiang.huntingjob.Model.entity.jianli;
import java.io.Serializable;
/**
* Created by qiuweiyu on 2018/2/12.
*/
public class BaseJianliBean implements Serializable{
private String username;
private String nickname ;
private int userType ;
private int authentication ;
private String photo ;
private String personal ;
private int gender ;
private String hidetype ;
private String birthdate ;
private String education ;
private String citysName ;
private String salary ;
private String citys ;
private int percent ;
private int uid ;
private int id ;
private String residence ;
private String email ;
private int wage ;
private String hopeCityName ;
private String truename ;
private String hope_city ;
private int satisfied ;
private int work_year ;
private String telephone ;
private String position ;
private String work_time ;
private String trade_id ;
private String tradeName ;
private String stateName ;
private String state ;
private String self_description ;
public String getSelf_description() {
return self_description;
}
public void setSelf_description(String self_description) {
this.self_description = self_description;
}
public String getStateName() {
return stateName;
}
public void setStateName(String stateName) {
this.stateName = stateName;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getTradeName() {
return tradeName;
}
public void setTradeName(String tradeName) {
this.tradeName = tradeName;
}
public String getTrade_id() {
return trade_id;
}
public void setTrade_id(String trade_id) {
this.trade_id = trade_id;
}
public int getGender() {
return gender;
}
public void setGender(int gender) {
this.gender = gender;
}
public String getBirthdate() {
return birthdate;
}
public void setBirthdate(String birthdate) {
this.birthdate = birthdate;
}
public String getEducation() {
return education;
}
public void setEducation(String education) {
this.education = education;
}
public String getCitysName() {
return citysName;
}
public void setCitysName(String citysName) {
this.citysName = citysName;
}
public String getSalary() {
return salary;
}
public void setSalary(String salary) {
this.salary = salary;
}
public String getCitys() {
return citys;
}
public void setCitys(String citys) {
this.citys = citys;
}
public int getPercent() {
return percent;
}
public void setPercent(int percent) {
this.percent = percent;
}
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public String getResidence() {
return residence;
}
public void setResidence(String residence) {
this.residence = residence;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public int getWage() {
return wage;
}
public void setWage(int wage) {
this.wage = wage;
}
public String getHopeCityName() {
return hopeCityName;
}
public void setHopeCityName(String hopeCityName) {
this.hopeCityName = hopeCityName;
}
public String getTruename() {
return truename;
}
public void setTruename(String truename) {
this.truename = truename;
}
public String getHope_city() {
return hope_city;
}
public void setHope_city(String hope_city) {
this.hope_city = hope_city;
}
public int getSatisfied() {
return satisfied;
}
public void setSatisfied(int satisfied) {
this.satisfied = satisfied;
}
public int getWork_year() {
return work_year;
}
public void setWork_year(int work_year) {
this.work_year = work_year;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getWork_time() {
return work_time;
}
public void setWork_time(String work_time) {
this.work_time = work_time;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public int getUserType() {
return userType;
}
public void setUserType(int userType) {
this.userType = userType;
}
public int getAuthentication() {
return authentication;
}
public void setAuthentication(int authentication) {
this.authentication = authentication;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
this.photo = photo;
}
public String getPersonal() {
return personal;
}
public void setPersonal(String personal) {
this.personal = personal;
}
public String getHidetype() {
return hidetype;
}
public void setHidetype(String hidetype) {
this.hidetype = hidetype;
}
}
| [
"[email protected]"
] | |
aecf47a90701496350b02516bac4307e02b0b93f | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/com/avito/android/home/default_search_location/DefaultSearchLocationInteractor.java | bcca8664e083adc6621aa0cb4cd84d0ebb1b7944 | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 855 | java | package com.avito.android.home.default_search_location;
import android.location.Location;
import io.reactivex.rxjava3.core.Single;
import kotlin.Metadata;
import org.jetbrains.annotations.NotNull;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\bf\u0018\u00002\u00020\u0001J\u0015\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0002H&¢\u0006\u0004\b\u0004\u0010\u0005¨\u0006\u0006"}, d2 = {"Lcom/avito/android/home/default_search_location/DefaultSearchLocationInteractor;", "", "Lio/reactivex/rxjava3/core/Single;", "Landroid/location/Location;", "defaultLocation", "()Lio/reactivex/rxjava3/core/Single;", "serp_release"}, k = 1, mv = {1, 4, 2})
public interface DefaultSearchLocationInteractor {
@NotNull
Single<Location> defaultLocation();
}
| [
"[email protected]"
] | |
4f3ac3617578762049f439fb9af6acd1cf13d5ce | a09406a16db71909b2ff2f18b75f43a9a865cbc1 | /com/src/main/java/com/DataDriven/Test/DataProviderDemo.java | 00576e08b1df208560f2e89ad069ae4efd3495e0 | [] | no_license | siva23492/TestProject | f088d2ee66d9bd1aeb9b2691dd38e37e8d987539 | 3a322189d655721113942cfce1503a008eb299c0 | refs/heads/master | 2020-03-27T11:06:38.213625 | 2018-10-12T10:40:22 | 2018-10-12T10:40:22 | 146,465,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,286 | java | package com.DataDriven.Test;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import com.test.utility.TestUtil;
public class DataProviderDemo {
WebDriver driver;
@BeforeMethod
public void setUP() {
System.setProperty("webdriver.chrome.driver", "C:\\Selenium\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
driver.get("http://demo.automationtesting.in/Register.html#");
}
@DataProvider
public Iterator<Object> getTestData() {
ArrayList<Object>testData=TestUtil.getExcelData();
return testData.iterator();
}
@Test(dataProvider="getTestData")
public void readDataFoRegistration(String firstName,String lastName,String address,String email,String phone) {
driver.findElement(By.xpath("//input[@type='text' and @placeholder='First Name']")).clear();
driver.findElement(By.xpath("//input[@type='text' and @placeholder='First Name']")).sendKeys(firstName);
driver.findElement(By.xpath("//input[@type='text' and @placeholder='Last Name']")).clear();
driver.findElement(By.xpath("//input[@type='text' and @placeholder='Last Name']")).sendKeys(lastName);
driver.findElement(By.xpath("//textarea[contains(@ng-model,'Adress')]")).clear();
driver.findElement(By.xpath("//textarea[contains(@ng-model,'Adress')]")).sendKeys(address);
driver.findElement(By.xpath("//input[contains(@type,'email')]")).clear();
driver.findElement(By.xpath("//input[contains(@type,'email')]")).sendKeys(email);
driver.findElement(By.xpath("//input[contains(@type,'tel')]")).clear();
driver.findElement(By.xpath("//input[contains(@type,'tel')]")).sendKeys(phone);
}
@AfterMethod
public void tearDown() {
driver.close();
}
}
| [
"[email protected]"
] | |
dff766efb5c6b0587ba589147e9a664c3834d660 | 6f26a9a792d5b262b68879e0b1328d5b2f755a8a | /lumhat-repository/src/main/java/com/kshrd/repository/classroomRepository/ClassroomHistoryRepository.java | eee2a722407b16fd7162219fb9d4fbb861b2ac2e | [] | no_license | visatch/KSHRD_Springboot_LUMHAT-Project | ee9b0f122fd354331a04fbf642a6ea75829ca79f | 9badee579d28db6dddfb19cc8a18203858662ae5 | refs/heads/master | 2022-12-22T20:44:09.598442 | 2020-02-20T20:44:34 | 2020-02-20T20:44:34 | 241,982,904 | 0 | 0 | null | 2022-12-16T00:43:15 | 2020-02-20T20:28:04 | JavaScript | UTF-8 | Java | false | false | 1,511 | java | package com.kshrd.repository.classroomRepository;
import com.kshrd.model.classroom.ClassroomHistoryTeacher;
import com.kshrd.model.classroom.History;
import com.kshrd.model.classroom.QuizRecord;
import com.kshrd.repository.classroomRepository.provider.ClassroomQuestionProvider;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Repository
public interface ClassroomHistoryRepository {
@Select("select * from get_topic_by_class_id(#{classId});")
@Results({
@Result(property = "topic.id", column = "id"),
@Result(property = "topic.topic", column = "topic")
})
List<History> findHistoryByClass(Integer classId);
@SelectProvider(method = "findQuizByTopic", type = ClassroomQuestionProvider.class)
@Results({
@Result(property = "id", column = "qr_id"),
@Result(property = "quiz.id", column = "q_id"),
@Result(property = "quiz.title", column = "title"),
@Result(property = "date", column = "created_date"),
@Result(property = "score", column = "score"),
@Result(property = "duration", column = "duration"),
@Result(property = "fullScore", column = "fullscore"),
@Result(property = "status", column = "status")
})
List<QuizRecord> findQuizByTopic(Integer topicId, Integer userId, Integer classId);
@Select("select * from get_active_quiz()")
Object getActive();
}
| [
"[email protected]"
] | |
40c1f502eb9e3144a112f484558d8ff3f6aa0625 | ebd2bbc19f85bec0aec634bd9294fa1945e32061 | /dependencies/jclouds/aws-ec2/1.6.0-wso2v1/src/main/java/org/jclouds/aws/ec2/compute/strategy/CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.java | bbfec00caa1192b1acd05256e6966f940de465f9 | [] | no_license | madusankap/turing-1 | da645af4886d562667dfd2f61b4aa184da093340 | 04edf79deefbe751f0dee518b3891f816cec2dbc | refs/heads/master | 2019-01-02T01:46:09.216852 | 2014-12-18T11:04:09 | 2014-12-18T11:04:09 | 28,171,116 | 0 | 1 | null | 2023-03-20T11:52:10 | 2014-12-18T06:21:53 | Java | UTF-8 | Java | false | false | 8,329 | java | /**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.aws.ec2.compute.strategy;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.or;
import java.util.concurrent.ConcurrentMap;
import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import javax.inject.Singleton;
import org.jclouds.aws.ec2.compute.AWSEC2TemplateOptions;
import org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial;
import org.jclouds.aws.ec2.functions.CreatePlacementGroupIfNeeded;
import org.jclouds.aws.ec2.options.AWSRunInstancesOptions;
import org.jclouds.compute.domain.Template;
import org.jclouds.compute.functions.GroupNamingConvention;
import org.jclouds.compute.options.TemplateOptions;
import org.jclouds.compute.reference.ComputeServiceConstants;
import org.jclouds.ec2.compute.domain.RegionAndName;
import org.jclouds.ec2.compute.options.EC2TemplateOptions;
import org.jclouds.ec2.compute.strategy.CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions;
import org.jclouds.ec2.domain.KeyPair;
import org.jclouds.ec2.options.RunInstancesOptions;
import org.jclouds.logging.Logger;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.cache.LoadingCache;
/**
*
* @author Adrian Cole
*/
@Singleton
public class CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions extends
CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions {
@Resource
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
protected Logger logger = Logger.NULL;
@VisibleForTesting
final LoadingCache<RegionAndName, String> placementGroupMap;
@VisibleForTesting
final CreatePlacementGroupIfNeeded createPlacementGroupIfNeeded;
@VisibleForTesting
final Function<RegionNameAndPublicKeyMaterial, KeyPair> importExistingKeyPair;
@Inject
public CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions(
Function<RegionAndName, KeyPair> makeKeyPair, ConcurrentMap<RegionAndName, KeyPair> credentialsMap,
@Named("SECURITY") LoadingCache<RegionAndName, String> securityGroupMap,
Provider<RunInstancesOptions> optionsProvider,
@Named("PLACEMENT") LoadingCache<RegionAndName, String> placementGroupMap,
CreatePlacementGroupIfNeeded createPlacementGroupIfNeeded,
Function<RegionNameAndPublicKeyMaterial, KeyPair> importExistingKeyPair,
GroupNamingConvention.Factory namingConvention) {
super(makeKeyPair, credentialsMap, securityGroupMap, optionsProvider, namingConvention);
this.placementGroupMap = placementGroupMap;
this.createPlacementGroupIfNeeded = createPlacementGroupIfNeeded;
this.importExistingKeyPair = importExistingKeyPair;
}
public AWSRunInstancesOptions execute(String region, String group, Template template) {
AWSRunInstancesOptions instanceOptions = AWSRunInstancesOptions.class
.cast(super.execute(region, group, template));
String placementGroupName = template.getHardware().getId().startsWith("cc") ? createNewPlacementGroupUnlessUserSpecifiedOtherwise(
region, group, template.getOptions()) : null;
if (placementGroupName != null)
instanceOptions.inPlacementGroup(placementGroupName);
if (AWSEC2TemplateOptions.class.cast(template.getOptions()).isMonitoringEnabled())
instanceOptions.enableMonitoring();
return instanceOptions;
}
@VisibleForTesting
String createNewPlacementGroupUnlessUserSpecifiedOtherwise(String region, String group, TemplateOptions options) {
String placementGroupName = null;
boolean shouldAutomaticallyCreatePlacementGroup = true;
if (options instanceof EC2TemplateOptions) {
placementGroupName = AWSEC2TemplateOptions.class.cast(options).getPlacementGroup();
if (placementGroupName == null)
shouldAutomaticallyCreatePlacementGroup = AWSEC2TemplateOptions.class.cast(options)
.shouldAutomaticallyCreatePlacementGroup();
}
if (placementGroupName == null && shouldAutomaticallyCreatePlacementGroup) {
// placementGroupName must be unique within an account per
// http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?using_cluster_computing.html
placementGroupName = String.format("jclouds#%s#%s", group, region);
RegionAndName regionAndName = new RegionAndName(region, placementGroupName);
// make this entry as needed
placementGroupMap.getUnchecked(regionAndName);
}
return placementGroupName;
}
@Override
public String createNewKeyPairUnlessUserSpecifiedOtherwise(String region, String group, TemplateOptions options) {
RegionAndName key = new RegionAndName(region, group);
KeyPair pair;
if (and(hasPublicKeyMaterial, or(doesntNeedSshAfterImportingPublicKey, hasLoginCredential)).apply(options)) {
pair = importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group, options.getPublicKey()));
options.dontAuthorizePublicKey();
if (hasLoginCredential.apply(options))
pair = pair.toBuilder().keyMaterial(options.getLoginPrivateKey()).build();
credentialsMap.put(key, pair);
} else {
if (hasPublicKeyMaterial.apply(options)) {
logger.warn("to avoid creating temporary keys in aws-ec2, use templateOption overrideLoginCredentialWith(id_rsa)");
}
return super.createNewKeyPairUnlessUserSpecifiedOtherwise(region, group, options);
}
return pair.getKeyName();
}
public static final Predicate<TemplateOptions> hasPublicKeyMaterial = new Predicate<TemplateOptions>() {
@Override
public boolean apply(TemplateOptions options) {
return options.getPublicKey() != null;
}
};
public static final Predicate<TemplateOptions> doesntNeedSshAfterImportingPublicKey = new Predicate<TemplateOptions>() {
@Override
public boolean apply(TemplateOptions options) {
return (options.getRunScript() == null && options.getPrivateKey() == null);
}
};
public static final Predicate<TemplateOptions> hasLoginCredential = new Predicate<TemplateOptions>() {
@Override
public boolean apply(TemplateOptions options) {
return options.getLoginPrivateKey() != null;
}
};
@Override
protected boolean userSpecifiedTheirOwnGroups(TemplateOptions options) {
return options instanceof AWSEC2TemplateOptions
&& AWSEC2TemplateOptions.class.cast(options).getGroupIds().size() > 0
|| super.userSpecifiedTheirOwnGroups(options);
}
@Override
protected void addSecurityGroups(String region, String group, Template template, RunInstancesOptions instanceOptions) {
AWSEC2TemplateOptions awsTemplateOptions = AWSEC2TemplateOptions.class.cast(template.getOptions());
AWSRunInstancesOptions awsInstanceOptions = AWSRunInstancesOptions.class.cast(instanceOptions);
if (awsTemplateOptions.getGroupIds().size() > 0)
awsInstanceOptions.withSecurityGroupIds(awsTemplateOptions.getGroupIds());
String subnetId = awsTemplateOptions.getSubnetId();
if (subnetId != null) {
AWSRunInstancesOptions.class.cast(instanceOptions).withSubnetId(subnetId);
} else {
super.addSecurityGroups(region, group, template, instanceOptions);
}
}
} | [
"[email protected]"
] | |
faa0e27dad45ba41bb947cfb09a6fcfc5c5775af | 17be2fe27bd5c56511d38c279bd1325e76e402f4 | /app/src/main/java/com/example/hangman/Art.java | cdf970962e8af7567786d0847eaa31cc71829b09 | [] | no_license | ifyousayso/labb-4 | 29e2e676c15fa65e32bbad11e8159a42aa3eeb9f | 4398964adbc3ff04202b6064db2c8c7c50931dc8 | refs/heads/main | 2023-08-29T04:18:47.154732 | 2021-11-15T12:52:36 | 2021-11-15T12:52:36 | 428,042,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,450 | java | package com.example.hangman;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.ImageView;
import androidx.annotation.Nullable;
public class Art extends ImageView {
private int state = 0;
private int width;
private int height;
private Paint paint = new Paint();
private Path path = new Path();
// Purpose: Constructor!
// Arguments: Context context
public Art(Context context) {
super(context);
this.init();
}
// Purpose: Constructor!
// Arguments: Context context, @Nullable AttributeSet attrs
public Art(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
this.init();
}
// Purpose: Constructor!
// Arguments: Context context, @Nullable AttributeSet attrs, int defStyleAttr
public Art(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.init();
}
private void init() {
this.paint.setAntiAlias(true);
this.paint.setColor(0xff000000); // Black
this.paint.setStyle(Paint.Style.STROKE);
this.paint.setStrokeCap(Paint.Cap.BUTT);
this.paint.setStrokeJoin(Paint.Join.ROUND);
}
// Purpose: When the size of Art changes (at start), set its height and the stroke width.
// Arguments: int width, int height, int oldWidth, int oldHeight
// Return: -
@Override
protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
super.onSizeChanged(width, height, oldWidth, oldHeight);
this.width = width;
this.height = this.width;
this.getLayoutParams().height = this.height;
this.paint.setStrokeWidth(this.width / 128.0f);
}
private float pW(float amount) {
return amount * 0.01f * this.width;
}
private float pH(float amount) {
return amount * 0.01f * this.height;
}
private void addGallows() {
this.path.moveTo(this.pW(90.0f), this.pH(90.0f));
this.path.lineTo(this.pW(10.0f), this.pH(90.0f));
this.path.moveTo(this.pW(20.0f), this.pH(90.0f));
this.path.lineTo(this.pW(20.0f), this.pH(10.0f));
this.path.lineTo(this.pW(50.0f), this.pH(10.0f));
}
private void addHead() {
this.path.addArc(this.pW(64.0f), this.pH(25.0f), this.pW(76.0f), this.pH(37.0f), 0.0f, 360.0f);
this.path.moveTo(this.pW(66.75f), this.pH(28.5f));
this.path.lineTo(this.pW(69.0f), this.pH(30.5f));
this.path.moveTo(this.pW(66.75f), this.pH(30.5f));
this.path.lineTo(this.pW(69.0f), this.pH(28.5f));
this.path.moveTo(this.pW(71.0f), this.pH(28.5f));
this.path.lineTo(this.pW(73.25f), this.pH(30.5f));
this.path.moveTo(this.pW(71.0f), this.pH(30.5f));
this.path.lineTo(this.pW(73.25f), this.pH(28.5f));
this.path.moveTo(this.pW(67.75f), this.pH(33.5f));
this.path.lineTo(this.pW(72.25f), this.pH(33.5f));
}
private void addTorso() {
this.path.moveTo(this.pW(70.0f), this.pH(37.0f));
this.path.lineTo(this.pW(70.0f), this.pH(58.0f));
}
private void addRightLeg() {
this.path.moveTo(this.pW(60.0f), this.pH(73.0f));
this.path.lineTo(this.pW(70.0f), this.pH(58.0f));
}
private void addLeftLeg() {
this.path.moveTo(this.pW(80.0f), this.pH(73.0f));
this.path.lineTo(this.pW(70.0f), this.pH(58.0f));
}
private void addRightArm() {
this.path.moveTo(this.pW(60.0f), this.pH(55.0f));
this.path.lineTo(this.pW(70.0f), this.pH(40.0f));
}
private void addLeftArm() {
this.path.moveTo(this.pW(80.0f), this.pH(55.0f));
this.path.lineTo(this.pW(70.0f), this.pH(40.0f));
}
private void addNoose() {
this.path.moveTo(this.pW(50.0f), this.pH(10.0f));
this.path.lineTo(this.pW(70.0f), this.pH(10.0f));
this.path.lineTo(this.pW(70.0f), this.pH(25.0f));
}
// Purpose: Progress the state of the drawing by adding another part.
// Arguments: -
// Return: -
public void progress() {
switch (this.state) {
case 0:
this.addGallows(); break;
case 1:
this.addHead(); break;
case 2:
this.addTorso(); break;
case 3:
this.addRightLeg(); break;
case 4:
this.addLeftLeg(); break;
case 5:
this.addRightArm(); break;
case 6:
this.addLeftArm(); break;
case 7:
this.addNoose(); break;
default:
return;
}
this.state++;
this.invalidate();
}
// Purpose: Draw the hanged man progress.
// Arguments: Canvas canvas
// Return: -
@Override
protected void onDraw(Canvas canvas) {
canvas.drawARGB(0xff, 0xff, 0xff, 0xff);
canvas.drawPath(this.path, this.paint);
}
}
| [
"[email protected]"
] | |
fbf25b3e36b75dc3bed9b0136798af6562bb35ea | ea5fc414e022b70c5c424271b3d665353983f7c3 | /app/src/main/java/com/survivingwithandroid/actionbartabnavigation/login/LoginView.java | 4d481bfbfb5e7115ccd96e018b0a73a21736be3f | [] | no_license | lipov91/gardener | ceb563e44fbca0d5044c96eaff797e4cd588d9c0 | e3106f3a6687c1e1b638ca848e0bb190dafefd1a | refs/heads/master | 2016-09-10T20:43:06.649536 | 2015-08-04T17:35:12 | 2015-08-04T17:35:12 | 40,195,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,434 | java | package com.survivingwithandroid.actionbartabnavigation.login;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import com.survivingwithandroid.actionbartabnavigation.MainActivity;
public class LoginView extends View {
private Context context;
private ScaleGestureDetector multiGestures;
private Matrix scale;
private Bitmap droid;
public LoginView(Context context, int iGraphicResourceId) {
super(context);
this.context = context;
scale = new Matrix();
GestureListener listener = new GestureListener(this);
multiGestures = new ScaleGestureDetector(context, listener);
droid = BitmapFactory
.decodeResource(getResources(), iGraphicResourceId);
}
public void onScale(float factor) {
scale.preScale(factor, factor);
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
Matrix transform = new Matrix(scale);
float width = droid.getWidth() / 2;
float height = droid.getHeight() / 2;
transform.postTranslate(-width, -height);
transform.postConcat(scale);
transform.postTranslate(width, height);
canvas.drawBitmap(droid, transform, null);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean retVal = false;
retVal = multiGestures.onTouchEvent(event);
return retVal;
}
private class GestureListener implements
ScaleGestureDetector.OnScaleGestureListener {
LoginView view;
public GestureListener(LoginView view) {
this.view = view;
}
@Override
public boolean onScale(ScaleGestureDetector detector) {
float scale = detector.getScaleFactor();
view.onScale(scale);
return true;
}
@Override
public boolean onScaleBegin(ScaleGestureDetector detector) {
return true;
}
@Override
public void onScaleEnd(ScaleGestureDetector detector) {
Intent intent = new Intent(context, MainActivity.class);
context.startActivity(intent);
}
}
}
| [
"[email protected]"
] | |
19afda313967d20a1808e78afb61ab18aa926b18 | 306d10877e33b7b8bf9f1915c124a3ef8907b685 | /app/src/main/java/com/zayan/eshop/data/BackgroundOrderEngine.java | 4f60e0be8e09c453b02c2c0783f5b34abdfc65b8 | [] | no_license | Saim20/E-com-final | 2f8d2722d3d2783b4b9b379b2c17f1f96b6bb9e1 | f4efd664be3d183446f2eaf510efd10ee514e2bd | refs/heads/master | 2022-12-26T17:48:16.282611 | 2020-09-28T12:03:52 | 2020-09-28T12:03:52 | 298,809,327 | 2 | 0 | null | 2020-09-26T12:27:26 | 2020-09-26T12:27:25 | null | UTF-8 | Java | false | false | 3,931 | java | package com.zayan.eshop.data;
import android.annotation.SuppressLint;
import android.os.AsyncTask;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.zayan.eshop.Checkout;
import com.zayan.eshop.MainActivity;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
public class BackgroundOrderEngine extends AsyncTask<String, Void, String> {
@SuppressLint("StaticFieldLeak")
private ProgressBar orderProgress;
@SuppressLint("StaticFieldLeak")
private TextView placeholder;
public BackgroundOrderEngine(ProgressBar orderProgress, TextView placeholder) {
this.orderProgress = orderProgress;
this.placeholder = placeholder;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
}
@Override
protected String doInBackground(String... strings) {
String retrievedData = "";
String registerUrl = "https://zayansshop.000webhostapp.com/order.php";
URL url;
try {
url = new URL(registerUrl);
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
OutputStream outputStream = httpURLConnection.getOutputStream();
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8));
String data = URLEncoder.encode("products", "UTF-8") + "=" + URLEncoder.encode(strings[0], "UTF-8") + "&" +
URLEncoder.encode("userid", "UTF-8") + "=" + URLEncoder.encode(strings[1], "UTF-8") + "&" +
URLEncoder.encode("total", "UTF-8") + "=" + URLEncoder.encode(strings[2], "UTF-8");
bufferedWriter.write(data);
bufferedWriter.flush();
bufferedWriter.close();
outputStream.close();
InputStream inputStream = httpURLConnection.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.ISO_8859_1));
String productDataReader;
while ((productDataReader = bufferedReader.readLine()) != null) {
//noinspection StringConcatenationInLoop
retrievedData += productDataReader;
}
bufferedReader.close();
inputStream.close();
httpURLConnection.disconnect();
} catch (IOException e) {
// e.printStackTrace();
return "server crash";
}
return retrievedData;
}
@Override
protected void onPostExecute(String s) {
if (s.equalsIgnoreCase("success")) {
orderProgress.setVisibility(View.INVISIBLE);
placeholder.setVisibility(View.VISIBLE);
placeholder.setText("Order Placed!");
Checkout.checkoutActivity.finish();
MainActivity.cartProducts.clear();
} else if (s.equalsIgnoreCase("server crash")) {
orderProgress.setVisibility(View.INVISIBLE);
placeholder.setVisibility(View.VISIBLE);
placeholder.setText("Please Check Network Connection!");
} else {
orderProgress.setVisibility(View.INVISIBLE);
placeholder.setVisibility(View.VISIBLE);
placeholder.setText("Unknown Error!");
}
super.onPostExecute(s);
}
}
| [
"[email protected]"
] | |
bd77494da0bd18b3472a733a45ce92962266130c | 9de6a98cdaed1a6577165999c0696e96baeaecc6 | /legend-pure-runtime-java-engine-interpreted/src/main/java/org/finos/legend/pure/runtime/java/interpreted/natives/core/math/LessThan.java | 942856a9dbb9d86fdb89321597f9f3fbdc8c748a | [
"Apache-2.0",
"CC0-1.0"
] | permissive | stephanof/legend-pure | 7cc4469ad2d926c15df8cb9f2150923907fb6887 | c75435f0a24a0fbc673297b1734a9921a0c7a40e | refs/heads/master | 2023-08-20T00:30:32.120001 | 2021-10-14T20:30:49 | 2021-10-14T20:30:49 | 314,235,221 | 0 | 0 | Apache-2.0 | 2021-06-28T09:47:53 | 2020-11-19T12:02:19 | Java | UTF-8 | Java | false | false | 978 | java | // Copyright 2020 Goldman Sachs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.finos.legend.pure.runtime.java.interpreted.natives.core.math;
import org.finos.legend.pure.m4.ModelRepository;
public class LessThan extends NumericComparisonPredicate
{
public LessThan(ModelRepository repository)
{
super(repository);
}
@Override
protected boolean acceptComparison(int comparison)
{
return comparison < 0;
}
}
| [
"[email protected]"
] | |
a4d4e1dc5f1a71c7e8f05c01541506c0c0cf8d5c | 37f3694788c5d4895a4a2c1ed59e8369a93728eb | /src/main/java/io/slc/jsm/slc_instruction_set/Mnemonic.java | 965b6bb9a30deee966d265b0e766eae5a061ef28 | [] | no_license | michelezamuner/jsm | 0fa1054f418ff9dd0b0e0fb497a6b701185f080f | 783d9e0275516c29afb36ab1cf3d089ee351357a | refs/heads/master | 2023-01-18T19:11:20.581829 | 2020-11-30T07:39:40 | 2020-11-30T07:39:40 | 295,228,546 | 0 | 0 | null | 2020-11-30T07:39:41 | 2020-09-13T20:05:37 | Java | UTF-8 | Java | false | false | 272 | java | package io.slc.jsm.slc_instruction_set;
import io.slc.jsm.slc_instruction_set.instructions.syscall.Type;
public class Mnemonic {
public static final int MOVI = 0x01;
public static final int SYSCALL = 0xf0;
public static final int SYSCALL_EXIT = Type.EXIT;
}
| [
"[email protected]"
] | |
2972953d6d99b1f6a5749389ac2fde2a8a2cd28c | 33d6dbd4f6f6db7302ec2d16b172327b04c73f3e | /app/src/main/java/com/laioffer/eventreporter/CommentAdapter.java | 3fc69fba7e7613ec4b223b6d16119a430741d19f | [] | no_license | Fan4530/WeLook | c5f91fb3b1122f3ce163bf346a7ba73cb6dc190f | edd185d0293c5136b7e731ca9403ce03483b9289 | refs/heads/master | 2021-01-19T20:08:01.062358 | 2017-09-21T20:29:42 | 2017-09-21T20:29:42 | 101,221,776 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,736 | java | package com.laioffer.eventreporter;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;
/**
* Created by program on 7/14/2017.
*/
public class CommentAdapter extends BaseAdapter {
private Context context;
private final static int TYPE_EVENT = 0;
private final static int TYPE_COMMENT = 1;
private final static int TYPE_MAX_COUNT = 2;
private List<Comment> commentList;
private Event event;
private DatabaseReference databaseReference;
private LayoutInflater inflater;
public CommentAdapter(Context context) {
this.context = context;
commentList = new ArrayList<>();
databaseReference = FirebaseDatabase.getInstance().getReference();
inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
}
public CommentAdapter(Context context, final Event event, List<Comment> commentList) {
this.context = context;
this.commentList = commentList;
this.event = event;
databaseReference = FirebaseDatabase.getInstance().getReference();
inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
}
public void setEvent(final Event event) {
this.event = event;
}
public void setComments(final List<Comment> comments) {
this.commentList = comments;
}
@Override
public int getItemViewType(int position) {
return position == 0 ? TYPE_EVENT: TYPE_COMMENT;
}
@Override
public int getViewTypeCount() {
return TYPE_MAX_COUNT;
}
@Override
public int getCount() {
return commentList.size() + 1;
}
@Override
public Comment getItem(int position) {
return commentList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
static class ViewHolder {
/* event items */
TextView event_username;
TextView event_location;
TextView event_description;
TextView event_time;
TextView event_title;
ImageView event_img;
ImageView event_img_view_like;
ImageView event_img_view_comment;
ImageView event_img_view_repost;
TextView event_like_number;
TextView event_comment_number;
TextView event_repost_number;
/* comment items */
TextView comment_user;
TextView comment_description;
TextView comment_time;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View rowView = convertView;
int type = getItemViewType(position);
if (rowView == null) {
ViewHolder viewHolder = new ViewHolder();
switch (type) {
case TYPE_EVENT:
rowView = inflater.inflate(R.layout.comment_main, parent, false);
viewHolder.event_username = (TextView)rowView.findViewById(R.id.comment_main_user);
viewHolder.event_location = (TextView)rowView.findViewById(R.id.comment_main_location);
viewHolder.event_description = (TextView)rowView.findViewById(R.id.comment_main_description);
viewHolder.event_time = (TextView)rowView.findViewById(R.id.comment_main_time);
viewHolder.event_img = (ImageView) rowView.findViewById(R.id.comment_main_image);
viewHolder.event_img_view_like = (ImageView) rowView.findViewById(R.id.comment_main_like_img);
viewHolder.event_img_view_comment = (ImageView) rowView.findViewById(R.id.comment_main_comment_img);
viewHolder.event_img_view_repost = (ImageView) rowView.findViewById(R.id.comment_main_repost_img);
viewHolder.event_like_number = (TextView) rowView.findViewById(R.id.comment_main_like_num);
viewHolder.event_comment_number = (TextView) rowView.findViewById(R.id.comment_main_comment_num);
viewHolder.event_repost_number = (TextView) rowView.findViewById(R.id.comment_main_repost_num);
viewHolder.event_title = (TextView) rowView.findViewById(R.id.comment_main_title);
break;
case TYPE_COMMENT:
rowView = inflater.inflate(R.layout.comment_item, parent, false);
viewHolder.comment_user = (TextView) rowView.findViewById(R.id.comment_item_user);
viewHolder.comment_description = (TextView)rowView.findViewById(R.id.comment_item_description);
viewHolder.comment_time = (TextView)rowView.findViewById(R.id.comment_item_time);
break;
}
rowView.setTag(viewHolder);
}
final ViewHolder holder = (ViewHolder) rowView.getTag();
if (type == TYPE_EVENT) {
String[] locations = event.getLocation().split(",");
try {
holder.event_location.setText(locations[1] + "," + locations[2]);
} catch (Exception ex) {
holder.event_location.setText("Wrong Location");
}
holder.event_description.setText(event.getDescription());
holder.event_username.setText(event.getUser());
holder.event_title.setText(event.getTitle());
holder.event_time.setText(Utilities.timeTransformer(event.getTime()));
if (!event.getImgUri().equals("")) {
final String url = event.getImgUri();
new AsyncTask<Void, Void, Bitmap>() {
@Override
protected void onPreExecute() {
holder.event_img.setImageBitmap(null);
holder.event_img.setVisibility(View.VISIBLE);
}
@Override
protected Bitmap doInBackground(Void... params) {
return Utilities.getBitmapFromURL(url);
}
@Override
protected void onPostExecute(Bitmap bitmap) {
holder.event_img.setImageBitmap(bitmap);
}
}.execute();
} else {
holder.event_img.setVisibility(View.GONE);
}
holder.event_like_number.setText(String.valueOf(event.getGood()));
holder.event_repost_number.setText(String.valueOf(event.getRepost()));
holder.event_comment_number.setText(String.valueOf(event.getCommentNumber()));
holder.event_img_view_like.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
databaseReference.child("events").addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
Event recordedevent = snapshot.getValue(Event.class);
if (recordedevent.getId().equals(event.getId())) {
int number = recordedevent.getGood();
holder.event_like_number.setText(String.valueOf(number + 1));
snapshot.getRef().child("good").setValue(number + 1);
break;
}
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
});
} else {
final Comment comment = commentList.get(position - 1);
holder.comment_user.setText(comment.getCommenter());
holder.comment_description.setText(comment.getDescription());
holder.comment_time.setText(Utilities.timeTransformer(comment.getTime()));
}
return rowView;
}
}
| [
"[email protected]"
] | |
414e166b03dbda0827a1c3068924924f795c4136 | de060342048d83f76a5ad972859d6798f897c875 | /src/test/java/CucumberTest.java | 374cfeb6e82381c251babbaee17a6631f606ad0d | [] | no_license | vp1836/j_t_1 | 9ae0beedeb59c3abc06cc11faa107a791b8fdf69 | b80948725ad924c78fa398f33d4d73e40cf8d294 | refs/heads/main | 2023-08-13T10:04:08.759446 | 2021-09-28T14:54:41 | 2021-09-28T14:54:41 | 409,498,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 125 | java | import io.cucumber.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
public class CucumberTest {
}
| [
"[email protected]"
] | |
eb21ad2fd736ae7ad3d3e9e9373035e517c14d6f | 34dec29c916f0ee813da53ec56b54b5c1b8f1fbb | /src/main/java/com/xiaobaidu/baseframe/common/utils/Threads.java | c1287e528bd1cb791f1aafe5a612127aa4ef7ed3 | [] | no_license | hefaji/GluttonCatMall | cdcb21249c3432842b6c42d7618495fed2e5d45b | 43c200d7c5c5c733853408475fe111d7aa21e6e5 | refs/heads/master | 2021-05-07T01:46:45.036334 | 2017-11-12T14:01:34 | 2017-11-12T14:01:34 | 110,436,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,311 | java | /**
* Copyright (c) 2005-2012 springside.org.cn
*/
package com.xiaobaidu.baseframe.common.utils;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
/**
* 线程相关工具类.
* @author calvin
* @version 2013-01-15
*/
public class Threads {
/**
* sleep等待,单位为毫秒,忽略InterruptedException.
*/
public static void sleep(long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
// Ignore.
return;
}
}
/**
* sleep等待,忽略InterruptedException.
*/
public static void sleep(long duration, TimeUnit unit) {
try {
Thread.sleep(unit.toMillis(duration));
} catch (InterruptedException e) {
// Ignore.
return;
}
}
/**
* 按照ExecutorService JavaDoc示例代码编写的Graceful Shutdown方法.
* 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务.
* 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数.
* 如果仍人超時,則強制退出.
* 另对在shutdown时线程本身被调用中断做了处理.
*/
public static void gracefulShutdown(ExecutorService pool, int shutdownTimeout, int shutdownNowTimeout,
TimeUnit timeUnit) {
pool.shutdown(); // Disable new tasks from being submitted
try {
// Wait a while for existing tasks to terminate
if (!pool.awaitTermination(shutdownTimeout, timeUnit)) {
pool.shutdownNow(); // Cancel currently executing tasks
// Wait a while for tasks to respond to being cancelled
if (!pool.awaitTermination(shutdownNowTimeout, timeUnit)) {
System.err.println("Pool did not terminated");
}
}
} catch (InterruptedException ie) {
// (Re-)Cancel if current thread also interrupted
pool.shutdownNow();
// Preserve interrupt status
Thread.currentThread().interrupt();
}
}
/**
* 直接调用shutdownNow的方法, 有timeout控制.取消在workQueue中Pending的任务,并中断所有阻塞函数.
*/
public static void normalShutdown(ExecutorService pool, int timeout, TimeUnit timeUnit) {
try {
pool.shutdownNow();
if (!pool.awaitTermination(timeout, timeUnit)) {
System.err.println("Pool did not terminated");
}
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
}
| [
"[email protected]"
] | |
ccdde970a7ffe20c741ab17e89dea6460a073090 | 2a4da57d124361b0934067f94e028611006e82bb | /dynamo-core/src/main/java/dynamo/providers/magazines/EBookW.java | 1382f35ba48d97df263e69df2df4d365dd2882fb | [
"Apache-2.0"
] | permissive | epew/dynamo | e47f736a22a4992d3f9e9ae25ddfbc12383b5c17 | b7e6b314a03081be1156a66d5191ee124ca63001 | refs/heads/master | 2021-01-11T18:19:52.422976 | 2015-10-20T11:20:59 | 2015-10-20T11:20:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,386 | java | package dynamo.providers.magazines;
import java.io.IOException;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import core.WebDocument;
import dynamo.magazines.KioskIssuesSuggester;
import dynamo.magazines.KioskIssuesSuggesterException;
import dynamo.magazines.MagazineManager;
import dynamo.model.DownloadSuggestion;
import hclient.HTTPClient;
public class EBookW implements KioskIssuesSuggester {
private final static int MAX_PAGES = 10;
@Override
public void suggestIssues() throws KioskIssuesSuggesterException {
for (int i=1; i<=MAX_PAGES; i++) {
String url = String.format("http://ebookw.com/magazines/page/%d", i);
WebDocument document;
try {
document = HTTPClient.getInstance().getDocument( url, HTTPClient.REFRESH_ONE_HOUR );
} catch (IOException e) {
throw new KioskIssuesSuggesterException( e );
}
Elements titles = document.jsoup("#dle-content .title");
for (Element element : titles) {
String title = element.select("a").first().text();
Element shortNews = element.nextElementSibling().nextElementSibling();
String coverImage = shortNews.select("img").first().absUrl("src");
MagazineManager.getInstance().suggest( new DownloadSuggestion(title, coverImage, url, null, null, -1.0f, toString(), null, false));
}
}
}
@Override
public String toString() {
return "EBookW.com";
}
}
| [
"[email protected]"
] | |
7deba74dfd389c95591a3162167298009635224b | b61004baecd332c5f8e9a1dfc063b61c8c13365d | /app/src/main/java/com/wedevgroup/weflyhelper/service/NetworkSchedulerService.java | f129e7b377f6aa381ddd867d58bb316fec171ba9 | [] | no_license | rolandassoh/WeflyHelper | 96e96db961dcc4f58a837fd343b3bbcf5c23e74f | 9b8d9a0b300c0d444f7c08129022d964286bcff3 | refs/heads/master | 2020-03-22T05:20:36.031980 | 2018-07-09T10:14:45 | 2018-07-09T10:14:45 | 139,559,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,821 | java | package com.wedevgroup.weflyhelper.service;
import android.app.job.JobParameters;
import android.app.job.JobService;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.util.Log;
import com.wedevgroup.weflyhelper.receiver.ConnectivityReceiver24Up;
import com.wedevgroup.weflyhelper.utils.Constants;
/**
* Created by admin on 07/05/2018.
*/
@RequiresApi(api = Build.VERSION_CODES.N)
public class NetworkSchedulerService extends JobService implements
ConnectivityReceiver24Up.ConnectivityReceiverListener {
private static final String TAG = NetworkSchedulerService.class.getSimpleName();
private ConnectivityReceiver24Up mConnectivityReceiver24Up;
@Override
public void onCreate() {
super.onCreate();
mConnectivityReceiver24Up = new ConnectivityReceiver24Up(this);
}
/**
* When the app's NetworkConnectionActivity is created, it starts this service. This is so that the
* activity and this service can communicate back and forth. See "setUiCallback()"
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_NOT_STICKY;
}
@Override
public boolean onStartJob(JobParameters params) {
registerReceiver(mConnectivityReceiver24Up, new IntentFilter(android.net.ConnectivityManager.CONNECTIVITY_ACTION));
return true;
}
@Override
public boolean onStopJob(JobParameters params) {
unregisterReceiver(mConnectivityReceiver24Up);
return true;
}
@Override
public void onNetworkConnectionChanged(boolean isConnected) {
if (isConnected){
startService(new Intent(this, PostParcelleService.class));
}
}
} | [
"[email protected]"
] | |
9640b9e1869c7f8e9d8846d6a258cc3b681b0203 | 995ded830d59b1229082669c52beb381d4b3320c | /6.Lesson-JDBC/src/DBConnection/example1.java | 7c86e9172882ac61956b97ef51d2491914afbc5a | [] | no_license | EgeKuran/JavaProjects | d52074c14217ffc3f7458d88ee7645113fa82223 | ea4181b29c293fb485f970aff50675c20e33dbc6 | refs/heads/master | 2020-05-19T15:43:19.774134 | 2019-05-05T22:41:28 | 2019-05-05T22:41:28 | 185,090,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 783 | java | package DBConnection;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class example1 {
public static void main(String[] args) {
//open connection
//connection string
try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/addressbook?useSSL=false", "root", "123456");){
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM PERSON");
while(rs.next())
{
String name =rs.getString("name");
String lname =rs.getString("lastname");
System.out.println(name + " " + lname);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
7cec949025e505592d283a58a4f82ed5d247f400 | ea305b7ebb7ab62668b9bdd4f8e4213dfbebbc5b | /src/main/java/com/epam/handling/interpreter/TermExpressionSin.java | 8b149610c3936d9076d9fd04a61ac30d82317978 | [] | no_license | ElizavetaKrasnovskaya/InfoHandler | cb91bddc7f93b65753610f2d7e5a681646ff0d16 | 69c9c916ed707586fbcd24517181477effbb1e62 | refs/heads/main | 2023-02-23T19:56:29.103496 | 2021-01-31T10:52:41 | 2021-01-31T10:52:41 | 334,631,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | java | package com.epam.handling.interpreter;
import java.util.Stack;
public class TermExpressionSin extends MathExpression{
@Override
public void interpret(Stack<Double> context) {
context.push(Math.sin(context.pop()));
}
}
| [
"[email protected]"
] | |
ffb3962bdcbc6f66463a61e40b92c34827acbe40 | eade157bf48d9f5a2bdc564bdcf14141a98402bc | /app/src/main/java/com/example/tiku_b/bean/Service.java | 1da69eb0ff349a32241c8a01ed4562e73453f94f | [] | no_license | SGP0410/TiKu_B | 69b120e5e460104f0d32b769314cb77d6ea01a3c | bd6bd722ecc3a6d460ce2550fb2c0d12946f5dba | refs/heads/master | 2023-02-07T12:22:56.739010 | 2021-01-02T01:29:45 | 2021-01-02T01:29:45 | 324,992,764 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,682 | java | package com.example.tiku_b.bean;
public class Service {
/**
* serviceid : 1
* serviceName : 便民服务
* icon : http://81.70.194.43:8080/mobileA/images/tubiao1.png
* url : https://new.qq.com/omn/20201003/20201003A06MRV00.html
* serviceType : 智慧服务
* desc : aaa
*/
private int serviceid;
private String serviceName;
private String icon;
private String url;
private String serviceType;
private String desc;
private int weight;
public Service() {
}
public Service(String serviceName, String icon) {
this.serviceName = serviceName;
this.icon = icon;
}
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
public int getServiceid() {
return serviceid;
}
public void setServiceid(int serviceid) {
this.serviceid = serviceid;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
| [
"[email protected]"
] | |
f14885f6059c5a96cb88e15dec4808d61484da84 | 80810b3f881d757e1ba320c917e65012707723f0 | /src/com/gexin/artplatform/adapter/HomeListAdapter.java | 9aa260ffeb648d8b90ac40eb12cd166d40712418 | [] | no_license | xiaoxinla/ArtPlatform | ac77db3696ee0840cca8e0b34a53d3fb969125b3 | 68e58137bc38025af0750d9956f3abd791d81b65 | refs/heads/master | 2020-12-30T10:12:45.604683 | 2015-06-15T23:53:14 | 2015-06-15T23:53:14 | 34,679,496 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 5,179 | java | package com.gexin.artplatform.adapter;
import java.util.ArrayList;
import java.util.List;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.MarginLayoutParams;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.TextView;
import com.gexin.artplatform.LargeImageActivity;
import com.gexin.artplatform.R;
import com.gexin.artplatform.RoomDetailActivity;
import com.gexin.artplatform.bean.Article;
import com.gexin.artplatform.utils.TimeUtil;
import com.gexin.artplatform.view.FlowLayout;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
public class HomeListAdapter extends BaseAdapter {
private List<Article> mList;
private Context mContext;
private DisplayImageOptions avatarOptions;
private DisplayImageOptions picOptions;
public HomeListAdapter(List<Article> mList, Context mContext) {
super();
this.mList = mList;
this.mContext = mContext;
avatarOptions = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.ic_menu_home)
.showImageForEmptyUri(R.drawable.ic_menu_home)
.showImageOnFail(R.drawable.ic_error).cacheInMemory(true)
.cacheOnDisk(true).considerExifParams(true)
.bitmapConfig(Bitmap.Config.RGB_565).build();
picOptions = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.ic_stub)
.showImageOnFail(R.drawable.ic_error).cacheInMemory(true)
.cacheOnDisk(true).considerExifParams(true)
.bitmapConfig(Bitmap.Config.RGB_565).build();
}
@Override
public int getCount() {
return mList.size();
}
@Override
public Object getItem(int arg0) {
return mList.get(arg0);
}
@Override
public long getItemId(int arg0) {
return arg0;
}
@SuppressLint("InflateParams")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
final Article article = mList.get(position);
if (convertView == null) {
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(
R.layout.home_list_item, null);
holder.tvClickNum = (TextView) convertView
.findViewById(R.id.tv_clicknum_home_item);
holder.tvContent = (TextView) convertView
.findViewById(R.id.tv_content_home_item);
holder.tvName = (TextView) convertView
.findViewById(R.id.tv_name_home_item);
holder.tvTime = (TextView) convertView
.findViewById(R.id.tv_time_home_item);
holder.tvTitle = (TextView) convertView
.findViewById(R.id.tv_title_home_item);
holder.flPics = (FlowLayout) convertView
.findViewById(R.id.fl_pics_home_item);
holder.ivHeader = (ImageView) convertView
.findViewById(R.id.iv_header_home_item);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.tvClickNum.setText("µã»÷" + article.getViewNum());
holder.tvContent.setText((article.getContent()));
holder.tvName.setText(article.getStudioName());
holder.tvTime.setText(TimeUtil.getDateString(article.getCreateTime()));
holder.tvTitle.setText(article.getTitle());
holder.ivHeader.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(mContext, RoomDetailActivity.class);
intent.putExtra("studioId", article.getStudioId());
mContext.startActivity(intent);
}
});
holder.tvName.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(mContext, RoomDetailActivity.class);
intent.putExtra("studioId", article.getStudioId());
mContext.startActivity(intent);
}
});
ImageLoader.getInstance().displayImage(article.getStudioAvatarUrl(),
holder.ivHeader, avatarOptions);
holder.flPics.removeAllViews();
int cnt = 0;
for (String url : article.getImages()) {
ImageView imageView = new ImageView(mContext);
// imageView.setMaxHeight(120);
// imageView.setMaxWidth(150);
// imageView.setAdjustViewBounds(true);
imageView.setScaleType(ScaleType.CENTER_CROP);
MarginLayoutParams lp = new MarginLayoutParams(
130, 130);
lp.setMargins(5, 5, 5, 5);
ImageLoader.getInstance().displayImage(url, imageView, picOptions);
holder.flPics.addView(imageView, lp);
final int index = cnt;
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(mContext,
LargeImageActivity.class);
intent.putStringArrayListExtra("images",
(ArrayList<String>) article.getImages());
intent.putExtra("index", index);
mContext.startActivity(intent);
}
});
}
return convertView;
}
private static class ViewHolder {
TextView tvName;
TextView tvContent;
TextView tvClickNum;
TextView tvTime;
TextView tvTitle;
FlowLayout flPics;
ImageView ivHeader;
}
}
| [
"[email protected]"
] | |
540a16e31bed8cbcf2b86c255a9ae1a0cdae12c1 | eafae636c22b5d95db19e5271d58796bd7be4a66 | /app-release-unsigned/sources/com/google/android/material/transition/platform/ScaleProvider.java | 99b5dc96d7cfff739d1abf31e2aa5530c687a7cc | [] | no_license | agustrinaldokurniawan/News_Kotlin_Native | 5fb97e9c9199c464e64a6ef901b133c88da3db55 | 411f2ae0c01f2cc490f9b80a6b8f40196bc74176 | refs/heads/main | 2023-05-31T20:59:44.356059 | 2021-06-15T14:43:42 | 2021-06-15T14:43:42 | 377,077,236 | 0 | 0 | null | 2021-06-15T07:44:11 | 2021-06-15T07:38:27 | null | UTF-8 | Java | false | false | 3,589 | java | package com.google.android.material.transition.platform;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.view.View;
import android.view.ViewGroup;
public final class ScaleProvider implements VisibilityAnimatorProvider {
private boolean growing;
private float incomingEndScale;
private float incomingStartScale;
private float outgoingEndScale;
private float outgoingStartScale;
private boolean scaleOnDisappear;
public ScaleProvider() {
this(true);
}
public ScaleProvider(boolean z) {
this.outgoingStartScale = 1.0f;
this.outgoingEndScale = 1.1f;
this.incomingStartScale = 0.8f;
this.incomingEndScale = 1.0f;
this.scaleOnDisappear = true;
this.growing = z;
}
public boolean isGrowing() {
return this.growing;
}
public void setGrowing(boolean z) {
this.growing = z;
}
public boolean isScaleOnDisappear() {
return this.scaleOnDisappear;
}
public void setScaleOnDisappear(boolean z) {
this.scaleOnDisappear = z;
}
public float getOutgoingStartScale() {
return this.outgoingStartScale;
}
public void setOutgoingStartScale(float f) {
this.outgoingStartScale = f;
}
public float getOutgoingEndScale() {
return this.outgoingEndScale;
}
public void setOutgoingEndScale(float f) {
this.outgoingEndScale = f;
}
public float getIncomingStartScale() {
return this.incomingStartScale;
}
public void setIncomingStartScale(float f) {
this.incomingStartScale = f;
}
public float getIncomingEndScale() {
return this.incomingEndScale;
}
public void setIncomingEndScale(float f) {
this.incomingEndScale = f;
}
@Override // com.google.android.material.transition.platform.VisibilityAnimatorProvider
public Animator createAppear(ViewGroup viewGroup, View view) {
if (this.growing) {
return createScaleAnimator(view, this.incomingStartScale, this.incomingEndScale);
}
return createScaleAnimator(view, this.outgoingEndScale, this.outgoingStartScale);
}
@Override // com.google.android.material.transition.platform.VisibilityAnimatorProvider
public Animator createDisappear(ViewGroup viewGroup, View view) {
if (!this.scaleOnDisappear) {
return null;
}
if (this.growing) {
return createScaleAnimator(view, this.outgoingStartScale, this.outgoingEndScale);
}
return createScaleAnimator(view, this.incomingEndScale, this.incomingStartScale);
}
private static Animator createScaleAnimator(final View view, float f, float f2) {
final float scaleX = view.getScaleX();
final float scaleY = view.getScaleY();
ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(view, PropertyValuesHolder.ofFloat(View.SCALE_X, scaleX * f, scaleX * f2), PropertyValuesHolder.ofFloat(View.SCALE_Y, f * scaleY, f2 * scaleY));
ofPropertyValuesHolder.addListener(new AnimatorListenerAdapter() {
/* class com.google.android.material.transition.platform.ScaleProvider.AnonymousClass1 */
public void onAnimationEnd(Animator animator) {
view.setScaleX(scaleX);
view.setScaleY(scaleY);
}
});
return ofPropertyValuesHolder;
}
}
| [
"[email protected]"
] | |
6a4f6774e892c959dfdd0d9cf41ff80a818bb7b2 | 8400336a23b70b623bd95d857a65fe0642580a2c | /MeshLib/test/mesh/creator/archimedian/RhombicosidodecahedronCreatorTest.java | 4f2f625da2a87e438ea83c8d419ad4223a0514b2 | [] | no_license | SimonAtelier/MeshLib | 9e36ccb3ddfec57ae1b9b147c297e568ba0a8a82 | 39c4ef085429e84383be7e39cb6ba5a0063eb3f3 | refs/heads/master | 2020-04-29T06:33:40.454398 | 2019-04-01T13:46:22 | 2019-04-01T13:46:22 | 175,920,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,719 | java | package mesh.creator.archimedian;
import java.util.Collection;
import org.junit.Assert;
import org.junit.Test;
import mesh.Edge3D;
import mesh.Mesh3D;
import mesh.creator.IMeshCreator;
import util.MeshTestUtil;
public class RhombicosidodecahedronCreatorTest {
RhombicosidodecahedronCreator creator = new RhombicosidodecahedronCreator();
Mesh3D mesh = creator.create();
@Test
public void creatorImplementsMeshCreatorInterface() {
Assert.assertTrue(creator instanceof IMeshCreator);
}
@Test
public void createdMeshHasSixtyTwoFaces() {
Assert.assertEquals(62, mesh.getFaceCount());
}
@Test
public void createdMeshHasOneHunderedAndTwentyEdges() {
Collection<Edge3D> edges = mesh.createEdges();
Assert.assertEquals(120, edges.size());
}
@Test
public void createdMeshHasSixtyVertices() {
Assert.assertEquals(60, mesh.getVertexCount());
}
@Test
public void createdMeshHasEdgesWithEqualLength() {
MeshTestUtil.allEdgesHaveEqualLength(mesh);
}
@Test
public void eachEdgeOfTheCreatedMeshIsIncidentToOnlyOneOrTwoFaces() {
MeshTestUtil.eachEdgeIsIncidentToOnlyOneOrTwoFaces(mesh);
}
@Test
public void createdMeshFulfillsEulersCharacteristic() {
MeshTestUtil.meshFulFillsEulersCharacteristic(mesh);
}
@Test
public void createdMeshHasTwentyTriangleFaces() {
Assert.assertEquals(20, mesh.getNumberOfFacesWithVertexCountOfN(3));
}
@Test
public void createdMeshHasThirtyQuadFaces() {
Assert.assertEquals(30, mesh.getNumberOfFacesWithVertexCountOfN(4));
}
@Test
public void createdMeshHasTwelvePentagonalFaces() {
Assert.assertEquals(12, mesh.getNumberOfFacesWithVertexCountOfN(5));
}
}
| [
"[email protected]_W_921V_1_45_000"
] | [email protected]_W_921V_1_45_000 |
926f36b515dfa3ce62017c83ab90dbb5d25940d4 | 079c0c8afde8603905eb8f1c96849236ea862178 | /spring-aop-schema/src/main/java/com/github/liuyiyou/spring/aop/HelloServiceImpl.java | 496ae6a5bfaafc3d9cb8f12a07a40d390d9b565a | [] | no_license | zhaozengbing/mySpring | 848b923ccf4cd853686bf97a931d0add3e969f76 | 84637766f5a4e9098ac9725b5cb81d7700270bda | refs/heads/master | 2020-12-27T04:40:45.823876 | 2014-07-24T09:10:00 | 2014-07-24T09:10:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.github.liuyiyou.spring.aop;
/**
* Created with IntelliJ IDEA.
* User: liuyiyou
* Date: 14-7-24
* Time: 下午12:01
* To change this template use File | Settings | File Templates.
*/
//002:定义目标接口实现
public class HelloServiceImpl implements HelloService {
@Override
public void sayHello() {
System.out.println("Hello World");
}
}
| [
"[email protected]"
] | |
b05a2cc0e728ef032a5652ca54800c1493e6fe16 | bca21c3e352f8573e203b90c52d6679f7a6f3e54 | /Aula 16 - 03-12-2019/ListaDeTarefas/src/listadetarefas/Tarefa.java | cdbd9128222255fa7b224c2739643a680facc41e | [] | no_license | i-santos/JavaTercaQuintaNoturno | 4a737c0ec5993ff1db15b9b8047fa58a90fdc8b3 | b1c532a2580a4c352fa5048597971989d02d2a82 | refs/heads/master | 2020-08-26T23:26:00.732027 | 2020-01-22T01:34:07 | 2020-01-22T01:34:07 | 217,180,892 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package listadetarefas;
public class Tarefa {
private String titulo;
private boolean finalizada;
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public boolean isFinalizada() {
return finalizada;
}
public void setFinalizada(boolean finalizada) {
this.finalizada = finalizada;
}
}
| [
"[email protected]"
] | |
28ed7bc599bd0731f0dfa5b54500e26b199b0ea5 | 4e6f45d5d9f0a997af922fec5c81da4540f9ea06 | /src/SWEA/D4/Solution_1223.java | bf8628e1742197954a1bb7c7b0d7388eac1121d7 | [] | no_license | Seoyoung2/Algorithm-Java | 19394b88027c3d27fa65fd51b5410b0895cca8bb | e3cb33b7175b4fc0acfc4d21751f5c229a3c4dc7 | refs/heads/master | 2023-04-14T07:49:17.272084 | 2021-04-26T00:25:57 | 2021-04-26T00:25:57 | 329,225,036 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,292 | java | package SWEA.D4;
import java.util.Scanner;
import java.util.Stack;
// 1223. [S/W 문제해결 기본] 6일차 - 계산기2
public class Solution_1223 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
StringBuilder sb;
Stack<Character> stk;
for (int t = 1; t <= 10; t++) {
int n = sc.nextInt();
String str = sc.next();
sb = new StringBuilder();
stk = new Stack<>();
char ch;
for (int i = 0; i < n; i++) {
ch = str.charAt(i);
switch (ch) {
case '*':
while(!stk.isEmpty() && stk.peek() == '*') sb.append(stk.pop());
stk.push(ch);
break;
case '+':
while(!stk.isEmpty()) sb.append(stk.pop());
stk.push(ch);
break;
default:
sb.append(ch);
break;
}
}
while(!stk.isEmpty()) sb.append(stk.pop());
Stack<Integer> nstk = new Stack<>();
int tmp;
for (int i = 0; i < n; i++) {
ch = sb.charAt(i);
switch (ch) {
case '*':
tmp = nstk.pop() * nstk.pop();
nstk.push(tmp);
break;
case '+':
tmp = nstk.pop() + nstk.pop();
nstk.push(tmp);
break;
default:
nstk.push(ch-'0');
break;
}
}
System.out.println("#"+t+" "+nstk.pop());
}
}
}
| [
"[email protected]"
] | |
d9f1280b40f7ce960fff57591e7378746ee378c6 | 7cfd5d2bbd09066973ad7a3116a440f0ce412fab | /AutoMultiMedia/src/main/java/com/semisky/automultimedia/common/utils/ActivityManagerUtils.java | c190aa83a502663cd59d41d5832d108b99aae4d0 | [] | no_license | liuyong87/Jetour2019 | d4266de0b3dd5a4281920d1b84779f8c56c5ea34 | 37ee407af079b8ba009ab11936e3d2ddbfb07176 | refs/heads/master | 2020-05-07T12:39:10.195885 | 2019-04-10T11:15:19 | 2019-04-10T11:15:19 | 180,514,349 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,267 | java | package com.semisky.automultimedia.common.utils;
import java.util.List;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.ComponentName;
import android.content.Context;
import android.util.Log;
public class ActivityManagerUtils {
private static final String TAG = "ActivityManagerUtils";
private static ActivityManagerUtils mActivityManagerUtils = null;
public static ActivityManagerUtils getInstance() {
if (null == mActivityManagerUtils) {
mActivityManagerUtils = new ActivityManagerUtils();
}
return mActivityManagerUtils;
}
public String getTastActivity(Context mContext, int taskActivityByIndex,
int maxRunningTask) {
String curActivityName = null;
ActivityManager mActivityManager = (ActivityManager) mContext
.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningTaskInfo> mRunningTaskInfo = mActivityManager
.getRunningTasks(maxRunningTask);
if (mRunningTaskInfo.size() <= 0) {
return "";
}
RunningTaskInfo cinfo = mRunningTaskInfo
.get(taskActivityByIndex);
ComponentName mComponentName = cinfo.topActivity;
curActivityName = mComponentName.getClassName();
return curActivityName;
}
public boolean getTopActivity(Context mContext, String clz,
int taskActivityByIndex, int maxRunningTask) {
String curActivityName = null;
ActivityManager mActivityManager = (ActivityManager) mContext
.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningTaskInfo> mRunningTaskInfo = mActivityManager
.getRunningTasks(maxRunningTask);
RunningTaskInfo cinfo = mRunningTaskInfo
.get(taskActivityByIndex);
ComponentName mComponentName = cinfo.topActivity;
curActivityName = mComponentName.getClassName();
if (null != clz || !("".equals(clz))) {
if (clz.equals(curActivityName)) {
return true;
}
}
return false;
}
}
| [
"[email protected]"
] | |
2c1ee535d4ac28008f14c0bea088ee0e54640ecd | 8fc8b9819543b9411e96a12d08860f00bb6c3f9d | /SSH2/src/tres/entity/Reader.java | b25a270d4638e8b580875107515f69ba42e20b83 | [] | no_license | laikunpu/I_everything_konw_you | 893d0153e382668223f55079f51c96342f61f3aa | 60516337bf03aec168bef360ab85a4b5cd00576d | refs/heads/master | 2016-09-06T03:28:06.524695 | 2013-10-28T17:46:46 | 2013-10-28T17:46:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,576 | java | package tres.entity;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "tb_reader")
public class Reader {
private int id;
private String username;
private String password;
private String nickname;
private int usernumber;
private int level;
private int votes;
private int points;
private String email;
private List<BookMark> bookMarks = new ArrayList<BookMark>();
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "Id")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Column
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Column
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
@Column
public int getUsernumber() {
return usernumber;
}
public void setUsernumber(int usernumber) {
this.usernumber = usernumber;
}
@Column
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
@Column
public int getVotes() {
return votes;
}
public void setVotes(int votes) {
this.votes = votes;
}
@Column
public int getPoints() {
return points;
}
public void setPoints(int points) {
this.points = points;
}
@Column
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@OneToMany(mappedBy = "reader", cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
public List<BookMark> getBookMarks() {
return bookMarks;
}
public void setBookMarks(List<BookMark> bookMarks) {
this.bookMarks = bookMarks;
}
public Reader(String username, String password, String nickname,
int usernumber, int level, int votes, int points, String email) {
this.username = username;
this.password = password;
this.nickname = nickname;
this.usernumber = usernumber;
this.level = level;
this.votes = votes;
this.points = points;
this.email = email;
}
public Reader() {
}
}
| [
"[email protected]"
] | |
50183234e2b962269f8f03c79ff692ddc6db2468 | fe38700b5179734e07a3686c1d79b531453ff0f6 | /src/test/java/com/spandigital/assessment/store/InMemoryTest.java | 1da4ed3156e2f1ab85fe993de9f9c26f9e4a189d | [] | no_license | rmukubvu/games-app | 6d91742082fa84a7fc0c78d1d7e281177567156d | a4ecf7b861127c4dc76618d7979cfe0c13fc8f32 | refs/heads/master | 2022-12-27T14:16:55.146475 | 2020-04-18T23:17:21 | 2020-04-18T23:17:21 | 255,974,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,772 | java | package com.spandigital.assessment.store;
import com.spandigital.assessment.contract.Database;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class InMemoryTest {
private Database<Integer> inMemory;
@Before
public void init(){
inMemory = new InMemory<>();
}
@Test
public void saveResult_should_save_any_type_count_be_greater_than_zero() {
String key = "Manchester United";
int value = 1;
inMemory.save(key,value);
assertTrue("value has been saved",inMemory.count() > 0);
}
@Test
public void get_must_return_value_if_key_present(){
String key = "Manchester United";
int expected = 1;
inMemory.save(key,expected);
int actual = inMemory.get(key);
String errorMessage = String.format("expected [%d] got [%d]", expected, actual);
assertEquals(errorMessage, actual, expected);
}
@Test
public void must_update_value_if_key_already_present(){
String key = "Manchester United";
int value = 1;
inMemory.save(key,value);
int expected = 5;
inMemory.save(key,expected);
int actual = inMemory.get(key);
String errorMessage = String.format("expected [%d] got [%d]", expected, actual);
assertEquals(errorMessage, actual, expected);
}
@Test
public void must_fail_and_show_null_if_key_is_not_present(){
String key = "ab36egdh5769jdfkj";
assertNull("expected null",inMemory.get(key));
}
@Test
public void getValues_should_get_saved_values() {
assertNotNull(inMemory.getAll());
}
@Test
public void saveResult_should_save_any() {
assertNotNull(inMemory.getAll());
}
}
| [
"[email protected]"
] | |
2b9e7ce6d22dd9540d2afa144d5120a01606bdaf | ec6144ebae8195a07bdf7cb72e2328139636bd6b | /exercise01/src/view/FolderFrame.java | d45d38081f67371843116cb202ac6cee386783fe | [] | no_license | foxist/Splat | d2d21c641f3ed0da53aab94129fd1c4004518e30 | 7876cb9a3d2236b703491f9689d5a9d2e5189ff7 | refs/heads/master | 2020-03-25T00:48:05.784921 | 2018-08-03T00:41:05 | 2018-08-03T00:41:05 | 143,206,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,998 | java | package view;
import io.FileText;
import model.Data;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.DefaultHighlighter;
import javax.swing.tree.TreePath;
import java.awt.*;
public class FolderFrame extends JFrame {
private Data data;
public FolderFrame(Data data) {
super("TreeFolder");
setPreferredSize(new Dimension(600, 400));
setMinimumSize(new Dimension(600, 400));
setMaximumSize(new Dimension(600, 400));
setLayout(new GridLayout(0, 2));
this.data = data;
add(getLeftPanel());
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
public Data getData() {
return data;
}
public JPanel getLeftPanel() {
JPanel leftPanel = new JPanel();
leftPanel.setLayout(new BorderLayout());
JTree tree = new JTree(getData().getTop());
JScrollPane treeView = new JScrollPane(tree);
leftPanel.add(treeView, BorderLayout.CENTER);
tree.addTreeSelectionListener(new SelectionListener());
return leftPanel;
}
public JPanel getRightPanel(String textFile) {
try {
JPanel rightPanel = new JPanel();
rightPanel.setLayout(new BorderLayout());
JTextPane text = new JTextPane();
text.setText(new FileText().isFindFile(textFile));
int index = text.getText().indexOf(getData().getSearchText());
text.getHighlighter().addHighlight(index, index + getData().getSearchText().length(), new DefaultHighlighter.DefaultHighlightPainter(Color.GREEN));
int lastIndex = text.getText().lastIndexOf(getData().getSearchText());
text.getHighlighter().addHighlight(lastIndex, lastIndex + getData().getSearchText().length(), new DefaultHighlighter.DefaultHighlightPainter(Color.GREEN));
JScrollPane scrollPane = new JScrollPane(text);
rightPanel.add(scrollPane, BorderLayout.CENTER);
return rightPanel;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Искомого текста необнаружено!",
"Ошибка", JOptionPane.ERROR_MESSAGE);
return null;
}
}
class SelectionListener implements TreeSelectionListener {
public void valueChanged(TreeSelectionEvent e) {
JTree tree = (JTree) e.getSource();
TreePath[] selected = tree.getSelectionPaths();
int[] rows = tree.getSelectionRows();
assert selected != null;
for (TreePath aSelected : selected) {
assert rows != null;
if (getRightPanel(aSelected.getPathComponent(1) + "\\" + aSelected.getLastPathComponent()) != null) {
add(getRightPanel(aSelected.getPathComponent(1) + "\\" + aSelected.getLastPathComponent()));
revalidate();
}
}
}
}
}
| [
"[email protected]"
] | |
bcdfbee2d1a3b9dd5dad904727e35590e9d09db8 | a4174fa64560080e3145dad8fd76bef88d1c67bc | /src/main/java/com/create80/rd/common/persistence/proxy/PaginationMapperProxy.java | 8906503125db994f8f721a2425ed99aeb0a2a321 | [] | no_license | javaboomBird/questionnaire | 94ccdb81099328e15ad1d15fb742a54337c04d91 | 5dab9a26cc00fd807958369e5be45bc466f76e48 | refs/heads/master | 2020-04-27T06:51:39.346610 | 2019-03-06T10:08:33 | 2019-03-06T10:08:33 | 174,119,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,605 | java | /**
* Copyright © 2012-2016 All rights reserved.
*/
package com.create80.rd.common.persistence.proxy;
import com.create80.rd.common.persistence.Page;
import com.create80.rd.common.utils.Reflections;
import org.apache.ibatis.binding.BindingException;
import org.apache.ibatis.binding.MapperMethod;
import org.apache.ibatis.session.SqlSession;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashSet;
import java.util.Set;
/**
* <p>
* .
* </p>
*
* @author poplar.yfyang
* @version 1.0 2012-05-13 上午10:07
* @since JDK 1.5
*/
public class PaginationMapperProxy implements InvocationHandler {
private static final Set<String> OBJECT_METHODS = new HashSet<String>() {
private static final long serialVersionUID = -1782950882770203583L;
{
add("toString");
add("getClass");
add("hashCode");
add("equals");
add("wait");
add("notify");
add("notifyAll");
}
};
private boolean isObjectMethod(Method method) {
return OBJECT_METHODS.contains(method.getName());
}
private final SqlSession sqlSession;
private PaginationMapperProxy(final SqlSession sqlSession) {
this.sqlSession = sqlSession;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
if (isObjectMethod(method)) {
return null;
}
final Class<?> declaringInterface = findDeclaringInterface(proxy, method);
if (Page.class.isAssignableFrom(method.getReturnType())) {
// 分页处理
return new PaginationMapperMethod(declaringInterface, method, sqlSession).execute(args);
}
// 原处理方式
final MapperMethod mapperMethod = new MapperMethod(declaringInterface, method, sqlSession.getConfiguration());
final Object result = mapperMethod.execute(sqlSession, args);
if (result == null && method.getReturnType().isPrimitive()) {
throw new BindingException(
"Mapper method '"
+ method.getName()
+ "' ("
+ method.getDeclaringClass()
+ ") attempted to return null from a method with a primitive return type ("
+ method.getReturnType() + ").");
}
return result;
}
private Class<?> findDeclaringInterface(Object proxy, Method method) {
Class<?> declaringInterface = null;
for (Class<?> mapperFaces : proxy.getClass().getInterfaces()) {
Method m = Reflections.getAccessibleMethod(mapperFaces,
method.getName(),
method.getParameterTypes());
if (m != null) {
declaringInterface = mapperFaces;
}
}
if (declaringInterface == null) {
throw new BindingException(
"Could not find interface with the given method " + method);
}
return declaringInterface;
}
@SuppressWarnings("unchecked")
public static <T> T newMapperProxy(Class<T> mapperInterface, SqlSession sqlSession) {
ClassLoader classLoader = mapperInterface.getClassLoader();
Class<?>[] interfaces = new Class[]{mapperInterface};
PaginationMapperProxy proxy = new PaginationMapperProxy(sqlSession);
return (T) Proxy.newProxyInstance(classLoader, interfaces, proxy);
}
}
| [
"[email protected]"
] | |
505c0636c9fe1f1ad23f55da83b0076b6317fd48 | 69f0384e226f76286c5e4a0d9e3e606c07dce863 | /Lee/Braille_learning/app/src/main/java/com/example/yeo/practice/Normal_version_menu/Menu_quiz_abbreviation.java | 228cf006376168a8fca641fd74bdfa3f30f3118e | [] | no_license | ch-Yoon/trio | 85201f39ae5b17509f11b3a822daf38303b4cd68 | 63df3673d118cb426ca99110e676ae7f9ba29f91 | refs/heads/master | 2020-04-27T13:49:07.241882 | 2017-05-16T02:38:53 | 2017-05-16T02:38:53 | 78,740,712 | 0 | 0 | null | 2017-01-12T11:53:27 | 2017-01-12T11:53:27 | null | UTF-8 | Java | false | false | 6,410 | java | package com.example.yeo.practice.Normal_version_menu;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.app.FragmentActivity;
import android.view.MotionEvent;
import android.view.View;
import com.example.yeo.practice.Common_menu_sound.Menu_detail_service;
import com.example.yeo.practice.Menu_info;
import com.example.yeo.practice.Common_menu_sound.Menu_quiz_service;
import com.example.yeo.practice.R;
import com.example.yeo.practice.Normal_version_quiz.quiz_reading_manual;
import com.example.yeo.practice.Normal_version_quiz.quiz_score;
import com.example.yeo.practice.Common_quiz_sound.quiz_reading_service;
import com.example.yeo.practice.Common_sound.slied;
import com.example.yeo.practice.*;
// 약자 및 약어 퀴즈 메뉴 화면
public class Menu_quiz_abbreviation extends FragmentActivity {
int newdrag,olddrag;
int y1drag,y2drag;
int posx1,posx2,posy1,posy2;
boolean enter = true;
quiz_reading_manual manual;
quiz_score score;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View decorView = getWindow().getDecorView();
int uiOption = getWindow().getDecorView().getSystemUiVisibility();
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH )
uiOption |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN )
uiOption |= View.SYSTEM_UI_FLAG_FULLSCREEN;
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT )
uiOption |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
quiz_reading_service.finish_n = 6;
decorView.setSystemUiVisibility( uiOption );
setContentView(R.layout.activity_common_menu_quiz_abbreviation);
}
public IBinder onBind(Intent intent) {
return null;
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch(event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN: //손가락 1개를 화면에 터치하였을 경우
startService(new Intent(this, Sound_Manager.class));
posx1 = (int)event.getX(); //현재 좌표의 x좌표값 저장
posy1 = (int)event.getY(); //현재 좌표의 y좌표값 저장
break;
case MotionEvent.ACTION_UP: //손가락 1개를 화면에서 떨어트렸을 경우
posx2 = (int)event.getX(); //손가락 1개를 화면에서 떨어트린 x좌표값 저장
posy2 = (int)event.getY(); //손가락 1개를 화면에서 떨어트린 y좌표값 저장
if(enter == true) { //손가락 1개를 떨어트린 x,y좌표 지점에 다시 클릭이 이루어진다면 약자 및 약어 퀴즈로 접속
if (posx2 < posx1 + WHclass.Touch_space && posx2 > posx1 - WHclass.Touch_space && posy1 < posy2 + WHclass.Touch_space && posy2 > posy2 - WHclass.Touch_space) {
Menu_info.MENU_QUIZ_INFO = Menu_info.MENU_QUIZ_ABBREVIATION;
manual.choice=7;
score.sel =7;
Intent intent = new Intent(Menu_quiz_abbreviation.this, Menu_quiz_reading.class);
startActivityForResult(intent, Menu_info.MENU_QUIZ_ABBREVIATION);
MainActivity.Braille_TTS.TTS_Play("읽기 퀴즈");
}
}
else enter = true;
break;
case MotionEvent.ACTION_POINTER_UP: // 두번째 손가락을 떼었을 경우
newdrag = (int)event.getX(); // 두번째 손가락이 떨어진 지점의 x좌표값 저장
y2drag = (int) event.getY(); // 두번째 손가락이 떨어진 지점의 y좌표값 저장
if(olddrag-newdrag>WHclass.Drag_space) { //손가락 2개를 이용하여 오른쪽에서 왼쪽으로 드래그할 경우 다음 메뉴로 이동
Intent intent = new Intent(this,Menu_quiz_letter.class);
startActivityForResult(intent,Menu_info.MENU_QUIZ_LETTER);
Menu_quiz_service.menu_page= Menu_info.MENU_QUIZ_LETTER;
startService(new Intent(this, Menu_quiz_service.class));
slied.slied = Menu_info.next;
startService(new Intent(this, slied.class));
finish();
}
else if(newdrag-olddrag>WHclass.Drag_space) { //손가락 2개를 이용하여 왼쪽에서 오른쪽으로 드래그 할 경우 이전 메뉴로 이동
Intent intent = new Intent(this,Menu_quiz_sentence.class);
startActivityForResult(intent,Menu_info.MENU_QUIZ_SENTENS);
Menu_quiz_service.menu_page=Menu_info.MENU_QUIZ_SENTENS;
startService(new Intent(this, Menu_quiz_service.class));
slied.slied = Menu_info.pre;
startService(new Intent(this, slied.class));
finish();
}
else if(y2drag-y1drag> WHclass.Drag_space) { //손가락 2개를 이용하여 상단에서 하단으로 드래그할 경우 현재 메뉴의 상세정보 음성 출력
Menu_detail_service.menu_page=23;
startService(new Intent(this, Menu_detail_service.class));
}else if (y1drag - y2drag >WHclass.Drag_space) { //손가락 2개를 이용하여 하단에서 상단으로 드래그할 경우 현재 메뉴를 종료
onBackPressed();
}
break;
case MotionEvent.ACTION_POINTER_DOWN: //두번째 손가락이 화면에 터치 될 경우
enter = false; //손가락 1개를 인지하는 화면을 잠금
olddrag = (int)event.getX(); // 두번째 손가락이 터지된 지점의 x좌표값 저장
y1drag = (int) event.getY(); // 두번째 손가락이 터지된 지점의 y좌표값 저장
break;
}
return true;
}
@Override
public void onBackPressed() {
Menu_quiz_service.finish = true;
startService(new Intent(this, Menu_quiz_service.class));
finish();
}
}
| [
"[email protected]"
] | |
76c7b25b863bffa06176387c24571eb24e5781fe | 41df3f1bffbcc52a02588eeaa13b920e2aa0245e | /cloud-ribbon/src/main/java/com/cloud/config/quanJu/RibbonClientDefaultConfigrationTestConfig.java | 0753b05d4bfa8bf4e65b0aabef1e891ca357d45c | [] | no_license | 18895317466/cloudDemo | fe50ab49af77a14e3d224ebbe94caf908623d485 | 7cce32afbd271ab0895fd64a9ffa71d969c7d4b4 | refs/heads/master | 2020-05-16T16:54:49.163212 | 2019-04-29T10:01:57 | 2019-04-29T10:01:57 | 183,177,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,033 | java | package com.cloud.config.quanJu;
import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.*;
import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Created by ouyang on 2019/4/29.
*/
@RibbonClients(defaultConfiguration = DefaultRibbonConfig.class)
public class RibbonClientDefaultConfigrationTestConfig {
public static class BazServiceList extends ConfigurationBasedServerList{
public BazServiceList(IClientConfig config){
super.initWithNiwsConfig(config);
}
}
}
@Configuration
class DefaultRibbonConfig{
@Bean
public IRule ribbonRule(){
return new BestAvailableRule();
}
@Bean
public IPing ribbonPing(){
return new PingUrl();
}
@Bean
public ServerListSubsetFilter serverListSubsetFilter(){
ServerListSubsetFilter filter= new ServerListSubsetFilter();
return filter;
}
} | [
"[email protected]"
] | |
431543436722e9d5ace0303494fda960930c9b8c | 27511a2f9b0abe76e3fcef6d70e66647dd15da96 | /src/com/instagram/ui/widget/bannertoast/b.java | dbe342da34ba74294254d891f1637fdacd9493ad | [] | no_license | biaolv/com.instagram.android | 7edde43d5a909ae2563cf104acfc6891f2a39ebe | 3fcd3db2c3823a6d29a31ec0f6abcf5ceca995de | refs/heads/master | 2022-05-09T15:05:05.412227 | 2016-07-21T03:48:36 | 2016-07-21T03:48:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package com.instagram.ui.widget.bannertoast;
import com.facebook.j.n;
final class b
implements Runnable
{
b(BannerToast paramBannerToast, n paramn) {}
public final void run()
{
a.b(0.0D);
}
}
/* Location:
* Qualified Name: com.instagram.ui.widget.bannertoast.b
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
7870cb3344e6d063567ba3666d80ff86a8ed3f79 | 2b981496f2b1194101926ad32a5372444ed72ba3 | /src/MainWithoutClasses.java | 6de7045b94cd9c1060d9a71a4d3a557aa7d05804 | [] | no_license | nguyen41v/Comp131-Lab-5 | 282b2937101a1eaf44501922d13c8a67705fe180 | 977332afdb711e9ac78cfae70a32ce089a33f340 | refs/heads/master | 2020-04-10T20:45:12.526702 | 2018-03-07T20:11:38 | 2018-03-07T20:11:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,774 | java | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.lang.Math;
import java.util.ArrayList;
import java.util.Arrays;
public class MainWithoutClasses {
/* constant for the data file */
public static String FILE_PATH = "src/active-businesses.tsv";
/* constants for column indices */
public static int FORMAL_NAME_INDEX = 0;
public static int INFORMAL_NAME_INDEX = 1;
public static int ADDRESS_INDEX = 2;
public static int CITY_INDEX = 3;
public static int ZIP_CODE_INDEX = 4;
public static int CATEGORY_INDEX = 5;
public static int START_DATE_INDEX = 6;
public static int LATITUDE_INDEX = 7;
public static int LONGITUDE_INDEX = 8;
/* Oxy's coordinates */
public static double OXY_LATITUDE = 34.126813;
public static double OXY_LONGITUDE = -118.211904;
/* 1 degree longitude is about 57 miles (at 34 latitude) */
public static double DEGREES_TO_MILES = 57;
/**
* Reads
* @return a list of businesses, each a list of strings
*/
public static ArrayList<ArrayList<String>> read_businesses() {
ArrayList<ArrayList<String>> businesses = new ArrayList<ArrayList<String>>();
ArrayList<String> lines = read_lines();
int i = 0;
while (i < lines.size()) {
String line = lines.get(i);
ArrayList<String> business = line_to_business(lines.get(i));
businesses.add(business);
i ++;
}
return businesses;
}
/**
* Reads data file into a list of strings.
*
* @return an ArrayList of strings, each a line in the data file
*/
public static ArrayList<String> read_lines() {
ArrayList<String> lines = new ArrayList<String>();
String line = "";
try {
BufferedReader reader = new BufferedReader(new FileReader(FILE_PATH));
line = reader.readLine();
while (line != null) {
lines.add(line);
line = reader.readLine();
}
} catch (IOException e) {
System.out.println("Working Directory is " + System.getProperty("user.dir") + ".");
System.out.println("Cannot find '" + FILE_PATH + "'; quitting.");
System.exit(1);
}
return lines;
}
/**
* Converts a line of data into multiple fields
*
* @param line a line from the data file
* @return the different fields, as strings
*/
public static ArrayList<String> line_to_business(String line) {
// this creates a list of strings from a single line of the data file
// each string corresponds to a field - formal name, informal name, address, etc.
ArrayList<String> fields = new ArrayList<String>(Arrays.asList(line.split("\t")));
// we are using the list of strings to represent the business, so we just return it
return fields;
}
/**
* Calculates the distance of a coordinate from Oxy
*
* @param business the target business
* @param latitude the latitude of the destination
* @param longitude the longitude of the destination
* @return the distance from Oxy, in miles
*/
public static double distance_from(ArrayList<String> business, double latitude, double longitude) {
double biz_lat = get_latitude(business);
double biz_long = get_longitude(business);
double lat_diff = biz_lat - latitude;
double long_diff = biz_long - longitude;
double coord_dist = java.lang.Math.sqrt((lat_diff * lat_diff) + (long_diff * long_diff));
return coord_dist * DEGREES_TO_MILES;
}
/**
* Extracts the latitude from a business
*
* @param business the target business
* @return the latitude of the business
*/
public static double get_latitude(ArrayList<String> business) {
double lat = Double.parseDouble(business.get(LATITUDE_INDEX));
return lat;
}
/**
* Extracts the longitude from a business
*
* @param business the target business
* @return the longitude of the business
*/
public static double get_longitude(ArrayList<String> business) {
double lon = Double.parseDouble(business.get(LONGITUDE_INDEX));
return lon;
}
/**
* Determines if a business is categorized as a restaurant
*
* @param business the target business
* @return true if the business is a restaurant, false otherwise
*/
public static boolean is_restaurant(ArrayList<String> business) {
// note: to compare Strings, DO NOT use ==
// instead, use the .equals method
// For example, DO NOT DO
//
// if ("hello" == "world") { ... }
//
// Instead, do
//
// if ("hello".equals("world")) { ... }
String Businessname = business.get(CATEGORY_INDEX);
return Businessname.equals("Full-service restaurants");
}
/**
* Determines if a business is a restaurant within a mile of Oxy
*
* @param business the target business
* @return true if the business is a restaurant near Oxy, false otherwise
*/
public static boolean is_restaurant_near_oxy(ArrayList<String> business) {
//double latitude = get_latitude(business);
//double longitude = get_longitude(business);
double distance = distance_from(business, OXY_LATITUDE, OXY_LONGITUDE);
return (is_restaurant(business) && distance < 1);
}
/**
* Prints the name of a business
*
* @param business the target business
*/
public static void print_business_name(ArrayList<String> business) {
// see note in is_restaurant about comparing Strings
//
if (business.get(INFORMAL_NAME_INDEX).equals("")){
System.out.println(business.get(FORMAL_NAME_INDEX));
}else if (!business.get(INFORMAL_NAME_INDEX).equals("")) {
System.out.println(business.get(INFORMAL_NAME_INDEX));}
}
/**
* Print the names of restaurants near Oxy
*/
public static void main(String[] args) {
ArrayList<ArrayList<String>> businesses = read_businesses();
int biz_index = 0;
while (biz_index < businesses.size()) {
ArrayList<String> business = businesses.get(biz_index);
if (is_restaurant_near_oxy(business)) {
print_business_name(business);
}
biz_index ++;
}
}
} | [
"[email protected]"
] | |
95b4dce096b3b4297de954dec9d7c4c1dd3b5ebd | 368c663f8d031f576e3add37dde8e9052dc628d8 | /java/GBOL/trunk/src/org/gmod/gbol/simpleObject/generated/AbstractPhenotypeCVTerm.java | 6ab8ef67fd45e97cab3dc89d791cff834f422197 | [] | no_license | mahmoudimus/obo-edit | 494a588830758ddbd7cf43d2e70550ddd542cb1b | 61c146958fd7d0ba7f78cda77f56d45849897b3e | refs/heads/master | 2022-01-31T22:59:21.316185 | 2014-03-20T17:05:47 | 2014-03-20T17:05:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,304 | java | package org.gmod.gbol.simpleObject.generated;
import org.gmod.gbol.simpleObject.*;
/**
* PhenotypeCVTerm generated by hbm2java
*/
public abstract class AbstractPhenotypeCVTerm extends AbstractSimpleObject implements java.io.Serializable {
private Integer phenotypeCVTermId;
private CVTerm cvterm;
private Phenotype phenotype;
private int rank;
public AbstractPhenotypeCVTerm() {
}
public AbstractPhenotypeCVTerm(CVTerm cvterm, Phenotype phenotype, int rank) {
this.cvterm = cvterm;
this.phenotype = phenotype;
this.rank = rank;
}
public Integer getPhenotypeCVTermId() {
return this.phenotypeCVTermId;
}
public void setPhenotypeCVTermId(Integer phenotypeCVTermId) {
this.phenotypeCVTermId = phenotypeCVTermId;
}
public CVTerm getCvterm() {
return this.cvterm;
}
public void setCvterm(CVTerm cvterm) {
this.cvterm = cvterm;
}
public Phenotype getPhenotype() {
return this.phenotype;
}
public void setPhenotype(Phenotype phenotype) {
this.phenotype = phenotype;
}
public int getRank() {
return this.rank;
}
public void setRank(int rank) {
this.rank = rank;
}
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof AbstractPhenotypeCVTerm) ) return false;
AbstractPhenotypeCVTerm castOther = ( AbstractPhenotypeCVTerm ) other;
return ( (this.getCvterm()==castOther.getCvterm()) || ( this.getCvterm()!=null && castOther.getCvterm()!=null && this.getCvterm().equals(castOther.getCvterm()) ) )
&& ( (this.getPhenotype()==castOther.getPhenotype()) || ( this.getPhenotype()!=null && castOther.getPhenotype()!=null && this.getPhenotype().equals(castOther.getPhenotype()) ) )
&& (this.getRank()==castOther.getRank());
}
public int hashCode() {
int result = 17;
result = 37 * result + ( getCvterm() == null ? 0 : this.getCvterm().hashCode() );
result = 37 * result + ( getPhenotype() == null ? 0 : this.getPhenotype().hashCode() );
result = 37 * result + this.getRank();
return result;
}
}
| [
"[email protected]"
] | |
a5889fe0a5bf27b5215f4245d6c3e6733f5c1639 | c42ad5074aa90a181d5ea061df649d41c76ae98a | /src/threads/TicketHandler.java | 4c5104993fc6b9beb12a52691734df4f0aeaf286 | [] | no_license | Denky230/HotelStucom | 505d1cffa7da552e063f45c17e8037f7593ea25f | 0295ca1b4649918592eb3d29195d5a2b7d3ddaad | refs/heads/master | 2020-04-18T11:05:12.176129 | 2019-02-11T13:22:34 | 2019-02-11T13:22:34 | 165,681,871 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,406 | java |
package threads;
import exceptions.MyException;
import input.InputHandler;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import management.Manager;
public class TicketHandler implements Runnable {
private final String FILE_PATH;
private final int SPEED;
private final InputHandler input = InputHandler.getInstance();
private final Manager manager = Manager.getInstance();
public TicketHandler(String filePath, int speed) {
this.FILE_PATH = filePath;
this.SPEED = speed;
}
@Override
public void run() {
try (
FileReader fr = new FileReader(FILE_PATH);
BufferedReader br = new BufferedReader(fr);
) {
// Read Customer requests until none are left or money <= 0
String line;
while ((line = br.readLine()) != null &&
manager.getMoney() > 0) {
try {
// Each hotel cycle (day)
Thread.sleep(SPEED);
input.processCustomerInput(line);
} catch (MyException e) {
System.out.println(e.getMessage());
}
}
} catch (IOException | InterruptedException e) {
System.out.println(e.getMessage());
}
}
} | [
"[email protected]"
] | |
2cd82d28184a35fa485f7053c644218258deb7c1 | aecffb5cc456d31f938774a02de30c062fee726b | /sources/com/sec/android/app/clockpackage/stopwatch/model/ListItem.java | 9748f990f943e18b214054d796ba9f1838236a35 | [] | no_license | Austin-Chow/SamsungClock10.0.04.3 | 6d48abd288f3b182a6520315ef526163a94b0278 | 5523378f7fea1bf462248fddf52a7828ff2de0a9 | refs/heads/master | 2020-06-29T12:44:41.353764 | 2019-08-04T20:47:14 | 2019-08-04T20:47:14 | 200,538,351 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,689 | java | package com.sec.android.app.clockpackage.stopwatch.model;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
public class ListItem implements Parcelable {
public static final Creator<ListItem> CREATOR = new C07071();
private long mElapsedTime;
private String mIndex;
private String mMilliSecond;
private String mMilliSecondDiff;
private String mTime;
private String mTimeDescription;
private String mTimeDiff;
private String mTimeDiffDescription;
/* renamed from: com.sec.android.app.clockpackage.stopwatch.model.ListItem$1 */
static class C07071 implements Creator<ListItem> {
C07071() {
}
public ListItem createFromParcel(Parcel source) {
return new ListItem(source.readString(), source.readLong(), source.readString(), source.readString(), source.readString(), source.readString(), source.readString(), source.readString());
}
public ListItem[] newArray(int size) {
return new ListItem[size];
}
}
public ListItem(String index, long elapsedTime, String time, String millisecond, String timeDiff, String millisecondDiff, String timeDescription, String timeDiffDescription) {
this.mIndex = index;
this.mElapsedTime = elapsedTime;
this.mTime = time;
this.mMilliSecond = millisecond;
this.mTimeDiff = timeDiff;
this.mMilliSecondDiff = millisecondDiff;
this.mTimeDescription = timeDescription;
this.mTimeDiffDescription = timeDiffDescription;
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.mIndex);
dest.writeLong(this.mElapsedTime);
dest.writeString(this.mTime);
dest.writeString(this.mMilliSecond);
dest.writeString(this.mTimeDiff);
dest.writeString(this.mMilliSecondDiff);
dest.writeString(this.mTimeDescription);
dest.writeString(this.mTimeDiffDescription);
}
public String getIndex() {
return this.mIndex;
}
public String getTime() {
return this.mTime;
}
public long getElapsedTime() {
return this.mElapsedTime;
}
public String getMillisecond() {
return this.mMilliSecond;
}
public String getTimeDiff() {
return this.mTimeDiff;
}
public String getMillisecondDiff() {
return this.mMilliSecondDiff;
}
public String getTimeDescription() {
return this.mTimeDescription;
}
public String getTimeDiffDescription() {
return this.mTimeDiffDescription;
}
}
| [
"myemail"
] | myemail |
0285498a6419ca3032675a6ab49a342eff568449 | b3f9f7bfbf69c52eb07daf3a6d041ad56fe95254 | /src/main/java/com/lypgod/test/ThinkingInJava/Ch14_TypeInformation/Practice6/Shapes.java | 5a67c8108ece56342c96a7582d1f415d3c475861 | [] | no_license | lypgod/ThinkingInJavaPractice | 33c13a8ad07648560d24060206db537e6d95aa76 | b3ced3631e751c09914af6d47fe0e3c17846801a | refs/heads/master | 2021-01-12T13:57:43.799008 | 2016-11-04T19:48:10 | 2016-11-04T19:48:10 | 69,253,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,202 | java | package com.lypgod.test.ThinkingInJava.Ch14_TypeInformation.Practice6;//: typeinfo/Shapes.java
import java.util.Arrays;
import java.util.List;
abstract class Shape {
void draw() {
System.out.println(this + ".draw()");
}
abstract public String toString();
}
class Circle extends Shape {
boolean flag = false;
public String toString() {
return (flag ? "H" : "Unh") + "ighlighted " + "Circle";
}
}
class Square extends Shape {
boolean flag = false;
public String toString() {
return (flag ? "H" : "Unh") + "ighlighted " + "Square";
}
}
class Triangle extends Shape {
boolean flag = false;
public String toString() {
return (flag ? "H" : "Unh") + "ighlighted " + "Triangle";
}
}
public class Shapes {
public static void setFlag(Shape s) {
if (s instanceof Triangle)
((Triangle) s).flag = true;
}
public static void main(String[] args) {
// upcasting to Shape:
List<Shape> shapeList = Arrays.asList(new Circle(), new Square(), new Triangle());
for (Shape shape : shapeList) {
setFlag(shape);
System.out.println(shape);
}
}
} | [
"[email protected]"
] | |
d1af097645c3a90b5f9f1d0617d49e938b65653c | 154ee51b147a8aad410fc966bf3aec0ac16f33fa | /nrakpo/src/main/java/com/vidakovic/nrakpo/aspect/timer/PrometheusService.java | f2773bfea82dfb742f3dc59a8ab8e0bc57b4e067 | [] | no_license | VidakovicDominik/nrakpo | 3b81b0465abe7f3912ca8c48a06a1a63c762a7eb | a378304552eb7fb5dc5cda3b2f0f3ebf666fd2d4 | refs/heads/master | 2020-06-25T22:42:46.743751 | 2020-02-04T16:33:00 | 2020-02-04T16:33:00 | 199,443,322 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 829 | java | package com.vidakovic.nrakpo.aspect.timer;
import io.micrometer.prometheus.PrometheusMeterRegistry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.Duration;
/**
* <p>
* <b>Title: TimerService </b>
* </p>
* <p>
* <b> Description:
*
*
* </b>
* </p>
* <p>
* <b>Copyright:</b> Copyright (c) ETK 2020
* </p>
* <p>
* <b>Company:</b> Ericsson Nikola Tesla d.d.
* </p>
*
* @author ezviddo
* @version PA1
* <p>
* <b>Version History:</b>
* </p>
* <br>
* PA1 04-Feb-20
* @since 04-Feb-20 14:17:42
*/
@Service
public class PrometheusService {
@Autowired
PrometheusMeterRegistry meterRegistry;
public void record(Duration duration, String meterName){
meterRegistry.timer(meterName).record(duration);
}
}
| [
"[email protected]"
] | |
780c01ef23e7158e3aea115a31fa77230beb37e3 | e28ca94227ed7dd6b905878233aec7cce98a99df | /Max-Increase-to-Keep-City-Skyline/src/Solution.java | a4c73197f8ee022a3816d7096c0938e35d41441b | [] | no_license | xiao-peng1006/Coding-Chanllenge | a0f80b70439902da98191d91f2d2b023070c3dde | 419ddfa497b744da4c985407c601f44ac149a03d | refs/heads/master | 2020-04-27T09:59:47.396322 | 2019-12-16T19:02:05 | 2019-12-16T19:02:05 | 174,236,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,352 | java | import java.util.Arrays;
class Solution {
/**
* Leetcode 807. Max Increase to Keep City Skyline
* @param grid
* @return
*/
int[][] grid;
public int maxIncreaseKeepingSkyline(int[][] grid) {
this.grid = grid;
int res = 0;
for (int i = 0; i < grid.length; i++) {
int rowMax = getMaxRow(i);
for (int j = 0; j < grid[0].length; j++) {
int colMax = getMaxCol(j);
if (grid[i][j] == rowMax || grid[i][j] == colMax)
continue;
res += Math.min(rowMax, colMax) - grid[i][j];
}
}
return res;
}
private int getMaxRow(int row) {
int rowMax = grid[row][0];
for (int i = 1; i < grid[row].length; i++) {
rowMax = Math.max(rowMax, grid[row][i]);
}
return rowMax;
}
private int getMaxCol(int col) {
int colMax = grid[0][col];
for (int i = 1; i < grid.length; i++) {
colMax = Math.max(colMax, grid[i][col]);
}
return colMax;
}
public static void main(String[] args) {
Solution solution = new Solution();
System.out.println("Expected: 35, Output: " + solution.maxIncreaseKeepingSkyline(new int[][]{{3, 0, 8, 4}, {2, 4, 5, 7}, {9, 2, 6, 3}, {0, 3, 1, 0}}));
}
} | [
"[email protected]"
] | |
13533e2305767fdae6ff4f709d12301d720fc12c | e03b109201dd7247de41c79340f328269531c39e | /src/main/java/sages/bootcamp/example/jooq/Tables.java | 3e2629d46c72c5d1f0da4831705b25ae745ad83b | [] | no_license | marcinkrol1024/camp10-cars | ad7c0a032254170f4c4d27a03de89868e5b1dc1c | ea0b925813a9e1f16889e87c0163bdd323f04674 | refs/heads/master | 2020-12-03T02:02:43.028409 | 2017-06-30T15:02:08 | 2017-06-30T15:02:08 | 95,898,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 584 | java | /*
* This file is generated by jOOQ.
*/
package sages.bootcamp.example.jooq;
import javax.annotation.Generated;
import sages.bootcamp.example.jooq.tables.Cars;
/**
* Convenience access to all tables in public
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.9.3"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Tables {
/**
* The table <code>public.cars</code>.
*/
public static final Cars CARS = sages.bootcamp.example.jooq.tables.Cars.CARS;
}
| [
"[email protected]"
] | |
f0741049a4693c23af8c009d506c5a092115304d | eed260a2b4d526c7ada66ba77c1b046299390eb8 | /sb3_gateway_server/src/main/java/com/topkst/gateway/dao/ScanBeaconDAOImpl.java | e49061cacaf3df2b9e80ffac0494427c0e7514f0 | [] | no_license | mpanda-kr/sb3_gateway | 5adb33fd098491b7f535373d5c1191a3c423b898 | 52ea4e0eb181ce7ddc7bf5e9abcf2f24c6d21380 | refs/heads/master | 2020-04-02T23:18:57.451096 | 2018-10-30T03:30:16 | 2018-10-30T03:30:16 | 154,863,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 680 | java | package com.topkst.gateway.dao;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.topkst.gateway.dto.ScanBeacon;
@Repository
public class ScanBeaconDAOImpl implements ScanBeaconDAO {
@Autowired
private SqlSessionTemplate sqlSession;
@Override
public void setScanBeacon_insert(ScanBeacon beacon) {
sqlSession.selectList("com.topkst.beacon.mapper.scanBeacon_isert",beacon);
}
public void setUltraBeacon_insert(ScanBeacon beacon) {
sqlSession.selectList("com.topkst.beacon.mapper.ultraBeacon_isert",beacon);
}
}
| [
"[email protected]"
] | |
362e0559d2feb49f394dd4f43987e9cf72ff2caa | 9e9c99ea453345c48e8817a7dd687de2b3f1001d | /source/anconsd/src/com/andconsd/ui/activity/PicViewSwitcher.java | 06d456caaf62c927a396f016e1ff4281f694ddc6 | [] | no_license | haoerloveyou/anconsd | 62218040b8cd2484ebb0da339d1e7f6e50552136 | 229beafc90746a298ba2817f34d5af80eff785c0 | refs/heads/master | 2021-12-07T12:07:50.299023 | 2015-11-25T05:26:24 | 2015-11-25T05:26:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,015 | java | package com.andconsd.ui.activity;
import java.io.File;
import com.andconsd.R;
import com.andconsd.ui.widget.DuoleCountDownTimer;
import com.andconsd.ui.widget.DuoleVideoView;
import com.andconsd.ui.widget.ScrollLayout;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.ImageSwitcher;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.ViewSwitcher.ViewFactory;
public class PicViewSwitcher extends Activity implements ViewFactory{
int cacheEnd = 0;
int cacheStart = 0;
RelativeLayout.LayoutParams lp;
ScrollLayout slPic;
PicViewSwitcher appref;
int imgIndex = 0;
TextView tvIndex;
RelativeLayout rlController;
RelativeLayout rlSlidShow;
ImageSwitcher iSwitcher;
int screenWidth = 0;
int screenHeight = 0;
ImageView iv ;
DuoleVideoView vv;
ImageView ivPlay;
File tempFile;
ImageView ivSlidShow;
DuoleCountDownTimer autoPlayerCountDownTimer;
private int ImageViewId = 999998;
Handler handler = new Handler();
RotateAnimation rotate;
ScaleAnimation scale;
AlphaAnimation alpha;
TranslateAnimation translate;
boolean slidshow = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
appref = this;
setContentView(R.layout.picview);
imgIndex = getIntent().getIntExtra("index", 0);
iSwitcher = (ImageSwitcher) findViewById(R.layout.picview);
iSwitcher.setFactory(this);
}
@Override
public View makeView() {
View view = LayoutInflater.from(appref).inflate(R.layout.picviewitem, null);
return null;
}
}
| [
"[email protected]"
] | |
d33136097061cc1b3d6b4d9b12e2413cadf68092 | a73df0dc7ae50ee6cf1e14611ef6db20a6eef10e | /app/src/main/java/com/shidonghui/mymagic/request/LiveDetailsRequest.java | a0cba314bd1ca3f1d05974a62b025b613604ec86 | [] | no_license | ZHANGKUN0917/MyMagic | a4143aad380e029d20f2d798d2217936777df38e | 60966ba16eb47f11924e661481573d005c9f5efa | refs/heads/master | 2020-06-17T00:32:44.189831 | 2019-07-08T10:15:12 | 2019-07-08T10:15:12 | 195,732,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | java | package com.shidonghui.mymagic.request;
/**
* @author ZhangKun
* @create 2019/6/19
* @Describe
*/
public class LiveDetailsRequest {
private String liveId;
public LiveDetailsRequest(String liveId) {
this.liveId = liveId;
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.