text
stringlengths
10
2.72M
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package lappa.smsbanking.IService.Impl; import com.douwe.generic.dao.DataAccessException; import java.util.List; import lappa.smsbanking.Entities.CompteParent; import lappa.smsbanking.IDao.ISmsCompte; import lappa.smsbanking.IDao.ICompteParent; import lappa.smsbanking.IService.IServiceCompteParent; import org.springframework.transaction.annotation.Transactional; /** * * @author lappa */ @Transactional public class IServiceCompteParentImpl implements IServiceCompteParent { private ISmsCompte iSmsCompte; private ICompteParent iCompteParent; public void save(CompteParent s) throws DataAccessException { iCompteParent.create(s); } public void delete(Long id) throws DataAccessException { CompteParent c = iCompteParent.findById(id); iCompteParent.delete(c); } public void update(CompteParent s) throws DataAccessException { iCompteParent.update(s); } public List<CompteParent> findAll() throws DataAccessException { return iCompteParent.findAll(); } public CompteParent findById(Long id) throws DataAccessException { return iCompteParent.findById(id); } public ISmsCompte getiSmsCompte() { return iSmsCompte; } public void setiSmsCompte(ISmsCompte iSmsCompte) { this.iSmsCompte = iSmsCompte; } public ICompteParent getiCompteParent() { return iCompteParent; } public void setiCompteParent(ICompteParent iCompteParent) { this.iCompteParent = iCompteParent; } @Override public CompteParent findByIdClient(String idClient) throws DataAccessException { return iCompteParent.findByIdClient(idClient); } }
package fr.iut_valence.tp_meteo.metier; import android.content.Context; import java.util.List; import fr.iut_valence.tp_meteo.SQLite.DAO.MesureDAO; import fr.iut_valence.tp_meteo.entity.Mesure; import fr.iut_valence.tp_meteo.entity.Station; /** * Created by Antony on 13/12/2015. */ public class MetierMesure { private final MesureDAO mesureDAO; public MetierMesure(Context context) { this.mesureDAO = new MesureDAO(context); } public void addMesure(String station, long quand, float temp1, float temp2, int pressure, float lux, float hygro, float windDir, float windSpeed){ mesureDAO.add(new Mesure(station, quand, temp1, temp2, pressure, lux, hygro, windDir, windSpeed)); } public List<Mesure> getLast(Station station){ return mesureDAO.getLast(station.getIdentifiant()); } public List<Mesure> getAll(Station station){ return mesureDAO.getByIdStation(station.getIdentifiant(), -1); } }
package com.kunsoftware.bean; import org.springframework.web.multipart.MultipartFile; public class GalleryRequestBean { private String type; private Integer productResourceId; private String productResourceName; private String title1; private String title2; private Integer orderValue; private String link; private Integer destination; private MultipartFile imageFile; private String enable; private String name; private String remark; public String getType() { return type; } public void setType(String type) { this.type = type; } public Integer getProductResourceId() { return productResourceId; } public void setProductResourceId(Integer productResourceId) { this.productResourceId = productResourceId; } public String getProductResourceName() { return productResourceName; } public void setProductResourceName(String productResourceName) { this.productResourceName = productResourceName; } public String getTitle1() { return title1; } public void setTitle1(String title1) { this.title1 = title1; } public String getTitle2() { return title2; } public void setTitle2(String title2) { this.title2 = title2; } public Integer getOrderValue() { return orderValue; } public void setOrderValue(Integer orderValue) { this.orderValue = orderValue; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } public Integer getDestination() { return destination; } public void setDestination(Integer destination) { this.destination = destination; } public MultipartFile getImageFile() { return imageFile; } public void setImageFile(MultipartFile imageFile) { this.imageFile = imageFile; } public String getEnable() { return enable; } public void setEnable(String enable) { this.enable = enable; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } }
package com.cz.android.cpp.sample.course.model; public class CustomClass { public int iVal; public double dVal; public char cVal; public boolean bVal; public OtherClass oVal; public String sVal; }
/** */ package sdo; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Organization</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link sdo.Organization#getOwner <em>Owner</em>}</li> * <li>{@link sdo.Organization#getOrganizationProperty <em>Organization Property</em>}</li> * <li>{@link sdo.Organization#getMembers <em>Members</em>}</li> * <li>{@link sdo.Organization#getId <em>Id</em>}</li> * <li>{@link sdo.Organization#getDependencyType <em>Dependency Type</em>}</li> * </ul> * * @see sdo.SdoPackage#getOrganization() * @model * @generated */ public interface Organization extends EObject { /** * Returns the value of the '<em><b>Owner</b></em>' reference list. * The list contents are of type {@link sdo.SDOSystemElement}. * It is bidirectional and its opposite is '{@link sdo.SDOSystemElement#getOwnedOrganizations <em>Owned Organizations</em>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Owner</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Owner</em>' reference list. * @see sdo.SdoPackage#getOrganization_Owner() * @see sdo.SDOSystemElement#getOwnedOrganizations * @model opposite="ownedOrganizations" required="true" * @generated */ EList<SDOSystemElement> getOwner(); /** * Returns the value of the '<em><b>Organization Property</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Organization Property</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Organization Property</em>' containment reference. * @see #setOrganizationProperty(OrganizationProperty) * @see sdo.SdoPackage#getOrganization_OrganizationProperty() * @model containment="true" * @generated */ OrganizationProperty getOrganizationProperty(); /** * Sets the value of the '{@link sdo.Organization#getOrganizationProperty <em>Organization Property</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Organization Property</em>' containment reference. * @see #getOrganizationProperty() * @generated */ void setOrganizationProperty(OrganizationProperty value); /** * Returns the value of the '<em><b>Members</b></em>' reference list. * The list contents are of type {@link sdo.SDO}. * It is bidirectional and its opposite is '{@link sdo.SDO#getOrganizations <em>Organizations</em>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Members</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Members</em>' reference list. * @see sdo.SdoPackage#getOrganization_Members() * @see sdo.SDO#getOrganizations * @model opposite="organizations" required="true" * @generated */ EList<SDO> getMembers(); /** * Returns the value of the '<em><b>Id</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Id</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Id</em>' containment reference. * @see #setId(UniqueIdentifier) * @see sdo.SdoPackage#getOrganization_Id() * @model containment="true" required="true" * @generated */ UniqueIdentifier getId(); /** * Sets the value of the '{@link sdo.Organization#getId <em>Id</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Id</em>' containment reference. * @see #getId() * @generated */ void setId(UniqueIdentifier value); /** * Returns the value of the '<em><b>Dependency Type</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Dependency Type</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Dependency Type</em>' containment reference. * @see #setDependencyType(DependencyType) * @see sdo.SdoPackage#getOrganization_DependencyType() * @model containment="true" * @generated */ DependencyType getDependencyType(); /** * Sets the value of the '{@link sdo.Organization#getDependencyType <em>Dependency Type</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Dependency Type</em>' containment reference. * @see #getDependencyType() * @generated */ void setDependencyType(DependencyType value); } // Organization
package com.hanbit.gms.constant; public class DB { public static final String ORACLE_DRIVER ="oracle.jdbc.driver.OracleDriver"; public static final String ORACLE_URL ="jdbc:oracle:thin:@localhost:1521:xe"; public static final String MYSQL_DRIVER =""; public static final String MYSQL_URL =""; public static final String MSSQL_DRIVER =""; public static final String MSSQL_URL =""; public static final String MARIADB_DRIVER =""; public static final String MARIADB_URL =""; public static final String DB2_DRIVER =""; public static final String DB2_URL =""; public static final String USERNAME ="hanbit"; public static final String PASSWORD ="hanbit"; public static final String TABLE_MEMBER="Member"; public static final String TABLE_BOARD="Board"; public static final String MEMBER_ID="id"; public static final String MEMBER_NAME="name"; public static final String MEMBER_PASS="pw"; public static final String MEMBER_SSN="ssn"; public static final String MEMBER_REGDATE="regdate"; public static final String BOARD_SEQ="article_seq"; public static final String BOARD_ID="id"; public static final String BOARD_TITLE="title"; public static final String BOARD_CONTENT="content"; public static final String BOARD_REGDATE="regdate"; public static final String BOARD_HITCNT="hitcount"; }
package com.tencent.mm.plugin.emoji.a.a; import com.tencent.mm.protocal.c.ts; public final class e { public static boolean a(ts tsVar) { if (tsVar == null) { return false; } return cs(tsVar.rwV, 1); } public static boolean b(ts tsVar) { if (!(tsVar == null ? false : cs(tsVar.rwU, 4))) { if (!(tsVar == null ? false : cs(tsVar.rwU, 8))) { return false; } } return true; } public static boolean oK(int i) { return cs(i, 4) || cs(i, 8); } public static boolean cs(int i, int i2) { return (i & i2) == i2; } }
package com.example.nicolas.spotifyshare; import android.app.IntentService; import android.content.Intent; import android.util.Log; import com.google.gson.Gson; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; /** * Created by Nicolas on 10/1/2016. */ public class WIFIDirectConnectionService extends IntentService { public WIFIDirectConnectionService() { super("WIFIDirectConnectionService"); } @Override protected void onHandleIntent(Intent intent) { ServerSocket serverSocket; Socket client; while(true) { try { serverSocket = new ServerSocket(64222); serverSocket.toString(); client = serverSocket.accept(); PrintWriter out = new PrintWriter(client.getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream())); // String packageName = in.readLine().trim(); // if (!packageName.equals(getPackageName())) { // out.close(); // in.close(); // client.close(); // serverSocket.close(); // continue; // } User user = SpotemApplication.getInstance(this).getUser(); User user2 = SpotemApplication.getInstance(this).loadUser(this); String jUser = new Gson().toJson(SpotemApplication.getInstance(this).getUser()) + "\n"; out.write(jUser); out.close(); in.close(); client.close(); serverSocket.close(); } catch (IOException e) { Log.d(this.getClass().toString(), e.getMessage()); } } } }
package com.training.ykb.payment.rest; import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.training.ykb.payment.model.PaymentRequest; @RestController @RequestMapping("/payment") public class PaymentRest { @Value("${server.port}") private int port; @PostMapping("/charge") public String charge(@Validated @RequestBody final PaymentRequest pr) { System.out.println("" + pr); return "OK-" + this.port; } }
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.inftel.scrum.model; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import java.util.List; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; /** * * @author Fernando */ @Entity @Table(name = "USUARIO") @XmlRootElement @NamedQueries({ @NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u"), @NamedQuery(name = "Usuario.findById", query = "SELECT u FROM Usuario u WHERE u.id = :id"), @NamedQuery(name = "Usuario.findByNombre", query = "SELECT u FROM Usuario u WHERE u.nombre = :nombre"), @NamedQuery(name = "Usuario.findByApellidos", query = "SELECT u FROM Usuario u WHERE u.apellidos = :apellidos"), @NamedQuery(name = "Usuario.findByEmail", query = "SELECT u FROM Usuario u WHERE u.email = :email"), @NamedQuery(name = "Usuario.findByFechanac", query = "SELECT u FROM Usuario u WHERE u.fechanac = :fechanac"), @NamedQuery(name = "Usuario.findByPassword", query = "SELECT u FROM Usuario u WHERE u.password = :password"), @NamedQuery(name = "Usuario.findByRol", query = "SELECT u FROM Usuario u WHERE u.rol = :rol"), @NamedQuery(name = "Usuario.findByLoggedin", query = "SELECT u FROM Usuario u WHERE u.loggedin = :loggedin")}) public class Usuario implements Serializable { private static final long serialVersionUID = 1L; // @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation @Id @Basic(optional = false) @NotNull @Column(name = "ID") private BigDecimal id; @Size(max = 50) @Column(name = "NOMBRE") private String nombre; @Size(max = 100) @Column(name = "APELLIDOS") private String apellidos; // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Correo electrónico no válido")//if the field contains email address consider using this annotation to enforce field validation @Size(max = 50) @Column(name = "EMAIL") private String email; @Column(name = "FECHANAC") @Temporal(TemporalType.TIMESTAMP) private Date fechanac; @Size(max = 50) @Column(name = "PASSWORD") private String password; @Size(max = 20) @Column(name = "ROL") private String rol; @Basic(optional = false) @NotNull @Column(name = "LOGGEDIN") private char loggedin; @OneToMany(cascade = CascadeType.ALL, mappedBy = "usuario",fetch= FetchType.EAGER) private List<Historico> historicoList; @OneToMany(mappedBy = "usuarioId",fetch= FetchType.EAGER) private List<Tarea> tareaList; @JoinColumn(name = "GRUPO_ID", referencedColumnName = "ID") @ManyToOne (fetch= FetchType.EAGER) private Grupo grupoId; @OneToMany(mappedBy = "usuarioId") private List<Log> logList; @OneToMany(cascade = CascadeType.ALL, mappedBy = "origen",fetch= FetchType.EAGER) private List<Mensajes> mensajesList; @OneToMany(cascade = CascadeType.ALL, mappedBy = "destino",fetch= FetchType.EAGER) private List<Mensajes> mensajesList1; public Usuario() { } public Usuario(BigDecimal id) { this.id = id; } public Usuario(BigDecimal id, char loggedin) { this.id = id; this.loggedin = loggedin; } public BigDecimal getId() { return id; } public void setId(BigDecimal id) { this.id = id; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getApellidos() { return apellidos; } public void setApellidos(String apellidos) { this.apellidos = apellidos; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Date getFechanac() { return fechanac; } public void setFechanac(Date fechanac) { this.fechanac = fechanac; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getRol() { return rol; } public void setRol(String rol) { this.rol = rol; } public char getLoggedin() { return loggedin; } public void setLoggedin(char loggedin) { this.loggedin = loggedin; } @XmlTransient public List<Historico> getHistoricoList() { return historicoList; } public void setHistoricoList(List<Historico> historicoList) { this.historicoList = historicoList; } @XmlTransient public List<Tarea> getTareaList() { return tareaList; } public void setTareaList(List<Tarea> tareaList) { this.tareaList = tareaList; } public Grupo getGrupoId() { return grupoId; } public void setGrupoId(Grupo grupoId) { this.grupoId = grupoId; } @XmlTransient public List<Log> getLogList() { return logList; } public void setLogList(List<Log> logList) { this.logList = logList; } @XmlTransient public List<Mensajes> getMensajesList() { return mensajesList; } public void setMensajesList(List<Mensajes> mensajesList) { this.mensajesList = mensajesList; } @XmlTransient public List<Mensajes> getMensajesList1() { return mensajesList1; } public void setMensajesList1(List<Mensajes> mensajesList1) { this.mensajesList1 = mensajesList1; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Usuario)) { return false; } Usuario other = (Usuario) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } @Override public String toString() { return "org.inftel.scrum.model.Usuario[ id=" + id + " ]"; } }
package com.demo.book.service; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; /** * TODO * * @author zlkong * @date 2017年10月24日 下午4:30:44 * */ @FeignClient(value = "BOOK") public interface BookFeignService { @GetMapping("/books") String listBooks(); }
package com.vaibhavdhunde.android.notes; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.app.LoaderManager; import android.content.ContentValues; import android.content.CursorLoader; import android.content.DialogInterface; import android.content.Intent; import android.content.Loader; import android.database.Cursor; import android.graphics.Typeface; import android.net.Uri; import android.support.annotation.NonNull; import android.support.design.widget.BottomNavigationView; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.widget.EditText; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.Toast; import com.vaibhavdhunde.android.notes.adapter.ColorAdapter; import com.vaibhavdhunde.android.notes.data.NoteContract.NoteEntry; import com.vaibhavdhunde.android.notes.util.RecyclerTouchListener; import butterknife.BindView; import butterknife.ButterKnife; @SuppressLint("ClickableViewAccessibility") public class EditorActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<Cursor> { private static final int CURRENT_NOTE_LOADER_ID = 1; private static final String KEY_HAS_NOTE_CHANGED = "key_has_note_changed"; private static final String KEY_NOTE_COLOR = "key_note_color"; @BindView(R.id.note_editor_container) FrameLayout mNoteEditorContainer; @BindView(R.id.input_title) EditText mInputTitle; @BindView(R.id.input_note) EditText mInputNote; private String mTitle; private String mNote; private int mColor = 0; private Uri mCurrentNoteUri; private boolean mHasNoteChanged = false; private View.OnTouchListener mOnTouchListener = new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { mHasNoteChanged = true; return false; } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_editor); ButterKnife.bind(this); setTitleColor(R.color.secondary_text); Intent notesIntent = getIntent(); mCurrentNoteUri = notesIntent.getData(); if (savedInstanceState != null && savedInstanceState.containsKey(KEY_HAS_NOTE_CHANGED)) { mHasNoteChanged = savedInstanceState.getBoolean(KEY_HAS_NOTE_CHANGED); } if (savedInstanceState != null && savedInstanceState.containsKey(KEY_NOTE_COLOR)) { mColor = savedInstanceState.getInt(KEY_NOTE_COLOR); if (mCurrentNoteUri == null) { changeNoteTheme(); } } if (mCurrentNoteUri != null) { setTitle(R.string.label_edit_note); getLoaderManager().initLoader(CURRENT_NOTE_LOADER_ID, null, this); } else { setTitle(R.string.label_add_new_note); invalidateOptionsMenu(); } applyTypeface(); mInputTitle.setOnTouchListener(mOnTouchListener); mInputNote.setOnTouchListener(mOnTouchListener); BottomNavigationView bottomNav = findViewById(R.id.bottom_nav); bottomNav.setOnNavigationItemSelectedListener( new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { final int id = menuItem.getItemId(); switch (id) { case R.id.action_more: mHasNoteChanged = true; showColorPickerDialog(); break; case R.id.action_send: sendNote(); break; } return true; } }); } private void applyTypeface() { Typeface typefaceRobotoSlab = Typeface.createFromAsset( getAssets(), getString(R.string.typeface_roboto_slab) ); mInputNote.setTypeface(typefaceRobotoSlab); } private void changeNoteTheme() { mNoteEditorContainer.setBackgroundColor(mColor); int[] noteColors = getResources().getIntArray(R.array.note_colors); int[] hintColors = getResources().getIntArray(R.array.note_hint_colors); int hintColor = 0; for (int i = 0; i < noteColors.length; i++) { if (mColor == noteColors[i]) { hintColor = hintColors[i]; break; } } mInputTitle.setHintTextColor(hintColor); mInputNote.setHintTextColor(hintColor); } private void sendNote() { if (isNoteValidTitle()) { return; } if (isNotValidNote()) { return; } String title = "Title:\n" + mTitle; String note = "Note:\n\n" + mNote; String message = title + "\n\n" + note; Intent sendNoteIntent = new Intent(Intent.ACTION_SEND); sendNoteIntent.putExtra(Intent.EXTRA_TEXT, message); sendNoteIntent.setType(getString(R.string.note_mime_type)); if (sendNoteIntent.resolveActivity(getPackageManager()) != null) { startActivity(Intent.createChooser(sendNoteIntent, getString(R.string.intent_label_send_note))); } } @Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (mCurrentNoteUri == null) { MenuItem delete = menu.findItem(R.id.action_delete); delete.setVisible(false); } return true; } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.note_editor, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { final int id = item.getItemId(); switch (id) { case android.R.id.home: { if (mHasNoteChanged) { showSaveChangesDialog(); } else { finish(); } return true; } case R.id.action_save: saveNote(); return true; case R.id.action_delete: { deleteNote(); return true; } default: return super.onOptionsItemSelected(item); } } private void saveNote() { if (isNoteValidTitle()) { return; } if (isNotValidNote()) { return; } ContentValues values = new ContentValues(); values.put(NoteEntry.COLUMN_TITLE, mTitle); values.put(NoteEntry.COLUMN_NOTE, mNote); values.put(NoteEntry.COLUMN_COLOR, mColor); Uri newNoteUri = null; int numNotesUpdated = 0; if (mCurrentNoteUri != null) { numNotesUpdated = getContentResolver().update( mCurrentNoteUri, values, null, null ); } else { newNoteUri = getContentResolver().insert(NoteEntry.CONTENT_URI, values); } if (newNoteUri != null || numNotesUpdated != 0) { Toast.makeText(this, R.string.success_save_note, Toast.LENGTH_SHORT).show(); finish(); } else { Toast.makeText(this, R.string.error_save_note, Toast.LENGTH_SHORT).show(); } } private boolean isNoteValidTitle() { mTitle = mInputTitle.getText().toString().trim(); if (TextUtils.isEmpty(mTitle)) { Toast.makeText(this, R.string.error_empty_title, Toast.LENGTH_SHORT).show(); return true; } else { return false; } } private boolean isNotValidNote() { mNote = mInputNote.getText().toString().trim(); if (TextUtils.isEmpty(mNote)) { Toast.makeText(this, R.string.error_empty_note, Toast.LENGTH_SHORT).show(); return true; } else { return false; } } private void deleteNote() { int numNotesDeleted = getContentResolver().delete( mCurrentNoteUri, null, null ); if (numNotesDeleted != 0) { Toast.makeText(this, R.string.success_del_note, Toast.LENGTH_SHORT).show(); finish(); } else { Toast.makeText(this, R.string.error_del_note, Toast.LENGTH_SHORT).show(); } } @Override public void onBackPressed() { if (mHasNoteChanged) { showSaveChangesDialog(); } else { super.onBackPressed(); } } private void showSaveChangesDialog() { AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setMessage(R.string.dialog_msg_save_changes); dialog.setNegativeButton(R.string.action_keep_editing, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int i) { if (dialog != null) { dialog.dismiss(); } } }); dialog.setPositiveButton(R.string.action_discard, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { finish(); } }); dialog.show(); } private void showColorPickerDialog() { final AlertDialog.Builder dialog = new AlertDialog.Builder(this); View colorView = LayoutInflater.from(mNoteEditorContainer.getContext()) .inflate(R.layout.list_color_picker, mNoteEditorContainer, false); RecyclerView listColors = colorView.findViewById(R.id.list_colors); listColors.setHasFixedSize(true); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager( this, LinearLayout.HORIZONTAL, false ); listColors.setLayoutManager(layoutManager); int[] colors = getResources().getIntArray(R.array.note_colors); final ColorAdapter colorAdapter = new ColorAdapter(colors); listColors.setAdapter(colorAdapter); listColors.addOnItemTouchListener(new RecyclerTouchListener( this, listColors, new RecyclerTouchListener.OnClickListener() { @Override public void OnClick(int position) { mColor = colorAdapter.getColors()[position]; changeNoteTheme(); } @Override public void OnLongClick(int position) { } })); dialog.setView(colorView); dialog.setTitle(R.string.dialog_title_pick_a_color); dialog.setNeutralButton(R.string.action_set_color, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { if (dialogInterface != null) { dialogInterface.dismiss(); } } }); dialog.show(); } @Override protected void onSaveInstanceState(Bundle outState) { outState.putBoolean(KEY_HAS_NOTE_CHANGED, mHasNoteChanged); if (mColor != 0) { outState.putInt(KEY_NOTE_COLOR, mColor); } super.onSaveInstanceState(outState); } @Override public Loader<Cursor> onCreateLoader(int loaderId, Bundle bundle) { switch (loaderId) { case CURRENT_NOTE_LOADER_ID: { String[] projection = { NoteEntry._ID, NoteEntry.COLUMN_TITLE, NoteEntry.COLUMN_NOTE, NoteEntry.COLUMN_COLOR }; return new CursorLoader( this, mCurrentNoteUri, projection, null, null, null ); } default: return null; } } @Override public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) { loadNote(cursor); } private void loadNote(Cursor cursor) { if (cursor != null && cursor.getCount() > 0) { if (cursor.moveToFirst()) { int columnIndexTitle = cursor.getColumnIndex(NoteEntry.COLUMN_TITLE); int columnIndexNote = cursor.getColumnIndex(NoteEntry.COLUMN_NOTE); int columnIndexColor = cursor.getColumnIndex(NoteEntry.COLUMN_COLOR); String title = cursor.getString(columnIndexTitle); mInputTitle.setText(title); String note = cursor.getString(columnIndexNote); mInputNote.setText(note); if (mColor == 0) { mColor = cursor.getInt(columnIndexColor); } changeNoteTheme(); } } } @Override public void onLoaderReset(Loader<Cursor> loader) { } }
package user; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; public class UserDAO { private Connection conn; private PreparedStatement pstmt; String dbURL = "jdbc:mysql://192.168.219.119:3306/album"; String dbDriver = "com.mysql.jdbc.Driver"; public void connect() { try { String dbID = "album"; String dbPassword = "heavensdoor"; Class.forName(dbDriver); conn = DriverManager.getConnection(dbURL, dbID, dbPassword); } catch (Exception e) { e.printStackTrace(); } } public void disconnect() { if(pstmt != null) { try { pstmt.close(); } catch (Exception e) { e.printStackTrace(); } } if(conn != null) { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } } } public ArrayList<User> showing() { connect(); ArrayList<User> list = new ArrayList<User>(); String sql = "select * from albumtbl"; try { pstmt = conn.prepareStatement(sql); ResultSet rs = pstmt.executeQuery(); while(rs.next()) { User user = new User(); user.setReleased(rs.getString("released")); user.setTitle(rs.getString("title")); user.setArtist(rs.getString("artist")); user.setBelong(rs.getString("belong")); list.add(user); } rs.close(); } catch (Exception e) { e.printStackTrace(); } finally { disconnect(); } return list; } }
package ru.itis.springboot.dto; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** * created: 18-04-2021 - 20:15 * project: SpringBoot * * @author dinar * @version v0.1 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class TokenPairDto { private String accessToken; private String refreshToken; }
/** * OpenKM, Open Document Management System (http://www.openkm.com) * Copyright (c) 2006-2015 Paco Avila & Josep Llort * * No bytes were intentionally harmed during the development of this application. * * 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 2 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, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package com.openkm.util; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Writer; import java.net.URL; import java.net.URLConnection; import java.net.URLDecoder; import java.net.URLEncoder; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import javax.swing.text.AttributeSet; import javax.swing.text.html.HTML; import javax.swing.text.html.HTMLDocument; import javax.swing.text.html.HTMLEditorKit; import org.apache.jackrabbit.util.Text; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api.OKMDocument; import com.openkm.api.OKMFolder; import com.openkm.api.OKMRepository; import com.openkm.bean.Document; import com.openkm.bean.Folder; public class Populate { private static Logger log = LoggerFactory.getLogger(Populate.class); public static final List<String> DEFAULT_TYPES = Arrays.asList(new String[] { "pdf", "rtf", "doc", "ppt", "xls" }); public static void massiveImport(final String token, final String seedWord, final int numDocs, final List<String> fileTypes, Writer out) throws Exception { final OKMRepository okmRepository = OKMRepository.getInstance(); final OKMDocument okmDocument = OKMDocument.getInstance(); final OKMFolder okmFolder = OKMFolder.getInstance(); int n = 0; for (int typeIdx = 0; typeIdx < fileTypes.size(); typeIdx++) { String type = (String) fileTypes.get(typeIdx); int offset = 0; while (n < numDocs * (typeIdx + 1) / fileTypes.size()) { final URL[] urls = new Populate.Search(type, seedWord, offset).getURLs(); if (urls.length == 0) { break; } for (int i = 0; i < urls.length; i++) { final URL currentURL = urls[i]; String urlPath = currentURL.getPath(); if (urlPath.startsWith("/")) { urlPath = urlPath.substring(1); } final String host = urls[i].getHost(); List<String> folderNames = new ArrayList<String>(); folderNames.addAll(Arrays.asList(host.split("\\."))); Collections.reverse(folderNames); folderNames.addAll(Arrays.asList(urlPath.split("/", 0))); final String fileName = URLDecoder.decode((String) folderNames.remove(folderNames.size() - 1), "UTF-8") .replaceAll(":", "_"); String path = okmRepository.getRootFolder(null).getPath(); for (Iterator<String> fn = folderNames.iterator(); fn.hasNext();) { String name = URLDecoder.decode((String) fn.next(), "UTF-8"); name = name.replaceAll(":", "_"); if (name.length() == 0) { continue; } path = path + "/" + name; if (!okmRepository.hasNode(null, path)) { // log.info("Create folder: {}", path); Folder fld = new Folder(); fld.setPath(path); okmFolder.create(null, fld); } } path = path + "/" + fileName; if (!okmRepository.hasNode(null, path)) { final Writer fOut = out; final String docPath = path; final Exception[] ex = new Exception[1]; final int nDoc = n; Thread t = new Thread(new Runnable() { public void run() { try { // String info = fileName + " (" + host + ")"; URLConnection con = currentURL.openConnection(); InputStream in = con.getInputStream(); try { synchronized (fOut) { fOut.write("<tr class=\"" + (nDoc % 2 == 0 ? "odd" : "even") + "\">"); fOut.write("<td>" + nDoc + "</td>"); fOut.write("<td>" + Text.encodeIllegalXMLCharacters(currentURL.toString()) + "</td>"); fOut.flush(); } int length = con.getContentLength(); if (length != -1) { // in = new ProgressInputStream(in, // length, info, "dp", fOut); } log.info("Create document: {}", docPath); Document doc = new Document(); doc.setPath(docPath); okmDocument.create(null, doc, in); } finally { in.close(); } } catch (Exception e) { ex[0] = e; } } }); t.start(); for (int s = 0; t.isAlive(); s++) { Thread.sleep(100); if (s % 10 == 0) { synchronized (fOut) { fOut.write("pb.inform(" + n + ", '')"); fOut.flush(); } } } if (ex[0] == null) { n++; synchronized (fOut) { fOut.write("<td>Ok</td></tr>"); fOut.flush(); } if (n >= numDocs * (typeIdx + 1) / fileTypes.size()) { break; } } else { fOut.write("<td>Error</td></tr>"); fOut.flush(); } } } offset += 10; } } } static class Search { private final String filetype; private final String term; private final int start; public Search(String filetype, String term, int start) { this.filetype = filetype; this.term = term; this.start = start; } public URL[] getURLs() throws Exception { List<URL> urls = new ArrayList<URL>(); String query = term + " filetype:" + filetype; URL google = new URL("http://www.google.com/search?q=" + URLEncoder.encode(query, "UTF-8") + "&start=" + start); URLConnection con = google.openConnection(); con.setRequestProperty("User-Agent", ""); InputStream in = con.getInputStream(); try { HTMLEditorKit kit = new HTMLEditorKit(); HTMLDocument doc = new HTMLDocument(); doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE); kit.read(new InputStreamReader(in, "UTF-8"), doc, 0); HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A); while (it.isValid()) { AttributeSet attr = it.getAttributes(); if (attr != null) { String href = (String) attr.getAttribute(HTML.Attribute.HREF); if (href != null && href.endsWith("." + filetype)) { URL url = new URL(new URL("http", "www.google.com", "dummy"), href); if (url.getHost().indexOf("google") == -1) { urls.add(url); } } } it.next(); } } finally { in.close(); } return (URL[]) urls.toArray(new URL[urls.size()]); } } }
class Student8 extends Person8{ Student8(String name, int age){ this.name = name; this.age = age; } public void eat(String food){ System.out.println(food+"¸¦ ¸Ô´Ù."); } }
package cq._09_Collections.Map.HashTable; import java.util.Hashtable; import org.junit.Test; public class TestHashTable { @Test public void testHashTable() { Hashtable<String, Object> hashtable = new Hashtable<String, Object>(); hashtable.put("a", "aa"); hashtable.put("b", "bb"); System.out.println(hashtable); } }
package com.imooc.VO; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; /** * http返回的最外层对象 * @author 宋德能 * @data 2019-12-01 18:22:19 */ @Data public class ResultVO<T> { /** 错误码code */ private Integer code; /** 提示信息 */ private String msg; /** 具体内容 */ private T data; }
package com.example; /** * Created by shivam on 27/02/16. */ public class LoginPresenter implements ILoginPresenter { private IAfterLoginActions loginView; private LoginInteractor loginInteractor; public LoginPresenter(IAfterLoginActions loginView){ this.loginView = loginView; loginInteractor = new LoginInteractor(this); } @Override public void success(String greetMessage) { loginView.showNextScreen(greetMessage); } @Override public void failed(String reason) { loginView.showFailedScreen(reason); } public void doLoginProcedure(String email, String password) { loginInteractor.checkLogin(email, password); } }
package org.iptc.extra.core.types.document; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; public class TextField extends DocumentField { protected String value; public TextField() { } public TextField(String value) { this.value = value; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public JsonElement toJson() { return new JsonPrimitive(value); } public String toString() { return value; } }
package platform; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.WindowEvent; import java.util.Observable; import java.util.Observer; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import environment.Environment; /** User interface * * @author simon * */ public class UserInterfaceFrame extends JFrame implements Observer, ActionListener, KeyListener{ private static final long serialVersionUID = 1L; public String version="Version1"; public Main main; private final JLabel m_statusBar = new JLabel(); private JButton m_save = new JButton("Save"); private JButton m_run = new JButton("Play"); private JButton m_stop = new JButton("Pause"); private JButton m_reset = new JButton("Reset"); private JButton m_clear = new JButton("Clear"); // clear traces private JButton m_arun = new JButton("Play agent"); // play selected agent private JButton m_astop = new JButton("Pause Agent"); // pause selected agent public UserInterfaceFrame(Main m){ main=m; this.setTitle("Interface"); this.setSize(900, 70); this.setLocationRelativeTo(null); this.setVisible(true); m_stop.addActionListener(this); m_run.addActionListener(this); m_reset.addActionListener(this); JPanel buttonPanel = new JPanel(); buttonPanel.addKeyListener(this); buttonPanel.add(m_save); buttonPanel.add(m_arun); buttonPanel.add(m_astop); buttonPanel.add(m_reset); buttonPanel.add(m_clear); buttonPanel.add(m_run); buttonPanel.add(m_stop); setEnableButton(); m_save.addActionListener(this); m_stop.addActionListener(this); m_run.addActionListener(this); m_reset.addActionListener(this); m_clear.addActionListener(this); m_astop.addActionListener(this); m_arun.addActionListener(this); JPanel statusPanel = new JPanel(new BorderLayout()); statusPanel.add(m_statusBar, BorderLayout.CENTER); statusPanel.add(buttonPanel, BorderLayout.EAST); statusPanel.setBorder(BorderFactory.createRaisedBevelBorder()); getContentPane().add(statusPanel, BorderLayout.SOUTH); m_statusBar.setText("Ready."); m_statusBar.setPreferredSize(new Dimension(200, m_statusBar.getHeight())); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(WindowEvent winEvt) { main.getAgent(0).communication.close(); main.stop(); System.exit(0); } }); } @Override public void keyPressed(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void keyReleased(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void keyTyped(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void actionPerformed(ActionEvent e) { // Run agents ****** if (e.getSource() == m_run){ for (int i=0;i<main.nbAgent();i++){ main.selectAgent(i).startAgent(); } } // Stops agents ***** else if (e.getSource() == m_stop){ for (int i=0;i<main.nbAgent();i++){ main.selectAgent(i).stopAgent(); } } // save agent ***** if (e.getSource() == m_save){ main.selectAgent(main.getAgentIndex()).save(); main.getEnv().save(); } // Run selected agent ****** if (e.getSource() == m_arun){ main.selectAgent(main.getAgentIndex()).startAgent(); } // Stop selected agent ***** else if (e.getSource() == m_astop){ main.selectAgent(main.getAgentIndex()).stopAgent(); } // Reset the board ****** else if (e.getSource() == m_reset){ try{ main.resetAgentList(); main.getEnv().setIndex(0); main.getEnv().init(Environment.DEFAULT_BOARD); if (main.nbAgent()>0){ main.getAgent(0).setDisplay(); } } catch (Exception ex){ } } // clear agent trace else if (e.getSource() == m_clear){ main.selectAgent(main.getAgentIndex()).clearTrace(); } setEnableButton(); } @Override public void update(Observable arg0, Object arg1) { // TODO Auto-generated method stub } public void setEnableButton(){ m_stop.setEnabled(!main.isStopped()); m_run.setEnabled(!main.isStarted()); m_reset.setEnabled(true); m_arun.setEnabled(main.isStopped(main.getAgentIndex())); m_astop.setEnabled(main.isStarted(main.getAgentIndex())); } }
package com.yoeki.kalpnay.hrporatal.Profile; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.yoeki.kalpnay.hrporatal.Profile.Model.user_info.BasicUserInfo; import com.yoeki.kalpnay.hrporatal.Profile.Model.user_info.User; import com.yoeki.kalpnay.hrporatal.R; import com.yoeki.kalpnay.hrporatal.setting.Textclass; import java.util.ArrayList; public class Personal_Info extends Fragment { private static Personal_Info personal_instance; Textclass personal_number,code,designation,title,name,gender,martial_stat,dob,ssn; ArrayList<User> mlist; public static Personal_Info newInstance() { Personal_Info fragment = new Personal_Info(); return fragment; } public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { personal_number=(Textclass) getView().findViewById(R.id.personal_number); code=(Textclass)getView().findViewById(R.id.code); designation=(Textclass)getView().findViewById(R.id.designation); title=(Textclass)getView().findViewById(R.id.title); name=(Textclass)getView().findViewById(R.id.name); gender=(Textclass)getView().findViewById(R.id.gender); martial_stat = (Textclass)getView().findViewById(R.id.martial_stat); dob = (Textclass)getView().findViewById(R.id.dob); ssn = (Textclass)getView().findViewById(R.id.ssn); for (final User list : mlist) { for(BasicUserInfo basicUserInfo : list.basicUserInfo) { personal_number.setText(basicUserInfo.getPesonalNumber()); code.setText(basicUserInfo.getCode()); designation.setText(basicUserInfo.getDesignation()); title.setText(basicUserInfo.getTitle()); name.setText(basicUserInfo.getUserName()); gender.setText(basicUserInfo.getGender()); martial_stat.setText(basicUserInfo.getMartialStatus()); dob.setText(basicUserInfo.getDOB()); ssn.setText(basicUserInfo.getStartingDate()); } } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view=inflater.inflate(R.layout.personal__info, container, false); Bundle args = getArguments(); mlist = (ArrayList<User>) getArguments().getSerializable("keyForProfile"); personal_instance=this; return view; } }
package com.root.mssm.ui.specification.discription; import androidx.lifecycle.ViewModel; public class DiscriptionViewModel extends ViewModel { // TODO: Implement the ViewModel }
package com.company; public class Main { public static void main(String[] args) { // write your code here } public static int myMultiply(int firstNum, int secondNum){ return firstNum*secondNum; } }
package com.cb.project.constants; /** * @author user * */ public interface IAccountConstants { public interface Messages { /** * RESSOURCE_NOT_EXISTS */ String RESSOURCE_NOT_EXISTS = "The account does not exist"; /** * RESSOURCE_NOT_EXISTS */ String ACCOUNT_USER_NOT_EXISTS = "The account does not have a correct involved user"; /** * MISSING_ATTRIBUTES */ String MISSING_ATTRIBUTES = "Missing attribute for the account"; /** * INSUFFICIENT_BALANCE */ String INSUFFICIENT_BALANCE = "Insufficient account balance"; /** * POSITIVE_NUMBER */ String POSITIVE_NUMBER = "Number must be positive"; } /** * @author user * */ public interface Codes { /** * MISSING_ATTRIBUTES */ String MISSING_ATTRIBUTES = "0101"; /** * MISSING_ATTRIBUTES */ String POSITIVE_NUMBER = "0102"; /** * RESSOURCE_NOT_EXISTS */ String RESSOURCE_NOT_EXISTS = "0201"; /** * ACCOUNT_USER_NOT_EXISTS */ String ACCOUNT_USER_NOT_EXISTS = "0202"; /** * INSUFFICIENT_BALANCE */ String INSUFFICIENT_BALANCE = "0203"; } }
package com.tiandi.logistics.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.tiandi.logistics.entity.pojo.RevenueSharing; /** * <p> * 收入分成参照表 Mapper 接口 * </p> * * @author TP * @since 2020-11-25 */ public interface RevenueSharingMapper extends BaseMapper<RevenueSharing> { }
package com.tt.miniapp.database.usagerecord; public class UsageRecordInfo { public String appID; public Long duration; public String scene; public Long startTime; public String subScene; } /* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapp\databas\\usagerecord\UsageRecordInfo.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
package Hub; import java.awt.Rectangle; import java.util.ArrayList; import processing.core.PApplet; import processing.core.PImage; /** * represents layout of entire campus that shows player's current location * @author Emily * */ public class Map { private ArrayList<Rectangle> rooms; private ArrayList<Classroom> campus; private Classroom current; private PImage map; private ArrayList<PImage> cursor; private int dir; /** * * @param map picture of entire map * @param cursor picture symbol for player's location * @param campus list of existing rooms */ public Map(PImage map, ArrayList<PImage> cursor, ArrayList<Classroom> campus) { rooms = new ArrayList<Rectangle>(); rooms.add(new Rectangle(191,264,96,96)); rooms.add(new Rectangle(191,164,96,96)); rooms.add(new Rectangle(101,289,86,86)); rooms.add(new Rectangle(291,289,86,86)); rooms.add(new Rectangle(116,214,71,71)); rooms.add(new Rectangle(116,139,71,71)); rooms.add(new Rectangle(203,89,71,71)); rooms.add(new Rectangle(291,139,71,71)); rooms.add(new Rectangle(291,214,71,71)); this.map = map; this.cursor = cursor; this.campus = campus; dir=0; } /** * draws a map that overlays game window and locates the player * @param drawer interface that draws the map */ public void display(GameWindow drawer) { drawer.pushStyle(); drawer.fill(100, 200); drawer.noStroke(); drawer.rect(0, 0, drawer.DRAWING_WIDTH, drawer.DRAWING_HEIGHT); drawer.image(map, 0, 0); String tag = null; for(Rectangle r : rooms) { if(r.contains(drawer.mouseX, drawer.mouseY)) { for(Classroom c : campus) { if(r.contains(c.getMapCoor())) tag = c.getMarker(); } } } int x = current.getMapCoor().x; int y = current.getMapCoor().y; PImage thing; if(dir == GameWindow.NORTH) thing = cursor.get(0); else if(dir == GameWindow.EAST) thing = cursor.get(1); else if(dir == GameWindow.SOUTH) thing = cursor.get(2); else thing = cursor.get(3); drawer.image(thing, x-thing.width/2, y-thing.height/2); if(tag != null) { drawer.rectMode(drawer.CENTER); drawer.stroke(0); drawer.fill(255,250,208); drawer.rect(drawer.mouseX, drawer.mouseY-5, 79, 10); drawer.textAlign(drawer.CENTER); drawer.fill(0); drawer.text(tag, drawer.mouseX, drawer.mouseY-2); } drawer.popStyle(); } /** * update player location * @param c classroom that player is in */ public void setCurrentRoom(Classroom c) { current = c; } /** * indentify which direction player is currently facing * @param userDir NORTH, SOUTH, EAST, WEST */ public void setDir(int userDir) { dir = userDir; } }
package com.shubh.javaworld; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class ConcatenatedWords { public List<String> findAllConcatenatedWordsInADict(String[] words) { Set<String> wordSet = buildSet(words); Set<String> notPresent = new HashSet<String>(); List<String> result = new ArrayList<>(); for (int i = 0; i < words.length; i++) { if (isPresent(words[i], wordSet, notPresent)) { result.add(words[i]); } } return result; } private boolean isPresent(String word, Set<String> wordSet, Set<String> notPresent) { if (notPresent.contains(word)) { return false; } for (int j = 0; j < word.length() - 1; j++) { String left = word.substring(0, j + 1); if (wordSet.contains(left)) { String right = word.substring(j + 1); if (wordSet.contains(right)) { return true; } boolean exists = isPresent(right, wordSet, notPresent); if (exists) { return true; } } } notPresent.add(word); return false; } private Set<String> buildSet(String[] words) { Set<String> wordSet = new HashSet<>(); for (String w : words) { wordSet.add(w); } return wordSet; } public static void main(String[] args) { // TODO Auto-generated method stub String[] words = new String[] { "cat", "cats", "catsdogcats", "dog", "dogcatsdog", "dogcats", "dogcatss", "hippopotamuses", "rat", "ratcatdogcat" }; ConcatenatedWords c = new ConcatenatedWords(); System.out.println(c.findAllConcatenatedWordsInADict(words)); } }
package com.tencent.mm.plugin.account.bind.ui; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; class FindMContactIntroUI$3 implements OnClickListener { final /* synthetic */ FindMContactIntroUI eHN; FindMContactIntroUI$3(FindMContactIntroUI findMContactIntroUI) { this.eHN = findMContactIntroUI; } public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }
package br.com.utfpr.dao.impl; import br.com.utfpr.beans.Truck; import br.com.utfpr.dao.ConnectionBuilder; import br.com.utfpr.dao.Dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class TruckDao implements Dao<Truck>{ public TruckDao() { try(Connection con = new ConnectionBuilder().getConnection()){ String sql = "CREATE TABLE IF NOT EXISTS public.caminhao\n" + "(\n" + " codcaminhao bigint NOT NULL,\n" + " marca character varying(40) COLLATE pg_catalog.\"default\",\n" + " modelo character varying(40) COLLATE pg_catalog.\"default\",\n" + " ano integer,\n" + " placa character varying(8) COLLATE pg_catalog.\"default\",\n" + " chassi character varying(17) COLLATE pg_catalog.\"default\",\n" + " captanque numeric(6,2),\n" + " kml integer,\n" + " CONSTRAINT caminhao_pkey PRIMARY KEY (codcaminhao)\n" + ")\n" + "WITH (\n" + " OIDS = FALSE\n" + ")\n" + "TABLESPACE pg_default;"; PreparedStatement stmt = con.prepareStatement(sql); stmt.execute(); stmt.close(); con.close(); }catch(SQLException e){ throw new RuntimeException(e); } } @Override public void add(Object obj) { try{ Connection con; con = new ConnectionBuilder().getConnection(); Truck truck = (Truck) obj; String sql = "insert into caminhao (codCaminhao,marca,modelo ,ano ,placa ,chassi ,capTanque, kml)" + "values(?,?,?,?,?,?,?,?)"; PreparedStatement stmt = con.prepareStatement(sql); stmt.setLong(1, truck.getId()); stmt.setString(2,truck.getBrand()); stmt.setString(3,truck.getModel()); stmt.setInt(4,truck.getYear()); stmt.setString(5,truck.getPlate()); stmt.setString(6,truck.getChassi()); stmt.setDouble(7,truck.getGasTank()); stmt.setInt(8,truck.getKML()); stmt.execute(); stmt.close(); con.close(); }catch(SQLException e){ throw new RuntimeException(e); } } @Override public void remove(Object obj) { try(Connection con = new ConnectionBuilder().getConnection()){ Truck truck = (Truck) obj; String sql = "delete from caminhao where codCaminhao=?"; PreparedStatement stmt = con.prepareStatement(sql); stmt.setLong(1,truck.getId()); stmt.execute(); stmt.close(); con.close(); }catch(SQLException e){ throw new RuntimeException(e); } } @Override public void update(Object obj) { try{ Connection con; con = new ConnectionBuilder().getConnection(); Truck truck = (Truck) obj; String sql = "update caminhao set marca=?,modelo=?,ano=?,placa =?," + "chassi =? ,capTanque = ?, kml = ? where codCaminhao = ?"; PreparedStatement stmt = con.prepareStatement(sql); stmt.setString(1,truck.getBrand()); stmt.setString(2,truck.getModel()); stmt.setInt(3,truck.getYear()); stmt.setString(4,truck.getPlate()); stmt.setString(5,truck.getChassi()); stmt.setDouble(6,truck.getGasTank()); stmt.setInt(7,truck.getKML()); stmt.setLong(8, truck.getId()); stmt.execute(); stmt.close(); con.close(); }catch(SQLException e){ throw new RuntimeException(e); } } @Override public Object read(long id) { try(Connection con = new ConnectionBuilder().getConnection()){ Truck truck = new Truck(); String sql = "select * from caminhao where codCaminhao=?"; PreparedStatement stmt = con.prepareStatement(sql); stmt.setLong(1,id); ResultSet rs = stmt.executeQuery(); while(rs.next()) { truck.setId(rs.getLong("codCaminhao")); truck.setBrand(rs.getString("marca")); truck.setModel(rs.getString("modelo")); truck.setYear(rs.getInt("ano")); truck.setPlate(rs.getString("placa")); truck.setChassi(rs.getString("chassi")); truck.setGasTank(rs.getLong("capTanque")); truck.setKML(rs.getInt("kml")); } stmt.close(); con.close(); return truck; }catch(SQLException e){ throw new RuntimeException(e); } } @Override public Collection<Truck> getList() { try(Connection con = new ConnectionBuilder().getConnection()){ List<Truck> trucklist = new ArrayList<>(); String sql = "select * from caminhao"; PreparedStatement stmt = con.prepareStatement(sql); ResultSet rs = stmt.executeQuery(); while(rs.next()) { Truck truck = new Truck(); truck.setId(rs.getLong("codCaminhao")); truck.setBrand(rs.getString("marca")); truck.setModel(rs.getString("modelo")); truck.setYear(rs.getInt("ano")); truck.setPlate(rs.getString("placa")); truck.setChassi(rs.getString("chassi")); truck.setGasTank(rs.getLong("capTanque")); truck.setKML(rs.getInt("kml")); trucklist.add(truck); } stmt.close(); con.close(); return trucklist; }catch(SQLException e){ throw new RuntimeException(e); } } }
package com.tencent.sqlitelint.behaviour.alert; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.LinearLayout; import android.widget.TextView; import com.tencent.sqlitelint.SQLiteLintIssue; import com.tencent.sqlitelint.d.b; import com.tencent.sqlitelint.d.c; import com.tencent.sqlitelint.d.d; import com.tencent.sqlitelint.util.SLog; import com.tencent.sqlitelint.util.SQLiteLintUtil; public class IssueDetailActivity extends SQLiteLintBaseActivity { protected void onCreate(Bundle bundle) { super.onCreate(bundle); final SQLiteLintIssue sQLiteLintIssue = (SQLiteLintIssue) getIntent().getParcelableExtra("issue"); if (sQLiteLintIssue != null) { LinearLayout linearLayout; setTitle(getString(d.diagnosis_detail_title)); TextView textView = (TextView) findViewById(b.diagnosis_level_tv); ((TextView) findViewById(b.time_tv)).setText(SQLiteLintUtil.h("yyyy-MM-dd HH:mm", sQLiteLintIssue.createTime)); textView.setText(SQLiteLintIssue.getLevelText(sQLiteLintIssue.level, getBaseContext())); if (!SQLiteLintUtil.oW(sQLiteLintIssue.desc)) { linearLayout = (LinearLayout) findViewById(b.desc_layout); ((TextView) findViewById(b.desc_tv)).setText(sQLiteLintIssue.desc); linearLayout.setVisibility(0); linearLayout.setOnClickListener(new OnClickListener() { public final void onClick(View view) { SLog.v("MicroMsg.IssueDetailActivity", sQLiteLintIssue.desc.replace("%", "###"), new Object[0]); } }); } if (!SQLiteLintUtil.oW(sQLiteLintIssue.detail)) { linearLayout = (LinearLayout) findViewById(b.detail_layout); textView = (TextView) findViewById(b.detail_tv); textView.setText(sQLiteLintIssue.detail); linearLayout.setVisibility(0); textView.setOnClickListener(new OnClickListener() { public final void onClick(View view) { SLog.v("MicroMsg.IssueDetailActivity", sQLiteLintIssue.detail.replace("%", "###"), new Object[0]); } }); } if (!SQLiteLintUtil.oW(sQLiteLintIssue.advice)) { linearLayout = (LinearLayout) findViewById(b.advice_layout); ((TextView) findViewById(b.advice_tv)).setText(sQLiteLintIssue.advice); linearLayout.setVisibility(0); } if (!SQLiteLintUtil.oW(sQLiteLintIssue.extInfo)) { linearLayout = (LinearLayout) findViewById(b.ext_info_layout); ((TextView) findViewById(b.ext_info_tv)).setText(getString(d.diagnosis_ext_info_title, new Object[]{sQLiteLintIssue.extInfo})); linearLayout.setVisibility(0); } } } protected final int getLayoutId() { return c.activity_diagnosis_detail; } }
package com.ns.greg.library.base_architecture.di.component; import com.ns.greg.library.base_architecture.BaseActivity; import com.ns.greg.library.base_architecture.di.module.ApplicationModule; import com.ns.greg.library.base_architecture.di.module.SharedPreferenceModule; import com.ns.greg.library.base_architecture.module.OkHttpManager; import com.ns.greg.library.base_architecture.module.SharedPreferenceManager; import dagger.Component; import javax.inject.Singleton; /** * @author Gregory * @since 2017/7/28 */ @Singleton @Component(modules = { ApplicationModule.class, SharedPreferenceModule.class }) public interface ApplicationComponent { void inject(BaseActivity baseActivity); /*-------------------------------- * Exposed to sub-graphs *-------------------------------*/ SharedPreferenceManager sharedPreferenceManger(); OkHttpManager okHttpManager(); }
package com.flipkart.programs; public class MySemaphore { /** * A counting semaphore. Conceptually, a semaphore maintains a set of permits. * Each acquire() blocks if necessary until a permit is available, and then takes it. * Each release() adds a permit, potentially releasing a blocking acquirer. * However, no actual permit objects are used; the Semaphore just keeps a count of the number available and acts accordingly. */ volatile private int bound = 0; private final Object LOCK = new Object(); public MySemaphore(int bound){ this.bound = bound; } public void acquire() throws InterruptedException { synchronized (LOCK) { while(bound==0){ System.out.println(Thread.currentThread().getName()+" waiting"); LOCK.wait(); } System.out.println(Thread.currentThread().getName()+"-------------- acquired"); bound--; LOCK.notifyAll(); } } public void release(){ synchronized (LOCK) { bound++; LOCK.notifyAll(); } } public static void main(String[] args) { MySemaphore sem = new MySemaphore(3); for(int i =0;i<10;i++){ new Thread(sem.new MyThread(sem)).start(); } System.out.println(Thread.currentThread().getName()+" FINISHED"); } private class MyThread implements Runnable{ MySemaphore sem; MyThread(MySemaphore sem){ this.sem = sem; } public void run(){ try{ sem.acquire(); for(int i =0;i<5;i++){ System.out.println(Thread.currentThread().getName()+" sleeping"); Thread.sleep(1000); } }catch(Exception e){ }finally{ sem.release(); } } } }
package net.fbvictorhugo.feelingcast; import android.os.Bundle; import android.support.v4.view.MenuItemCompat; import android.support.v7.app.AppCompatActivity; import android.support.v7.app.MediaRouteActionProvider; import android.support.v7.media.MediaRouteSelector; import android.support.v7.media.MediaRouter; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import com.google.android.gms.cast.Cast; import com.google.android.gms.cast.CastDevice; import com.google.android.gms.cast.CastMediaControlIntent; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.ResultCallback; import com.google.android.gms.common.api.Status; import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; public class MainActivity extends AppCompatActivity { private final String TAG = "> GDG >>>"; private final String NAMESPACE = "urn:x-cast:net.fbvictorhugo.feelingcast"; private MediaRouter mMediaRouter; private MediaRouteSelector mMediaRouteSelector; private MediaRouter.Callback mMediaRouterCallback; private CastDevice mCastDevice; private GoogleApiClient mGoogleApiClient; private GoogleApiClient.ConnectionCallbacks mGoogleConnectionCallbacks; private GoogleApiClient.OnConnectionFailedListener mGoogleConnectionFailedListener; Toolbar mToolbar; EditText editText; Button btnPositivo; Button btnNegativo; Button btnNull; TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mToolbar = (Toolbar) findViewById(R.id.main_toolbar); setSupportActionBar(mToolbar); editText = (EditText) findViewById(R.id.main_edittext); btnPositivo = (Button) findViewById(R.id.main_btn_pos); btnNegativo = (Button) findViewById(R.id.main_btn_neg); btnNull = (Button) findViewById(R.id.main_btn_nulo); textView = (TextView) findViewById(R.id.main_text_view); btnPositivo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { buttonAction("positive"); } }); btnNegativo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { buttonAction("negative"); } }); btnNull.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { buttonAction("null"); } }); mMediaRouter = MediaRouter.getInstance(getApplicationContext()); mMediaRouteSelector = new MediaRouteSelector.Builder(). addControlCategory(CastMediaControlIntent.categoryForCast(getResources().getString(R.string.cast_app_id))).build(); mMediaRouterCallback = new MyMediaRouterCallback(); } private void buttonAction(String choice) { try { String mes = createJsonData(choice, editText.getText().toString()); textView.setText(mes); sendMessageToCast(mes); } catch (Exception e) { textView.setText(e.getMessage()); } } @Override protected void onStart() { super.onStart(); mMediaRouter.addCallback(mMediaRouteSelector, mMediaRouterCallback, MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY); } @Override protected void onStop() { mMediaRouter.removeCallback(mMediaRouterCallback); super.onStop(); } // region OptionsMenu @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item); MediaRouteActionProvider mediaRouteActionProvider = (MediaRouteActionProvider) MenuItemCompat.getActionProvider(mediaRouteMenuItem); mediaRouteActionProvider.setRouteSelector(mMediaRouteSelector); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } // endregion // region My MediaRouter.Callback class MyMediaRouterCallback extends MediaRouter.Callback { @Override public void onRouteSelected(MediaRouter router, MediaRouter.RouteInfo route) { // super.onRouteSelected(router, route); // Handle the user route selection. mCastDevice = CastDevice.getFromBundle(route.getExtras()); mToolbar.setSubtitle(route.getName()); prepareGoogleApis(); } @Override public void onRouteAdded(MediaRouter router, MediaRouter.RouteInfo route) { // super.onRouteAdded(router, route); Log.d(TAG, route.getName()); } @Override public void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route) { mToolbar.setSubtitle(""); } } //endregion // region Prepare Goolge APIs private void prepareGoogleApis() { Cast.Listener castListener = new Cast.Listener() { @Override public void onApplicationDisconnected(int statusCode) { mToolbar.setSubtitle("Tchau " + statusCode); } }; // Cast API options Cast.CastOptions.Builder castOptionsBuilder = Cast.CastOptions .builder(mCastDevice, castListener); mGoogleConnectionCallbacks = new GoogleConnectionCallbacks(); mGoogleConnectionFailedListener = new GoogleConnectionFailedListener(); // The Cast SDK API’s are invoked using GoogleApiClient GoogleApiClient.Builder googleApiBuilder = new GoogleApiClient.Builder(this); googleApiBuilder.addApi(Cast.API, castOptionsBuilder.build()); googleApiBuilder.addConnectionCallbacks(mGoogleConnectionCallbacks); googleApiBuilder.addOnConnectionFailedListener(mGoogleConnectionFailedListener); mGoogleApiClient = googleApiBuilder.build(); // connect mGoogleApiClient.connect(); } // endregion // region Google Callbacks private class GoogleConnectionCallbacks implements GoogleApiClient.ConnectionCallbacks { @Override public void onConnected(Bundle bundle) { Cast.CastApi.launchApplication(mGoogleApiClient, getString(R.string.cast_app_id)). setResultCallback(castAppConnectionResultCallback); } @Override public void onConnectionSuspended(int i) { } } public class GoogleConnectionFailedListener implements GoogleApiClient.OnConnectionFailedListener { @Override public void onConnectionFailed(ConnectionResult connectionResult) { } } // endregion // region Cast Callbacks ResultCallback<Cast.ApplicationConnectionResult> castAppConnectionResultCallback = new ResultCallback<Cast.ApplicationConnectionResult>() { @Override public void onResult(Cast.ApplicationConnectionResult result) { if (result.getStatus().isSuccess()) { try { Cast.CastApi.setMessageReceivedCallbacks(mGoogleApiClient, NAMESPACE, new CastMessageReceivedCallback()); } catch (IOException e) { e.printStackTrace(); } } } }; class CastMessageReceivedCallback implements Cast.MessageReceivedCallback { @Override public void onMessageReceived(CastDevice castDevice, String namespace, String message) { textView.setText(message); Log.d(TAG, "from " + castDevice.getFriendlyName() + " : " + message); } } // endregion // region Message to Cast void sendMessageToCast(final String message) { try { Cast.CastApi.sendMessage(mGoogleApiClient, NAMESPACE, message) .setResultCallback(new ResultCallback<Status>() { @Override public void onResult(Status result) { if (result.isSuccess()) { Log.d("Cast.sendMessage", message); } } }); } catch (Exception e) { e.printStackTrace(); } } //endregion String createJsonData(String choice, String message) throws JSONException { JSONObject json = new JSONObject(); json.put("choice", choice); json.put("message", message); return json.toString(); } }
package com.tt.miniapp.feedback.screenrecord; import android.media.MediaCodecInfo; import android.media.MediaCodecList; import android.os.AsyncTask; import android.util.SparseArray; import com.tt.miniapphost.AppBrandLogger; import java.lang.reflect.Field; import java.util.ArrayList; public class ScreenRecordUtils { static SparseArray<String> sAACProfiles = new SparseArray(); static SparseArray<String> sAVCLevels; static SparseArray<String> sAVCProfiles = new SparseArray(); static SparseArray<String> sColorFormats; static { sAVCLevels = new SparseArray(); sColorFormats = new SparseArray(); } public static String avcProfileLevelToString(MediaCodecInfo.CodecProfileLevel paramCodecProfileLevel) { if (sAVCProfiles.size() == 0 || sAVCLevels.size() == 0) initProfileLevels(); int i = sAVCProfiles.indexOfKey(paramCodecProfileLevel.profile); String str2 = null; if (i >= 0) { str1 = (String)sAVCProfiles.valueAt(i); } else { str1 = null; } i = sAVCLevels.indexOfKey(paramCodecProfileLevel.level); if (i >= 0) str2 = (String)sAVCLevels.valueAt(i); String str3 = str1; if (str1 == null) str3 = String.valueOf(paramCodecProfileLevel.profile); String str1 = str2; if (str2 == null) str1 = String.valueOf(paramCodecProfileLevel.level); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(str3); stringBuilder.append('-'); stringBuilder.append(str1); return stringBuilder.toString(); } static MediaCodecInfo[] findEncodersByType(String paramString) { MediaCodecList mediaCodecList = new MediaCodecList(1); ArrayList<MediaCodecInfo> arrayList = new ArrayList(); MediaCodecInfo[] arrayOfMediaCodecInfo = mediaCodecList.getCodecInfos(); int j = arrayOfMediaCodecInfo.length; int i = 0; while (true) { if (i < j) { MediaCodecInfo mediaCodecInfo = arrayOfMediaCodecInfo[i]; if (mediaCodecInfo.isEncoder()) try { MediaCodecInfo.CodecCapabilities codecCapabilities = mediaCodecInfo.getCapabilitiesForType(paramString); if (codecCapabilities != null) arrayList.add(mediaCodecInfo); } catch (IllegalArgumentException illegalArgumentException) {} i++; continue; } return arrayList.<MediaCodecInfo>toArray(new MediaCodecInfo[arrayList.size()]); } } public static void findEncodersByTypeAsync(String paramString, Callback paramCallback) { (new EncoderFinder(paramCallback)).execute((Object[])new String[] { paramString }); } private static void initColorFormatFields() { Field[] arrayOfField = MediaCodecInfo.CodecCapabilities.class.getFields(); int j = arrayOfField.length; int i = 0; while (true) { if (i < j) { Field field = arrayOfField[i]; if ((field.getModifiers() & 0x18) != 0) { String str = field.getName(); if (str.startsWith("COLOR_")) try { int k = field.getInt(null); sColorFormats.put(k, str); } catch (IllegalAccessException illegalAccessException) {} } i++; continue; } return; } } private static void initProfileLevels() { for (Field field : MediaCodecInfo.CodecProfileLevel.class.getFields()) { if ((field.getModifiers() & 0x18) != 0) { SparseArray<String> sparseArray; String str = field.getName(); if (str.startsWith("AVCProfile")) { sparseArray = sAVCProfiles; } else if (str.startsWith("AVCLevel")) { sparseArray = sAVCLevels; } else if (str.startsWith("AACObject")) { sparseArray = sAACProfiles; } else { continue; } try { sparseArray.put(field.getInt(null), str); } catch (IllegalAccessException illegalAccessException) { AppBrandLogger.stacktrace(6, "tma_ScreenRecordUtils", illegalAccessException.getStackTrace()); } } continue; } } private static <T> int keyOfValue(SparseArray<T> paramSparseArray, T paramT) { int j = paramSparseArray.size(); for (int i = 0; i < j; i++) { Object object = paramSparseArray.valueAt(i); if (object == paramT || object.equals(paramT)) return paramSparseArray.keyAt(i); } return -1; } static int toColorFormat(String paramString) { if (sColorFormats.size() == 0) initColorFormatFields(); int i = keyOfValue(sColorFormats, paramString); return (i > 0) ? i : (paramString.startsWith("0x") ? Integer.parseInt(paramString.substring(2), 16) : 0); } public static String toHumanReadable(int paramInt) { if (sColorFormats.size() == 0) initColorFormatFields(); int i = sColorFormats.indexOfKey(paramInt); if (i >= 0) return (String)sColorFormats.valueAt(i); StringBuilder stringBuilder = new StringBuilder("0x"); stringBuilder.append(Integer.toHexString(paramInt)); return stringBuilder.toString(); } static MediaCodecInfo.CodecProfileLevel toProfileLevel(String paramString) { // Byte code: // 0: getstatic com/tt/miniapp/feedback/screenrecord/ScreenRecordUtils.sAVCProfiles : Landroid/util/SparseArray; // 3: invokevirtual size : ()I // 6: ifeq -> 27 // 9: getstatic com/tt/miniapp/feedback/screenrecord/ScreenRecordUtils.sAVCLevels : Landroid/util/SparseArray; // 12: invokevirtual size : ()I // 15: ifeq -> 27 // 18: getstatic com/tt/miniapp/feedback/screenrecord/ScreenRecordUtils.sAACProfiles : Landroid/util/SparseArray; // 21: invokevirtual size : ()I // 24: ifne -> 30 // 27: invokestatic initProfileLevels : ()V // 30: aload_0 // 31: bipush #45 // 33: invokevirtual indexOf : (I)I // 36: istore_1 // 37: iload_1 // 38: ifle -> 59 // 41: aload_0 // 42: iconst_0 // 43: iload_1 // 44: invokevirtual substring : (II)Ljava/lang/String; // 47: astore_2 // 48: aload_0 // 49: iload_1 // 50: iconst_1 // 51: iadd // 52: invokevirtual substring : (I)Ljava/lang/String; // 55: astore_0 // 56: goto -> 65 // 59: aconst_null // 60: astore_3 // 61: aload_0 // 62: astore_2 // 63: aload_3 // 64: astore_0 // 65: new android/media/MediaCodecInfo$CodecProfileLevel // 68: dup // 69: invokespecial <init> : ()V // 72: astore_3 // 73: aload_2 // 74: ldc 'AVC' // 76: invokevirtual startsWith : (Ljava/lang/String;)Z // 79: ifeq -> 96 // 82: aload_3 // 83: getstatic com/tt/miniapp/feedback/screenrecord/ScreenRecordUtils.sAVCProfiles : Landroid/util/SparseArray; // 86: aload_2 // 87: invokestatic keyOfValue : (Landroid/util/SparseArray;Ljava/lang/Object;)I // 90: putfield profile : I // 93: goto -> 127 // 96: aload_2 // 97: ldc 'AAC' // 99: invokevirtual startsWith : (Ljava/lang/String;)Z // 102: ifeq -> 119 // 105: aload_3 // 106: getstatic com/tt/miniapp/feedback/screenrecord/ScreenRecordUtils.sAACProfiles : Landroid/util/SparseArray; // 109: aload_2 // 110: invokestatic keyOfValue : (Landroid/util/SparseArray;Ljava/lang/Object;)I // 113: putfield profile : I // 116: goto -> 127 // 119: aload_3 // 120: aload_2 // 121: invokestatic parseInt : (Ljava/lang/String;)I // 124: putfield profile : I // 127: aload_0 // 128: ifnull -> 165 // 131: aload_0 // 132: ldc 'AVC' // 134: invokevirtual startsWith : (Ljava/lang/String;)Z // 137: ifeq -> 154 // 140: aload_3 // 141: getstatic com/tt/miniapp/feedback/screenrecord/ScreenRecordUtils.sAVCLevels : Landroid/util/SparseArray; // 144: aload_0 // 145: invokestatic keyOfValue : (Landroid/util/SparseArray;Ljava/lang/Object;)I // 148: putfield level : I // 151: goto -> 165 // 154: aload_3 // 155: aload_0 // 156: invokestatic parseInt : (Ljava/lang/String;)I // 159: putfield level : I // 162: goto -> 165 // 165: aload_3 // 166: getfield profile : I // 169: ifle -> 181 // 172: aload_3 // 173: getfield level : I // 176: iflt -> 181 // 179: aload_3 // 180: areturn // 181: aconst_null // 182: areturn // 183: astore_0 // 184: aconst_null // 185: areturn // 186: astore_0 // 187: aconst_null // 188: areturn // Exception table: // from to target type // 119 127 183 java/lang/NumberFormatException // 154 162 186 java/lang/NumberFormatException } public static interface Callback { void onResult(MediaCodecInfo[] param1ArrayOfMediaCodecInfo); } static final class EncoderFinder extends AsyncTask<String, Void, MediaCodecInfo[]> { private ScreenRecordUtils.Callback mCallback; EncoderFinder(ScreenRecordUtils.Callback param1Callback) { this.mCallback = param1Callback; } protected final MediaCodecInfo[] doInBackground(String... param1VarArgs) { return ScreenRecordUtils.findEncodersByType(param1VarArgs[0]); } protected final void onPostExecute(MediaCodecInfo[] param1ArrayOfMediaCodecInfo) { this.mCallback.onResult(param1ArrayOfMediaCodecInfo); } } } /* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapp\feedback\screenrecord\ScreenRecordUtils.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
package me.bo0tzz; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; public class Main { public static void main(String[] args) { String in; try { in = new String(Files.readAllBytes(Paths.get("in.txt"))); } catch (IOException e) { e.printStackTrace(); return; } char[] chars = in.toCharArray(); List<Character> out = new LinkedList<>(); boolean currentlyGarbage = false; for (int i = 0; i < chars.length; i++) { char c = chars[i]; switch(c) { case '!': i++; //Skip the next character break; case '<': currentlyGarbage = true; break; case '>': currentlyGarbage = false; break; default: if (!currentlyGarbage) out.add(c); } } String clean = out.stream().map(String::valueOf).collect(Collectors.joining()); int sum = 0; int depth = 0; for (Character c : clean.toCharArray()) { switch (c) { case '{': depth++; break; case '}': sum += depth; depth--; break; } } System.out.println(sum); } }
/** * Write a description of class ComplexNumber here. * * @author (your name) * @version (a version number or a date) */ public class Complex { // instance variables - replace the example below with your own private int a; private int b; /** * Constructor for objects of class ComplexNumber */ public Complex(int x, int y) { // initialise instance variables a = x; b = y; } public void setA(int x) { a = x; } public void setB(int y) { b = y; } public int getA() { // put your code here return a; } public int getB() { return b; } public String print() { return "" + a + " + " + b + "i"; } public Complex add(Complex c) { Complex result = new Complex(this.getA() + c.getA(), this.getB() + c.getB()); return result; } public Complex multiply(Complex c) { int x = 0; int y = 0; Complex result2 = new Complex(x,y); result2.setA(this.getA() * c.getA() - this.getB() * c.getB()); result2.setB(this.getA() * c.getB() + this.getB() * c.getA()); return result2; } }
package io.github.azaiats.androidmvvm.sample.activities; import android.support.annotation.NonNull; import io.github.azaiats.androidmvvm.R; import io.github.azaiats.androidmvvm.core.common.BindingConfig; import io.github.azaiats.androidmvvm.databinding.ActivityStartBinding; import io.github.azaiats.androidmvvm.navigation.NavigatingMvvmActivity; import io.github.azaiats.androidmvvm.sample.navigators.StartNavigator; import io.github.azaiats.androidmvvm.sample.utils.AppPreferences; import io.github.azaiats.androidmvvm.sample.viewmodels.StartViewModel; /** * @author Andrei Zaiats * @since 05/12/2016 */ public class StartActivity extends NavigatingMvvmActivity<StartNavigator, ActivityStartBinding, StartViewModel> { @NonNull @Override public StartViewModel createViewModel() { return new StartViewModel(new AppPreferences(this)); } @NonNull @Override public BindingConfig getBindingConfig() { return new BindingConfig(R.layout.activity_start); } @NonNull @Override public StartNavigator getNavigator() { return new StartNavigator(this); } }
package com.plexobject.dp.sample.domain; import java.math.BigDecimal; import java.util.Date; public class TimeOfSales { private String symbol; private Date date; private BigDecimal price; private BigDecimal volume; private String exchange; public TimeOfSales() { } public TimeOfSales(String symbol, Date date, BigDecimal price, BigDecimal volume, String exchange) { this.symbol = symbol; this.date = date; this.price = price; this.volume = volume; this.exchange = exchange; } public String getSymbol() { return symbol; } public void setSymbol(String symbol) { this.symbol = symbol; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public BigDecimal getVolume() { return volume; } public void setVolume(BigDecimal volume) { this.volume = volume; } public String getExchange() { return exchange; } public void setExchange(String exchange) { this.exchange = exchange; } }
package codex.instance; import codex.service.RemoteServiceOptions; import codex.model.Entity; import codex.service.LocalServiceOptions; import codex.utils.ImageUtils; public class CommunicationServiceOptions extends LocalServiceOptions<InstanceCommunicationService> { public CommunicationServiceOptions(InstanceCommunicationService service) { super(service); setIcon(ImageUtils.getByPath("/images/remotehost.png")); } @Override public boolean allowModifyChild() { return false; } @Override public Class<? extends Entity> getChildClass() { return RemoteServiceOptions.class; } }
public class GuitarString { Note frets[]; GuitarString(Note openNote, int maxFrets) { frets = new Note[maxFrets+1]; for(int i=0;i<frets.length;i++) { frets[i] = openNote.plus(i); } } public String toString() { String string = ""; for(int i=0;i<frets.length;i++) { string += "Fret: " + i + " Note: " + frets[i] + "\n"; } return string; } }
package com.findme.controller; import com.findme.exception.BadRequestException; import lombok.extern.log4j.Log4j; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import javax.servlet.http.HttpSession; @Log4j @Controller public class FeedController { @RequestMapping(path = "/feed", method = RequestMethod.GET) public String profile(HttpSession session, Model model){ String loggedUserId = (String) session.getAttribute("loggedUserId"); if(loggedUserId==null) { log.warn("User is not authorized"); model.addAttribute("error", new BadRequestException("You are not logged in to see this information.")); return "errors/forbidden"; } model.addAttribute("loggedUser", session.getAttribute("loggedUser")); return "feed"; } }
package rendering; import shaders.ShaderProgram; import shaders.UniformMatrix; import shaders.UniformVec2; import shaders.UniformVec3; import shaders.UniformVec4; import utils.MyFile; /** * Represents the shader program that is used for rendering the terrain. * * @author Karl * */ public class TerrainShader extends ShaderProgram { protected UniformMatrix projectionViewMatrix = new UniformMatrix("projectionViewMatrix"); protected UniformVec3 lightDirection = new UniformVec3("lightDirection"); protected UniformVec3 lightColour = new UniformVec3("lightColour"); protected UniformVec2 lightBias = new UniformVec2("lightBias"); protected UniformVec4 plane = new UniformVec4("plane"); public TerrainShader(MyFile vertexFile, MyFile fragmentFile) { super(vertexFile, fragmentFile); super.storeAllUniformLocations(projectionViewMatrix, lightDirection, lightColour, lightBias, plane); } public TerrainShader(MyFile vertexFile, MyFile geometryFile, MyFile fragmentFile) { super(vertexFile, geometryFile, fragmentFile); super.storeAllUniformLocations(projectionViewMatrix, lightDirection, lightColour, lightBias, plane); } }
import java.util.Properties; import javax.mail.MessagingException; import javax.mail.Message; import javax.mail.Message.*; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import java.util.Date; import java.text.DateFormat; import java.util.Calendar; import java.text.SimpleDateFormat; import java.lang.String; import java.util.*; import java.io.*; import java.util.*; import javax.mail.*; import javax.mail.internet.*; import java.net.*; public class enviarNotificacionFaltaGrave extends com.wavemaker.runtime.javaservice.JavaServiceSuperClass { public String enviarNotificacionFaltaGrave(String alumno, String nombrepadre, String correopadre, String nombremadre, String correomadre, String subtipoEventualidad, String curso, String fechaCita, String horaCita, String dnipap, String dnimam, String correocoordinador, String correodirector) { try{ DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); DateFormat timeFormat = new SimpleDateFormat("HH:mm"); Date getToday = new Date(); String today = dateFormat.format(getToday); System.out.println(dateFormat.format(getToday)); Properties props = new Properties(); props.setProperty("mail.smtp.host", "smtp.gmail.com"); props.setProperty("mail.smtp.starttls.enable", "true"); props.setProperty("mail.smtp.port", "587"); props.setProperty("mail.smtp.user", "eventualidades@rochester.edu.co"); props.setProperty("mail.smtp.auth", "true"); Session session = Session.getDefaultInstance(props); MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress("eventualidades@rochester.edu.co")); message.addRecipient( Message.RecipientType.TO, new InternetAddress(correopadre)); message.addRecipient( Message.RecipientType.TO, new InternetAddress(correomadre)); message.addRecipient( Message.RecipientType.TO, new InternetAddress("eventualidades@rochester.edu.co")); message.addRecipient( Message.RecipientType.TO, new InternetAddress("jospina@rochester.edu.co")); message.addRecipient( Message.RecipientType.TO, new InternetAddress(correocoordinador)); message.addRecipient( Message.RecipientType.TO, new InternetAddress(correodirector)); message.setSubject("No Reply - Notificación de falta grave"); message.setText( "<img src=\"http://www.rochester.edu.co/images/logo.png\">"+"<br/><br/>"+ "NOTIFICACIÓN - COLEGIO ROCHESTER<br/><br/>"+ "<b>Respetados padres de familia.</b><br/>"+ nombrepadre+" - C.C No. "+dnipap+"<br>"+ nombremadre+" - C.C No. "+dnimam+"<br><br>"+ "En coordinación con el Centro de Bienestar, y en calidad de orientador de convivencia del Colegio Rochester, me dirijo a ustedes para informarles que si hijo/a "+alumno+" del curso "+curso+", tuvo la siguiente falta grave: <br><br>"+ "<u>"+subtipoEventualidad+"</u><br/><br/>"+ "Los invito entonces a un reunión el dia "+fechaCita+" a las "+horaCita+", para profundizar sobre esta situación y contarles sobre el plan que se trazó su hijo/a para reparar la falta. Los espero en mi oficina, ubicada en el Bloque 4, Piso 1, Oficina4.<br/><br/>"+ "Atentamente,<br><br><br>"+ "Julián Ospina López<br/>"+ "Relationships Counselor<br>"+ "Notificador<br>"+ "Aprendoz Colegio Rochester","ISO-8859-1","html"); Transport t = session.getTransport("smtp"); t.connect("eventualidades@rochester.edu.co", "Rochester1959+"); t.sendMessage(message, message.getAllRecipients()); t.close(); }catch (Exception e){ e.printStackTrace(); } return "ok"; } }
package com.sneaker.mall.api.model; /** * 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. */ public class OrderItem extends BaseModel<Long> { /** * 数量 */ private int total; /** * 商城商品ID */ private long mgid; /** * 销营活动ID */ private long market_id; /** * 活动名称 */ private String market_name; /** * 价格 */ private float price; /** * 商品条型码 */ private String gbarcode; /** * 商品 */ private String gname; /** * 商品编码 */ private String gcode; /** * 图片地址 */ private String gphoto; /** * 商品基础资料ID */ private long gid; /** * 供应商ID */ private long scid; /** * 订单ID */ private String order_id; /** * 业务员ID */ private long suid; /** * 备注 */ private String memo; /** * 总金额 */ private float total_amount; /** * 是否是赠送项 */ private int giveaway; /** * 打包商品的新商品ID */ private long bindId; /** * 打包商品数量 */ private int bindTotal; public int getBindTotal() { return bindTotal; } public void setBindTotal(int bindTotal) { this.bindTotal = bindTotal; } public long getBindId() { return bindId; } public void setBindId(long bindId) { this.bindId = bindId; } public int getGiveaway() { return giveaway; } public void setGiveaway(int giveaway) { this.giveaway = giveaway; } public String getGphoto() { return gphoto; } public void setGphoto(String gphoto) { this.gphoto = gphoto; } public float getTotal_amount() { return total_amount; } public void setTotal_amount(float total_amount) { this.total_amount = total_amount; } public String getMemo() { return memo; } public void setMemo(String memo) { this.memo = memo; } public long getSuid() { return suid; } public void setSuid(long suid) { this.suid = suid; } public String getOrder_id() { return order_id; } public void setOrder_id(String order_id) { this.order_id = order_id; } public long getMarket_id() { return market_id; } public void setMarket_id(long market_id) { this.market_id = market_id; } public String getMarket_name() { return market_name; } public void setMarket_name(String market_name) { this.market_name = market_name; } public String getGname() { return gname; } public void setGname(String gname) { this.gname = gname; } public String getGbarcode() { return gbarcode; } public void setGbarcode(String gbarcode) { this.gbarcode = gbarcode; } public String getGcode() { return gcode; } public void setGcode(String gcode) { this.gcode = gcode; } public long getGid() { return gid; } public void setGid(long gid) { this.gid = gid; } public long getScid() { return scid; } public void setScid(long scid) { this.scid = scid; } public float getPrice() { return price; } public void setPrice(float price) { this.price = price; } public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public long getMgid() { return mgid; } public void setMgid(long mgid) { this.mgid = mgid; } }
package ba.bitcamp.LabS10D01; public class StackInt { private Node head; public StackInt() { head = null; } public void push(int value) { Node newNode = new Node(value); newNode.next = head; head = newNode; } public int pop() { if (head == null) { throw new NullPointerException("Stack is empty!"); } Node current = head; head = head.next; int value = current.value; current = null; return value; } public int peek() { if (head == null) { throw new NullPointerException("Stack is empty!"); } return head.value; } public int getSize() { if (head == null) { return 0; } return getSize(head, 0); } private int getSize(Node current, int counter) { if (current == null) { return counter; } return getSize(current.next, counter + 1); //Moze i ++counter } public boolean contains(int value) { return contains(head, value); } private boolean contains(Node current, int value) { if (current == null) { return false; } if (current.value == value) { return true; } return contains(current.next, value); } /** * Private class Node * * @author nermingraca * */ private class Node { public int value; public Node next; /** * Constructor of object Node with one parameter * @param value = Integer variable which is held in object node */ public Node(int value) { this.value = value; this.next = null; } } }
package com.demo.withdrawal.util; import static org.junit.jupiter.api.Assertions.*; import java.math.BigDecimal; import org.junit.jupiter.api.Test; class ValidationUtilsTest { @Test void testValidateParams() { assertThrows(Throwable.class, () -> { ValidationUtils.validateParams(0, 0, "NA", "-1"); }); assertThrows(Throwable.class, () -> { ValidationUtils.validateParams(1, 0, "NA", "-1"); }); assertThrows(Throwable.class, () -> { ValidationUtils.validateParams(1, 1, "NA", "-1"); }); assertThrows(Throwable.class, () -> { ValidationUtils.validateParams(1, 1, "USD", "-1"); }); assertThrows(Throwable.class, () -> { ValidationUtils.validateParams(1, 1, "NA", "214.545564"); }); //TODO: more parameter permutations } @Test void testAssureAvailableBalance() { assertThrows(IllegalStateException.class, () -> { ValidationUtils.assureAvailableBalance(new BigDecimal("12.22"), new BigDecimal("12.23")); }); assertDoesNotThrow(() -> { ValidationUtils.assureAvailableBalance(new BigDecimal("12.22"), new BigDecimal("12.22")); }); assertDoesNotThrow(() -> { ValidationUtils.assureAvailableBalance(new BigDecimal("12.23"), new BigDecimal("12.22")); }); } }
package com.linkedbook.dao; import com.linkedbook.dto.deal.selectDeal.SelectDealInput; import com.linkedbook.dto.deal.selectDeal.SelectDealOutput; import com.linkedbook.dto.deal.selectDealDetail.SelectDealDetailOutput; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; public interface DealRepositoryCustom { Page<SelectDealOutput> findDynamicQueryDeal(SelectDealInput selectDealInput, Integer userId, Pageable pageable); SelectDealDetailOutput findDealDetail(Integer dealId, Integer userId); }
package com.stark.example7; import org.fusesource.hawtbuf.Buffer; import org.fusesource.hawtbuf.UTF8Buffer; import org.fusesource.mqtt.client.*; import java.net.URISyntaxException; /** * Created by Stark on 2017/11/3. */ public class MqttTest { public static void main(String[] args) throws URISyntaxException { MQTT mqtt = new MQTT(); mqtt.setHost("tcp://localhost:1883"); final CallbackConnection connection = mqtt.callbackConnection(); connection.listener(new Listener() { public void onDisconnected() { System.out.println("listen disConnect"); } public void onConnected() { System.out.println("listent connect"); } public void onPublish(UTF8Buffer topic, Buffer payload, Runnable ack) { System.out.println("listen publish"); System.out.println(UTF8Buffer.decode(topic)); System.out.println(UTF8Buffer.decode(Buffer.utf8(payload))); ack.run(); } public void onFailure(Throwable value) { System.out.println("listen fail" + value.toString()); } }); connection.connect(new Callback<Void>() { public void onFailure(Throwable value) { System.out.println("connect fail"); } // Once we connect.. public void onSuccess(Void v) { // Subscribe to a topic Topic[] topics = {new Topic("mqtt/test/#", QoS.AT_LEAST_ONCE)}; connection.subscribe(topics, new Callback<byte[]>() { public void onSuccess(byte[] qoses) { System.out.println("subscribe success"); System.out.println(new String(qoses).toString()); } public void onFailure(Throwable value) { System.out.println("subscribe fail"); } }); } }); try { Thread.sleep(100000l); } catch (InterruptedException e) { e.printStackTrace(); } // To disconnect.. connection.disconnect(new Callback<Void>() { public void onSuccess(Void v) { System.out.println("disconnect success"); } public void onFailure(Throwable value) { System.out.println("fail"); } }); } }
package com.tencent.mm.ui.base; public interface h$b { boolean p(CharSequence charSequence); }
package model; import dao.ClienteDAO; public class Cliente { private String nome; private Conta conta; public Cliente(String agencia, String numConta) { this.setConta(carregaConta(numConta, agencia)); if (this.getConta() == null) { throw new NullPointerException("Conta não encontrada"); } ClienteDAO dao = new ClienteDAO(); this.setNome(dao.retornaNome(this.conta.getId())); } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public Conta getConta() { return conta; } public void setConta(Conta conta) { this.conta = conta; } public Conta carregaConta(String numConta, String agencia) { Conta c = new Conta(agencia, numConta); return c.carregaConta(); } }
package org.jboss.jdf.example.ticketmonster.rest; import java.util.List; import javax.ejb.Stateless; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.jboss.jdf.example.ticketmonster.model.Event; @Path("/events-ejb") @Stateless public class EventResourceRESTServiceBean { @Inject private EntityManager em; @GET @Path("/xml") @Produces(MediaType.APPLICATION_XML) public List<Event> getAllEventsXML(){ return getAllEvents(); } @GET @Path("/json") @Produces(MediaType.APPLICATION_JSON) public List<Event> getAllEventsJSON(){ return getAllEvents(); } private List<Event> getAllEvents() { final List<Event> results = em.createQuery("select e from Event e order by e,name").getResultList(); return results; } }
package com.gotkx.utils.dataBases.jdbc; public class ComDef { public static final int ARCH_TYPE_SINGLE = 0; // 单件 public static final int ARCH_TYPE_ROLL_SINGLE = 1; // 卷内 public static final int ARCH_TYPE_ROLL = 2; // 案卷 public static final int ARCH_TYPE_PROJECT = 6;// 项目 // 旧系统 public static final String DOC_SINGLE_TABLE_OLD = "archive_description_jh"; // 单件表 public static final String ROLL_TABLE_OLD = "folder_description"; // 案卷表 public static final String DOC_IN_ROLL_TABLE_OLD = "archive_description"; // 卷内表 public static final String[] OLD_TABLE = { DOC_SINGLE_TABLE_OLD, DOC_IN_ROLL_TABLE_OLD, ROLL_TABLE_OLD }; // 新系统 public static final String DOC_TABLE_NEW = "doc_card"; // 单件表 public static final String ROLL_TABLE_NEW = "vol_card"; // 案卷表 public static final int SQL_SERVER = 0; // SQL SERVER 2008数据库 public static final int ORACLE = 1; // Oracle数据库 public static final int ARCHIVE_ID = 1; // 档案馆ID public static final String ARCHIVE_CODE = "443002"; // 档案馆代码 public static final String ARCHIVE_NAME = "长沙市国家综合档案馆";// 档案馆名称 public static final int MODULE_TYPE_ARCHIVE = 0; // 档案 public static final int MODULE_TYPE_IMPORT = 6;// 导入 public static final int DISABLED = 0; // 不可用 public static final int USABLE = 1; // 可用 public static final int NO = 0; // 否 public static final int YES = 1; // 是 public static final String ARCHIVE_CATE = "A1"; // 文书归档 public static final String ROLL_CATE = "A2"; // 文书案卷 public static final String ZXJS_CATE = "SZXJS";// 在线接收 public static final int QUALITY_YES = 2; // 已入库 public static final int COLLECT_TYPE_MIGRATE = 3; // 迁移数据 public static final int HANDOVER_STATE_NO = 0; // 未移交 public static final int HANDOVER_STATE_OK = 1; // 档案室已移交 档案馆已接收 public static final int DOC_OPEN_UNIDENTIFY = 0; // 未鉴定 2014/5/8 add by hd public static final int DOC_OPEN_NO = 1; // 不开放 2014/5/8 由0改为1 change by hd public static final int DOC_OPEN_OK = 2; // 已开放 2014/5/8 由1改为2 change by hd public static final int DOC_OPEN_UNSURE = 3; // 不确定 2014/5/7 add by hd public static final int DOC_OPEN_SURE = 4; // 已经生成了鉴定表,即已最终确定为开放状态. // 密级 public static final int SHARE_OPEN = 1; // 公开 public static final int SHARE_CHINA = 2; // 国内 public static final int SHARE_INSIDE = 3; // 内部 public static final int SHARE_SECRIT = 4; // 秘密 public static final int SHARE_CONFIDENTIAL = 5;// 机密 public static final int SHARE_TOPSECRET = 6;// 绝密 // 公开级别 public static final int OPEN_LEVEL_PUBLIC = 4;// 公开 public static final int OPEN_LEVEL_CHINA = 3;// 国内 public static final int OPEN_LEVEL_UNITINSIDE = 2;// 单位内部 public static final int OPEN_LEVEL_SECRET = 0;// 密件 // 根分类号 public static final String ROOT_CATE_CODE_SINGLE = "A1"; public static final String ROOT_CATE_CODE_VOL = "A2"; public static final int INT_DEFUALT_VALUE = -1;// int类型默认值 public static final String UNDERLINE = "_"; // 下划线 public static final String STRIKE = "-";// 中划线 public static final String MID_DOT = "·"; // 中文的点 public static final String SHUN_SLASH = "/"; // 正斜杠 public static final String DOT = "."; // 点 public static final String UPRIGHT = "|"; // 竖线 public static final String[] SYMBOLS = { UNDERLINE, STRIKE, MID_DOT, SHUN_SLASH, DOT, UPRIGHT }; }
package com.trendyol.bootcamp; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.safari.SafariOptions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.awt.*; import java.util.Locale; import java.util.concurrent.TimeUnit; import static org.testng.Assert.assertEquals; public class SmokeTest { /** * case 1 * ------ * 1- browseri actim * 2- www.trendyol.com'a gittim * 3- popupu kapatmak gerekecek * 4- searchbar'a telefon yazdim * 5- entera bastim * 6- sayfanin ust kisminda telefon yazdigini kontrol ettim * <p> * user actions * ------ * click * input * scroll * url'e gider * hover yapabilir * surukle birak (click) * speech recognition * read * * */ WebDriver webDriver; @BeforeMethod public void startUp() { ChromeOptions options = new ChromeOptions(); options.addArguments("--disable-notifications"); options.setExperimentalOption("excludeSwitches", new String[]{"enable-automation"}); System.setProperty("webdriver.chrome.driver", "\\Users\\fatma\\Downloads\\Compressed/chromedriver.exe"); webDriver = new ChromeDriver(options); webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); webDriver.get("https://www.trendyol.com"); webDriver.findElement(By.className("fancybox-close")) .click(); } @Test public void shouldSearch() { webDriver.findElement(By.className("search-box")).sendKeys("telefon"); webDriver.findElement(By.className("search-box")).sendKeys(Keys.ENTER); String resultText = webDriver.findElement(By.cssSelector(".dscrptn > h1")).getText(); // By.xpath(//*[@data-id='dscrptn']/h1")) assertEquals(resultText, "telefon"); } @Test public void shouldDisplayRecommendationsOnSearchBox() { webDriver.findElement(By.className("search-box")).sendKeys("telefon"); boolean searchRecommendations = webDriver.findElement(By.className("suggestion-title")).isDisplayed(); assertEquals(searchRecommendations, true); } @Test public void shouldLogin() { webDriver.findElement(By.className("account-user")).click(); webDriver.findElement(By.id("login-email")).sendKeys("enesberke2@gmail.com"); webDriver.findElement(By.id("login-password-input")).sendKeys("Asdasd123"); webDriver.findElement(By.className("submit")).click(); WebDriverWait wait = new WebDriverWait(webDriver, 10); wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("component-list"))); String accountButtonText = webDriver.findElement(By.className("account-user")).getText(); assertEquals(accountButtonText, "Hesabım"); } @Test public void shouldFindCost() { webDriver.findElement(By.id("topBanner")).click(); webDriver.findElement(By.className("account-favorites")).click(); String welcomeText = webDriver.findElement(By.cssSelector("#login-register > div >h1")).getText(); assertEquals(welcomeText.toLowerCase(Locale.ROOT) , "merhaba,"); } @Test public void shouldThereIsLoginWord(){ webDriver.findElement(By.id("topBanner")).click(); webDriver.findElement(By.className("account-favorites")).click(); String welcomeText = webDriver.findElement(By.cssSelector("#login-register > div >h3")).getText().toLowerCase(Locale.ROOT); //System.out.println(welcomeText); boolean mustbetrue = welcomeText.contains("giriş yap"); //System.out.println(mustbetrue); } @AfterMethod public void tearDown() { webDriver.quit(); } //TODO: create page objects //TODO: webdrivermaneger (handle webdrivers) //TODO: create base classes }
package com.bignerdranch.android.tingleapp; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; public class TingleFragment extends Fragment { public static TingleFragment newInstance(){ return new TingleFragment(); } private Button mCreateButton; private Button mListButton; private TextView mSizeText; private ItemStash mItemStash; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_tingle, container, false); mItemStash = ItemStash.get(getContext()); mCreateButton = (Button)view.findViewById(R.id.create_button); mCreateButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), CreateItemActivity.class); startActivity(intent); } }); mListButton = (Button)view.findViewById(R.id.list_button); mListButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), ItemListActivity.class); startActivity(intent); } }); mSizeText = (TextView)view.findViewById(R.id.list_size); updateSize(); return view; } @Override public void onResume(){ super.onResume(); updateSize(); } private void updateSize(){ int x = ItemStash.get(getContext()).size(); if(x>0){ mSizeText.setText("Currently the list contains " + String.valueOf(mItemStash.getItemCount()) + " items."); } else { mSizeText.setText("The list does not have any records."); } } }
package devas.com.whatchaap; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.AppCompatButton; import android.support.v7.widget.AppCompatEditText; import android.util.Log; import android.view.View; public class Login extends AppCompatActivity implements View.OnClickListener { AppCompatEditText passwd, username; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); UserDetails ud = new UserDetails(this); if(ud.isUserSet() == 1) { // ud.setDetails(u, p, this); Intent i = new Intent(this, MainActivity.class); startActivity(i); finish(); } username = (AppCompatEditText) findViewById(R.id.username); passwd = (AppCompatEditText) findViewById(R.id.pass); AppCompatButton log = (AppCompatButton) findViewById(R.id.login); log.setOnClickListener(this); } @Override public void onClick(View v) { String u = username.getText().toString().trim(); String p = passwd.getText().toString().trim(); Log.d(u, p); if((!u.equals("") && !p.equals(""))) { UserDetails ud = new UserDetails(this); ud.setDetails(u, p , this); Intent i = new Intent(this, MainActivity.class); startActivity(i); finish(); } } }
package org.damienoreilly.zserv; import org.springframework.core.style.ToStringCreator; public class ZservProfile { private String zservName; private Zserv zserv; public Zserv getZserv() { return zserv; } public void setZserv(Zserv zserv) { this.zserv = zserv; } public String getZservName() { return zservName; } public void setZservName(String zservName) { this.zservName = zservName; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((zservName == null) ? 0 : zservName.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ZservProfile other = (ZservProfile) obj; if (zservName == null) { if (other.zservName != null) return false; } else if (!zservName.equals(other.zservName)) return false; return true; } @Override public String toString() { return new ToStringCreator(this).append(zservName).toString(); } }
package com.example.demo.service.imp; import com.example.demo.dao.UserInfoMapper; import com.example.demo.domain.UserInfo; import com.example.demo.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @Service("userService") public class UserServiceImp implements UserService { @Resource private UserInfoMapper userInfoMapper; @Override public List<UserInfo> getAllUserInfos() { return userInfoMapper.selectAll(); } @Override public UserInfo getUserInfoWithId(int id) { return userInfoMapper.selectByPrimaryKey(id); } @Override public int deleteUserInfoWithId(int id) { return userInfoMapper.deleteByPrimaryKey(id); } }
package math; public class Vec4 { double x, y, z, w; /** Constructeur */ public Vec4(double x, double y, double z, double w) { this.x = x; this.y = y; this.z = z; this.w = w; } /** Constructeur */ public Vec4(Point3D point) { this(point.getX(), point.getY(), point.getZ(), 1); } /** Constructeur */ public Vec4(Vecteur3D vect) { this(vect.getDx(), vect.getDy(), vect.getDz(), 0); } /** Constructeur */ public Vec4() { this(0, 0, 0, 1); } /** Retourne la composante x */ public double getX() { return x; } /** Retourne la composante y */ public double getY() { return y; } /** Retourne la composante z */ public double getZ() { return z; } /** Retourne la composante w */ public double getW() { return w; } /** Retourne la composante i */ public double get(int i) { double res = 0; switch (i) { case 0: res = getX(); break; case 1: res = getY(); break; case 2: res = getZ(); break; case 3: res = getW(); break; default: break; } return res; } /** Set la composante i */ public void set(int i, double d) { switch (i) { case 0: this.x = d; break; case 1: this.y = d; break; case 2: this.z = d; break; case 3: this.w = d; break; default: break; } } /** Normalise le Vec4 */ public Vec4 normalized() { if (Math.abs(getW()) < 0.0001) { throw new ArithmeticException("Coordonnees homogenes : division par 0"); } double x = getX() / getW(); double y = getY() / getW(); double z = getZ() / getW(); return new Vec4(x, y, z, 1); } /** Converti en Point3D */ public Point3D toPoint3D() { double w = getW(); return new Point3D(getX()/w, getY()/w, getZ()/w); } /** Converti en Vecteur3D */ public Vecteur3D toVecteur3D() { return new Vecteur3D(getX(), getY(), getZ()); } public String toString() { return "(" + getX() + ", " + getY() + ", " + getZ() + ", " + getW() + ")"; } }
package BaiTap; public class Hello { public static void main(String[] args) { // Scanner scanner=new Scanner(System.in); // System.out.print("Enter your name: "); // String name = scanner.nextLine(); // // System.out.println("Hello: " + name); long millis=System.currentTimeMillis(); java.sql.Date date=new java.sql.Date(millis); System.out.println(date); } }
package com.storageservice.bmi.dao; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; public enum StorageServiceDao { instance; private EntityManagerFactory emf; // entity manager init private StorageServiceDao() { if (emf != null) { emf.close(); } emf = Persistence.createEntityManagerFactory("storage-service-jpa"); } // entity manager creation public EntityManager createEntityManager() { return emf.createEntityManager(); } // entity manager close public void closeConnections(EntityManager em) { em.close(); } // transaction public EntityTransaction getTransaction(EntityManager em) { return em.getTransaction(); } public EntityManagerFactory getEntityManagerFactory() { return emf; } }
package nodes; import flow.*; import nodes.base.*; import exceptions.*; public class Source extends AbstractNode implements Sender { private Wire output; public Source() { output = new Wire(); } @Override public String getType() { return "SOURCE"; } public void switchOn() { output.setValue(Bit.ONE); } public void switchOff() { output.setValue(Bit.ZERO); } @Override public Wire getOutput(int param) { if (param != 0) { throw new LogicException(); } return output; } }
package com.locadoraveiculosweb.util; public class PasswordUtils { }
package com.tencent.mm.plugin.voiceprint.model; import android.os.Parcel; import android.os.Parcelable.Creator; class VertifyInfo$1 implements Creator<VertifyInfo> { VertifyInfo$1() { } public final /* synthetic */ Object createFromParcel(Parcel parcel) { boolean z = true; VertifyInfo vertifyInfo = new VertifyInfo(); vertifyInfo.oFi = parcel.readInt(); vertifyInfo.oFj = parcel.readInt(); vertifyInfo.oFk = parcel.readInt(); vertifyInfo.oFa = parcel.readInt(); vertifyInfo.gEw = parcel.readString(); vertifyInfo.oET = parcel.readString(); vertifyInfo.mFileName = parcel.readString(); vertifyInfo.oFl = parcel.readInt() > 0; if (parcel.readInt() <= 0) { z = false; } vertifyInfo.oFm = z; vertifyInfo.oFa = vertifyInfo.oFi; return vertifyInfo; } public final /* bridge */ /* synthetic */ Object[] newArray(int i) { return new VertifyInfo[i]; } }
package com.duanxr.yith.hard; import java.util.Stack; /** * @author 段然 2021/10/11 */ public class IntegerToEnglishWords { /** * Convert a non-negative integer num to its English words representation. * *   * * Example 1: * * Input: num = 123 * Output: "One Hundred Twenty Three" * Example 2: * * Input: num = 12345 * Output: "Twelve Thousand Three Hundred Forty Five" * Example 3: * * Input: num = 1234567 * Output: "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven" * Example 4: * * Input: num = 1234567891 * Output: "One Billion Two Hundred Thirty Four Million Five Hundred Sixty Seven Thousand Eight Hundred Ninety One" *   * * Constraints: * * 0 <= num <= 231 - 1 * * 将非负整数 num 转换为其对应的英文表示。 * *   * * 示例 1: * * 输入:num = 123 * 输出:"One Hundred Twenty Three" * 示例 2: * * 输入:num = 12345 * 输出:"Twelve Thousand Three Hundred Forty Five" * 示例 3: * * 输入:num = 1234567 * 输出:"One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven" * 示例 4: * * 输入:num = 1234567891 * 输出:"One Billion Two Hundred Thirty Four Million Five Hundred Sixty Seven Thousand Eight Hundred Ninety One" *   * * 提示: * * 0 <= num <= 231 - 1 * */ class Solution { private final String[] w1 = {"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}; private final String[] w2 = {"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}; private final String[] w3 = {"", "Thousand", "Million", "Billion", "Trillion"}; public String numberToWords(int num) { return num == 0 ? w1[0] : toString(new Stack<>(), num); } private String toString(Stack<String> stack, int num) { int i = 0; while (num != 0) { int val = num % 1000; if (val != 0) { if (i > 0) { stack.push(w3[i]); } toString999(stack, val); } num /= 1000; i++; } StringBuilder sb = new StringBuilder(); while (!stack.isEmpty()) { sb.append(stack.pop()).append(' '); } sb.setLength(sb.length() - 1); return sb.toString(); } private void toString999(Stack<String> stack, int num) { toString99(stack, num % 100); toString900(stack, num / 100); } private void toString900(Stack<String> stack, int num) { if (num != 0) { stack.push("Hundred"); stack.push(w1[num]); } } private void toString99(Stack<String> stack, int num) { if (num != 0) { if (num < 20) { stack.push(w1[num]); } else { int mod = num % 10; if (mod != 0) { stack.push(w1[mod]); } stack.push(w2[num / 10 - 2]); } } } } class Solution1 { private final String[] w0 = {"Thousand", "Million", "Billion", "Trillion"}; private final String[] w1 = {"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}; private final String[] w2 = {"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}; public String numberToWords(int num) { return num == 0 ? w1[0] : toString(new Stack<>(), num); } private String toString(Stack<String> stack, int num) { int i = 0; while (num != 0) { int val = num % 1000; if (val != 0) { if (i > 0) { stack.push(w0[i - 1]); } toString999(stack, val); } num /= 1000; i++; } StringBuilder sb = new StringBuilder(); while (!stack.isEmpty()) { sb.append(stack.pop()).append(' '); } sb.setLength(sb.length() - 1); return sb.toString(); } private void toString999(Stack<String> stack, int num) { if (num != 0) { toString99(stack, num % 100); toString900(stack, num / 100); } } private void toString900(Stack<String> stack, int num) { if (num != 0) { stack.push("Hundred"); stack.push(w1[num]); } } private void toString99(Stack<String> stack, int num) { if (num != 0) { if (num < 20) { stack.push(w1[num]); } else { int mod = num % 10; if (mod != 0) { stack.push(w1[mod]); } stack.push(w2[num / 10 - 2]); } } } } }
package com.rofour.baseball.service.message; import com.rofour.baseball.controller.model.message.MsgTmplMymsgInfo; import java.util.List; /** * @ClassName: MsgTmplMymsgService * @Description: 用户消息模板操作服务 * @author: xulang * @date: 2016年09月06日 13:21 */ public interface MsgTmplMymsgService { /** * 删除 * * @param id * @return */ int delete(Integer id); /** * 新增 * * @param record * @return */ int insert(MsgTmplMymsgInfo record) throws Exception; /** * 按主键查询 * * @param id * @return */ MsgTmplMymsgInfo selectByPrimaryKey(Integer id); /** * 按条件查询 * * @param msgType * @param limit * @param offset * @return */ List<MsgTmplMymsgInfo> selectAll(Integer msgType, Integer limit, Integer offset); /** * 按条件查询列表条数 * * @param msgType * @return */ int selectAllCount(Integer msgType); /** * 更新 * * @param record * @return */ int update(MsgTmplMymsgInfo record) throws Exception; }
package org.opentosca.core.model.endpoint.rest; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.persistence.UniqueConstraint; import javax.xml.namespace.QName; import org.eclipse.persistence.annotations.Convert; import org.eclipse.persistence.annotations.Converter; import org.opentosca.core.model.csar.id.CSARID; import org.opentosca.core.model.endpoint.GenericEndpoint; /** * This class Represents a REST-Endpoint (an endpoint with a REST-Operation). * For the fields of this class refer to the REST operation element in the * TOSCA-Specification. * * Copyright 2012 IAAS University of Stuttgart <br> * <br> * * @author Matthias Fetzer - fetzerms@studi.informatik.uni-stuttgart.de * */ // Named Queries for JPA // @formatter:off @NamedQueries({ @NamedQuery(name = RESTEndpoint.getEndpointForPath, query = RESTEndpoint.getEndpointForPathQuery), @NamedQuery(name = RESTEndpoint.getEndpointForPathAndMethod, query = RESTEndpoint.getEndpointForPathAndMethodQuery), @NamedQuery(name = RESTEndpoint.getEndpointForUri, query = RESTEndpoint.getEndpointForUriQuery) }) // @formatter:on @Entity @Inheritance(strategy = InheritanceType.JOINED) @Table(name = RESTEndpoint.tableName, uniqueConstraints = @UniqueConstraint(columnNames = {"path", "method", "csarId"})) public class RESTEndpoint extends GenericEndpoint { protected static final String tableName = "RESTEndpoint"; // Named queries: // Query to retrieve RESTEndpoints by Path. public static final String getEndpointForPath = "RESTEndpoint.getByPath"; protected static final String getEndpointForPathQuery = "select t from " + RESTEndpoint.tableName + " t where t.path = :path and t.csarId = :csarId"; // Query to retrieve a RESTEndpoint by Path and Method public static final String getEndpointForPathAndMethod = "RESTEndpoint.getByPathAndMethod"; protected static final String getEndpointForPathAndMethodQuery = "select t from " + RESTEndpoint.tableName + " t where t.path = :path and t.method = :method and t.csarId = :csarId"; // Query to check if an Endpoint with given URI exists. public static final String getEndpointForUri = "RESTEndpoint.getByUri"; protected static final String getEndpointForUriQuery = "select t from " + RESTEndpoint.tableName + " t where t.uri = :uri and t.csarId = :csarId"; public static enum restMethod { GET, PUT, POST, DELETE }; // Converter to Convert QNames to String, and back from String to QName. // Used when persisting, so we can Query for QName-Objects. @Basic @Converter(name = "QNameConverter", converterClass = org.opentosca.util.jpa.converters.QNameConverter.class) @Column(name = "method") private restMethod method; @Column(name = "path") private String path; @Convert("QNameConverter") private QName requestPayload; @Convert("QNameConverter") private QName responsePayload; @Column(name = "RequestHeaders") private List<RequestHeader> headers = new ArrayList<RequestHeader>(); @Column(name = "Parameters") private List<Parameter> params = new ArrayList<Parameter>(); public RESTEndpoint() { super(); } public RESTEndpoint(URI uri, restMethod method, CSARID csarId) { super(uri, csarId); this.method = method; this.path = uri.getPath(); } public RESTEndpoint(String host, String path, restMethod method, CSARID csarId) throws URISyntaxException { // Check if the path starts with a "/", if not we prepend a "/". this(new URI(host + ((path.charAt(0) == '/') ? path : '/' + path)), method, csarId); } public RESTEndpoint(URI uri, restMethod method, QName requestPayload, QName responsePayload, CSARID csarId) { this(uri, method, csarId); this.requestPayload = requestPayload; this.responsePayload = responsePayload; } public QName getRequestPayload() { return this.requestPayload; } public QName getResponsePayload() { return this.responsePayload; } public restMethod getRequestMethod() { return this.method; } public String getPath() { return this.path; } public void setPath(String path) { this.path = path; } public void addParameter(Parameter p) { this.params.add(p); } public void addRequestHeader(RequestHeader h) { this.headers.add(h); } public List<RequestHeader> getRequestHeaders() { return this.headers; } public List<Parameter> getParameters() { return this.params; } }
package bookexercises.chapter1.fundamentals.two; import edu.princeton.cs.algs4.Point2D; import edu.princeton.cs.algs4.StdDraw; import edu.princeton.cs.algs4.StdOut; import edu.princeton.cs.algs4.StdRandom; /** * Write a Point2D client that takes an integer value N from the command line, * generates N random points in the unit square, * and computes the distance separating the closest pair of points. * * @author atlednolispe * @email atlednolispe@gmail.com * @date 2018/6/29 */ public class One { public static Point2D[] generatePoint2DArray(int N) { Point2D[] point2DArray = new Point2D[N]; StdDraw.setPenRadius(0.01); for (int i = 0; i != N; ++i) { point2DArray[i] = new Point2D(StdRandom.uniform(), StdRandom.uniform()); point2DArray[i].draw(); } return point2DArray; } public static void main(String[] args) { int N = Integer.parseInt(args[0]); Point2D[] point2DArray = generatePoint2DArray(N); double minDistance = Math.sqrt(2); int index0 = 0, index1 = 1; for (int i = 0; i != N; ++i) { for (int j = i+1; j != N; ++j) { double distance = point2DArray[i].distanceTo(point2DArray[j]); if (distance < minDistance) { minDistance = distance; index0 = i; index1 = j; } } } // draw the closest pair of points in green StdDraw.setPenColor(StdDraw.GREEN); point2DArray[index0].draw(); point2DArray[index1].draw(); StdOut.println("The distance separating the closest pair of points is: "); StdOut.println(point2DArray[index0]); StdOut.println(point2DArray[index1]); StdOut.println("Distance is " + minDistance + "."); } }
package com.NewIO; import java.io.File; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Path; import java.nio.file.Paths; public class Path接口 { public static void main(String[] args) { Path path = Paths.get("D:","test","test","zhang.txt"); System.out.println(path); File file = new File(String.valueOf(path)); System.out.println(file.toPath()); FileSystems.getDefault().getPath("D:","test","test","zhang.txt"); } }
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package com.hybris.backoffice.widgets.syncpopup; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyList; import static org.mockito.Matchers.anyMap; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.same; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; import de.hybris.platform.catalog.model.CatalogModel; import de.hybris.platform.catalog.model.CatalogVersionModel; import de.hybris.platform.catalog.model.SyncItemJobModel; import de.hybris.platform.core.model.ItemModel; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.function.Predicate; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Button; import org.zkoss.zul.Div; import org.zkoss.zul.Label; import org.zkoss.zul.ListModelList; import org.zkoss.zul.Listbox; import org.zkoss.zul.Tab; import org.zkoss.zul.Tabbox; import org.zkoss.zul.Textbox; import com.google.common.collect.Lists; import com.hybris.backoffice.sync.facades.SynchronizationFacade; import com.hybris.cockpitng.labels.LabelService; import com.hybris.cockpitng.testing.AbstractWidgetUnitTest; import com.hybris.cockpitng.testing.annotation.DeclaredInput; import com.hybris.cockpitng.testing.annotation.DeclaredViewEvent; import com.hybris.cockpitng.testing.annotation.ExtensibleWidget; @DeclaredInput(value = SyncPopupController.SOCKET_IN_INPUT_OBJECT, socketType = ItemModel.class) @DeclaredInput(value = SyncPopupController.SOCKET_IN_INPUT_OBJECTS, socketType = List.class) @DeclaredViewEvent(componentID = SyncPopupController.PULLLIST_ID, eventName = Events.ON_SELECT) @DeclaredViewEvent(componentID = SyncPopupController.PUSHLIST_ID, eventName = Events.ON_SELECT) @DeclaredViewEvent(componentID = SyncPopupController.SEARCHBOX_ID, eventName = Events.ON_CHANGING) @DeclaredViewEvent(componentID = SyncPopupController.CANCEL_BUTTON_ID, eventName = Events.ON_CLICK) @DeclaredViewEvent(componentID = SyncPopupController.SYNC_BUTTON_ID, eventName = Events.ON_CLICK) @ExtensibleWidget(level = ExtensibleWidget.ALL) public class SyncPopupControllerTest extends AbstractWidgetUnitTest<SyncPopupController> { private static final String SAMPLE_JOB_MODEL_DESCRIPTION = "sample description"; @Spy @InjectMocks private SyncPopupController controller; @Mock private Listbox pullList; @Mock private Listbox pushList; @Mock private Textbox searchbox; @Mock private Tabbox tabbox; @Mock private Label title; @Mock private Button sync; @Mock private LabelService labelService; @Mock private SynchronizationFacade synchronizationFacade; @Mock private Tab pullTab; @Mock private Tab pushTab; @Before public void before() { controller.initialize(new Div()); doNothing().when(controller).showWarningMessageBox(anyString(), anyString()); doAnswer(inv -> { final SyncJobsLoader loader = spy(new SyncJobsLoader((List<ItemModel>) inv.getArguments()[0])); doReturn(synchronizationFacade).when(loader).getSynchronizationFacade(); return loader; }).when(controller).createSyncDataLoader(any()); when(synchronizationFacade.getSyncCatalogVersion(any())).thenReturn(Optional.empty()); when(synchronizationFacade.performSynchronization(any())).thenReturn(Optional.empty()); when(synchronizationFacade.isInSync(anyList(), any(), anyMap())).thenReturn(Optional.empty()); } @Test public void testSelectedSync() { final ItemModel item = mock(ItemModel.class); final List<SyncItemJobModel> pullModels = new ArrayList<>(); pullModels.add(createSampleJobModelMock()); pullModels.add(createSampleJobModelMock()); pullModels.add(createSampleJobModelMock()); pullModels.add(createSampleJobModelMock()); final List<SyncItemJobModel> pushModels = new ArrayList<>(); pushModels.add(createSampleJobModelMock()); pushModels.add(createSampleJobModelMock()); pushModels.add(createSampleJobModelMock()); pushModels.add(createSampleJobModelMock()); final CatalogVersionModel cv = mock(CatalogVersionModel.class); when(synchronizationFacade.getSyncCatalogVersion(Lists.newArrayList(item))).thenReturn(Optional.of(cv)); when(synchronizationFacade.getInboundSynchronizations(cv)).thenReturn(pullModels); when(synchronizationFacade.getOutboundSynchronizations(cv)).thenReturn(pushModels); when(synchronizationFacade.getCatalogVersionAwareItems(any())).thenAnswer(inv -> inv.getArguments()[0]); when(synchronizationFacade.performSynchronization(any())).thenReturn(Optional.of("testCode")); when(synchronizationFacade.canSync(any())).thenReturn(true); controller.showSyncJobsForInputObject(item); controller.getPullListModel().addToSelection(controller.getPullListModel().get(1)); executeViewEvent(SyncPopupController.PULLLIST_ID, Events.ON_SELECT); controller.getPushListModel().addToSelection(controller.getPushListModel().get(2)); executeViewEvent(SyncPopupController.PUSHLIST_ID, Events.ON_SELECT); executeViewEvent(SyncPopupController.SYNC_BUTTON_ID, Events.ON_CLICK); assertSocketOutput(SyncPopupController.SOCKET_STARTED_SYNC_CRON_JOB, (Predicate<String>) "testCode"::equals); } @Test public void testPullListSelectDeselectsPushList() { final List<SyncPopupViewModel> pullModels = new ArrayList<>(); pullModels.add(new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PULL, Boolean.FALSE)); pullModels.add(new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PULL, Boolean.FALSE)); pullModels.add(new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PULL, Boolean.FALSE)); pullModels.add(new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PULL, Boolean.FALSE)); final ListModelList<SyncPopupViewModel> pullListModel = controller.getPullListModel(); pullListModel.addAll(pullModels); assertThat(pullListModel.getSelection()).isEmpty(); assertThat(controller.getPushListModel().getSelection()).isEmpty(); pullListModel.setSelection(Lists.newArrayList(pullModels.get(2))); assertThat(pullListModel.getSelection().size()).isEqualTo(1); assertThat(pullListModel.getSelection().iterator().next()).isEqualTo(pullModels.get(2)); executeViewEvent(SyncPopupController.PUSHLIST_ID, Events.ON_SELECT); assertThat(pullListModel.getSelection()).isEmpty(); } @Test public void testPushListSelectDeselectsPullList() { final List<SyncPopupViewModel> pushModels = new ArrayList<>(); pushModels.add(new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PUSH, Boolean.FALSE)); pushModels.add(new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PUSH, Boolean.FALSE)); pushModels.add(new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PUSH, Boolean.FALSE)); pushModels.add(new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PUSH, Boolean.FALSE)); final ListModelList<SyncPopupViewModel> pushListModel = controller.getPushListModel(); pushListModel.addAll(pushModels); assertThat(pushListModel.getSelection()).isEmpty(); assertThat(controller.getPullListModel().getSelection()).isEmpty(); pushListModel.setSelection(Lists.newArrayList(pushModels.get(2))); assertThat(pushListModel.getSelection().size()).isEqualTo(1); assertThat(pushListModel.getSelection().iterator().next()).isEqualTo(pushModels.get(2)); executeViewEvent(SyncPopupController.PULLLIST_ID, Events.ON_SELECT); assertThat(pushListModel.getSelection()).isEmpty(); } @Test public void testPullJobsAreLoadedOnlyOnce() { final CatalogVersionModel cv1 = mock(CatalogVersionModel.class); final CatalogVersionModel cv2 = mock(CatalogVersionModel.class); final ItemModel item1 = mock(ItemModel.class); final ItemModel item2 = mock(ItemModel.class); final SyncItemJobModel job1 = createSampleJobModelMock(); final SyncItemJobModel job2 = createSampleJobModelMock(); final SyncItemJobModel job3 = createSampleJobModelMock(); final ArrayList<SyncItemJobModel> jobsCv1 = Lists.newArrayList(job1, job2); final ArrayList<SyncItemJobModel> jobsCv2 = Lists.newArrayList(job3); when(synchronizationFacade.getInboundSynchronizations(same(cv1))).thenReturn(jobsCv1); when(synchronizationFacade.getInboundSynchronizations(same(cv2))).thenReturn(jobsCv2); when(synchronizationFacade.canSync(any())).thenReturn(true); when(synchronizationFacade.getSyncCatalogVersion(Lists.newArrayList(item1))).thenReturn(Optional.of(cv1)); when(synchronizationFacade.getSyncCatalogVersion(Lists.newArrayList(item2))).thenReturn(Optional.of(cv2)); when(synchronizationFacade.getCatalogVersionAwareItems(any())).thenAnswer(inv -> inv.getArguments()[0]); //first object came executeInputSocketEvent(SyncPopupController.SOCKET_IN_INPUT_OBJECT, item1); assertThat(controller.getPullListModel()).hasSize(2); assertThat(controller.getPullListModel().get(0).getJobModel()).isEqualTo(job1); assertThat(controller.getPullListModel().get(1).getJobModel()).isEqualTo(job2); //second object - old jobs should be removed executeInputSocketEvent(SyncPopupController.SOCKET_IN_INPUT_OBJECT, item2); assertThat(controller.getPullListModel()).hasSize(1); assertThat(controller.getPullListModel().get(0).getJobModel()).isEqualTo(job3); } @Test public void testPushJobsAreLoadedOnlyOnce() { final CatalogVersionModel cv1 = mock(CatalogVersionModel.class); final CatalogVersionModel cv2 = mock(CatalogVersionModel.class); final ItemModel item1 = mock(ItemModel.class); final ItemModel item2 = mock(ItemModel.class); final SyncItemJobModel job1 = createSampleJobModelMock(); final SyncItemJobModel job2 = createSampleJobModelMock(); final SyncItemJobModel job3 = createSampleJobModelMock(); final ArrayList<SyncItemJobModel> jobsCv1 = Lists.newArrayList(job1, job2); final ArrayList<SyncItemJobModel> jobsCv2 = Lists.newArrayList(job3); when(synchronizationFacade.getOutboundSynchronizations(same(cv1))).thenReturn(jobsCv1); when(synchronizationFacade.getOutboundSynchronizations(same(cv2))).thenReturn(jobsCv2); when(synchronizationFacade.getSyncCatalogVersion(Lists.newArrayList(item1))).thenReturn(Optional.of(cv1)); when(synchronizationFacade.getSyncCatalogVersion(Lists.newArrayList(item2))).thenReturn(Optional.of(cv2)); when(synchronizationFacade.canSync(any())).thenReturn(true); when(synchronizationFacade.getCatalogVersionAwareItems(any())).thenAnswer(inv -> inv.getArguments()[0]); //first object came executeInputSocketEvent(SyncPopupController.SOCKET_IN_INPUT_OBJECTS, Lists.newArrayList(item1)); assertThat(controller.getPushListModel()).hasSize(2); assertThat(controller.getPushListModel().get(0).getJobModel()).isEqualTo(job1); assertThat(controller.getPushListModel().get(1).getJobModel()).isEqualTo(job2); //second object - old jobs should be removed executeInputSocketEvent(SyncPopupController.SOCKET_IN_INPUT_OBJECTS, Lists.newArrayList(item2)); assertThat(controller.getPushListModel()).hasSize(1); assertThat(controller.getPushListModel().get(0).getJobModel()).isEqualTo(job3); } @Test public void testListsClearedWhenSecondObjectIsNotCatalogVersionAware() { final CatalogVersionModel cv1 = mock(CatalogVersionModel.class); final ItemModel item1 = mock(ItemModel.class); final ItemModel item2 = mock(ItemModel.class); final SyncItemJobModel job1 = createSampleJobModelMock(); final SyncItemJobModel job2 = createSampleJobModelMock(); final ArrayList<SyncItemJobModel> jobsCv1 = Lists.newArrayList(job1, job2); when(synchronizationFacade.getOutboundSynchronizations(same(cv1))).thenReturn(jobsCv1); when(synchronizationFacade.getSyncCatalogVersion(Lists.newArrayList(item1))).thenReturn(Optional.of(cv1)); when(synchronizationFacade.getSyncCatalogVersion(Lists.newArrayList(item2))).thenReturn(Optional.empty()); when(synchronizationFacade.canSync(any())).thenReturn(true); when(synchronizationFacade.getCatalogVersionAwareItems(any())).thenAnswer(inv -> inv.getArguments()[0]); //first object came executeInputSocketEvent(SyncPopupController.SOCKET_IN_INPUT_OBJECT, item1); assertThat(controller.getPushListModel()).hasSize(2); assertThat(controller.getPushListModel().get(0).getJobModel()).isEqualTo(job1); assertThat(controller.getPushListModel().get(1).getJobModel()).isEqualTo(job2); //second object - no common catalog found - list cleared executeInputSocketEvent(SyncPopupController.SOCKET_IN_INPUT_OBJECT, item2); assertThat(controller.getPushListModel()).hasSize(0); } @Test public void testPackModels() { final List<SyncPopupViewModel> pullList = controller.packModels(createSampleJobModelList(5), SyncJobType.PULL); final List<SyncPopupViewModel> pushList = controller.packModels(createSampleJobModelList(4), SyncJobType.PUSH); assertThat(pullList.size()).isEqualTo(5); assertThat(pushList.size()).isEqualTo(4); assertThat(pullList.get(0).getType()).isEqualTo(SyncJobType.PULL); assertThat(pushList.get(0).getType()).isEqualTo(SyncJobType.PUSH); assertThat(pullList.get(1).getDescription()).isEqualTo(SAMPLE_JOB_MODEL_DESCRIPTION); assertThat(pushList.get(1).getDescription()).isEqualTo(SAMPLE_JOB_MODEL_DESCRIPTION); assertThat(pullList.get(2).getJobModel()).isNotNull(); assertThat(pushList.get(2).getJobModel()).isNotNull(); assertThat(pullList.get(3).getName()).isNotNull(); assertThat(pushList.get(3).getName()).isNotNull(); } @Test public void testUnpackSelectedModels() { final SyncPopupViewModel[] pullModels = new SyncPopupViewModel[4]; pullModels[0] = new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PULL, Boolean.FALSE); pullModels[1] = new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PULL, Boolean.FALSE); pullModels[2] = new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PULL, Boolean.FALSE); pullModels[3] = new SyncPopupViewModel(createSampleJobModelMock(), SyncJobType.PULL, Boolean.FALSE); final ListModelList<SyncPopupViewModel> pullListModel = new ListModelList<>(pullModels); pullListModel.setSelection(Lists.newArrayList(pullModels[1])); final List<SyncItemJobModel> syncItemJobModels = controller.unpackModels(pullListModel.getSelection()); assertThat(syncItemJobModels.size()).isEqualTo(1); assertThat(syncItemJobModels.get(0).getCode()).isEqualTo(SAMPLE_JOB_MODEL_DESCRIPTION); } @Test public void testGetSyncItems() { assertThat(controller.getSyncItems()).isNotNull(); assertThat(controller.getSyncItems()).isEmpty(); final List<ItemModel> models = new ArrayList<>(); models.add(new ItemModel()); models.add(new ItemModel()); models.add(new ItemModel()); controller.setValue(SyncPopupController.MODEL_SYNC_ITEMS, models); assertThat(controller.getSyncItems().size()).isEqualTo(3); } private List<SyncItemJobModel> createSampleJobModelList(final int size) { final List<SyncItemJobModel> list = new ArrayList<>(); for (int i = 0; i < size; i++) { list.add(createSampleJobModelMock()); } return list; } private SyncItemJobModel createSampleJobModelMock() { final SyncItemJobModel model = mock(SyncItemJobModel.class); Mockito.when(model.getCode()).thenReturn(SAMPLE_JOB_MODEL_DESCRIPTION); final CatalogVersionModel catalogVersionModel = mock(CatalogVersionModel.class); Mockito.when(catalogVersionModel.getCatalog()).thenReturn(mock(CatalogModel.class)); Mockito.when(model.getSourceVersion()).thenReturn(catalogVersionModel); return model; } @Override protected SyncPopupController getWidgetController() { return controller; } }
package com.example.danielatienza.farmdropapp.di.component; import com.example.danielatienza.farmdropapp.di.module.MainModule; import com.example.danielatienza.farmdropapp.di.scope.Activity; import com.example.danielatienza.farmdropapp.presenter.main.MainPresenter; import com.example.danielatienza.farmdropapp.ui.main.MainActivity; import com.example.danielatienza.farmdropapp.ui.main.ProducersAdapter; import dagger.Component; /** * Created by danielatienza on 14/12/2016. */ @Activity @Component(dependencies = AppComponent.class, modules = MainModule.class) public interface MainComponent { void inject(MainActivity mainActivity); MainPresenter provideMainPresenter(); }
/** * Provides exception artifacts related to Hemajoo's Foundation resource bundle. */ package com.hemajoo.foundation.common.exception;
package com.microsilver.mrcard.basicservice.model.enums; public enum EWarning { Unknown("未知错误",1000), NonExistent("账号不存在",1001), PasswordError("密码错误",1002), SendCheckCodeError("发送验证码错误",1003), CheckCodeError("验证码不正确",1004), CheckCodeNonExistent("没有查询到验证码",1005), CheckCode_Overdue("验证码已过期 ",1006), Order_ErrorStatus("订单状态错误",1007), MobileExist("手机号已存在",1008), MobileRegistered("手机已注册",1009), NoGetCheckCode("为获取到验证码,请联系管理员",1010), CheckCodeTypeNotSame("验证码类型不一致",1043), MessageIsNull("你输入的信息为空",1011), PhoneIsNull("手机号为空",1012), CheckCodeIsNull("验证码为空",1013), NoUserOfAddress("无该用户或者该用户的地址信息",1014), UserNoAddress("该用户无地址可使用",1015), MobileNotRegister("手机号未注册",1018), Order_Overdue("订单已过期 ",1019), Order_Repeat_Payment("订单重复支付",1020), NoOrderInfo("无订单信息",1021), CardNotSame("身份证信息不一致",1022), NotType("无该类型",1023), NoAreaMsg("无区域信息",1024), MobileNotConformingToSpecifications("电话不符合规格",1025), UninitializedVersion("未初始化版本",1026), NotPerfectData("未完善资料",1027), RobbOrderError("抢单失败",1028), OperationFailed("操作失败",1029), AliPayAccountError("支付宝信息不正确",1030), BalanceNotEnough("余额不足",1031), NoFinanceMsg("无财务信息",1032), NotWithDrawDate("不在提现日期内",1033), OrderAccountError("订单金额错误",1034), DispatchError("运费不一致",1035), NoFinance("无财务信息",1036), DeliveryDisable("骑手已禁用",1037), PlatFormNoFinanceMsg("平台无财务信息",1038), DeliveryNoFinanceMsg("骑手无财务信息",1039), AgentNoFinanceMsg("代理商无财务信息",1040), NoDeliveryServiceScore("无骑手服务分",1041), ErrorParams("参数错误",9002), NoAgent("无代理商信息",1042), Too_Slow("手慢啦!",10086), ; protected String name; protected int value; private EWarning(String name, int value){ this.name=name; this.value=value; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getValue() { return value; } public void setValue(int value) { this.value = value; } public static EWarning valueOf(int value){ switch (value) { case 1001: return NonExistent ; case 2002: return PasswordError ; default: return Unknown ; } } }
package com.pointburst.jsmusic.events; /** * Created by kshitij on 30/7/14. */ public class ServiceClosedEvent { }
//This file is part of JPACS. // // JPACS 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. // // JPACS 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 JPACS. If not, see <http://www.gnu.org/licenses/>. package br.pucminas.dcc.jpacs; import br.pucminas.dcc.jpacs.gui.MainFrame; /** * Classe Principal do JPACS, contém o método main */ public class JPACS { public static void main(String args[]) { if(args.length>=2) Internacionalizacao.create(args[0],args[1]); else { Internacionalizacao.readFromFile("JPACS.lang"); } MainFrame JanelaPrincipal = new MainFrame(); } }
package LessonsJavaCore_1; import static MyClassesToWork.Print.print; public class Lesson_2 { public static void main ( String[] args ) { print ( "Максимальне значення BYTE - " + Byte.MAX_VALUE ); print ( "Мінімальне значення BYTE - " + Byte.MIN_VALUE ); print ( "Максимальне значення Character - " + Character.MAX_VALUE ); print ( "Мінімальне значення Character - " + Character.MIN_VALUE ); print ( "Максимальне значення Double - " + Double.MAX_VALUE ); print ( "Мінімальне значення Double - " + Double.MIN_VALUE ); print ( "Максимальне значення Float - " + Float.MAX_VALUE ); print ( "Мінімальне значення Float - " + Float.MAX_VALUE); print ( "Максимальне значення Integer - " + Integer.MAX_VALUE ); print ( "Мінімальне значення Integer - " + Integer.MIN_VALUE ); print ( "Максимальне значення Long - " + Long.MAX_VALUE ); print ( "Мінімальне значення Long - " + Long.MIN_VALUE ); print ( "Максимальне значення Short - " + Short.MAX_VALUE ); print ( "Мінімальне значення Short - " + Short.MIN_VALUE ); } }
import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; public class Database { static String defaultFilename = "phonebookDatabase.txt"; // - List all entries in the phone book. public static void listAll() throws IOException{ ArrayList<Entries> entries = new ArrayList<Entries>(); //read all entries into arraylist entries = readEntriesFromFile(); //print them out. printEntries(true,entries); } // - Create a new entry to the phone book. public static void addEntry(Entries entry) throws IOException{ ArrayList<Entries> entriesArrayList = new ArrayList<Entries>(); //read all entries into arraylist entriesArrayList = readEntriesFromFile(); //Add new entry to the list @ index 0 entriesArrayList.add(0,entry); //Sort the arraylist sortEntriesBySurname(entriesArrayList); //write modified & sorted arraylist to file writeToFile(entriesArrayList); } // - Remove an existing entry in the phone book. public static void removeEntry(int entryNumber) throws Exception{ ArrayList<Entries> entriesArrayList = new ArrayList<Entries>(); //read all entries into arraylist entriesArrayList = readEntriesFromFile(); //check valid entry if (entryNumber > (entriesArrayList.size()-1)){ throw new Exception(); } //remove one entry entriesArrayList.remove(entryNumber); //write entries to file. writeToFile(entriesArrayList); } // - Update an existing entry in the phone book. public static void editEntry(int entryNumber, String firstname, String surname, String number, String address) throws Exception{ ArrayList<Entries> entriesArrayList = new ArrayList<Entries>(); //read all entries into arraylist entriesArrayList = readEntriesFromFile(); //check valid entry number given if (entryNumber > (entriesArrayList.size()-1)){ throw new Exception(); } //edit something Entries entry = entriesArrayList.get(entryNumber); entry.setFirstname(firstname); entry.setSurname(surname); entry.setNumber(number); entry.setAddress(address); entriesArrayList.remove(entryNumber); //Add edited entry to the list @ index 0 entriesArrayList.add(0,entry); //Sort the arraylist sortEntriesBySurname(entriesArrayList); writeToFile(entriesArrayList); } // - Search for entries in the phone book by surname. public static void searchEntries(String searchterms) throws IOException{ ArrayList<Entries> entriesArrayList = new ArrayList<Entries>(); //read all entries into arraylist entriesArrayList = readEntriesFromFile(); //for each entry if surname does not contain search term remove, starting from the bottom for (int i = entriesArrayList.size()-1; i >= 0; i--){ Entries entry = entriesArrayList.get(i); if (!entry.getSurname().contains(searchterms)){ entriesArrayList.remove(i); } } printEntries(false, entriesArrayList); } //printing out entries to console with addition of entry numbers if Listing public static void printEntries(boolean listAllValues,ArrayList<Entries> entriesArraylist){ if (!entriesArraylist.isEmpty()){ if (listAllValues){ System.out.println("Listing all results:<br><br>"); int entryNumber = 0; for (Entries Entry : entriesArraylist){ System.out.println("Entry Number: " + entryNumber + "<br>"); System.out.println("Firstname: " + Entry.getFirstname() + "<br>"); System.out.println("Surname: " + Entry.getSurname() + "<br>"); System.out.println("Phone Number: " + Entry.getNumber() + "<br>"); System.out.println("Address: " + Entry.getAdress() + "<br><br>"); entryNumber++; } } else{ System.out.println("Listing search results:<br><br>"); for (Entries Entry : entriesArraylist){ System.out.println("Firstname: " + Entry.getFirstname() + "<br>"); System.out.println("Surname: " + Entry.getSurname() + "<br>"); System.out.println("Phone Number: " + Entry.getNumber() + "<br>"); System.out.println("Address: " + Entry.getAdress() + "<br><br>"); } } } else{ System.out.println("No values found."); } } // Sort aplabetically by Surname. public static ArrayList<Entries> sortEntriesBySurname(ArrayList<Entries> entriesArraylist) throws IOException{ //as the arraylist will always be sorted (comes sorted to start with) save at most 1 entry (when added or edited) //we can use a fairly simple method for sorting, placing the new/edited entry at the top of the arraylist and //performing a linear comparison with each following entry to see which string comes first. //loops through all entries, checks if surname is alphabetically > than next entry if so swaps them. for (int i = 0; i < entriesArraylist.size()-1; i++ ){ if (entriesArraylist.get(i).getSurname().compareToIgnoreCase(entriesArraylist.get(i + 1).getSurname())>0){ //System.out.println("Entry " + i + " Greater then entry " + (i+1) + " Swapping them!"); Entries placeholderEntry = entriesArraylist.get(i); entriesArraylist.remove(i); entriesArraylist.add(i+1, placeholderEntry); } } return entriesArraylist; } // - method to read from file. public static ArrayList<Entries> readEntriesFromFile() throws IOException{ Charset cs = Charset.forName("UTF-8"); //TODO either specify files must be encoded with utf-8 or check OS and use deafult. List<String> linesList = Files.readAllLines(getFilePath(), cs); ArrayList<Entries> listOfEntries = new ArrayList<Entries>(); for (String line : linesList){ String[] values = line.split("\\!"); if (values.length > 3){ listOfEntries.add(new Entries(values[0],values[1],values[2],values[3])); } else { listOfEntries.add(new Entries(values[0],values[1],values[2])); } } return listOfEntries; } //write arraylist to file in format. public static void writeToFile(ArrayList<Entries> entriesArraylist) throws IOException{ PrintWriter pw = new PrintWriter(getFilePath().toString()); for (int i = 0; i < entriesArraylist.size(); i++){ Entries entry = entriesArraylist.get(i); pw.println(entry.getFirstname() + "!" + entry.getSurname() + "!" + entry.getNumber() + "!" + entry.getAdress()); } pw.close(); } //get filepath public static Path getFilePath() { String homeDir = System.getProperty("user.home"); String fileName = defaultFilename; return Paths.get(homeDir, fileName); } //check file exists public static boolean checkFile(){ // Check the file exists as a normal file File file = getFilePath().toFile(); if ( ! file.exists() || file.isDirectory() ) { System.err.println("File does not exist or is directory"); return false; } return true; } }
package model.impl; import java.util.ArrayList; import java.util.List; import java.util.Vector; import model.AccessPoint; import model.GridPoint; import model.Level; import model.PathLossModel; import model.ReceiverCardImpl; import model.Room; import model.Trajectory; import model.TxRadioImpl; import model.Wall; public class SimpleIndoorDominantPathLossModelImpl implements PathLossModel { public void setOffset(double offset) { this.offset = offset; } private double freq_MHz; private Trajectory lastbestTraj; //InternPLmodel intern=null; private double PL0; private double n; private double offset=0; private double shad_margin; private double fade_margin; private double interf_margin; /*public PathLossModel getIntern() { return intern; }*/ /*public void setIntern(PathLossModel intern) { this.intern = (Zpoort) intern; }*/ public SimpleIndoorDominantPathLossModelImpl(double PL0, double n,double freq_MHz) { this.freq_MHz = freq_MHz; this.freq_MHz = freq_MHz; this.PL0=PL0; this.n=n; //intern=(InternPLmodel) PathLossModelFactory.newInstance("intern",PL0,n,freq_MHz); } public double getTotalMargin(double distance) { return this.fade_margin+this.interf_margin+this.shad_margin; } public double getMaxPL(double TxP,double TxGain,double RxGain,double RxReq,double total_margin){ return TxP-RxReq+RxGain+TxGain-total_margin; } public double getFreq() { return freq_MHz; } public Trajectory getLastbestTraj() { return lastbestTraj; } public double calculate_Pathloss(Room r, TransTxRadioImpl rad, GridPoint Rx,Vector<Wall> w, Trajectory posbestpath, double max_PL,Trajectory t) { AccessPoint parentAP=rad.getParentAP(); double losdist_cm=Rx.distance(parentAP.getCoordinates()); if(t!=null) { double []info=t.distanceAlongTrajectory(Rx, parentAP, w); double pathdist1_cm=info[0]; //intern.setLos(false); double pathloss1=getDistanceloss(pathdist1_cm,parentAP,Rx); /*if(Math.abs(pathdist1_cm-losdist_cm)<2) { intern.setLos(true); pathloss1=intern.giveLoss(pathdist1_cm,Rx,PLcorr); }*/ //System.out.println("1 "+pathloss1+t.getTotalLoss()+info[1]+offset); // totale formule uitvoeren return pathloss1+t.getTotalLoss()+info[1]+offset; } //intern.setLos(true); // traject unknown //kan er rechtstreeks heen: geen muren en rechte lijn if(parentAP.getRoom().toPolygon().contains(Rx)&&(r.isConvex()||(parentAP.determineNoWallsTxRx(Rx, r.getWalls())==0))){ //System.out.println("2 "+getDistanceloss(losdist_cm,ap,Rx)+offset); return getDistanceloss(losdist_cm,parentAP,Rx)+offset; } // reken minimum pathloss uit (heb je bij LOS) double min_pathloss4AllPaths=getDistanceloss(losdist_cm, parentAP, Rx); if(rad.getParentAP().getCoordinates().distance(GridPointFactory.newInstance(1120, 450))<1) System.out.println("minPL to "+Rx+" = "+min_pathloss4AllPaths); if(min_pathloss4AllPaths>max_PL) return 400000; //nog returntje voor te veel wallloss if(!parentAP.getRoom().equals(r)) { double minap=1000; for(Wall wal:parentAP.getRoom().getWalls()) if(!wal.isExterior()&&wal.getLoss()<minap) minap=wal.getLoss(); if(minap+min_pathloss4AllPaths>max_PL) return 500000; double minrx=1000; for(Wall wal:r.getWalls()) if(!wal.isExterior()&&wal.getLoss()<minrx) minrx=wal.getLoss(); if(minrx+min_pathloss4AllPaths>max_PL) return 800000; if(!parentAP.getRoom().isNeighbourOrSameRoom(r)) { if(minrx+minap+min_pathloss4AllPaths>max_PL) return 100000; } } List<Room> list = new ArrayList<Room>(); list.addAll(r.getLevel().getRooms()); List<Room> rs=parentAP.sortClosestRooms(list); //System.out.println("voor preprocessed"); for(Room k:rs) k.preprocess(parentAP,r.getLevel()); //System.out.println("preprocessed"); Level l=r.getLevel(); int apindex=r.giveIndex(parentAP); Trajectory[] DP=r.getAproominfo().elementAt(apindex).getDP(); DP[0].setLossSet(true); double cumulWallLoss=DP[0].getTotalLoss(); //directe pad Vector<Wall> directpathINTwalls=parentAP.determineWallsTxRx(Rx, w,false); if(directpathINTwalls!=null){//if null: there is an EXT wall that is penetrated double directpadINTwallloss=0; for (Wall dd:directpathINTwalls) directpadINTwallloss+=dd.getLoss(); if(cumulWallLoss==directpadINTwallloss) return min_pathloss4AllPaths+directpadINTwallloss+offset; } Vector<Wall> directpathwalls=parentAP.determineWallsTxRx(Rx, w,true);//exteriorwalls mag double directpadwallloss=0; for (Wall dd:directpathwalls) directpadwallloss+=dd.getLoss(); Double curlowestloss=min_pathloss4AllPaths+directpadwallloss+offset; /*if(Rx.getX()==4650 && Rx.getY()==3400 && rad.getParentAP().getCoordinates().getX()==2420){ System.out.println(rad.getParentAP().getCoordinates()); System.out.println("CWL dir "+directpadwallloss); for (Wall dd:directpathwalls) System.out.println("wall " +dd+" "+dd.getLoss()); System.out.println("DL dir"+min_pathloss4AllPaths); System.out.println("total dir "+curlowestloss); }*/ //einde directe pad if(min_pathloss4AllPaths+cumulWallLoss>max_PL) return 150000; double []info=DP[0].distanceAlongTrajectory(Rx, parentAP, w);//100k is zeker genoeg om beter te zijn double pathdist1_cm=info[0]; double pathloss1=getDistanceloss(pathdist1_cm,parentAP,Rx); double interactionloss=info[1]; if(pathloss1+cumulWallLoss+interactionloss<curlowestloss) curlowestloss=pathloss1+cumulWallLoss+interactionloss; lastbestTraj=DP[0]; int nowalls=0; for(int k=0;k<DP[0].getTrajectorywalls().size();k++) if(DP[0].getTrajectorywalls().elementAt(k).getLoss()>0) nowalls++; if(r.equals(parentAP.getRoom())||DP[1].getTrajectorywalls().size()>0){ DP[1].setLossSet(true); double cumulWallLoss2=DP[1].getTotalLoss(); double []info2=DP[1].distanceAlongTrajectory(Rx, parentAP, w);//100k is zeker genoeg om beter te zijn double pathdist1_cm2=info2[0]; //intern.setLos(false); double pathloss12=getDistanceloss(pathdist1_cm2,parentAP,Rx); /*if(Math.abs(pathdist1_cm2-losdist_cm)<2) { intern.setLos(true); pathloss12=intern.giveLoss(pathdist1_cm2,Rx,PLcorr); }*/ /*if(Math.abs(rad.getParentAP().getCoordinates().getX()-2420)<0.1&&Math.abs(rad.getParentAP().getCoordinates().getY()-430)<0.1) { if(Rx.getX()==4650&&Rx.getY()==3200) { DP[0].printTrajectory(); System.out.println("CWL "+DP[0].getTotalLoss()); System.out.println("IL"+info[1]); System.out.println("DL"+pathloss1); System.out.println("total "+(DP[0].getTotalLoss()+info[1]+pathloss1)); DP[1].printTrajectory(); System.out.println("CWL "+DP[1].getTotalLoss()); System.out.println("IL"+info2[1]); System.out.println("DL"+pathloss12); System.out.println("total "+(DP[1].getTotalLoss()+info2[1]+pathloss12)); } }*/ double interactionloss2=info2[1]; Double curlowestloss2=pathloss12+cumulWallLoss2+interactionloss2; if(curlowestloss2<curlowestloss) { //System.out.println(curlowestloss2+" < "+curlowestloss); curlowestloss=curlowestloss2; lastbestTraj=DP[1]; } } Double max_wall_loss=curlowestloss-min_pathloss4AllPaths; if(posbestpath!=null) { double cumulWallLoss3=posbestpath.getTotalLoss(); double []info3=posbestpath.distanceAlongTrajectory(Rx, parentAP, w);//100k is zeker genoeg om beter te zijn double pathdist2_cm=info3[0]; //intern.setLos(false); double pathloss3=getDistanceloss(pathdist2_cm,parentAP,Rx); /*if(Math.abs(pathdist2_cm-losdist_cm)<2) { intern.setLos(true); pathloss3=intern.giveLoss(pathdist2_cm,Rx,PLcorr); }*/ double interactionloss3=info3[1]; double totloss=pathloss3+cumulWallLoss3+interactionloss3; if(totloss<curlowestloss&&!posbestpath.equals(DP[0])&&!posbestpath.equals(DP[1])) { curlowestloss=totloss; max_wall_loss=curlowestloss-min_pathloss4AllPaths; lastbestTraj=posbestpath; } } Best_MaxLeft a=new Best_MaxLeft(); a.setCurlowestloss(curlowestloss); a.setMax_total_wallloss(max_wall_loss); a.setCurbestpath(lastbestTraj); a.setMax_PL(max_PL-min_pathloss4AllPaths); r.getLowestLoss(rad, l, a,Rx,w, posbestpath,nowalls); lastbestTraj=a.getCurbestpath(); /*if(Math.abs(rad.getParentAP().getCoordinates().getX()-2420)<0.1&&Math.abs(rad.getParentAP().getCoordinates().getY()-430)<0.1) { if(Rx.getX()==4650&&Rx.getY()==3200) { System.out.println("T up "+a.getCurlowestloss()+offset); a.getCurbestpath().printTrajectory(); } if(Rx.getX()==4650&&Rx.getY()==3400) { System.out.println("T down "+a.getCurlowestloss()+offset); a.getCurbestpath().printTrajectory(); } }*/ //System.out.println("3 "+a.getCurlowestloss()+offset); return a.getCurlowestloss()+offset; } public double calculateMaxDist(double min_P_req,TxRadioImpl rad,int TxHeight,int RxHeight,ReceiverCardImpl rectype) { //double HRX=g.getRxHeight(); double total_margin=this.getTotalMargin(0); double maxPL=rad.getPt()+rad.getGain()+rectype.getRec_gain()-total_margin-min_P_req; //double HTX=rad.getParentAP().getHeight(); double PLcorr=Math.abs((TxHeight-RxHeight)/50)-3; maxPL+=PLcorr; return 100*Math.pow(10,(maxPL-PL0)/(10*n)); } public double getDistanceloss(double dist_cm,AccessPoint ap,GridPoint g) { double HRX=g.getRxHeight(); //double HTX=aptype.getHeight(); int apheight=ap.getHeight(); double PLcorr=Math.abs((apheight-HRX)/50)-3; //System.out.println(dist_cm+" "+PLcorr+" "+PL0+" "+n); return PL0+10*n*(Math.log10(dist_cm/100))+PLcorr; } public void setShadowingMargin(double shad_margin) { this.shad_margin=shad_margin; } public void setFadingMargin(double fade_margin) { this.fade_margin=fade_margin; } public void setInterferenceMargin(double interference_margin) { this.interf_margin=interference_margin; } /*public double giveLoss(double dist, double PLcorr) { return ; }*/ /*private Room determineRoom(GridPoint rx, Vector<Wall> w) { Vector<Room> allroomsonlevel = w.elementAt(0).getRooms().elementAt(0) .getLevel().getRooms(); for (int i = 0; i < allroomsonlevel.size(); i++) if (allroomsonlevel.elementAt(i).toPolygon().contains(rx)) return allroomsonlevel.elementAt(i); return null; }*/ /*private double giveLosloss(double min_pathloss4AllPaths, AccessPoint ap, GridPoint rx, Vector<Wall> w) { double totloss=min_pathloss4AllPaths; //enkel nog wallloss adden ; for(Wall wa:ap.determineWallsTxRx2(rx, w)) totloss+=wa.getLoss(); return totloss; }*/ //weet niet voor wat dit hier aan stond... /*public double calculate_Pathloss_Var(Room r,AccessPoint ap, GridPoint Rx, Vector<Wall> w) { intern.setLos(true); double losdist_cm=Rx.distance(ap.getCoordinates()); double min_pathloss4AllPaths=intern.giveLoss(losdist_cm,Rx); Level l=w.elementAt(0).getRooms().elementAt(0).getLevel(); int apindex=r.giveIndex(ap); Trajectory DP=r.getAproominfo().elementAt(apindex).getDP(); double cumulWallLoss=DP.getTotalLoss(); double []info=DP.distanceAlongTrajectory(Rx, ap, w);//100k is zeker genoeg om beter te zijn double pathdist1_cm=info[0]; intern.setLos(false); double pathloss1=intern.giveLoss(pathdist1_cm,Rx); if(Math.abs(pathdist1_cm-losdist_cm)<2) { intern.setLos(true); pathloss1=intern.giveLoss(pathdist1_cm,Rx); } double interactionloss=info[3]; Double curlowestloss=pathloss1+cumulWallLoss+interactionloss; Double max_wall_loss=curlowestloss-min_pathloss4AllPaths; lastbestTraj=DP; Best_MaxLeft a=new Best_MaxLeft(); a.setCurlowestloss(curlowestloss); a.setMax_total_wallloss(max_wall_loss); a.setCurbestpath(lastbestTraj); r.getLowestLoss(ap, l, a,Rx,w,intern, null); lastbestTraj=a.getCurbestpath(); return a.getCurlowestloss(); }*/ /*public double calculate_Pathloss(Room r,AccessPoint ap, GridPoint Rx, Vector<Wall> w, Trajectory posbestpath) { Vector<Wall> walvector=new Vector<Wall>(); for(Wall wwall:w) walvector.add(wwall); //System.out.println("WAADDEEEEEEu"); //double min_pathloss4AllPaths=32.4+20*(Math.log10(Rx.distance(ap.getCoordinates())/100000))+20*(Math.log10(this.freq_MHz)); intern.setLos(true); double HRX=Rx.getRxHeight(); double HTX=ap.getHeight(); double PLcorr=Math.abs((HTX-HRX)/50)-3; double losdist_cm=Rx.distance(ap.getCoordinates()); double min_pathloss4AllPaths=intern.giveLoss(losdist_cm,Rx); //System.out.println("losdist "+min_pathloss4AllPaths); Level l=w.elementAt(0).getRooms().elementAt(0).getLevel(); //double FSLoSloss=32.4+20*(Math.log10(ap.distance(Rx)/100000))+20*(Math.log10(this.freq_MHz)); int apindex=r.giveIndex(ap); //Room RxRoom=determineRoom(Rx,w); //Trajectory DP=r.getDominantpath2AP(ap, l); Trajectory[] DP=r.getAproominfo().elementAt(apindex).getDP(); double cumulWallLoss=DP[0].getTotalLoss(); double []info=DP[0].distanceAlongTrajectory(Rx, ap, walvector);//100k is zeker genoeg om beter te zijn double pathdist1_cm=info[0]; intern.setLos(false); double pathloss1=intern.giveLoss(pathdist1_cm,Rx); if(Math.abs(pathdist1_cm-losdist_cm)<2) { intern.setLos(true); pathloss1=intern.giveLoss(pathdist1_cm,Rx); } //System.out.println(ap.distance(Rx)); double interactionloss=info[1]; //System.out.println("interactionloss DP "+interactionloss); //DP[1].printTrajectory(); //double pathloss1=32.4+20*(Math.log10(pathdist1/100000))+20*(Math.log10(this.freq_MHz)); //hier nog aanpassen: neem punt in kamer dat dichtst bij ap ligt, zo laat je (correcte) maximale wall loss toe //double distans=r.giveSmallestDist2AP(ap); //System.out.println("Los pad heeft volgende loss: "+min_pathloss4AllPaths+" en deze Los afstand (m) "+Rx.distance(ap.getCoordinates())/100); Double curlowestloss=pathloss1+cumulWallLoss+interactionloss; //System.out.println("Lowest na wallDP :"+curlowestloss); /////Double max_wall_loss=curlowestloss-min_pathloss4AllPaths; lastbestTraj=DP[0]; int nowalls=0; for(int k=0;k<DP[0].getTrajectorywalls().size();k++) if(DP[0].getTrajectorywalls().elementAt(k).getLoss()>0) nowalls++; if(Rx.getRoom(l).equals(ap.getRoom())||DP[1].getTrajectorywalls().size()>0){ double cumulWallLoss2=DP[1].getTotalLoss(); double []info2=DP[1].distanceAlongTrajectory(Rx, ap, walvector);//100k is zeker genoeg om beter te zijn double pathdist1_cm2=info2[0]; intern.setLos(false); double pathloss12=intern.giveLoss(pathdist1_cm2,Rx); if(Math.abs(pathdist1_cm2-losdist_cm)<2) { intern.setLos(true); pathloss12=intern.giveLoss(pathdist1_cm2,Rx); } //System.out.println(ap.distance(Rx)); double interactionloss2=info2[1]; Double curlowestloss2=pathloss12+cumulWallLoss2+interactionloss2; if(curlowestloss2<curlowestloss) { //System.out.println(curlowestloss2+" < "+curlowestloss); curlowestloss=curlowestloss2; lastbestTraj=DP[1]; } } //DP[1].printTrajectory(); Double max_wall_loss=curlowestloss-min_pathloss4AllPaths; if(posbestpath!=null) { double cumulWallLoss3=posbestpath.getTotalLoss(); double []info3=posbestpath.distanceAlongTrajectory(Rx, ap, walvector);//100k is zeker genoeg om beter te zijn double pathdist2_cm=info3[0]; intern.setLos(false); double pathloss3=intern.giveLoss(pathdist2_cm,Rx); if(Math.abs(pathdist2_cm-losdist_cm)<2) { intern.setLos(true); pathloss3=intern.giveLoss(pathdist2_cm,Rx); } double interactionloss3=info3[1]; //double pathloss2=32.4+20*(Math.log10(pathdist2/100000))+20*(Math.log10(this.freq_MHz)); double totloss=pathloss3+cumulWallLoss3+interactionloss3; if(totloss<curlowestloss&&!posbestpath.equals(DP[0])&&!posbestpath.equals(DP[1])) { //System.out.println("UUUIJ"+totloss+" "+curlowestloss); curlowestloss=totloss; max_wall_loss=curlowestloss-min_pathloss4AllPaths; lastbestTraj=posbestpath; //System.out.println("nieuwe kleinste loss dmx afstand "+pathdist); } } //nu alle mogelijke paden die nog over zijn VOOR HELE KAMER (grens iets ruimer) //double highestcurlowestloss=r.getAproominfo().elementAt(index).getMaxPLinRoom4AP(); //double lowestLoSdist=r.getAproominfo().elementAt(index).getClosestGPdist2AP(); //double lowestLoSPLloss=32.4+20*(Math.log10(lowestLoSdist/100000))+20*(Math.log10(this.freq_MHz)); //double max_wall_loss=highestcurlowestloss-lowestLoSPLloss; //System.out.println("****"); Best_MaxLeft a=new Best_MaxLeft(); a.setCurlowestloss(curlowestloss); //System.out.println("DP geeft "+curlowestloss); //DP.printTrajectory(); a.setMax_total_wallloss(max_wall_loss); a.setCurbestpath(lastbestTraj); //System.out.println("Dit gridpoint "+Rx+" heeft de volgende cumulated wall loss en maxwallloss: "+cumulWallLoss+ " ; "+max_wall_loss); //GridPoint roommid=new GridPointImpl(r.toPolygon().getBounds().getCenterX(),r.toPolygon().getBounds().getCenterY()); //if(roommid.distance(ap.getCoordinates())<6000)//60meter is grens voor alle paden te onderzoeken r.getLowestLoss(ap, l, a,Rx,w,intern, posbestpath,nowalls); //Vector<Trajectory> allposspaths=r.allPossibleBestPaths2AP(ap,l,max_wall_loss); //nu hebben we dus alle paden langs waar het eventueel NOG korter kan, maar dan door een kortere afstand //Vector<Trajectory> allposspaths=r.getAproominfo().elementAt(index).getAllposspaths(); //System.out.println("Aantal beste paden "+allposspaths.size()); //System.out.println(); //if(allposspaths.size()==3715) //DP.printTrajectory(); //a.getCurbestpath().printTrajectory(); double []test=a.getCurbestpath().distanceAlongTrajectory(Rx, ap, walvector); lastbestTraj=a.getCurbestpath(); //lastbestTraj.printTrajectory(); //System.out.println("muurloss "+a.getCurbestpath().getTotalLoss()); //System.out.println("***best*****"); //System.out.println("Beste loss= "+a.getCurlowestloss()); return a.getCurlowestloss()+PLcorr+offset; }*/ }
import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.Graphics; import java.awt.event.*; import java.util.ArrayList; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class ConnectionMaker extends JPanel { int port; String hostOrJoin; public ConnectionMaker(int port, String option) { this.port=port; hostOrJoin=option; } }
package Biblioteca; import java.io.Serializable; import java.util.Date; import java.util.logging.Logger; public class EntEmprestimo implements Serializable{ private int numexemplar; private int ISBN; private Date dataemprestimo; private int codassociado; public EntEmprestimo(int numexemplar, int ISBN, Date dataemprestimo, int codassociado) { this.numexemplar = numexemplar; this.ISBN = ISBN; this.dataemprestimo = dataemprestimo; this.codassociado = codassociado; } public int getNumexemplar() { return numexemplar; } public int getISBN() { return ISBN; } public Date getDataemprestimo() { return dataemprestimo; } public int getCodassociado() { return codassociado; } public void setNumexemplar(int numexemplar) { this.numexemplar = numexemplar; } public void setISBN(int ISBN) { this.ISBN = ISBN; } public void setDataemprestimo(Date dataemprestimo) { this.dataemprestimo = dataemprestimo; } public void setCodassociado(int codassociado) { this.codassociado = codassociado; } }
package mouse.client.network; import java.io.IOException; import java.io.ObjectInputStream; import java.util.ArrayList; import java.util.List; import mouse.shared.messages.serverToClient.ServerToClientMessage; import mouse.shared.messages.serverToClient.ServerToClientMessageListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * @author kevin_000 */ public class ClientMessageParser { private static final Logger log = LoggerFactory.getLogger(ClientMessageParser.class); private final List<ServerToClientMessageListener> listeners; public ClientMessageParser() { this.listeners = new ArrayList<ServerToClientMessageListener>(); } public void addListener(ServerToClientMessageListener listener) { listeners.add(listener); } public void parseMessage(ObjectInputStream stream) throws IOException { if (stream == null) { throw new IOException("Unable to parseMessage, stream was null"); } ServerToClientMessage.fromStream(stream).alertListeners(this.listeners); //log.debug("Received Message and alerted:" + listeners.size()); } }
package Views; import Models.Usuario_model; import java.awt.GridLayout; import java.util.ArrayList; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; public class Inicio_view extends JPanel { private JLabel listaUsuarios; private JScrollPane scroll; private JPanel usuariosAtivos; private JLabel meuNome; private JLabel meusTrofeus; private JPanel usuarios[]; public Inicio_view() { this.setSize(400,500); this.setLayout(null); this.listaUsuarios = new JLabel("Usuários Online"); listaUsuarios.setBounds(145, 20, 150, 25); this.add(listaUsuarios); this.meuNome = new JLabel("ID: user_0"); meuNome.setBounds(25, 20, 150, 25); this.add(meuNome); this.meusTrofeus = new JLabel("Troféus: 23"); meusTrofeus.setBounds(25, 35, 150, 25); this.add(meusTrofeus); scroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scroll.setBorder(null); scroll.setBounds(25, 60, 350, 380); scroll.getVerticalScrollBar().setUnitIncrement(10); this.add(scroll); } public void desenha(ArrayList Array) { usuariosAtivos = new JPanel(); usuariosAtivos.setLayout(new GridLayout(0, 1, 0, 0)); if(Array.size() > 0) { usuarios = new JPanel[Array.size()]; for(int i = 0; i < Array.size(); i++) { Usuario_model u = (Usuario_model) Array.get(i); usuarios[i] = gerarPanel(u.getNome()); usuariosAtivos.add(usuarios[i]); } } scroll.setViewportView(usuariosAtivos); repaint(); } public JPanel gerarPanel(String nome) { JLabel nomeLb; JPanel usuario = new JPanel(); usuario.setLayout(new GridLayout(1, 1)); nomeLb = new JLabel(nome); usuario.add(nomeLb); return usuario; } public JPanel[] getPanels() { return this.usuarios; } public JLabel getMeuNome() { return meuNome; } public JLabel getMeusTrofeus() { return meusTrofeus; } }
package com.pangpang6.books.offer.chapter2; import org.junit.Test; import java.util.Stack; public class StackTest { @Test public void test01() { Stack<Integer> stack = new Stack<>(); System.out.println(stack.push(2)); System.out.println(stack.push(4)); System.out.println(stack.pop()); System.out.println(stack.pop()); } }
package com.axess.smartbankapi.repository; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.axess.smartbankapi.model.CCUser; @Repository public interface CCUserRepository extends JpaRepository<CCUser, Long>{ Optional<CCUser> findByUserIdAndPassword(String userId, String password); }
public class BalancoTrimestral { public static void main(String[] args) { // Declaração double mesBalanco[]; // Instância mesBalanco = new double[3]; mesBalanco[0] = 17000; mesBalanco[1] = 23000; mesBalanco[2] = 15500; // Primitiva: letra minúscula // Declaração + inicialização double valorTotal = 0; // Loop tradicional: 3 blocos (inicialização; condição; incremento) // Escopo das variáveis permance dentro da estrutura do loop { } for (int i=0; i<mesBalanco.length; i++){ // valorTotal = valorTotal + mesBalanco[i]; valorTotal += mesBalanco[i]; } //System.out.println("Valor Total: "+valorTotal); valorTotal = 0; // For each: declara uma variável para cada iteração for (double d : mesBalanco){ valorTotal += d; } System.out.println("Valor Total: "+valorTotal); } }
/* * Copyright © 2014 YAOCHEN Corporation, All Rights Reserved. */ package com.yaochen.address.data.domain.address; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class AdOaCountyRef implements Serializable{ /** OA系统的分公司ID */ private String companyId; /** 地址库的 */ private String countyId; private String pid;//上级ID /** 分公司名称 */ private String countyName; /** 描述信息 */ private String remark; private List<AdOaCountyRef> children = new ArrayList<AdOaCountyRef>(); public String getCompanyId() { return companyId; } public void setCompanyId(String companyId) { this.companyId = companyId; } public String getCountyId() { return countyId; } public void setCountyId(String countyId) { this.countyId = countyId; } public String getCountyName() { return countyName; } public void setCountyName(String countyName) { this.countyName = countyName == null ? null : countyName.trim(); } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark == null ? null : remark.trim(); } public String getPid() { return pid; } public void setPid(String pid) { this.pid = pid; } public List<AdOaCountyRef> getChildren() { return children; } public void setChildren(List<AdOaCountyRef> children) { this.children = children; } }
package adaptivex.pedidoscloud.View.EventListeners; import android.content.Context; import android.view.View; import android.widget.TextView; import android.widget.Toast; import adaptivex.pedidoscloud.Config.GlobalValues; import adaptivex.pedidoscloud.Controller.PedidoController; import adaptivex.pedidoscloud.R; import adaptivex.pedidoscloud.Servicios.HelperPedidos; /** * Created by Ezequiel on 06/04/2017. */ public class ButtonOnClickListener implements View.OnClickListener { private Context ctx; public ButtonOnClickListener(Context c){ setCtx(c); } @Override public void onClick(View v) { if (v.getId() == R.id.btnEliminarPedido) { try { TextView tvDpfIdTmp = (TextView)v.findViewById(R.id.tvDpfIdTmp); PedidoController pc = new PedidoController(getCtx()); pc.abrir().deleteByIdTmp(Long.valueOf(tvDpfIdTmp.getText().toString())); pc.cerrar(); GlobalValues.getINSTANCIA().setPEDIDO_ACTION_VALUE(GlobalValues.getINSTANCIA().PEDIDO_ACTION_DELETE); Toast.makeText(getCtx(), "Eliminado Correctamente ", Toast.LENGTH_LONG).show(); } catch (Exception e) { Toast.makeText(getCtx(), "Error RVAdapterPedido: " + e.getMessage(), Toast.LENGTH_LONG); } }else if (v.getId() == R.id.btnEnviarPedido2) { try{ TextView tvDpfIdTmp = (TextView)v.findViewById(R.id.tvDpfIdTmp); HelperPedidos hp = new HelperPedidos(v.getContext(), Long.valueOf(tvDpfIdTmp.getText().toString()),GlobalValues.getINSTANCIA().ENVIAR_PEDIDO); hp.execute(); }catch (Exception e){ Toast.makeText(v.getContext(),"Error RVAdapterPedido: "+ e.getMessage(), Toast.LENGTH_LONG); } } } public Context getCtx() { return ctx; } public void setCtx(Context ctx) { this.ctx = ctx; } }
package com.pgssoft.httpclient.internal.debug; import com.pgssoft.httpclient.internal.rule.Rule; import java.net.http.HttpRequest; import java.util.List; public class Debugger { public void debug(List<Rule> rules, HttpRequest request) { logRequest(request); logRules(rules, request); } private void logRules(List<Rule> rules, HttpRequest request) { if (rules.size() == 0) { System.out.println("No rules were defined."); } for (int i = 0; i < rules.size(); i++) { System.out.println("Rule " + (i + 1) + ":"); System.out.println("\tMATCHES\t\tEXPECTED"); rules.get(i).debug(request, this); } System.out.println(); System.out.println("----------------"); } private void logRequest(HttpRequest request) { System.out.println("Request: " + request.method() + " " + request.uri()); } public void message(boolean matches, String expected) { String debugMessage = String.format("\t%s\t\t%s", matches, expected); System.out.println(debugMessage); } }
import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Random; public class TimeDisplay extends JFrame { // Extend JFrame class public TimeDisplay() { // Constructor frame(); // Method } public void frame() { // Method for JFrame // Frame and Panel JFrame frame = new JFrame(); // Frame for TimeDisplay JPanel panel = new JPanel(); // For Panel within Frame frame.getContentPane().add(panel); // Add panel as content pane // Other GUI Aspects JLabel instructions = new JLabel("Click the button to see what time it is:"); JLabel timeZone = new JLabel(""); // Create the TimeZone warning, add info to it later JButton button = new JButton("Check the Time"); // Create the JButton JLabel displayTime = new JLabel(""); // Create the text for the time display displayTime.setFont(new Font("Serif", Font.BOLD, 72)); // and then make it real big button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { // Time Logic Date now = new Date(); // Create the Date/ Time SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss"); // Format the date to show only the time String currentTime = time.format(now); // Create a string of the current time System.out.println("The current time is " + currentTime + ""); // Print the time in IDE for testing displayTime.setText(currentTime); // display current time final Random random = new Random(); // Prepare to grab a random color Color color = new Color(random.nextInt(256),random.nextInt(256),random.nextInt(256)); // Parameters for random background color panel.setBackground(color); // set the random background color timeZone.setText("All times are Coordinated Universal Time (UTC)."); // Update text for timeZone warning } }); // This area wasn't required, but I found a cool tutorial on YouTube and wanted to try it out JMenuBar menu = new JMenuBar(); // Create object for MenuBar frame.setJMenuBar(menu); // Add MenuBar // Add File Menu item JMenu file = new JMenu("File"); menu.add(file); // Make Exit sub menu item JMenuItem exit = new JMenuItem("Exit"); file.add(exit); // Make Exit close application exit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); } }); // Add about Menu item JMenu about = new JMenu("About"); menu.add(about); // Make creator sub menu item JMenuItem creator = new JMenuItem("Creator"); about.add(creator); // Make creator sub menu bring up an informational dialog menu creator.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { JOptionPane.showMessageDialog(panel, "Created by Travis Woodward\nColorado State University - Global Campus.\nProgramming II (CSC372)\nApplication created on 8/31/2018"); } }); // Add Areas to the Panel panel.add(instructions); panel.add(button); panel.add(displayTime); panel.add(timeZone); // Set the JFrame details final int width = 400; // width of frame final int height = 220; // height of frame frame.setSize(width, height); // set the width X height frame.setTitle("Current Local Time"); // Title the frame frame.setLocationRelativeTo(null); // Place the frame in the center of the screen frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // close when X frame.setVisible(true); // Make the frame visible } public static void main (String[] args) { new TimeDisplay(); // Call TimeDisplay so it actually runs } }
/* Construir un programa que dado el numero de horas =? devuleve el numero de semanas, dias, horas equivalestes */ package ejercicio_7; import java.util.Scanner; /** * * @author jrodriguez */ public class Ejercicio_7 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner entrada = new Scanner (System.in); int horas_t,semanas,dias,horas; System.out.println("Ingrese el total de horas: "); horas_t= entrada.nextInt(); semanas = horas_t /168 ; dias = horas_t%168/24; horas =horas_t%24; System.out.println("\nEquivalente de Horas es: "); System.out.println("semanas: "+semanas); System.out.println("dias: "+dias); System.out.println("horas: "+horas); } }
package com.sxli.javaconfig; import com.sxli.pool.RedisPool; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class RedisConfig { @Bean public RedisPool redisPool(){ return new RedisPool(); } }
package mapmaker.obj; import javafx.scene.paint.Color; import java.util.ArrayList; import java.util.List; public class Room { private int x, y; private String desc; private String flag; private ArrayList<String> attributes; private Color color; public Room(int x, int y){ this.x = x; this.y = y; this.desc = ""; this.flag = "#ROOM"; this.attributes = new ArrayList<>(); this.color = Color.BLACK; } public Room(int x, int y, ArrayList<String> attributes, String description, String flag, Color color){ this.x = x; this.y = y; this.attributes = attributes; this.desc = description; this.flag = flag; this.color = color; } public int getX() { return x; } public int getY() { return y; } public String getFlag(){ return flag; } public String getDesc() { return desc; } public String getAttributeAt(int index) { return attributes.get(index); } public ArrayList<String> getAttributes(){ return attributes; } public Color getColor() { return color; } public void setX(int newX) { this.x = newX; } public void setY(int newY) { this.y = newY; } public void setDesc(String newDesc) { this.desc = newDesc; } public void setAttributes(ArrayList<String> newAttributes) { attributes.clear(); attributes.addAll(newAttributes); } public void setFlag(String newFlag){ this.flag = newFlag; } public void setColor(Color color) { this.color = color; } }
package main.java.com.java4beginners.ex1; public abstract class Figura { String nombre; public void getInfoFigura(){ System.out.println("El perimetro total del/la " + nombre + " es: " + this.calcularPerimetro()); System.out.println("El area total del/la " + nombre + " es: " + this.calcularArea()); } public abstract double calcularPerimetro(); public abstract double calcularArea(); }
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // 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: 2015.09.03 at 09:19:50 PM EDT // package org.oasisopen.xliff; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.namespace.QName; import org.w3c.dom.Element; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element ref="{urn:oasis:names:tc:xliff:document:1.2}source"/> * &lt;element ref="{urn:oasis:names:tc:xliff:document:1.2}seg-source" minOccurs="0"/> * &lt;element ref="{urn:oasis:names:tc:xliff:document:1.2}target" minOccurs="0"/> * &lt;choice maxOccurs="unbounded" minOccurs="0"> * &lt;element ref="{urn:oasis:names:tc:xliff:document:1.2}context-group"/> * &lt;element ref="{urn:oasis:names:tc:xliff:document:1.2}count-group"/> * &lt;element ref="{urn:oasis:names:tc:xliff:document:1.2}prop-group"/> * &lt;element ref="{urn:oasis:names:tc:xliff:document:1.2}note"/> * &lt;element ref="{urn:oasis:names:tc:xliff:document:1.2}alt-trans"/> * &lt;/choice> * &lt;any processContents='skip' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="approved" type="{urn:oasis:names:tc:xliff:document:1.2}AttrType_YesNo" /> * &lt;attribute name="translate" type="{urn:oasis:names:tc:xliff:document:1.2}AttrType_YesNo" default="yes" /> * &lt;attribute name="reformat" type="{urn:oasis:names:tc:xliff:document:1.2}AttrType_reformat" default="yes" /> * &lt;attribute ref="{http://www.w3.org/XML/1998/namespace}space default="default""/> * &lt;attribute name="datatype" type="{urn:oasis:names:tc:xliff:document:1.2}AttrType_datatype" /> * &lt;attribute name="ts" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="phase-name" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="restype" type="{urn:oasis:names:tc:xliff:document:1.2}AttrType_restype" /> * &lt;attribute name="resname" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="extradata" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="extype" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="help-id" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="menu" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="menu-option" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="menu-name" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="coord" type="{urn:oasis:names:tc:xliff:document:1.2}AttrType_Coordinates" /> * &lt;attribute name="font" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="css-style" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="style" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="exstyle" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="size-unit" type="{urn:oasis:names:tc:xliff:document:1.2}AttrType_size-unit" default="pixel" /> * &lt;attribute name="maxwidth" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="minwidth" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="maxheight" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="minheight" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="maxbytes" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="minbytes" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="charclass" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="merged-trans" type="{urn:oasis:names:tc:xliff:document:1.2}AttrType_YesNo" default="yes" /> * &lt;anyAttribute processContents='skip'/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "source", "segSource", "target", "contextGroupOrCountGroupOrPropGroup", "any" }) @XmlRootElement(name = "trans-unit") public class TransUnit { @XmlElement(required = true) protected Source source; @XmlElement(name = "seg-source") protected SegSource segSource; protected Target target; @XmlElements({ @XmlElement(name = "context-group", type = ContextGroup.class), @XmlElement(name = "count-group", type = CountGroup.class), @XmlElement(name = "prop-group", type = PropGroup.class), @XmlElement(name = "note", type = Note.class), @XmlElement(name = "alt-trans", type = AltTrans.class) }) protected List<Object> contextGroupOrCountGroupOrPropGroup; @XmlAnyElement protected List<Element> any; @XmlAttribute(name = "id", required = true) protected String id; @XmlAttribute(name = "approved") protected AttrTypeYesNo approved; @XmlAttribute(name = "translate") protected AttrTypeYesNo translate; @XmlAttribute(name = "reformat") protected List<String> reformat; @XmlAttribute(name = "space", namespace = "http://www.w3.org/XML/1998/namespace") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String space; @XmlAttribute(name = "datatype") protected String datatype; @XmlAttribute(name = "ts") protected String ts; @XmlAttribute(name = "phase-name") protected String phaseName; @XmlAttribute(name = "restype") protected String restype; @XmlAttribute(name = "resname") protected String resname; @XmlAttribute(name = "extradata") protected String extradata; @XmlAttribute(name = "extype") protected String extype; @XmlAttribute(name = "help-id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String helpId; @XmlAttribute(name = "menu") protected String menu; @XmlAttribute(name = "menu-option") protected String menuOption; @XmlAttribute(name = "menu-name") protected String menuName; @XmlAttribute(name = "coord") protected String coord; @XmlAttribute(name = "font") protected String font; @XmlAttribute(name = "css-style") protected String cssStyle; @XmlAttribute(name = "style") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String style; @XmlAttribute(name = "exstyle") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String exstyle; @XmlAttribute(name = "size-unit") protected String sizeUnit; @XmlAttribute(name = "maxwidth") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String maxwidth; @XmlAttribute(name = "minwidth") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String minwidth; @XmlAttribute(name = "maxheight") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String maxheight; @XmlAttribute(name = "minheight") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String minheight; @XmlAttribute(name = "maxbytes") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String maxbytes; @XmlAttribute(name = "minbytes") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String minbytes; @XmlAttribute(name = "charclass") protected String charclass; @XmlAttribute(name = "merged-trans") protected AttrTypeYesNo mergedTrans; @XmlAnyAttribute private Map<QName, String> otherAttributes = new HashMap<QName, String>(); /** * Gets the value of the source property. * * @return * possible object is * {@link Source } * */ public Source getSource() { return source; } /** * Sets the value of the source property. * * @param value * allowed object is * {@link Source } * */ public void setSource(Source value) { this.source = value; } /** * Gets the value of the segSource property. * * @return * possible object is * {@link SegSource } * */ public SegSource getSegSource() { return segSource; } /** * Sets the value of the segSource property. * * @param value * allowed object is * {@link SegSource } * */ public void setSegSource(SegSource value) { this.segSource = value; } /** * Gets the value of the target property. * * @return * possible object is * {@link Target } * */ public Target getTarget() { return target; } /** * Sets the value of the target property. * * @param value * allowed object is * {@link Target } * */ public void setTarget(Target value) { this.target = value; } /** * Gets the value of the contextGroupOrCountGroupOrPropGroup property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the contextGroupOrCountGroupOrPropGroup property. * * <p> * For example, to add a new item, do as follows: * <pre> * getContextGroupOrCountGroupOrPropGroup().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ContextGroup } * {@link CountGroup } * {@link PropGroup } * {@link Note } * {@link AltTrans } * * */ public List<Object> getContextGroupOrCountGroupOrPropGroup() { if (contextGroupOrCountGroupOrPropGroup == null) { contextGroupOrCountGroupOrPropGroup = new ArrayList<Object>(); } return this.contextGroupOrCountGroupOrPropGroup; } /** * Gets the value of the any property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the any property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAny().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Element } * * */ public List<Element> getAny() { if (any == null) { any = new ArrayList<Element>(); } return this.any; } /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setId(String value) { this.id = value; } /** * Gets the value of the approved property. * * @return * possible object is * {@link AttrTypeYesNo } * */ public AttrTypeYesNo getApproved() { return approved; } /** * Sets the value of the approved property. * * @param value * allowed object is * {@link AttrTypeYesNo } * */ public void setApproved(AttrTypeYesNo value) { this.approved = value; } /** * Gets the value of the translate property. * * @return * possible object is * {@link AttrTypeYesNo } * */ public AttrTypeYesNo getTranslate() { if (translate == null) { return AttrTypeYesNo.YES; } else { return translate; } } /** * Sets the value of the translate property. * * @param value * allowed object is * {@link AttrTypeYesNo } * */ public void setTranslate(AttrTypeYesNo value) { this.translate = value; } /** * Gets the value of the reformat property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the reformat property. * * <p> * For example, to add a new item, do as follows: * <pre> * getReformat().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getReformat() { if (reformat == null) { reformat = new ArrayList<String>(); } return this.reformat; } /** * Gets the value of the space property. * * @return * possible object is * {@link String } * */ public String getSpace() { if (space == null) { return "default"; } else { return space; } } /** * Sets the value of the space property. * * @param value * allowed object is * {@link String } * */ public void setSpace(String value) { this.space = value; } /** * Gets the value of the datatype property. * * @return * possible object is * {@link String } * */ public String getDatatype() { return datatype; } /** * Sets the value of the datatype property. * * @param value * allowed object is * {@link String } * */ public void setDatatype(String value) { this.datatype = value; } /** * Gets the value of the ts property. * * @return * possible object is * {@link String } * */ public String getTs() { return ts; } /** * Sets the value of the ts property. * * @param value * allowed object is * {@link String } * */ public void setTs(String value) { this.ts = value; } /** * Gets the value of the phaseName property. * * @return * possible object is * {@link String } * */ public String getPhaseName() { return phaseName; } /** * Sets the value of the phaseName property. * * @param value * allowed object is * {@link String } * */ public void setPhaseName(String value) { this.phaseName = value; } /** * Gets the value of the restype property. * * @return * possible object is * {@link String } * */ public String getRestype() { return restype; } /** * Sets the value of the restype property. * * @param value * allowed object is * {@link String } * */ public void setRestype(String value) { this.restype = value; } /** * Gets the value of the resname property. * * @return * possible object is * {@link String } * */ public String getResname() { return resname; } /** * Sets the value of the resname property. * * @param value * allowed object is * {@link String } * */ public void setResname(String value) { this.resname = value; } /** * Gets the value of the extradata property. * * @return * possible object is * {@link String } * */ public String getExtradata() { return extradata; } /** * Sets the value of the extradata property. * * @param value * allowed object is * {@link String } * */ public void setExtradata(String value) { this.extradata = value; } /** * Gets the value of the extype property. * * @return * possible object is * {@link String } * */ public String getExtype() { return extype; } /** * Sets the value of the extype property. * * @param value * allowed object is * {@link String } * */ public void setExtype(String value) { this.extype = value; } /** * Gets the value of the helpId property. * * @return * possible object is * {@link String } * */ public String getHelpId() { return helpId; } /** * Sets the value of the helpId property. * * @param value * allowed object is * {@link String } * */ public void setHelpId(String value) { this.helpId = value; } /** * Gets the value of the menu property. * * @return * possible object is * {@link String } * */ public String getMenu() { return menu; } /** * Sets the value of the menu property. * * @param value * allowed object is * {@link String } * */ public void setMenu(String value) { this.menu = value; } /** * Gets the value of the menuOption property. * * @return * possible object is * {@link String } * */ public String getMenuOption() { return menuOption; } /** * Sets the value of the menuOption property. * * @param value * allowed object is * {@link String } * */ public void setMenuOption(String value) { this.menuOption = value; } /** * Gets the value of the menuName property. * * @return * possible object is * {@link String } * */ public String getMenuName() { return menuName; } /** * Sets the value of the menuName property. * * @param value * allowed object is * {@link String } * */ public void setMenuName(String value) { this.menuName = value; } /** * Gets the value of the coord property. * * @return * possible object is * {@link String } * */ public String getCoord() { return coord; } /** * Sets the value of the coord property. * * @param value * allowed object is * {@link String } * */ public void setCoord(String value) { this.coord = value; } /** * Gets the value of the font property. * * @return * possible object is * {@link String } * */ public String getFont() { return font; } /** * Sets the value of the font property. * * @param value * allowed object is * {@link String } * */ public void setFont(String value) { this.font = value; } /** * Gets the value of the cssStyle property. * * @return * possible object is * {@link String } * */ public String getCssStyle() { return cssStyle; } /** * Sets the value of the cssStyle property. * * @param value * allowed object is * {@link String } * */ public void setCssStyle(String value) { this.cssStyle = value; } /** * Gets the value of the style property. * * @return * possible object is * {@link String } * */ public String getStyle() { return style; } /** * Sets the value of the style property. * * @param value * allowed object is * {@link String } * */ public void setStyle(String value) { this.style = value; } /** * Gets the value of the exstyle property. * * @return * possible object is * {@link String } * */ public String getExstyle() { return exstyle; } /** * Sets the value of the exstyle property. * * @param value * allowed object is * {@link String } * */ public void setExstyle(String value) { this.exstyle = value; } /** * Gets the value of the sizeUnit property. * * @return * possible object is * {@link String } * */ public String getSizeUnit() { if (sizeUnit == null) { return "pixel"; } else { return sizeUnit; } } /** * Sets the value of the sizeUnit property. * * @param value * allowed object is * {@link String } * */ public void setSizeUnit(String value) { this.sizeUnit = value; } /** * Gets the value of the maxwidth property. * * @return * possible object is * {@link String } * */ public String getMaxwidth() { return maxwidth; } /** * Sets the value of the maxwidth property. * * @param value * allowed object is * {@link String } * */ public void setMaxwidth(String value) { this.maxwidth = value; } /** * Gets the value of the minwidth property. * * @return * possible object is * {@link String } * */ public String getMinwidth() { return minwidth; } /** * Sets the value of the minwidth property. * * @param value * allowed object is * {@link String } * */ public void setMinwidth(String value) { this.minwidth = value; } /** * Gets the value of the maxheight property. * * @return * possible object is * {@link String } * */ public String getMaxheight() { return maxheight; } /** * Sets the value of the maxheight property. * * @param value * allowed object is * {@link String } * */ public void setMaxheight(String value) { this.maxheight = value; } /** * Gets the value of the minheight property. * * @return * possible object is * {@link String } * */ public String getMinheight() { return minheight; } /** * Sets the value of the minheight property. * * @param value * allowed object is * {@link String } * */ public void setMinheight(String value) { this.minheight = value; } /** * Gets the value of the maxbytes property. * * @return * possible object is * {@link String } * */ public String getMaxbytes() { return maxbytes; } /** * Sets the value of the maxbytes property. * * @param value * allowed object is * {@link String } * */ public void setMaxbytes(String value) { this.maxbytes = value; } /** * Gets the value of the minbytes property. * * @return * possible object is * {@link String } * */ public String getMinbytes() { return minbytes; } /** * Sets the value of the minbytes property. * * @param value * allowed object is * {@link String } * */ public void setMinbytes(String value) { this.minbytes = value; } /** * Gets the value of the charclass property. * * @return * possible object is * {@link String } * */ public String getCharclass() { return charclass; } /** * Sets the value of the charclass property. * * @param value * allowed object is * {@link String } * */ public void setCharclass(String value) { this.charclass = value; } /** * Gets the value of the mergedTrans property. * * @return * possible object is * {@link AttrTypeYesNo } * */ public AttrTypeYesNo getMergedTrans() { if (mergedTrans == null) { return AttrTypeYesNo.YES; } else { return mergedTrans; } } /** * Sets the value of the mergedTrans property. * * @param value * allowed object is * {@link AttrTypeYesNo } * */ public void setMergedTrans(AttrTypeYesNo value) { this.mergedTrans = value; } /** * Gets a map that contains attributes that aren't bound to any typed property on this class. * * <p> * the map is keyed by the name of the attribute and * the value is the string value of the attribute. * * the map returned by this method is live, and you can add new attribute * by updating the map directly. Because of this design, there's no setter. * * * @return * always non-null */ public Map<QName, String> getOtherAttributes() { return otherAttributes; } }
package com.tkb.elearning.model; import java.sql.Timestamp; public class Ensuredo { //品保有什麼能服務的 private int id; //品保有什麼能服務的-id private String do_title; //品保有什麼能服務的-標題 private String do_content; //品保有什麼能服務的-內文 private Timestamp create_date; //創建日期 public int getId() { return id; } public void setId(int id) { this.id = id; } public String getDo_title() { return do_title; } public void setDo_title(String do_title) { this.do_title = do_title; } public String getDo_content() { return do_content; } public void setDo_content(String do_content) { this.do_content = do_content; } public Timestamp getCreate_date() { return create_date; } public void setCreate_date(Timestamp create_date) { this.create_date = create_date; } }
package com.tencent.mm.plugin.collect.reward.b; import com.tencent.smtt.sdk.TbsReaderView$ReaderCallback; public interface b { public static final Integer[] hVj = new Integer[]{Integer.valueOf(100), Integer.valueOf(500), Integer.valueOf(1000), Integer.valueOf(2000), Integer.valueOf(TbsReaderView$ReaderCallback.GET_BAR_ANIMATING), Integer.valueOf(10000)}; }
package com.tencent.mm.plugin.luckymoney.ui; import android.view.View; import android.view.View.OnClickListener; class LuckyMoneyPrepareUI$21 implements OnClickListener { final /* synthetic */ LuckyMoneyPrepareUI kWX; LuckyMoneyPrepareUI$21(LuckyMoneyPrepareUI luckyMoneyPrepareUI) { this.kWX = luckyMoneyPrepareUI; } public final void onClick(View view) { LuckyMoneyPrepareUI.u(this.kWX).setVisibility(8); this.kWX.bbp(); } }
package com.byxy.student.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import com.byxy.student.entity.Student; public class LoginSpringMVCInterceptor implements HandlerInterceptor { @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { System.out.println("===========HandlerInterceptor1 afterCompletion"); } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { System.out.println("===========HandlerInterceptor1 postHandle"); } @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { System.out.println("===========HandlerInterceptor1 preHandle"); Student u = (Student) request.getSession().getAttribute("loginUser"); if (u == null) { String uri = request.getContextPath(); response.sendRedirect(uri + "/springmvc/login"); return false; } return true; } }
package com.ybg.company.service; import java.util.List; import com.ybg.base.jdbc.BaseMap; import com.ybg.base.util.Page; import com.ybg.company.domain.Company; import com.ybg.company.qvo.CompanyQvo; import com.ybg.component.org.inter.Organization; public interface CompanyService { /** 创建 企业 * * @throws Exception **/ Company create(Company org) throws Exception; /** 查询企业 **/ List<Company> query(CompanyQvo qvo); /** 查询企业 **/ Page query(Page page, CompanyQvo qvo); void remove(BaseMap<String, Object> condictionmap); void update(BaseMap<String, Object> updatemap, BaseMap<String, Object> wheremap); Organization get(String id); }