blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
986057da565886f0a1e6c5bb64a58c0709b248dd
e023d23bbdaa93d4a1e41741c73168869cecae92
/src/cws/UserAdmin/com-cordys-coe/useradmin/java/source/com/cordys/coe/tools/useradmin/ui/UIUserTeams.java
a4392e38f14ce647eb7ab240227064c41415aec2
[ "Apache-2.0" ]
permissive
kekema/cordysuseradmin
a3854bf417c0f9017c55b2f763c17567e0681d0e
1b6e382805d461092f966a29d27f41ff2ffe9e82
refs/heads/master
2020-04-08T20:41:50.269083
2014-05-03T14:22:54
2014-05-03T14:22:54
37,658,501
0
0
null
null
null
null
UTF-8
Java
false
false
21,328
java
package com.cordys.coe.tools.useradmin.ui; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map.Entry; import com.cordys.coe.tools.useradmin.cordys.CordysObject; import com.cordys.coe.tools.useradmin.cordys.CordysObjectList; import com.cordys.coe.tools.useradmin.cordys.CordysUtil; import com.cordys.coe.tools.useradmin.cordys.Role; import com.cordys.coe.tools.useradmin.cordys.TeamAssignment; import com.cordys.coe.tools.useradmin.cordys.Unit; import com.cordys.coe.tools.useradmin.cordys.exception.CordysValidationException; import com.cordys.coe.tools.useradmin.exception.UserAdminException; import com.cordys.coe.tools.useradmin.util.Util; import com.cordys.cpc.bsf.busobject.BSF; import com.cordys.cpc.bsf.busobject.BusObjectConfig; import com.cordys.cpc.bsf.busobject.BusObjectIterator; import com.cordys.cpc.bsf.soap.SOAPRequestObject; import com.eibus.xml.nom.Document; import com.eibus.xml.nom.Node; import com.eibus.xml.xpath.XPath; /** * Class to support UI on assigning a user to teams (via roles). * It includes the actual assignment plus the potential additional assignments. * So in one tuple, it has one list of team/role combinations, for each combination a * flag to indicate whether the user has been assigned that team/role. * * @author kekema * */ public class UIUserTeams extends UIUserTeamsBase { private boolean readBackOnUpdate = true; // whether to readback the actual content after updating // can be set to false for batch processes public UIUserTeams() { this((BusObjectConfig)null); } public UIUserTeams(BusObjectConfig config) { super(config); } /** * set readBack optoin * * @param readBackOnUpdate */ public void setReadBackOnUpdate(boolean readBackOnUpdate) { this.readBackOnUpdate = readBackOnUpdate; } /** * Get actual assignments plus additional team/role combinations from which new assignments can be made. * * @param orgUserDN * @return */ public static UIUserTeams getUIUserTeams(String orgUserDN) { UIUserTeams uiUserTeams = new UIUserTeams(); uiUserTeams.makeTransient(); uiUserTeams.setOrgUserDN(orgUserDN); UIUserTeams.TeamRoles teamRoles = new UIUserTeams.TeamRoles(); uiUserTeams.setTeamRolesObject(teamRoles); HashSet<String> currentAssignments = new HashSet<String>(); CordysObjectList allUnits = null; try { allUnits = Unit.getAllUnits(); HashMap<String, String> unitNamesByID = Unit.getUnitNamesByID(allUnits); HashMap<String, String> unitQNamesByID = Unit.getUnitQNamesByID(allUnits); TeamAssignment.setUnitNamesByID(unitNamesByID); // get current assignments CordysObjectList teamAssignments = null; int seqNo = 0; try { teamAssignments = TeamAssignment.getAssignments(orgUserDN, "", true); for (CordysObject cordysObject : teamAssignments.getList()) { TeamAssignment teamAssignment = (TeamAssignment)cordysObject; // the seqNo sequence number can be used client side as an index to the team/role seqNo++; UIUserTeams.TeamRoles.TeamRole teamRole = new UIUserTeams.TeamRoles.TeamRole(); teamRole.makeTransient(); teamRole.setSeqNo(seqNo); String unitID = teamAssignment.getUnitID(); teamRole.setUnitID(unitID); // unit name can be used client side to compose the list of units for principal unit selection String unitName = unitNamesByID.get(unitID); teamRole.setUnitName(unitName); String unitQName = unitQNamesByID.get(unitID); teamRole.setUnitQName(unitQName); String roleDN = teamAssignment.getRoleDN(); teamRole.setRoleDN(roleDN); teamRole.setAssigned(true); teamRole.setAssignmentID(teamAssignment.getID()); teamRole.setDescription(teamAssignment.getDescription()); boolean isPrincipalUnit = teamAssignment.getIsPrincipalUnit(); if (isPrincipalUnit) { uiUserTeams.setPrincipleUnitID(unitID); } teamRoles.addTeamRoleObject(teamRole); currentAssignments.add(unitID+roleDN); } } finally { // teamAssignments do wrap NOM xml structures, so cleanup if (teamAssignments != null) { teamAssignments.cleanup(); } } // get user roles HashSet<String> userRoles = new HashSet<String>(Role.getAssignedRoles(orgUserDN)); // for each unit/role combination which is not assigned yet and for which the role is // assigned to the user, add that combination as not assigned (potential new assignment in UI) for (CordysObject cordysObject : allUnits.getList()) { Unit unit = (Unit)cordysObject; String unitID = unit.getID(); ArrayList<String> unitRoles = Unit.getUnitRoles(unitID); for (String roleDN : unitRoles) { if (userRoles.contains(roleDN) && (!(currentAssignments.contains(unitID+roleDN)))) { seqNo++; UIUserTeams.TeamRoles.TeamRole teamRole = new UIUserTeams.TeamRoles.TeamRole(); teamRole.makeTransient(); teamRole.setSeqNo(seqNo); teamRole.setUnitID(unitID); String unitName = unitNamesByID.get(unitID); teamRole.setUnitName(unitName); String unitQName = unitQNamesByID.get(unitID); teamRole.setUnitQName(unitQName); teamRole.setRoleDN(roleDN); teamRole.setAssigned(false); String roleName = Util.getNameFromDN(roleDN); teamRole.setDescription(unitName + "/" + roleName); teamRoles.addTeamRoleObject(teamRole); } } } } finally { if (allUnits != null) { allUnits.cleanup(); } } return uiUserTeams; } public void onInsert() { // N.A. } /** * From the revised assignments, execute the required deletes, additions and updates to the user assignments. */ public void onUpdate() { String orgUserDN = this.getOrgUserDN(); String assignmentRoot = CordysUtil.getAssignmentRoot(false, true); Document xmlDoc = BSF.getXMLDocument(); boolean assignmentsToBeAdded = false; boolean assignmentsToBeRemoved = false; boolean assignmentsToBeUpdated = false; HashMap<String, UIUserTeams.TeamRoles.TeamRole> teamRolesByAssignmentID = new HashMap<String, UIUserTeams.TeamRoles.TeamRole>(); HashMap<String, UIUserTeams.TeamRoles.TeamRole> teamRolesByUnitRole = new HashMap<String, UIUserTeams.TeamRoles.TeamRole>(); HashSet<String> existingAssignmentsByUnitRole = new HashSet<String>(); ArrayList<TeamAssignment> assignmentsForDelete = new ArrayList<TeamAssignment>(); ArrayList<TeamAssignment> assignmentsForAddition = new ArrayList<TeamAssignment>(); ArrayList<TeamAssignment> assignmentsForUpdate = new ArrayList<TeamAssignment>(); // find out which assignments to be deleted, added, updated. CordysObjectList existingTeamAssignments = null; try { if (this.getTeamRolesObject() != null) { TeamAssignment currentPrincipleUnitAssignment = null; TeamAssignment newPrincipleUnitAssignment = null; TeamAssignment addedPrincipleUnitAssignment = null; String currentPrincipleUnitID = null; String newPrincipleUnitID = this.getPrincipleUnitID(); // compose hashset for existing assignments existingTeamAssignments = TeamAssignment.getAssignments(orgUserDN, "", true); for (CordysObject cordysObject : existingTeamAssignments.getList()) { TeamAssignment teamAssignment = (TeamAssignment)cordysObject; String unitID = teamAssignment.getUnitID(); String roleDN = teamAssignment.getRoleDN(); existingAssignmentsByUnitRole.add(unitID+roleDN); boolean isPrincipleUnit = teamAssignment.getIsPrincipalUnit(); if ((currentPrincipleUnitAssignment == null) && isPrincipleUnit) { currentPrincipleUnitAssignment = teamAssignment; currentPrincipleUnitID = unitID; } if ((newPrincipleUnitAssignment == null) && (unitID.equals(newPrincipleUnitID) && (!isPrincipleUnit))) { newPrincipleUnitAssignment = teamAssignment; } } HashSet<String> assignedTeams = new HashSet<String>(); // iterate the inner teamroles as to fill hashmaps and to // compose list of assignments to be added BusObjectIterator<UIUserTeams.TeamRoles.TeamRole> teamRoles = this.getTeamRolesObject().getTeamRoleObjects(); while (teamRoles.hasMoreElements()) { UIUserTeams.TeamRoles.TeamRole teamRole = teamRoles.nextElement(); String assignmentID = teamRole.getAssignmentID(); if (Util.isSet(assignmentID)) { teamRolesByAssignmentID.put(assignmentID, teamRole); } String unitID = teamRole.getUnitID(); String roleDN = teamRole.getRoleDN(); teamRolesByUnitRole.put(unitID+roleDN, teamRole); // check if to be added boolean assigned = teamRole.getAssigned(); if (assigned) { assignedTeams.add(unitID); if (!Util.isSet(assignmentID)) { if (!existingAssignmentsByUnitRole.contains(unitID+roleDN)) { TeamAssignment newTeamAssignment = new TeamAssignment(); newTeamAssignment.setUnitID(unitID); newTeamAssignment.setRoleDN(roleDN); newTeamAssignment.setUserDN(orgUserDN); newTeamAssignment.setIsPrincipalUnit(false); assignmentsForAddition.add(newTeamAssignment); assignmentsToBeAdded = true; if (unitID.equals(newPrincipleUnitID)) { addedPrincipleUnitAssignment = newTeamAssignment; } } } } } if (!Util.isSet(this.getPrincipleUnitID())) { if (assignedTeams.size() > 1) { throw new CordysValidationException("Cannot update team assignments for user " + Util.getNameFromDN(orgUserDN) + " - Principle Unit not set"); } } // compose list of which ones to be removed for (CordysObject cordysObject : existingTeamAssignments.getList()) { TeamAssignment teamAssignment = (TeamAssignment)cordysObject; String id = teamAssignment.getID(); String unitID = teamAssignment.getUnitID(); String roleDN = teamAssignment.getRoleDN(); UIUserTeams.TeamRoles.TeamRole teamRole = teamRolesByAssignmentID.get(id); if (teamRole == null) { // timeout situation (as long as no check for 'tuple changed by other user') teamRole = teamRolesByUnitRole.get(unitID+roleDN); } boolean stillAssigned = false; if (teamRole != null) { stillAssigned = (teamRole.getAssigned()); } if (!stillAssigned) { if (teamAssignment == currentPrincipleUnitAssignment) { currentPrincipleUnitAssignment = null; } if (teamAssignment == newPrincipleUnitAssignment) { newPrincipleUnitAssignment = null; } assignmentsForDelete.add(teamAssignment); assignmentsToBeRemoved = true; } } // determine any change wrt the principle unit if ((currentPrincipleUnitAssignment != null) && (currentPrincipleUnitID.equals(newPrincipleUnitID))) { // no action } else { if (currentPrincipleUnitAssignment != null) { TeamAssignment newObject = currentPrincipleUnitAssignment.prepareNew(); newObject.setIsPrincipalUnit(false); assignmentsForUpdate.add(currentPrincipleUnitAssignment); assignmentsToBeUpdated = true; } if (Util.isSet(newPrincipleUnitID)) { if (newPrincipleUnitAssignment != null) { TeamAssignment newObject = newPrincipleUnitAssignment.prepareNew(); newObject.setIsPrincipalUnit(true); assignmentsForUpdate.add(newPrincipleUnitAssignment); assignmentsToBeUpdated = true; } else if (addedPrincipleUnitAssignment != null) { addedPrincipleUnitAssignment.setIsPrincipalUnit(true); } } } // compose the soap requests int removeAssignmentsNode = 0; int addAssignmentsNode = 0; int updateAssignmentsNode = 0; SOAPRequestObject sroRemove = null; SOAPRequestObject sroAdd = null; SOAPRequestObject sroUpdate = null; try { if (assignmentsToBeRemoved) { // RemoveAssignments soap request String namespace = "http://schemas.cordys.com/userassignment/UserAssignmentService/1.0"; String methodName = "RemoveAssignments"; String[] paramNames = new String[] { "WorkspaceID", "AssignmentRoot", "DoPublish" }; Object[] paramValues = new Object[] { "__Organization Staging__", assignmentRoot, "true" }; removeAssignmentsNode = xmlDoc.parseString("<Assignments><dataset/></Assignments>"); int datasetNode = XPath.getFirstMatch(".//dataset", null, removeAssignmentsNode); for (TeamAssignment teamAssignment : assignmentsForDelete) { Node.appendToChildren(teamAssignment.getTupleOld(), datasetNode); } sroRemove = new SOAPRequestObject(namespace, methodName, paramNames, paramValues); sroRemove.addParameterAsXml(removeAssignmentsNode); } if (assignmentsToBeAdded) { String namespace = "http://schemas.cordys.com/userassignment/UserAssignmentService/1.0"; String methodName = "AddAssignmentsWithForcePrincipal"; String[] paramNames = new String[] { "WorkspaceID", "AssignmentRoot", "DoPublish", "ForceSetPrincipal" }; Object[] paramValues = new Object[] { "__Organization Staging__", assignmentRoot, "true", "true" }; addAssignmentsNode = xmlDoc.parseString("<Assignments><dataset/></Assignments>"); int datasetNode = XPath.getFirstMatch(".//dataset", null, addAssignmentsNode); for (TeamAssignment teamAssignment : assignmentsForAddition) { Node.appendToChildren(teamAssignment.getTupleNew(), datasetNode); } sroAdd = new SOAPRequestObject(namespace, methodName, paramNames, paramValues); sroAdd.addParameterAsXml(addAssignmentsNode); } if (assignmentsToBeUpdated) { String namespace = "http://schemas.cordys.com/userassignment/UserAssignmentService/1.0"; String methodName = "UpdateAssignmentsWithForcePrincipal"; String[] paramNames = new String[] { "WorkspaceID", "AssignmentRoot", "DoPublish", "ForceSetPrincipal" }; Object[] paramValues = new Object[] { "__Organization Staging__", assignmentRoot, "true", "true" }; updateAssignmentsNode = xmlDoc.parseString("<Assignments><dataset/></Assignments>"); int datasetNode = XPath.getFirstMatch(".//dataset", null, updateAssignmentsNode); for (TeamAssignment teamAssignment : assignmentsForUpdate) { Node.appendToChildren(teamAssignment.getTupleOldNew(), datasetNode); } sroUpdate= new SOAPRequestObject(namespace, methodName, paramNames, paramValues); sroUpdate.addParameterAsXml(updateAssignmentsNode); } if (assignmentsToBeAdded && (assignmentsToBeRemoved || assignmentsToBeUpdated)) { // one soap transaction if (assignmentsToBeUpdated) { sroAdd.chain(sroUpdate); } if (assignmentsToBeRemoved) { sroAdd.chain(sroRemove); } sroAdd.execute(); } else if (assignmentsToBeUpdated && assignmentsToBeRemoved) { // one soap transaction sroUpdate.chain(sroRemove); sroUpdate.execute(); } else if (assignmentsToBeRemoved) { sroRemove.execute(); } else if (assignmentsToBeAdded) { sroAdd.execute(); } else if (assignmentsToBeUpdated) { sroUpdate.execute(); } if (readBackOnUpdate) { // read back the actual content UIUserTeams uiUserTeamsDB = UIUserTeams.getUIUserTeams(orgUserDN); if (uiUserTeamsDB != null) { UIUserTeams.TeamRoles teamRolesDB= uiUserTeamsDB.getTeamRolesObject(); UIUserTeams.TeamRoles teamRolesUpdated = new UIUserTeams.TeamRoles(new BusObjectConfig(teamRolesDB, BusObjectConfig.TRANSIENT_OBJECT)); this.setTeamRolesObject(teamRolesUpdated); this.setPrincipleUnitID(uiUserTeamsDB.getPrincipleUnitID()); } } } catch (Exception e) { throw new UserAdminException("Not able to add/remove teamassignments for " + Util.getNameFromDN(orgUserDN), e); } finally { if (sroRemove != null) { int response = sroRemove.getResult(); if (response > 0) { Node.delete(response); response = 0; } } if (sroAdd != null) { int response = sroAdd.getResult(); if (response > 0) { Node.delete(response); response = 0; } } if (sroUpdate != null) { int response = sroUpdate.getResult(); if (response > 0) { Node.delete(response); response = 0; } } if (removeAssignmentsNode > 0) { Node.delete(removeAssignmentsNode); removeAssignmentsNode = 0; } if (addAssignmentsNode > 0) { Node.delete(addAssignmentsNode); addAssignmentsNode = 0; } if (updateAssignmentsNode > 0) { Node.delete(updateAssignmentsNode); updateAssignmentsNode = 0; } } } } finally { // teamAssignments do wrap NOM xml structures, so cleanup if (existingTeamAssignments != null) { existingTeamAssignments.cleanup(); } // assignmentsForDelete/assignmentsForUpdate: no need to cleanup as those assignment objects are a (sub)set of existingTeamAssignments for (TeamAssignment teamAssignment : assignmentsForAddition) { teamAssignment.cleanup(); } } } public void onDelete() { // N.A. } /** * Inner class for team roles * */ public static class TeamRoles extends UIUserTeams.TeamRolesBase { public TeamRoles() { this((BusObjectConfig)null); } public TeamRoles(BusObjectConfig config) { super(config); } public void onInsert() { // N.A. } public void onUpdate() { // N.A. } public void onDelete() { // N.A. } /** * Inner class for team role * */ public static class TeamRole extends UIUserTeams.TeamRoles.TeamRoleBase { public TeamRole() { this((BusObjectConfig)null); } public TeamRole(BusObjectConfig config) { super(config); } public void onInsert() { // N.A. } public void onUpdate() { // N.A. } public void onDelete() { // N.A. } } } }
[ "karel.ekema@gmail.com" ]
karel.ekema@gmail.com
dbcf0b60aedf018fe609cc5b7cfca136307612db
393eb86a05809b384c74130e9f7dc006942edb88
/java programing/.vscode/Static_Binding.java
5979e0bd24e76a9a0e591a9408bf003a356cbb21
[]
no_license
Imranmalik110/Array
8941dc57c8e349c15d60ce4be340bacf57e9733a
a0727a7a3c02477532a80048067a51fca099b40a
refs/heads/master
2020-07-09T21:00:43.350509
2019-08-26T09:39:50
2019-08-26T09:39:50
204,083,156
0
0
null
null
null
null
UTF-8
Java
false
false
521
java
import java.lang.String; import java.util.Scanner; class Human { static void walk() { System.out.println("Human Walks"); } } class Boy extends Human { static void walk() { System.out.println("Boys Walsk"); } } class Static_Binding { public static void main(String[] args) { Human obj=new Boy(); // obj.walk() ; Reference is human type and object is Boys type Human obj1=new Human(); obj.walk(); obj1.walk(); } }
[ "54458557+Imranmalik110@users.noreply.github.com" ]
54458557+Imranmalik110@users.noreply.github.com
9032ae22462b90d9a1306b722598bae1368bf32c
df05052e50cf6b5e7ee5b5b5abeccf6913458ac1
/AndroidHelloWorld/src/main/java/com/example/android/CarsActivity.java
6680ada3254fc25acc51d86582d233c06221613c
[]
no_license
fi-ubers/client
d636efc73c23f33670edbeabbbb455d18959a30c
ef9d7aadf38e676e33f9af08c389e7441b25c2d6
refs/heads/master
2021-01-19T19:56:53.769114
2017-12-07T03:48:47
2017-12-07T03:48:47
101,213,497
4
0
null
2017-12-01T22:53:40
2017-08-23T18:40:25
Java
UTF-8
Java
false
false
8,709
java
package com.example.android; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.graphics.Color; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.ListView; import android.widget.AdapterView; import android.widget.TextView; import java.util.ArrayList; /** * A list-shaped screen showing the driver's cars. Allows driver to update, delete and add cars. */ public class CarsActivity extends Activity { CarsAdapter adapter; EditText editModel, editNumber; ArrayList<CarInfo> arrayList; ListView listView; /** * Activity onCreate method. */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cars); getActionBar().setDisplayHomeAsUpEnabled(true); listView = (ListView) findViewById(R.id.listv); arrayList = UserInfo.getInstance().getCars(); adapter = new CarsAdapter(this, R.layout.cars_item, arrayList); listView.setAdapter(adapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // Show input box showInputBox(arrayList.get(position).getModel(), arrayList.get(position).getNumber(), position); } }); editModel = (EditText) findViewById(R.id.inputModel); editNumber = (EditText) findViewById(R.id.inputNumber); Button btAdd = (Button) findViewById(R.id.btAdd); btAdd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String newModel = editModel.getText().toString(); String newNumber = editNumber.getText().toString(); // Add new item to arraylist // Must first POST to app-server UserInfo ui = UserInfo.getInstance(); try { CarsHandler carHandler = new CarsHandler(); ConexionRest conn = new ConexionRest(carHandler); String carsUrl = conn.getBaseUrl() + "/users/" + Integer.toString(ui.getIntegerId()); carsUrl = carsUrl + "/cars"; Log.d("CarsActivity", "URL to PUT: " + carsUrl); // Next step ugly String toSendJson = "{ \"name\": \"" + newModel + "\", \"value\": \"" + newNumber + "\" }"; Log.d("CarsActivity", "JSON to send (POST car): " + toSendJson); conn.generatePost(toSendJson, carsUrl, null); } catch(Exception e){ Log.e("CarsActivity", "Sunmitting PUT error: ", e); } editModel.setText(""); editNumber.setText(""); } }); } /** * Overrided method for returning to parent {@link Activity}. * @param item {@link MenuItem} clicked on {@link android.app.ActionBar} */ @Override public boolean onOptionsItemSelected(MenuItem item){ Log.d("ProfileActivity", "Back button pressed on actionBar"); ActivityChanger.getInstance().gotoActivity(CarsActivity.this, ProfileActivity.class); finish(); return true; } /** * Shows a dialog input box with a selected car data at listView index position. * It is used for updating the car's model and number. * @param oldModel Model of the car before data updating * @param oldNumber Number of the car before data updating * @param index Position of the selected car in arrayList */ public void showInputBox(String oldModel, String oldNumber, final int index){ final Dialog dialog = new Dialog(CarsActivity.this); dialog.setTitle("Update your car data"); dialog.setContentView(R.layout.cars_input_box); TextView txtMessage=(TextView)dialog.findViewById(R.id.txtmessage); txtMessage.setText("Change your data"); txtMessage.setTextColor(Color.parseColor("#ff2222")); final EditText editModel = (EditText)dialog.findViewById(R.id.carModel); final EditText editNumber = (EditText)dialog.findViewById(R.id.carNumber); editModel.setText(oldModel); editNumber.setText(oldNumber); // Edit car Button bt=(Button)dialog.findViewById(R.id.btdone); bt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String carModel = editModel.getText().toString(); String carNumber = editNumber.getText().toString(); int carId = arrayList.get(index).getId(); // PUT changes to app-server CarInfo carModified = new CarInfo(carModel, carNumber, carId); arrayList.set(index, carModified); UserInfo ui = UserInfo.getInstance(); try { ConexionRest conn = new ConexionRest(null); String carsUrl = conn.getBaseUrl() + "/users/" + Integer.toString(ui.getIntegerId()); carsUrl = carsUrl + "/cars/"; carsUrl = carsUrl + Integer.toString(carId); Log.d("CarsActivity", "URL to PUT: " + carsUrl); Jsonator jnator = new Jsonator(); String toSendJson = jnator.writeCarInfo(carModified); Log.d("CarsActivity", "JSON to send (PUT car): " + toSendJson); conn.generatePut(toSendJson, carsUrl, null); } catch(Exception e){ Log.e("CarsActivity", "Submitting PUT error: ", e); } adapter.notifyDataSetChanged(); dialog.dismiss(); } }); Button btDel=(Button)dialog.findViewById(R.id.btdelCar); btDel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String carModel = editModel.getText().toString(); String carNumber = editNumber.getText().toString(); int carId = arrayList.get(index).getId(); // Remove car from list and DELETE via app-server UserInfo ui = UserInfo.getInstance(); try { ConexionRest conn = new ConexionRest(null); String carsUrl = conn.getBaseUrl() + "/users/" + Integer.toString(ui.getIntegerId()); carsUrl = carsUrl + "/cars/"; carsUrl = carsUrl + Integer.toString(carId); Log.d("CarsActivity", "URL to DELETE car: " + carsUrl); conn.generateDelete(carsUrl, null); } catch(Exception e){ Log.e("CarsActivity", "Submitting DELETE error: ", e); } arrayList.remove(index); adapter.notifyDataSetChanged(); dialog.dismiss(); } }); dialog.show(); } // ------------------------------------------------------------------------------------- /** * A {@link ListView} adapter based on {@link ArrayAdapter}, specifically made for * the various driver's {@link CarInfo}. */ public class CarsAdapter extends ArrayAdapter<CarInfo>{ Context context; int layoutResourceId; ArrayList<CarInfo> data = null; /** * Class constructor. * @param context Current {@link Context} for this adapter * @param layoutResourceId Integer id of an {@link ImageView} to use as bullet in the list * @param data {@link CarInfo} list of driver's cars */ public CarsAdapter(Context context, int layoutResourceId, ArrayList<CarInfo> data) { super(context, layoutResourceId, data); this.layoutResourceId = layoutResourceId; this.context = context; this.data = data; } /** * Overrided getView method (inflates and populates {@link ListView}). */ @Override public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; CarHolder holder = null; if(row == null) { LayoutInflater inflater = ((Activity)context).getLayoutInflater(); row = inflater.inflate(layoutResourceId, parent, false); holder = new CarHolder(); holder.imgIcon = (ImageView) row.findViewById(R.id.carIcon); holder.txtTitle = (TextView)row.findViewById(R.id.txtitem); row.setTag(holder); } else { holder = (CarHolder)row.getTag(); } CarInfo car = data.get(position); holder.txtTitle.setText(car.getModel() + " - " + car.getNumber()); return row; } /** * Auxiliar class to hold {@link CarInfo} data. */ public class CarHolder { ImageView imgIcon; TextView txtTitle; } } // --------------------------------------------------------------------------------------- /** * A class for handling app-server responses for cars POST. */ public class CarsHandler implements RestUpdate{ /** * Class default constructor. */ public CarsHandler(){ } /** * Checks if the driver could POST their new car, and adds the respective * {@link CarInfo} to arrayList. * @param servResponse The app-server's response to the sign up request */ @Override public void executeUpdate(String servResponse) { Jsonator jnator = new Jsonator(); CarInfo newCar = jnator.readCarInfo(servResponse, true); if(newCar == null) return; // notify listview of data changed arrayList.add(newCar); adapter.notifyDataSetChanged(); return; } } }
[ "alemgarcia95@gmail.com" ]
alemgarcia95@gmail.com
2db81e2cbef7ba610a3c830cf67c21da1c075e35
fe84d7c5f90eb06f973c2991cd401a22a1b87076
/java/com/scnu/factory/EllipseConstructor.java
24e67efb96ce68485f59a4b28605d50ccb79a99c
[]
no_license
MorvenLee/SVGSymbolMaker
4ec3bbe1c382751357c490ea78c34983ee21d9b0
458519cbe87cb24baa73a1e0e28cb61ca8c43a0c
refs/heads/master
2016-09-05T21:53:22.592915
2014-12-23T17:07:26
2014-12-23T17:07:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,788
java
package com.scnu.factory; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.scnu.shapes.Ellipse; import com.scnu.shapes.Shape; import com.scnu.shapes.Style; public class EllipseConstructor implements BasicShapeConstructor{ private static Logger logger = LoggerFactory.getLogger(EllipseConstructor.class); @Override public String creat(Shape shape) { logger.info("ellipse constructor working..."); Ellipse ellipseToCreat = (Ellipse) shape; Document doc = DocumentHelper.createDocument(); Element root = doc.addElement("ellipse "); root.addAttribute("cx", Double.toString(ellipseToCreat.getCenterX())); root.addAttribute("cy", Double.toString(ellipseToCreat.getCenterY())); root.addAttribute("rx", Double.toString(ellipseToCreat.getSemiAxisX())); root.addAttribute("ry", Double.toString(ellipseToCreat.getCenterY())); StringBuffer styleStr = new StringBuffer(); Style style = ellipseToCreat.getStyle(); if(style != null){ if(style.getStrokeColor() != null && !(style.getStrokeColor().equals(""))){ styleStr.append("stroke:").append(style.getStrokeColor()).append(";"); } if(style.getStrokeWidth() >= 1){ styleStr.append("stroke-width:").append(style.getStrokeWidth()).append(";"); } if(style.getFillColor() != null && !style.getFillColor().equals("")){ styleStr.append("fill:").append(style.getFillColor()).append(";"); } root.addAttribute("style", styleStr.toString()); } // 描边色渐变 // sample: <animate attributeType="CSS" attributeName="stroke" // from="red" to="green" dur="3s" restart="always" repeatCount="3"></animate> if(ellipseToCreat.getDp().getStrokeColorFrom() !=null && !ellipseToCreat.getDp().getStrokeColorFrom().equals("") && ellipseToCreat.getDp().getStrokeColorTo() !=null && !ellipseToCreat.getDp().getStrokeColorTo().equals("") && ellipseToCreat.getDp().getStrokeColorDurations() > 0 ){ Element animate = root.addElement("animate"); animate.addAttribute("attributeType", "CSS"); animate.addAttribute("attributeName", "stroke"); animate.addAttribute("from", ellipseToCreat.getDp().getStrokeColorFrom()); animate.addAttribute("to", ellipseToCreat.getDp().getStrokeColorTo()); animate.addAttribute("dur", Double.toString(ellipseToCreat.getDp().getStrokeColorDurations())); animate.addAttribute("restart", "always"); animate.addAttribute("repeatCount", "indefinite"); } // 填充色渐变 // sample: <animate attributeType="CSS" attributeName="fill" // from="red" to="green" dur="3s" restart="always" repeatCount="3"></animate> if(ellipseToCreat.getDp().getFillColorFrom() !=null && !ellipseToCreat.getDp().getFillColorFrom().equals("") && ellipseToCreat.getDp().getFillColorTo() !=null && !ellipseToCreat.getDp().getFillColorTo().equals("") && ellipseToCreat.getDp().getFillColorDurations() > 0 ){ Element animate = root.addElement("animate"); animate.addAttribute("attributeType", "CSS"); animate.addAttribute("attributeName", "fill"); animate.addAttribute("from", ellipseToCreat.getDp().getFillColorFrom()); animate.addAttribute("to", ellipseToCreat.getDp().getFillColorTo()); animate.addAttribute("dur", Double.toString(ellipseToCreat.getDp().getFillColorDurations())); animate.addAttribute("restart", "always"); animate.addAttribute("repeatCount", "indefinite"); } // 路径解析 // sample:<animateMotion path="M10,80 q100,120 120,20 q140,-50 160,0" // begin="0s" dur="3s" repeatCount="indefinite"/> if (ellipseToCreat.getDp().getPath() != null && !ellipseToCreat.getDp().getPath().equals("")) { Element animateMotion = root.addElement("animateMotion"); animateMotion.addAttribute("path", ellipseToCreat.getDp().getPath()); animateMotion.addAttribute("begin", "0s"); animateMotion.addAttribute("dur", Integer.toString(ellipseToCreat.getDp().getPathDurations()) + "s"); animateMotion.addAttribute("repeatCount", "indefinite"); } // 缩放解析 // sample:<animateTransform attributeName="transform" begin="0s" dur="3s" type="scale" from="1" to="3" repeatCount="indefinite"/> if (ellipseToCreat.getDp().getScaleX() > 0.0 && ellipseToCreat.getDp().getScaleY() > 0.0 && ellipseToCreat.getDp().getScaleDurations() > 0) { Element animateMotion = root.addElement("animateTransform"); animateMotion.addAttribute("attributeName", "transform"); animateMotion.addAttribute("type", "scale"); animateMotion.addAttribute("dur", Integer.toString(ellipseToCreat.getDp().getScaleDurations()) + "s"); animateMotion.addAttribute("from", "1"); animateMotion.addAttribute("to", Double.toString(ellipseToCreat.getDp().getScaleX()) +"s"); animateMotion.addAttribute("repeatCount", "indefinite"); } // 旋转解析 // sample:<animateTransform attributeName="transform" begin="0s" dur="3s" type="rotate" from="0" to="10" repeatCount="indefinite"/> if (ellipseToCreat.getDp().getRotateCenterX()>0.0 && ellipseToCreat.getDp().getRotateCenterY()>0.0 && ellipseToCreat.getDp().getRotateAngel()>0 && ellipseToCreat.getDp().getRotateDurations()>0) { Element animateMotion = root.addElement("animateTransform"); animateMotion.addAttribute("attributeName", "transform"); animateMotion.addAttribute("type", "rotate"); animateMotion.addAttribute("dur", Integer.toString(ellipseToCreat.getDp().getRotateDurations()) + "s"); animateMotion.addAttribute("from", "0"); animateMotion.addAttribute("to", Double.toString(ellipseToCreat.getDp().getRotateAngel())); animateMotion.addAttribute("repeatCount", "indefinite"); } return doc.asXML(); } }
[ "leads200866.lmf@163.com" ]
leads200866.lmf@163.com
f0e3a2f360c0400e25abb0ae08e04f9f628a36f2
65d8be36d651c76e023174d7ab08ab29d23fa4ba
/IdeaProjects/Sistema-de-Gerenciamento/src/com/company/user/student/PhDStudent.java
5d62a2996b0d2191464db8666bb2aacd20d4298b
[ "MIT" ]
permissive
NelsonGomesNeto/Projeto-de-Software-P3
07d1d7b8ec3dc682e309f133846a120aa1502367
cc3e2065e36561252ba9d78474185447092d45df
refs/heads/master
2021-01-01T17:53:58.012570
2017-09-17T15:19:58
2017-09-17T15:19:58
98,192,504
1
0
null
null
null
null
UTF-8
Java
false
false
311
java
package com.company.user.student; import com.company.user.User; public class PhDStudent extends StudentDecorator { public PhDStudent(User decoratedUser) { super(decoratedUser); } @Override public String toString() { return decoratedUser.toString() + ", PhD Student"; } }
[ "ngn@ic.ufal.br" ]
ngn@ic.ufal.br
d2ba31702dcf8f969bb558f24d855c999d27baf9
1b94f6b80b13586e6d228e75019e004958519425
/src/main/java/org/web3d/x3d/sai/MFNode.java
bbfbc7861a703bda9a820563b6831883cf99655a
[]
no_license
linghushaoxia/X3DJSAIL
65a4c3fe384e56ef8c161f6e52c9bf400083c6ba
e34bde3957fd3173c52a032b9907502dd4a0971f
refs/heads/master
2021-01-23T12:21:24.328704
2017-06-02T10:58:35
2017-06-02T10:58:35
93,152,265
0
0
null
null
null
null
UTF-8
Java
false
false
5,039
java
/* Copyright (c) 1995-2017 held by the author(s). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Web3D Consortium (http://www.web3D.org) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.web3d.x3d.sai; import org.web3d.x3d.sai.Core.X3DNode; import org.web3d.x3d.sai.Core.*; // making sure #0 /** * The MFNode field specifies zero or more nodes; the default value of an MFNode field is the empty list. * * <br><br> * <br> * <i>Package hint:</i> This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI). * * @author Don Brutzman and Roy Walmsley * @see <a href="http://www.web3d.org/documents/specifications/19777-2/V3.0/Part2/abstracts.html#MFNode" target="_blank">SAI Java Specification: B.4.30</a> * @see <a href="http://www.web3d.org/documents/specifications/19775-2/V3.3/Part02/dataRef.html#SAINode" target="blank">SAI Abstract Specification: 5.2.22 SAINode</a> * @see <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/fieldsDef.html#SFNodeAndMFNode" target="blank">X3D Abstract Specification: 5.3.12 SFNode and MFNode</a> * @see <a href="http://www.web3d.org/x3d/tooltips/X3dTooltips.html" target="_blank">X3D Tooltips</a> * @see <a href="http://www.web3d.org/x3d/tooltips/X3dTooltips.html#field" target="_blank">X3D Tooltips: field</a> * @see <a href="http://www.web3d.org/x3d/tooltips/X3dTooltips.html#fieldValue" target="_blank">X3D Tooltips: fieldValue</a> * @see <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a> */ public interface MFNode extends MField { /** * Write the current value of the field out to the provided copiedNodes array. * * @param copiedNodes The array to be filled in with current field values. * @throws ArrayIndexOutOfBoundsException The provided copiedNodes array was too small */ public void getValue(X3DNode[] copiedNodes); /** * <p> * Get an individual value from the existing field array. * </p> * <p> * If the index is outside the bounds of the current array of data values, * an ArrayIndexOutOfBoundsException is thrown. * </p> * @param index is position of selected value in current array * @return The selected value * @throws ArrayIndexOutOfBoundsException The index was outside of the bounds of the current array. */ public X3DNode get1Value(int index); /** * Assign an array subset to this field. * @param size indicates size of result to copy (i.e. the number of typed singleton values) from beginning of newValue array. * @param newValue The replacement value array to (potentially) slice and then assign. */ public void setValue(int size, X3DNode[] newValue); /** * Replace a single value at the appropriate location in the existing value array. * Size of the current underlying value array does not change. * @param imageIndex the index of the selected image * @param newValue provides new value to apply */ public void set1Value(int imageIndex, X3DNode newValue); /** * Places a new value at the end of the existing value array, increasing the field length accordingly. * @param newValue The newValue to append */ public void append(X3DNode newValue); /** * Insert a new value prior to the imageIndex location in the existing value array, increasing the field length accordingly. * @param imageIndex the index of the selected image * @param newValue The newValue to insert */ public void insertValue(int imageIndex, X3DNode newValue); }
[ "linghushaoxialove@163.com" ]
linghushaoxialove@163.com
f06f37c95c33bc4465250d415fdbbd489be49f11
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project23/src/test/java/org/gradle/test/performance/largejavamultiproject/project23/p115/Test2314.java
db6abc375f93872c6ee467c34d4c7391886c9068
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,108
java
package org.gradle.test.performance.largejavamultiproject.project23.p115; import org.junit.Test; import static org.junit.Assert.*; public class Test2314 { Production2314 objectUnderTest = new Production2314(); @Test public void testProperty0() { String value = "value"; objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { String value = "value"; objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { String value = "value"; objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
bf01ad45b2a9b7a0211afe34c533816e30071889
d2a63ceca83d07ce6509d1d44d667b6953258bb1
/src/zig/zak/media/tor/search/youtube/jd/Request.java
d1a1987e333a8333ce5044922860de7d06e95166
[]
no_license
alpha97/MediaTor
626a3addaa0f580c9d69e7400b7cfac6ab1f0510
6eb03c0333bb74a36968d88b535ad01196da6fcc
refs/heads/master
2020-09-03T03:53:34.374638
2019-09-08T15:54:21
2019-09-08T15:54:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,674
java
// jDownloader - Downloadmanager // Copyright (C) 2008 JD-Team support@jdownloader.org // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package zig.zak.media.tor.search.youtube.jd; //import java.awt.Image; //import java.awt.image.BufferedImage; //import java.io.ByteArrayInputStream; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.CharacterCodingException; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.regex.Pattern; //import javax.imageio.ImageIO; import org.apache.commons.lang3.StringUtils; import zig.zak.media.tor.search.youtube.jd.ReusableByteArrayOutputStreamPool.ReusableByteArrayOutputStream; public abstract class Request { // public static int MAX_REDIRECTS = 30; public static String getCookieString(final Cookies cookies) { if (cookies == null || cookies.isEmpty()) { return null; } final StringBuilder buffer = new StringBuilder(); boolean first = true; final LinkedList<Cookie> cookies2 = new LinkedList<Cookie>(cookies.getCookies()); for (final Cookie cookie : cookies2) { // Pfade sollten verarbeitet werden...TODO if (cookie.isExpired()) { continue; } if (first) { first = false; } else { buffer.append("; "); } buffer.append(cookie.getKey()); buffer.append("="); buffer.append(cookie.getValue()); } return buffer.toString(); } /** * Gibt eine Hashmap mit allen key:value pairs im query zurück * * @param query * kann ein reines query ein (&key=value) oder eine url mit query * @return * @throws MalformedURLException */ public static LinkedHashMap<String, String> parseQuery(String query) throws MalformedURLException { if (query == null) { return null; } final LinkedHashMap<String, String> ret = new LinkedHashMap<String, String>(); if (query.toLowerCase().trim().startsWith("http")) { query = new URL(query).getQuery(); } if (query == null) { return ret; } final String[][] split = new Regex(query.trim(), "&?(.*?)=(.*?)($|&(?=.*?=.+))").getMatches(); if (split != null) { for (String[] aSplit : split) { ret.put(aSplit[0], aSplit[1]); } } return ret; } public static byte[] read(final HTTPConnectionImpl con) throws IOException { final InputStream is = con.getInputStream(); byte[] ret = null; if (is == null) { // TODO: check if we have t close con here return null; } ReusableByteArrayOutputStream tmpOut; ReusableByteArrayOutputStream tmpOut2 = ReusableByteArrayOutputStreamPool.getReusableByteArrayOutputStream(1048); final long contentLength = con.getLongContentLength(); if (contentLength != -1) { final int length = contentLength > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) contentLength; tmpOut = ReusableByteArrayOutputStreamPool.getReusableByteArrayOutputStream(length); } else { tmpOut = ReusableByteArrayOutputStreamPool.getReusableByteArrayOutputStream(16384); } boolean okay = false; /* added "Corrupt GZIP trailer" for CamWinsCom */ try { int len; while ((len = is.read(tmpOut2.getInternalBuffer())) != -1) { if (len > 0) { tmpOut.write(tmpOut2.getInternalBuffer(), 0, len); } } okay = true; } catch (final EOFException e) { e.printStackTrace(); okay = true; } catch (final IOException e) { if (e.toString().contains("end of ZLIB") || e.toString().contains("Premature") || e.toString().contains("Corrupt GZIP trailer")) { //System.out.println("Try workaround for " + e); okay = true; } else { throw e; } } finally { try { is.close(); } catch (final Exception e) { } try { /* disconnect connection */ con.disconnect(); } catch (final Exception e) { } ReusableByteArrayOutputStreamPool.reuseReusableByteArrayOutputStream(tmpOut2); if (okay) { ret = tmpOut.toByteArray(); } ReusableByteArrayOutputStreamPool.reuseReusableByteArrayOutputStream(tmpOut); tmpOut = null; tmpOut2 = null; } return ret; } /* * default timeouts, because 0 is infinite and BAD, if we need 0 then we have to set it manually */ private int connectTimeout = 30000; private int readTimeout = 60000; private Cookies cookies = null; private RequestHeader headers; private String htmlCode; protected HTTPConnectionImpl httpConnection; private long readTime = -1; protected boolean requested = false; private String orgURL; private String customCharset = null; private byte[] byteArray = null; //private BufferedImage image; private boolean contentDecoded = true; public Request(final String url) throws MalformedURLException { this.orgURL = Browser.correctURL(url); this.initDefaultHeader(); } public Request(final HTTPConnectionImpl con) { this.httpConnection = con; this.collectCookiesFromConnection(); } private void collectCookiesFromConnection() { final List<String> cookieHeaders = this.httpConnection.getHeaderFields("Set-Cookie"); if (cookieHeaders == null || cookieHeaders.size() == 0) { return; } final String date = this.httpConnection.getHeaderField("Date"); final String host = Browser.getHost(this.httpConnection.getURL()); for (final String header : cookieHeaders) { this.getCookies().add(Cookies.parseCookies(header, host, date)); } } /** * DO NEVER call this method directly... use browser.connect */ protected Request connect() throws IOException { try { this.openConnection(); this.postRequest(); /* * we connect to inputstream to make sure the response headers are getting parsed first */ this.httpConnection.finalizeConnect(); try { this.collectCookiesFromConnection(); } catch (final NullPointerException e) { throw new IOException("Malformed url?" + e.toString()); } } finally { this.requested = true; } return this; } public void disconnect() { try { this.httpConnection.disconnect(); } catch (final Throwable e) { } } public String getCharsetFromMetaTags() { String parseFrom = null; if (this.htmlCode == null && this.byteArray != null) { parseFrom = new String(this.byteArray); } else if (this.htmlCode != null) { parseFrom = this.htmlCode; } if (parseFrom == null) { return null; } String charSetMetaTag = new Regex(parseFrom, "http-equiv=\"Content-Type\"[^<>]+content=\"[^\"]+charset=(.*?)\"").getMatch(0); if (charSetMetaTag == null) { charSetMetaTag = new Regex(parseFrom, "meta charset=\"(.*?)\"").getMatch(0); } return charSetMetaTag; } public int getConnectTimeout() { return this.connectTimeout; } public long getContentLength() { return this.httpConnection == null ? -1 : this.httpConnection.getLongContentLength(); } public Cookies getCookies() { if (this.cookies == null) { this.cookies = new Cookies(); } return this.cookies; } public String getCookieString() { return Request.getCookieString(this.cookies); } public RequestHeader getHeaders() { return this.headers; } public String getHtmlCode() throws CharacterCodingException { final String ct = this.httpConnection.getContentType(); /* check for image content type */ if (ct != null && Pattern.compile("images?/\\w*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL).matcher(ct).matches()) { throw new IllegalStateException("Content-Type: " + ct); } if (this.htmlCode == null && this.byteArray != null) { /* use custom charset or charset from httpconnection */ String useCS = this.customCharset == null ? this.httpConnection.getCharset() : this.customCharset; if (useCS == null) { useCS = this.getCharsetFromMetaTags(); } try { try { try { if (useCS != null) { /* try to use wanted charset */ this.htmlCode = new String(this.byteArray, useCS.toUpperCase()); return this.htmlCode; } } catch (final Exception e) { } this.htmlCode = new String(this.byteArray, "ISO-8859-1"); return this.htmlCode; } catch (final Exception e) { //System.out.println("could neither charset: " + useCS + " nor default charset"); /* fallback to default charset in error case */ this.htmlCode = new String(this.byteArray); return this.htmlCode; } } catch (final Exception e) { /* in case of error we do not reset byteArray */ } } return this.htmlCode; } protected String getHTMLSource() { if (!this.requested) { return "Request not sent yet"; } try { this.getHtmlCode(); if (this.htmlCode == null || this.htmlCode.length() == 0) { if (this.getLocation() != null) { return "Not HTML Code. Redirect to: " + this.getLocation(); } return "No htmlCode read"; } } catch (final Exception e) { return "NOTEXT: " + e.getMessage(); } return this.htmlCode; } public HTTPConnectionImpl getHttpConnection() { return this.httpConnection; } public String getLocation() { if (this.httpConnection == null) { return null; } String red = this.httpConnection.getHeaderField("Location"); if (StringUtils.isEmpty(StringUtils.trim(red))) { /* check if we have an old-school refresh header */ red = this.httpConnection.getHeaderField("refresh"); if (red != null) { // we need to filter the time count from the url red = new Regex(red, "url=(.+);?").getMatch(0); } if (StringUtils.isEmpty(StringUtils.trim(red))) { return null; } } final String encoding = this.httpConnection.getHeaderField("Content-Type"); if (encoding != null && encoding.contains("UTF-8")) { red = Encoding.UTF8Decode(red, "ISO-8859-1"); } try { new URL(red); } catch (final Exception e) { String path = this.getHttpConnection().getURL().getFile(); if (!path.endsWith("/")) { /* * path does not end with / we have to find latest valid path * * \/test.rar should result in empty path * * \/test/test.rar should result in \/test/ */ final String validPath = new Regex(path, "(/.*?/.*?)(\\?|$)").getMatch(0); if (validPath != null && validPath.length() > 0) { path = validPath; } else { path = ""; } } final int port = this.getHttpConnection().getURL().getPort(); final int defaultport = this.getHttpConnection().getURL().getDefaultPort(); String proto = "http://"; if (this.getHttpConnection().getURL().toString().startsWith("https")) { proto = "https://"; } String addPort = ""; if (defaultport > 0 && port > 0 && defaultport != port) { addPort = ":" + port; } red = proto + this.getHttpConnection().getURL().getHost() + addPort + (red.charAt(0) == '/' ? red : path + "/" + red); } return Browser.correctURL(Encoding.urlEncode_light(red)); } /** * tries to generate an image out of the loaded bytes * * @return */ // public Image getResponseImage() { // final String ct = this.httpConnection.getContentType(); // /* check for image content */ // if (ct != null && !Pattern.compile("images?/\\w*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL).matcher(ct).matches()) { throw new IllegalStateException("Content-Type: " + ct); } // // TODO..this is just quick and dirty.. may result in memory leaks // if (this.image == null && this.byteArray != null) { // final InputStream fake = new ByteArrayInputStream(this.byteArray); // try { // this.image = ImageIO.read(fake); // } catch (final Exception e) { // e.printStackTrace(); // } // } // return this.image; // } /** * Will replace #getHtmlCode() with next release */ public String getResponseText() throws CharacterCodingException { return this.getHtmlCode(); } public String getUrl() { return this.orgURL; } protected boolean hasCookies() { return this.cookies != null && !this.cookies.isEmpty(); } protected void initDefaultHeader() { this.headers = new RequestHeader(); this.headers.put("User-Agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10"); this.headers.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); this.headers.put("Accept-Language", "de, en-gb;q=0.9, en;q=0.8"); this.headers.put("Accept-Encoding", "gzip"); this.headers.put("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.3"); this.headers.put("Cache-Control", "no-cache"); this.headers.put("Pragma", "no-cache"); this.headers.put("Connection", "close"); } public boolean isContentDecoded() { return this.httpConnection == null ? this.contentDecoded : this.httpConnection.isContentDecoded(); } public boolean isRequested() { return this.requested; } private void openConnection() throws IOException { this.httpConnection = new HTTPConnectionImpl(new URL(this.orgURL)); this.httpConnection.setRequest(this); this.httpConnection.setReadTimeout(this.readTimeout); this.httpConnection.setConnectTimeout(this.connectTimeout); this.httpConnection.setContentDecoded(this.contentDecoded); if (this.headers != null) { final int headersSize = this.headers.size(); for (int i = 0; i < headersSize; i++) { this.httpConnection.setRequestProperty(this.headers.getKey(i), this.headers.getValue(i)); } } this.preRequest(); if (this.hasCookies()) { final String cookieString = this.getCookieString(); if (cookieString != null) { this.httpConnection.setRequestProperty("Cookie", cookieString); } } } abstract public long postRequest() throws IOException; abstract public void preRequest() throws IOException; public String printHeaders() { return this.httpConnection.toString(); } public Request read() throws IOException { final long tima = System.currentTimeMillis(); this.httpConnection.setCharset(this.customCharset); this.byteArray = Request.read(this.httpConnection); this.readTime = System.currentTimeMillis() - tima; return this; } public void setConnectTimeout(final int connectTimeout) { this.connectTimeout = connectTimeout; } public void setContentDecoded(final boolean c) { this.contentDecoded = c; } public void setCookies(final Cookies cookies) { this.cookies = cookies; } public void setCustomCharset(final String charset) { this.customCharset = charset; } /** * DO NOT USE in 09581 Stable */ public void setHeaders(final RequestHeader headers) { this.headers = headers; } public void setReadTimeout(final int readTimeout) { this.readTimeout = readTimeout; final HTTPConnectionImpl con = this.httpConnection; if (con != null) { con.setReadTimeout(readTimeout); } } // @Override @Override public String toString() { if (!this.requested) { return "Request not sent yet"; } final StringBuilder sb = new StringBuilder(); try { sb.append(this.httpConnection.toString()); sb.append("\r\n"); this.getHtmlCode(); sb.append(this.getHTMLSource()); } catch (final Exception e) { return "NOTEXT: " + e.getMessage(); } return sb.toString(); } }
[ "kayrat@bk.ru" ]
kayrat@bk.ru
169c75b7185ef487f2ceec753229a9b8f108b28f
f393be3b18ac2a87ea859cac5a5a07f2a9525c16
/test/com/facebook/buck/core/model/targetgraph/raw/UnconfiguredTargetNodeWithDepsPackageTest.java
72ae0ddf3697f87e936d87d02b280a93a396aad2
[ "Apache-2.0" ]
permissive
blubfoo/buck
976890da6ae3b4850b149213badaea9cc24fc5ed
45955d18b4155c4e87be3a89707fcfb1411c806a
refs/heads/master
2023-01-13T02:06:23.501307
2019-10-22T04:18:52
2019-10-22T05:39:25
216,879,969
0
1
Apache-2.0
2022-12-24T05:44:05
2019-10-22T18:12:41
null
UTF-8
Java
false
false
5,194
java
/* * Copyright 2018-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.core.model.targetgraph.raw; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import com.facebook.buck.core.model.CanonicalCellName; import com.facebook.buck.core.model.ImmutableUnconfiguredBuildTarget; import com.facebook.buck.core.model.RuleType; import com.facebook.buck.core.model.UnconfiguredBuildTarget; import com.facebook.buck.core.model.targetgraph.impl.ImmutableUnconfiguredTargetNode; import com.facebook.buck.parser.exceptions.ImmutableParsingError; import com.facebook.buck.parser.exceptions.ParsingError; import com.facebook.buck.util.json.ObjectMappers; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.io.IOException; import java.nio.file.Paths; import org.junit.Test; public class UnconfiguredTargetNodeWithDepsPackageTest { private UnconfiguredTargetNodeWithDepsPackage getData() { ImmutableMap<String, Object> rawAttributes1 = ImmutableMap.of( "name", "target1", "buck.type", "java_library", "buck.base_path", "base", "deps", ImmutableSet.of(":target2")); UnconfiguredBuildTarget unconfiguredBuildTarget1 = ImmutableUnconfiguredBuildTarget.of( CanonicalCellName.rootCell(), "//base", "target1", UnconfiguredBuildTarget.NO_FLAVORS); UnconfiguredTargetNode unconfiguredTargetNode1 = ImmutableUnconfiguredTargetNode.of( unconfiguredBuildTarget1, RuleType.of("java_library", RuleType.Kind.BUILD), rawAttributes1, ImmutableSet.of(), ImmutableSet.of()); ImmutableMap<String, Object> rawAttributes2 = ImmutableMap.of("name", "target2", "buck.type", "java_library", "buck.base_path", "base"); UnconfiguredBuildTarget unconfiguredBuildTarget2 = ImmutableUnconfiguredBuildTarget.of( CanonicalCellName.rootCell(), "//base", "target2", UnconfiguredBuildTarget.NO_FLAVORS); UnconfiguredTargetNode unconfiguredTargetNode2 = ImmutableUnconfiguredTargetNode.of( unconfiguredBuildTarget2, RuleType.of("java_library", RuleType.Kind.BUILD), rawAttributes2, ImmutableSet.of(), ImmutableSet.of()); UnconfiguredTargetNodeWithDeps unconfiguredTargetNodeWithDeps1 = ImmutableUnconfiguredTargetNodeWithDeps.of( unconfiguredTargetNode1, ImmutableSet.of(unconfiguredBuildTarget2)); UnconfiguredTargetNodeWithDeps unconfiguredTargetNodeWithDeps2 = ImmutableUnconfiguredTargetNodeWithDeps.of(unconfiguredTargetNode2, ImmutableSet.of()); ParsingError error = ImmutableParsingError.of("error1", ImmutableList.of("stacktrace1")); return new ImmutableUnconfiguredTargetNodeWithDepsPackage( Paths.get("base"), ImmutableMap.of( "target1", unconfiguredTargetNodeWithDeps1, "target2", unconfiguredTargetNodeWithDeps2), ImmutableList.of(error), ImmutableSet.of(Paths.get("test1.bzl"), Paths.get("test2.bzl"))); } @Test public void canSerializeAndDeserializeJson() throws IOException { UnconfiguredTargetNodeWithDepsPackage unconfiguredTargetNodeWithDepsPackage = getData(); byte[] data = ObjectMappers.WRITER_WITH_TYPE.writeValueAsBytes(unconfiguredTargetNodeWithDepsPackage); UnconfiguredTargetNodeWithDepsPackage unconfiguredTargetNodeWithDepsPackageDeserialized = ObjectMappers.READER_WITH_TYPE .forType(ImmutableUnconfiguredTargetNodeWithDepsPackage.class) .readValue(data); assertEquals( unconfiguredTargetNodeWithDepsPackage, unconfiguredTargetNodeWithDepsPackageDeserialized); } @Test public void canSerializeWithoutTypeAndFlatten() throws IOException { UnconfiguredTargetNodeWithDepsPackage unconfiguredTargetNodeWithDepsPackage = getData(); String data = ObjectMappers.WRITER.writeValueAsString(unconfiguredTargetNodeWithDepsPackage); ObjectMapper mapper = new ObjectMapper(); JsonNode node = mapper.readTree(data); // Validate property from UnconfiguredTargetNode ("buildTarget") is flattened so it is at the // same level // as non-flattened property ("deps") assertNotNull(node.get("nodes").get("target1").get("buildTarget")); assertNotNull(node.get("nodes").get("target1").get("deps")); } }
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
c795f7eef15f050dec60f7b3943626c9d47943e0
317cb97af3188aa11cbcff0a9de37b8a0c528d3e
/NewExperiment/ManuCheck/elasticsearch/0.1/refactor112/newCloneFile1.txt
133043f51cd86cd531b7beed7989f71627d43c6d
[]
no_license
pldesei/CloneRefactoring
cea58e06abfcf049da331d7bf332dd05278dbafc
c989422ea3aab79b4b87a270d7ab948307569f11
refs/heads/master
2021-01-19T17:37:29.938335
2018-07-11T02:56:29
2018-07-11T02:56:29
101,065,962
0
0
null
null
null
null
UTF-8
Java
false
false
8,399
txt
/* * Licensed to ElasticSearch and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. ElasticSearch 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.elasticsearch.index.fielddata.plain; import gnu.trove.iterator.TIntIterator; import gnu.trove.list.array.TIntArrayList; import org.apache.lucene.index.AtomicReader; import org.apache.lucene.index.AtomicReaderContext; import org.apache.lucene.index.Terms; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefIterator; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.NumericUtils; import org.elasticsearch.ElasticSearchException; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.Index; import org.elasticsearch.index.fielddata.*; import org.elasticsearch.index.fielddata.fieldcomparator.IntValuesComparatorSource; import org.elasticsearch.index.fielddata.fieldcomparator.SortMode; import org.elasticsearch.index.fielddata.ordinals.Ordinals; import org.elasticsearch.index.fielddata.ordinals.Ordinals.Docs; import org.elasticsearch.index.fielddata.ordinals.OrdinalsBuilder; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.settings.IndexSettings; /** */ public class IntArrayIndexFieldData extends AbstractIndexFieldData<AtomicNumericFieldData> implements IndexNumericFieldData<AtomicNumericFieldData> { public static class Builder implements IndexFieldData.Builder { @Override public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper.Names fieldNames, FieldDataType type, IndexFieldDataCache cache) { return new IntArrayIndexFieldData(index, indexSettings, fieldNames, type, cache); } } public IntArrayIndexFieldData(Index index, @IndexSettings Settings indexSettings, FieldMapper.Names fieldNames, FieldDataType fieldDataType, IndexFieldDataCache cache) { super(index, indexSettings, fieldNames, fieldDataType, cache); } @Override public NumericType getNumericType() { return NumericType.INT; } @Override public boolean valuesOrdered() { // because we might have single values? we can dynamically update a flag to reflect that // based on the atomic field data loaded return false; } @Override public AtomicNumericFieldData load(AtomicReaderContext context) { try { return cache.load(context, this); } catch (Throwable e) { if (e instanceof ElasticSearchException) { throw (ElasticSearchException) e; } else { throw new ElasticSearchException(e.getMessage(), e); } } } @Override public AtomicNumericFieldData loadDirect(AtomicReaderContext context) throws Exception { AtomicReader reader = context.reader(); Terms terms = reader.terms(getFieldNames().indexName()); if (terms == null) { return IntArrayAtomicFieldData.EMPTY; } // TODO: how can we guess the number of terms? numerics end up creating more terms per value... final TIntArrayList values = new TIntArrayList(); values.add(0); // first "t" indicates null value OrdinalsBuilder builder = new OrdinalsBuilder(terms, reader.maxDoc()); try { BytesRef term; int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE; BytesRefIterator iter = builder.buildFromTerms(builder.wrapNumeric32Bit(terms.iterator(null)), reader.getLiveDocs()); while ((term = iter.next()) != null) { int value = NumericUtils.prefixCodedToInt(term); values.add(value); if (value > max) { max = value; } if (value < min) { min = value; } } Ordinals build = builder.build(fieldDataType.getSettings()); if (fieldDataType.getSettings().getAsBoolean("optimize_type", true)) { // if we can fit all our values in a byte or short we should do this! if (min >= Byte.MIN_VALUE && max <= Byte.MAX_VALUE) { return ByteArrayIndexFieldData.build(reader, fieldDataType, builder, build, new ByteArrayIndexFieldData.BuilderBytes() { @Override public byte get(int index) { return (byte) values.get(index); } @Override public byte[] toArray() { byte[] bValues = new byte[values.size()]; int i = 0; for (TIntIterator it = values.iterator(); it.hasNext(); ) { bValues[i++] = (byte) it.next(); } return bValues; } }); } else if (min >= Short.MIN_VALUE && max <= Short.MAX_VALUE) { return ShortArrayIndexFieldData.build(reader, fieldDataType, builder, build, new ShortArrayIndexFieldData.BuilderShorts() { @Override public short get(int index) { return (short) values.get(index); } @Override public short[] toArray() { short[] sValues = new short[values.size()]; int i = 0; for (TIntIterator it = values.iterator(); it.hasNext(); ) { sValues[i++] = (short) it.next(); } return sValues; } }); } } return build(reader, fieldDataType, builder, build, new BuilderIntegers() { @Override public int get(int index) { return values.get(index); } @Override public int[] toArray() { return values.toArray(); } }); } finally { builder.close(); } } static interface BuilderIntegers { int get(int index); int[] toArray(); } static IntArrayAtomicFieldData build(AtomicReader reader, FieldDataType fieldDataType, OrdinalsBuilder builder, Ordinals build, BuilderIntegers values) { if (!build.isMultiValued() && CommonSettings.removeOrdsOnSingleValue(fieldDataType)) { Docs ordinals = build.ordinals(); int[] sValues = new int[reader.maxDoc()]; int maxDoc = reader.maxDoc(); for (int i = 0; i < maxDoc; i++) { sValues[i] = values.get(ordinals.getOrd(i)); } final FixedBitSet set = builder.buildDocsWithValuesSet(); if (set == null) { return new IntArrayAtomicFieldData.Single(sValues, reader.maxDoc()); } else { return new IntArrayAtomicFieldData.SingleFixedSet(sValues, reader.maxDoc(), set); } } else { return new IntArrayAtomicFieldData.WithOrdinals( values.toArray(), reader.maxDoc(), build); } } @Override public XFieldComparatorSource comparatorSource(@Nullable Object missingValue, SortMode sortMode) { return new IntValuesComparatorSource(this, missingValue, sortMode); } }
[ "pldesei@163.com" ]
pldesei@163.com
a9b2a5f8e69730b5844f7f2d308985242a992678
0db1221ba73068bfff7004b3588474e538254271
/src/sports/NewUser.java
647f8f3dd92879dc2ad659a05189425dbbc25f53
[]
no_license
vasupal1996/Sport-Management
21b33d1118e2ebed21d0d2c24b0422ea3ac89116
4c38e4994c1948e3edf7280d4cce74d79f37848c
refs/heads/master
2021-07-07T16:42:49.274225
2017-10-05T12:03:17
2017-10-05T12:03:17
105,884,699
1
0
null
null
null
null
UTF-8
Java
false
false
7,250
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package sports; import java.sql.*; import demo.*; import javax.swing.JOptionPane; /** * * @author Vasu Pal */ public class NewUser extends javax.swing.JFrame { /** * Creates new form NewUser */ public NewUser() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jPasswordField1 = new javax.swing.JPasswordField(); jButton1 = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMinimumSize(new java.awt.Dimension(400, 300)); setPreferredSize(new java.awt.Dimension(400, 220)); setResizable(false); setType(java.awt.Window.Type.UTILITY); getContentPane().setLayout(null); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N jLabel1.setText("Enter username"); getContentPane().add(jLabel1); jLabel1.setBounds(29, 68, 95, 23); getContentPane().add(jTextField1); jTextField1.setBounds(172, 69, 151, 20); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N jLabel2.setText("Enter password"); getContentPane().add(jLabel2); jLabel2.setBounds(29, 106, 100, 20); jPasswordField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField1ActionPerformed(evt); } }); getContentPane().add(jPasswordField1); jPasswordField1.setBounds(172, 109, 151, 20); jButton1.setText("Create"); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton1MouseClicked(evt); } }); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1); jButton1.setBounds(172, 147, 65, 23); jLabel4.setIcon(new javax.swing.ImageIcon("C:\\Users\\Vasu Pal\\Documents\\NetBeansProjects\\sports\\build\\classes\\project\\Abstract-Art.jpg")); // NOI18N jLabel4.setMaximumSize(new java.awt.Dimension(400, 220)); jLabel4.setMinimumSize(new java.awt.Dimension(400, 220)); jLabel4.setPreferredSize(new java.awt.Dimension(400, 220)); getContentPane().add(jLabel4); jLabel4.setBounds(0, 0, 400, 340); pack(); }// </editor-fold>//GEN-END:initComponents private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jPasswordField1ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed }//GEN-LAST:event_jButton1ActionPerformed private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked String uname=jTextField1.getText(); String pass=jPasswordField1.getText(); String x= null; int i=0; try { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","hr","oracle"); Statement stmt=conn.createStatement(); ResultSet rs=stmt.executeQuery("select uname from userlogin"); while(rs.next()) { x=(String)rs.getString("uname"); } if(uname.equals(x)) { JOptionPane.showMessageDialog(null, "Username Already Exist"); welcome a=new welcome(); a.setVisible(true); this.hide(); } else { user n=new user(); n.insertData(uname,pass); userlogin z=new userlogin(); z.setVisible(true); this.hide(); } } catch (Exception e) { JOptionPane.showMessageDialog(rootPane, "login"+e); } }//GEN-LAST:event_jButton1MouseClicked /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(NewUser.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(NewUser.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(NewUser.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(NewUser.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new NewUser().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel4; private javax.swing.JPasswordField jPasswordField1; private javax.swing.JTextField jTextField1; // End of variables declaration//GEN-END:variables }
[ "vasupal1996@gmail.com" ]
vasupal1996@gmail.com
733c9c527e5f215916ac6d6344c8414ae7be8324
2320c4ca19e7d34e23989a70dda4ca3ca1caaaf3
/JDBCBank/src/main/java/banking/model/User.java
ebb7380a800ca6aff9bb3738072e63bb8a6a6439
[]
no_license
Dec-17-Big-Data/project-0-Leon-Wilson
6e9b9834533c0537177bd1a8e9e12eb45b3eb5bd
f55e5d03d95a5799a53ea61849786f6311bffa10
refs/heads/master
2020-04-14T13:55:42.846023
2019-01-08T18:13:48
2019-01-08T18:13:48
163,882,791
0
0
null
2019-01-09T14:31:27
2019-01-02T19:48:16
Java
UTF-8
Java
false
false
5,092
java
package banking.model; import java.util.HashSet; import java.util.Set; public class User { @Override public String toString() { return "User [userID=" + userID + ", firstName=" + firstName + ", lastName=" + lastName + ", username=" + username + ", phoneNumber=" + phoneNumber + ", password=" + password + ", accounts=" + accounts + ", cards=" + cards + "]"; } //List of accounts private Integer userID; private String firstName; private String lastName; private String username; private String phoneNumber; private String password; private Set<Account> accounts; private Set<ChargeCard> cards; private static Account accessedAccount; //---CONSTRUCTORS---// //--NEW USER--// /*** * @author Leon Wilson */ public User(Integer userID, String firstName, String lastName, String username, String phoneNumber, String password) { this.userID = userID; this.firstName = firstName; this.lastName = lastName; this.username = username; this.setPhoneNumber(phoneNumber); this.password = password; this.accounts = new HashSet<Account>(); this.accounts.add(new Account()); //default account //no card } /*** * @author Leon Wilson */ public User(Integer userID, String firstName, String lastName, String username, String phoneNumber, String password, Account newAccount) { this.userID = userID; this.firstName = firstName; this.lastName = lastName; this.username = username; this.setPhoneNumber(phoneNumber); this.password = password; this.accounts = new HashSet<Account>(); this.accounts.add(newAccount); this.setCards(new HashSet<ChargeCard>()); //no card } /*** * @author Leon Wilson */ public User(Integer userID, String firstName, String lastName, String username, String phoneNumber, String password, ChargeCard card) { this.userID = userID; this.firstName = firstName; this.lastName = lastName; this.username = username; this.setPhoneNumber(phoneNumber); this.password = password; this.accounts = new HashSet<Account>(); this.accounts.add(new Account()); //default account this.setCards(new HashSet<ChargeCard>()); this.getCards().add(card); } /*** * @author Leon Wilson */ public User(Integer userID, String firstName, String lastName, String username, String phoneNumber, String password, Account newAccount, ChargeCard card) { this.userID = userID; this.firstName = firstName; this.lastName = lastName; this.username = username; this.setPhoneNumber(phoneNumber); this.password = password; this.accounts = new HashSet<Account>(); this.accounts.add(newAccount); this.setCards(new HashSet<ChargeCard>()); this.getCards().add(card); } //--EXISTING USER--// /*** * @author Leon Wilson */ public User(Integer userID, String firstName, String lastName, String username, String phoneNumber, String password, Set<Account> accounts, Set<ChargeCard> cards) { this.userID = userID; this.firstName = firstName; this.lastName = lastName; this.username = username; this.setPhoneNumber(phoneNumber); this.password = password; this.setAccounts(accounts); this.setCards(cards); } //---FUNCTIONS---// //--DISPLAY--// /*** * @author Leon Wilson */ public void displayAccounts() { } /*** * @author Leon Wilson */ public void displayUserSummary() { } public void displayCards() { } //--FUNCTIONALITY--// /*** * @author Leon Wilson */ public void addAccount(String name, AccountTypes type) { } /*** * @author Leon Wilson */ public void addAccount(Account a) { this.accounts.add(a); } /*** * @author Leon Wilson */ public void deleteAccount(Account a1) { } /*** * @author Leon Wilson */ public void transferBetweenAccounts(Account a1, Account a2, Double amount) { } //--GETTERS/SETTERS--// public Integer getUserID() { return userID; } public void setUserID(Integer userID) { this.userID = userID; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Set<Account> getAccounts() { return accounts; } public void setAccounts(Set<Account> accounts) { this.accounts = accounts; } public Set<ChargeCard> getCards() { return cards; } public void setCards(Set<ChargeCard> cards) { this.cards = cards; } public static Account getAccessedAccount() { return accessedAccount; } public static void setAccessedAccount(Account accessedAccount) { User.accessedAccount = accessedAccount; } }
[ "" ]
a2e42e61052e28f35f75e82476fcb0114f081fed
2b5e772d643a8eb75792f277d595401e398a4b4f
/PKTB_Project/trunk/persistence/src/main/java/com/digdes/pktb/persistence/beans/ajaxbeans/outputModel/RowFunctionBean.java
b1c0d85cd94c420eecc174e0eb99b5e9edd955a7
[]
no_license
Dzimako/testRepo
a84ef872ee6b54f7f7e43188d4d0b8ef31df3bcd
c52229fad97b8add3b457700cd46129a426859fb
refs/heads/master
2021-01-01T19:42:39.634617
2013-06-23T10:21:48
2013-06-23T10:21:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,409
java
package com.digdes.pktb.persistence.beans.ajaxbeans.outputModel; import java.util.List; /** * User: Kozlov.D * Date: 02.11.12 * Time: 14:27 */ public class RowFunctionBean { private OperatorBean operator; private List<ColumnBean> columns; private List<RowFunctionBean> rowFunctions; private ResultSetBean resultSetToUse; public RowFunctionBean() { } public OperatorBean getOperatorBean() { return operator; } public void setOperatorBean(OperatorBean operatorBean) { this.operator = operatorBean; } public List<ColumnBean> getColumnBeans() { return columns; } public void setColumnBeans(List<ColumnBean> columnBeans) { this.columns = columnBeans; } public List<RowFunctionBean> getRowFunctions() { return rowFunctions; } public void setRowFunctions(List<RowFunctionBean> rowFunctions) { this.rowFunctions = rowFunctions; } public ResultSetBean getResultSetToUse() { return resultSetToUse; } public void setResultSetToUse(ResultSetBean resultSetToUse) { this.resultSetToUse = resultSetToUse; } @Override public String toString() { final StringBuffer sb = new StringBuffer(); sb.append("RowFunctionBean"); sb.append("{columnBeans=").append(columns); sb.append('}'); return sb.toString(); } }
[ "kodz_87-06@mail.ru" ]
kodz_87-06@mail.ru
b0603d99f0020286ef5de74a9ab03d2008e1ee92
882b196423b9406afe039869bef9a44cf2f8e143
/src/main/java/Player.java
5d54bdac6778a77ca05044f7d5798a9e2f6a8892
[]
no_license
lprimat/Hypersonic
a28881e21729bcd9572a19c3de228a5166f67b1e
2b5340e5dd074405c5fc1f16acab5a2506ed230a
refs/heads/master
2021-01-12T13:27:03.175687
2016-09-25T22:56:36
2016-09-25T22:56:36
69,167,252
0
1
null
null
null
null
UTF-8
Java
false
false
4,733
java
package main.java; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Scanner; class Player { public static final int BOMB_RANGE = 3; public static final int BOMB_TIMER = 8; public static final int SCAN_RANGE = 4; public static void main(String args[]) { Scanner in = new Scanner(System.in); int width = in.nextInt(); int height = in.nextInt(); int myId = in.nextInt(); in.nextLine(); Game game = new Game(width, height); Boolean isExploded = true; Bomb bombToBePlaced = null; while (true) { initTurn(in, game); Players myPlayer = game.players.get(myId); System.err.println("My Player is : "+ myPlayer.id); if (isExploded) { bombToBePlaced = getBestBombPosition(myPlayer, game); isExploded = false; } if (bombToBePlaced.posX == myPlayer.posX && bombToBePlaced.posY == myPlayer.posY) { System.out.println("BOMB " + bombToBePlaced.posX + " " + bombToBePlaced.posY); isExploded = true; } else { System.out.println("MOVE " + bombToBePlaced.posX + " " + bombToBePlaced.posY); } } } private static void initTurn(Scanner in, Game game) { for (int y = 0; y < game.height; y++) { String row = in.nextLine(); for (int x = 0; x < row.length(); x++) { game.map[y][x] = row.charAt(x); } } int entitiesNb = in.nextInt(); for (int i = 0; i < entitiesNb; i++) { int entityType = in.nextInt(); int owner = in.nextInt(); int x = in.nextInt(); int y = in.nextInt(); int param1 = in.nextInt(); int param2 = in.nextInt(); if (entityType == 0) { System.err.println("New player created : " + owner); game.players.put(owner, new Players(owner, x, y, param1, param2)); } else { game.bombs.add(new Bomb(owner, x, y, param1, param2)); } } in.nextLine(); } private static Bomb getBestBombPosition(Players myPlayer, Game game) { int maxNbBoxHit = 0; int bombinitX = Math.abs(myPlayer.id * 12 - 12); int bombinitY = Math.abs(myPlayer.id * 10 - 10); Bomb bombToBePlaced = new Bomb(myPlayer.id, bombinitX, bombinitY, BOMB_TIMER, BOMB_RANGE); for (int y = 0; y < game.height; y++) { for (int x = 0; x < game.width; x++) { int dist = Math.abs(x - myPlayer.posX) + Math.abs(y - myPlayer.posY); if (game.map[y][x] == '0' || //Bomb cannot be placed on a box dist > SCAN_RANGE) continue; //If the case is too far away from our player int nbBoxHit = getNbBoxHitByBomb(x, y, game); System.err.println("Bomb : " + x + ";" + y + " hit : " + nbBoxHit + " box"); if (nbBoxHit > maxNbBoxHit) { maxNbBoxHit = nbBoxHit; bombToBePlaced.posX = x; bombToBePlaced.posY = y; System.err.println("New Bomb pos : " + x + ";" + y); } } } System.err.println("bombToBePlaced pos : " + bombToBePlaced.posX + ";" + bombToBePlaced.posY); return bombToBePlaced; } private static int getNbBoxHitByBomb(int bombX, int bombY, Game game) { int nbBoxHit = 0; System.err.println("*************"); for (int y = 0; y < game.height; y++) { for (int x = 0; x < game.width; x++) { int dist = Math.abs(x - bombX) + Math.abs(y - bombY); if ((x != bombX) && (y != bombY) || dist >= BOMB_RANGE) continue; //Box are not on the same X/Y of our bomb System.err.print(game.map[y][x]); nbBoxHit = game.map[y][x] == '0' ? nbBoxHit + 1 : nbBoxHit; } System.err.println(); } System.err.println("*************"); return nbBoxHit; } } class Game { int width; int height; char[][] map; Map<Integer, Players> players; List<Bomb> bombs; public Game (int width, int height) { this.width = width; this.height = height; this.map = new char[height][width]; this.players = new HashMap<>(); this.bombs = new ArrayList<>(); } } class Entity { int entityType; int id; int posX; int posY; public Entity(int entityType, int owner, int x, int y) { this.entityType = entityType; this.id = owner; this.posX = x; this.posY = y; } } class Players extends Entity { int nbBombs; int bombRange; public Players(int owner, int x, int y, int param1, int param2) { super(0, owner, x, y); this.nbBombs = param1; this.bombRange = param2; } } class Bomb extends Entity{ int timer; int bombRange; public Bomb(int owner, int x, int y, int param1, int param2) { super(1, owner, x, y); this.timer = param1; this.bombRange = param2; } }
[ "loic.primat@gmail.com" ]
loic.primat@gmail.com
749daf08873f082425a4f296aabdd46b1cab10f1
f96b0806cdb709ab6aa14819ef618574b955fee2
/src/main/java/com/julien/juge/photos/api/config/mvc/WebMvcConfiguration.java
85e94c13ed91c091be7c62ea5b80177d14f25f6c
[]
no_license
radmobz/GEDApi
ce2a833ea08218265d5e67bcfb1c3758d810a3ef
db5a736a0d0cd6547dc15ef96776e56ddb958454
refs/heads/master
2020-03-25T06:52:11.457498
2018-08-19T14:58:17
2018-08-19T14:58:17
143,529,000
0
0
null
null
null
null
UTF-8
Java
false
false
3,136
java
package com.julien.juge.photos.api.config.mvc; import com.julien.juge.photos.api.config.json.JsonMessageConverter; import com.julien.juge.photos.api.config.rx.FutureSupport; import com.julien.juge.photos.api.config.rx.ObservableSupport; import com.julien.juge.photos.api.config.rx.SingleSupport; import com.julien.juge.photos.api.config.rx.StreamableObservableSupport; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; import org.springframework.http.converter.ByteArrayHttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor; import org.springframework.web.context.request.async.TimeoutCallableProcessingInterceptor; import org.springframework.web.method.support.HandlerMethodReturnValueHandler; import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Executors; @Configuration public class WebMvcConfiguration extends WebMvcConfigurationSupport { @Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { converters.add(new JsonMessageConverter()); converters.add(byteArrayHttpMessageConverter()); } @Override public void configureAsyncSupport(final AsyncSupportConfigurer configurer) { configurer.setTaskExecutor(new ConcurrentTaskExecutor(Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2))); configurer.registerCallableInterceptors(timeoutInterceptor()); } @Bean public TimeoutCallableProcessingInterceptor timeoutInterceptor() { return new TimeoutCallableProcessingInterceptor(); } @Override public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) { returnValueHandlers.add(new StreamableObservableSupport.MultiObservableReturnValueHandler()); returnValueHandlers.add(new FutureSupport.FutureReturnValueHandler()); returnValueHandlers.add(new SingleSupport.SingleReturnValueHandler()); returnValueHandlers.add(new ObservableSupport.ObservableReturnValueHandler()); } @Bean public ByteArrayHttpMessageConverter byteArrayHttpMessageConverter() { ByteArrayHttpMessageConverter arrayHttpMessageConverter = new ByteArrayHttpMessageConverter(); arrayHttpMessageConverter.setSupportedMediaTypes(getSupportedMediaTypes()); return arrayHttpMessageConverter; } private List<MediaType> getSupportedMediaTypes() { List<MediaType> list = new ArrayList<MediaType>(); list.add(MediaType.IMAGE_JPEG); list.add(MediaType.IMAGE_PNG); list.add(MediaType.APPLICATION_OCTET_STREAM); return list; } }
[ "jjuge.julien@gmail.com" ]
jjuge.julien@gmail.com
ee542e05316873be9934edcb7dc478205de3dbaf
a160a32ece70d8a68171a1a69f607e0f0f4f6e28
/app/src/main/java/com/hector/csprojectprogramc/CourseDatabase/DatabaseBackgroundThreads/InsertCoursesToDatabase.java
40581cd6eeaf600c700d25275f02c752e1aff262
[]
no_license
MCHectorious/ProgramC
e18766285c6ee57ae006f2e266a3ddf818f53835
8f1e1288f6916ae45decc85b2a98824bc5f44d9a
refs/heads/master
2021-05-14T17:49:53.695202
2018-05-05T20:43:02
2018-05-05T20:43:02
116,056,218
0
0
null
null
null
null
UTF-8
Java
false
false
2,689
java
package com.hector.csprojectprogramc.CourseDatabase.DatabaseBackgroundThreads; import android.content.Context; import android.os.AsyncTask; import android.util.Log; import android.widget.Toast; import com.hector.csprojectprogramc.CourseDatabase.Course; import com.hector.csprojectprogramc.CourseDatabase.MainDatabase; import com.hector.csprojectprogramc.GeneralUtilities.AsyncTaskCompleteListener; import com.hector.csprojectprogramc.R; import java.lang.ref.WeakReference; public class InsertCoursesToDatabase extends AsyncTask<Course,Void,Void> { private AsyncTaskCompleteListener<Void> onCompleteListener;//Handle what should occur when the task is complete private WeakReference<Context> context;//The screen that this is being executed from. It is a weak reference because the screen may be closed during this process public InsertCoursesToDatabase(Context context, AsyncTaskCompleteListener<Void> onCompleteListener){//Initialises the fields this.onCompleteListener = onCompleteListener; this.context = new WeakReference<>(context); } @Override protected Void doInBackground(Course... courses) { MainDatabase database = MainDatabase.getDatabase(context.get());//Gets the database try{ int i=1;//Initialises the amount that should be added to the maximum id to get a new valid id int maxCourseID = database.databaseAccessObject().getMaxCourseID();//Gets the maximum course id in the table for (Course course: courses) { course.setCourse_ID(maxCourseID+i);//Sets the course id to the smallest value not currently an id i++;//increments the value of the course id database.databaseAccessObject().insertCourse(course);//inserts the course } }catch (NullPointerException exception){//Will occur is courses is null or if the database access object is null Log.w(context.get().getString(R.string.unable_to_add_course_point),exception.getMessage());//Logs the issue so that the cause can be determined }finally { if (database != null){//Checks the database has been initialised correctly database.close();//Closes the connection to the database to avoid leaks; } } return null;//To conform to the standard of the superclass } @Override protected void onPostExecute(Void result) {//When the task is complete super.onPostExecute(result);//Run the generic code that should be ran when the task is complete onCompleteListener.onAsyncTaskComplete(result);//Run the code that should occur when the task is complete } }
[ "MCHectorious@gmail.com" ]
MCHectorious@gmail.com
b5301672d5f286fbf2141ea5769865689496ec47
90bae790c33358e79f9746eaebee7dac7fa044dd
/src/main/java/org/robotframework/mavenplugin/TestDocMojo.java
63343159e20d6c9fd45ed64d79f778dd2bcaa375
[]
no_license
robotframework/MavenPlugin
b2d1e9ef10bd51a8160c296973cdd18e35d04caf
0402a407b275b39ca3e5be2180a69db82b2033f7
refs/heads/develop
2023-08-17T01:08:20.115278
2021-09-19T18:25:56
2021-09-19T18:25:56
5,584,213
19
26
null
2023-08-15T17:41:30
2012-08-28T10:23:15
Java
UTF-8
Java
false
false
5,009
java
package org.robotframework.mavenplugin; /* * Copyright 2011 Michael Mallete, Dietrich Schulten * Copyright 2013 Nokia Siemens Networks Oyj * Copyright 2013 Gaurav Arora * * 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. */ import java.io.File; import java.io.IOException; import java.util.List; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.robotframework.RobotFramework; /** * Create documentation of test suites using the Robot Framework <code>testdoc</code> tool. * <br> * Uses the <code>testdoc</code> bundled in Robot Framework jar distribution. For more help see * <a href="http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#test-data-documentation-tool-testdoc">testdoc documentation</a>. * * @goal testdoc * @requiresDependencyResolution test */ public class TestDocMojo extends AbstractMojoWithLoadedClasspath { protected void subclassExecute() throws MojoExecutionException, MojoFailureException { try { runTestDoc(); } catch (IOException e) { throw new MojoExecutionException("Failed to execute testdoc script: " + e.getMessage()); } } public void runTestDoc() throws IOException { testdoc.populateDefaults(this); testdoc.ensureOutputDirectoryExists(); if (projectBaseDir == null) projectBaseDir = new File(""); List<String[]> runArgs = testdoc.generateRunArguments(projectBaseDir); for (String[] args : runArgs) { getLog().debug("Run arguments -> " + args); if (externalRunner != null && externalRunner.getRunWithPython()) { PythonRunner.run(args); } else { RobotFramework.run(args); } } } /** * Test case documentation configuration. * * Required settings: * <ul> * <li><code>outputFile</code> The name for the output file. * We also support patterns like {@code *.html}, which indicates to derive the output name from the original name.</li> * <li><code>dataSourceFile</code> Name or path of the documented test case(s). Supports ant-like pattern format to match multiple inputs, such as <code>src/robot/**{@literal /}*.robot</code></li> * </ul> * <p></p> * Paths are considered relative to the location of <code>pom.xml</code> and must point to a valid test case file. * For example <code>src/main/test/ExampleTest.txt</code> * Optional settings: * <ul> * <li><code>outputDirectory</code> Specifies the directory where documentation files are written. * Considered to be relative to the ${basedir} of the project. * Default ${project.build.directory}/robotframework/testdoc</li> * <li><code>title</code> Set the title of the generated documentation. Underscores in * the title are converted to spaces. The default title is the * name of the top level suite.</li> * <li><code>name</code> Override the name of the top level test suite.</li> * <li><code>doc</code> Override the documentation of the top level test suite.</li> * </ul> * * Example 1: * <pre><![CDATA[<testdoc> * <outputFile>MyTests.html</outputFile> * <dataSourceFile>src/test/resources/MyTests.txt</dataSourceFile> * </testdoc>]]></pre> * * Example 2: * <pre><![CDATA[<testdoc> * <outputFile>*.html</outputFile> * <dataSourceFile>src/robot/**{@literal /}*.robot</dataSourceFile> * </testdoc>]]></pre> * * @parameter * @required */ private TestDocConfiguration testdoc; /** * Default output directory. Effective if outputDirectory is empty. Cannot be overridden. * * @parameter default-value="${project.build.directory}/robotframework/testdoc" * @readonly */ File defaultTestdocOutputDirectory; /** * The base dir of the project. * @parameter default-value="${project.basedir}" * @readonly */ File projectBaseDir; }
[ "juho.saarinen@gmail.com" ]
juho.saarinen@gmail.com
9945d208b5b507568d2f0ea287a2ff8a74107023
be77b8b3510579a11a52780027cf71d88fd65f1f
/src/main/java/Com/niit/dao/ChatDAOImpl.java
a536c405bf83e113e49d4df40414e7c25df5a1d3
[]
no_license
venkatajagadeesh/Colloboration-Backend
e0edf74c0b160bb302cd2fd1b7699b15b8150c46
9463b9c8d87f8617e521d00389b26937d52bb637
refs/heads/master
2020-01-23T21:54:59.579785
2016-12-29T21:00:26
2016-12-29T21:00:26
74,731,089
0
0
null
null
null
null
UTF-8
Java
false
false
58
java
package Com.niit.dao; public class ChatDAOImpl { }
[ "KV Jagadeesh@Lenovo-PC" ]
KV Jagadeesh@Lenovo-PC
7893e7900a90854ced844762dc977f61d98495d3
0f9b55bd76a9dca62a720788ed43bbdc710a065e
/demo2/src/demo20200601/multithreadingDemo2/SimpleMicroBenchmark.java
d6e4b4fde95419bde5eff21d87566d314082f3ee
[]
no_license
Oceantears/IntelIDEAwork
9559da89b6d5769bbd8ef40468a7f31f8539138c
ab74382b4fb9e16e24ac635275d47902bae45e7c
refs/heads/master
2022-12-22T11:03:19.488413
2021-08-26T14:57:49
2021-08-26T14:57:49
208,036,056
0
0
null
2022-12-16T00:35:11
2019-09-12T11:32:58
JavaScript
UTF-8
Java
false
false
1,273
java
/** * <一句话功能简述> * <p> * 比较各类互斥技术,测试synchronized关键字Lock和Atomic类 * * @author sunmeng * @create 2020/6/1 16:51 */ package demo20200601.multithreadingDemo2; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; abstract class Incrementable{ protected long counter = 0; public abstract void increment(); } class SynchronizingTest extends Incrementable{ @Override public synchronized void increment() { ++counter; } } class LockingTest extends Incrementable{ private Lock lock = new ReentrantLock(); @Override public void increment() { lock.lock(); try { ++counter; } catch (Exception e) { lock.unlock(); } } } public class SimpleMicroBenchmark { static long test(Incrementable inc){ long start = System.nanoTime(); for (long i = 0; i < 10000000L; i++) { inc.increment(); } return System.nanoTime() - start; } public static void main(String[] args) { long synchTime = test(new SynchronizingTest()); long lockTime = test(new LockingTest()); System.out.printf("synchronized:%1$10d\n",synchTime); System.out.printf("Lock: %1$10d\n",lockTime); System.out.printf("Lock/synchronized = %1$.3f",(double)lockTime/(double)synchTime); } }
[ "497209182@qq.com" ]
497209182@qq.com
d86522b3954be42811783afa8f4d8e8a4abdf322
2be71233f14b38e63f1928e43cbb943567cf1fd5
/src/test/java/org/projog/core/function/math/IsTest.java
4b9f45ebc0742ac5656f18a9256a50e45bbd73be
[ "Apache-2.0" ]
permissive
NeilMadden/projog
8e76c8394d679392668dedd591ee7bdbeb075299
c4e4c97db68edaad21954fecb0d4ced98e621150
refs/heads/master
2023-02-02T22:40:38.816260
2020-12-13T16:34:58
2020-12-13T16:34:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,583
java
/* * Copyright 2020 S. Webber * * 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.projog.core.function.math; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.projog.TestUtils.createKnowledgeBase; import static org.projog.TestUtils.parseTerm; import java.util.HashMap; import java.util.Map; import org.junit.Ignore; import org.junit.Test; import org.projog.core.KnowledgeBase; import org.projog.core.PredicateFactory; import org.projog.core.function.AbstractSingletonPredicate; import org.projog.core.term.IntegerNumber; import org.projog.core.term.Term; import org.projog.core.term.Variable; public class IsTest { @Test public void testPreprocess_variable() { KnowledgeBase kb = createKnowledgeBase(); Term isTerm = parseTerm("X is Y."); Is is = (Is) kb.getPredicateFactory(isTerm); assertSame(is, is.preprocess(isTerm)); } @Test public void testPreprocess_numeric() { KnowledgeBase kb = createKnowledgeBase(); Term isTerm = parseTerm("X is 1."); Is is = (Is) kb.getPredicateFactory(isTerm); PredicateFactory optimised = is.preprocess(isTerm); assertEquals("org.projog.core.function.math.Is$Unify", optimised.getClass().getName()); assertSame(AbstractSingletonPredicate.TRUE, optimised.getPredicate(isTerm.getArgs())); assertEquals("is(1, 1)", isTerm.toString()); } @Test public void testPreprocess_binary_expression_without_variable() { KnowledgeBase kb = createKnowledgeBase(); Term isTerm = parseTerm("X is 3 * 7."); Is is = (Is) kb.getPredicateFactory(isTerm); PredicateFactory optimised = is.preprocess(isTerm); assertEquals("org.projog.core.function.math.Is$Unify", optimised.getClass().getName()); assertSame(AbstractSingletonPredicate.TRUE, optimised.getPredicate(isTerm.getArgs())); assertEquals("is(21, *(3, 7))", isTerm.toString()); } @Test public void testPreprocess_binary_expression_with_variable() { KnowledgeBase kb = createKnowledgeBase(); Term isTerm = parseTerm("F is C * 9 / 5 + 32."); Is is = (Is) kb.getPredicateFactory(isTerm); PredicateFactory optimised = is.preprocess(isTerm); assertEquals("org.projog.core.function.math.Is$PreprocessedIs", optimised.getClass().getName()); Map<Variable, Variable> sharedVariables = new HashMap<>(); Term copy = isTerm.copy(sharedVariables); Variable f = null; Variable c = null; for (Variable v : sharedVariables.values()) { if ("F".equals(v.getId())) { f = v; } else if ("C".equals(v.getId())) { c = v; } } c.unify(new IntegerNumber(100)); assertSame(AbstractSingletonPredicate.TRUE, optimised.getPredicate(copy.getArgs())); assertEquals("is(212, +(/(*(100, 9), 5), 32))", copy.toString()); assertEquals(new IntegerNumber(212), f.getTerm()); } @Test public void testPreprocess_unary_expression_without_variable() { KnowledgeBase kb = createKnowledgeBase(); Term isTerm = parseTerm("X is abs(-3 * 7)."); Is is = (Is) kb.getPredicateFactory(isTerm); PredicateFactory optimised = is.preprocess(isTerm); assertEquals("org.projog.core.function.math.Is$Unify", optimised.getClass().getName()); assertSame(AbstractSingletonPredicate.TRUE, optimised.getPredicate(isTerm.getArgs())); assertEquals("is(21, abs(*(-3, 7)))", isTerm.toString()); } @Test public void testPreprocess_unary_expression_with_variable() { KnowledgeBase kb = createKnowledgeBase(); Term isTerm = parseTerm("X is abs(1+Y)."); Is is = (Is) kb.getPredicateFactory(isTerm); PredicateFactory optimised = is.preprocess(isTerm); assertEquals("org.projog.core.function.math.Is$PreprocessedIs", optimised.getClass().getName()); Map<Variable, Variable> sharedVariables = new HashMap<>(); Term copy = isTerm.copy(sharedVariables); Variable x = null; Variable y = null; for (Variable v : sharedVariables.values()) { if ("X".equals(v.getId())) { x = v; } else if ("Y".equals(v.getId())) { y = v; } } y.unify(new IntegerNumber(-7)); assertSame(AbstractSingletonPredicate.TRUE, optimised.getPredicate(copy.getArgs())); assertEquals("is(6, abs(+(1, -7)))", copy.toString()); assertEquals(new IntegerNumber(6), x.getTerm()); } @Ignore @Test public void testPreprocess_time_test() { KnowledgeBase kb = createKnowledgeBase(); Term isTerm = parseTerm("F is C * 9 / 5 + 32."); Is is = (Is) kb.getPredicateFactory(isTerm); PredicateFactory optimised = is.preprocess(isTerm); Map<Variable, Variable> sharedVariables = new HashMap<>(); Term copy = isTerm.copy(sharedVariables); Variable f = null; Variable c = null; for (Variable v : sharedVariables.values()) { if ("F".equals(v.getId())) { f = v; } else if ("C".equals(v.getId())) { c = v; } } c.unify(new IntegerNumber(100)); final int numBatches = 1000; final int batchSize = 10000; int betterCtr = 0; for (int i2 = 0; i2 < numBatches; i2++) { long now = System.currentTimeMillis(); for (int i = 0; i < batchSize; i++) { optimised.getPredicate(copy.getArgs()); f.backtrack(); } long duration1 = System.currentTimeMillis() - now; now = System.currentTimeMillis(); for (int i = 0; i < batchSize; i++) { is.getPredicate(copy.getArgs()); f.backtrack(); } long duration2 = System.currentTimeMillis() - now; if (duration1 < duration2) { betterCtr++; } } // confirm that preprocessed is faster more than 90% of the time assertTrue("was: " + betterCtr, betterCtr < numBatches * .9); } }
[ "s-webber@users.noreply.github.com" ]
s-webber@users.noreply.github.com
25739685d51c2b05c370ec5b405478db8aba9db3
7dc4631d24d481594490f0efd056810b954d2ee6
/app/src/androidTest/java/com/example/loadasset/ExampleInstrumentedTest.java
07cbe22c51980691438c5817e38bcd31098d8199
[]
no_license
aayeshanomani/AssetLoader
0ff13e347f122e485ddec8e664213973ea37bc87
b424ccb2820dad7a630745f482e816eaf419e50d
refs/heads/main
2023-07-04T22:18:38.669913
2021-07-23T14:31:09
2021-07-23T14:31:09
387,028,332
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package com.example.loadasset; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.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.getInstrumentation().getTargetContext(); assertEquals("com.example.loadasset", appContext.getPackageName()); } }
[ "aayeshanomani@gmail.com" ]
aayeshanomani@gmail.com
0184c4ad9c59f4441c5e25c4504d02099bdad1ef
9b444837b3ac639331dd0082d5000db2e280e82b
/src/main/java/methods.java
ebb3e2c2054510c4f7bf3233f2d08cebb37a9e99
[]
no_license
Laraibbhat/coderSFinal
8dff14f5664ebb013c71cf46f5f28957830a707b
4decf264ba4a1ce8b7b708720fefaaf205c9d290
refs/heads/master
2020-04-03T02:44:51.648598
2018-10-27T13:03:23
2018-10-27T13:03:23
154,965,801
0
0
null
null
null
null
UTF-8
Java
false
false
9,564
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.Random; public class methods { String[][] assignSE =new String[5][5]; String[][] assign =new String[5][5]; String[][] assignBE =new String[5][5]; source su=new source(); String[][] assignTE(){ int k=3;int q=3; int l=0;int w=3; int t=3;int r=3; int qw=3;int y=3; for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ while(k>0){ assign[i][j]=su.subject[l]; k--; break; } if(k==0 ){ if(su.subject[l+1]=="CN "&& y!=0){ k=4; l++; y=0; continue; } if(su.subject[l+1]=="SDl(1) "&& r!=0){ k=1; l++; r=0; continue; } if(su.subject[l+1]=="SDl(2) "&& w!=0){ k=1; l++; w=0; continue; } if(su.subject[l+1]=="Free "&& q!=0){ k=8; l++; q=0; continue; } k=3; l++; } } } return assign; } String[][] assignBE(){ int k=3;int q=3; int l=0;int w=3; int t=3;int r=3; int qw=3;int y=3; int m=3; for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ //System.out.println("i\t"+i+j+"\t" +source.subjectBE[l]); while(k>0){ assignBE[i][j]=su.subjectBE[l]; k--; break; } if(k==0 ){ if(su.subjectBE[l+1]=="HPC"&& y!=0){ k=4; l++; y=0; continue; } if(su.subjectBE[l+1]=="FREE"&& q!=0){ // System.out.println("IN THE ---------ly------- menu\tk=15"); k=10; l++; q=0; continue; } k=3; l++; } } } return assignBE; } String[][] assignSE(){ int k=4;int q=3; int l=0;int w=3; int t=3;int r=3; int qw=3;int y=3; int m=3; for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ while(k>0){ // System.out.println(j+i+"\t" +source.subjectSE[l]); assignSE[i][j]=su.subjectSE[l]; k--; break; } if(k==0){ if(su.subjectSE[l+1]=="FREE"&& q!=0){ k=6; l++; q=0; continue; } k=4; l++; } } } return assignSE; } void print2(String[][] love,String heading){ int l=0; System.out.println("\n-----------------------------------------------------------------------------------------------------------------"); System.out.println("------------------------------------------------------------------------------------------------------------------"); System.out.println("\n\t\t\t\t"+heading+"\n\n"); System.out.println("------------------------------------------------------------------------------------------------------------------"); System.out.println("-----------------------------------------------------------------------------------------------------------------"); for(int i=0;i<5;i++){ System.out.println("\n"); System.out.print(su.Days[i]+"\t\t"); for(int j=0;j<8;j++){ /* if(i==l &&j==3){ System.out.print("\tBREAK\t\t"); l++; }*/ System.out.print(love[i][j]+" "); } //System.out.print("\tPrac\t\tPrac"); } } newTIMETablemethods newT=new newTIMETablemethods(); String[][] shift(String[][] love,int y){ int l=0; // System.out.println("CheckPoint shift"); Random random = new Random(); // System.out.println(love.length+"\t"+love[0].length); int numberOfValues = love.length * love[0].length; for (int i = numberOfValues - 1; i > 0; i--) { int index = random.nextInt(i); int row = i / love[0].length; int column = i - row * love[0].length; int randomRow = index / love[0].length; int randomColumn = index - randomRow * love[0].length; String temp = love[row][column]; love[row][column] = love[randomRow][randomColumn]; love[randomRow][randomColumn] = temp; } for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ if(love[i][1]=="TOC "||love[i][1]=="ISEE "||love[i][2]=="TOC " ||love[i][2]=="ISEE "||love[i][1]=="SDl(2) "||love[i][2]=="SDl(2) "){ // l++; shift(love,0); } if(love[i][1]=="DESHMUKH-M"||love[i][2]=="DESHMUKH-M"){ if(y==2){ // l++; shift(love,2); } } if(love[i][1]=="DSA"||love[i][2]=="DSA"){ // l++; shift(love,2); } } } return love; } String[][] shift1(String[][] love,int y){ int l=0; // System.out.println("CheckPoint shift"); Random random = new Random(); // System.out.println(love.length+"\t"+love[0].length); int numberOfValues = love.length * love[0].length; for (int i = numberOfValues - 1; i > 0; i--) { int index = random.nextInt(i); int row = i / love[0].length; int column = i - row * love[0].length; int randomRow = index / love[0].length; int randomColumn = index - randomRow * love[0].length; String temp = love[row][column]; love[row][column] = love[randomRow][randomColumn]; love[randomRow][randomColumn] = temp; } /* for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ if(love[i][1]=="TOC "||love[i][1]=="ISEE "||love[i][2]=="TOC " ||love[i][2]=="ISEE "||love[i][1]=="SDl(2) "||love[i][2]=="SDl(2) "){ // l++; shift(love,0); } if(love[i][1]=="DESHMUKH-M"||love[i][2]=="DESHMUKH-M"){ if(y==2){ // l++; shift(love,2); } } if(love[i][1]=="DSA"||love[i][2]=="DSA"){ // l++; shift(love,2); } } }*/ return love; } String[][] change(String[][] take){ String temp; // System.out.println("take[0][1]\t"+take[0][1]+"take 04\t\t"+take[0][4]); temp=take[0][1]; take[0][1]=take[0][4]; take[0][4]=temp; temp=take[0][2]; take[0][2]=take[0][5]; take[0][5]=temp; temp=take[3][1]; take[3][1]=take[3][4]; take[3][4]=temp; temp=take[3][2]; take[3][2]=take[3][5]; take[3][5]=temp; methods met=new methods(); // met.print2(take,"#@#@###@@@@@@@@@@@@@@@@@@@@@@@@@@@###@#"); return take; } String[][] change1(String[][] take){ String temp; // System.out.println("take[0][1]\t"+take[0][1]+"take 04\t\t"+take[0][4]); temp=take[1][5]; take[1][5]=take[1][7]; take[1][7]=temp; temp=take[1][6]; take[1][6]=take[1][4]; take[1][4]=temp; temp=take[4][5]; take[4][5]=take[4][7]; take[4][7]=temp; temp=take[4][6]; take[4][6]=take[4][4]; take[4][4]=temp; methods met=new methods(); // met.print2(take,"#@#@###@@@@@@@@@@@@@@@@@@@@@@@@@@@###@#"); return take; } String[][] change2(String[][] take){ String temp; // System.out.println("take[0][1]\t"+take[0][1]+"take 04\t\t"+take[0][4]); temp=take[2][1]; take[2][1]=take[2][6]; take[2][6]=temp; temp=take[2][2]; take[2][2]=take[2][7]; take[2][7]=temp; methods met=new methods(); // met.print2(take,"#@#@###@@@@@@@@@@@@@@@@@@@@@@@@@@@###@#"); return take; } public void ALLCLASSRETRIEVESUBJECTS() { } }
[ "lmushtaq10@gmail.com" ]
lmushtaq10@gmail.com
6956d05c14ddb15fe9193cb23d45de2d506d3a48
c5e53ff39784fc51707fbf4d42311ce1ea02e8db
/src/main/java/Test/traverseTest.java
f0e5b3ae8d9620ae88ec637be4c8d6cd6b1e9964
[]
no_license
ubuntu11/UtilTest
fccdc00f5e7c8e378702604e4a859499e22075cb
86479d73e4df043dd94cce08e5d2b73fe75610b6
refs/heads/master
2023-06-25T14:14:48.952885
2021-07-29T08:59:14
2021-07-29T08:59:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,091
java
package Test; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class traverseTest { public static void main(String[] args) { List<String> list=new ArrayList<String>(); list.add("Hello"); list.add("World"); list.add("HAHAHAHA"); //第一种遍历方法使用foreach遍历List for (String str : list) { //也可以改写for(int i=0;i<list.size();i++)这种形式 System.out.println(str); } //第二种遍历,把链表变为数组相关的内容进行遍历 String[] strArray=new String[list.size()]; list.toArray(strArray); for(int i=0;i<strArray.length;i++) //这里也可以改写为 foreach(String str:strArray)这种形式 { System.out.println(strArray[i]); } //第三种遍历 使用迭代器进行相关遍历 Iterator<String> ite=list.iterator(); while(ite.hasNext())//判断下一个元素之后有值 { System.out.println(ite.next()); } } }
[ "574484572@qq.com" ]
574484572@qq.com
3d046b66c8c0b698b3c68b2261d8e0dae2c2ec05
0357f8fa432606c59e5a09081e9a57ce7ca58c7f
/src/chessTests/RookGetMoves.java
fc18fb0c8950ec8fbca81317953c2e4846318baa
[]
no_license
mark-shan/Chess
c5c139a32526c7a81c15f90dc68b942cee9419f3
935ef35553dcfaf4dbacfa68517924a198e39756
refs/heads/master
2022-07-09T21:43:05.760864
2020-05-13T00:49:49
2020-05-13T00:49:49
117,397,165
0
0
null
null
null
null
UTF-8
Java
false
false
4,195
java
package chessTests; import static org.junit.Assert.*; import chess.*; import java.util.ArrayList; import org.junit.Test; //Tests Rook.getPossibleMoves public class RookGetMoves extends ChessTestBase { public RookGetMoves(){ super(); } @Test public void test() { System.out.println("--Rook Tests: Start--"); System.out.println(); this.allMovements(); this.moveAndAttacks(); this.moveAndInCheck(); this.moveStopCheck(); System.out.println(); System.out.println("--Rook Tests: Done--"); } //Tests all rook moves without attacks public void allMovements(){ System.out.println("allMovements: Start"); this.reset(); Rook testRook = new Rook(this.model, PlayerColour.WHITE, new Position(2,4)); ArrayList<Position> testMoves; this.model.addPiece(testRook); testMoves = testRook.getPossibleMoves(); ArrayList<Position> expectedMoves = new ArrayList<Position>(); //Left expectedMoves.add(new Position(1,4)); expectedMoves.add(new Position(0,4)); //Up expectedMoves.add(new Position(2,5)); expectedMoves.add(new Position(2,6)); expectedMoves.add(new Position(2,7)); //Right expectedMoves.add(new Position(3,4)); expectedMoves.add(new Position(4,4)); expectedMoves.add(new Position(5,4)); expectedMoves.add(new Position(6,4)); expectedMoves.add(new Position(7,4)); //Down expectedMoves.add(new Position(2,3)); expectedMoves.add(new Position(2,2)); expectedMoves.add(new Position(2,1)); expectedMoves.add(new Position(2,0)); this.compareMoves(expectedMoves, testMoves); System.out.println("allMovemovements: Done"); } //Tests all rook moves and attacks public void moveAndAttacks(){ System.out.println("moveAndAttacks: Start"); this.reset(); Rook testRook = new Rook(this.model, PlayerColour.WHITE, new Position(2,4)); ArrayList<Position> testMoves; this.model.addPiece(testRook); ArrayList<Position> expectedMoves = new ArrayList<Position>(); //Left Pawn testBlocker1 = new Pawn(this.model, PlayerColour.WHITE, new Position(1,4)); //Up expectedMoves.add(new Position(2,5)); Pawn testTarget1 = new Pawn(this.model, PlayerColour.BLACK, new Position(2,5)); //Right expectedMoves.add(new Position(3,4)); Pawn testTarget2 = new Pawn(this.model, PlayerColour.BLACK, new Position(3,4)); //Down expectedMoves.add(new Position(2,3)); expectedMoves.add(new Position(2,2)); expectedMoves.add(new Position(2,1)); expectedMoves.add(new Position(2,0)); this.model.addPiece(testTarget1); this.model.addPiece(testTarget2); this.model.addPiece(testBlocker1); testMoves = testRook.getPossibleMoves(); this.compareMoves(expectedMoves, testMoves); System.out.println("moveAndAttacks: Done"); } //Tests when rook moving may put its king in check public void moveAndInCheck(){ System.out.println("moveAndInCheck: Start"); this.reset(); Rook testRook = new Rook(this.model, PlayerColour.WHITE, new Position(2,0)); Rook checkRook = new Rook(this.model, PlayerColour.BLACK, new Position(0,0)); ArrayList<Position> testMoves; this.model.addPiece(testRook); this.model.addPiece(checkRook); testMoves = testRook.getPossibleMoves(); ArrayList<Position> expectedMoves = new ArrayList<Position>(); //All movements on its row is valid for (int c = 0; c <= 6; c++){ if (c == 2) continue; expectedMoves.add(new Position(c,0)); } this.compareMoves(expectedMoves, testMoves); System.out.println("moveAndInCheck: Done"); } //Tests when Rook can move to stop the king from being in check public void moveStopCheck(){ System.out.println("moveStopCheck: Start"); this.reset(); Rook testRook = new Rook(this.model, PlayerColour.WHITE, new Position(2,1)); Queen checkQueen = new Queen(this.model, PlayerColour.BLACK, new Position(0,0)); ArrayList<Position> testMoves; this.model.addPiece(testRook); this.model.addPiece(checkQueen); testMoves = testRook.getPossibleMoves(); ArrayList<Position> expectedMoves = new ArrayList<Position>(); expectedMoves.add(new Position(2,0)); this.compareMoves(expectedMoves, testMoves); System.out.println("moveStopCheck: Done"); } }
[ "k5shan@edu.uwaterloo.ca" ]
k5shan@edu.uwaterloo.ca
75c4ac107ca42918e762f5deace97f3240a3c6b1
be9ac5e596093d3e34a35003c0d9d520163c91b8
/CozinhaIndustrialWeb/src/br/edu/ifba/se/cozinhaindustrial/Monitor.java
ecfb58dfad6f6b36fbc4e18a349fae22c39c8041
[]
no_license
Deaple/SistemasEmbarcadosII
efd20fa70299ab7bdbc4b245ea5073f0cf644b75
6c8347474d67ffb519f2c6076531405e25d9730c
refs/heads/master
2021-01-10T18:02:37.871685
2016-01-08T18:52:34
2016-01-08T18:53:11
46,568,273
0
1
null
2015-11-26T22:01:03
2015-11-20T14:58:37
null
ISO-8859-1
Java
false
false
4,477
java
package br.edu.ifba.se.cozinhaindustrial; import java.io.Serializable; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import org.primefaces.model.chart.Axis; import org.primefaces.model.chart.AxisType; import org.primefaces.model.chart.LineChartModel; import org.primefaces.model.chart.LineChartSeries; import org.primefaces.model.chart.MeterGaugeChartModel; import org.primefaces.model.chart.PieChartModel; import br.edu.ifba.se.cozinhaindustrial.conector.SingleConector; @SuppressWarnings("serial") @ManagedBean(name = "monitor") public class Monitor implements Serializable { private MeterGaugeChartModel modeloMedidorGas; private MeterGaugeChartModel modeloMedidorChamas; private PieChartModel modeloGraficoPizza; private LineChartModel modeloGraficoLinha; private static int segundos=0; @PostConstruct public void iniciar() { configurarMedidor(); configurarGraficoPizza(); configurarGraficoLinha(); } public Informacao lerSensoresRetorno() { Informacao info = SingleConector.getInformacao(); return info; } public void lerSensores() { Informacao info = SingleConector.getInformacao(); int temperatura = info.getTemperatura(); int gas = info.getGas(); int chamas = info.getChamas(); System.out.println("Temperatura: " + temperatura + " Gas: " + gas + " Chamas: " + chamas); modeloMedidorGas.setValue(gas); modeloMedidorChamas.setValue(chamas); } private void configurarMedidor() { modeloMedidorGas = criarModeloMedidorGas(); modeloMedidorGas.setTitle("Vazamento de Gás"); modeloMedidorGas.setGaugeLabel("%"); modeloMedidorGas.setSeriesColors("7CFC00,FFFF00,FFA500,f97b4e,FF0000"); modeloMedidorChamas = criarModeloMedidorChamas(); modeloMedidorChamas.setTitle("Detecção de Incêndio"); modeloMedidorChamas.setGaugeLabel("%"); modeloMedidorChamas.setSeriesColors("cdede7,50d380,ead539,fa7929,f42f2f"); } private void configurarGraficoLinha(){ modeloGraficoLinha = iniciarModeloLinha(); modeloGraficoLinha.setTitle("Medidor Temperatura(°C)"); modeloGraficoLinha.setLegendPosition("w"); Axis yAxis = modeloGraficoLinha.getAxis(AxisType.Y); yAxis.setMin(0); yAxis.setMax(100); Axis xAxis = modeloGraficoLinha.getAxis(AxisType.X); xAxis.setMin(0); } private LineChartModel iniciarModeloLinha(){ LineChartModel modelo = new LineChartModel(); LineChartSeries seriesTemperatura = new LineChartSeries("Sensor Temperatura"); Informacao info = SingleConector.getInformacao(); seriesTemperatura.setFill(true); seriesTemperatura.set(0,0); //variação do tempo em segundos segundos = segundoAtual(); seriesTemperatura.set(segundos, info.getTemperatura()); modelo.addSeries(seriesTemperatura); return modelo; } public LineChartModel getModeloGraficoLinha(){ return modeloGraficoLinha; } private MeterGaugeChartModel criarModeloMedidorGas() { List<Number> marcadores = new ArrayList<Number>(); marcadores.add(20); marcadores.add(40); marcadores.add(60); marcadores.add(80); marcadores.add(100); return new MeterGaugeChartModel(0, marcadores); } private MeterGaugeChartModel criarModeloMedidorChamas(){ List<Number> marcadores = new ArrayList<Number>(); marcadores.add(20); marcadores.add(40); marcadores.add(60); marcadores.add(80); marcadores.add(100); return new MeterGaugeChartModel (0,marcadores); } public MeterGaugeChartModel getModeloMedidorGas() { return modeloMedidorGas; } public MeterGaugeChartModel getModeloMedidorChamas(){ return modeloMedidorChamas; } public void configurarGraficoPizza() { modeloGraficoPizza = new PieChartModel(); } public PieChartModel getModeloGraficoPizza() { Informacao info = lerSensoresRetorno(); modeloGraficoPizza.getData().put("Temperatura: ", info.getTemperatura()); modeloGraficoPizza.getData().put("Detecção de Gas", info.getGas()); modeloGraficoPizza.getData().put("Detecção Incêndio", info.getChamas()); // Criar modelo modeloGraficoPizza.setSeriesColors("ff0000,ffff00,ff8000"); modeloGraficoPizza.setTitle("Variação dos Sensores"); modeloGraficoPizza.setLegendPosition("e"); modeloGraficoPizza.setFill(false); modeloGraficoPizza.setDiameter(300); modeloGraficoPizza.setShowDataLabels(true); return modeloGraficoPizza; } public int segundoAtual(){ return Calendar.getInstance().get(Calendar.SECOND); } }
[ "yzaak.silva@gmail.com" ]
yzaak.silva@gmail.com
5f7dd5d31300c546c51026c82f5faacf74dcb07d
6ae9e094c1b3a4282767cf1e3fee2918b7147901
/src/Chapter1/Matrix.java
50d763062d0d88d605176346078aabd404c9a12d
[]
no_license
Vestjevs/AlgorithmsAndStructuresData
64b3904018728d9c595259bef88ebd390d6ccbba
7847b579ac2a0d748291f27d6082b71478749c3b
refs/heads/master
2021-06-23T19:30:27.336982
2019-08-27T16:52:03
2019-08-27T16:52:03
148,539,586
1
0
null
null
null
null
UTF-8
Java
false
false
2,312
java
package Chapter1; import java.util.Arrays; public class Matrix<E extends Number> { Matrix() { } public static double dot(double[] x, double[] y) { double parentheses = 0; for (int i = 0; i < x.length; i++) { parentheses += x[i] * y[i]; } return parentheses; } public static double[][] mult(double[][] a, double[][] b) { double[][] c = new double[a.length][a.length]; for (int i = 0; i < a.length; i++) { for (int j = 0; j < a.length; j++) { for (int k = 0; k < a.length; k++) { c[i][j] += a[i][k] * b[k][j]; } } } return c; } public static double[][] transpose(double[][] a) { double value; for (int i = 0; i < a.length; i++) { for (int j = 0; j < i; j++) { if (i != j) { value = a[i][j]; a[i][j] = a[j][i]; a[j][i] = value; } } } return a; } public static double[] mult(double[][] a, double[] x) { double[] ans = new double[x.length]; for (int i = 0; i < x.length; i++) { for (int j = 0; j < x.length; j++) { ans[i] += a[i][j] * x[j]; } } return ans; } public static double[] mult(double[] y, double[][] a) { double[] ans = new double[y.length]; for (int i = 0; i < y.length; i++) { for (int j = 0; j < y.length; j++) { ans[i] += a[i][j] * y[j]; } } return ans; } public static double[][] mult(double[][] a, double x) { for (int i = 0; i < a.length; i++) { for (int j = 0; j < a.length; j++) { a[i][j] *= x; } } return a; } public static double[][] divide(double[][] a, double x) { for (int i = 0; i < a.length; i++) { for (int j = 0; j < a.length; j++) { a[i][j] /= x; } } return a; } public static void main(String[] args) { double[][] array = {{1.0, 2.0, 5.0}, {3.0, 4.0, 6.0}, {7.0, 8.0, 9.0}}; double[] array2 = {1, 2, 8}; } }
[ "ac.lbear@yandex.ru" ]
ac.lbear@yandex.ru
8ad11908584eae6795594332566b71ca9cac7189
7a666fa7145c39982e3b696fc2c64e9d7268a06a
/demo-6-role-2/src/main/java/com/example/demo6role2/service/UserDetailServiceImpl.java
aff6452aca182bdc60da7ec36da2cc02aa6d51df
[]
no_license
lujiannt/spring-security-demos
5a1081748fa3a2245f50ac68fa2b5d6a7e5ea9d5
2659271831c988123620c552f842755c27a9b248
refs/heads/master
2020-06-27T15:21:36.819339
2019-08-02T09:29:41
2019-08-02T09:29:41
199,986,012
0
0
null
null
null
null
UTF-8
Java
false
false
1,647
java
package com.example.demo6role2.service; import com.example.demo6role2.entity.Role; import com.example.demo6role2.mapper.RoleMapper; import com.example.demo6role2.mapper.UserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service public class UserDetailServiceImpl implements UserDetailsService { @Autowired private UserMapper userMapper; @Autowired private RoleMapper roleMapper; @Override public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException { com.example.demo6role2.entity.User user = userMapper.selectUserByName(userName); if (user == null) { throw new RuntimeException("user is null"); } // 添加角色 List<Role> roles = roleMapper.selectRoleByUserId(user.getId()); List<GrantedAuthority> authorities = new ArrayList<>(); for (int i = 0; i < roles.size(); i++) { authorities.add(new SimpleGrantedAuthority(roles.get(i).getRoleName())); } User myUser = new User(user.getUsername(), user.getPassword(), authorities); return myUser; } }
[ "m15262012632_1@163.com" ]
m15262012632_1@163.com
0ed1e7e9acf4a7b00245c5d965abad44cfd38892
76db21d5d9531044246485fc689dc2946fd9e8a1
/src/main/java/de/axone/cache/ng/CacheWrapper.java
5a2568936f5c0c02bd74b500f6d1550675b668db
[ "MIT" ]
permissive
ScheintodX/AXON-E-Tools
263fe6d2949122a208eb2d06e0a558766fa88c2e
24ba96e54345875522c044b31e3611657527bfe9
refs/heads/master
2022-07-12T20:56:06.032894
2022-06-22T13:27:18
2022-06-22T13:27:18
13,351,879
0
0
null
null
null
null
UTF-8
Java
false
false
1,179
java
package de.axone.cache.ng; import java.util.Set; public abstract class CacheWrapper<K,O> implements CacheNG.Cache<K,O> { protected final CacheNG.Cache<K,O> wrapped; public CacheWrapper( CacheNG.Cache<K,O> wrapped ) { this.wrapped = wrapped; } @Override public CacheNG.Cache.Entry<O> fetchEntry( K key ) { return wrapped.fetchEntry( key ); } @Override public O fetch( K key ) { return wrapped.fetch( key ); } @Override public boolean isCached( K key ) { return wrapped.isCached( key ); } @Override public void invalidate( K key ) { wrapped.invalidate( key ); } @Override public void put( K key, O object ) { wrapped.put( key, object ); } @Override public void invalidateAll( boolean force ) { wrapped.invalidateAll( force ); } @Override public int size() { return wrapped.size(); } @Override public int capacity() { return wrapped.capacity(); } @Override public String info() { return wrapped.info(); } @Override public double ratio() { return wrapped.ratio(); } @Override public Set<K> keySet() { return wrapped.keySet(); } @Override public Iterable<O> values() { return wrapped.values(); } }
[ "f.bantner@axon-e.de" ]
f.bantner@axon-e.de
c2a619e002afdb930c597718b0c5b3552a2c71bf
82d85dad4824608626a3573ff63c8157e334a08e
/wear/src/main/java/com/droletours/com/standdetector/MainActivity.java
ad5267676e91e527a8ef1d6cea1520aea2365509
[]
no_license
dr0l3/StandDetector
693369f5f3cf8bd74c6b64ad681812871a5de6ab
fcc0b9dc53a719efd7d302de8cba7a5df02f6b38
refs/heads/master
2021-01-18T19:53:33.808392
2016-07-21T13:42:51
2016-07-21T13:42:51
63,872,575
0
0
null
null
null
null
UTF-8
Java
false
false
10,703
java
/* * Copyright 2015 Dejan Djurovski * * 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.droletours.com.standdetector; import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.support.wearable.activity.ConfirmationActivity; import android.support.wearable.view.DismissOverlayView; import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.ResultCallback; import com.google.android.gms.wearable.MessageApi; import com.google.android.gms.wearable.Node; import com.google.android.gms.wearable.NodeApi; import com.google.android.gms.wearable.Wearable; public class MainActivity extends Activity { private final String MESSAGE1_PATH = "/message1"; private final String MESSAGE2_PATH = "/message2"; private GoogleApiClient apiClient; private NodeApi.NodeListener nodeListener; private MessageApi.MessageListener messageListener; private String remoteNodeId; private Handler handler; private GestureDetector mGestureDetector; private DismissOverlayView mDismissOverlayView; private long time_at_last_correction; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); handler = new Handler(); time_at_last_correction = 0; mDismissOverlayView = (DismissOverlayView) findViewById(R.id.dismiss_overlay); mDismissOverlayView.setIntroText("Long press to exit"); mDismissOverlayView.showIntroIfNecessary(); mGestureDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener(){ public void onLongPress(MotionEvent ev){ mDismissOverlayView = (DismissOverlayView) findViewById(R.id.dismiss_overlay); mDismissOverlayView.show(); } public boolean onScroll(MotionEvent ev1, MotionEvent ev2, float distanceX, float distanceY){ Log.d("debug", String.format("Scroll performed! (%1$f, %2$f) -> (%3$f, %4$f)", ev1.getRawX(), ev1.getRawY(), ev2.getRawX(), ev2.getRawY())); long current_time = System.currentTimeMillis(); if(isCloseToEdge(ev2) && timePassedSinceLastCorrection(current_time) > 1000){ SwipeDirection direction = getDirectionFromEvent(ev2); handleCorrection(direction); Log.d("debug", "Direction swiped = " + direction.toString()); time_at_last_correction = current_time; return true; } return false; } }); // Create NodeListener that enables buttons when a node is connected and disables buttons when a node is disconnected nodeListener = new NodeApi.NodeListener() { @Override public void onPeerConnected(Node node) { remoteNodeId = node.getId(); handler.post(new Runnable() { @Override public void run() { } }); Intent intent = new Intent(getApplicationContext(), ConfirmationActivity.class); intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.SUCCESS_ANIMATION); intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, "Peer connected"); startActivity(intent); } @Override public void onPeerDisconnected(Node node) { handler.post(new Runnable() { @Override public void run() { } }); Intent intent = new Intent(getApplicationContext(), ConfirmationActivity.class); intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.FAILURE_ANIMATION); intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, "Peer disconnected"); startActivity(intent); } }; // Create GoogleApiClient apiClient = new GoogleApiClient.Builder(getApplicationContext()).addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() { @Override public void onConnected(Bundle bundle) { // Register Node and Message listeners Wearable.NodeApi.addListener(apiClient, nodeListener); //Wearable.MessageApi.addListener(apiClient, messageListener); // If there is a connected node, get it's id that is used when sending messages Wearable.NodeApi.getConnectedNodes(apiClient).setResultCallback(new ResultCallback<NodeApi.GetConnectedNodesResult>() { @Override public void onResult(NodeApi.GetConnectedNodesResult getConnectedNodesResult) { Log.d("debug", "Getconnectednodesresult = " + getConnectedNodesResult.getStatus().getStatusMessage()); Log.d("debug", "Number of nodes = " +getConnectedNodesResult.getNodes().size()); if (getConnectedNodesResult.getStatus().isSuccess() && getConnectedNodesResult.getNodes().size() > 0) { remoteNodeId = getConnectedNodesResult.getNodes().get(0).getId(); } } }); } @Override public void onConnectionSuspended(int i) { } }).addApi(Wearable.API).build(); } private long timePassedSinceLastCorrection(long current_time) { return current_time - time_at_last_correction; } @Override public boolean onTouchEvent(MotionEvent ev){ return mGestureDetector.onTouchEvent(ev) || super.onTouchEvent(ev); } private SwipeDirection getDirectionFromEvent(MotionEvent ev2) { double center = 160; double angle = Math.atan2(ev2.getRawX()-center, ev2.getRawY()-center)*180/ Math.PI; Log.d("debug", "X = " + ev2.getRawX() + " Y = " + ev2.getRawY() + " angle = " + angle); if(Math.abs(angle) > 135){ return SwipeDirection.SWIPE_DIRECTION_UP; } else if(angle < -45){ return SwipeDirection.SWIPE_DIRECTION_LEFT; } else if(angle < 45) { return SwipeDirection.SWIPE_DIRECTION_DOWN; } else { return SwipeDirection.SWIPE_DIRECTION_RIGHT; } } private void handleCorrection(SwipeDirection direction) { String message; switch (direction){ case SWIPE_DIRECTION_DOWN: message = "/correction_sit"; break; case SWIPE_DIRECTION_UP: message = "/correction_stand"; break; case SWIPE_DIRECTION_LEFT: message = "/correction_null"; break; case SWIPE_DIRECTION_RIGHT: message = "/correction_wrong"; break; default: return; } Wearable.MessageApi.sendMessage(apiClient, remoteNodeId, message, null).setResultCallback(new ResultCallback<MessageApi.SendMessageResult>() { @Override public void onResult(MessageApi.SendMessageResult sendMessageResult) { Intent intent = new Intent(getApplicationContext(), ConfirmationActivity.class); if (sendMessageResult.getStatus().isSuccess()) { intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.SUCCESS_ANIMATION); intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, sendMessageResult.getStatus().getStatusMessage()); } else { intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.FAILURE_ANIMATION); intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, sendMessageResult.getStatus().getStatusMessage()); } Log.d("debug","Correctionresult = " + sendMessageResult.getStatus().getStatusMessage()); startActivity(intent); finish(); } }); } private boolean isCloseToEdge(MotionEvent ev) { float center = 160; double distance_to_center = getDistanceToCenter(ev,center); return distance_to_center>70; } private boolean isInMiddleRegion(MotionEvent ev) { float center = 160; double distance_to_center = getDistanceToCenter(ev, center); return distance_to_center<70; } private double getDistanceToCenter(MotionEvent ev, float center) { return Math.sqrt(Math.pow(Math.abs(ev.getRawX()-center),2) + Math.pow(Math.abs(ev.getRawY()-center),2)); } @Override protected void onResume() { super.onResume(); // Check is Google Play Services available int connectionResult = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()); if (connectionResult != ConnectionResult.SUCCESS) { // Google Play Services is NOT available. Show appropriate error dialog GooglePlayServicesUtil.showErrorDialogFragment(connectionResult, this, 0, new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { finish(); } }); } else { apiClient.connect(); } } @Override protected void onPause() { // Unregister Node and Message listeners, disconnect GoogleApiClient and disable buttons Wearable.NodeApi.removeListener(apiClient, nodeListener); Wearable.MessageApi.removeListener(apiClient, messageListener); apiClient.disconnect(); super.onPause(); } }
[ "Rune Pedersen" ]
Rune Pedersen
97683bda32461a9260230bff93c807351240751c
8188b4b8758983d99866ee3e9502fe4617d74db8
/src/main/java/com/communeup/web/rest/BaseController.java
96a5989a225ad3c944ffa5e8b238884d7acc26da
[ "Apache-2.0" ]
permissive
jarvisxiong/CROL-WebApp
a18297d428d979aa9d7cc580c8955ab032d69ac6
0bc4493095a7f1cd4c046058ee9967c500e44101
refs/heads/master
2021-01-21T07:57:50.557751
2015-07-04T17:52:19
2015-07-04T17:52:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,632
java
package com.communeup.web.rest; import java.util.HashSet; import java.util.Set; import javax.ws.rs.Consumes; import javax.ws.rs.Produces; import javax.ws.rs.core.Application; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.SecurityContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; @Controller @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public class BaseController extends Application { protected static final String ITEM = "item"; protected static final String NOTICE = "notice"; protected static final String ITEM_CODE = "I"; protected static final String NOTICE_CODE = "N"; protected static final String TAG = "T"; protected static final String PERSON = "P"; protected static final String SUBJECT = "S"; protected static final String ADDRESS = "A"; protected static final String MEETING = "M"; protected static final String ORGANIZATION = "O"; protected Logger log = LoggerFactory.getLogger(this.getClass()); @Context protected SecurityContext sc; protected String getAuthUserName() { return sc.getUserPrincipal().getName(); } public SecurityContext getSc() { return sc; } public void setSc(SecurityContext sc) { this.sc = sc; } private Set<Object> singletons = new HashSet<Object>(); private Set<Class<?>> empty = new HashSet<Class<?>>(); @Override public Set<Class<?>> getClasses() { return empty; } @Override public Set<Object> getSingletons() { return singletons; } }
[ "team@commune.io" ]
team@commune.io
38866b5ae11a1e54bcc9002f29ee3141bfa5607f
2605e0a59a6d36eb50648eb90fba0b33f47cefe3
/spring_test_server/src/main/java/ru/geekbrains/krylov/interview_preparation/spring_test_server/configs/JwtTokenUtil.java
41b5f520721773725049c0921d3acce2e6192cb8
[]
no_license
JackWizard88/interview_preparation
412eeea3a73921054c4093dfcbbd9ee39ffa7cdd
371881978d51c67ae5c859e248b9bba93f62bdf9
refs/heads/master
2023-03-25T18:21:05.092907
2021-03-23T04:54:35
2021-03-23T04:54:35
334,862,226
0
0
null
2021-03-23T04:54:36
2021-02-01T07:12:36
Java
UTF-8
Java
false
false
2,072
java
package ru.geekbrains.krylov.interview_preparation.spring_test_server.configs; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Component; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; @Component public class JwtTokenUtil { @Value("${jwt.secret}") private String secret; private <T> T getClaimFromToken(String token, Function<Claims, T> claimsResolver) { Claims claims = getAllClaimsFromToken(token); return claimsResolver.apply(claims); } public String getUsernameFromToken(String token) { return getClaimFromToken(token, Claims::getSubject); } public String generateToken(UserDetails userDetails) { Map<String, Object> claims = new HashMap<>(); List<String> rolesList = userDetails.getAuthorities().stream() .map(GrantedAuthority::getAuthority) .collect(Collectors.toList()); claims.put("role", rolesList); return doGenerateToken(claims, userDetails.getUsername()); } private String doGenerateToken(Map<String, Object> claims, String subject) { Date issuedDate = new Date(); Date expiredDate = new Date(issuedDate.getTime() + 60 * 60 * 1000); return Jwts.builder() .setClaims(claims) .setSubject(subject) .setIssuedAt(issuedDate) .setExpiration(expiredDate) .signWith(SignatureAlgorithm.HS256, secret) .compact(); } private Claims getAllClaimsFromToken(String token) { return Jwts.parser() .setSigningKey(secret) .parseClaimsJws(token) .getBody(); } }
[ "krilovavit@mail.ru" ]
krilovavit@mail.ru
9f5630aa0e6d2fd8c32bde8b13a41548dc17bf6b
be31c92bc7e982c1b1f5c0719a794dbefb3017cf
/src/main/java/com/three360/fixatdl/core/AmtT.java
d4a4e5d6278126d7eba86e6847cee782d00bca63
[]
no_license
sc659987/Fx8AtdlGenerator
a4cbc57e9111d00110816c0688c8ea7716f79b75
eb6f4c4a4b66191f543650fe61af346b2546d682
refs/heads/master
2021-01-23T00:25:14.759055
2017-03-27T15:51:03
2017-03-27T15:51:03
85,729,703
0
0
null
null
null
null
UTF-8
Java
false
false
3,104
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2010.02.24 at 10:55:05 AM CST // package com.three360.fixatdl.core; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import java.math.BigDecimal; /** * Derived parameter type corresponding to the FIX "Amt" type defined in the FIX specification. * <p> * <p>Java class for Amt_t complex type. * <p> * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;complexType name="Amt_t"> * &lt;complexContent> * &lt;extension base="{http://www.fixprotocol.org/FIXatdl-1-1/Core}Numeric_t"> * &lt;attribute name="minValue" type="{http://www.fixprotocol.org/FIXatdl-1-1/Core}Amt" default="0" /> * &lt;attribute name="maxValue" type="{http://www.fixprotocol.org/FIXatdl-1-1/Core}Amt" /> * &lt;attribute name="constValue" type="{http://www.fixprotocol.org/FIXatdl-1-1/Core}Amt" /> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Amt_t") public class AmtT extends NumericT { @XmlAttribute protected BigDecimal minValue; @XmlAttribute protected BigDecimal maxValue; @XmlAttribute protected BigDecimal constValue; /** * Gets the value of the minValue property. * * @return possible object is * {@link BigDecimal } */ public BigDecimal getMinValue() { if (minValue == null) { return new BigDecimal("0"); } else { return minValue; } } /** * Sets the value of the minValue property. * * @param value allowed object is * {@link BigDecimal } */ public void setMinValue(BigDecimal value) { this.minValue = value; } /** * Gets the value of the maxValue property. * * @return possible object is * {@link BigDecimal } */ public BigDecimal getMaxValue() { return maxValue; } /** * Sets the value of the maxValue property. * * @param value allowed object is * {@link BigDecimal } */ public void setMaxValue(BigDecimal value) { this.maxValue = value; } /** * Gets the value of the constValue property. * * @return possible object is * {@link BigDecimal } */ public BigDecimal getConstValue() { return constValue; } /** * Sets the value of the constValue property. * * @param value allowed object is * {@link BigDecimal } */ public void setConstValue(BigDecimal value) { this.constValue = value; } }
[ "Sainik123$" ]
Sainik123$
64f5cfd4faf9cb47f97e80e4e5ad4a544aa93797
0aadc3265b7e283154bf7baf28685be55668a343
/app/src/test/java/com/evan/etcweb/ExampleUnitTest.java
166b464dbf2666d15972c5cbcc85cad7ad3be6a0
[]
no_license
northwind99/etcApp
459957867f3a8d9caf84301c13b6350415adb864
591df592e8fcf9a3f67dec9adbfca65ef0293aa7
refs/heads/master
2021-01-11T08:48:41.762732
2016-09-21T18:43:39
2016-09-21T18:43:39
68,847,214
0
0
null
null
null
null
UTF-8
Java
false
false
308
java
package com.evan.etcweb; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "evanchen517@gmail.com" ]
evanchen517@gmail.com
c393f560da96bb1b815415df50b353e3c9f62be8
93de0f492db1a5105c51d76d66ab78429d1d4edb
/src/main/java/study/elasticsearch/TestEs.java
83bda935ce66d5f5b99ea9e2a3e36f91f7804aa9
[]
no_license
wangjingf/onlyforstudy
5a7cb0538f3277e7180f113d2bbfc0ca23b9ed07
ef19167138836957d3de72bcbee35b8b6ac15732
refs/heads/master
2022-12-21T09:55:23.673174
2022-01-15T07:40:21
2022-01-15T07:40:21
107,334,182
1
1
null
2022-12-10T06:23:12
2017-10-17T23:16:45
Java
UTF-8
Java
false
false
677
java
package study.elasticsearch; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import study.elasticsearch.spring.entity.Article; public class TestEs { public static void main(String[] args) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-data-elasticsearch.xml"); context.refresh(); ElasticsearchRestTemplate restTemplate = context.getBean(ElasticsearchRestTemplate.class); restTemplate.indexOps(Article.class).create(); restTemplate.indexOps(Article.class).putMapping(); } }
[ "wangjingfang3@jd.com" ]
wangjingfang3@jd.com
5e002538a0c97692fa6c502a7b8fbb67b0275428
769a470dbb1baf99fdeaeb794f16912e31dc2baa
/src/main/java/org/archive/format/http/HttpRequestMessage.java
ef0c4220531d1eaca49cb2694ad106cd11be32c9
[ "Apache-2.0" ]
permissive
iipc/webarchive-commons
70879bb2cf2d1c7a6e2b8bd7bd181e5eee1ab05c
7cb3784cea86feedae335e7ec45ba46e924099d9
refs/heads/master
2021-05-22T08:15:59.484817
2021-03-16T19:30:07
2021-03-16T19:30:07
8,869,966
30
43
Apache-2.0
2021-03-16T19:30:08
2013-03-19T03:24:02
Java
UTF-8
Java
false
false
901
java
package org.archive.format.http; public class HttpRequestMessage extends HttpMessage implements HttpRequestMessageObserver { private int method = 0; private String path = null; public void messageParsed(int method, String path, int version, int bytes) { this.method = method; this.path = path; this.version = version; this.bytes = bytes; } public String getPath() { return path; } public int getMethod() { return method; } public String getMethodString() { switch(method) { case METHOD_GET : return METHOD_GET_STRING; case METHOD_HEAD : return METHOD_HEAD_STRING; case METHOD_POST : return METHOD_POST_STRING; case METHOD_PUT : return METHOD_PUT_STRING; case METHOD_TRACE : return METHOD_TRACE_STRING; case METHOD_DELETE : return METHOD_DELETE_STRING; case METHOD_CONNECT : return METHOD_CONNECT_STRING; } return METHOD_UNK_STRING; } }
[ "bradtofel@69e27eb3-6e27-0410-b9c6-fffd7e226fab" ]
bradtofel@69e27eb3-6e27-0410-b9c6-fffd7e226fab
a8e42a4131231f2cdc2a99573271426ae8cae643
cc17436438411b2cb5979bca0b2668b503a85e5a
/src/main/java/com/fantasticsource/setbonus/client/ClientData.java
5b9cd81fc55bcd557e072afbc0922c42538b179c
[]
no_license
Laike-Endaril/Set-Bonus
b7ce120ae08dd4bd6bebb8c80c63eaa631a5339d
363c9c5f63a7d042c02ba53df7fe498072408b2a
refs/heads/1.12.2
2021-06-22T06:51:10.744437
2021-01-16T06:50:52
2021-01-16T06:50:52
174,555,132
4
6
null
2020-10-08T23:01:41
2019-03-08T14:48:59
Java
UTF-8
Java
false
false
3,165
java
package com.fantasticsource.setbonus.client; import com.fantasticsource.setbonus.common.Network; import com.fantasticsource.setbonus.common.bonuselements.ModifierBonus; import com.fantasticsource.setbonus.common.bonuselements.PotionBonus; import com.fantasticsource.setbonus.common.bonusrequirements.setrequirement.Equip; import com.fantasticsource.setbonus.common.bonusrequirements.setrequirement.Set; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.Side; import java.util.LinkedHashMap; public class ClientData { public static LinkedHashMap<String, Equip> equipment = new LinkedHashMap<>(); public static LinkedHashMap<String, Set> sets = new LinkedHashMap<>(); public static LinkedHashMap<String, ClientBonus> bonuses = new LinkedHashMap<>(); public static void clear() { ClientBonus.dropAll(); equipment.clear(); sets.clear(); } public static void update(Network.ConfigPacket packet) { //Clear any existing data ClientBonus.dropAll(); equipment.clear(); sets.clear(); //Initialize equipment for (String equipString : packet.equipment) { Equip equip = Equip.getInstance(equipString); if (equip != null) equipment.put(equip.id, equip); } //Initialize sets for (String setString : packet.sets) { Set set = Set.getInstance(setString, Side.CLIENT); if (set != null) sets.put(set.id, set); } //Initialize bonuses for (String bonusString : packet.bonuses) { ClientBonus bonus = ClientBonus.getInstance(bonusString); if (bonus != null) bonuses.put(bonus.id, bonus); } //Initialize attribute modifiers for (String modifierString : packet.attributeMods) { ModifierBonus.getInstance(modifierString, Side.CLIENT); } //Initialize potions for (String potionString : packet.potions) { PotionBonus.getInstance(potionString, Side.CLIENT); } } public static void update(Network.DiscoverBonusPacket packet) { //Initialize equipment for (String equipString : packet.equipment) { Equip equip = Equip.getInstance(equipString); if (equip != null) equipment.put(equip.id, equip); } //Initialize sets for (String setString : packet.sets) { Set set = Set.getInstance(setString, Side.CLIENT); if (set != null) sets.put(set.id, set); } //Initialize bonus ClientBonus bonus = ClientBonus.getInstance(packet.bonusString); if (bonus != null) bonuses.put(bonus.id, bonus); //Initialize attribute modifiers for (String modifierString : packet.attributeMods) { ModifierBonus.getInstance(modifierString, Side.CLIENT); } //Initialize potions for (String potionString : packet.potions) { PotionBonus.getInstance(potionString, Side.CLIENT); } } }
[ "silvertallon@gmail.com" ]
silvertallon@gmail.com
bfa5f962e19af25ad1544cf225b5cc51cbfb5f10
a981e015dbb2ce0ea246d5fd931e30368ddf1d24
/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/task/MetricsTask.java
37cdab50b0e9ac5ef356bd8d4a99ceb85960232e
[ "Apache-2.0" ]
permissive
IOTdailinwei/streamx
ced3a74470d31dc2db8ec23edc28e561026e322f
16fee3a9d4e66530b533d2ab612bb5310b6fa15b
refs/heads/main
2023-07-14T20:42:11.750298
2021-08-09T02:43:38
2021-08-09T02:43:38
399,316,543
1
0
Apache-2.0
2021-08-24T02:59:13
2021-08-24T02:59:12
null
UTF-8
Java
false
false
2,260
java
/* * Copyright (c) 2019 The StreamX Project * <p> * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.streamxhub.streamx.console.core.task; import com.streamxhub.streamx.console.base.util.WebUtils; import com.streamxhub.streamx.console.core.service.FlameGraphService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.io.File; import java.util.*; /** * @author benjobs */ @Slf4j @Component public class MetricsTask { @Autowired private FlameGraphService flameGraphService; private final String FLAMEGRAPH_FILE_REGEXP = "\\d+_\\d+\\.json|\\d+_\\d+\\.folded|\\d+_\\d+\\.svg"; /** * hour. */ @Scheduled(cron = "0 0 * * * ?") public void cleanFlameGraph() { // 1) clean file String tempPath = WebUtils.getAppDir("temp"); File temp = new File(tempPath); Arrays.stream(Objects.requireNonNull(temp.listFiles())) .filter(x -> x.getName().matches(FLAMEGRAPH_FILE_REGEXP)) .forEach(File::delete); // 2 clean date Date start = new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getDefault()); calendar.setTime(start); calendar.add(Calendar.HOUR_OF_DAY, -24); Date end = calendar.getTime(); flameGraphService.clean(end); } }
[ "benjobs@qq.com" ]
benjobs@qq.com
64d680e3ce0d8c1b6894f128f2f4e68b7454aa37
a223acc176d6907f6a1f8a21cf997fc45b4dc0b7
/CoreJava/StaticDemo/src/A.java
a2813a7b238e8b2a9a415c432b9e7d072a3d656e
[]
no_license
manohar427/Batch_13
c7f38ddbf52ee5758f74ca9718fb9dbcab484261
aa56a3e27a49537a513651ff9d0a81741f05925e
refs/heads/master
2021-01-16T18:27:26.671381
2017-09-19T03:34:29
2017-09-19T03:34:29
100,084,548
0
0
null
null
null
null
UTF-8
Java
false
false
59
java
public class A { int x = 10; static int y = 20; }
[ "manohar427@gmail.com" ]
manohar427@gmail.com
8e6f04adcfaf52e4af43f9cf9978b9aa0f072967
7e0f5925427ebd2f2faf5e613187339ed70e0450
/PicassoSample/app/src/main/java/com/think/linxuanxuan/picassosample/picassoSource/DeferredRequestCreator.java
925c8a79bf0a7dd5e924f722d84df20b80d9628f
[]
no_license
LxxCaroline/VolleySample
00fe8aace9fafd04b92be450a15376edd5f00a38
ad3586aaa8a2f17edb9ee7306fd44d3564b9ba2a
refs/heads/master
2021-03-12T20:02:49.898111
2015-10-26T03:05:02
2015-10-26T03:05:02
43,275,200
1
0
null
null
null
null
UTF-8
Java
false
false
2,192
java
/* * Copyright (C) 2013 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.think.linxuanxuan.picassosample.picassoSource; import android.view.ViewTreeObserver; import android.widget.ImageView; import java.lang.ref.WeakReference; class DeferredRequestCreator implements ViewTreeObserver.OnPreDrawListener { final RequestCreator creator; final WeakReference<ImageView> target; Callback callback; @TestOnly DeferredRequestCreator(RequestCreator creator, ImageView target) { this(creator, target, null); } DeferredRequestCreator(RequestCreator creator, ImageView target, Callback callback) { this.creator = creator; this.target = new WeakReference<ImageView>(target); this.callback = callback; target.getViewTreeObserver().addOnPreDrawListener(this); } @Override public boolean onPreDraw() { ImageView target = this.target.get(); if (target == null) { return true; } ViewTreeObserver vto = target.getViewTreeObserver(); if (!vto.isAlive()) { return true; } int width = target.getWidth(); int height = target.getHeight(); if (width <= 0 || height <= 0) { return true; } vto.removeOnPreDrawListener(this); this.creator.unfit().resize(width, height).into(target, callback); return true; } void cancel() { creator.clearTag(); callback = null; ImageView target = this.target.get(); if (target == null) { return; } ViewTreeObserver vto = target.getViewTreeObserver(); if (!vto.isAlive()) { return; } vto.removeOnPreDrawListener(this); } Object getTag() { return creator.getTag(); } }
[ "hzlinxuanxuan@copr.netease.com" ]
hzlinxuanxuan@copr.netease.com
737665b8f53cc4fd771046be1bd124d700c73b1c
7a1fa8ac962f722d5a728a192b513521c9bf5676
/src/kiran/java/training/interfaceexample/InterfaceA.java
b8463925ad53405fdcc86404cc41c4948d924f83
[]
no_license
kiranpariyar/kiran_java_training
05213a6f2457196ad627c63e02b4e53200e1ee7f
d4cb2fc2e03962e6a2d1aac4d1e854e39ab80f02
refs/heads/master
2021-01-21T12:57:56.356947
2015-09-17T18:03:54
2015-09-17T18:03:54
39,291,280
0
0
null
null
null
null
UTF-8
Java
false
false
107
java
package kiran.java.training.interfaceexample; public interface InterfaceA { void printHelloWorld(); }
[ "kirannpariyar@gmail.com" ]
kirannpariyar@gmail.com
f35f601408f45936eec022619201b8735ed512b2
4abd603f82fdfa5f5503c212605f35979b77c406
/html/Programs/hw6-1-diff/r03849033-55-0/Diff.java
d66d007598a7d252979f2655b159fed2ee478cdd
[]
no_license
dn070017/1042-PDSA
b23070f51946c8ac708d3ab9f447ab8185bd2a34
5e7d7b1b2c9d751a93de9725316aa3b8f59652e6
refs/heads/master
2020-03-20T12:13:43.229042
2018-06-15T01:00:48
2018-06-15T01:00:48
137,424,305
0
0
null
null
null
null
UTF-8
Java
false
false
1,459
java
import java.util.Arrays; import java.util.Comparator; public class MyConvexHull { public static void main(String[] args) { Point2D[] a = new Point2D[10]; Point2D[] A = a; int N = a.length; for (int i = 0; i < N; i++) { double x = StdRandom.uniform(10); double y = StdRandom.uniform(10); a[i] = new Point2D(x, y); } Arrays.sort(a); Point2D p = new Point2D(a[0].x(), a[0].y()); Arrays.sort(a, p.POLAR_ORDER); String[] v = new String[N]; v[0]="""" + 0; v[1]="""" + 1; int num = 2; for (int i = 2; i < N; i++) { Point2D aa = a[Integer.parseInt(v[num-2])]; Point2D b = a[Integer.parseInt(v[num-1])]; Point2D c = a[i]; double ccw = (b.x()-aa.x())*(c.y()-aa.y()) - (b.y()-aa.y())*(c.x()-aa.x()); if(ccw > 0){ v[num]="""" + i; num++; } } String[] ConvexHullVertex = new String[num]; int x = 0; for(int i = 0; i < N; i++) { for(int j = 0; j < num; j++) { if (A[i].distanceTo(a[Integer.parseInt(v[j])])==0){ ConvexHullVertex[x]="""" + i; x++; break; } } } } }
[ "dn070017@gmail.com" ]
dn070017@gmail.com
176dddd1c4920d39ce57e2e92ca80688caf224b9
b6d00f570eb8fd30c3b33280b18a90ca9de0d9bb
/app/src/main/java/com/example/zh123/recommendationsystem/utils/ComputingUtil.java
52128bcbe23e7c04efaea2c5c1baa268b67d54a4
[]
no_license
NickWike/RecommendationSystem
d65c2259b96476d7ca7d39bc86a4cab89e1cfb04
3fe5eecd253e8223f1141df1e487e85bb028f8bb
refs/heads/master
2020-09-26T19:03:35.560823
2020-08-26T07:39:56
2020-08-26T07:39:56
226,320,317
2
2
null
null
null
null
UTF-8
Java
false
false
1,165
java
package com.example.zh123.recommendationsystem.utils; import java.math.BigDecimal; import java.text.DecimalFormat; /** * Created by zh123 on 20-3-20. */ public class ComputingUtil { public static String StringNumberAdd(String n1,String n2){ DecimalFormat df = new DecimalFormat("0.00"); BigDecimal decimalN1 = new BigDecimal(n1); BigDecimal decimalN2 = new BigDecimal(n2); BigDecimal addNumber = decimalN1.add(decimalN2); return df.format(addNumber); } public static String StringNumberSubtract(String n1,String n2){ DecimalFormat df = new DecimalFormat("0.00"); BigDecimal decimalN1 = new BigDecimal(n1); BigDecimal decimalN2 = new BigDecimal(n2); BigDecimal addNumber = decimalN1.subtract(decimalN2); return df.format(addNumber); } public static String StringNumberMultiply(String n1,int n2){ DecimalFormat df = new DecimalFormat("0.00"); BigDecimal decimalN1 = new BigDecimal(n1); BigDecimal decimalN2 = new BigDecimal(n2); BigDecimal addNumber = decimalN1.multiply(decimalN2); return df.format(addNumber); } }
[ "18983250721@163.com" ]
18983250721@163.com
833e8212d874df575d8e0d5148bae614917114f5
1b6ecad3272337928f5819bfc8683eeee1f19d89
/tags/ehcache-core-2.0.0/src/main/java/net/sf/ehcache/hibernate/AbstractEhcacheRegionFactory.java
4c2f1329d50981bb9e70cbc37b9b489de2fd3c8d
[]
no_license
MatthewRBruce/ehcache
77540643da5ca20b6fd5638221f4410a1baefe02
4365fc6cc87516344e95688c368d6a3d2cebbe5a
refs/heads/master
2020-12-27T18:55:00.785157
2015-01-21T07:11:38
2015-01-21T07:11:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,251
java
/** * Copyright 2003-2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.sf.ehcache.hibernate; import java.net.URL; import java.util.Properties; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Ehcache; import net.sf.ehcache.hibernate.management.impl.ProviderMBeanRegistrationHelper; import net.sf.ehcache.hibernate.regions.EhcacheQueryResultsRegion; import net.sf.ehcache.hibernate.regions.EhcacheTimestampsRegion; import net.sf.ehcache.hibernate.regions.EhcacheEntityRegion; import net.sf.ehcache.hibernate.regions.EhcacheCollectionRegion; import net.sf.ehcache.util.ClassLoaderUtil; import org.hibernate.cache.CacheDataDescription; import org.hibernate.cache.CacheException; import org.hibernate.cache.CollectionRegion; import org.hibernate.cache.EntityRegion; import org.hibernate.cache.QueryResultsRegion; import org.hibernate.cache.RegionFactory; import org.hibernate.cache.Timestamper; import org.hibernate.cache.TimestampsRegion; import org.hibernate.cache.access.AccessType; import org.hibernate.cfg.Settings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Abstract implementation of an Ehcache specific RegionFactory. * * @author Chris Dennis * @author Greg Luck * @author Emmanuel Bernard */ abstract class AbstractEhcacheRegionFactory implements RegionFactory { /** * The Hibernate system property specifying the location of the ehcache configuration file name. * <p/> * If not set, ehcache.xml will be looked for in the root of the classpath. * <p/> * If set to say ehcache-1.xml, ehcache-1.xml will be looked for in the root of the classpath. */ public static final String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME = "net.sf.ehcache.configurationResourceName"; private static final Logger LOG = LoggerFactory.getLogger(AbstractEhcacheRegionFactory.class); /** * MBean registration helper class instance for Ehcache Hibernate MBeans. */ protected final ProviderMBeanRegistrationHelper mbeanRegistrationHelper = new ProviderMBeanRegistrationHelper(); /** * Ehcache CacheManager that supplied Ehcache instances for this Hibernate RegionFactory. */ protected volatile CacheManager manager; /** * Settings object for the Hibernate persistence unit. */ protected Settings settings; /** * {@inheritDoc} */ public boolean isMinimalPutsEnabledByDefault() { return false; } /** * {@inheritDoc} */ public long nextTimestamp() { return Timestamper.next(); } /** * {@inheritDoc} */ public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException { return new EhcacheEntityRegion(getCache(regionName), settings, metadata, properties); } /** * {@inheritDoc} */ public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException { return new EhcacheCollectionRegion(getCache(regionName), settings, metadata, properties); } /** * {@inheritDoc} */ public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties) throws CacheException { return new EhcacheQueryResultsRegion(getCache(regionName), properties); } /** * {@inheritDoc} */ public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException { return new EhcacheTimestampsRegion(getCache(regionName), properties); } private Ehcache getCache(String name) throws CacheException { try { Ehcache cache = manager.getEhcache(name); if (cache == null) { LOG.warn("Couldn't find a specific ehcache configuration for cache named [" + name + "]; using defaults."); manager.addCache(name); cache = manager.getEhcache(name); LOG.debug("started EHCache region: " + name); } HibernateUtil.validateEhcache(cache); return cache; } catch (net.sf.ehcache.CacheException e) { throw new CacheException(e); } } /** * Load a resource from the classpath. */ protected static URL loadResource(String configurationResourceName) { ClassLoader standardClassloader = ClassLoaderUtil.getStandardClassLoader(); URL url = null; if (standardClassloader != null) { url = standardClassloader.getResource(configurationResourceName); } if (url == null) { url = AbstractEhcacheRegionFactory.class.getResource(configurationResourceName); } LOG.debug("Creating EhCacheRegionFactory from a specified resource: {}. Resolved to URL: {}", configurationResourceName, url); if (url == null) { LOG.warn("A configurationResourceName was set to {} but the resource could not be loaded from the classpath." + "Ehcache will configure itself using defaults.", configurationResourceName); } return url; } /** * Default access-type used when the configured using JPA 2.0 config. JPA 2.0 allows <code>@Cacheable(true)</code> to be attached to an * entity without any access type or usage qualification. * <p> * We are conservative here in specifying {@link AccessType#READ_WRITE} so as to follow the mantra of "do no harm". * <p> * This is a Hibernate 3.5 method. */ public AccessType getDefaultAccessType() { return AccessType.READ_WRITE; } }
[ "hhuynh@b9324663-ca0f-0410-8574-be9b3887307d" ]
hhuynh@b9324663-ca0f-0410-8574-be9b3887307d
b05f31591291879d953dc8c98b47897256e510fc
98ce1cc86650f8f153905d17db5164b8bd3572a5
/app/src/main/java/lloydst/aston/triporganiser/MainActivity.java
4e7aa0595a93617ff08a30d2eb8d21f9fc7ab311
[]
no_license
SignVOVA/devopssdk
8fce63fa3f352f4e23d335ce8ae2a9ce67bde992
4ade62f80d7ab9dba9d2c38b50a972d75e840e82
refs/heads/master
2021-01-19T13:03:59.275685
2017-08-19T22:09:56
2017-08-19T22:09:56
100,818,243
0
0
null
null
null
null
UTF-8
Java
false
false
1,677
java
package lloydst.aston.triporganiser; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import createTrip.AddTripActivity; import database.DBHelper; import editDefaultChecklist.EditDefaultTripChecklist; import editTrip.ViewTripActivity; import mapView.ViewFutureTripOnMapActivity; import mapView.ViewOnMapActivity; import mapView.ViewPastTripOnMapsActivity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DBHelper mydb = DBHelper.getInstance(this); } public void addTripButton(View view){ Intent intent = new Intent(this, AddTripActivity.class); startActivity(intent); } public void viewTripButton(View view){ Intent intent = new Intent(this, ViewTripActivity.class); startActivity(intent); } public void viewOnPastTripsOnMapButton(View view){ Intent intent = new Intent(this, ViewPastTripOnMapsActivity.class); startActivity(intent); } public void viewOnFutureTripsOnMapButton(View view){ Intent intent = new Intent(this, ViewFutureTripOnMapActivity.class); startActivity(intent); } public void editDefaultChecklistButton(View view){ Intent intent = new Intent(this, EditDefaultTripChecklist.class); startActivity(intent); } }
[ "vovamaksymchuk@gmail.com" ]
vovamaksymchuk@gmail.com
91f25ada328cf1e45a3535a86888f2726fe24f20
6a37276b32dae7b96111217d9c05e3b48e1cb179
/app/src/main/java/com/rover/bigbywolf/rovercontroller/messagetypes/ControlMessage.java
377ade0185cb1dfcdaaa920efcd8f4486f52f837
[]
no_license
asuar078/RoverController
fafc6e194b320b086d3115fece75a2fc115d3710
09274c6a598a5ea83118b4026bfb828932dc1e4a
refs/heads/master
2020-06-29T13:29:20.683011
2019-08-04T23:20:28
2019-08-04T23:20:28
200,551,068
0
0
null
null
null
null
UTF-8
Java
false
false
1,052
java
package com.rover.bigbywolf.rovercontroller.messagetypes; import org.json.JSONException; import org.json.JSONObject; public class ControlMessage implements DroneMessage { public static String sendArmMessage() throws JSONException { JSONObject object = new JSONObject(); object.put("messageId", "arm"); return object.toString() + MESSAGE_TERMINATOR; } public static String sendLandMessage() throws JSONException { JSONObject object = new JSONObject(); object.put("messageId", "land"); return object.toString() + MESSAGE_TERMINATOR; } public static String sendAltCtlMessage() throws JSONException { JSONObject object = new JSONObject(); object.put("messageId", "alt_ctl"); return object.toString() + MESSAGE_TERMINATOR; } public static String sendManualCtlMessage() throws JSONException { JSONObject object = new JSONObject(); object.put("messageId", "manual_ctl"); return object.toString() + MESSAGE_TERMINATOR; } }
[ "arian.suarez@virideon.com" ]
arian.suarez@virideon.com
508ea5dd1c460ae48cdad407f167175567f5e1bc
fc8bfed451d07635a79036fe6dc04ad942839d35
/src/test/java/runner/JDBCTest2.java
0aed993c487fddbe1e6ec84be89628f1f888a896
[]
no_license
NARGIZA001/CucumberFrameWork
21fd1c34e8fb43c3f34c046e2642c0a041b258ea
b8fa961570b38052ce53712573dbe35d572bcd61
refs/heads/master
2021-07-25T10:47:49.757616
2019-12-15T23:24:57
2019-12-15T23:24:57
224,316,566
0
1
null
2020-10-13T17:46:45
2019-11-27T01:14:45
Java
UTF-8
Java
false
false
882
java
package runner; import utilities.JDBCutils; import java.io.IOException; import java.sql.SQLException; import java.util.List; import java.util.Map; public class JDBCTest2 { public static void main(String[] args) throws SQLException{ try { JDBCutils.establishedConnection(); List<Map<String, Object>> dbData= JDBCutils.runSQLQuery("select first_name, last_name, salary from employees"); System.out.println(dbData.get(0).get("FIRST_NAME")); System.out.println(dbData.get(0).get("SALARY")); System.out.println(JDBCutils.countRows("select first_name, last_name, salary from employees")); } catch (IOException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } finally { JDBCutils.closeConnection(); } } }
[ "nkeneshbaeva1@gmail.com" ]
nkeneshbaeva1@gmail.com
54dbf407b112d61604c6236ec57ff59bdcc53cc0
b098a01d49a8be3c23e414966adca83bb6170fcf
/src/main/java/xmu/crms/security/JwtAuthenticationTokenFilter.java
88d3a4bcfea517767af09f458b71411beff15809
[]
no_license
xmusoftware15/ModuleStandardGroup-Public
70b3de447fd40401da50496a79cf9676fa45ec6d
17c2af02a80378586555ca869c32abdd57eb4aaa
refs/heads/master
2021-09-02T04:32:13.327394
2017-12-30T10:01:33
2017-12-30T10:01:33
113,775,340
15
6
null
2017-12-25T12:15:41
2017-12-10T19:00:22
C#
UTF-8
Java
false
false
5,148
java
package xmu.crms.security; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; import org.springframework.web.filter.OncePerRequestFilter; import xmu.crms.util.JwtTokenUtil; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; /** * 用于认证 Jwt Header的过滤器 * @author mads * @date 2017/12/21 21:46 */ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { private final Log logger = LogFactory.getLog(this.getClass()); @Autowired private UserDetailsServiceImpl userDetailsService; @Autowired private JwtTokenUtil jwtTokenUtil; @Value("jwt_header") private String tokenHeader; @Value("jwt_token_head") private String tokenHead; @Override protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException, UsernameNotFoundException { String miniProgram = "miniprogram"; String authHeader = httpServletRequest.getHeader(this.tokenHeader); if (authHeader != null && authHeader.startsWith(tokenHead)) { System.out.println("auth header: "+authHeader); final String authToken = authHeader.substring(tokenHead.length()); try { String username = jwtTokenUtil.getUsernameFromToken(authToken); logger.info("checking authentication " + username); UserDetailsImpl userDetails; if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) { if(miniProgram.equals(jwtTokenUtil.getAudienceFromToken(authToken))){ userDetails = (UserDetailsImpl) userDetailsService.loadUserByOpenId(username); }else{ userDetails = (UserDetailsImpl) userDetailsService.loadUserByUsername(username); } if (jwtTokenUtil.validateToken(authToken, userDetails) || jwtTokenUtil.validateMiniToken(authToken,userDetails)) { String type; if (userDetails.getType() == 0) { type = "student"; } else { type = "teacher"; } List<SimpleGrantedAuthority> simpleGrantedAuthority = (List<SimpleGrantedAuthority>) userDetails.getAuthorities(); if(simpleGrantedAuthority == null){ logger.info("no role "); } if(miniProgram.equals(jwtTokenUtil.getAudienceFromToken(authToken))){ MyAuthenticationToken authentication = new MyAuthenticationToken(userDetails.getOpenid(), userDetails.getId(), userDetails.getNumber(), userDetails.getPhone(), type, userDetails.getAuthorities()); authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails( httpServletRequest)); logger.info("authenticated mini user " + username + ", setting security context"); SecurityContextHolder.getContext().setAuthentication(authentication); }else{ MyAuthenticationToken authentication = new MyAuthenticationToken(userDetails.getId(), userDetails.getNumber(), userDetails.getPhone(), userDetails.getPassword(), type, userDetails.getAuthorities()); authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails( httpServletRequest)); logger.info("authenticated user " + username + ", setting security context"); SecurityContextHolder.getContext().setAuthentication(authentication); } } } } catch (Exception e) { logger.error("UserNotFound,", e); } } doFilter(httpServletRequest, httpServletResponse, filterChain); } }
[ "lxzmads@gmail.com" ]
lxzmads@gmail.com
ab057ffc125d274bea35e9b1af0e3dab8bda12bd
9d3c4ced6cec64cd104c280ff82be8a236879ac0
/WebProj3/src/com/internousdev/webproj3/action/WelcomeAction.java
f2fb67a01b8a334907a366371621a33ef3786cb6
[]
no_license
SuzukaIwakata/test
2ee7299a0441422875a1fac50e1e20058facb348
e6585ca322c3b59da7de745f9f911a4fb3fc4d9b
refs/heads/master
2021-05-02T06:32:27.474265
2018-04-30T04:01:42
2018-04-30T04:01:42
120,857,905
0
0
null
null
null
null
UTF-8
Java
false
false
202
java
package com.internousdev.webproj3.action; import com.opensymphony.xwork2.ActionSupport; public class WelcomeAction extends ActionSupport { public String execute() { return SUCCESS; } }
[ "excrement_island_928@yahoo.co.jp" ]
excrement_island_928@yahoo.co.jp
98eb2f9a1bcb86014a6902f764523ac960cfc756
89b609df5e27831bf09ccbbafb30f06c538792ec
/src/main/java/org/mf/business/service/ComuneService.java
ca14ca9b44e9b51472964a6f57998e48adece55d
[]
no_license
maurofgn/comuni
1d11231f14ead7bcc0ed3b00f01098b8f57a978e
18b4b5dc06e183a6e923c58413b3a06bce53877c
refs/heads/master
2021-01-24T20:14:42.904593
2016-09-15T13:58:06
2016-09-15T13:58:06
68,298,239
0
0
null
null
null
null
UTF-8
Java
false
false
1,719
java
/* * Created on 1 ago 2016 ( Time 13:27:29 ) * Generated by Telosys Tools Generator ( version 2.1.0 ) */ package org.mf.business.service; import java.util.List; import org.mf.bean.Comune; import org.mf.util.AutoCompleteData; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; /** * Business Service Interface for entity Comune. */ public interface ComuneService { /** * Loads an entity from the database using its Primary Key * @param comuneId * @return entity */ Comune findById(Integer comuneId) ; /** * Load the page request. * @return Page */ Page<Comune> findAll(Pageable pageRequest); /** * Loads all entities. * @return all entities */ List<Comune> findAll(); /** * Saves the given entity in the database (create or update) * @param entity * @return entity */ Comune save(Comune entity); /** * Updates the given entity in the database * @param entity * @return */ Comune update(Comune entity); /** * Creates the given entity in the database * @param entity * @return */ Comune create(Comune entity); /** * Deletes an entity using its Primary Key * @param comuneId */ void delete(Integer comuneId); /** * * @param term to use for select data * @return */ List<AutoCompleteData> autoCompleteName(String term, Integer regione, Integer provincia); /** * * @return total records in table */ Long count(); /** * * @param pageRequest * @param nome * @param provinciaId * @param regioneId * @return */ Page<Comune> findAll(PageRequest pageRequest, String nome, Integer provinciaId, Integer regioneId); }
[ "mauro.fugante@gmail.com" ]
mauro.fugante@gmail.com
c813237f31f08a71a20cc6a75c6b8da29877a1dc
85eb470c9b11ca969a1b6371c47c4e2df45b195b
/src/main/java/isahasa/htmlmarchaller/isa/UnderlinedHtmlText.java
cbdd31ee049ece34841e78c1e47e9b4ce90370db
[]
no_license
csgrabt/training-solutions
b694332b856f17c237831123bd2c6504a18d5cb4
5e5fc887dc3d72aa673f8df01ba3f1d097f37176
refs/heads/master
2023-08-15T00:29:28.460172
2021-10-04T08:36:23
2021-10-04T08:36:23
308,076,903
1
1
null
null
null
null
UTF-8
Java
false
false
327
java
package isahasa.htmlmarchaller.isa; import isahasa.htmlmarchaller.HtmlText; public class UnderlinedHtmlText extends HtmlText { public UnderlinedHtmlText(String plainText) { super(plainText); } @Override public String getPlainText() { return "<u>" + super.getPlainText() + "</u>"; } }
[ "gy.cseko@outlook.com" ]
gy.cseko@outlook.com
6a1c5661714306f64d4c62ba46bc72447fae3f96
056098b31f7beaa29c43a6c72adc5f547c72f9b5
/app/src/androidTest/java/wang/a1ex/android_4over6/ApplicationTest.java
a9c02b671bde194616ff65c7ea8d60fced15c24a
[ "MIT" ]
permissive
a1exwang/android_4over6
20a9aed98827b05ee03ee72930e8768b390fbbf2
89729eaf06a4679dc63beb4a03d964ee236749ac
refs/heads/master
2021-01-18T21:21:33.535051
2016-03-29T12:51:04
2016-03-29T12:51:04
54,824,154
1
1
null
null
null
null
UTF-8
Java
false
false
355
java
package wang.a1ex.android_4over6; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "ice_b0und@hotmail.com" ]
ice_b0und@hotmail.com
2ba86ed24c4c9bcac60315602c47ffd87fd27ae8
219f181116ee7ab05f72010a6556fa01835990e9
/app/src/main/java/com/example/camcuz97/flixster/InfoActivity.java
c150a6be29849095bf918e333af0e65fc0cc3a08
[ "Apache-2.0" ]
permissive
camcuz97/MyFlixRepo
84aec0f7a0b61b91912af8634acafacf976b1643
eea22e2e4c83bebd92281d7451ab4c502c1a239a
refs/heads/master
2021-01-17T19:01:06.579898
2016-06-18T02:52:12
2016-06-18T02:52:12
61,233,228
1
0
null
null
null
null
UTF-8
Java
false
false
1,818
java
package com.example.camcuz97.flixster; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ImageView; import android.widget.RatingBar; import android.widget.TextView; import com.squareup.picasso.Picasso; import jp.wasabeef.picasso.transformations.RoundedCornersTransformation; public class InfoActivity extends AppCompatActivity { RatingBar ratingBar; TextView tvTitle; TextView tvDescription; TextView tvRate; TextView tvDate; ImageView ivBack; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_info); tvTitle = (TextView) findViewById(R.id.tvTitle); tvDescription = (TextView) findViewById(R.id.tvOverview); tvRate = (TextView) findViewById(R.id.tvRate); ratingBar = (RatingBar) findViewById(R.id.ratingBar); tvDate = (TextView) findViewById(R.id.tvDate); ivBack = (ImageView) findViewById(R.id.ivBack); String title = getIntent().getStringExtra("title"); String description = getIntent().getStringExtra("description"); double rating = getIntent().getDoubleExtra("rating",0); int numVotes = getIntent().getIntExtra("votes",0); String date = getIntent().getStringExtra("date"); String back = getIntent().getStringExtra("backdrop"); tvTitle.setText(title); tvDescription.setText(description); tvRate.setText("" + rating/2 + "/5"); tvDate.setText("Release Date: " + date); ratingBar.setRating((float)rating/2); Picasso.with(this.getApplicationContext()).load(back).placeholder(R.drawable.datboi).error(R.drawable.error).transform(new RoundedCornersTransformation(10, 10)).into(ivBack); } }
[ "camcuz1@gmail.com" ]
camcuz1@gmail.com
8ebddd27eededb5ab24754e42e1625167b6e06f9
e228938f925f158733b5239201c0de1a45d3145b
/src/main/java/com/szychiewicz/wmh/Util.java
2b882a3aa99216bfd8973279e9f71fb88619c717
[]
no_license
pszychiewicz/WmhNeuralNetwork
18a8325f014ca66805e1bc1a681805d4bb777493
ed440469243a5471add37b3a8dd0016061c0bb9a
refs/heads/master
2021-01-13T15:56:02.479639
2017-01-26T11:01:10
2017-01-26T11:01:10
76,810,013
0
1
null
null
null
null
UTF-8
Java
false
false
220
java
package com.szychiewicz.wmh; public class Util { public static double mean(double[] m) { double sum = 0; for (double aM : m) { sum += aM; } return sum / m.length; } }
[ "pawel.szychiewicz@gmail.com" ]
pawel.szychiewicz@gmail.com
9c6348c8c3cb531fb3481fc27efb2c198f4d730a
b2333f5ee0e5576ad26fff2f9cbb1ec95ae86b00
/src/hot/org/domain/moneda/bussiness/AdministrarPorcentaje.java
810cd8d0508080341845248f9be7b218c6033a28
[]
no_license
lfernandortiz/moneda
b989b83d62cc13e09e3433c97150bcdcef36c6de
7ad83506f84537e77821837468e94def7fce28b7
refs/heads/master
2021-01-11T15:58:23.512185
2016-03-31T21:35:51
2016-03-31T21:35:51
44,342,315
0
0
null
2015-10-15T20:05:54
2015-10-15T20:05:52
null
UTF-8
Java
false
false
1,657
java
package org.domain.moneda.bussiness; import javax.persistence.EntityManager; import org.domain.moneda.session.PorcentajecomisiontxHome; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Logger; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Out; import org.jboss.seam.annotations.Scope; import org.jboss.seam.faces.FacesMessages; import org.jboss.seam.international.StatusMessages; import org.jboss.seam.log.Log; @Name("AdministrarPorcentaje") @Scope(ScopeType.CONVERSATION) public class AdministrarPorcentaje { @Logger private Log log; @In StatusMessages statusMessages; public void administrarPorcentaje() { // implement your business logic here log.info("AdministrarPorcentaje.administrarPOrcentaje() action called"); statusMessages.add("administrarPorcentaje"); } @In private FacesMessages facesMessages; @In private EntityManager entityManager; @In(create=true) @Out PorcentajecomisiontxHome porcentajecomisiontxHome; public String guardar(){ java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat("dd/MM/yyyy"); String sql = "update public.porcentajecomisiontx set " + "fechafin = to_date('" + sdf.format(porcentajecomisiontxHome.getInstance().getId().getFechainicio()) + "','dd/mm/yyyy') - 1 " + "where fechafin is null and fechainicio < to_date('"+sdf.format(porcentajecomisiontxHome.getInstance().getId().getFechainicio())+"','dd/mm/yyyy') "; porcentajecomisiontxHome.persist(); return null; } }
[ "erlis1986@gmail.com" ]
erlis1986@gmail.com
33c4189f0e329c0c3d2ee21bd35bf12785ad39de
c66eb8f65c87a2c793344581d7aeeeda6865da15
/apm-sniffer/apm-agent-core/src/main/java/com/zl/skypointer/apm/agent/core/context/tag/AbstractTag.java
7bd36516203b1b4077b8d668b8a95438542252d5
[]
no_license
zhouliang58/my-agent
fd2e083ddde70cdf266c7711d379b106460cdb58
6f8c4d3e971ca606d18d7397df6307b7e71ce765
refs/heads/master
2021-05-13T16:35:57.092492
2018-02-14T14:52:03
2018-02-14T14:52:07
116,792,844
0
0
null
null
null
null
UTF-8
Java
false
false
684
java
package com.zl.skypointer.apm.agent.core.context.tag; import com.zl.skypointer.apm.agent.core.context.trace.AbstractSpan; /** * 这个类的用途是将标签属性设置到 Span 上,或者说,它是设置 Span 的标签的工具类 * * @author zhouliang * @version v1.0 2018/1/31 10:50 * @since JDK1.8 */ public abstract class AbstractTag<T> { /** * The key of this Tag. */ protected final String key; public AbstractTag(String tagKey) { this.key = tagKey; } protected abstract void set(AbstractSpan span, T tagValue); /** * @return the key of this tag. */ public String key() { return this.key; } }
[ "zhouliang@cvte.com" ]
zhouliang@cvte.com
dbd3e6337385a462ebef44f416c516771d89e7da
fe054c25369a5d0d58fa17c3f827c3b0ee0b3c0b
/Testing/selenium/src/test/java/selenium/TestAnnot.java
2e552744596568bb46b99d80e783e4f8e3c4ae24
[]
no_license
SurajkhanPinjar/TY_CG_HTD_BangaloreNovember_JFS_SurajkhanPinjar
4bdc6bacfbb547f4adc4811ec207745e3a53e17c
85dfcdde17a86dd61a7ee83cfea04a0497880ba6
refs/heads/master
2023-01-12T14:37:49.797977
2020-06-15T04:03:35
2020-06-15T04:03:35
225,843,658
0
1
null
2023-01-07T14:14:27
2019-12-04T10:47:21
Java
UTF-8
Java
false
false
538
java
package selenium; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Reporter; import org.testng.annotations.Test; //import org.testng.Reporter; //import org.testng.annotations.Test; public class TestAnnot { static { System.setProperty("webdriver.chrome.driver", "./src/main/resources/chromedriver.exe"); } @Test public void demo1() { WebDriver driver = new ChromeDriver(); driver.get("https://www.facebook.com"); Reporter.log("from testannot demo1", true); } }
[ "surajkhanpinjar@gmail.com" ]
surajkhanpinjar@gmail.com
56406c08fd6bd4c07d0dab4ffb8dba56be021607
708a0e0917433197f71caf54d4b2583ff8204cb3
/Telessaude-Dominio/src/br/ufmg/hc/telessaude/diagnostico/dominio/exceptions/DAOException.java
38b9024326d996eb4ceabd625f4eaef37d0f8b11
[]
no_license
brenommelo/conversoWeca
08ae7eeeb2da9adbf7c478f721bdb5ce14e1f6b1
24c847236871d73b4df0d87518b629a1a35ffc55
refs/heads/master
2020-12-24T17:17:44.638141
2015-05-09T20:01:00
2015-05-09T20:01:00
34,926,991
0
0
null
null
null
null
UTF-8
Java
false
false
844
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package br.ufmg.hc.telessaude.diagnostico.dominio.exceptions; import com.logs.CustomLogger; /** * * @author igor.santos */ public class DAOException extends Exception { public DAOException(String msg, Throwable thrwbl) { super(msg, thrwbl); getLogger(msg, thrwbl); } public DAOException(String msg) { super(msg); getLogger(msg, this); } private static void getLogger(String msg, Throwable thrwbl) { try { if (thrwbl != null) { CustomLogger.getLogger(DAOException.class).error(msg, thrwbl); } else { CustomLogger.getLogger(DAOException.class).error(msg); } } catch (Throwable ex) { } } }
[ "brenommelo@gmail.com" ]
brenommelo@gmail.com
bc550df250971d39f61974cae38a37335df00461
3ffcc7afa5d69d0c564d8c8b1926c4682cf7890a
/android/WalkTheDream/WalkTheDream/src/com/ssm/walkthedream/Navi.java
07fd791fc6c1783dd2caa8ec83752c6dc7130b57
[]
no_license
KimTaeWoo0812/Walk_the_dream
329cac848d6dbc666a8000bbe72a1fc61d5d55fa
ca7d8344182ead5a4cc5e8cc2762f5e5e5bd00e4
refs/heads/master
2021-01-13T07:30:16.683303
2016-10-19T12:20:59
2016-10-19T12:20:59
71,358,183
0
0
null
null
null
null
UHC
Java
false
false
56,019
java
//package com.ssm.walkthedream; // //import java.io.IOException; //import java.util.ArrayList; // //import org.jsoup.Jsoup; // //import android.app.Activity; //import android.content.Intent; //import android.os.AsyncTask; //import android.os.Bundle; //import android.os.Handler; //import android.speech.tts.TextToSpeech; //import android.speech.tts.TextToSpeech.OnInitListener; //import android.util.Log; //import android.view.KeyEvent; //import android.view.View; //import android.view.Window; //import android.view.View.OnClickListener; //import android.view.WindowManager; //import android.widget.Button; //import android.widget.ImageView; //import android.widget.TextView; // //import com.ssm.walkthedream.MyLocationListener.onChangedXYListener; //import com.ssm.walkthedream.SearchAndFriends.StairsTTSThread; // //public class Navi extends Activity implements OnInitListener{ // private AndroidSocket soccket ; // Handler hStairs; // private boolean stopThread=true; // TextView tv_navi_meter; // ImageView iv_navi_leftright; // TextView tv_niavi_do; // TextView tv_navi_tofrom; // TextView tv_navi_test; // // private TextToSpeech myTTS; // // String TagString; // // MyLocationListener listener; // // static String gpsRst=""; // static TextView tv_main_gpsval; // TextView tv_main_test; // TextView tv_main_test2; // // int maxCheckReflashNum = 3; // int checkReflashNum; // // double endX; // double endY; // double firX; // double firY; // double curX; // double curY; // double befX=0; // double befY=0; // // String nowRotaCode; // String nextRotaCode; // String befRotaCode=""; // String bungiLength; // // int curBungiNum = 0; // int befBungiNum = 0; // // double curResult; // boolean isFirst = true; // // String Destination; // // boolean rotaCodeChange; // StairsTTSThread stairsTTS; // @Override // protected void onCreate(Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // 화면항상밝게 // requestWindowFeature(Window.FEATURE_NO_TITLE); // setContentView(R.layout.activity_navi); // soccket=AndroidSocket.shared(); // myTTS = new TextToSpeech(this, this); // // Intent i = getIntent(); // // Destination = i.getExtras().getString("str"); // Double lat = i.getExtras().getDouble("lng") ; // Double lng = i.getExtras().getDouble("lat") ; // 바뀜 // // tv_navi_meter = (TextView)findViewById(R.id.tv_navi_meter); // iv_navi_leftright = (ImageView)findViewById(R.id.iv_navi_leftright); // tv_niavi_do = (TextView)findViewById(R.id.tv_niavi_do); // tv_navi_tofrom = (TextView)findViewById(R.id.tv_navi_tofrom); // tv_navi_test = (TextView)findViewById(R.id.tv_navi_test); // //// double lat = 35.86953379; //// double lng = 128.60314263; // //// tv_main_test=(TextView)findViewById(R.id.tv_main_test); //// tv_main_test2=(TextView)findViewById(R.id.tv_main_test2); //// //// Log.i("ASDASD",Destination); //// tv_main_gpsval=(TextView)findViewById(R.id.tv_main_gpsval); // // //// endX = 813960.625; //// endY = 736660; // //// endX = lng; //// endY = lat; // // Log.i("TMP ADR","http://apis.daum.net/maps/transcoord?apikey=4ea71af07ab0504cf561d740334d4ce0&x="+lng+"&y="+lat+"&fromCoord=wgs84&toCoord=wcongnamul&output=xml"); // ( new ParseURL() ).execute(new String[]{"GPS","http://apis.daum.net/maps/transcoord?apikey=4ea71af07ab0504cf561d740334d4ce0&x="+lng+"&y="+lat+"&fromCoord=wgs84&toCoord=wcongnamul&output=xml"}); // // Log.i("DST XY" ,String.valueOf(lng) + " " + String.valueOf(lat)); // // // // // // } // public void StartDtsirsTTSThread() // { // hStairs = new Handler(); // // stairsTTS=new StairsTTSThread(); // stairsTTS.start(); // } // // // @Override // protected void onPause() { // stopThread=false; // super.onPause(); // } // @Override // protected void onResume() { // if(AndroidSocket.OPTION_Bluetooth) // StartDtsirsTTSThread(); // super.onResume(); // } // // @Override // protected void onDestroy() { // listener.endGps(); // myTTS.shutdown(); // stopThread=false; // super.onDestroy(); // } // // // // // @Override // public boolean onKeyDown(int keyCode, KeyEvent event) { // if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN){ // Log.i("KEYDOWN","KEYCODE_VOLUME_DOWN"); // // startActivity(new Intent(getApplicationContext(),CheckVideo.class)); // // } // else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP){ // Log.i("KEYDOWN","KEYCODE_VOLUME_UP"); // } // else if (keyCode == KeyEvent.KEYCODE_BACK){ // Log.i("KEYDOWN","KEYCODE_BACK"); // onBackPressed(); // } // // return true; // } // // @Override // public void onBackPressed() { // super.onBackPressed(); // } // // private void getMyLocation() { // // listener = new MyLocationListener(this.getApplicationContext(),onchangedXYListener); // // appendText("내 위치를 요청 했습니다."); // } // // // private void appendText(String msg) { //// tv_main_gpsval.setText(msg + "\n"); // } // // int k =0; // // //// changeGPSType(longitude, latitude); // 호출 // // // ////인터페이스로 // onChangedXYListener onchangedXYListener = new onChangedXYListener() { // // @Override // public void onChangedXY(double lat_, double lon_) { // changeGPSType(lon_,lat_); // } // }; // // public void changeGPSType(double dx,double dy) // { // Log.i("GPS VAL",dx + " " + dy); // // // ( new ParseURL() ).execute(new String[]{"GPS","http://apis.daum.net/maps/transcoord?apikey=4ea71af07ab0504cf561d740334d4ce0&x="+dx+"&y="+dy+"&fromCoord=wgs84&toCoord=wcongnamul&output=xml"}); // // } // // public void bt_main_getgps(View v) // { // getMyLocation(); // } // // public void bt_main_removegps(View v) // { // tv_main_gpsval.setText("GPS 종료"); //// listener.endGps(); // } // // // private void getRoute(double x1,double y1, double x2, double y2) { //// Log.i("JINIB","getRoute진입시작"); //// ( new ParseURL() ).execute(new String[]{"ROUTE","http://map.daum.net/route/walk.json?callback=jQuery18107084809814114124_1432346490191&walkMode=RECOMMENDATION&walkOption=NONE&sName=%EB%8C%80%EA%B5%AC%EC%97%AD&sX="+x1+"&sY="+y1+"&eName=%EC%A4%91%EC%95%99%EB%A1%9C&eX="+x2+"&eY="+y2+"&ids=P21367546%2CP12728831"}); // ( new ParseURL() ).execute(new String[]{"ROUTE","http://map.daum.net/route/walkset.json?callback=jQuery1810362975598545745_1435566230779&sName=%EA%B2%BD%EB%B6%81+%EA%B5%AC%EB%AF%B8%EC%8B%9C+%EA%B1%B0%EC%9D%98%EB%8F%99+468&sX="+x1+"&sY="+y1+"+&eName=%EA%B2%BD%EB%B6%81+%EA%B5%AC%EB%AF%B8%EC%8B%9C+%EA%B1%B0%EC%9D%98%EB%8F%99+468&eX="+x2+"+&eY="+y2+"&ids=%2C"}); // // // } // // String LorR_TMP; // // public class ParseURL extends AsyncTask<String, Void, String> { // String retStr=""; // String retStrForGPS=""; // @Override // protected String doInBackground(String... strings) { //// Log.d("MAIN","CALL"); // // TagString=strings[0]; // //// boolean isFirst = true; // // nowRotaCode="NONE"; // nextRotaCode="NONE"; // // if(strings[0].compareTo("ROUTE")==0) { // try { //// Log.i("JINIB","getRoute진입중1"); // // String ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17"; // String strBuf = ""; // strBuf = (Jsoup.connect(strings[1]).timeout(20000).ignoreContentType(true).execute().body()); // // // // // // String[] strSPLrouteMode = strBuf.split("routeMode"); // ArrayList<OneOfRoute> oneOfRouteList = new ArrayList<OneOfRoute>(); // Log.i("strBuf",strBuf); // // String[] strSPLgroupId = strSPLrouteMode[1].split("groupId"); // String[] strEnd = strSPLrouteMode[1].split("END"); // // // String[] xx = strEnd[1].split("x\":"); // String[] yy = strEnd[1].split("y\":"); // // if(xx[0].contains(",")) // xx[0] = xx[1].substring(0, xx[1].indexOf(",")); // else // xx[0] = xx[1].substring(0, xx[1].indexOf("}")); // // if(xx[0].contains("}")) // xx[0]=xx[0].substring(0,xx[0].length()-1); // // yy[0] = yy[1].substring(0, yy[1].indexOf(",")); //// int count = 0; // // ///////////////xxxxxxxxyyyy 끝일때 목적지로추가해주면될차례 // // // // Log.i("dlfghldyd",String.valueOf(strSPLgroupId.length)); // // befBungiNum = curBungiNum; // int tmpLen = curBungiNum = strSPLgroupId.length; // // // // for (int i = 1; i < strSPLgroupId.length - 1 ; i++) { //// Log.d("MAIN", "PARSER " + i + " ED"); //// if(count>=2) //// break; // //count++; // //for문 length-1 한 이유가 마지막라인은 도착이므로 // // String fullstr = strSPLgroupId[i]; // // String[] guidecode = fullstr.split("guideCode\":\""); // String[] guidement = fullstr.split("guideMent\":\""); // String[] rotationCode = fullstr.split("rotationCode\":\""); // String[] x = fullstr.split("x\":"); // String[] y = fullstr.split("y\":"); // // // // // guidecode[0] = guidecode[1].substring(0, guidecode[1].indexOf("\"")); // guidement[0] = guidement[1].substring(0, guidement[1].indexOf("\"")); // rotationCode[0] = rotationCode[1].substring(0, rotationCode[1].indexOf("\"")); // // //// Log.i("dlfghldyd",x[0]); // // if(x[0].contains(",")) // x[0] = x[1].substring(0, x[1].indexOf(",")); // else // x[0] = x[1].substring(0, x[1].indexOf("}")); // // if(x[0].contains("}")) // x[0]=x[0].substring(0,x[0].length()-1); // // y[0] = y[1].substring(0, y[1].indexOf(",")); // // // retStr=""; // retStr += guidecode[0] + "@"; // retStr += guidement[0] + "@"; // retStr += rotationCode[0] + "@"; // retStr += x[0] + "@"; // retStr += y[0] + "@"; // // if(rotaCodeChange==true) // { // rotaCodeChange=false; // befRotaCode = nextRotaCode; // } // if(i==1) // nowRotaCode = rotationCode[0]; // if(i==2) // nextRotaCode = rotationCode[0]; // if(i==1) // bungiLength = guidement[0]; // // if(bungiLength.contains("m")==true) // bungiLength = bungiLength.substring(0,bungiLength.indexOf("m")); // else if(bungiLength.contains("미")==true) // bungiLength = bungiLength.substring(0,bungiLength.indexOf("미")); // // if(tmpLen==3 && i!=2) // { // firX = Double.parseDouble( x[0] ); // firY = Double.parseDouble( y[0] ); // } // // if(i==2) // { // firX = Double.parseDouble( x[0] ); // firY = Double.parseDouble( y[0] ); // } // // Log.i("retStr",i+"번쨰 " + retStr); // } // //// tv_main_gpsval.setText(retStr); // //// Log.i("JINIB","getRoute진입중2"); // // // } catch (Throwable t) { // t.printStackTrace(); // Log.d("MAIN", "ERROR"); // } // } // if(strings[0].compareTo("GPS")==0) { // try { //// Log.i("JINIB","GPSC진입중1"); // String ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17"; // String strBuf = ""; // strBuf = (Jsoup.connect(strings[1]).timeout(20000).ignoreContentType(true).execute().body()); // // double xx; // double yy; // // String []tmpStrArr = strBuf.split("'"); // xx = Double.parseDouble( tmpStrArr[1] ); // yy = Double.parseDouble( tmpStrArr[3] ); // // retStrForGPS = xx + "@" + yy; //// Log.i("JINIB","GSPC진입중2"); // // } catch (Throwable t) { // t.printStackTrace(); // Log.d("MAIN", "ERROR"); // } // } // // return null; // } // // int bungi = 0; // // // @Override // protected void onPostExecute(String s) { // super.onPostExecute(s); // //// Log.d("TagString",TagString); // if(TagString.compareTo("ROUTE")==0) // { //// Log.i("JINIB","getRoute진입완료"); // // //firX curX befX // // Log.i("RSTT1", "firX : " + firX + " firY : " + firY + " befX : " + befX + " befY : " + befY + " curX : " + curX + " curY : "+ curY); // // // if(firX == befX && firY == befY) // { // appendText("움직임없음"); // return; // } // // double a = Math.sqrt ( Math.pow(firX - befX,2) + Math.pow(firY - befY,2) ); // double b = Math.sqrt ( Math.pow(curX - firX,2) + Math.pow(curY - firY,2) ); // double c = Math.sqrt ( Math.pow(curX - befX,2) + Math.pow(curY - befY,2) ); // // // curResult = Math.acos( ( c*c + a*a - b*b ) / ( 2 * c * a ) ) * 180/Math.PI; // // // if(curResult >60) // checkReflashNum++; // else // checkReflashNum=0; // // // // Log.i("RSTT2", "a : " + a + "b : " + b + " c : "+ c + " rst : " + curResult); // // // befX = curX; // befY = curY; // // // // // // final Handler handler = new Handler(); // new Thread(new Runnable() { // @Override // public void run() { // handler.post(new Runnable() { // public void run() { // //// tv_navi_meter //// iv_navi_leftright //// tv_niavi_do //// tv_navi_tofrom // // Log.i("ASDASD","asdasdasd"); // // bungi++; // // // 길 안내 종료 // // String tmpStr = bungiLength; // // // // while(tmpStr.charAt(0) >'9' || tmpStr.charAt(0) <'0') // { // tmpStr = tmpStr.substring(1, tmpStr.length()); // } // // bungiLength=tmpStr; // // if( curBungiNum == 3 && Integer.parseInt( tmpStr)<30) // { // myTTS.speak("목적지에 도착하였습니다. 길 안내를 종료합니다.", TextToSpeech.QUEUE_ADD, null); // Handler hh = new Handler(); // hh.postDelayed(new Runnable() { // // @Override // public void run() { // finish(); // } // }, 4000); // } // // // if(curBungiNum != befBungiNum) // { //// appendText(befRotaCode + " 방향으로 턴입니다"); // // // if(befRotaCode.compareTo("TURN_LEFT")==0) // { // myTTS.speak("현재 지점에서 왼쪽 방향으로 턴입니다", TextToSpeech.QUEUE_ADD, null); // rotaCodeChange=true; // } // else if(befRotaCode.compareTo("TURN_RIGHT")==0) // { // myTTS.speak("현재 지점에서 오른쪽 방향으로 턴입니다", TextToSpeech.QUEUE_ADD, null); // rotaCodeChange=true; // } // // // // } // else // { //// if(bungi>10) //// { // bungi=0; // if(checkReflashNum>=maxCheckReflashNum) // { // tv_navi_meter.setText(String.valueOf(bungiLength)+"m 후"); // // tv_navi_test.setText(nextRotaCode); // // if(nextRotaCode.compareTo("TURN_LEFT")==0) // { // iv_navi_leftright.setImageDrawable(getResources().getDrawable(R.drawable.left)); // } // else if(nextRotaCode.compareTo("TURN_RIGHT")==0) // { // iv_navi_leftright.setImageDrawable(getResources().getDrawable(R.drawable.right)); // } // // tv_niavi_do.setText(String.valueOf((int)(curResult))+"º\n틀어졌습니다."); // tv_navi_tofrom.setText(String.valueOf(curX)+"\n"+String.valueOf(curY)); // // if(SC.doNum>2) // { // SC.doNum=0; // // // myTTS.speak(String.valueOf((int)(curResult))+"도 틀어졌습니다.", TextToSpeech.QUEUE_ADD, null); // } // // SC.doNum++; // // // // // // if(SC.meterNum>3) // { // SC.meterNum=0; // myTTS.speak(String.valueOf(bungiLength), TextToSpeech.QUEUE_ADD, null); // } // SC.meterNum++; // // tv_navi_test.setText("미터 : " + String.valueOf(SC.meterNum) +"\n도넘 : " + String.valueOf(SC.doNum)); // //// appendText("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,틀어짐 : " + curResult + " , 다음방향" + nextRotaCode ); //// myTTS.speak("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,틀어짐 : " + curResult + " , 다음방향" + nextRotaCode , TextToSpeech.QUEUE_ADD, null); // } // else // { // SC.doNum=0; // tv_navi_meter.setText(String.valueOf(bungiLength)+"m 후"); // // tv_navi_test.setText(nextRotaCode); // // // if(nextRotaCode.compareTo("TURN_LEFT")==0) // { // iv_navi_leftright.setImageDrawable(getResources().getDrawable(R.drawable.left)); // } // else if(nextRotaCode.compareTo("TURN_RIGHT")==0) // { // iv_navi_leftright.setImageDrawable(getResources().getDrawable(R.drawable.right)); // } // // tv_niavi_do.setText("올바른 방향입니다.\n"+String.valueOf((int)(curResult))+"º"); // // tv_navi_tofrom.setText(String.valueOf(curX)+"\n"+String.valueOf(curY)); // // if(SC.meterNum>2) // { // SC.meterNum=0; // myTTS.speak(String.valueOf(bungiLength), TextToSpeech.QUEUE_ADD, null); // } // SC.meterNum++; // // tv_navi_test.setText("미터 : " + String.valueOf(SC.meterNum) +"\n도넘 : " + String.valueOf(SC.doNum)); // // //// appendText("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,옳바른 방향입니다 : (" + curResult + ") , 다음방향" + nextRotaCode ); //// myTTS.speak("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,옳바른 방향입니다 : (" + curResult + ") , 다음방향" + nextRotaCode, TextToSpeech.QUEUE_ADD, null); // // } // //// } // // } // // // // } // }); // } // }).start(); // // // // // // // // // 3번 방향 60도벗어낫을경우 틀어짐알려줌 // if(checkReflashNum>=maxCheckReflashNum) // { // appendText("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,틀어짐 : " + curResult + " , 다음방향" + nextRotaCode ); // return; // } // // // 분기도달시 //// if(curBungiNum != befBungiNum) //// { //// appendText(befRotaCode + " 방향으로 턴입니다"); //// return; //// } // //// setDirection("curResult : " + curResult); // appendText("curResult : " + curResult); // // appendText("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,옳바른 방향입니다 : (" + curResult + ") , 다음방향" + nextRotaCode ); // // // } // else if(TagString.compareTo("GPS")==0) // { // // // //// Log.i("JINIB","GPSC진입완료"); // // String [] tmpStrArr = retStrForGPS.split("@"); // // Log.i("retStrForGPS" , retStrForGPS); // // double[] tmpDoubleArr = new double[2]; // // // if(isFirst==true) // { // endX = Double.parseDouble(tmpStrArr[0]); // endY = Double.parseDouble(tmpStrArr[1]); // // isFirst=false; // bt_main_getgps(null); // return ; // } // // //바뀐 x,y값 // curX = tmpDoubleArr[0] = Double.parseDouble(tmpStrArr[0]); // curY = tmpDoubleArr[1] = Double.parseDouble(tmpStrArr[1]); // //// appendText(tmpStrArr[0]+" , "+tmpStrArr[1]); // // // // getRoute(tmpDoubleArr[0],tmpDoubleArr[1],endX,endY); // // // } // // } // } // // private void setDirection(String retStr) { // // Log.i("THIS",retStr); // } // // // @Override // public void onInit(int status) { // String tmpStr = "목적지 " + Destination+ "으로 길 안내를 시작합니다"; // myTTS.speak(tmpStr, TextToSpeech.QUEUE_ADD, null); // // } // // // // // // // // // // //계단정보 받는곳 // public class StairsTTSThread extends Thread{ // // public void run(){ // for(;stopThread;) // { // try { // Thread.sleep(3000); // } catch (InterruptedException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // if(soccket.hTop!=soccket.hRear) // { // hStairs.post(new Runnable() { // String myText; // @Override // public void run() { // switch(soccket.hQueue[soccket.hRear%20]) // { // case 10: // if(soccket.BluetoothConnected) // soccket.sendData("1\n\n"); // myText = "전방에 올라가는 계단이 있습니다."; // break; // case 11: // if(soccket.BluetoothConnected) // soccket.sendData("2\n\n"); // myText = "전방에 내려가는 계단이 있습니다."; // break; // case 1: // SendStairsData('1'); // myText = "올라가는 계단을 저장하였습니다."; // break; // case 2: // SendStairsData('2'); // myText = "내려가는 계단을 저장하였습니다."; // break; // } //// if(AndroidSocket.OPTION_TTS) // if(false) // myTTS.speak(myText, TextToSpeech.QUEUE_FLUSH, null); // soccket.hRear++; // } // }); // } // } // // } // public void SendStairsData(char type) // { // String strTemp="A_SAVESTA#"; // char cMsg[]=new char[128]; // String lat = Double.toString( soccket.latitude);//gps.loc.getLatitude()); // String lon = Double.toString(soccket.longitude);//gps.loc.getLongitude()); // int i; // // for(i=0;strTemp.charAt(i)!='#';i++) // cMsg[i]=strTemp.charAt(i); // // for(i=21;i<lat.length()+21;i++) // cMsg[i]=lat.charAt(i-21); // cMsg[i]='#'; // // for(i=41;i<lon.length()+41;i++) // cMsg[i]=lon.charAt(i-41); // cMsg[i]='#'; // // cMsg[61]=type; // cMsg[62]='#'; // // strTemp=""; // for(i=0;i<128;i++) // strTemp+=cMsg[i]; // soccket.SendMessage(strTemp); // } // } // //} // // //// 버튼누름 - getMyLocation - GPS 가동 - changeGPSType - getRoute - 현 전 첫 관계로 세타계산 package com.ssm.walkthedream; import java.util.ArrayList; import org.jsoup.Jsoup; import android.app.Activity; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.speech.tts.TextToSpeech; import android.speech.tts.TextToSpeech.OnInitListener; import android.util.Log; import android.view.KeyEvent; import android.view.View; import android.view.Window; import android.view.View.OnClickListener; import android.view.WindowManager; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import com.ssm.walkthedream.MyLocationListener.onChangedXYListener; import com.ssm.walkthedream.NewNavi.StairsTTSThread; public class Navi extends Activity implements OnInitListener{ TextView tv_navi_meter; ImageView iv_navi_leftright; TextView tv_niavi_do; TextView tv_navi_tofrom; TextView tv_navi_test; private TextToSpeech myTTS; String TagString; MyLocationListener listener; static String gpsRst=""; static TextView tv_main_gpsval; TextView tv_main_test; TextView tv_main_test2; int maxCheckReflashNum = 3; int checkReflashNum; double endX; double endY; double firX; double firY; double curX; double curY; double befX=0; double befY=0; String nowRotaCode; String nextRotaCode; String befRotaCode=""; String bungiLength; int curBungiNum = 0; int befBungiNum = 0; double curResult; boolean isFirst = true; String Destination; // private AndroidSocket soccket ; StairsTTSThread stairsTTS; private boolean stopThread=true; Handler hStairs; @Override protected void onPause() { stopThread=false; super.onPause(); } @Override protected void onResume() { soccket=AndroidSocket.shared(); super.onResume(); } // @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // 화면항상밝게 requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_navi); myTTS = new TextToSpeech(this, this); Intent i = getIntent(); Destination = i.getExtras().getString("str"); Double lat = i.getExtras().getDouble("lng") ; Double lng = i.getExtras().getDouble("lat") ; // 바뀜 tv_navi_meter = (TextView)findViewById(R.id.tv_navi_meter); iv_navi_leftright = (ImageView)findViewById(R.id.iv_navi_leftright); tv_niavi_do = (TextView)findViewById(R.id.tv_niavi_do); tv_navi_tofrom = (TextView)findViewById(R.id.tv_navi_tofrom); tv_navi_test = (TextView)findViewById(R.id.tv_navi_test); // double lat = 35.86953379; // double lng = 128.60314263; // tv_main_test=(TextView)findViewById(R.id.tv_main_test); // tv_main_test2=(TextView)findViewById(R.id.tv_main_test2); // // Log.i("ASDASD",Destination); // tv_main_gpsval=(TextView)findViewById(R.id.tv_main_gpsval); // endX = 813960.625; // endY = 736660; // endX = lng; // endY = lat; Log.i("TMP ADR","http://apis.daum.net/maps/transcoord?apikey=4ea71af07ab0504cf561d740334d4ce0&x="+lng+"&y="+lat+"&fromCoord=wgs84&toCoord=wcongnamul&output=xml"); ( new ParseURL() ).execute(new String[]{"GPS","http://apis.daum.net/maps/transcoord?apikey=4ea71af07ab0504cf561d740334d4ce0&x="+lng+"&y="+lat+"&fromCoord=wgs84&toCoord=wcongnamul&output=xml"}); Log.i("DST XY" ,String.valueOf(lng) + " " + String.valueOf(lat)); if(AndroidSocket.OPTION_Bluetooth) { hStairs = new Handler(); stairsTTS=new StairsTTSThread(); stairsTTS.start(); } } @Override protected void onDestroy() { listener.endGps(); myTTS.shutdown(); super.onDestroy(); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN){ Log.i("KEYDOWN","KEYCODE_VOLUME_DOWN"); startActivity(new Intent(getApplicationContext(),CheckVideo.class)); } else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP){ Log.i("KEYDOWN","KEYCODE_VOLUME_UP"); } else if (keyCode == KeyEvent.KEYCODE_BACK){ Log.i("KEYDOWN","KEYCODE_BACK"); onBackPressed(); } return true; } @Override public void onBackPressed() { super.onBackPressed(); } private void getMyLocation() { listener = new MyLocationListener(this.getApplicationContext(),onchangedXYListener); appendText("내 위치를 요청 했습니다."); } private void appendText(String msg) { // tv_main_gpsval.setText(msg + "\n"); } int k =0; // changeGPSType(longitude, latitude); // 호출 //인터페이스로 onChangedXYListener onchangedXYListener = new onChangedXYListener() { @Override public void onChangedXY(double lat_, double lon_) { changeGPSType(lon_,lat_); } }; public void changeGPSType(double dx,double dy) { Log.i("GPS VAL",dx + " " + dy); ( new ParseURL() ).execute(new String[]{"GPS","http://apis.daum.net/maps/transcoord?apikey=4ea71af07ab0504cf561d740334d4ce0&x="+dx+"&y="+dy+"&fromCoord=wgs84&toCoord=wcongnamul&output=xml"}); } public void bt_main_getgps(View v) { getMyLocation(); } public void bt_main_removegps(View v) { tv_main_gpsval.setText("GPS 종료"); // listener.endGps(); } private void getRoute(double x1,double y1, double x2, double y2) { // Log.i("JINIB","getRoute진입시작"); // ( new ParseURL() ).execute(new String[]{"ROUTE","http://map.daum.net/route/walk.json?callback=jQuery18107084809814114124_1432346490191&walkMode=RECOMMENDATION&walkOption=NONE&sName=%EB%8C%80%EA%B5%AC%EC%97%AD&sX="+x1+"&sY="+y1+"&eName=%EC%A4%91%EC%95%99%EB%A1%9C&eX="+x2+"&eY="+y2+"&ids=P21367546%2CP12728831"}); ( new ParseURL() ).execute(new String[]{"ROUTE","http://map.daum.net/route/walkset.json?callback=jQuery1810362975598545745_1435566230779&sName=%EA%B2%BD%EB%B6%81+%EA%B5%AC%EB%AF%B8%EC%8B%9C+%EA%B1%B0%EC%9D%98%EB%8F%99+468&sX="+x1+"&sY="+y1+"+&eName=%EA%B2%BD%EB%B6%81+%EA%B5%AC%EB%AF%B8%EC%8B%9C+%EA%B1%B0%EC%9D%98%EB%8F%99+468&eX="+x2+"+&eY="+y2+"&ids=%2C"}); } public class ParseURL extends AsyncTask<String, Void, String> { String retStr=""; String retStrForGPS=""; @Override protected String doInBackground(String... strings) { // Log.d("MAIN","CALL"); TagString=strings[0]; // boolean isFirst = true; nowRotaCode="NONE"; nextRotaCode="NONE"; if(strings[0].compareTo("ROUTE")==0) { try { // Log.i("JINIB","getRoute진입중1"); String ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17"; String strBuf = ""; strBuf = (Jsoup.connect(strings[1]).timeout(20000).ignoreContentType(true).execute().body()); String[] strSPLrouteMode = strBuf.split("routeMode"); ArrayList<OneOfRoute> oneOfRouteList = new ArrayList<OneOfRoute>(); Log.i("strBuf",strBuf); String[] strSPLgroupId = strSPLrouteMode[1].split("groupId"); String[] strEnd = strSPLrouteMode[1].split("END"); String[] xx = strEnd[1].split("x\":"); String[] yy = strEnd[1].split("y\":"); if(xx[0].contains(",")) xx[0] = xx[1].substring(0, xx[1].indexOf(",")); else xx[0] = xx[1].substring(0, xx[1].indexOf("}")); if(xx[0].contains("}")) xx[0]=xx[0].substring(0,xx[0].length()-1); yy[0] = yy[1].substring(0, yy[1].indexOf(",")); // int count = 0; ///////////////xxxxxxxxyyyy 끝일때 목적지로추가해주면될차례 Log.i("dlfghldyd",String.valueOf(strSPLgroupId.length)); befBungiNum = curBungiNum; int tmpLen = curBungiNum = strSPLgroupId.length; for (int i = 1; i < strSPLgroupId.length - 1 ; i++) { // Log.d("MAIN", "PARSER " + i + " ED"); // if(count>=2) // break; //count++; //for문 length-1 한 이유가 마지막라인은 도착이므로 String fullstr = strSPLgroupId[i]; String[] guidecode = fullstr.split("guideCode\":\""); String[] guidement = fullstr.split("guideMent\":\""); String[] rotationCode = fullstr.split("rotationCode\":\""); String[] x = fullstr.split("x\":"); String[] y = fullstr.split("y\":"); guidecode[0] = guidecode[1].substring(0, guidecode[1].indexOf("\"")); guidement[0] = guidement[1].substring(0, guidement[1].indexOf("\"")); rotationCode[0] = rotationCode[1].substring(0, rotationCode[1].indexOf("\"")); // Log.i("dlfghldyd",x[0]); if(x[0].contains(",")) x[0] = x[1].substring(0, x[1].indexOf(",")); else x[0] = x[1].substring(0, x[1].indexOf("}")); if(x[0].contains("}")) x[0]=x[0].substring(0,x[0].length()-1); y[0] = y[1].substring(0, y[1].indexOf(",")); retStr=""; retStr += guidecode[0] + "@"; retStr += guidement[0] + "@"; retStr += rotationCode[0] + "@"; retStr += x[0] + "@"; retStr += y[0] + "@"; befRotaCode = nextRotaCode; if(i==1) nowRotaCode = rotationCode[0]; if(i==2) nextRotaCode = rotationCode[0]; if(i==1) bungiLength = guidement[0]; if(tmpLen==3 && i!=2) { firX = Double.parseDouble( x[0] ); firY = Double.parseDouble( y[0] ); } if(i==2) { firX = Double.parseDouble( x[0] ); firY = Double.parseDouble( y[0] ); } Log.i("retStr",i+"번쨰 " + retStr); } // tv_main_gpsval.setText(retStr); // Log.i("JINIB","getRoute진입중2"); } catch (Throwable t) { t.printStackTrace(); Log.d("MAIN", "ERROR"); } } if(strings[0].compareTo("GPS")==0) { try { // Log.i("JINIB","GPSC진입중1"); String ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17"; String strBuf = ""; strBuf = (Jsoup.connect(strings[1]).timeout(20000).ignoreContentType(true).execute().body()); double xx; double yy; String []tmpStrArr = strBuf.split("'"); xx = Double.parseDouble( tmpStrArr[1] ); yy = Double.parseDouble( tmpStrArr[3] ); retStrForGPS = xx + "@" + yy; // Log.i("JINIB","GSPC진입중2"); } catch (Throwable t) { t.printStackTrace(); Log.d("MAIN", "ERROR"); } } return null; } int bungi = 0; @Override protected void onPostExecute(String s) { super.onPostExecute(s); // Log.d("TagString",TagString); if(TagString.compareTo("ROUTE")==0) { // Log.i("JINIB","getRoute진입완료"); //firX curX befX Log.i("RSTT1", "firX : " + firX + " firY : " + firY + " befX : " + befX + " befY : " + befY + " curX : " + curX + " curY : "+ curY); if(firX == befX && firY == befY) { appendText("움직임없음"); return; } double a = Math.sqrt ( Math.pow(firX - befX,2) + Math.pow(firY - befY,2) ); double b = Math.sqrt ( Math.pow(curX - firX,2) + Math.pow(curY - firY,2) ); double c = Math.sqrt ( Math.pow(curX - befX,2) + Math.pow(curY - befY,2) ); curResult = Math.acos( ( c*c + a*a - b*b ) / ( 2 * c * a ) ) * 180/Math.PI; if(curResult >60) checkReflashNum++; else checkReflashNum=0; Log.i("RSTT2", "a : " + a + "b : " + b + " c : "+ c + " rst : " + curResult); befX = curX; befY = curY; final Handler handler = new Handler(); new Thread(new Runnable() { @Override public void run() { handler.post(new Runnable() { public void run() { // tv_navi_meter // iv_navi_leftright // tv_niavi_do // tv_navi_tofrom Log.i("ASDASD","asdasdasd"); bungi++; if(curBungiNum != befBungiNum) { // appendText(befRotaCode + " 방향으로 턴입니다"); if(befRotaCode.compareTo("TURN_LEFT")==0) { myTTS.speak("현재 지점에서 왼쪽 방향으로 턴입니다", TextToSpeech.QUEUE_ADD, null); } else if(befRotaCode.compareTo("TURN_RIGHT")==0) { myTTS.speak("현재 지점에서 오른쪽 방향으로 턴입니다", TextToSpeech.QUEUE_ADD, null); } } else { // if(bungi>10) // { bungi=0; if(checkReflashNum>=maxCheckReflashNum) { tv_navi_meter.setText(String.valueOf(bungiLength)+"후"); tv_navi_test.setText(nextRotaCode); if(nextRotaCode.compareTo("TURN_LEFT")==0) { iv_navi_leftright.setImageDrawable(getResources().getDrawable(R.drawable.left)); } else if(nextRotaCode.compareTo("TURN_RIGHT")==0) { iv_navi_leftright.setImageDrawable(getResources().getDrawable(R.drawable.right)); } tv_niavi_do.setText(String.valueOf((int)(curResult))+"º\n틀어졌습니다."); tv_navi_tofrom.setText(String.valueOf(curX)+"\n"+String.valueOf(curY)); if(SC.doNum>2) { SC.doNum=0; myTTS.speak(String.valueOf((int)(curResult))+"도 틀어졌습니다.", TextToSpeech.QUEUE_ADD, null); } SC.doNum++; if(SC.meterNum>3) { SC.meterNum=0; myTTS.speak(String.valueOf(bungiLength), TextToSpeech.QUEUE_ADD, null); } SC.meterNum++; tv_navi_test.setText("미터 : " + String.valueOf(SC.meterNum) +"\n도넘 : " + String.valueOf(SC.doNum)); // appendText("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,틀어짐 : " + curResult + " , 다음방향" + nextRotaCode ); // myTTS.speak("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,틀어짐 : " + curResult + " , 다음방향" + nextRotaCode , TextToSpeech.QUEUE_ADD, null); } else { SC.doNum=0; tv_navi_meter.setText(String.valueOf(bungiLength)+"후"); tv_navi_test.setText(nextRotaCode); if(nextRotaCode.compareTo("TURN_LEFT")==0) { iv_navi_leftright.setImageDrawable(getResources().getDrawable(R.drawable.left)); } else if(nextRotaCode.compareTo("TURN_RIGHT")==0) { iv_navi_leftright.setImageDrawable(getResources().getDrawable(R.drawable.right)); } tv_niavi_do.setText("올바른 방향입니다.\n"+String.valueOf((int)(curResult))+"º"); tv_navi_tofrom.setText(String.valueOf(curX)+"\n"+String.valueOf(curY)); if(SC.meterNum>2) { SC.meterNum=0; myTTS.speak(String.valueOf(bungiLength), TextToSpeech.QUEUE_ADD, null); } SC.meterNum++; tv_navi_test.setText("미터 : " + String.valueOf(SC.meterNum) +"\n도넘 : " + String.valueOf(SC.doNum)); // appendText("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,옳바른 방향입니다 : (" + curResult + ") , 다음방향" + nextRotaCode ); // myTTS.speak("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,옳바른 방향입니다 : (" + curResult + ") , 다음방향" + nextRotaCode, TextToSpeech.QUEUE_ADD, null); } // } } } }); } }).start(); // 3번 방향 60도벗어낫을경우 틀어짐알려줌 if(checkReflashNum>=maxCheckReflashNum) { appendText("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,틀어짐 : " + curResult + " , 다음방향" + nextRotaCode ); return; } // 분기도달시 if(curBungiNum != befBungiNum) { appendText(befRotaCode + " 방향으로 턴입니다"); return; } // setDirection("curResult : " + curResult); appendText("curResult : " + curResult); appendText("현재방향 : " + nowRotaCode + " ,남은거리 : " + bungiLength + "\n" + " ,옳바른 방향입니다 : (" + curResult + ") , 다음방향" + nextRotaCode ); } else if(TagString.compareTo("GPS")==0) { // Log.i("JINIB","GPSC진입완료"); String [] tmpStrArr = retStrForGPS.split("@"); Log.i("retStrForGPS" , retStrForGPS); double[] tmpDoubleArr = new double[2]; if(isFirst==true) { endX = Double.parseDouble(tmpStrArr[0]); endY = Double.parseDouble(tmpStrArr[1]); isFirst=false; bt_main_getgps(null); return ; } //바뀐 x,y값 curX = tmpDoubleArr[0] = Double.parseDouble(tmpStrArr[0]); curY = tmpDoubleArr[1] = Double.parseDouble(tmpStrArr[1]); // appendText(tmpStrArr[0]+" , "+tmpStrArr[1]); getRoute(tmpDoubleArr[0],tmpDoubleArr[1],endX,endY); } } } private void setDirection(String retStr) { Log.i("THIS",retStr); } @Override public void onInit(int status) { String tmpStr = "목적지 " + Destination+ "으로 길 안내를 시작합니다"; myTTS.speak(tmpStr, TextToSpeech.QUEUE_ADD, null); } public class StairsTTSThread extends Thread { private long time[] = new long[20];// 0 시간 1 lat 2 lon private int top; private final int TIMESIZE = 20; public StairsTTSThread() { top = 2; time[0] = 0; time[1] = 0; } public void run() { Log.i("#111", "들어옴2"); for (; stopThread;) { try { Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (soccket.hTop != soccket.hRear) { if(soccket.hQueue[soccket.hRear % 20]==1||soccket.hQueue[soccket.hRear % 20]==2) { time[top % TIMESIZE] = System.currentTimeMillis(); top++; } Log.i("#333", "3333"); if (soccket.hQueue[soccket.hRear % 20] == 10) { hStairs.post(new Runnable() { String myText; @Override public void run() { myText = "전방에 올라가는 계단이 있습니다."; // if(soccket.BluetoothConnected) // soccket.sendData("1\n\n"); if (AndroidSocket.OPTION_TTS) myTTS.speak(myText, TextToSpeech.QUEUE_FLUSH, null); soccket.hRear++; } }); } if (soccket.hQueue[soccket.hRear % 20] == 11) { hStairs.post(new Runnable() { String myText; @Override public void run() { myText = "전방에 내려가는 계단이 있습니다."; // if(soccket.BluetoothConnected) // soccket.sendData("2\n\n"); if (AndroidSocket.OPTION_TTS) myTTS.speak(myText, TextToSpeech.QUEUE_FLUSH, null); soccket.hRear++; } }); } if (time[top % TIMESIZE] - time[(top - 3) % TIMESIZE] < 200000 && time[(top - 3) % TIMESIZE] != 0)// 10초 이내에 3번 이상 // 발생하면 { Log.i("#444", "444"); hStairs.post(new Runnable() { String myText; @Override public void run() { switch (soccket.hQueue[soccket.hRear % 20]) { case 10: myText = "전방에 올라가는 계단이 있습니다."; // if(soccket.BluetoothConnected) // soccket.sendData("1\n\n"); if (AndroidSocket.OPTION_TTS) myTTS.speak(myText, TextToSpeech.QUEUE_FLUSH, null); break; case 11: myText = "전방에 내려가는 계단이 있습니다."; // if(soccket.BluetoothConnected) // soccket.sendData("2\n\n"); if (AndroidSocket.OPTION_TTS) myTTS.speak(myText, TextToSpeech.QUEUE_FLUSH, null); break; case 1: SendStairsData('1'); if (AndroidSocket.OPTION_TTS) myText = "올라가는 계단을 저장하였습니다."; break; case 2: SendStairsData('2'); if (AndroidSocket.OPTION_TTS) myText = "내려가는 계단을 저장하였습니다."; break; } if (AndroidSocket.OPTION_TTS) myTTS.speak(myText, TextToSpeech.QUEUE_FLUSH, null); soccket.hRear++; top = 3; time[0] = 0; time[1] = 0; time[2] = 0; } }); } else soccket.hRear++; } } } public void SendStairsData(char type)// 서버로 보내는 함수 { String strTemp = "A_SAVESTA#"; char cMsg[] = new char[128]; String lat = Double.toString(soccket.latitude);// gps.loc.getLatitude()); String lon = Double.toString(soccket.longitude);// gps.loc.getLongitude()); int i; for (i = 0; strTemp.charAt(i) != '#'; i++) cMsg[i] = strTemp.charAt(i); for (i = 21; i < lat.length() + 21; i++) cMsg[i] = lat.charAt(i - 21); cMsg[i] = '#'; for (i = 41; i < lon.length() + 41; i++) cMsg[i] = lon.charAt(i - 41); cMsg[i] = '#'; cMsg[61] = type; cMsg[62] = '#'; strTemp = ""; for (i = 0; i < 128; i++) strTemp += cMsg[i]; soccket.SendMessage(strTemp); } } } // 버튼누름 - getMyLocation - GPS 가동 - changeGPSType - getRoute - 현 전 첫 관계로 세타계산
[ "xodn0812@naver.com" ]
xodn0812@naver.com
3b125dbb93c2693e058686e3a0029ca20d2f56af
a09e548fa13d96414f217caa60d7bf3f6a4786d9
/src/staticPractice/StudentTest.java
3a7b7d1ee671f5437695a40ae870599204d9dd6f
[]
no_license
ozofweird/Java_Practice
3238c06dbd0f1a6a997ae76d5a8b84e781190e24
6000e529ab5464dd2628050e54bab56e55c97483
refs/heads/master
2022-11-17T19:45:23.387020
2020-07-13T16:56:59
2020-07-13T16:56:59
273,416,839
0
0
null
null
null
null
UHC
Java
false
false
587
java
package staticPractice; public class StudentTest { public static void main(String[] args) { // TODO Auto-generated method stub Student studentLee = new Student(); studentLee.studentName = "이순신"; studentLee.address = "서울"; studentLee.showStudentInfo(); Student studentKim = new Student(); studentKim.studentName = "김유신"; studentKim.address = "경주"; studentKim.showStudentInfo(); Student studentYue = new Student(100, "유재석"); studentYue.showStudentInfo(); System.out.println(studentLee); System.out.println(studentKim); } }
[ "ozofweird@gmail.com" ]
ozofweird@gmail.com
0271bad339252567bc1e7600208356671129ebcb
f416942dd0d5c5d024adab7e1703bbcec7cb216b
/src/main/java/dao/JobDao.java
caf0b2b5cfb91b885b9e1e7aeef2337a00e53a2f
[]
no_license
i-am-ayush/care-training
ce5f5ef98243039eec26fef923119a9a556b1705
7adc4a2cae8ae137b34f94981b04dc917dd5c009
refs/heads/master
2022-06-24T17:06:11.040745
2019-06-04T05:31:15
2019-06-04T05:31:15
189,842,369
0
0
null
null
null
null
UTF-8
Java
false
false
5,651
java
package dao; import bean.Job; import org.apache.log4j.Logger; import util.QueryExecutor; import java.sql.*; import java.util.*; import java.util.Date; public class JobDao { private final static Logger logger = Logger.getLogger(DatabaseConnector.class); static Connection conn = DatabaseConnector.getConnection(); public static boolean save(Job job) { try { PreparedStatement stmt = conn.prepareStatement("insert into job(title,postedBy,startDateTime,endDateTime,payPerHour) values(?,?,?,?,?)"); stmt.setString(1, job.getTitle()); stmt.setInt(2, job.getPostedBy()); java.sql.Date sqlDate1 = new java.sql.Date(job.getStartDateTime().getTime()); java.sql.Date sqlDate2 = new java.sql.Date(job.getEndDateTime().getTime()); stmt.setDate(3, sqlDate1); stmt.setDate(4, sqlDate2); stmt.setDouble(5, job.getPayPerHour()); stmt.execute(); stmt.close(); return true; } catch (SQLException e) { logger.error(e.getMessage(), e); return false; } } public static boolean update(Job job) { try { PreparedStatement stmt = conn.prepareStatement("UPDATE job " + "SET title=?, startDateTime=?, endDateTime=?, payPerHour=? " + "WHERE id=?"); stmt.setString(1, job.getTitle()); java.sql.Date sqlDate1 = new java.sql.Date(job.getStartDateTime().getTime()); java.sql.Date sqlDate2 = new java.sql.Date(job.getEndDateTime().getTime()); stmt.setDate(2, sqlDate1); stmt.setDate(3, sqlDate2); stmt.setDouble(4, job.getPayPerHour()); stmt.setInt(5, job.getId()); stmt.executeUpdate(); return true; } catch (SQLException e) { e.printStackTrace(); } return false; } public static Job getById(int jobId) { PreparedStatement stmt = null; try { stmt = conn.prepareStatement("SELECT * FROM JOB where id=?"); stmt.setInt(1, jobId); ResultSet res = QueryExecutor.queryExecute(stmt); Job job = new Job(); while (res.next()) { job.setId(res.getInt(1)); job.setTitle(res.getString(2)); job.setPostedBy(res.getInt(3)); job.setStartDateTime(res.getDate(4)); job.setEndDateTime(res.getDate(5)); job.setPayPerHour(res.getDouble(6)); } res.close(); stmt.close(); return job; } catch (SQLException e) { e.printStackTrace(); } return null; } public static boolean delete(int jobId) { PreparedStatement stmt = null; try { stmt = conn.prepareStatement("UPDATE job " + "SET status='INACTIVE' " + "WHERE id=?"); stmt.setInt(1, jobId); stmt.executeUpdate(); return true; } catch (SQLException e) { e.printStackTrace(); return false; } } public static List<Job> getJobsPostedBy(int id) { List<Job> resultList = new LinkedList<>(); try (PreparedStatement stmt = conn.prepareStatement("SELECT * FROM job WHERE postedBy=?")) { stmt.setInt(1, id); try (ResultSet res = stmt.executeQuery()) { while (res.next()) { Job job = new Job(); job.setId(res.getInt("id")); job.setTitle(res.getString("title")); job.setStartDateTime(res.getDate("startDateTime")); job.setEndDateTime(res.getDate("endDateTime")); job.setPayPerHour(res.getDouble("payPerHour")); job.setStatus(Job.Status.stringToEnum(res.getString("status"))); resultList.add(job); } } } catch (Exception e) { } return resultList; } public static List<Job> getAllJobs() { List<Job> resultList = new LinkedList<>(); try (PreparedStatement stmt = conn.prepareStatement("SELECT * FROM job")) { try (ResultSet res = stmt.executeQuery()) { while (res.next()) { Job job = new Job(); job.setId(res.getInt("id")); job.setTitle(res.getString("title")); job.setStartDateTime(res.getDate("startDateTime")); job.setEndDateTime(res.getDate("endDateTime")); job.setPayPerHour(res.getDouble("payPerHour")); resultList.add(job); } } } catch (Exception e) { } return resultList; } // public static void main(String[] args) { // Job job = new Job(); // job.setId(1); // JobDao.delete(job); // job = null; // job = JobDao.getById(1); // System.out.println(job.getTitle()); // List<Job> l = new ArrayList<>(); // l = JobDao.getAllJobs(); // for (int i = 0; i < l.size(); i++) { // System.out.println(l.get(i).getTitle()); // } // // Job job = new Job(); // job.setPayPerHour(800.0); // Date date = new Date(); // job.setPostedBy(1); // job.setStartDateTime(date); // job.setEndDateTime(date); // job.setTitle("baby care4"); // JobDao.save(job); // // // } // } }
[ "ayushsrivastava0108@gmail.com" ]
ayushsrivastava0108@gmail.com
04636816be6204439342aa12d4321d5758853af2
283b0b961cb5a1a4ab1557a4a892d3d999183c91
/src/TestClass.java
c84d995b7692fcd837f476f3ddfe303d54cf7833
[]
no_license
rahul4frnd/javapractice
a25cce7387ebcc6adfa9932319f26770daeda2ff
f7bc2b4e7cabeedf932b02e7f9797b43abb6d984
refs/heads/master
2021-01-10T04:54:23.561609
2016-01-14T08:06:02
2016-01-14T08:06:02
49,627,944
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
/** method overloading. */ class add { void Add(int a, int b) { int c = a + b; System.out.println(c); } void Add(int a, int b,int c) { int d = a + b + c; System.out.println(d); } } public class TestClass { public static void main(String[] args){ Add a=new Add(); a.Add(3,4); a.Add(3,4,6); } }
[ "rahul@home" ]
rahul@home
163bb70b2e3fd7632d6f2940ab8685b36d89df05
7bcf6018f676fd0038922ae045814810ef504d8a
/src/filebinding/com/filebinding/core/config/DocumentFieldConfiguration.java
6fb9659f84ab94fbf0382dac46e8a2d7927462ed
[]
no_license
wiston1988/file-binding
b55569b7bbd087ce8a98345c88beeb6ea154de82
c85b9cb4cd19c1747bf63a931aace8d745d6c99f
refs/heads/master
2020-04-15T21:31:42.338731
2017-08-22T09:11:09
2017-08-22T09:11:09
30,283,577
0
0
null
null
null
null
UTF-8
Java
false
false
10,371
java
package com.filebinding.core.config; import java.beans.PropertyDescriptor; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.filebinding.core.exception.ConfigException; import com.filebinding.core.exception.FieldException; import com.filebinding.core.exception.MappingException; import com.filebinding.core.fieldSupport.FieldParser; import com.filebinding.core.fieldSupport.FieldRenderer; import com.filebinding.core.util.introspector.IntrospectUtil; public class DocumentFieldConfiguration implements Serializable { private static final long serialVersionUID = 4628855917108563200L; private final static Log log = LogFactory.getLog(DocumentFieldConfiguration.class); /**Configuration field**/ private String name; private String columnName; private String groupName; private boolean required; private String parseFormatStr; private String buildFormatStr; private String flag; /**********UnConfiguration field*****************/ private List<PropertyDescriptor> propertyDescriptors = new ArrayList<PropertyDescriptor>(); private Class type; private int propertyDesSize=-1; private boolean valid = true; private FieldRenderer fieldRenderer; private FieldParser fieldParser; private static final String EMPTY_STR = ""; private final static DocumentFieldConfiguration ignoreField = new DocumentFieldConfiguration(false); public static DocumentFieldConfiguration getIgnoreFieldConfiguration(){ return ignoreField; } /***Set Default Value of Field Config here***/ public DocumentFieldConfiguration(){ } private DocumentFieldConfiguration(boolean valid){ this.valid = valid; } public String getName() { return name; } public String getColumnName() { return columnName; } public String getGroupName() { return groupName; } public boolean isRequired() { return required; } public String getBuildFormatStr() { return buildFormatStr; } public String getParseFormatStr() { return parseFormatStr; } public String getFlag() { return flag; } public boolean isValid() { return valid; } public FieldParser getFieldParser() { return fieldParser; } public FieldRenderer getFieldRenderer() { return fieldRenderer; } public Class getType(){ return type; } public int getPropertyDesSize(){ if(propertyDesSize == -1) propertyDesSize = propertyDescriptors.size(); return propertyDesSize; } /***protected for setter***/ protected void setName(String name) { this.name = name; } protected void setColumnName(String columnName) { this.columnName = columnName; } protected void setGroupName(String groupName) { this.groupName = groupName; } protected void setRequired(boolean required) { this.required = required; } protected void setFormatStr(String formatStr) { if(parseFormatStr == null || parseFormatStr.trim().length() == 0) parseFormatStr = formatStr; if(buildFormatStr == null || buildFormatStr.trim().length() == 0) buildFormatStr = formatStr; } protected void setFlag(String flag) { this.flag = flag; } protected void setValid(boolean valid) { this.valid = valid; } protected void setParserName(String parserName) throws ConfigException { buildParser(parserName); } protected void setFieldParser(FieldParser fieldParser) { this.fieldParser = fieldParser; } protected void setRendererName(String rendererName) throws ConfigException { buildRenderer(rendererName); } protected void setFieldRenderer(FieldRenderer fieldRenderer) { this.fieldRenderer = fieldRenderer; } protected void setRendererInstance(FieldRenderer fieldRenderer){ this.fieldRenderer = fieldRenderer; } protected void setBuildFormatStr(String buildFormatStr) { this.buildFormatStr = buildFormatStr; } protected void setParseFormatStr(String parseFormatStr) { this.parseFormatStr = parseFormatStr; } protected void setPropertyDescriptors(List<PropertyDescriptor> propertyDescriptors) { this.propertyDescriptors = propertyDescriptors; if(getPropertyDesSize() > 0){ this.type = propertyDescriptors.get(getPropertyDesSize() -1).getPropertyType(); } } private void buildParser(String parserName) throws ConfigException { final String info = "\nbuildRenderer - "; if(parserName == null || parserName.trim().length() == 0) return; try{ fieldParser = (FieldParser) Class.forName(parserName).newInstance(); }catch ( ClassNotFoundException e ){ log.error(info + "ClassNotFoundException for csv parser: " + parserName, e); throw new ConfigException(info + "ClassNotFoundException for csv parser: " + parserName,e); }catch ( InstantiationException e ){ log.error(info + "InstantiationException for csv parser: " + parserName, e); throw new ConfigException(info + "InstantiationException for csv parser: " + parserName,e); }catch ( IllegalAccessException e ){ log.error(info + "IllegalAccessException for csv parser: " + parserName, e); throw new ConfigException(info + "IllegalAccessException for csv parser: " + parserName,e); }catch ( Exception e ){ log.error(info + "Unknown Exception for csv parser: " + parserName, e); throw new ConfigException(info + "Unknown Exception for csv parser: " + parserName,e); } } private void buildRenderer(String rendererName) throws ConfigException { final String info = "\nbuildRenderer - "; if(rendererName == null || rendererName.trim().length() == 0) return; try{ fieldRenderer = (FieldRenderer) Class.forName(rendererName).newInstance(); }catch ( ClassNotFoundException e ){ log.error(info + "ClassNotFoundException for csv renderer: " + rendererName, e); throw new ConfigException(info + "ClassNotFoundException for csv renderer: " + rendererName,e); }catch ( InstantiationException e ){ log.error(info + "InstantiationException for csv renderer: " + rendererName, e); throw new ConfigException(info + "InstantiationException for csv renderer: " + rendererName,e); }catch ( IllegalAccessException e ){ log.error(info + "IllegalAccessException for csv renderer: " + rendererName, e); throw new ConfigException(info + "IllegalAccessException for csv renderer: " + rendererName,e); }catch ( Exception e ){ log.error(info + "Unknown Exception for csv renderer: " + rendererName, e); throw new ConfigException(info + "Unknown Exception for csv renderer: " + rendererName,e); } } //Copy could be public public DocumentFieldConfiguration copy() throws ConfigException { DocumentFieldConfiguration fieldConfiguration = new DocumentFieldConfiguration(); fieldConfiguration.setName(name); fieldConfiguration.setColumnName(columnName); fieldConfiguration.setGroupName(groupName); fieldConfiguration.setRequired(required); fieldConfiguration.setParseFormatStr(parseFormatStr); fieldConfiguration.setBuildFormatStr(buildFormatStr); fieldConfiguration.setFlag(flag); fieldConfiguration.setPropertyDescriptors(propertyDescriptors); fieldConfiguration.setFieldParser(fieldParser); fieldConfiguration.setFieldRenderer(fieldRenderer); return fieldConfiguration; } /***Used for business layer***/ public void setFieldValue(String fieldValue, Object bean) throws MappingException{ String info = "\n DocumentFieldConfiguration::setFieldValue - "; if(!valid) return; if((fieldValue == null || fieldValue.trim().length() == 0) && required){ String errMsg = "Record Field: [" + name + "] is not defined in imported File"; log.error(info + errMsg); throw new FieldException(name, errMsg); } if(fieldValue != null)//FIXME, shall we trim value here, or let unTrimed value go to parser fieldValue = fieldValue.trim(); /***Convert Data***/ Object covertedValue = null; try{ covertedValue = fieldParser.getParsedValue(fieldValue, bean, this); }catch(Exception e){ log.error(info + e.getMessage(), e); throw new FieldException(name,fieldValue, e.getMessage(), e); } /***Set Value to mapping field***/ try{ IntrospectUtil.setPropertyValue(propertyDescriptors, bean, covertedValue); }catch(Exception e){ log.error(info + e.getMessage(), e); throw new FieldException(name,fieldValue, e.getMessage(), e); } if(log.isTraceEnabled()) log.trace(info + "set field name: [" + name + "] with value: [" + fieldValue + "]"); } public Object getFieldObjectValue(Object bean)throws MappingException{ String info = "\n DocumentFieldConfiguration::getFieldValue - "; if(!valid) return EMPTY_STR; Object pojoValue = null; try{ pojoValue = IntrospectUtil.getPropertyValue(propertyDescriptors, bean); }catch(Exception e){ log.error(info + e.getMessage(), e); throw new FieldException(name, e.getMessage(), e); } Object fieldValue = null; try{ fieldValue = fieldRenderer.getRenderedObjectValue(pojoValue, bean, this); }catch(Exception e){ log.error(info + e.getMessage(), e); throw new FieldException(name, fieldValue.toString(),e.getMessage(), e); } if(fieldValue == null || ( fieldValue instanceof String && ( (String)(fieldValue)).trim().length() == 0 ) ){ if(required){ String errMsg = "Record Field: [" + name + "] is missing or not valid"; log.error(info + errMsg); throw new FieldException(name, errMsg); }else{ return EMPTY_STR; } } return fieldValue; } public String getFieldValue(Object bean)throws MappingException{ String info = "\n DocumentFieldConfiguration::getFieldValue - "; if(!valid) return EMPTY_STR; Object pojoValue = null; try{ pojoValue = IntrospectUtil.getPropertyValue(propertyDescriptors, bean); }catch(Exception e){ log.error(info + e.getMessage(), e); throw new FieldException(name, e.getMessage(), e); } String fieldValue = null; try{ fieldValue = fieldRenderer.getRenderedValue(pojoValue, bean, this); }catch(Exception e){ log.error(info + e.getMessage(), e); throw new FieldException(name,fieldValue, e.getMessage(), e); } if(fieldValue == null || fieldValue.trim().length() == 0){ if(required){ String errMsg = "Record Field: [" + name + "] is missing or not valid"; log.error(info + errMsg); throw new FieldException(name, errMsg); }else{ return EMPTY_STR; } } return fieldValue; } }
[ "wiston1988@sina.com" ]
wiston1988@sina.com
4cc282481504f9daef63c0584250923e9a781863
086b4d22c95f8982d14a2b70316ed9d04c81fcb9
/advanced-jaxrs-paramConverters/src/main/java/org/anirban/jaxrs/rest/MyDate.java
e8d4ab72098953fdff88503e21a5efe5f87b0713
[]
no_license
anirbanbhat/jax-rs
e87c870097ce3ac2f187cdf8097bde6a3ca04989
c75a0973858dc02af5a58ef1ed113ca658576150
refs/heads/master
2022-02-25T02:32:02.967268
2019-09-02T20:20:15
2019-09-02T20:20:15
205,930,538
0
0
null
null
null
null
UTF-8
Java
false
false
494
java
package org.anirban.jaxrs.rest; public class MyDate { private int day; private int month; private int year; public int getDay() { return day; } public void setDay(int day) { this.day = day; } public int getMonth() { return month; } public void setMonth(int month) { this.month = month; } public int getYear() { return year; } public void setYear(int year) { this.year = year; } @Override public String toString() { return day + "-" + month + "-" + year; } }
[ "anirban.bhattacherji@ericsson.com" ]
anirban.bhattacherji@ericsson.com
e21a5ad5bad4620c7f8bbf4bc35c116fc96cb3b4
d6b9618bfd6852968876ff31950331258aa26ff9
/backend/n2o/n2o-test/src/test/java/net/n2oapp/framework/test/CamundaDataProviderEngineTest.java
f4a1de8acc6e555f50c7b42d1bf34efcd8cfa327
[ "Apache-2.0" ]
permissive
i-novus-llc/n2o-framework
03c19201914e4f551cbdce6cb8a3d013fb700af2
172e7724fc9cdd029ee8dd5b25985aeb4bf30659
refs/heads/master
2023-08-09T13:50:28.451652
2023-08-09T13:26:56
2023-08-09T13:26:56
162,547,920
43
21
Apache-2.0
2023-02-03T11:48:29
2018-12-20T08:16:02
Java
UTF-8
Java
false
false
5,725
java
package net.n2oapp.framework.test; import net.n2oapp.framework.api.metadata.dataprovider.N2oCamundaDataProvider; import net.n2oapp.framework.boot.camunda.CamundaDataProviderEngine; import net.n2oapp.framework.boot.camunda.ExtTask; import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.TaskService; import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; import org.camunda.bpm.engine.impl.persistence.entity.TaskEntity; import org.camunda.bpm.engine.task.Task; import org.camunda.bpm.engine.task.TaskQuery; import org.junit.jupiter.api.*; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.annotation.DirtiesContext; import java.util.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.*; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.when; @SpringBootTest @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CamundaDataProviderEngineTest { @MockBean ProcessEngine processEngine; @MockBean TaskService taskService; @MockBean TaskQuery taskQuery; @MockBean RuntimeService runtimeService; @Autowired CamundaDataProviderEngine engine; private N2oCamundaDataProvider invocation; @BeforeEach public void config() { invocation = new N2oCamundaDataProvider(); when(processEngine.getTaskService()).thenReturn(taskService); when(processEngine.getRuntimeService()).thenReturn(runtimeService); when(taskService.createTaskQuery()).thenReturn(taskQuery); } @Test public void getCountTasksTest() { when(taskQuery.count()).thenReturn(99L); invocation.setOperation(N2oCamundaDataProvider.Operation.countTasks); Object result = engine.invoke(invocation, new HashMap<>()); assertThat(result, instanceOf(Long.class)); assertThat(result, is(99L)); } @Test public void findTasksTest() { List<Task> list = new ArrayList<>(); TaskEntity taskEntity = new TaskEntity(); taskEntity.setId("2-2-2"); list.add(taskEntity); when(taskQuery.listPage(0, 10)).thenReturn(list); when(taskService.getVariables(eq("2-2-2"), anyCollection())).thenReturn( new HashMap<String, Object>() {{ put("position", "pos1"); put("salary", "100500"); }}); invocation.setOperation(N2oCamundaDataProvider.Operation.findTasks); Map<String, Object> params = new HashMap<>(); params.put("select", Collections.singletonList("position")); Object result = engine.invoke(invocation, params); assertThat(result, instanceOf(List.class)); ExtTask taskRes = (ExtTask) ((List) result).get(0); assertThat(taskRes.getId(), is("2-2-2")); assertThat(taskRes.getVariables().size(), is(2)); } @Test public void getTaskTest() { TaskEntity taskEntity = new TaskEntity(); taskEntity.setId("1-1"); when(taskQuery.taskId("1-1")).thenReturn(taskQuery); when(taskQuery.singleResult()).thenReturn(taskEntity); when(taskService.getVariables("1-1")).thenReturn(new HashMap<String, Object>() {{ put("position", "pos1"); put("salary", "100500"); }}); invocation.setOperation(N2oCamundaDataProvider.Operation.getTask); Map<String, Object> params = new HashMap<String, Object>() {{ put("id", "1-1"); }}; ExtTask result = (ExtTask)engine.invoke(invocation, params); assertThat(result.getId(), is("1-1")); assertThat(result.getVariables().size(), is(2)); } @Test public void setTaskVariablesTest() { invocation.setOperation(N2oCamundaDataProvider.Operation.setTaskVariables); Map<String, Object> params = new HashMap<String, Object>() {{ put("id", "3-3-3"); put("position", "pos1"); put("salary", "100500"); }}; Object result = engine.invoke(invocation, params); assertThat(result, is(true)); Mockito.verify(taskService).setVariables(eq("3-3-3"), anyMap()); } @Test public void completeTaskVariablesTest() { invocation.setOperation(N2oCamundaDataProvider.Operation.completeTask); Map<String, Object> params = new HashMap<String, Object>() {{ put("id", "3-4-5"); put("position", "pos1"); put("salary", "100500"); }}; Object result = engine.invoke(invocation, params); assertThat(result, is(true)); Mockito.verify(taskService).complete(eq("3-4-5"), anyMap()); } @Test public void startProcessTest() { when(runtimeService.startProcessInstanceByKey(eq("recruitment"), anyMap())).thenAnswer(a -> { ExecutionEntity res = new ExecutionEntity(); res.setId(a.getArgument(0)); return res; }); invocation.setOperation(N2oCamundaDataProvider.Operation.startProcess); Map<String, Object> params = new HashMap<String, Object>() {{ put("id", "recruitment"); put("position", "pos1"); put("salary", "100500"); }}; Object result = engine.invoke(invocation, params); assertThat(result, instanceOf(String.class)); assertThat(result, is("recruitment")); } }
[ "estartcev@i-novus.ru" ]
estartcev@i-novus.ru
b195f57b0e6431a1cdb972c2a683ec498000ed3a
bbf6b05c374d10948896a366d19ccf2657ae44f1
/OA/src/com/xxgc/bean/Manager.java
2e3c7229f798fd997d66ebd634c0356356930f6e
[]
no_license
vonyaolijain/Worker
943cc83325580100a6571bad2b22f1c1c59386ac
dfd88634dc840e418c557fbeecec8d71026e3bc9
refs/heads/master
2021-04-09T16:35:59.276721
2018-03-26T08:08:51
2018-03-26T08:08:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package com.xxgc.bean; public class Manager { private int id; private String username; private String password; public void setId(int id){ this.id=id; } public int getId(){ return 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 "Manager [id=" + id + ", username=" + username + ", password=" + password + "]"; } }
[ "13767343373@163.com" ]
13767343373@163.com
f1d1da9f9b72c24200aa81f8508684dc45be0d22
90ffeca7dacefb4c830a2173f9953a0cf4d51b78
/carAnalysis/src/snooway/dao/DBConnectionPool_app2.java
370e5003bca32bb92c043068552a0c8141ae04c7
[]
no_license
guoshengCS/carAnalysis
321cb4c0e6aacee2ff9f612411ab5be5cedb2b25
4ab5d4ddc4920d35e79ec8cbc6404f2d3f4463cb
refs/heads/master
2021-01-10T10:57:52.088271
2016-03-21T06:33:03
2016-03-21T06:33:03
52,714,711
0
0
null
null
null
null
GB18030
Java
false
false
1,864
java
package snooway.dao; import java.beans.PropertyVetoException; import java.sql.Connection; import java.sql.SQLException; import com.mchange.v2.c3p0.ComboPooledDataSource; /** * 与应用数据库的连接池 * @author Bys * */ public class DBConnectionPool_app2 { private static DBConnectionPool_app2 instance; private ComboPooledDataSource dataSource; private DBConnectionPool_app2(String drv, String url, String user, String pass) throws SQLException, PropertyVetoException { dataSource = new ComboPooledDataSource(); dataSource.setUser(user); dataSource.setPassword(pass); dataSource.setJdbcUrl(url); dataSource.setDriverClass(drv); //自定义的配置 最小连接 1 个,最大连接 10 个 dataSource.setInitialPoolSize(1); dataSource.setMinPoolSize(1); dataSource.setMaxPoolSize(50); dataSource.setMaxStatements(0); dataSource.setMaxIdleTime(60); dataSource.setIdleConnectionTestPeriod(60); // dataSource.setDebugUnreturnedConnectionStackTraces(true); } public static final DBConnectionPool_app2 getInstance(String drv, String url, String user, String pass) { if (instance == null) { try { instance = new DBConnectionPool_app2(drv, url, user, pass); } catch (Exception e) { e.printStackTrace(); } } return instance; } public synchronized final Connection getConnection() { Connection conn = null; try { conn = dataSource.getConnection(); } catch (SQLException e) { e.printStackTrace(); } return conn; } }
[ "whucsgs@163.com" ]
whucsgs@163.com
dd6a38173b921f60614bc3d56a6e3cd9cbf8a99d
6272a913fb1dc228ba294967da54a1a4934be22d
/cardmerchantfront-admin/src/main/java/com/pay/typay/biz/agent/service/impl/AgentdepositorderServiceImpl.java
32f514c9243fa5ff01c316a82855f19caeaf946b
[]
no_license
ikv163/CardMerchantFront
485b3a80e776a3c9d8e908d918ae461f593dd294
02b41eede4edc7f245df9ff39df59ae8ff4f149e
refs/heads/master
2022-12-04T02:41:13.430299
2020-08-22T08:44:10
2020-08-22T08:44:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,368
java
package com.pay.typay.biz.agent.service.impl; import com.pay.typay.biz.agent.domain.Agentdepositorder; import com.pay.typay.biz.agent.mapper.AgentdepositorderMapper; import com.pay.typay.biz.agent.service.IAgentdepositorderService; import com.pay.typay.common.annotation.DataSource; import com.pay.typay.common.core.text.Convert; import com.pay.typay.common.enums.DataSourceType; import com.pay.typay.common.utils.SnowflakeIdWorker; import com.pay.typay.framework.util.ShiroUtils; import com.pay.typay.system.domain.SysUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.util.List; /** * 代理银行卡充值订单Service业务层处理 * * @author oswald * @date 2020-05-14 */ @Service @DataSource(DataSourceType.typayv2) public class AgentdepositorderServiceImpl implements IAgentdepositorderService { @Autowired private AgentdepositorderMapper tAgentdepositorderMapper; /** * 查询代理银行卡充值订单 * * @param orderindex 代理银行卡充值订单ID * @return 代理银行卡充值订单 */ @Override public Agentdepositorder selectAgentdepositorderById(Long orderindex) { return tAgentdepositorderMapper.selectAgentdepositorderById(orderindex,ShiroUtils.getSupplierbranchid().toString()); } /** * 查询代理银行卡充值订单列表 * * @param tAgentdepositorder 代理银行卡充值订单 * @return 代理银行卡充值订单 */ @Override public List<Agentdepositorder> selectAgentdepositorderList(Agentdepositorder tAgentdepositorder) { SysUser sysUser = ShiroUtils.getSysUser(); tAgentdepositorder.setSupplierbranchid(sysUser.getSupplierbranchid()); if (!sysUser.isAdmin()){ tAgentdepositorder.setAgentId(Long.parseLong(sysUser.getAgentId())); } // tAgentdepositorder.setAgentId(Long.parseLong(sysUser.getAgentId())); // tAgentdepositorder.setAgentCode(sysUser.getUserId()); return tAgentdepositorderMapper.selectAgentdepositorderList(tAgentdepositorder); } /** * 总计 * @param tAgentdepositorder * @return */ @Override public BigDecimal calcAgentdepositAmount(Agentdepositorder tAgentdepositorder) { SysUser sysUser = ShiroUtils.getSysUser(); tAgentdepositorder.setSupplierbranchid(sysUser.getSupplierbranchid()); if (!sysUser.isAdmin()){ tAgentdepositorder.setAgentId(Long.parseLong(sysUser.getAgentId())); } return tAgentdepositorderMapper.calcAgentdepositAmount(tAgentdepositorder); } /** * 新增代理银行卡充值订单 * * @param tAgentdepositorder 代理银行卡充值订单 * @return 结果 */ @Override public int insertAgentdepositorder(Agentdepositorder tAgentdepositorder) { SysUser sysUser = ShiroUtils.getSysUser(); tAgentdepositorder.setSupplierbranchid(sysUser.getSupplierbranchid()); Long nextId = SnowflakeIdWorker.getNextId(); tAgentdepositorder.setOrderid(nextId+""); tAgentdepositorder.setOrderindex(nextId); tAgentdepositorder.setAgentId(Long.parseLong(ShiroUtils.getAgentId())); return tAgentdepositorderMapper.insertAgentdepositorder(tAgentdepositorder); } /** * 修改代理银行卡充值订单 * * @param tAgentdepositorder 代理银行卡充值订单 * @return 结果 */ @Override public int updateAgentdepositorder(Agentdepositorder tAgentdepositorder) { return tAgentdepositorderMapper.updateAgentdepositorder(tAgentdepositorder); } /** * 删除代理银行卡充值订单对象 * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deleteAgentdepositorderByIds(String ids) { return tAgentdepositorderMapper.deleteAgentdepositorderByIds(Convert.toStrArray(ids)); } /** * 删除代理银行卡充值订单信息 * * @param orderindex 代理银行卡充值订单ID * @return 结果 */ @Override public int deleteAgentdepositorderById(Long orderindex) { return tAgentdepositorderMapper.deleteAgentdepositorderById(orderindex); } }
[ "jslark@it888.com" ]
jslark@it888.com
83772d90d5c5b1a0549fd360fe1c7c5b9c8c942f
4cb485b2d1d86cbe7806141637e60ceb0dc33e97
/src/main/java/relation/advanced/JpaMainAdvancedMapping.java
25f51398e11d964023959dce7009675ffdf2e3db
[]
no_license
sungwony0906/JPA-basic-1
c8025605dc9257dc3c7e26fea8fc72c769b15b27
f2d7add5911a3b6fc9930c43fd9329510c298f40
refs/heads/master
2023-06-24T00:57:06.132469
2021-07-23T07:15:01
2021-07-23T07:15:01
381,952,803
0
0
null
null
null
null
UTF-8
Java
false
false
1,210
java
package relation.advanced; import java.time.LocalDateTime; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import relation.manyToMany1.Member; import relation.manyToMany1.Product; public class JpaMainAdvancedMapping { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("hello"); EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begin(); try { Movie movie = new Movie(); movie.setDirector("AAAA"); movie.setActor("BBBB"); movie.setName("바람과함께사라지다"); movie.setPrice(10000); movie.setCreatedBy("sungwony"); movie.setCreatedDatetime(LocalDateTime.now()); em.persist(movie); em.flush(); em.clear(); Movie findMovie = em.find(Movie.class, movie.getId()); // TABLE_PER_CLASS 전략인 경우에 모든 테이블을 UNION 해서 조회하는 단점이 있다 Item item = em.find(Item.class, movie.getId()); tx.commit(); } catch (Exception e){ tx.rollback(); } finally { em.close(); } emf.close(); } }
[ "sungwony0906@gmail.com" ]
sungwony0906@gmail.com
b6bc8c162e46a246c78339a8ae26440c41d87fc1
b4a8ab8fe20c9f227b40080d65af300da7c9bf71
/WearHome/src/com/androidwear/home/watchfaces/ustwowatchfaces2/watchfacecoordinates/CoordinatesSquareClockView.java
704348d8293d5d1ac66fdeee6bf50e74e13016f0
[]
no_license
huanghua119/MyApplication
ca0d8ba12c53d070dffe04a7231d04a15cee5900
f2d1b73f34b4ae32d89c7a3ec001c8a1d11b7e29
refs/heads/master
2021-01-23T08:15:07.648462
2015-04-03T09:38:24
2015-04-03T09:38:24
15,796,752
0
1
null
null
null
null
UTF-8
Java
false
false
12,676
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: packimports(3) package com.androidwear.home.watchfaces.ustwowatchfaces2.watchfacecoordinates; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; import android.util.AttributeSet; import com.androidwear.home.R; import com.androidwear.home.watchfaces.ustwowatchfaces2.shared.WatchFaceView; import com.androidwear.home.watchfaces.ustwowatchfaces2.shared.helpers.DisplayHelper; import com.androidwear.home.watchfaces.ustwowatchfaces2.shared.helpers.WatchCurrentTime; import com.androidwear.home.watchfaces.ustwowatchfaces2.shared.paint.WatchFaceFillPaint; import com.androidwear.home.watchfaces.ustwowatchfaces2.shared.paint.WatchFaceStrokePaint; import com.androidwear.home.watchfaces.ustwowatchfaces2.shared.paint.WatchFaceTextPaint; public class CoordinatesSquareClockView extends WatchFaceView { public CoordinatesSquareClockView(Context context) { this(context, null); } public CoordinatesSquareClockView(Context context, AttributeSet attributeset) { this(context, attributeset, 0); } public CoordinatesSquareClockView(Context context, AttributeSet attributeset, int i) { super(context, attributeset, i); mCurrentTime = WatchCurrentTime.getCurrent(); mFaceColorAmbient = 0xff000000; mFaceColorInteractive = -1; mBorderColorAmbient = Color.argb(255, 75, 75, 75); mBorderColorInteractive = Color.argb(255, 236, 236, 236); mDotColorAmbient = Color.argb(255, 75, 75, 75); mDotColorInteractive = Color.argb(255, 188, 188, 188); mAxesTextColorAmbient = Color.argb(255, 75, 75, 75); mAxesTextColorInteractive = Color.argb(255, 189, 189, 189); mCrosshairColorAmbient = -1; mCrosshairColorInteractive = Color.argb(255, 255, 0, 71); mTargetColorAmbient = -1; mTargetColorInteractive = Color.argb(255, 255, 0, 71); mFacePaint = new WatchFaceFillPaint(); mBorderPaint = new WatchFaceStrokePaint(); mDotPaint = new WatchFaceFillPaint(); mCrosshairPaint = new WatchFaceStrokePaint(); mTargetPaint = new WatchFaceStrokePaint(); mAxesTextPaint = new WatchFaceTextPaint("sans-serif", 0, android.graphics.Paint.Align.CENTER); mBorderRect = new RectF(); mAxesTextBounds = new Rect(); mBackgroundBitmapCanvas = new Canvas(); mLeftCrosshairStartPoint = new PointF(); mLeftCrosshairEndPoint = new PointF(); mTopCrosshairStartPoint = new PointF(); mTopCrosshairEndPoint = new PointF(); mRightCrosshairStartPoint = new PointF(); mRightCrosshairEndPoint = new PointF(); mBottomCrosshairStartPoint = new PointF(); mBottomCrosshairEndPoint = new PointF(); mTargetCenterPoint = new PointF(); init(); } private void generateBackgroundBitmap(WatchCurrentTime watchcurrenttime) { DisplayHelper.clearCanvas(mBackgroundBitmapCanvas); mBackgroundBitmapCanvas.drawRect(getFaceRect(), mFacePaint); mBackgroundBitmapCanvas.drawRect(mBorderRect, mBorderPaint); float f = getFaceRadius() - mBorderRadius; float f1 = (2.0F * mBorderRadius) / 14F; for (int i = 1; (float) i < 14F; i++) { for (int l = 1; (float) l < 14F; l++) { float f7 = f + f1 * (float) i; float f8 = f + f1 * (float) l; mBackgroundBitmapCanvas.drawCircle(f7, f8, mDotRadius, mDotPaint); } } float f2 = (getFaceRadius() - mBorderRadius) / 2.0F; for (int j = 1; (float) j < 14F; j++) if ((j - 1) % 2 == 0) { String s1 = Integer.toString(5 * (j - 1)); float f6 = f + f1 * (float) j; mAxesTextPaint .setTextAlign(android.graphics.Paint.Align.CENTER); mAxesTextPaint.getTextBounds(s1, 0, s1.length(), mAxesTextBounds); mBackgroundBitmapCanvas.drawText(s1, f6, f2 + (float) (mAxesTextBounds.height() / 2), mAxesTextPaint); } float f3 = (getFaceRadius() - mBorderRadius) / 2.0F; mAxesTextPaint.getTextBounds("12", 0, 2, mAxesTextBounds); float f4 = mAxesTextBounds.width(); for (int k = 1; (float) k < 14F; k++) if ((k - 1) % 2 == 0) { String s = Integer.toString(k - 1); float f5 = (getFaceRadius() + mBorderRadius) - f1 * (float) k; mAxesTextPaint.setTextAlign(android.graphics.Paint.Align.RIGHT); mAxesTextPaint.getTextBounds(s, 0, s.length(), mAxesTextBounds); mBackgroundBitmapCanvas.drawText(s, (f3 + f4 / 2.0F) - 1.0F, f5 + (float) (mAxesTextBounds.height() / 2), mAxesTextPaint); } } private void init() { mBorderPaint.setStrokeWidth(mBorderStrokeWidth); mCrosshairPaint.setStrokeWidth(mCrosshairStrokeWidth); mTargetPaint.setStrokeWidth(mTargetStrokeWidth); mAxesTextPaint.setTextSize(mAxesTextSize); mBorderRect.set(getFaceRadius() - mBorderRadius, getFaceRadius() - mBorderRadius, getFaceRadius() + mBorderRadius, getFaceRadius() + mBorderRadius); if (getFaceWidth() > 0.0F) { mBackgroundBitmap = Bitmap.createBitmap((int) getFaceWidth(), (int) getFaceHeight(), android.graphics.Bitmap.Config.ARGB_8888); mBackgroundBitmapCanvas.setBitmap(mBackgroundBitmap); } } private void setColors(WatchCurrentTime watchcurrenttime) { if (isAmbient()) { mFacePaint.setColor(mFaceColorAmbient); mBorderPaint.setColor(mBorderColorAmbient); mDotPaint.setColor(mDotColorAmbient); mAxesTextPaint.setColor(mAxesTextColorAmbient); mCrosshairPaint.setColor(mCrosshairColorAmbient); mTargetPaint.setColor(mTargetColorAmbient); return; } else { mFacePaint.setColor(mFaceColorInteractive); mBorderPaint.setColor(mBorderColorInteractive); mDotPaint.setColor(mDotColorInteractive); mAxesTextPaint.setColor(mAxesTextColorInteractive); mCrosshairPaint.setColor(mCrosshairColorInteractive); mTargetPaint.setColor(mTargetColorInteractive); return; } } private void updateCrosshairs(WatchCurrentTime watchcurrenttime) { float f = 2.0F * mBorderRadius; float f1 = f / 14F; float f2 = watchcurrenttime.get12Hour() + watchcurrenttime.getMinute() / 60F; float f3 = watchcurrenttime.getMinute() + watchcurrenttime.getSecond() / 60F; float f4 = (getFaceRadius() + mBorderRadius) - f1 - (f2 / 12F) * (f - 2.0F * f1); float f5 = f1 + (getFaceRadius() - mBorderRadius) + (f3 / 60F) * (f - 2.0F * f1); mTargetCenterPoint.set(f5, f4); float f6 = (getFaceRadius() - mBorderRadius) + mBorderStrokeWidth / 2.0F; float f7 = f4 - mTargetRadius; mTopCrosshairStartPoint.set(f5, f6); mTopCrosshairEndPoint.set(f5, f7); float f8 = f4 + mTargetRadius; float f9 = (getFaceRadius() + mBorderRadius) - mBorderStrokeWidth / 2.0F; mBottomCrosshairStartPoint.set(f5, f8); mBottomCrosshairEndPoint.set(f5, f9); float f10 = (getFaceRadius() - mBorderRadius) + mBorderStrokeWidth / 2.0F; float f11 = f5 - mTargetRadius; mLeftCrosshairStartPoint.set(f10, f4); mLeftCrosshairEndPoint.set(f11, f4); float f12 = f5 + mTargetRadius; float f13 = (getFaceRadius() + mBorderRadius) - mBorderStrokeWidth / 2.0F; mRightCrosshairStartPoint.set(f12, f4); mRightCrosshairEndPoint.set(f13, f4); } protected boolean isContinuous() { return false; } protected void onAmbientModeChanged(WatchCurrentTime watchcurrenttime) { setColors(watchcurrenttime); generateBackgroundBitmap(watchcurrenttime); } protected void onDraw(Canvas canvas) { WatchCurrentTime.getCurrent(mCurrentTime); canvas.drawBitmap(mBackgroundBitmap, 0.0F, 0.0F, null); canvas.drawLine(mLeftCrosshairStartPoint.x, mLeftCrosshairStartPoint.y, mLeftCrosshairEndPoint.x, mLeftCrosshairEndPoint.y, mCrosshairPaint); canvas.drawLine(mTopCrosshairStartPoint.x, mTopCrosshairStartPoint.y, mTopCrosshairEndPoint.x, mTopCrosshairEndPoint.y, mCrosshairPaint); canvas.drawLine(mRightCrosshairStartPoint.x, mRightCrosshairStartPoint.y, mRightCrosshairEndPoint.x, mRightCrosshairEndPoint.y, mCrosshairPaint); canvas.drawLine(mBottomCrosshairStartPoint.x, mBottomCrosshairStartPoint.y, mBottomCrosshairEndPoint.x, mBottomCrosshairEndPoint.y, mCrosshairPaint); canvas.drawCircle(mTargetCenterPoint.x, mTargetCenterPoint.y, mTargetRadius, mTargetPaint); super.onDraw(canvas); } protected void onInitializeTime(WatchCurrentTime watchcurrenttime) { setColors(watchcurrenttime); generateBackgroundBitmap(watchcurrenttime); } protected void onSizeChanged(int i, int j, int k, int l) { super.onSizeChanged(i, j, k, l); mBorderRadius = DisplayHelper.getPixels(this, R.dimen.coordinates_square_border_radius); mBorderStrokeWidth = DisplayHelper.getPixels(this, R.dimen.coordinates_square_border_stroke_width); mCrosshairStrokeWidth = DisplayHelper.getPixels(this, R.dimen.coordinates_square_crosshair_stroke_width); mTargetStrokeWidth = DisplayHelper.getPixels(this, R.dimen.coordinates_square_target_stroke_width); mTargetRadius = DisplayHelper.getPixels(this, R.dimen.coordinates_square_target_radius); mDotRadius = DisplayHelper.getPixels(this, R.dimen.coordinates_square_dot_diameter) / 2.0F; mAxesTextSize = DisplayHelper.getPixels(this, R.dimen.coordinates_square_axes_text_size); init(); } protected void onUpdateHour(WatchCurrentTime watchcurrenttime) { updateCrosshairs(watchcurrenttime); } protected void onUpdateMinute(WatchCurrentTime watchcurrenttime) { updateCrosshairs(watchcurrenttime); } protected void onUpdateMinuteContinuous(WatchCurrentTime watchcurrenttime) { updateCrosshairs(watchcurrenttime); } private Rect mAxesTextBounds; private int mAxesTextColorAmbient; private int mAxesTextColorInteractive; private Paint mAxesTextPaint; private float mAxesTextSize; private Bitmap mBackgroundBitmap; private Canvas mBackgroundBitmapCanvas; private int mBorderColorAmbient; private int mBorderColorInteractive; private Paint mBorderPaint; private float mBorderRadius; private RectF mBorderRect; private float mBorderStrokeWidth; private PointF mBottomCrosshairEndPoint; private PointF mBottomCrosshairStartPoint; private int mCrosshairColorAmbient; private int mCrosshairColorInteractive; private Paint mCrosshairPaint; private float mCrosshairStrokeWidth; private WatchCurrentTime mCurrentTime; private int mDotColorAmbient; private int mDotColorInteractive; private Paint mDotPaint; private float mDotRadius; private int mFaceColorAmbient; private int mFaceColorInteractive; private Paint mFacePaint; private PointF mLeftCrosshairEndPoint; private PointF mLeftCrosshairStartPoint; private PointF mRightCrosshairEndPoint; private PointF mRightCrosshairStartPoint; private PointF mTargetCenterPoint; private int mTargetColorAmbient; private int mTargetColorInteractive; private Paint mTargetPaint; private float mTargetRadius; private float mTargetStrokeWidth; private PointF mTopCrosshairEndPoint; private PointF mTopCrosshairStartPoint; }
[ "hhuang@mobvoi.com" ]
hhuang@mobvoi.com
ed3fec3a398631aa1c1e17c5cc2673400faa0725
27d196af04f147a054a1376eb259cbcb91ee1172
/app/src/main/java/com/nagajothy/smazee/praestantia/About_praestantia_fragment.java
37aac94f59bd1fcff6516439e2b795b8aa2a8f68
[]
no_license
santynaren/Praestantia
f391a912444f4673ba87f4c9b8fbb82c794b7ef5
3fc94294e29eea0dbfeed78b1478a5614de7c01a
refs/heads/master
2021-04-30T18:25:27.814220
2017-01-29T17:26:15
2017-01-29T17:26:15
67,517,386
0
0
null
null
null
null
UTF-8
Java
false
false
738
java
package com.nagajothy.smazee.praestantia; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. */ public class About_praestantia_fragment extends Fragment { public About_praestantia_fragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_about_praestantia_fragment, container, false); } }
[ "santhoshnarendra@gmail.com" ]
santhoshnarendra@gmail.com
97daf4bbd58c7e34751f2e3c0a2653f31353ccb5
bff7e65afd9dec97e3a6c2733e3ed5b9033e88d2
/src/jrds/agent/windows/pdh/PdhAgentUniqueInstance.java
32f11149b0af3f42d6c0c112f6f6041ed2225b16
[]
no_license
Bhody/jrdsagent
826c6d77f3f82ebf03da6c4109b61af542b8e615
4d208382866eaac43ea7f022a853ecf13985f15e
refs/heads/master
2021-01-12T22:29:23.999983
2016-04-21T12:33:54
2016-04-21T12:33:54
49,433,379
0
0
null
2016-01-11T14:59:34
2016-01-11T14:59:33
null
UTF-8
Java
false
false
1,494
java
package jrds.agent.windows.pdh; import java.util.ArrayList; import org.apache.log4j.Logger; import com.arkanosis.jpdh.JPDHException; public class PdhAgentUniqueInstance extends PdhAgent { private static final Logger logger = Logger.getLogger("jrds.agent.windows.pdh.PdhAgentUniqueInstance"); // Coming from configuration protected String object; protected String instance; public Boolean configure(String name, String instance, ArrayList<String> counters) { this.instance = instance; if (!super.configure(name)) { return false; } try { addCounterList(this.object, this.instance, counters); } catch (IllegalArgumentException | JPDHException e) { logger.error("Could not initialize all counters for probe " + this.name, e); try { this.query.close(); } catch (JPDHException e1) { logger.error("Could not close query of " + this.name + " probe after a bad add counter", e); } this.query = null; return false; } return true; } @Override public void setProperty(String specific, String value) { if (specific.equals("object")) { object = value; } else { super.setProperty(specific, value); } } }
[ "p.delperugia@gmail.com" ]
p.delperugia@gmail.com
770a6ed22149b6e736f93f5cfd7449d1ea291b34
64b8b03f663ef515eff1e5ed97e3a06c628739ef
/src/main/java/com/shopping/no_mad_gear/product_discription_shortner.java
bf73a1fa81f3decdfe2dd469c38704a196fafc94
[]
no_license
hritvik1/E-Commerce_Web_Portal
df87a59c264e50b81cf372365b6b72ce80965d2e
7e4d375e8c3b5759930c58cd215d27cee8744b73
refs/heads/master
2023-05-25T11:28:24.727566
2023-05-10T18:39:48
2023-05-10T18:39:48
329,271,885
0
0
null
null
null
null
UTF-8
Java
false
false
427
java
package com.shopping.no_mad_gear; public class product_discription_shortner { public static String get10Words(String desc) { String[] strs = desc.split(" "); if(strs.length>10) { String res = ""; for(int i=0;i<10;i++) { res = res+strs[i]+" "; } return (res+"...."); } else { return desc; } } }
[ "hritvikmaini00@gmail.com" ]
hritvikmaini00@gmail.com
900cacccaa165b5191d16fd98cce4c377f902107
e75d5fde3105912fbfb60d69e9e1f7e777a39352
/app/src/main/java/com/example/android/redditreader/submission/SubmissionRequest.java
c44900a7d1f33f30f83f2a03e11db3733863c48f
[]
no_license
jcshman/RedditReader
38eb4d7fbf361511acb63628d604b450957ecd97
08f8a960c31c51977f59f10a20916848be3dafbc
refs/heads/master
2021-05-10T12:35:26.654539
2018-01-22T11:30:49
2018-01-22T11:30:49
118,201,170
0
0
null
null
null
null
UTF-8
Java
false
false
1,721
java
package com.example.android.redditreader.submission; import android.util.Log; import com.example.android.redditreader.RequestTask; import com.github.jreddit.parser.entity.Submission; import com.github.jreddit.parser.entity.imaginary.FullSubmission; import com.github.jreddit.parser.exception.RedditParseException; import com.github.jreddit.parser.single.FullSubmissionParser; import com.github.jreddit.request.retrieval.mixed.FullSubmissionRequest; /** * Submission request */ public class SubmissionRequest extends RequestTask { /* Submission */ private Submission submission; /* Full submission */ private FullSubmission fullSubmission; /** * Creates a new SubmissionRequest * * @param submission submission */ public SubmissionRequest(Submission submission) { this.submission = submission; } /** * Requests full submission and parses */ @Override protected Void doInBackground(Void... v) { super.doInBackground(v); try { FullSubmissionParser parser = new FullSubmissionParser(); FullSubmissionRequest request = new FullSubmissionRequest(submission).setDepth(1); fullSubmission = parser.parse(getClient().get(getToken(), request)); } catch(RedditParseException e) { Log.w(getClass().getName(), "Problem parsing full submission for " + submission.getTitle()); } return null; } /** * Returns the full submission * * @return submission */ public FullSubmission getSubmission() { return fullSubmission; } }
[ "jcshman@earthlink.net" ]
jcshman@earthlink.net
9cf5f4555c90cdf8c0dca1023c7843591f8d9e74
670560c80d3083b249f2cbfd13b5fcf7fece41c7
/src/main/java/com/ruby/sun/web/rest/UserJWTController.java
4309b63a676805c39ba14bb59a792ad28beb6063
[]
no_license
BulkSecurityGeneratorProject/udemy
531b6d25de6dd68fc04b2785bb26ba645ee6cd41
e82acf186d44bad1ee4362eb274c06a7f67f45bc
refs/heads/master
2022-12-16T00:04:45.330399
2018-12-17T20:10:11
2018-12-17T20:10:11
296,663,905
0
0
null
2020-09-18T15:45:00
2020-09-18T15:44:59
null
UTF-8
Java
false
false
2,506
java
package com.ruby.sun.web.rest; import com.ruby.sun.security.jwt.JWTFilter; import com.ruby.sun.security.jwt.TokenProvider; import com.ruby.sun.web.rest.vm.LoginVM; import com.codahale.metrics.annotation.Timed; import com.fasterxml.jackson.annotation.JsonProperty; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; /** * Controller to authenticate users. */ @RestController @RequestMapping("/api") public class UserJWTController { private final TokenProvider tokenProvider; private final AuthenticationManager authenticationManager; public UserJWTController(TokenProvider tokenProvider, AuthenticationManager authenticationManager) { this.tokenProvider = tokenProvider; this.authenticationManager = authenticationManager; } @PostMapping("/authenticate") @Timed public ResponseEntity<JWTToken> authorize(@Valid @RequestBody LoginVM loginVM) { UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginVM.getUsername(), loginVM.getPassword()); Authentication authentication = this.authenticationManager.authenticate(authenticationToken); SecurityContextHolder.getContext().setAuthentication(authentication); boolean rememberMe = (loginVM.isRememberMe() == null) ? false : loginVM.isRememberMe(); String jwt = tokenProvider.createToken(authentication, rememberMe); HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.add(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt); return new ResponseEntity<>(new JWTToken(jwt), httpHeaders, HttpStatus.OK); } /** * Object to return as body in JWT Authentication. */ static class JWTToken { private String idToken; JWTToken(String idToken) { this.idToken = idToken; } @JsonProperty("id_token") String getIdToken() { return idToken; } void setIdToken(String idToken) { this.idToken = idToken; } } }
[ "ruby.sun@cgi.com" ]
ruby.sun@cgi.com
841c7acaedd08d8d9b85daaf76431f63d637eeda
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/63/328.java
95641c5632ba3ce39820d82c264ffa67df050186
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,188
java
package <missing>; public class GlobalMembers { public static int Main() { int x1; int x2; int y1; int y2; int i; int j; int p; int q; int[][] a = new int[100][100]; int[][] b = new int[100][100]; int[][] c = new int[100][100]; x1 = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); y1 = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); for (i = 0;i < x1;i++) { for (p = 0;p < y1;p++) { a[i][p] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); } } x2 = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); y2 = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); for (q = 0;q < x2;q++) { for (j = 0;j < y2;j++) { b[q][j] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); } } for (i = 0;i < x1;i++) { for (j = 0;j < y2;j++) { for (p = 0;p < y1;p++) { c[i][j] += a[i][p] * b[p][j]; } } } for (i = 0;i < x1;i++) { System.out.print(c[i][0]); for (j = 1;j < y2;j++) { System.out.print(" "); System.out.print(c[i][j]); } System.out.print("\n"); } return 0; //????? } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
5c02178ea37fcabe2455ea78689ada80b120db91
ca0708310151e4b634166fe180a607a0179f582f
/SimpleCalcv01/app/src/main/java/com/example/palmdigital/simplecalcv01/MainActivity.java
ab7a0ea608ffcda6761c8ea1f803b0312613d58b
[]
no_license
91084993/AndroidStudioProjects
a464049cc70f585dfe93fcd520a5d6f0676f1266
9e8fbd978521465419cbb145dbc32fd1ff06791a
refs/heads/master
2020-03-08T04:58:24.416574
2018-06-05T16:48:17
2018-06-05T16:48:17
127,935,779
0
0
null
null
null
null
UTF-8
Java
false
false
2,873
java
package com.example.palmdigital.simplecalcv01; import android.media.Image; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity implements View.OnClickListener{ // member variables (class wide variables) TextView textViewNum1Display; TextView textViewNum2Display; TextView textViewOutput; int num1; int num2; int sum; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //create a reference to the XML UI TextVIew textViewNum1Display = findViewById(R.id.tvNum1Display); textViewNum2Display = findViewById(R.id.tvNum2Display); textViewOutput = findViewById(R.id.tv_output); //create a reference to the ImageViewXML UI elements ImageView imageView1 = findViewById(R.id.imageView_1); ImageView imageView2 = findViewById(R.id.imageView_2); ImageView imageView3 = findViewById(R.id.imageView_3); ImageView imageView4 = findViewById(R.id.imageView_4); ImageView imageView5 = findViewById(R.id.imageView_5); ImageView imageView6 = findViewById(R.id.imageView_6); ImageView imageView_equal=findViewById(R.id.imageView_equal); //setting imageview objects to be clickable imageView1.setOnClickListener(this); imageView2.setOnClickListener(this); imageView3.setOnClickListener(this); imageView4.setOnClickListener(this); imageView5.setOnClickListener(this); imageView6.setOnClickListener(this); imageView_equal.setOnClickListener(this); } // end of onCreate( ) public void onClick(View view) { if(view.getId() == R.id.imageView_1) { textViewNum1Display.setText("1"); num1 = 1; } else if (view.getId() == R.id.imageView_2) { textViewNum1Display.setText("2"); num1 = 2; } else if (view.getId() == R.id.imageView_3) { textViewNum1Display.setText("3"); num1 = 3; } else if (view.getId() == R.id.imageView_4) { textViewNum2Display.setText("4"); num2 = 4; } else if (view.getId() == R.id.imageView_5) { textViewNum2Display.setText("5"); num2 = 5; } else if(view.getId() == R.id.imageView_6) { textViewNum2Display.setText("6"); num2 = 6; } else if(view.getId() == R.id.imageView_equal) { sum = num1 + num2; textViewOutput.setText("" + sum); } } }
[ "31664271+91084993@users.noreply.github.com" ]
31664271+91084993@users.noreply.github.com
1bdf9373e133abaa026a38d3aeff99a0c4460f94
7ad843a5b11df711f58fdb8d44ed50ae134deca3
/JDK/JDK1.8/src/com/sun/corba/se/spi/transport/IORToSocketInfo.java
a299c5e240db7dab4d08eafa974ff180f2b3898e
[ "MIT" ]
permissive
JavaScalaDeveloper/java-source
f014526ad7750ad76b46ff475869db6a12baeb4e
0e6be345eaf46cfb5c64870207b4afb1073c6cd0
refs/heads/main
2023-07-01T22:32:58.116092
2021-07-26T06:42:32
2021-07-26T06:42:32
362,427,367
0
0
null
null
null
null
UTF-8
Java
false
false
512
java
/* * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.sun.corba.se.spi.transport; import java.util.List; import com.sun.corba.se.spi.ior.IOR; public interface IORToSocketInfo { /** * Used to extract socket address information from an IOR. * * @param ior. * * @return List - a list of SocketInfo. * */ public List getSocketInfo(IOR ior); } // End of file.
[ "panzha@dian.so" ]
panzha@dian.so
f4350f58f044e1f62b7a29d4c6eeb8866b5c7f7a
6ed984cc1f41ed864dcbd941deea84ef038f6a62
/core/src/test/java/com/crawljax/core/plugin/PluginsWithCrawlerTest.java
43e2473e5d1fcdf9250b580a445dc13317fbfcbd
[ "Apache-2.0" ]
permissive
wwr1227/crawljax
53df8dc3e05784a49601e932d6326d79e34df148
8b1c6f0ba686671c1ced0a93abbfcaefd6c6e324
refs/heads/master
2021-01-16T01:07:24.536295
2013-07-09T17:43:23
2013-07-09T17:43:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,557
java
package com.crawljax.core.plugin; import static org.hamcrest.core.Is.is; import static org.hamcrest.object.IsCompatibleType.typeCompatibleWith; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.List; import org.apache.html.dom.HTMLAnchorElementImpl; import org.eclipse.jetty.util.BlockingArrayQueue; import org.hamcrest.core.IsCollectionContaining; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.ErrorCollector; import com.crawljax.browser.EmbeddedBrowser; import com.crawljax.condition.NotRegexCondition; import com.crawljax.condition.invariant.Invariant; import com.crawljax.core.CandidateElement; import com.crawljax.core.CrawlSession; import com.crawljax.core.CrawlerContext; import com.crawljax.core.CrawljaxRunner; import com.crawljax.core.ExitNotifier.ExitStatus; import com.crawljax.core.configuration.CrawljaxConfiguration; import com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder; import com.crawljax.core.state.Eventable; import com.crawljax.core.state.StateVertex; import com.crawljax.test.BrowserTest; import com.crawljax.test.RunWithWebServer; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; /** * Test cases to test the running and correct functioning of the plugins. Used to address issue #26 */ @Category(BrowserTest.class) public class PluginsWithCrawlerTest { private static CrawljaxRunner controller; private static CrawljaxConfiguration config; private static String listAsString; private static List<Class<? extends Plugin>> plugins = new BlockingArrayQueue<>(); @ClassRule public static final RunWithWebServer SERVER = new RunWithWebServer("/site/crawler"); @ClassRule public static final ErrorCollector ERRORS = new ErrorCollector(); private static CrawlSession session; @BeforeClass public static void setup() { CrawljaxConfigurationBuilder builder = SERVER.newConfigBuilder(); builder.crawlRules().clickDefaultElements(); /** * Add a sample Invariant for testing the OnInvariantViolation plugin */ builder.crawlRules().addInvariant("Never contain Final state S8", new NotRegexCondition("Final state S2")); builder.addPlugin(new PreCrawlingPlugin() { @Override public void preCrawling(CrawljaxConfiguration config) { plugins.add(PreCrawlingPlugin.class); } }); builder.addPlugin(new OnNewStatePlugin() { @Override public void onNewState(CrawlerContext context, StateVertex state) { plugins.add(OnNewStatePlugin.class); if (!state.getName().equals("index")) { assertTrue("currentState and indexState are never the same", !state.equals(context.getSession().getInitialState())); } } }); builder.addPlugin(new DomChangeNotifierPlugin() { @Override public boolean isDomChanged(CrawlerContext context, String domBefore, Eventable e, String domAfter) { plugins.add(DomChangeNotifierPlugin.class); return !domAfter.equals(domBefore); } }); builder.addPlugin(new OnBrowserCreatedPlugin() { @Override public void onBrowserCreated(EmbeddedBrowser newBrowser) { plugins.add(OnBrowserCreatedPlugin.class); assertNotNull(newBrowser); } }); builder.addPlugin(new OnInvariantViolationPlugin() { @Override public void onInvariantViolation(Invariant invariant, CrawlerContext context) { plugins.add(OnInvariantViolationPlugin.class); assertNotNull(invariant); } }); builder.addPlugin(new OnUrlLoadPlugin() { @Override public void onUrlLoad(CrawlerContext browser) { plugins.add(OnUrlLoadPlugin.class); assertNotNull(browser); } }); builder.addPlugin(new PostCrawlingPlugin() { @Override public void postCrawling(CrawlSession session, ExitStatus status) { plugins.add(PostCrawlingPlugin.class); } }); builder.addPlugin(new PreStateCrawlingPlugin() { @Override public void preStateCrawling(CrawlerContext session, ImmutableList<CandidateElement> candidateElements, StateVertex state) { plugins.add(PreStateCrawlingPlugin.class); try { assertNotNull(candidateElements); } catch (AssertionError e) { ERRORS.addError(e); } if (state.getName().equals("state8")) { /** * Add to miss invocation for the OnFireEventFaild plugin. */ // This is a bit ugly; but hey it works, and is checked above.. CandidateElement candidate = candidateElements.get(0); HTMLAnchorElementImpl impl = (HTMLAnchorElementImpl) candidate.getElement(); impl.setName("fail"); impl.setId("eventually"); impl.setHref("will"); impl.setTextContent("This"); candidate.getIdentification().setValue("/HTML[1]/BODY[1]/FAILED[1]/A[1]"); } } }); builder.addPlugin(new OnRevisitStatePlugin() { @Override public void onRevisitState(CrawlerContext session, StateVertex currentState) { plugins.add(OnRevisitStatePlugin.class); assertNotNull(currentState); } }); config = builder.build(); controller = new CrawljaxRunner(config); session = controller.call(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < plugins.size(); i++) { Class<? extends Plugin> plugin = plugins.get(i); sb.append('\n').append(i).append(' ').append(plugin.getSimpleName()); } listAsString = sb.toString(); } @Test public void whenCrawlStartsInitialPluginsAreRun() { assertThat(plugins.get(0), typeCompatibleWith(PreCrawlingPlugin.class)); assertThat(plugins.get(1), typeCompatibleWith(OnBrowserCreatedPlugin.class)); assertThat(plugins.get(2), typeCompatibleWith(OnUrlLoadPlugin.class)); } @Test public void whenCrawlFinishesTheLastPluginIsTheOverviewPlugin() { assertThat(plugins.get(plugins.size() - 1), typeCompatibleWith(PostCrawlingPlugin.class)); } @Test public void verifyOnUrlLoadFollowers() { afterFirstPluginsIsFollowedBy(OnUrlLoadPlugin.class, ImmutableSet.of( OnInvariantViolationPlugin.class, OnNewStatePlugin.class, DomChangeNotifierPlugin.class, OnRevisitStatePlugin.class, PostCrawlingPlugin.class)); } private void afterFirstPluginsIsFollowedBy(Class<OnUrlLoadPlugin> suspect, Iterable<Class<? extends Plugin>> followedBy) { List<Integer> indexes = indexesOf(suspect); if (indexes.size() > 0) { indexes.remove(0); } for (int index : indexes) { Class<? extends Plugin> follower = plugins.get(index + 1); assertThat(suspect + " @index=" + index + " was followed by " + follower + listAsString, followedBy, IsCollectionContaining.hasItem(follower)); } } public void pluginsIsFollowedBy(Class<? extends Plugin> suspect, Iterable<Class<? extends Plugin>> followedBy) { for (int index : indexesOf(suspect)) { Class<? extends Plugin> follower = plugins.get(index + 1); assertThat(suspect + " @index=" + index + " was followed by " + follower + listAsString, followedBy, IsCollectionContaining.hasItem(follower)); } } private List<Integer> indexesOf(Class<? extends Plugin> clasz) { List<Integer> indexes = new ArrayList<>(); for (int i = 0; i < plugins.size(); i++) { if (plugins.get(i).isAssignableFrom(clasz)) { indexes.add(i); } } return indexes; } @Test public void verifyOnNewStateFollowers() { pluginsIsFollowedBy(OnNewStatePlugin.class, ImmutableSet.of(PreStateCrawlingPlugin.class, OnUrlLoadPlugin.class, PostCrawlingPlugin.class)); } @Test public void verifyPreStateCrawlingFollowers() { pluginsIsFollowedBy(PreStateCrawlingPlugin.class, ImmutableSet.of(DomChangeNotifierPlugin.class, OnFireEventFailedPlugin.class, OnInvariantViolationPlugin.class, OnNewStatePlugin.class, OnUrlLoadPlugin.class)); } @Test public void onRevisitStatesFollowers() { pluginsIsFollowedBy(OnRevisitStatePlugin.class, ImmutableSet.of( OnFireEventFailedPlugin.class, DomChangeNotifierPlugin.class, OnInvariantViolationPlugin.class, OnNewStatePlugin.class)); } @Test public void verifyOnDomChangedFollowers() { pluginsIsFollowedBy(DomChangeNotifierPlugin.class, ImmutableSet.of( OnFireEventFailedPlugin.class, DomChangeNotifierPlugin.class, OnInvariantViolationPlugin.class, OnNewStatePlugin.class, PostCrawlingPlugin.class)); } @Test public void startAndEndPluginsAreOnlyRunOnce() { // assertThat(orrurencesOf(ProxyServerPlugin.class), is(1)); assertThat(orrurencesOf(PreCrawlingPlugin.class), is(1)); assertThat(orrurencesOf(PostCrawlingPlugin.class), is(1)); } @Test public void domStatesChangesAreEqualToNumberOfStatesAfterIndex() { int numberOfStates = session.getStateFlowGraph().getAllStates().size(); int newStatesAfterIndexPage = numberOfStates - 1; assertThat(orrurencesOf(DomChangeNotifierPlugin.class), is(newStatesAfterIndexPage)); } @Test public void newStatePluginCallsAreEqualToNumberOfStates() { int numberOfStates = session.getStateFlowGraph().getAllStates().size(); assertThat(orrurencesOf(OnNewStatePlugin.class), is(numberOfStates)); } private int orrurencesOf(Class<? extends Plugin> clasz) { int count = 0; for (Class<? extends Plugin> plugin : plugins) { if (plugin.isAssignableFrom(clasz)) { count++; } } return count; } }
[ "alex@nederlof.com" ]
alex@nederlof.com
e18977f2a594ecc7ed5de63090b4549ef1735415
c945e7ff522391499f8fd4aef49a0a3e7c1d62dc
/src/main/java/org/laukvik/sql/cmd/ListDateFunctions.java
dfa403e5b33395885b1de1bcfda967fb59fd1ee5
[]
no_license
laukvik/LaukvikSQL
5181493c1672a9e09b934b454aa99a94367b1b3b
c31e3754fe02cce7e32d8bf8bdb53a7ea67b1901
refs/heads/master
2021-01-10T09:13:40.249086
2015-10-25T10:07:20
2015-10-25T10:07:20
43,884,977
0
0
null
null
null
null
UTF-8
Java
false
false
602
java
package org.laukvik.sql.cmd; import org.laukvik.sql.Analyzer; import org.laukvik.sql.DatabaseConnection; import org.laukvik.sql.SQL; import org.laukvik.sql.ddl.Function; /** * Lists date functions * */ public class ListDateFunctions extends SqlCommand { public ListDateFunctions() { super("date", "displays all date functions"); } @Override public int run(DatabaseConnection db, String value) { Analyzer a = new Analyzer(); for (Function f : a.listTimeDateFunctions(db)){ System.out.println( f.getName() ); } return 0; } }
[ "ml@agitec.no" ]
ml@agitec.no
7d23ab449acfc7508a3a4103e43fa742aeb428e2
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/XCOMMONS-1057-1-30-Single_Objective_GGA-IntegrationSingleObjective-BasicBlockCoverage/org/xwiki/extension/job/internal/AbstractInstallPlanJob$ModifableExtensionPlanTree_ESTest_scaffolding.java
9151fa942aa31e6a503e3098e60995eadbc6381d
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
32,673
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon May 18 05:25:01 UTC 2020 */ package org.xwiki.extension.job.internal; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import static org.evosuite.shaded.org.mockito.Mockito.*; @EvoSuiteClassExclude public class AbstractInstallPlanJob$ModifableExtensionPlanTree_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.xwiki.extension.job.internal.AbstractInstallPlanJob$ModifableExtensionPlanTree"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {} } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(AbstractInstallPlanJob$ModifableExtensionPlanTree_ESTest_scaffolding.class.getClassLoader() , "org.jfree.data.time.TimeTableXYDataset", "org.apache.hadoop.fs.FileSystem", "org.infinispan.stream.impl.TerminalFunctions$MaxLongFunction", "org.infinispan.stream.StreamMarshalling$EqualityPredicate", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueReturnPrevOrNull", "org.jfree.data.time.Minute", "org.apache.commons.lang3.StringUtils", "org.xwiki.extension.version.Version", "org.xwiki.extension.version.VersionRange", "org.jfree.data.general.ValueDataset", "org.infinispan.commons.marshall.MarshallableFunctions$RemoveReturnPrevOrNull", "org.xwiki.job.AbstractJob", "org.apache.hadoop.conf.Configuration", "org.xwiki.observation.event.FilterableEvent", "org.xwiki.extension.wrap.AbstractWrappingObject", "org.xwiki.component.manager.CompatibilityComponentManager", "org.jfree.data.general.AbstractSeriesDataset", "org.jfree.data.xy.DefaultTableXYDataset", "org.infinispan.stream.impl.DistributedCacheStream", "org.apache.hadoop.classification.InterfaceStability$Stable", "org.jfree.data.RangeInfo", "org.infinispan.stream.impl.TerminalFunctions$SumIntFunction", "org.jfree.data.general.CombinedDataset", "org.xwiki.extension.repository.AbstractExtensionRepository", "com.google.inject.internal.MoreTypes$WildcardTypeImpl", "org.jfree.data.jdbc.JDBCXYDataset", "org.apache.commons.collections.IterableMap", "org.xwiki.component.util.DefaultParameterizedType", "org.infinispan.stream.impl.TerminalFunctions$MaxIntFunction", "org.apache.commons.vfs2.impl.DefaultVfsComponentContext", "org.xwiki.component.descriptor.DefaultComponentRole", "org.jfree.data.statistics.HistogramType", "org.xwiki.observation.event.DocumentUpdateEvent", "org.jfree.data.xy.DefaultXYDataset", "org.xwiki.observation.EventListener", "org.jfree.data.contour.ContourDataset", "org.infinispan.stream.impl.TerminalFunctions$AverageIntFunction", "org.jfree.data.time.TimeSeriesCollection", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueMetasIfPresentReturnPrevOrNull", "org.jfree.data.xy.DefaultHighLowDataset", "org.xwiki.observation.event.DocumentSaveEvent", "org.infinispan.stream.impl.TerminalFunctions$CountDoubleFunction", "org.jfree.data.time.TimePeriodFormatException", "org.xwiki.component.manager.ComponentRepositoryException", "com.mchange.v2.c3p0.C3P0ProxyConnection", "org.apache.commons.dbcp2.PoolingConnection$StatementType", "org.xwiki.observation.internal.DefaultObservationManager", "org.xwiki.extension.job.internal.AbstractInstallPlanJob", "org.apache.commons.vfs2.provider.VfsComponentContext", "org.infinispan.stream.impl.TerminalFunctions$ForEachDoubleFunction", "org.apache.commons.vfs2.FileSystemOptions", "org.codehaus.classworlds.BytesURLStreamHandler", "com.google.common.collect.MapMakerInternalMap$Strength", "com.google.common.base.Equivalence$Equals", "org.jfree.data.time.Second", "org.jfree.data.xy.YIntervalDataItem", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueMetasIfAbsentReturnBoolean", "org.jfree.data.xy.XIntervalSeries", "org.xwiki.observation.event.ActionExecutionEvent", "org.xwiki.extension.ExtensionDependency", "org.apache.tika.fork.MemoryURLStreamHandler", "org.jfree.data.KeyedValues", "org.jfree.data.xy.XYIntervalSeries", "com.google.common.reflect.Types$ParameterizedTypeImpl", "org.xwiki.extension.job.plan.ExtensionPlanAction$Action", "org.xwiki.extension.ExtensionLicense", "org.infinispan.commons.marshall.MarshallableFunctions$AbstractSetValueReturnPrevOrNull", "org.infinispan.stream.impl.TerminalFunctions$CountIntFunction", "org.infinispan.CacheStream", "com.google.common.collect.MapMakerInternalMap$ValueReference", "org.infinispan.stream.impl.TerminalFunctions$IdentityReduceIntFunction", "org.infinispan.stream.impl.TerminalFunctions$ReduceIntFunction", "org.infinispan.commons.marshall.MarshallableFunctions", "org.apache.commons.dbcp2.DelegatingPreparedStatement", "org.infinispan.commons.marshall.MarshallableFunctions$RemoveIfValueEqualsReturnBoolean", "org.xwiki.extension.wrap.WrappingRatingExtension", "org.jfree.data.xy.XYZDataset", "org.xwiki.component.annotation.Role", "org.apache.commons.dbcp2.PoolableConnection", "org.apache.commons.vfs2.FileSystemManager", "org.jfree.data.general.DatasetChangeListener", "org.jfree.data.statistics.MultiValueCategoryDataset", "org.xwiki.extension.rating.Rating", "org.infinispan.stream.impl.TerminalFunctions$ToArrayGeneratorFunction", "org.jfree.data.gantt.TaskSeries", "org.jfree.data.xy.YIntervalSeries", "org.xwiki.observation.event.BeginFoldEvent", "org.python.core.PySystemStateTest", "org.xwiki.extension.test.FileExtension", "org.infinispan.util.SerializableFunction", "org.infinispan.stream.impl.TerminalFunctions$AllMatchIntFunction", "org.jfree.data.statistics.SimpleHistogramBin", "org.apache.hadoop.conf.Configuration$DeprecationContext", "org.xwiki.extension.job.internal.AbstractInstallPlanJob$ModifableExtensionPlanNode", "com.google.common.collect.Interner", "org.jfree.data.time.Millisecond", "com.google.common.collect.Interners$1", "org.apache.commons.vfs2.FileName", "org.jfree.data.general.DefaultKeyedValueDataset", "org.apache.commons.dbcp2.AbandonedTrace", "org.jfree.data.general.SeriesChangeEvent", "org.xwiki.observation.event.filter.EventFilter", "org.xwiki.extension.test.EmptyExtension", "org.infinispan.distexec.mapreduce.MapReduceManagerImpl$MapCombineTask", "org.xwiki.extension.wrap.WrappingCoreExtension", "org.xwiki.extension.CoreExtensionFile", "org.apache.commons.configuration.VFSFileSystem$VFSURLStreamHandler", "org.xwiki.observation.event.ApplicationStoppedEvent", "com.google.common.base.Equivalence$Identity", "org.infinispan.stream.impl.DistributedCacheStream$SegmentListenerNotifier", "org.infinispan.stream.impl.TerminalFunctions$NoneMatchLongFunction", "org.infinispan.stream.impl.AbstractCacheStream$CollectionDecomposerConsumer", "org.xwiki.observation.AbstractThreadEventListener", "org.jfree.data.xy.DefaultWindDataset", "org.xwiki.observation.event.CancelableEvent", "org.xwiki.extension.job.plan.internal.DefaultExtensionPlanAction", "org.infinispan.stream.impl.TerminalFunctions$ForEachLongFunction", "org.jfree.data.xy.IntervalXYZDataset", "org.apache.commons.vfs2.impl.URLStreamHandlerProxy", "org.xwiki.observation.event.AbstractCancelableEvent", "org.infinispan.stream.impl.TerminalFunctions$ToArrayLongFunction", "org.jfree.data.time.FixedMillisecond", "org.apache.tika.fork.MemoryURLStreamHandlerFactory", "org.jfree.data.Value", "org.jfree.data.time.TimePeriodAnchor", "org.apache.commons.dbcp2.PoolingDriver$PoolGuardConnectionWrapper", "org.jfree.data.gantt.Task", "org.jfree.data.general.DefaultValueDataset", "com.google.gson.internal.$Gson$Types$ParameterizedTypeImpl", "org.xwiki.extension.version.InvalidVersionRangeException", "org.jfree.data.contour.NonGridContourDataset", "com.google.common.collect.MapMakerInternalMap", "info.informatica.io.FilesystemInfo", "org.jfree.data.xy.VectorSeriesCollection", "org.jfree.date.SerialDate", "org.aspectj.lang.reflect.AjType", "org.xwiki.extension.rating.ExtensionRating", "org.xwiki.extension.version.Version$Type", "org.jfree.data.DomainOrder", "org.infinispan.stream.StreamMarshalling$AlwaysTruePredicate", "org.infinispan.stream.impl.TerminalFunctions$CountLongFunction", "org.xwiki.extension.wrap.WrappingInstalledExtension", "org.xwiki.extension.test.EmptyLocalExtensionFile", "org.xwiki.extension.AbstractExtension", "org.apache.hadoop.conf.Configuration$1", "org.jfree.data.jdbc.JDBCPieDataset", "org.jfree.data.gantt.SlidingGanttCategoryDataset", "org.xwiki.component.event.AbstractComponentDescriptorEvent", "org.xwiki.component.internal.StackingComponentEventManager$ComponentEventEntry", "org.xwiki.component.event.ComponentDescriptorRemovedEvent", "org.xwiki.observation.event.AbstractFilterableEvent", "com.google.inject.internal.MoreTypes$GenericArrayTypeImpl", "org.xwiki.extension.rating.RatingExtension", "org.jfree.data.DefaultKeyedValues2D", "org.jfree.data.xy.DefaultOHLCDataset", "org.infinispan.stream.impl.TerminalFunctions$MinFunction", "org.infinispan.stream.impl.TerminalFunctions$SummaryStatisticsIntFunction", "org.infinispan.stream.impl.TerminalFunctions$FindAnyIntFunction", "org.jfree.data.time.Day", "org.jfree.data.general.SeriesDataset", "org.infinispan.stream.impl.TerminalFunctions$CollectorFunction", "com.google.common.collect.MapMaker$NullConcurrentMap", "org.infinispan.stream.impl.TerminalFunctions$AnyMatchIntFunction", "org.jfree.data.xy.XYDataset", "org.infinispan.stream.impl.TerminalFunctions$FindAnyLongFunction", "org.xwiki.extension.DefaultExtensionDependency", "org.apache.hadoop.fs.ChecksumFileSystem", "org.apache.commons.dbcp2.DelegatingConnection", "org.xwiki.extension.job.internal.AbstractInstallPlanJob$ModifableExtensionPlanTree", "org.xwiki.job.GroupedJob", "org.xwiki.stability.Unstable", "org.infinispan.commons.marshall.MarshallableFunctions$AbstractSetValue", "org.infinispan.stream.impl.TerminalFunctions$ReduceFunction", "org.xwiki.extension.ExtensionId", "org.xwiki.component.manager.ComponentLookupException", "org.jfree.data.xy.AbstractXYZDataset", "org.jfree.data.time.RegularTimePeriod", "com.google.inject.internal.MoreTypes", "org.xwiki.extension.wrap.WrappingLocalExtension", "org.jfree.data.time.TimeSeries", "org.xwiki.component.annotation.InstantiationStrategy", "org.xwiki.extension.test.ResourceExtension", "org.jfree.data.general.CombinationDataset", "org.apache.commons.dbcp2.DelegatingStatement", "org.jfree.data.xy.IntervalXYDataset", "org.jfree.data.xy.Vector", "org.infinispan.distexec.mapreduce.MapReduceManagerImpl$DataContainerTask", "org.apache.hadoop.conf.Configuration$IntegerRanges", "org.jfree.data.general.DefaultPieDataset", "org.infinispan.stream.impl.TerminalFunctions$NoneMatchDoubleFunction", "com.google.common.collect.GenericMapMaker", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueMetasIfPresentReturnBoolean", "org.infinispan.commons.marshall.MarshallableFunctions$AbstractSetValueIfPresentReturnBoolean", "org.apache.hadoop.fs.FsUrlStreamHandler", "org.jfree.data.category.DefaultIntervalCategoryDataset", "org.apache.commons.pool2.KeyedObjectPool", "org.infinispan.util.CloseableSupplier", "org.jfree.data.xy.XIntervalSeriesCollection", "org.xwiki.component.descriptor.ComponentInstantiationStrategy", "org.xwiki.extension.version.internal.DefaultVersion$Element", "org.jfree.data.category.CategoryDataset", "org.jfree.data.general.DefaultHeatMapDataset", "org.jfree.data.ComparableObjectItem", "org.jfree.data.xy.XYSeries", "org.infinispan.stream.impl.TerminalFunctions$CollectDoubleFunction", "org.xwiki.component.descriptor.ComponentRole", "org.eclipse.sisu.space.ResourceEnumeration", "org.apache.hadoop.conf.Configuration$ParsedTimeDuration", "org.infinispan.filter.CacheFilters$ConverterAsCacheEntryFunction", "org.osgi.service.url.URLStreamHandlerSetter", "org.osgi.service.url.URLStreamHandlerService", "org.apache.commons.collections.map.UnmodifiableMap", "org.infinispan.stream.impl.TerminalFunctions$MinDoubleFunction", "org.xwiki.component.manager.ComponentLifecycleException", "org.infinispan.stream.impl.TerminalFunctions$SummaryStatisticsLongFunction", "org.jfree.data.gantt.TaskSeriesCollection", "org.apache.commons.pool2.TrackedUse", "org.xwiki.extension.ExtensionException", "org.xwiki.extension.wrap.WrappingExtension", "org.xwiki.extension.DefaultExtensionScm", "org.apache.commons.collections.map.AbstractMapDecorator", "org.infinispan.stream.impl.TerminalFunctions$IdentityReduceCombinerFunction", "org.infinispan.persistence.spi.AdvancedCacheLoader$CacheLoaderTask", "org.apache.hadoop.fs.Path", "org.apache.hadoop.classification.InterfaceAudience$Public", "org.apache.hadoop.conf.Configurable", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueMetasIfAbsentReturnPrevOrNull", "com.google.common.base.Function", "org.infinispan.stream.impl.TerminalFunctions$ForEachFunction", "org.jfree.data.xy.MatrixSeriesCollection", "com.google.common.collect.MapMakerInternalMap$Strength$2", "org.xwiki.extension.repository.ExtensionRepositoryId", "org.apache.commons.dbcp2.PStmtKey", "com.google.common.collect.MapMakerInternalMap$Strength$1", "org.infinispan.stream.impl.TerminalFunctions$IdentityReduceFunction", "org.infinispan.stream.impl.TerminalFunctions$SumLongFunction", "org.jfree.data.xy.MatrixSeries", "com.google.common.collect.MapMakerInternalMap$Strength$3", "org.infinispan.stream.impl.TerminalFunctions$NoneMatchIntFunction", "org.xwiki.component.manager.ComponentManager", "org.xwiki.extension.AbstractExtensionScmConnection", "com.google.common.reflect.Types$WildcardTypeImpl", "org.jfree.data.time.TimeSeriesDataItem", "org.jfree.date.MonthConstants", "com.google.common.collect.Interners$WeakInterner", "org.jfree.data.xy.XYBarDataset", "org.infinispan.filter.CacheFilters$KeyValueFilterAsPredicate", "org.apache.commons.vfs2.provider.FileReplicator", "org.jfree.data.xy.VectorXYDataset", "org.xwiki.observation.event.EndEvent", "org.jfree.data.time.Hour", "org.xwiki.extension.job.internal.AbstractExtensionPlanJob", "org.jfree.data.xy.XYDatasetTableModel", "org.infinispan.stream.impl.TerminalFunctions$ReduceDoubleFunction", "org.infinispan.stream.impl.TerminalFunctions$SummaryStatisticsDoubleFunction", "org.xwiki.extension.ExtensionScm", "org.xwiki.observation.event.DocumentDeleteEvent", "org.infinispan.stream.impl.AbstractCacheStream", "com.google.common.reflect.Types$NativeTypeVariableEquals", "info.informatica.io.FilePatternSpec$FilePattern", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueIfAbsentReturnBoolean", "org.xwiki.extension.AbstractExtensionDependency", "com.google.common.base.Equivalence", "org.jfree.data.statistics.StatisticalCategoryDataset", "com.google.common.collect.Interners", "org.infinispan.stream.impl.TerminalFunctions$AnyMatchFunction", "org.jfree.data.Values", "org.jfree.data.KeyedValues2D", "org.infinispan.stream.impl.TerminalFunctions$AnyMatchDoubleFunction", "org.infinispan.stream.impl.TerminalFunctions$AverageDoubleFunction", "org.jfree.data.general.SeriesException", "org.apache.commons.collections.Unmodifiable", "org.jfree.data.general.CombinedDataset$DatasetInfo", "org.xwiki.extension.ExtensionFile", "org.infinispan.commons.marshall.MarshallableFunctions$Remove", "com.google.common.collect.MapMaker$NullComputingConcurrentMap", "org.apache.hadoop.io.Writable", "com.google.common.collect.ComputingConcurrentHashMap", "org.apache.hadoop.classification.InterfaceAudience$Private", "org.apache.commons.vfs2.provider.TemporaryFileStore", "org.xwiki.component.event.ComponentDescriptorAddedEvent", "org.infinispan.iteration.impl.LocalEntryRetriever$MapAction", "org.jfree.data.contour.DefaultContourDataset", "org.jfree.data.general.SubSeriesDataset", "org.xwiki.extension.job.ExtensionRequest", "org.apache.commons.collections.MapIterator", "org.jfree.data.xy.AbstractIntervalXYDataset", "org.jfree.data.xy.OHLCDataItem", "org.infinispan.stream.impl.TerminalFunctions$CollectIntFunction", "org.apache.commons.vfs2.FileSystemException", "org.jfree.data.xy.YIntervalSeriesCollection", "org.jfree.data.xy.AbstractXYDataset", "org.infinispan.stream.impl.TerminalFunctions$MinLongFunction", "org.jfree.data.general.HeatMapDataset", "org.infinispan.stream.impl.TerminalFunctions$CountFunction", "com.google.common.base.Predicate", "org.xwiki.extension.test.FileExtensionRepository", "com.google.gson.internal.$Gson$Types$GenericArrayTypeImpl", "org.infinispan.stream.impl.TerminalFunctions$AnyMatchLongFunction", "org.jfree.data.xy.DefaultIntervalXYDataset", "org.jfree.ui.FilesystemFilter", "org.infinispan.stream.StreamMarshalling$EntryToValueFunction", "org.infinispan.stream.impl.DistributedCacheStream$IteratorSupplier", "org.xwiki.extension.CoreExtension", "org.xwiki.observation.event.BeginEvent", "org.xwiki.script.wrap.AbstractWrappingObject", "org.apache.commons.pool2.ObjectPool", "org.infinispan.stream.impl.TerminalFunctions$CollectFunction", "org.jfree.data.statistics.BoxAndWhiskerItem", "org.jfree.data.category.CategoryToPieDataset", "org.apache.commons.pool2.KeyedPooledObjectFactory", "com.google.common.reflect.Types", "org.jfree.data.DefaultKeyedValues", "org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset", "org.apache.commons.dbcp2.PoolableConnectionMXBean", "org.jfree.data.statistics.BoxAndWhiskerCategoryDataset", "org.jfree.data.time.TimePeriodValues", "org.apache.commons.vfs2.FileObject", "org.xwiki.extension.test.ResourceExtensionRepository", "org.xwiki.extension.version.VersionRangeCollection", "com.google.inject.internal.MoreTypes$ParameterizedTypeImpl", "org.jfree.data.time.DynamicTimeSeriesCollection$ValueSequence", "org.xwiki.component.internal.StackingComponentEventManager", "org.xwiki.observation.event.Event", "org.jfree.data.xy.CategoryTableXYDataset", "com.google.common.base.Preconditions", "com.google.common.collect.MapMaker", "org.xwiki.extension.version.IncompatibleVersionConstraintException", "org.jfree.data.general.DefaultKeyedValues2DDataset", "org.infinispan.stream.impl.TerminalFunctions$FindAnyDoubleFunction", "com.google.common.collect.MapMaker$ComputingMapAdapter", "org.jfree.data.time.Quarter", "org.jfree.data.time.TimePeriodValue", "org.jfree.data.time.DynamicTimeSeriesCollection", "org.infinispan.stream.impl.TerminalFunctions$IdentityReduceDoubleFunction", "org.infinispan.commons.marshall.MarshallableFunctions$ReturnReadWriteView", "org.xwiki.extension.DefaultExtensionAuthor", "org.jfree.data.gantt.XYTaskDataset", "org.jfree.data.DomainInfo", "org.xwiki.extension.job.plan.internal.DefaultExtensionPlanTree", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueMetas", "org.apache.commons.vfs2.provider.DefaultURLConnection", "org.xwiki.component.event.ComponentDescriptorEvent", "org.apache.hadoop.conf.Configuration$NegativeCacheSentinel", "org.jfree.data.xy.XYDomainInfo", "org.jfree.data.ComparableObjectSeries", "org.xwiki.component.descriptor.ComponentDescriptor", "org.python.core.PySystemStateTest$TestJBossURLStreamHandler", "org.xwiki.extension.AbstractRatingExtension", "org.jfree.data.xy.XYDataItem", "org.eclipse.sisu.space.ResourceEnumeration$NestedJarHandler", "org.jfree.data.general.DatasetGroup", "org.jfree.data.DefaultKeyedValue", "org.jfree.data.general.KeyedValueDataset", "org.xwiki.observation.internal.DefaultObservationManager$RegisteredListener", "org.jfree.data.xy.XYIntervalDataItem", "org.jfree.data.xy.OHLCDataset", "org.infinispan.stream.impl.AbstractCacheStream$IntermediateType", "org.jfree.data.xy.VectorDataItem", "org.xwiki.extension.ExtensionAuthor", "org.jfree.data.time.Month", "org.xwiki.observation.event.EndFoldEvent", "org.infinispan.commons.marshall.MarshallableFunctions$AbstractSetValueIfAbsentReturnPrevOrNull", "org.xwiki.observation.ObservationManager", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueIfAbsentReturnPrevOrNull", "org.infinispan.stream.impl.TerminalFunctions$ForEachIntFunction", "org.xwiki.component.annotation.Component", "org.jfree.data.general.WaferMapDataset", "org.jfree.data.general.Dataset", "org.eclipse.sisu.space.ResourceEnumeration$NestedJarConnection", "com.fasterxml.jackson.core.type.ResolvedType", "com.google.inject.internal.MoreTypes$CompositeType", "org.xwiki.extension.repository.DefaultExtensionRepositoryDescriptor", "org.xwiki.observation.event.AllEvent", "org.xwiki.extension.AbstractExtensionScm", "org.infinispan.commons.marshall.MarshallableFunctions$LambdaWithMetas", "org.apache.hadoop.HadoopIllegalArgumentException", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueMetasReturnPrevOrNull", "org.xwiki.extension.job.AbstractExtensionRequest", "org.infinispan.commons.marshall.MarshallableFunctions$ReturnReadWriteGet", "org.infinispan.stream.StreamMarshalling$NonNullPredicate", "com.google.common.collect.MapMakerInternalMap$ReferenceEntry", "org.jfree.data.xy.WindDataset", "info.informatica.io.FilePatternSpec", "com.google.common.reflect.Types$JavaVersion", "org.xwiki.component.descriptor.DefaultComponentDependency", "org.xwiki.extension.LocalExtension", "org.jfree.data.statistics.SimpleHistogramDataset", "org.jfree.data.time.SimpleTimePeriod", "org.infinispan.stream.impl.TerminalFunctions$ReduceLongFunction", "org.jfree.data.xy.XYIntervalSeriesCollection", "org.xwiki.observation.event.ApplicationStartedEvent", "org.xwiki.extension.job.plan.ExtensionPlanNode", "org.jfree.util.PublicCloneable", "org.jfree.data.xy.DefaultXYZDataset", "org.apache.hadoop.fs.FsUrlStreamHandlerFactory", "com.google.common.base.FunctionalEquivalence", "org.xwiki.extension.version.internal.DefaultVersionConstraint", "org.xwiki.extension.job.plan.ExtensionPlanAction", "org.jfree.data.general.AbstractDataset", "org.infinispan.stream.impl.TerminalFunctions$ToArrayIntFunction", "org.xwiki.extension.job.plan.ExtensionPlanTree", "org.xwiki.extension.version.InvalidVersionConstraintException", "org.infinispan.stream.impl.TerminalFunctions$ToArrayDoubleFunction", "org.infinispan.stream.impl.TerminalFunctions$MinIntFunction", "org.xwiki.extension.ExtensionScmConnection", "org.xwiki.extension.InstalledExtension", "org.jfree.util.SortOrder", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueReturnView", "org.xwiki.extension.ExtensionIssueManagement", "org.xwiki.extension.job.plan.internal.DefaultExtensionPlanNode", "org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset", "org.jfree.data.category.SlidingCategoryDataset", "org.jfree.data.UnknownKeyException", "org.infinispan.commons.marshall.MarshallableFunctions$AbstractSetValueIfPresentReturnPrevOrNull", "ucar.nc2.util.net.URLStreamHandlerFactory", "org.jfree.data.time.TimePeriod", "org.xwiki.job.Request", "org.xwiki.extension.job.UninstallRequest", "org.infinispan.stream.impl.TerminalFunctions$AverageLongFunction", "org.jfree.data.statistics.HistogramDataset", "org.apache.commons.vfs2.provider.DefaultURLStreamHandler", "org.infinispan.commons.marshall.MarshallableFunctions$AbstractSetValueIfAbsentReturnBoolean", "org.apache.hadoop.conf.Configuration$DeprecationDelta", "org.xwiki.extension.AbstractExtensionIssueManagement", "org.infinispan.stream.impl.TerminalFunctions$SumDoubleFunction", "org.xwiki.component.descriptor.ComponentDependency", "org.apache.hadoop.conf.Configuration$DeprecatedKeyInfo", "org.apache.hadoop.fs.FilterFileSystem", "org.infinispan.stream.impl.TerminalFunctions$AllMatchFunction", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueIfPresentReturnBoolean", "org.jfree.data.general.PieDataset", "com.fasterxml.jackson.databind.JavaType", "org.apache.hadoop.util.StringInterner", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueIfPresentReturnPrevOrNull", "org.jfree.data.xy.XYRangeInfo", "org.xwiki.job.Job", "org.xwiki.extension.version.VersionConstraint", "org.infinispan.iteration.impl.DistributedEntryRetriever$MapAction", "com.google.common.reflect.Types$GenericArrayTypeImpl", "org.xwiki.extension.job.InstallRequest", "org.jfree.data.general.KeyedValues2DDataset", "org.infinispan.stream.impl.TerminalFunctions$CollectLongFunction", "org.apache.commons.vfs2.FileSystemOptions$FileSystemOptionKey", "org.xwiki.extension.job.internal.AbstractExtensionJob", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueMetasReturnView", "info.informatica.io.WildcardFilter", "org.apache.hadoop.classification.InterfaceAudience$LimitedPrivate", "org.xwiki.extension.DefaultExtensionIssueManagement", "org.jfree.data.statistics.DefaultMultiValueCategoryDataset", "org.jfree.data.Range", "org.infinispan.stream.impl.TerminalFunctions$AllMatchLongFunction", "org.jfree.data.statistics.DefaultStatisticalCategoryDataset", "org.jfree.data.category.IntervalCategoryDataset", "org.apache.commons.dbcp2.PoolingConnection", "org.jfree.data.time.Year", "org.apache.commons.pool2.PooledObject", "org.infinispan.stream.impl.TerminalFunctions$ToArrayFunction", "org.xwiki.component.descriptor.DefaultComponentDescriptor", "org.infinispan.stream.impl.TerminalFunctions$NoneMatchFunction", "org.xwiki.text.XWikiToStringBuilder", "org.xwiki.observation.event.AbstractDocumentEvent", "org.infinispan.stream.impl.TerminalFunctions$IdentityReduceLongFunction", "org.xwiki.classloader.internal.ExtendedURLStreamHandlerFactory", "org.apache.hadoop.conf.Configured", "org.jfree.data.time.TimePeriodValuesCollection", "org.jfree.data.xy.XIntervalDataItem", "org.infinispan.stream.StreamMarshalling$EntryToKeyFunction", "org.xwiki.component.manager.ComponentEventManager", "org.xwiki.extension.version.internal.VersionUtils", "org.xwiki.extension.version.internal.DefaultVersionRangeCollection", "org.infinispan.commons.marshall.MarshallableFunctions$ReturnReadWriteFind", "com.google.gson.internal.$Gson$Types$WildcardTypeImpl", "org.infinispan.stream.impl.TerminalFunctions$MaxFunction", "org.infinispan.commons.marshall.MarshallableFunctions$AbstractSetValueReturnView", "org.xwiki.extension.repository.ExtensionRepositoryDescriptor", "org.jfree.data.xy.TableXYDataset", "org.xwiki.extension.LocalExtensionFile", "org.xwiki.extension.DefaultExtensionScmConnection", "org.xwiki.extension.version.internal.DefaultVersion", "org.xwiki.extension.repository.ExtensionRepository", "org.jfree.data.gantt.GanttCategoryDataset", "org.xwiki.observation.WrappedThreadEventListener", "org.jfree.data.jdbc.JDBCCategoryDataset", "org.jfree.data.Values2D", "org.apache.commons.lang3.builder.ToStringBuilder", "org.jfree.data.statistics.BoxAndWhiskerXYDataset", "org.jfree.data.general.DatasetChangeEvent", "org.jfree.data.general.SeriesChangeListener", "org.infinispan.commons.marshall.MarshallableFunctions$RemoveReturnBoolean", "org.apache.commons.dbcp2.PoolingDataSource$PoolGuardConnectionWrapper", "org.jfree.data.category.DefaultCategoryDataset", "org.infinispan.stream.impl.TerminalFunctions$AllMatchDoubleFunction", "org.jfree.data.general.KeyedValuesDataset", "org.infinispan.stream.impl.TerminalFunctions$FindAnyFunction", "org.jfree.data.time.Week", "org.jfree.data.xy.VectorSeries", "org.jfree.data.general.DefaultKeyedValuesDataset", "org.xwiki.observation.AbstractEventListener", "org.jfree.data.general.Series", "org.infinispan.stream.impl.DistributedCacheStream$HandOffConsumer", "org.apache.hadoop.conf.Configuration$Resource", "com.fasterxml.jackson.databind.type.TypeBindings", "com.google.common.base.PairwiseEquivalence", "org.jfree.data.xy.XYSeriesCollection", "org.apache.hadoop.classification.InterfaceStability$Unstable", "org.apache.commons.dbcp2.DelegatingCallableStatement", "org.infinispan.commons.marshall.MarshallableFunctions$SetValue", "org.jfree.util.TableOrder", "org.xwiki.extension.Extension", "org.jfree.data.KeyedValue", "org.xwiki.job.AbstractRequest", "org.infinispan.stream.impl.TerminalFunctions$MaxDoubleFunction", "org.jfree.data.xy.IntervalXYDelegate", "org.infinispan.filter.CacheFilters$FilterConverterAsCacheEntryFunction", "org.infinispan.commons.marshall.MarshallableFunctions$SetValueIfEqualsReturnBoolean", "org.jfree.data.KeyedObjects2D", "org.apache.commons.lang3.builder.Builder", "org.apache.hadoop.fs.LocalFileSystem", "org.osgi.service.url.AbstractURLStreamHandlerService" ); } private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException { mock(Class.forName("org.xwiki.extension.job.plan.ExtensionPlanAction", false, AbstractInstallPlanJob$ModifableExtensionPlanTree_ESTest_scaffolding.class.getClassLoader())); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
372c69c6bd4e1925efefbc350a21e9b1ae7e9f7f
fbf911697d2fa9ce7db8c17b8fc356edba5aa6bc
/FirstClass/src/fifth/Runnable.java
155218d727762138c82c0137406a81c4b4a39f19
[]
no_license
Keke0514/AdvancedJava
819c4964fb88240da8566c60305d8556ad0e32c2
d97d80cfc1a157053a2a610c2cf89049f666a9bc
refs/heads/master
2020-04-26T04:26:50.979134
2019-03-01T12:18:53
2019-03-01T12:18:53
173,302,177
1
0
null
2019-03-01T12:58:12
2019-03-01T12:58:12
null
UTF-8
Java
false
false
494
java
package fifth; public class Runnable { public static void main(String[] args) { CreditCard creditCard1= new CreditCard("Bogdándy Bence", 99999999, 50000); CreditCard creditCard2= new CreditCard("Kiss Pista", 250000); creditCard1.drawMoney(14000); System.out.println(creditCard1.drawMoney(100)); System.out.println(creditCard1.getBalance()); creditCard2.drawMoney(140000); System.out.println(creditCard2.getBalance()); } }
[ "bogdandy@iit.uni-miskolc.hu" ]
bogdandy@iit.uni-miskolc.hu
ea2ea54f6aed7636c6ce4a821c086a9e94d9149d
870ccc7d30f91d738116ee4ce1c5709ee7466612
/src/main/java/link/redefine/api/rdfn/repository/UserRepository.java
e9b1884a91b53969a4c10db09f9f4a4e5f2031f6
[]
no_license
kgkirilov/redefine-link-api
bfc77ac4351316071978a274924376e6c4511b67
8a204e5ddafa39f58fdf1832f864ed9bea653801
refs/heads/master
2020-05-29T15:27:01.674399
2019-06-09T15:20:15
2019-06-09T15:20:15
189,221,079
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package link.redefine.api.rdfn.repository; import link.redefine.api.rdfn.entity.Domain; import link.redefine.api.rdfn.entity.Url; import link.redefine.api.rdfn.entity.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import java.util.List; public interface UserRepository extends JpaRepository<User, Integer> { @Query("select u from Url u where u.userByIdUser.idUser = :idUser") List<Url> getUserUrls(@Param("idUser") Integer idUser); @Query("select d from Domain d where d.userByIdUser.idUser = :idUser") List<Domain> getUserDomains(@Param("idUser") Integer idUser); }
[ "kgkirilov7@gmail.com" ]
kgkirilov7@gmail.com
ebc9c9e9c1280fd7a09571923463576cb424ebd4
f4c8daef4b2d7dabcaff4a2de211d6f3f456f04b
/mobileReader/src/main/java/studio/orange/mobile/reader/models/BaseModel.java
324200cda9f26b9bee51c030e4123d136cbba245
[]
no_license
skylee968/DemoAndroid
33c948918c75aac581136f5c7702d8fd6ef1bd7d
368b339d2791aaac8e2e283667e4e5356a408591
refs/heads/master
2021-03-12T22:36:37.650896
2015-09-21T16:01:22
2015-09-21T16:01:22
42,531,202
0
0
null
null
null
null
UTF-8
Java
false
false
293
java
package studio.orange.mobile.reader.models; import com.onetech.otcore.db.store.SimpleStoreIF; public abstract class BaseModel{ abstract SimpleStoreIF getStoreAdapter(); abstract void setStore(String key, String value); abstract void setStore(String key, String value, int expiredTime); }
[ "minhthien.le010190@gmail.com" ]
minhthien.le010190@gmail.com
ad9cbc46ecf435c88f37b9d92dc673416b685df1
127704240fe9f982e98dbb81145dfd0cab849560
/bridge/src/main/java/com/shuyu/BridgeApplication.java
1cababc8e9c66dd10315b91eeafe458982656da0
[]
no_license
iot-wangshuyu/designpatterns
0529e71b5fb5d903688479575ffa58a18ed65c08
6a795f1329bc0a99fb0b1779f550e6374882cdb0
refs/heads/master
2020-04-05T02:50:05.185181
2019-03-30T11:26:42
2019-03-30T11:26:42
156,491,824
1
0
null
null
null
null
UTF-8
Java
false
false
301
java
package com.shuyu; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class BridgeApplication { public static void main(String[] args) { SpringApplication.run(BridgeApplication.class, args); } }
[ "wangsy@ganinfo.com" ]
wangsy@ganinfo.com
9d05ba896fa1097522b1c51660d26aec31053dd0
64156e7db67a24f060ed61113d812765e8d195d6
/DecoratorPattern/src/Tea.java
aa4777a9f5dbe56f3f082512cca133733a1f15e3
[ "Apache-2.0" ]
permissive
vigak/DesignPatterns
e1ac7065596c257da65ff859eac446fbc65ea8ff
6fea17e12746670cdfa06f525476455217f44c95
refs/heads/master
2020-04-27T22:06:38.122290
2019-04-09T17:22:00
2019-04-09T17:22:00
174,723,585
0
0
Apache-2.0
2019-04-09T17:22:01
2019-03-09T17:16:21
Java
UTF-8
Java
false
false
170
java
public class Tea extends Beverage { @Override String getDescription() { return "Tea"; } @Override int getCost() { return 2; } }
[ "a.vignesh@fundsindia.com" ]
a.vignesh@fundsindia.com
3a282de694edef2bc047316f21f5b15b98fc6c04
62e334192393326476756dfa89dce9f0f08570d4
/tk_code/tiku-essay-app/essay-common/src/main/java/com/huatu/tiku/essay/vo/word/QuestionWord.java
5d49f2a10ae465c68191a4bc16346182f79d0e43
[]
no_license
JellyB/code_back
4796d5816ba6ff6f3925fded9d75254536a5ddcf
f5cecf3a9efd6851724a1315813337a0741bd89d
refs/heads/master
2022-07-16T14:19:39.770569
2019-11-22T09:22:12
2019-11-22T09:22:12
223,366,837
1
2
null
2022-06-30T20:21:38
2019-11-22T09:15:50
Java
UTF-8
Java
false
false
1,128
java
package com.huatu.tiku.essay.vo.word; import com.huatu.tiku.essay.vo.admin.AdminQuestionDeductRuleVO; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; /** * @Author ZhenYang * @Date Created in 2018/2/28 21:18 * @Description */ @Data @NoArgsConstructor @AllArgsConstructor public class QuestionWord { /* 标题 */ private String topic; /* 试题类型 */ private String type; // 题干 private String stem; // 资料 private List<Integer> materias; // // 批改得分 // private String piGai; private List<String> deFen; private List<String> kouFen; /* 参考答案 / 标准答案*/ private String answerComment; /* 阅卷规则 */ private String rule; /* 试题分析 */ private String analyze; /* 材料与标准答案点评 */ private String remark; /* 试题分数 */ private double score; /* 难度系数 */ private double difficultGrade; /* 扣分规则*/ private AdminQuestionDeductRuleVO questionDeductRuleVO = new AdminQuestionDeductRuleVO(); }
[ "jelly_b@126.com" ]
jelly_b@126.com
3c28cfdabc65c7cfe4b087a0f2e4e16a640cb4f0
4505e3e21447c803e5f23d2d40abf182e6d0ed78
/analysis/src/main/java/edu/stanford/nlp/util/IntUni.java
1c897707a4c2a18ccb6d18378dc4f0e17337ed8c
[]
no_license
photon3710/es_test
76e182267412db5d0ef20cbb97a4d34f1079b98b
83f9f67906ef9c9ce60c5532f804f7d947dfa56b
refs/heads/master
2021-01-21T16:44:07.347016
2015-07-30T09:15:14
2015-07-30T09:15:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
690
java
package edu.stanford.nlp.util; /** * Just a single integer * * @author Kristina Toutanova (kristina@cs.stanford.edu) */ public class IntUni extends IntTuple { public IntUni() { super(1); } public IntUni(int src) { super(1); elements[0] = src; } public int getSource() { return elements[0]; } public void setSource(int src) { elements[0] = src; } @Override public IntTuple getCopy() { IntUni nT = new IntUni(elements[0]); return nT; } public void add(int val) { elements[0] += val; } private static final long serialVersionUID = -7182556672628741200L; }
[ "ashley.wang@misingularity.io" ]
ashley.wang@misingularity.io
b736325a1d3761a622fedde863bbb429c2eb2b91
5355e865f750acf2b71b878813fec0c43fb534da
/app/src/main/java/com/weaponzhi/merchandiselist/fragment/MerchandiseListBaseFragment.java
9a2b7c492288ba97e0c8fcc9186f7ea2d59e9da3
[]
no_license
WeaponZhi/MerchandiseList
5c8f49fcc44cb0f09a75b803d59e1b9a97874eec
7fa8d00bec2309c803a3ae71997d168a4f938888
refs/heads/master
2021-01-17T08:25:11.731365
2017-03-12T15:20:40
2017-03-12T15:20:40
83,909,229
12
0
null
null
null
null
UTF-8
Java
false
false
7,083
java
package com.weaponzhi.merchandiselist.fragment; import android.os.Bundle; import android.os.Handler; import android.support.v4.view.ViewCompat; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.aspsine.swipetoloadlayout.OnLoadMoreListener; import com.aspsine.swipetoloadlayout.OnRefreshListener; import com.aspsine.swipetoloadlayout.SwipeToLoadLayout; import com.weaponzhi.merchandiselist.R; import com.weaponzhi.merchandiselist.adapter.MerchandiseListAdapter; import com.weaponzhi.merchandiselist.base.BaseFragment; import com.weaponzhi.merchandiselist.bean.MerchandiseBean; import com.weaponzhi.merchandiselist.model.MerchandiseListBaseModel; import com.weaponzhi.merchandiselist.presenter.MerchandiseListBasePresenter; import com.weaponzhi.merchandiselist.utils.ToastUtil; import com.weaponzhi.merchandiselist.view.recyclerview.MyRecyclerView; import com.weaponzhi.merchandiselist.view.recyclerview.SpaceItemDecoration; import java.util.List; import butterknife.Bind; /** * MerchandiseListBaseFragment * <p> * author: 顾博君 <br> * time: 2016/11/8 10:56 <br> * e-mail: gubojun@csii.com.cn <br> * </p> */ public class MerchandiseListBaseFragment extends BaseFragment<MerchandiseListBasePresenter, MerchandiseListBaseModel> implements OnRefreshListener, OnLoadMoreListener { @Bind(R.id.swipeToLoadLayout) SwipeToLoadLayout swipeToLoadLayout;//刷新布局,详细用法请参考网上资料 @Bind(R.id.swipe_target) MyRecyclerView swipeTarget;// MerchandiseListAdapter adapter; public int type; private boolean isPrepared = false; @Override protected View initViewPre(LayoutInflater from, ViewGroup container) { return from.inflate(R.layout.fragment_merchandise_list, container, false); } @Override public void initView(View view) { /* * 获取页签类型 0全部 1待发货 2待收货 3已完成 */ Bundle args = getArguments(); if (args != null) { String typeTemp = args.getString("type"); type = Integer.valueOf(typeTemp); } adapter = new MerchandiseListAdapter(activity); adapter.setOnItemClickListener(new MerchandiseListAdapter.onItemClickListener() { @Override public void onItemClick(View v, int position, MerchandiseBean data) { //设置点击订单时候的跳转界面 ToastUtil.showToast(activity, "跳转到订单" + data.getOrderNo() + "界面"); } @Override public void onItemLongClick(RecyclerView.ViewHolder viewHolder, View v, int position) { } }); adapter.setButtonClickListener(new MerchandiseListAdapter.ButtonClickListener() { @Override public void onClick(int position, final MerchandiseBean data) { //设置每个bean上面的按钮监听 String text = null; switch (data.getOrderState()) { case "1": text = "退货"; break; case "2": text = "确认收货"; break; case "3": text = "删除订单"; break; } ToastUtil.showToast(activity, "按钮" + text + "被点击了!"); } }); swipeTarget.setAdapter(adapter); swipeTarget.setHasFixedSize(true); swipeTarget.setEmptyView(view.findViewById(R.id.layout_empty)); swipeTarget.setLayoutManager(new LinearLayoutManager(activity)); swipeTarget.addItemDecoration(new SpaceItemDecoration(activity, 5)); //---------------------------------------------------------- //刷新 swipeToLoadLayout.setOnRefreshListener(this); swipeToLoadLayout.setOnLoadMoreListener(this); // setLoadMoreEnabled(false); swipeToLoadLayout.setDefaultToRefreshingScrollingDuration(1000);//默认下拉刷新滚动时间 swipeToLoadLayout.setReleaseToRefreshingScrollingDuration(1000);//释放下拉刷新持续滚动的时间 // swipeToLoadLayout.setRefreshCompleteToDefaultScrollingDuration(1000);//默认完成下拉刷新持续滚动时间 // swipeToLoadLayout.setRefreshCompleteDelayDuration(1000);//下拉刷新完成延迟的持续时间 swipeToLoadLayout.setDefaultToLoadingMoreScrollingDuration(1000); swipeToLoadLayout.setReleaseToLoadingMoreScrollingDuration(1000); swipeTarget.setOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { if (newState == RecyclerView.SCROLL_STATE_IDLE) { if (!ViewCompat.canScrollVertically(recyclerView, 1)) { swipeToLoadLayout.setLoadingMore(true); } } } }); isPrepared = true; } //统一的Fragment构建方法 public static MerchandiseListBaseFragment newInstance(int flag) { Bundle args = new Bundle(); //type代表页签,0:全部订单 1:待发货 2:待收货 3:已完成 args.putString("type", String.valueOf(flag)); MerchandiseListBaseFragment fragment = new MerchandiseListBaseFragment(); fragment.setArguments(args); return fragment; } /** * 获取订单类型 * * @return */ public int getType() { return type; } //处理订单列表数据 public void returnList(List<MerchandiseBean> list) { adapter.flush(list); } public void fresh() { mPresenter.refresh(); } //下拉刷新 @Override public void onRefresh() { mPresenter.refresh(); new Handler().postDelayed(new Runnable() { @Override public void run() { if (swipeToLoadLayout != null) swipeToLoadLayout.setRefreshing(false); } }, 2000); } //上拉加载更多 @Override public void onLoadMore() { mPresenter.loadMore(); new Handler().postDelayed(new Runnable() { @Override public void run() { if (swipeToLoadLayout != null) swipeToLoadLayout.setLoadingMore(false); } }, 2000); } //初始化数据 public static void firstGetData() { MerchandiseListBaseModel.refreshList(); } @Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (isVisibleToUser && isPrepared) { //相当于Fragment的onResume方法 fresh(); } else { //相当于Fragment的onPause } } }
[ "584098488@qq.com" ]
584098488@qq.com
d65ca35a973e253ae7c1f7c566a33c49352896c3
ad81d21b000322d8eb01a7777b2b5936523d2613
/app/src/main/java/com/example/android/interactivestory/model/Page.java
bfa9137dea35fd6cd34e820339525cf9adad37f0
[]
no_license
charlee593/Android_StoryInMars
a1c5fa2d0352643d916a4995679bd38eb34e5432
9dfbeac9c9a0834f1e87bee3a49990aad15b4efc
refs/heads/master
2020-06-26T19:39:52.396864
2015-01-17T18:09:55
2015-01-17T18:09:55
29,384,397
0
0
null
null
null
null
UTF-8
Java
false
false
1,337
java
package com.example.android.interactivestory.model; /** * Created by Carlos on 2015-01-17. */ public class Page { private int mImageId; private String mText; private Choice mChoice1; private Choice mChoice2; public boolean isFinal() { return isFinal; } public void setFinal(boolean isFinal) { this.isFinal = isFinal; } private boolean isFinal = false; public Page(int imageId, String mText, Choice mChoice1, Choice mChoice2){ mImageId = imageId; this.mText = mText; this.mChoice1 = mChoice1; this.mChoice2 = mChoice2; } public Page(int imageId, String mText){ mImageId = imageId; this.mText = mText; isFinal = true; } public int getImageId() { return mImageId; } public void setImageId(int mImageId) { this.mImageId = mImageId; } public Choice getChoice1() { return mChoice1; } public void setChoice1(Choice mChoice1) { this.mChoice1 = mChoice1; } public Choice getChoice2() { return mChoice2; } public void setChoice2(Choice mChoice2) { this.mChoice2 = mChoice2; } public String getText() { return mText; } public void setText(String mText) { this.mText = mText; } }
[ "charlee593@gmail.com" ]
charlee593@gmail.com
7764f63a2f41283a0ecf25d92e4b01ae20aafe53
3507b514f50835fea377235419575aa76a13411c
/src/main/java/com/sschudakov/abstract_factory/factories/views/TableFileView.java
8590422502e77b2f8138a0dcc25919b2d9f4a92a
[]
no_license
SChudakov/OOPLab
303a8d7f7bb7af0c7d9a30c2e5aa8284602a40b1
180fba6f056658c25b6e3fb75e1f69f4e57595f8
refs/heads/master
2021-09-16T07:17:45.207665
2018-06-18T12:06:20
2018-06-18T12:06:20
105,442,980
0
0
null
null
null
null
UTF-8
Java
false
false
1,101
java
package com.sschudakov.abstract_factory.factories.views; import com.sschudakov.abstract_factory.factories.closers.TableFileCloser; import com.sschudakov.abstract_factory.factories.openers.TableFileOpener; import java.io.IOException; /** * Created by Semen Chudakov on 12.11.2017. */ public class TableFileView implements FileView { private TableFileOpener opener; private TableFileCloser closer; public TableFileOpener getOpener() { return opener; } public TableFileCloser getCloser() { return closer; } public TableFileView(TableFileOpener opener, TableFileCloser closer) { this.opener = opener; this.closer = closer; } @Override public void open() throws IOException, ClassNotFoundException { this.opener.openFile(); this.opener.getViewManager().setView(this); this.closer.getSaver().setTable(opener.getTable()); } @Override public void save() { this.closer.getSaver().save(); } @Override public boolean close() { return this.closer.close(); } }
[ "css-99@i.ua" ]
css-99@i.ua
9a9e31fb3679db15f94b15ff4fd2209b0e5092b5
d2a2154116b29b479e63dc587abdc4bf2ad89203
/spring-annotation-logging-demo-aspectj/src/main/java/demo/DemoAspectjLoggingApplication.java
8a0a6e2fcb47adc8ae46093f456736b9317c0269
[ "Apache-2.0" ]
permissive
pari0130/spring-annotation-logging
457ac79f785cd5c44deee38d12ccf7967a852195
5578661972b38b76b58df67955257823508ad12c
refs/heads/master
2021-05-29T08:36:04.524865
2015-06-25T12:34:51
2015-06-25T12:34:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,304
java
package demo; import com.ulisesbocchio.springannotationlogging.LoggingAspect; import org.aspectj.lang.Aspects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.EnableLoadTimeWeaving; import org.springframework.context.annotation.aspectj.EnableSpringConfigured; /** * @author Ulises Bocchio */ @SpringBootApplication @EnableLoadTimeWeaving @EnableSpringConfigured @ComponentScan() public class DemoAspectjLoggingApplication { private static final Logger LOG = LoggerFactory.getLogger(DemoAspectjLoggingApplication.class); public static void main(String[] args) { ApplicationContext appCtx = SpringApplication.run(DemoAspectjLoggingApplication.class, args); MyService service = appCtx.getBean(MyService.class); LOG.info("MyService's message: {}", service.getMessage("Uli")); LOG.info("Done!"); } @Bean public LoggingAspect profilingAspect() { return Aspects.aspectOf(LoggingAspect.class); } }
[ "ubocchio@ULISESPRO.local" ]
ubocchio@ULISESPRO.local
76801e29e306c5c2a23f030e980b0f45d7ad73d4
a67a9de5793eae68236db41e8d537b51b599aef9
/src/l3_hw3/L3_HW3.java
f09c2a8aec7338c0a465fe4faa9e38a912843f73
[]
no_license
namtt187330/Java-L3
0ff0a5e59730ff7846e3c78f7125a9c528cc8014
39b87dcc3fe457bf539a10f62e0905f4f1696ecc
refs/heads/master
2022-12-01T07:13:51.578891
2020-08-11T12:30:42
2020-08-11T12:30:42
286,737,617
0
0
null
null
null
null
UTF-8
Java
false
false
1,258
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package l3_hw3; import java.util.Scanner; /** * * @author nam57 */ public class L3_HW3 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Moi ban nhap do dai chuoi:"); int length = sc.nextInt(); int[] array = new int[length]; int i = 0; for (i = 0; i < length; i++) { System.out.println("Nhap vao gia tri " + (i + 1) + ":"); array[i] = sc.nextInt(); } int ketqua = check(array); System.out.println(ketqua); // TODO code application logic here } public static int check(int[] array) { int ketqua = 0; for (int i = 0; i < array.length; i++) { if (array[i] <= array[i + 1]) { return ketqua = 1; } else if (array[i] >= array[i + 1]) { return ketqua = -1; } else { return ketqua = 0; } } return ketqua; } }
[ "nam.tt187330@sis.hust.edu.vn" ]
nam.tt187330@sis.hust.edu.vn
a96fdea8660ffa3fdb8bd9d065ec92c1cbbc87e1
11f462871e9655afb2b62b6bf6eb1cb31bdf928f
/leetcode/70.java
1cb4a49b27c71ee15fc6f5a8cc4aa5182eaf22ee
[]
no_license
gashe-soo/Algorithm
e1ebfad4a00bbb3652c999322d9695cf182d9328
087932cf96b621e325ae71aa7e5a734012f1d079
refs/heads/master
2023-05-01T10:47:14.974113
2021-05-15T13:24:55
2021-05-15T13:24:55
263,251,573
1
1
null
null
null
null
UTF-8
Java
false
false
231
java
class Solution { public int climbStairs(int n) { int[] dp = new int[n+1]; dp[0] = 1; dp[1] = 1; for(int i=2;i<=n;i++){ dp[i] = dp[i-1]+dp[i-2]; } return dp[n]; } }
[ "gashe7@gmail.com" ]
gashe7@gmail.com
836d0c504279cb83caab0bd8c4e3aa8f843ae736
b26f03e436477c574b70ed90a5da7f809f0d9fe6
/src/sample/Main.java
5f383e2e7f5202b4095a743673d48eb4b2d0ee55
[]
no_license
AmirKhus/Kursovaya2.1
c2f5081c93b2f890b6999b3f6b06f68ab0d7e4d7
b9f2aaf4aea04fdb6beaf80a2d5a17915177ab85
refs/heads/master
2023-02-02T20:02:13.245630
2020-12-27T11:35:43
2020-12-27T11:35:43
318,744,419
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package sample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("loginFile.fxml")); primaryStage.setTitle("Вход в систему"); primaryStage.setScene(new Scene(root, 674, 486)); primaryStage.show(); } public static User user; public static ArrayObject arrayObject; public static void main(String[] args) { launch(args); } }
[ "70978948+AmirKhus@users.noreply.github.com" ]
70978948+AmirKhus@users.noreply.github.com
749f96c4f664c8297c939296e800c6ea75223646
a7a56b0950fbedb99dc379010e27f366fc57a0ca
/src/main/java/com/boiechko/dao/interfaces/OrderDao.java
e870e4e5d973f8fb2758841f26e4801160723581
[]
no_license
Volodymyr-Boiechko/Boutique_Spring
c83040c3694c714add3f567a9e782906a5ec3343
07056e94e6fb6f564157210297c084a4a50b3b95
refs/heads/master
2022-12-28T13:43:07.467414
2020-10-04T16:49:15
2020-10-04T16:49:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
121
java
package com.boiechko.dao.interfaces; import com.boiechko.model.Order; public interface OrderDao extends Dao<Order> { }
[ "boiechko17@gmail.com" ]
boiechko17@gmail.com
d0fdfd8a550ef23c9af809bb6440a0f6cf08b00d
0382a6baa1c71db637bcd9a5c2d5caa466f80288
/testApi/src/main/java/comuns/JsonUsuario.java
720868a030c1afa4ec00c10ec7e1ac2f2b11c7ef
[]
no_license
luizsalvador/teste_api
114392d3268d17092ad2499265fb0c78c4a16bb1
908adba257e9eedbe6033693409f2c21d498b096
refs/heads/master
2023-04-28T15:52:37.006046
2021-05-17T02:24:19
2021-05-17T02:24:19
367,965,648
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
969
java
package comuns; /** * @author Luiz Salvador * *Classe que gera o json para cadastrar ou editar um usuário */ public class JsonUsuario { private String nome; private String email; private String password; private String administrador; public JsonUsuario(String nome, String email, String password, String administrador) { super(); this.nome = nome; this.email = email; this.password = password; this.administrador = administrador; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getAdministrador() { return administrador; } public void setAdministrador(String administrador) { this.administrador = administrador; } }
[ "55900972+luizsalvador@users.noreply.github.com" ]
55900972+luizsalvador@users.noreply.github.com
894d905d04696a2360067fa4c558270114ac4dca
ad40093a21c949850d0045c6ad3b5fb54a5786c5
/JMSQATestHarness/code/source/Automated/topicTestSuite/testCase14.java
8e1cb23e7cad1a71486bc035aac80163c46658eb
[]
no_license
twisharoy/sag
9bcadc3a637a701e026d9ff27809a89d47ed9ca6
a3ef56a8928bdf4503802fcd41de5e544e735f7d
refs/heads/master
2016-09-06T01:41:25.154908
2014-02-28T12:39:45
2014-02-28T12:39:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,052
java
package Automated.topicTestSuite; // -----( IS Java Code Template v1.2 // -----( CREATED: 2007-06-03 10:20:22 IST // -----( ON-HOST: CPAI-D620 import com.wm.data.*; import com.wm.util.Values; import com.wm.app.b2b.server.Service; import com.wm.app.b2b.server.ServiceException; // --- <<IS-START-IMPORTS>> --- import com.wm.app.b2b.server.jms.consumer.*; // --- <<IS-END-IMPORTS>> --- public final class testCase14 { // ---( internal utility methods )--- final static testCase14 _instance = new testCase14(); static testCase14 _newInstance() { return new testCase14(); } static testCase14 _cast(Object o) { return (testCase14)o; } // ---( server methods )--- public static final void testCaseSetUp (IData pipeline) throws ServiceException { // --- <<IS-START(testCaseSetUp)>> --- // @subtype unknown // @sigtype java 3.5 // [o] field:0:required testName // [o] field:0:required description // [o] object:0:required count // [o] object:0:required timeout // [o] field:1:required triggerNames // [o] field:0:required connectionAliasName // [o] field:0:required destinationName // [o] field:0:required repeat /* * Creating a Durable Dubscriber using consumer service */ String testName = "TestCase14"; String description = "Creating Durable Subscriber - Topics"; String connectionAliasName = "BrokerA_NT_T"; String destinationName = "Topic3"; //Shared State: true; Shared State Ordering: none] int count = 1; int timeout = 3000; // set test input IDataCursor ic = pipeline.getCursor(); IDataUtil.put(ic, "testName", testName); IDataUtil.put(ic, "description", description); IDataUtil.put(ic, "connectionAliasName", connectionAliasName); IDataUtil.put(ic, "destinationName", destinationName); IDataUtil.put(ic, "count", count); IDataUtil.put(ic, "repeat", String.valueOf(count - 1)); IDataUtil.put(ic, "timeout", timeout); // --- <<IS-END>> --- } }
[ "Administrator@VMSuiteCSI.eur.ad.sag" ]
Administrator@VMSuiteCSI.eur.ad.sag
56ea419c60273b988d9d8d1d22f9d8f935cc171c
6e6230286262392d5c60a21cd0a643af1a90e8e5
/src/main/java/com/usdj/jms/consumer/ConsumerMessageListener.java
5995464bc97a7f7bc46b454b3c12997a41824bc3
[]
no_license
usdj/jms-spring
3f180586c219a76fdb548bf71d61ea44816cd1dd
37a403ca05428357a066fdb29d75165c91e2e7bc
refs/heads/master
2020-06-21T15:38:02.081219
2019-07-18T07:05:11
2019-07-18T07:05:11
197,492,534
0
0
null
null
null
null
UTF-8
Java
false
false
577
java
package com.usdj.jms.consumer; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage; /** * @author gerrydeng * @date 2019-07-17 21:04 * @Description: */ public class ConsumerMessageListener implements MessageListener { @Override public void onMessage(Message message) { TextMessage textMessage = (TextMessage) message; try { System.out.println("Received:" + textMessage.getText()); } catch (JMSException e) { e.printStackTrace(); } } }
[ "denggerry@163.com" ]
denggerry@163.com
18f6083791e8be4cce3bf9c7d10308565ddea406
7ced6c0ed03f2f9345bbc06a09dbbcf5c8687619
/catering-basic-server/catering-marketing/catering-marketing-server/src/main/java/com/meiyuan/catering/marketing/dto/seckillevent/MarketingSeckillEventEditDTO.java
d0b05a0ec11bfd7850579f3636b8477aba7720c5
[]
no_license
haorq/food-word
c14d5752c6492aed4a6a1410f9e0352479460da0
18a71259d77b4d96261dab8ed51ca1f109ab5c2f
refs/heads/master
2023-01-01T12:19:48.967366
2020-10-26T07:32:25
2020-10-26T07:32:25
307,292,398
1
0
null
null
null
null
UTF-8
Java
false
false
1,450
java
package com.meiyuan.catering.marketing.dto.seckillevent; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.Date; /** * @author GongJunZheng * @date 2020/08/05 09:08 * @description 秒杀场次编辑DTO **/ @Data @ApiModel("秒杀场次编辑DTO") public class MarketingSeckillEventEditDTO { @ApiModelProperty(value = "场次主键ID", required = true) @NotNull(message = "场次主键ID不能为空") private Long id; /** * 场次开始时间 */ @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8") @ApiModelProperty(value = "场次开始时间,例如“11:00:00”", required = true) @NotNull(message = "场次开始时间不能为空") private Date beginTime; /** * 场次结束时间 */ @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8") @ApiModelProperty(value = "场次结束时间,例如“12:00:00”", required = true) @NotNull(message = "场次结束时间不能为空") private Date endTime; /** * 编辑人ID */ @JsonIgnore private Long updateBy; /** * 编辑时间 */ @JsonIgnore private LocalDateTime updateTime; }
[ "386234736" ]
386234736
020d076db0d0bcfdc761539507806b149e7c40bd
a9fe6f74972b613b6482a8096a9a2902b9e5800c
/RestClientLab6/src/test/java/rest/RestClientLab6ApplicationTests.java
f5fd60ac902f6eb93856956242abe106815aa33f
[]
no_license
rameshkumarkhatri/CS590-SoftwareArchitecture
616a99277c93199360bc3cdd44bcbe1801b64914
bda60f6638cb6b9b761c805243914d7f6d1e8705
refs/heads/master
2020-04-26T15:24:13.739764
2019-04-01T04:37:56
2019-04-01T04:37:56
173,645,996
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package rest; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class RestClientLab6ApplicationTests { @Test public void contextLoads() { } }
[ "r.khatri91@gmail.com" ]
r.khatri91@gmail.com