query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Accessor d'escriptura de l'atribut koncept.
public void setKoncept(KoncepteParaula koncept) { this.koncept = koncept; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getAtk(){\n return atk;\n }", "public int getAtk() {\n return atk;\n }", "public KoncepteParaula getKoncept() {\n\t\treturn koncept;\n\t}", "public int getTinta()\n {\n //COMPLETE\n return this.tinta;\n }", "public int getNilaiBtn() {\n return nilaiBtn;\n }"...
[ "0.61751044", "0.60988426", "0.6051074", "0.60037434", "0.59550416", "0.586683", "0.58485276", "0.58350843", "0.57939494", "0.57924783", "0.573768", "0.573096", "0.56699705", "0.5654258", "0.56293607", "0.562377", "0.56155884", "0.5604977", "0.5584053", "0.5581108", "0.557470...
0.0
-1
Created by xaksamit on 10.3.17.
public interface UserManager { /** * Creates new User * @exception IllegalArgumentException * @param user to be created */ void createUser(User user); /** * Updates existing User * @exception IllegalArgumentException * @param user to be updated to */ void updateUser(User user); /** * Deletes existing User * @exception IllegalArgumentException * @param user to be deleted */ void deleteUser(User user); /** * Finds user with specific id * @exception IllegalArgumentException * @param id with which User should be deleted * @return User with specific id */ User getUser(Long id); /** * Finds user with specific email * @exception IllegalArgumentException * @param email with which user will be returned * @return user with specific email */ User getUserByEmail(String email); /** * Finds list of users with specific name * @exception IllegalArgumentException * @param name with which user will be returned * @return List of users with specific name */ List<User> getUserByName(String name); /** * Finds all users * @return list of users */ List<User> getAllUsers(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void b...
[ "0.58760893", "0.5856834", "0.57864094", "0.56888855", "0.5653693", "0.56152755", "0.5594994", "0.5594994", "0.5581084", "0.5558404", "0.5536378", "0.55351317", "0.55335987", "0.55311316", "0.5529862", "0.5516026", "0.5514229", "0.55071235", "0.5503244", "0.549621", "0.549102...
0.0
-1
Finds user with specific id
User getUser(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User findById ( int id) {\n\t\t return users.stream().filter( user -> user.getId().equals(id)).findAny().orElse(null);\n\t}", "@Override\r\n\tpublic User searchUser(Integer id) {\n\t\treturn userReposotory.getById(id);\r\n\t}", "public User findUser(int id) {\n for (int i = 0; i < allUsers.size()...
[ "0.8024627", "0.7972367", "0.7965203", "0.79257464", "0.7833512", "0.77927333", "0.7773359", "0.7748306", "0.76517594", "0.76395124", "0.7541372", "0.7540856", "0.75406545", "0.7538977", "0.75260526", "0.7525195", "0.75244206", "0.75228745", "0.75064534", "0.7500155", "0.7476...
0.7342708
37
Finds user with specific email
User getUserByEmail(String email);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "User find(String email);", "public User findUserByEmail(final String email);", "User getUserByEmail(final String email);", "User findUserByEmail(String email) throws Exception;", "public static UserEntity search(String email) {\n\t\tDatastoreService datastore = DatastoreServiceFactory\n\t\t\t\t.getDatastor...
[ "0.80889857", "0.80652934", "0.7930125", "0.78928125", "0.78899264", "0.7803829", "0.7792027", "0.7787357", "0.7730231", "0.7730231", "0.76892394", "0.76892394", "0.76892394", "0.76892394", "0.76892394", "0.76892394", "0.76429844", "0.76429844", "0.76429844", "0.76327676", "0...
0.784911
5
Finds list of users with specific name
List<User> getUserByName(String name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic List<User> search(String name) {\n\t\treturn null;\r\n\t}", "public List<User> listUsers(String userName);", "List<User> searchUsersByUsername(String username);", "public List<User> findUsers(final String name) {\n if (Objects.nonNull(name))\n return userRepository.fin...
[ "0.79152566", "0.7655889", "0.7568199", "0.75451636", "0.7504306", "0.7389524", "0.73269767", "0.72769", "0.72534037", "0.7252888", "0.72307706", "0.7226351", "0.7222813", "0.7209989", "0.72061145", "0.7059736", "0.70538414", "0.702999", "0.69730407", "0.69588554", "0.6935931...
0.78058887
1
Searches for BPMN processes with the same, but a different containing process.
private boolean containsOtherProcessSameBPMNProcessName(SushiProcess process, String bpmnProcessName) { List<BPMNProcess> bpmnProcesses = BPMNProcess.findByName(bpmnProcessName); for(BPMNProcess bpmnProcess : bpmnProcesses){ if(!SushiProcess.findByBPMNProcess(bpmnProcess).equals(process)){ return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String m29548a(Context context) {\n ActivityManager activityManager = (ActivityManager) context.getSystemService(\"activity\");\n int myPid = Process.myPid();\n for (RunningAppProcessInfo runningAppProcessInfo : activityManager.getRunningAppProcesses()) {\n if (runnin...
[ "0.52918816", "0.5244699", "0.52394223", "0.5118726", "0.5037656", "0.5009589", "0.49855298", "0.49773642", "0.49733478", "0.49732167", "0.49681723", "0.49670303", "0.4945311", "0.49329686", "0.49165756", "0.4914502", "0.48801413", "0.48737153", "0.48618305", "0.4861296", "0....
0.6662566
0
XXX supply from PP? Creates a new instance of EditorPropertyDisplayer
public EditorPropertyDisplayer(Property p) { this(p, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CustomModuleEditor getPropertyEditor() {\n\t return new SetErrorFunction();\n }", "public interface PropertyConsumer {\n\n /**\n * Key in the associated propertyInfo object. Holds a list of\n * property names, which should be displayed and editable when\n * configuring a PropertyConsumer ...
[ "0.62836003", "0.615627", "0.60967094", "0.6071574", "0.6042168", "0.60037154", "0.6002211", "0.5854544", "0.5852782", "0.5852627", "0.58445305", "0.58326095", "0.5828475", "0.58198315", "0.5819442", "0.5799287", "0.57928115", "0.578143", "0.5780925", "0.57637775", "0.5756076...
0.79972327
0
If the property descriptor explicitly says it does not want a custom editor button, this overrides anything set on the PropertyPanel.
public final void setShowCustomEditorButton(boolean val) { if (getProperty() != null) { Property p = getProperty(); Boolean explicit = (Boolean) p.getValue("suppressCustomEditor"); //NOI18N if (explicit != null) { val = explicit.booleanValue(); System.err.println("Found explicit value: " + val); } } if (showCustomEditorButton != val) { showCustomEditorButton = val; replaceInner(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean supportsCustomEditor() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean hasCustomUI() {\n\t\treturn false;\n\t}", "public boolean hasInPlaceCustomEditor () {\n if (modifiedEditor instanceof EnhancedPropertyEditor) {\n return ((EnhancedPropertyEditor)modifiedEditor).hasIn...
[ "0.62741894", "0.6188662", "0.61318207", "0.606741", "0.59131444", "0.580118", "0.57796514", "0.5764428", "0.5757403", "0.5751678", "0.5721563", "0.5691282", "0.56860256", "0.5678437", "0.56566846", "0.56363404", "0.562533", "0.56233364", "0.55951726", "0.55799943", "0.557714...
0.6937546
0
Basically some hacks to acquire the underlying property descriptor in the case of a wrapper. This is here because some property editors will cast the result of PropertyEnv.getFeatureDescriptor() as a specific implementation type, so even if we're wrapping a property model, we still need to make sure we're returning the class they expect.
static final FeatureDescriptor findFeatureDescriptor(PropertyDisplayer pd) { if (pd instanceof EditorPropertyDisplayer) { //Issue 38004, more gunk to ensure we get the right feature //descriptor EditorPropertyDisplayer epd = (EditorPropertyDisplayer) pd; if (epd.modelRef != null) { PropertyModel pm = epd.modelRef.get(); if (pm instanceof ExPropertyModel) { FeatureDescriptor fd = ((ExPropertyModel) pm).getFeatureDescriptor(); if (fd != null) { return fd; } } } } Property p = pd.getProperty(); if (p instanceof ModelProperty) { return ((ModelProperty) p).getFeatureDescriptor(); } else if (p instanceof ModelProperty.DPMWrapper) { return ((ModelProperty.DPMWrapper) p).getFeatureDescriptor(); } else { return p; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private PropertyPagePropertyDescriptor getPropertyDescriptor() {\n \t\treturn propertyDescriptor;\n \t}", "public java.beans.PropertyDescriptor[] getPropertyDescriptors()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfinal java.beans.PropertyDescriptor[] res =\n\t\t\t\t{ prop(\"TargetType\", \"the type of vessel this mode...
[ "0.61963177", "0.60254854", "0.5794402", "0.5722748", "0.5651864", "0.5591935", "0.5573587", "0.5548992", "0.5521717", "0.5494136", "0.5494136", "0.54733235", "0.54704756", "0.5440892", "0.5428297", "0.5403326", "0.540225", "0.53843963", "0.5370714", "0.5343851", "0.5332133",...
0.6189955
1
Overridable if retention strategy is parameterized
public void updateState(Map<String, String[]> parameters){ if(this instanceof ParameterizedStrategy){ ((ParameterizedStrategy)this).updateStrategyParameters(parameters); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void trackRetention() {\n track(\"_retention\");\n }", "public Integer getRetentionPeriod()\n {\n return retentionPeriod;\n }", "public Retention getRetention() {\n return retention;\n }", "public void setRetentionPolicy(String retentionPolicy) {\n this.retentio...
[ "0.64734757", "0.58462393", "0.5727814", "0.56283355", "0.5627045", "0.5627045", "0.5349921", "0.52925223", "0.5151037", "0.51500726", "0.50653285", "0.5013327", "0.49793172", "0.49264416", "0.4800356", "0.4755118", "0.46884927", "0.46848577", "0.46834266", "0.46742728", "0.4...
0.0
-1
Overridable if retention strategy is a build deleted listener
public void onBuildDeleted(AbstractBuild build, GlobalBuildStatsPluginSaver pluginSaver) { if(this instanceof BuildDeletedListener){ ((BuildDeletedListener)this).buildDeleted(build, pluginSaver); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onDeleted(final AbstractBuild<?, ?> build) {\n\n final AbstractProject<?, ?> project = build.getProject();\n final PermalinkStorage storage = project.getProperty(PermalinkStorage.class);\n\n if (storage == null) return;\n\n storage.deleteAl...
[ "0.6154862", "0.5783279", "0.5703009", "0.5703009", "0.566047", "0.56584233", "0.56526995", "0.5646516", "0.56319195", "0.55683106", "0.54626316", "0.5415358", "0.5415358", "0.5350929", "0.5252443", "0.5232634", "0.52243733", "0.520412", "0.5110609", "0.507282", "0.5044069", ...
0.6125566
1
Overridable if retention strategy is a build completed listener
public void onBuildCompleted(AbstractBuild build, GlobalBuildStatsPluginSaver pluginSaver) { if(this instanceof BuildCompletedListener){ ((BuildCompletedListener)this).buildCompleted(build, pluginSaver); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public final void onCompleted(final Run run, @Nonnull final TaskListener listener) {\n final String jobName = run.getParent().getDisplayName();\n\n // Process only if job in NOT in blacklist\n if ( isJobTracked(jobName) ) {\n logger.fine(\"Completed build!\");\n\n // Collect Data\n ...
[ "0.5769018", "0.54456455", "0.5388309", "0.53781503", "0.5332176", "0.5131163", "0.51247233", "0.51016766", "0.50876796", "0.5071182", "0.5066076", "0.5033003", "0.5023366", "0.49953353", "0.48980466", "0.48840803", "0.48773628", "0.48639998", "0.48632494", "0.48632494", "0.4...
0.5661619
1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.credits_simulator, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.6862...
0.0
-1
Created by DANCO on 29/03/2017.
public interface ddd { public String dan(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Ov...
[ "0.5936388", "0.58663046", "0.5795119", "0.5693191", "0.56316614", "0.56064814", "0.56037015", "0.56037015", "0.56014633", "0.5578554", "0.55616325", "0.55478483", "0.55395216", "0.55058694", "0.5490745", "0.5482945", "0.5481928", "0.54698455", "0.54658496", "0.54556334", "0....
0.0
-1
Creates new form VistaDenunciaActualizar
public VistaDenunciaA() { initComponents(); listaDenuncias=new LinkedList<>(); mostrarDenuncias1(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void actualizar(int id_evento_vista, Object datos) {\r\n\t\t//Borra lo anterior\r\n \t\r\n \t jFormattedTextFieldPiso.setText(\"\");\r\n jFormattedTextFieldNumero.setText(\"\");\r\n jFormattedTextFieldTipo.setText(\"\");\r\n \r\n\t\t\r\n\t\tif(id_evento_vista == ...
[ "0.6667095", "0.66258216", "0.6575771", "0.6489927", "0.64610445", "0.6426287", "0.63288975", "0.6324128", "0.6306889", "0.62444836", "0.62107867", "0.6204141", "0.62033904", "0.6183825", "0.6172163", "0.61620784", "0.6152925", "0.6149529", "0.61264455", "0.61238945", "0.6118...
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); modificar = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); descripcion = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); jTable1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTable1MouseClicked(evt); } }); jScrollPane1.setViewportView(jTable1); modificar.setText("Modificar"); modificar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { modificarActionPerformed(evt); } }); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel2.setText("Actualizar Denuncias"); jLabel3.setText("Selecciona la denuncia que deseas midificar y pulsa el boton."); jLabel4.setText("descripcion:"); descripcion.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { descripcionActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addGap(310, 310, 310) .addComponent(modificar)) .addGroup(layout.createSequentialGroup() .addGap(124, 124, 124) .addComponent(jLabel2)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel3)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(descripcion))) .addContainerGap(21, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel2) .addGap(32, 32, 32) .addComponent(jLabel3) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(57, 57, 57) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE) .addComponent(modificar) .addContainerGap()) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.73195875", "0.7291065", "0.7291065", "0.7291065", "0.7286258", "0.7248489", "0.7213822", "0.7208757", "0.7195916", "0.7190243", "0.7184025", "0.71591616", "0.7148041", "0.70930153", "0.7080625", "0.7056986", "0.6987694", "0.69770867", "0.6955136", "0.69538426", "0.69452894...
0.0
-1
Use the current date as the default date in the picker
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { int year; int month; int day; if (!this.getArguments().containsKey("date")) { final Calendar c = Calendar.getInstance(); year = c.get(Calendar.YEAR); month = c.get(Calendar.MONTH); day = c.get(Calendar.DAY_OF_MONTH); } else { final Calendar c = Calendar.getInstance(); c.setTimeInMillis(getArguments().getLong("date")); year = c.get(Calendar.YEAR); month = c.get(Calendar.MONTH); day = c.get(Calendar.DAY_OF_MONTH); } // Create a new instance of DatePickerDialog and return it return new DatePickerDialog(getActivity(), this, year, month, day); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTodayDate() {\n\t\tfinal Calendar c = Calendar.getInstance();\r\n\t\tmYear = c.get(Calendar.YEAR);\r\n\t\tmMonth = c.get(Calendar.MONTH);\r\n\t\tmDay = c.get(Calendar.DAY_OF_MONTH);\r\n\r\n\t\tmaxYear = mYear - 10;\r\n\t\tmaxMonth = mMonth;\r\n\t\tmaxDay = mDay;\r\n\r\n\t\tminYear = mYear - 110;\r\n...
[ "0.7570866", "0.7052404", "0.6975466", "0.68639815", "0.67990696", "0.6789898", "0.6783088", "0.6780454", "0.670162", "0.6687505", "0.66742736", "0.6661783", "0.66408455", "0.6629506", "0.6622046", "0.6614785", "0.66132003", "0.65635", "0.6558133", "0.65395504", "0.65298307",...
0.0
-1
Main method for testing
public static void main(String[] args){ fatalError(); System.out.println("Termination not requested."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void main() {\n MainApp.main(new String[] {});\n }", "public static void main(String[] args) {\n // PUT YOUR TEST CODE HERE\n }", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n GOL_Main.main(args);\n }...
[ "0.7799056", "0.77874213", "0.76932955", "0.7666802", "0.7611093", "0.757639", "0.74970156", "0.7496197", "0.7367972", "0.7329825", "0.7298581", "0.72750217", "0.72648335", "0.72605103", "0.72511375", "0.7203502", "0.71987534", "0.71808213", "0.71754104", "0.71677196", "0.716...
0.0
-1
9 Utility classes should not have a public or default constructor.
private RiValCrossValidatedRecsys() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Util() { }", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Util() {\n }", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "private Utility() {\n throw new IllegalAccessError();\n }"...
[ "0.8163816", "0.81117535", "0.81117535", "0.81117535", "0.81117535", "0.7976204", "0.7952325", "0.79112375", "0.79051715", "0.79051715", "0.78382826", "0.78382826", "0.78146636", "0.77984935", "0.77445227", "0.7734713", "0.7689046", "0.76741374", "0.7674087", "0.7674087", "0....
0.0
-1
Main method. Parameter is not used.
public static void main(final String[] args) { String enginePath = engines[8]; EngineParameter eparams = new EngineParameter(enginePath); String url = "http://files.grouplens.org/datasets/movielens/ml-1m.zip"; String folder = "src/resources/main/data/ml-1m"; String modelPath = "src/resources/main/crossValid/ml-1m/model/"; String recPath = "src/resources/main/crossValid/ml-1m/recommendations/"; String dataFile = eparams.getDataSouceParams().getSourceLocation().get(0); int nFolds = N_FOLDS; System.out.println("Preparing splits..."); prepareSplits(url, nFolds, dataFile, folder, modelPath); System.out.println("Gathering recomendations..."); //recommend(nFolds, modelPath, recPath); // RiVal's original step. //orbsRecommend(nFolds, eparams, modelPath); // Based on RiVal' step mixedRecommend(nFolds, eparams, modelPath); // Mixed step //System.out.println("Preparing strategy..."); // the strategy files are (currently) being ignored //prepareStrategy(nFolds, modelPath, recPath, modelPath); System.out.println("Evaluating..."); evaluate(nFolds, modelPath, recPath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main() {\n \n }", "public static void main()\n\t{\n\t}", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main(){\n\t...
[ "0.79063153", "0.76104075", "0.7546838", "0.7469704", "0.7449896", "0.7387559", "0.7351645", "0.73487926", "0.73139954", "0.7300619", "0.7300619", "0.7300619", "0.7300619", "0.7300619", "0.7300619", "0.7294175", "0.7292122", "0.7282494", "0.7275569", "0.7275569", "0.7264027",...
0.0
-1
Downloads a dataset and stores the splits generated from it.
public static void prepareSplits(final String url, final int nFolds, final String inFile, final String folder, final String outPath) { DataDownloader dd = new DataDownloader(url, folder); dd.downloadAndUnzip(); boolean perUser = true; long seed = SEED; Parser<Long, Long> parser = new MovielensParser(); DataModelIF<Long, Long> data = null; try { data = parser.parseData(new File(inFile)); } catch (IOException e) { e.printStackTrace(); } DataModelIF<Long, Long>[] splits = new CrossValidationSplitter<Long, Long>(nFolds, perUser, seed).split(data); File dir = new File(outPath); if (!dir.exists()) { if (!dir.mkdir()) { System.err.println("Directory " + dir + " could not be created"); return; } } for (int i = 0; i < splits.length / 2; i++) { DataModelIF<Long, Long> training = splits[2 * i]; DataModelIF<Long, Long> test = splits[2 * i + 1]; String trainingFile = outPath + "train_" + i + ".csv"; String testFile = outPath + "test_" + i + ".csv"; System.out.println("train: " + trainingFile); System.out.println("test: " + testFile); boolean overwrite = true; try { DataModelUtils.saveDataModel(training, trainingFile, overwrite, "\t"); DataModelUtils.saveDataModel(test, testFile, overwrite, "\t"); } catch (FileNotFoundException | UnsupportedEncodingException e) { e.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void downloadUCIData() throws Exception {\r\n\r\n String query = \"\";\r\n String strTableHeading = \"\";\r\n int numTableColumns = 89;\r\n //boolean overwrite = false; // Flag to avoid SQL calls if we are okay with using existing files\r\n sqlConnector.outSqlToCSV(query,...
[ "0.5514423", "0.53716314", "0.52574795", "0.5123324", "0.5105031", "0.5077774", "0.5073874", "0.5060727", "0.5027278", "0.5019327", "0.5017672", "0.50064033", "0.49569267", "0.49229422", "0.4884217", "0.4841211", "0.4839872", "0.48218042", "0.4821767", "0.48151094", "0.481422...
0.50001144
12
Recommends using an UB algorithm. Based on RiVal step.
public static void orbsRecommend(final int nFolds, EngineParameter eparams, final String inPath) { List<String> trainingFiles; String testFile; for (int curFold = 0; curFold < nFolds; curFold++) { trainingFiles = new ArrayList<String>(); trainingFiles.add(inPath + "train_" + curFold + ".csv"); testFile = inPath+"test_"+curFold+".csv"; DataSourceParams dsp = eparams.getDataSouceParams(); eparams.setDataSource(trainingFiles, dsp.getEnclosure(), " ", false, false); eparams.setEngineName("EngineFold"+curFold); eparams.setTestFile(testFile); eparams.setServing("br.ufsc.lapesd.orbs.example.crossvalidation.ServingToFile"); Engine engine; switch (eparams.getEngineType()) { case "br.ufsc.lapesd.orbs.example.ucfclassic.UCFClassicEngine": engine = new UCFClassicEngine(eparams); break; case "br.ufsc.lapesd.orbs.example.ucfmultiattribute.UCFMultiAttributeEngine": engine = new UCFMultiAttributeEngine(eparams); break; case "br.ufsc.lapesd.orbs.core.ProposalEngine": engine = new UCFProposalEngine(eparams); break; default: System.out.println("Declared engine no expected. Using ClassicNeighborhoodAnalyzerEngine instead."); engine = new UCFClassicEngine(eparams); break; } System.out.println("EngineFold "+ curFold +" will begin training."); engine.train(); //Query especial para todos os usuários do teste, recomendar todos os itens do treino List<String> ls = new ArrayList<String>(); ls.add(testFile); eparams.setDataSource(ls, dsp.getEnclosure(), " ", false, false); DataSource testSource = new DataSource(eparams.getDataSouceParams()); TrainingData testData = testSource.readTraining(); Set<String> userIDs = testData.getUsers().keySet(); for(String userID: userIDs){ engine.query(new Query(userID, 4000, null, null, null)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public static void tinyUBTest() {\n final double[] answers = {0.5307575646626514, 0.7264168965132833, 0.860376939237304,\n 0.952744626134358, 0.9954079673114701, 1.0};\n final double kappa = 2.0;\n assertTrue(1.0 == approximateUpperBoundOnP(0, 0, kappa));\n final long n = 5;\n for (l...
[ "0.58324426", "0.5489201", "0.53820795", "0.53361386", "0.53274024", "0.5316997", "0.52796596", "0.52309275", "0.5214268", "0.520948", "0.5177799", "0.5170669", "0.5156676", "0.51091975", "0.50787944", "0.50751066", "0.50734615", "0.5070566", "0.50516033", "0.5043201", "0.501...
0.0
-1
Recommends using an UB algorithm. Mixed step.
public static void mixedRecommend(final int nFolds, EngineParameter eparams, final String inPath) { List<String> trainingFiles; String trainPath, testPath; for (int i = 0; i < nFolds; i++) { trainPath = inPath+"train_"+i+".csv"; testPath = inPath+"test_"+i+".csv"; org.apache.mahout.cf.taste.model.DataModel trainModel; org.apache.mahout.cf.taste.model.DataModel testModel; try { trainModel = new FileDataModel(new File(trainPath)); testModel = new FileDataModel(new File(testPath)); } catch (IOException e) { e.printStackTrace(); return; } trainingFiles = new ArrayList<String>(); trainingFiles.add(trainPath); DataSourceParams dsp = eparams.getDataSouceParams(); eparams.setDataSource(trainingFiles, dsp.getEnclosure(), " ", false, false); eparams.setEngineName("EngineFold"+i); eparams.setTestFile(testPath); eparams.setServing("br.ufsc.lapesd.orbs.example.crossvalidation.ServingToFile"); Engine engine; switch (eparams.getEngineType()) { case "br.ufsc.lapesd.orbs.example.ucfclassic.UCFClassicEngine": engine = new UCFClassicEngine(eparams); break; case "br.ufsc.lapesd.orbs.example.ucfmultiattribute.UCFMultiAttributeEngine": engine = new UCFMultiAttributeEngine(eparams); break; case "br.ufsc.lapesd.orbs.core.ProposalEngine": engine = new UCFProposalEngine(eparams); break; default: System.out.println("Declared engine no expected. Using ClassicNeighborhoodAnalyzerEngine instead."); engine = new UCFClassicEngine(eparams); break; } System.out.println("EngineFold "+ i +" is start training."); engine.train(); System.out.println("EngineFold "+ i +" is receiving queries."); LongPrimitiveIterator users; try { users = testModel.getUserIDs(); while (users.hasNext()) { long u = users.nextLong(); engine.query(new Query(String.valueOf(u), trainModel.getNumItems(), null, null, null)); } } catch (TasteException e) { e.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public static void tinyUBTest() {\n final double[] answers = {0.5307575646626514, 0.7264168965132833, 0.860376939237304,\n 0.952744626134358, 0.9954079673114701, 1.0};\n final double kappa = 2.0;\n assertTrue(1.0 == approximateUpperBoundOnP(0, 0, kappa));\n final long n = 5;\n for (l...
[ "0.5865389", "0.52983296", "0.5298174", "0.5288557", "0.5286946", "0.5259145", "0.5204375", "0.51925296", "0.5187872", "0.51338184", "0.51148057", "0.508005", "0.5078387", "0.5077074", "0.5074551", "0.5047387", "0.50442535", "0.5039547", "0.5005193", "0.4999824", "0.49925786"...
0.0
-1
Recommends using an UB algorithm. RiVal original step.
public static void recommend(final int nFolds, final String inPath, final String outPath) { for (int i = 0; i < nFolds; i++) { org.apache.mahout.cf.taste.model.DataModel trainModel; org.apache.mahout.cf.taste.model.DataModel testModel; try { trainModel = new FileDataModel(new File(inPath + "train_" + i + ".csv")); testModel = new FileDataModel(new File(inPath + "test_" + i + ".csv")); } catch (IOException e) { e.printStackTrace(); return; } GenericRecommenderBuilder grb = new GenericRecommenderBuilder(); String recommenderClass = "org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender"; String similarityClass = "org.apache.mahout.cf.taste.impl.similarity.PearsonCorrelationSimilarity"; int neighborhoodSize = NEIGH_SIZE; Recommender recommender = null; try { recommender = grb.buildRecommender(trainModel, recommenderClass, similarityClass, neighborhoodSize); } catch (RecommenderException e) { e.printStackTrace(); } String fileName = "recs_" + i + ".csv"; LongPrimitiveIterator users; try { users = testModel.getUserIDs(); boolean createFile = true; while (users.hasNext()) { long u = users.nextLong(); assert recommender != null; List<RecommendedItem> items = recommender.recommend(u, trainModel.getNumItems()); // List<RecommenderIO.Preference<Long, Long>> prefs = new ArrayList<>(); for (RecommendedItem ri : items) { prefs.add(new RecommenderIO.Preference<>(u, ri.getItemID(), ri.getValue())); } // RecommenderIO.writeData(u, prefs, outPath, fileName, !createFile, null); createFile = false; } } catch (TasteException e) { e.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public static void tinyUBTest() {\n final double[] answers = {0.5307575646626514, 0.7264168965132833, 0.860376939237304,\n 0.952744626134358, 0.9954079673114701, 1.0};\n final double kappa = 2.0;\n assertTrue(1.0 == approximateUpperBoundOnP(0, 0, kappa));\n final long n = 5;\n for (l...
[ "0.5842457", "0.55284095", "0.5347937", "0.534463", "0.53140646", "0.5242372", "0.5221243", "0.520257", "0.51934546", "0.5125386", "0.5117165", "0.50800085", "0.5070388", "0.5057851", "0.5039086", "0.5031912", "0.502062", "0.5014984", "0.50127894", "0.49875814", "0.49743205",...
0.0
-1
Prepares the strategies to be evaluated with the recommenders already generated.
@SuppressWarnings("unchecked") public static void prepareStrategy(final int nFolds, final String splitPath, final String recPath, final String outPath) { for (int i = 0; i < nFolds; i++) { File trainingFile = new File(splitPath + "train_" + i + ".csv"); File testFile = new File(splitPath + "test_" + i + ".csv"); File recFile = new File(recPath + "recs_" + i + ".csv"); DataModelIF<Long, Long> trainingModel; DataModelIF<Long, Long> testModel; DataModelIF<Long, Long> recModel; try { trainingModel = new SimpleParser().parseData(trainingFile); testModel = new SimpleParser().parseData(testFile); recModel = new SimpleParser().parseData(recFile); } catch (IOException e) { e.printStackTrace(); return; } Double threshold = REL_TH; String strategyClassName = "net.recommenders.rival.evaluation.strategy.UserTest"; EvaluationStrategy<Long, Long> strategy = null; try { strategy = (EvaluationStrategy<Long, Long>) (Class.forName(strategyClassName)).getConstructor(DataModelIF.class, DataModelIF.class, double.class). newInstance(trainingModel, testModel, threshold); } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | ClassNotFoundException | InvocationTargetException e) { e.printStackTrace(); } DataModelIF<Long, Long> modelToEval = DataModelFactory.getDefaultModel(); for (Long user : recModel.getUsers()) { assert strategy != null; for (Long item : strategy.getCandidateItemsToRank(user)) { if (!Double.isNaN(recModel.getUserItemPreference(user, item))) { modelToEval.addPreference(user, item, recModel.getUserItemPreference(user, item)); } } } try { DataModelUtils.saveDataModel(modelToEval, outPath + "strategymodel_" + i + ".csv", true, "\t"); } catch (FileNotFoundException | UnsupportedEncodingException e) { e.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initModelEntities(final Collection<String> strategiesElems_) {\n\t\tthis.strategies = new ArrayList<String>();\n\t\tfinal Iterator<String> iteStrategies = strategiesElems_.iterator();\n\t\twhile (iteStrategies.hasNext()) {\n\t\t\tfinal String strategyElement = iteStrategies.next();\n\t\t\tthis.strateg...
[ "0.6329999", "0.5739692", "0.57129675", "0.5571761", "0.55425686", "0.5487731", "0.5403286", "0.5397956", "0.5278479", "0.5158581", "0.5121787", "0.5084718", "0.5080898", "0.5077817", "0.50607514", "0.5037881", "0.50302464", "0.5012148", "0.5011203", "0.49685088", "0.4963341"...
0.5875318
1
Evaluates the recommendations generated in previous steps.
public static void evaluate(final int nFolds, final String splitPath, final String recPath) { double ndcgRes = 0.0; double precisionRes = 0.0; double rmseRes = 0.0; for (int i = 0; i < nFolds; i++) { File testFile = new File(splitPath + "test_" + i + ".csv"); File recFile = new File(recPath + "recs_" + i + ".csv"); DataModelIF<Long, Long> testModel = null; DataModelIF<Long, Long> recModel = null; try { testModel = new SimpleParser().parseData(testFile); recModel = new SimpleParser().parseData(recFile); } catch (IOException e) { e.printStackTrace(); } NDCG<Long, Long> ndcg = new NDCG<>(recModel, testModel, new int[]{AT}); ndcg.compute(); ndcgRes += ndcg.getValueAt(AT); RMSE<Long, Long> rmse = new RMSE<>(recModel, testModel); rmse.compute(); rmseRes += rmse.getValue(); Precision<Long, Long> precision = new Precision<>(recModel, testModel, REL_TH, new int[]{AT}); precision.compute(); precisionRes += precision.getValueAt(AT); } System.out.println("NDCG@" + AT + ": " + ndcgRes / nFolds); System.out.println("RMSE: " + rmseRes / nFolds); System.out.println("P@" + AT + ": " + precisionRes / nFolds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void learn() {\n\t\tupdateValues();\n\t\tif(CFG.isUpdatedPerformanceHistory()){\n\t\t\tupdateHistory();\n\t\t}\n\t\tif(CFG.isEvaluated()) evaluate();\n\t}", "private String[] evaluate()\n {\n //there must be some recommender selected by the user on the UI\n if (selectedRecommenderPanel.g...
[ "0.72130793", "0.69825137", "0.6927204", "0.667792", "0.6453841", "0.64381564", "0.6286033", "0.62509346", "0.6246983", "0.6227371", "0.62233096", "0.62020224", "0.61712927", "0.6165585", "0.61446327", "0.6136282", "0.61212873", "0.60419166", "0.6034763", "0.6013873", "0.6013...
0.0
-1
/ Just so that my state changes are more organized.
public void stateChange() { if (Qclicks > 3 && mini == GameState.questions) { /* * This makes all of the buttons disappear except for the continue * button */ stage.clear(); stage.addActor(next); } if (Gdx.input.justTouched()) { if (mini == GameState.start) { int x = Gdx.input.getX(); int y = Gdx.input.getY(); score = 0; clicks = 0; Qclicks = 0; // font.setScale(0.25f); if(x > 240 && x < 445 && y > 322 && y < 350){ mini = GameState.questions; } } else if (mini == GameState.score) { int numc = (int) (percentCorrect * (numTries * 4)) + score; numTries++; percentCorrect = ((float) numc) / ((float) (numTries * 4)); if (score >= 3) { numSuccess++; } if (needToReview.size() == 0) { endGame(); } mini = GameState.review; } else if (mini == GameState.review) { reviewNum++; if (needToReview.size() == reviewNum) { endGame(); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void incrementStates() {\n\n }", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "abstract public void updateState();", "public void updateState();", "void beforeState();", "protected abstract int newState();", "@Override\n\tpublic void stateChanged(ChangeEvent arg0) {\n...
[ "0.73819786", "0.710344", "0.69200546", "0.67290556", "0.66232073", "0.65874666", "0.65573126", "0.6504009", "0.6496594", "0.6483216", "0.64576316", "0.6456516", "0.64556503", "0.64172775", "0.6388261", "0.63094467", "0.62913376", "0.62877065", "0.6287188", "0.6286149", "0.62...
0.0
-1
/ The instructions will be updated. The heights are actually widths
public void drawGame() { if (first) { for (int i = 0; i < 4; i++) { int place = r.nextInt(4); while (heightUsed[place] == true) { place = r.nextInt(4); } if (i == 0) { a1.setBounds(heights[place], 265, 150, 60); stage.addActor(a1); heightUsed[place] = true; } else if (i == 1) { a2.setBounds(heights[place], 265, 150, 60); stage.addActor(a2); heightUsed[place] = true; } else if (i == 2) { a3.setBounds(heights[place], 265, 150, 60); stage.addActor(a3); heightUsed[place] = true; } else if (i == 3) { a4.setBounds(heights[place], 265, 150, 60); stage.addActor(a4); heightUsed[place] = true; } } } if (mini == GameState.questions) { basketball.render(); batch.begin(); if (Qclicks == 0) { for (int i = 0; i < text.size(); i++) { if (i == 0) { questionfont.draw(batch, "1: " + text.get(i), 50, 450 - 50 * i); } else { questionfont.draw(batch, text.get(i), 50, 450 - 50 * i); } } a1.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(0)); a2.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(1)); a3.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(2)); a4.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(3)); } if (Qclicks == 1) { for (int i = 0; i < text.size(); i++) { if (i == 0) { questionfont.draw(batch, "2: " + text.get(i), 50, 450 - 50 * i); } else { questionfont.draw(batch, text.get(i), 50, 450 - 50 * i); } } a1.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(0)); a2.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(1)); a3.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(2)); a4.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(3)); } if (Qclicks == 2) { for (int i = 0; i < text.size(); i++) { if (i == 0) { questionfont.draw(batch, "3: " + text.get(i), 50, 450 - 50 * i); } else { questionfont.draw(batch, text.get(i), 50, 450 - 50 * i); } } a1.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(0)); a2.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(1)); a3.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(2)); a4.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(3)); } if (Qclicks == 3) { for (int i = 0; i < text.size(); i++) { if (i == 0) { questionfont.draw(batch, "4: " + text.get(i), 50, 450 - 50 * i); } else { questionfont.draw(batch, text.get(i), 50, 450 - 50 * i); } } a1.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(0)); a2.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(1)); a3.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(2)); a4.setText(answersForQuestions.get( questionsOrdered.get(Qclicks)).get(3)); } font.setColor(Color.BLACK); font.draw(batch, "(Click answers below)", (Gdx.graphics.getWidth() / 2) - 80, 350); font.draw(batch, score + " out of " + Qclicks, 50, 100); font.setColor(Color.WHITE); batch.end(); stage.draw(); } if (mini == GameState.start) { batch.begin(); font.draw(batch, "(click here to continue)", Gdx.graphics.getWidth() / 2 - 75, 150); font.draw(batch, InteractWithFiles.readMiniGameScreen(0), Gdx.graphics.getWidth() / 2 - 75, Gdx.graphics.getHeight() / 2 + 50); font.draw(batch, InteractWithFiles.readMiniGameScreen(1), Gdx.graphics.getWidth() / 2 - 200, Gdx.graphics.getHeight() / 2 + 25); font.draw(batch, InteractWithFiles.readMiniGameScreen(2), Gdx.graphics.getWidth() / 2 - 150, Gdx.graphics.getHeight() / 2); batch.end(); } if (mini == GameState.score) { batch.begin(); font.draw(batch, "(click to continue)", 200, 150); if (score >= 3) { font.draw(batch, "You passed!", Gdx.graphics.getWidth() / 2 - 125, Gdx.graphics.getHeight() / 2 + 50); font.draw(batch, score + " out of 4", Gdx.graphics.getWidth() / 2 - 125, Gdx.graphics.getHeight() / 2 - 5); success = true; } else { font.draw(batch, "You Failed...", Gdx.graphics.getWidth() / 2 - 125, Gdx.graphics.getHeight() / 2 + 50); font.draw(batch, score + " out of 4", Gdx.graphics.getWidth() / 2 - 125, Gdx.graphics.getHeight() / 2 - 5); } batch.end(); } if (mini == GameState.review) { if (!first) { batch.begin(); font.draw(batch, "Review Section", 200, 350); font.draw(batch, "(click to continue)", 200, 150); ArrayList<String> text = InteractWithFiles .drawQuestionsDifferentLines( needToReview.get(reviewNum), 50); for (int i = 0; i < text.size(); i++) { font.draw(batch, text.get(i), 50, 300 - 50 * i); } batch.end(); } } first = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void calcContentSize() {\n }", "@Override\n void setWidthHeight() {\n setWidth(explosions[0].getWidth());\n setHeight(explosions[1].getHeight());\n }", "double getNewWidth();", "double getNewHeight();", "private void updateDimensions() {\r\n width = gui.getWidth();\r\n heig...
[ "0.69163185", "0.666156", "0.65453655", "0.6502497", "0.644595", "0.6423595", "0.64125174", "0.6300663", "0.6284631", "0.6262397", "0.6228059", "0.6222905", "0.6219349", "0.6147509", "0.6131417", "0.610565", "0.6101213", "0.607861", "0.6076779", "0.60758454", "0.60605955", ...
0.0
-1
extends Thread > runnable
public void run() { // variables to store key HTTP(S) request information String sReadLine; boolean bNewHTTPHeader = true; String sHTTPMethod = ""; String sHTTPRequest = ""; boolean bPersistentConnection = true; // print the client IP:port System.out.println("client " + connectedClient.getInetAddress() + ":" + connectedClient.getPort() + " is connected"); System.out.println(); // create BufferedReader to read in from socket & DataOutputStream to send out to socket try { inFromClient = new BufferedReader(new InputStreamReader(connectedClient.getInputStream())); outToClient = new DataOutputStream(connectedClient.getOutputStream()); } catch (IOException e) { System.out.println("There was an error setting up the buffered reader, " + "data stream, or reading from the client:"); System.out.println(" " + e); } // process the HTTP(S) request try { // break apart the input to read the http method and request while ((sReadLine = inFromClient.readLine()) != null) { // create a tokenizer to parse the string StringTokenizer tokenizer = new StringTokenizer(sReadLine); // if new HTTP header, then pull out the Method and Request (first line) if (bNewHTTPHeader) { sHTTPMethod = tokenizer.nextToken().toUpperCase(); // HTTP method: GET, HEAD sHTTPRequest = tokenizer.nextToken().toLowerCase(); // HTTP query: file path bNewHTTPHeader = false; // next lines are not part of a new HTTP header // print to console System.out.println("New HTTP Header:"); System.out.println(" HTTP Method: " + sHTTPMethod); System.out.println(" HTTP Request: " + sHTTPRequest); // not a new HTTP header: check for key params Connection or empty line } else if (sReadLine.length() > 0) { // get the next token in the input line String sParam = tokenizer.nextToken(); // check to update connection status if (sParam.equalsIgnoreCase("Connection:")) { String sConnectionRequest = tokenizer.nextToken(); bPersistentConnection = (sConnectionRequest.equalsIgnoreCase("keep-alive")); // print param to console System.out.println(" param: " + sParam + " " + sConnectionRequest); } else { // otherwise just print param to console System.out.println(" param: " + sParam); } // no more lines to header: header is over } else { //print to console System.out.println("End of Header"); System.out.println(); // get the status code & response, then send back to client int iStatusCode = getStatusCode(sHTTPMethod, sHTTPRequest); String sResponse = getResponse(sHTTPMethod, sHTTPRequest, iStatusCode); sendResponse(sHTTPMethod, sHTTPRequest, iStatusCode, sResponse, bPersistentConnection); // next line is part of a new HTTP header bNewHTTPHeader = true; } } // loop has ended: client input is null (client must want to disconnect) this.connectedClient.close(); System.out.println("input from client " + connectedClient.getInetAddress() + + connectedClient.getPort() + " is null. This socket closed."); } catch (IOException e) { System.out.println("There was an error reading the HTTP request:"); System.out.println(" " + e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void run() {}", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n ...
[ "0.75462306", "0.75315017", "0.75315017", "0.74886465", "0.74886465", "0.74875474", "0.74875474", "0.7487275", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.7483098", "0.748309...
0.0
-1
MAIN HTTP METHODS send the HTTP response back to the client
private void sendResponse(String sHTTPMethod, String sHTTPRequest, int iStatusCode, String sResponse, boolean bPersistentConnection) { // determine if sending file and if redirect -> determines response boolean bIsFileSend = sHTTPMethod.equalsIgnoreCase("GET") && iStatusCode == 200; boolean bIsRedirect = iStatusCode == 301; // write header String sStatus = getStatusLine(iStatusCode) + END_LINE; String sLocation = (bIsRedirect) ? ("Location: " + sResponse) + END_LINE : (""); // only if redirect String sServerDetails = getServerDetails() + END_LINE; String sContentLength = "Content-Length: " + sResponse.length() + END_LINE; String sContentType = getContentType(sHTTPRequest) + END_LINE; String sConnection = getConnectionLine(bPersistentConnection) + END_LINE; String sSpaceBetweenHeaderAndBody = END_LINE; FileInputStream fin = null; // update content length if sending a file -> create file input stream if (bIsFileSend) { try { fin = new FileInputStream(ROOT_FOLDER.toString() + "/" + sResponse); // if file request, then sResponse is the file path sContentLength = "Content-Length: " + Integer.toString(fin.available()) + END_LINE; } catch (IOException e) { System.out.println("There was an error creating the file input stream for the response:"); System.out.println(" " + e); } } try { // send HTTP Header outToClient.writeBytes(sStatus); if (bIsRedirect) { outToClient.writeBytes(sLocation); // only send Location on redirect } outToClient.writeBytes(sServerDetails); outToClient.writeBytes(sContentType); outToClient.writeBytes(sContentLength); outToClient.writeBytes(sConnection); outToClient.writeBytes(sSpaceBetweenHeaderAndBody); // send HTTP Body if (bIsFileSend) { sendFile(fin, outToClient); // send file } else if (!bIsRedirect && !sHTTPMethod.equalsIgnoreCase("HEAD")) { outToClient.writeBytes(sResponse); // send HTML msg back } // print HTTP Header and Body to console System.out.println(sStatus); System.out.println(sServerDetails); System.out.println(sContentType); System.out.println(sContentLength); System.out.println(sConnection); if (bIsRedirect) { System.out.println(sLocation); } if (bIsFileSend) { System.out.println("File sent: " + sResponse); } else { System.out.println("Response: " + sResponse); } System.out.println(); // close connection if (!bPersistentConnection) { outToClient.close(); } } catch (IOException e) { System.out.println("writeBytes did not complete:"); System.out.println(" " + e + "\n"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract HTTPResponse finish();", "public Response send() {\n setupAndConnect();\n setRequestMethod();\n setRequestBody();\n setRequestHeaders();\n writeRequestBody();\n getResponse();\n connection.disconnect();\n return response;\n }", "public ...
[ "0.71534806", "0.6761867", "0.6721567", "0.6690706", "0.6682303", "0.66477954", "0.6621936", "0.66075796", "0.6606492", "0.6577515", "0.6546094", "0.65407616", "0.65321136", "0.6510369", "0.64647657", "0.63734144", "0.6369521", "0.6366952", "0.63529503", "0.634321", "0.633362...
0.69932956
1
HTTP HELPERS get the status code for based on the HTTP method and request from the client
private int getStatusCode(String sHTTPMethod, String sHTTPRequest) { // default is internal server error int iStatusCode = 500; // update based on method and request if (!isSupportedMethod(sHTTPMethod)) { iStatusCode = 403; } else if (isRedirect(sHTTPRequest)) { iStatusCode = 301; } else if (!isValidFile(sHTTPRequest)) { iStatusCode = 404; } else if (!isValidContentType(sHTTPRequest)) { iStatusCode = 415; } else if (isSupportedMethod(sHTTPMethod) && !isRedirect(sHTTPRequest) && isValidFile(sHTTPRequest) && isValidContentType(sHTTPRequest)) { iStatusCode = 200; } // return final status code return iStatusCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Http.Status status();", "int getStatusCode( );", "int getStatusCode();", "int getStatusCode();", "public abstract int statusCode();", "HttpStatusCode getStatusCode();", "RequestStatus getStatus();", "abstract Integer getStatusCode();", "protected abstract boolean isExpectedResponseCode(int httpStat...
[ "0.79022324", "0.7504849", "0.742197", "0.742197", "0.72349036", "0.7226157", "0.72035074", "0.7151141", "0.7062775", "0.69155204", "0.6700309", "0.66408074", "0.662412", "0.6576522", "0.6567496", "0.6526421", "0.6525116", "0.64627796", "0.64070505", "0.6401836", "0.64013565"...
0.6671865
11
check if HTTP method is supported
private boolean isSupportedMethod(String sHTTPMethod) { return Arrays.asList(SUPPORTED_METHODS).contains(sHTTPMethod.toUpperCase()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasHttpMethod();", "Collection<HttpMethod> getMinimalSupportedHttpMethods();", "public HTTPRequestMethod getMethod();", "public boolean hasHttpMethod() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasHttpMethod() {\n return ((bitField0_ & 0x00000002) ...
[ "0.82364774", "0.7192524", "0.7117007", "0.7085474", "0.7084208", "0.70812386", "0.70812386", "0.6905309", "0.67807746", "0.65462375", "0.648353", "0.64081204", "0.6369265", "0.6305307", "0.6294494", "0.6255011", "0.6211679", "0.61534435", "0.614888", "0.6142477", "0.6130073"...
0.79390204
1
get the response that should be sent to the client based on HTTP method, request, & status code
private String getResponse(String sHTTPMethod, String sHTTPRequest, int iStatusCode) { // default is internal server error String sResponse = HTML_START + "There was an internal error with the server." + HTML_END; // update based on status code if (iStatusCode == 403) { sResponse = HTML_START + "HTTP method not supported" + HTML_END; } else if (iStatusCode == 301) { sResponse = getRedirectURL(sHTTPRequest); } else if (iStatusCode == 404) { sResponse = HTML_START + "File not found" + HTML_END; } else if (iStatusCode == 415) { sResponse = HTML_START + "The server does not support this file type" + HTML_END; } else if (iStatusCode == 200 ) { sResponse = (sHTTPMethod.equalsIgnoreCase("GET")) ? getFilePath(sHTTPRequest) : ""; } // return final response return sResponse; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getResponse();", "public int getResponse() {return response;}", "public abstract String getResponse();", "public HTTPResponse get(HTTPRequest request) {\n\t\tHTTPResponse response = new HTTPResponse();\n\t\tresponse.setResponseHeader(request.getProtocol(), HTTPConstants.STATUS_OK, HTTPConsta...
[ "0.7020867", "0.68637896", "0.6836475", "0.6781197", "0.6726867", "0.65801936", "0.6563718", "0.6532034", "0.6532034", "0.6526765", "0.6502836", "0.64847034", "0.64675325", "0.64541924", "0.64538807", "0.6350708", "0.6340801", "0.6305348", "0.62977326", "0.62746066", "0.62604...
0.6275796
19
get the status line to return based on status code
private String getStatusLine(int iStatusCode) { String sStatus = "HTTP/1.1 "; if (iStatusCode == 200) { sStatus += iStatusCode + " OK"; } else if (iStatusCode == 301) { sStatus += iStatusCode + " Moved Permanently"; } else if (iStatusCode == 403) { sStatus += iStatusCode + " Forbidden"; } else if (iStatusCode == 404) { sStatus += iStatusCode + " Not Found"; } else if (iStatusCode == 415) { sStatus += iStatusCode + " Unsupported Media Type"; } else if(iStatusCode == 500) { sStatus += iStatusCode + " Internal Server Error"; } return sStatus; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "StatusLine getStatusLine();", "public String getStatusLine() {\n\n StringBuilder builder = new StringBuilder(SL_11_START.length() + 4 + message.length());\n builder.append(SL_11_START).append(code).append(' ').append(message);\n return builder.toString();\n }", "public int getStatusCode...
[ "0.81150985", "0.7552662", "0.7415008", "0.7310059", "0.7243096", "0.702844", "0.7024562", "0.6921105", "0.6921105", "0.6871629", "0.67230093", "0.6665587", "0.6629091", "0.6629091", "0.6629091", "0.6629091", "0.66212684", "0.66131794", "0.6519089", "0.6510767", "0.64916015",...
0.724805
4
get the connection line
private String getConnectionLine(boolean bPersistentConnection) { String sConnection = "Connection: "; String sConnectionStatus = (bPersistentConnection ? "keep-alive" : "close"); return sConnection + sConnectionStatus; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getLine() {\n return this.line;\n }", "public String getLine() {\n\t\treturn line.toString();\n\t}", "public String getline() {\n\t\treturn _line;\n\t}", "public String getLine ()\n {\n return line;\n }", "public int getLine() {\n return line;\n }", "public ...
[ "0.6916044", "0.6842314", "0.67717725", "0.6711854", "0.66935116", "0.66882586", "0.666875", "0.6668173", "0.66477567", "0.6642723", "0.65657914", "0.655207", "0.65501153", "0.6531744", "0.6531054", "0.6520084", "0.6515465", "0.6412692", "0.6404704", "0.63204044", "0.6279292"...
0.6666927
8
get the server details (secure or unsecure)
private String getServerDetails() { String sServerLine = "Server: Ramon's Killer "; String sSocketType = (bIsSecure ? "(SECURE)" : "(unsecure)"); sServerLine = sServerLine + sSocketType + " Server"; return sServerLine; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServerDetails();", "public static List<Object[]> getServerDetails(){\n\t\t\n\t\tString filePath = Holders.getFlatConfig().get(\"statusFile.use\").toString();\n\n\t\treturn getServerDetailsFromCSV(filePath, \"hostname\", \"user\",\"password\");\n\t}", "public String[] getConnessionDetails() {\r...
[ "0.8138273", "0.7112578", "0.6737043", "0.6591903", "0.65498316", "0.65450245", "0.6542783", "0.6493376", "0.645927", "0.64332265", "0.634277", "0.62657297", "0.623563", "0.6234245", "0.6192464", "0.6180939", "0.6173558", "0.6164954", "0.61233836", "0.6122236", "0.6101568", ...
0.79051
1
get the content type to return
private String getContentType(String sHTTPRequest) { String sContentType = "Content-Type: "; // update based on file extension or if response starts with HTML/URL String sFileExtension = getFileExtension(sHTTPRequest); if (sFileExtension.equalsIgnoreCase(".html") || sFileExtension.equalsIgnoreCase(".htm")) { sContentType += "text/html"; } else if (sFileExtension.equalsIgnoreCase(".txt")) { sContentType += "text/plain"; } else if (sFileExtension.equalsIgnoreCase(".pdf")) { sContentType += "application/pdf"; } else if (sFileExtension.equalsIgnoreCase(".png")) { sContentType += "image/png"; } else if (sFileExtension.equalsIgnoreCase(".jpeg") || sFileExtension.equalsIgnoreCase(".jpg")) { sContentType += "image/jpeg"; } else { sContentType += "text/html"; // default response } // return final content type return sContentType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getContentType();", "String getContentType();", "String getContentType();", "public String getContentType();", "public String getContentType();", "public String getContenttype() {\n return contenttype;\n }", "public String getContenttype() {\n return contenttype;\n }", "pub...
[ "0.8534745", "0.8534745", "0.8534745", "0.8346976", "0.8346976", "0.82786334", "0.82786334", "0.82219017", "0.81707627", "0.8133447", "0.80243516", "0.79723275", "0.79545283", "0.793058", "0.7905952", "0.7852434", "0.7842211", "0.7842211", "0.7842211", "0.7839472", "0.7816019...
0.70141894
65
check if request is redirect
private boolean isRedirect(String sHTTPRequest) { return sRedirects.containsKey(sHTTPRequest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\t\tpublic boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context)\n\t\t\t\t\t\t\tthrows ProtocolException {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}", "@Override\n\tpublic final boolean isRedirect()\n\t{\n\t\treturn redirect;\n\t}", "@Override\r\n\tpublic boolean ...
[ "0.7724539", "0.7720949", "0.75871396", "0.7539549", "0.7186285", "0.7102728", "0.7101214", "0.6995431", "0.6719359", "0.651093", "0.64703923", "0.615984", "0.6086953", "0.60814875", "0.6078687", "0.6010962", "0.5922289", "0.59053785", "0.58976924", "0.588356", "0.588356", ...
0.74049705
4
get the final URL location if request is a redirect
private String getRedirectURL(String sHTTPRequest) { return sRedirects.get(sHTTPRequest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tprotected String getRedirectUri(HttpServletRequest req)\r\n\t\t\tthrows ServletException, IOException {\n\t\treturn Utils.getRedirectUri(req);\r\n\t}", "public Optional<String> redirectLocation() {\n return header(LOCATION);\n }", "public String getRedirect() {\r\n\t\treturn this.redirect;\r...
[ "0.7090773", "0.702193", "0.6789755", "0.67723864", "0.6751809", "0.6709334", "0.66184723", "0.6475609", "0.6459454", "0.6382093", "0.6374195", "0.6279614", "0.62408966", "0.6232041", "0.6165911", "0.61559814", "0.61325413", "0.60450536", "0.60066116", "0.5871302", "0.5857687...
0.6737978
5
check if content type is supported
private boolean isValidContentType(String sHTTPRequest) { String sFileType = getFileExtension(sHTTPRequest); return Arrays.asList(SUPPORTED_FILE_TYPES).contains(sFileType); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isContentTypeSupported(String contentType)\n {\n if(contentType.equals(DEFAULT_MIME_TYPE))\n return true;\n else if(contentType.equals(\"text/html\"))\n return true;\n else\n return false;\n }", "boolean hasMimeType();", "public ...
[ "0.7812621", "0.7144021", "0.71287453", "0.6989769", "0.6979273", "0.6895225", "0.688765", "0.6738082", "0.66546667", "0.6559367", "0.6518798", "0.6518798", "0.6518798", "0.6489901", "0.6484654", "0.6430237", "0.6430237", "0.6342374", "0.6310551", "0.6307443", "0.62991303", ...
0.75405777
1
check if HTTP request is a valid file i.e. among available files in root server
private boolean isValidFile(String sHTTPRequest) { String sRootFolder = "/" + ROOT_FOLDER.getName(); return sAvailableFiles.contains(sRootFolder + sHTTPRequest.toLowerCase()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean checkURL(String file) {\n\t\tFile myFile = new File(file);\n\t\treturn myFile.exists() && !myFile.isDirectory();\n\t}", "private boolean isValidContentType(String sHTTPRequest) {\n String sFileType = getFileExtension(sHTTPRequest);\n return Arrays.asList(SUPPORTED_FILE_TYPES)...
[ "0.6779091", "0.6393829", "0.6367751", "0.6328221", "0.6257644", "0.62151855", "0.6149639", "0.61011523", "0.60670155", "0.6058419", "0.60380656", "0.60320777", "0.5986675", "0.59836894", "0.5964035", "0.59437716", "0.5942946", "0.59429145", "0.5923584", "0.5888236", "0.58769...
0.783616
0
get the file path for the HTTP request
private String getFilePath(String sHTTPRequest) { return sHTTPRequest.replaceFirst("/", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getResourcePath() {\n\t\tString reqResource = getRequest().getResourceRef().getPath();\n\t\treqResource = actualPath(reqResource, 1);\n\t\tLOGGERS.info(\"reqResourcePath---->\" + reqResource);\n\t\treturn reqResource;\n\t}", "public String getPath() {\n if (fileType == HTTP) {\n ...
[ "0.7138709", "0.7071984", "0.699531", "0.68856305", "0.68685293", "0.68161947", "0.67807025", "0.6743172", "0.6665684", "0.6651136", "0.66166615", "0.65921557", "0.6550765", "0.64477086", "0.6421631", "0.63855785", "0.63853836", "0.6379949", "0.6344093", "0.6338368", "0.63316...
0.7689751
0
INITIALIZATION HELPERS get list of valid file requests
private List<String> getValidFiles(File currentFolder) { File[] subFiles = currentFolder.listFiles(); List<String> sValidFiles = new ArrayList<>(); // recurse through root directory, http://stackoverflow.com/questions/1844688/read-all-files-in-a-folder // valid file must not be a directory, not be the redirect file, and be a supported content type if (subFiles != null) { for (File fileEntry : subFiles) { String sFileName = fileEntry.getPath(); if (fileEntry.isDirectory()) { sValidFiles.addAll(getValidFiles(fileEntry)); } else if (isValidContentType(sFileName) && !sFileName.equals(REDIRECT_FILE_NAME)) { sValidFiles.add(sFileName.replaceFirst(".","").toLowerCase()); } } } return sValidFiles; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Path getRequestListFilePath();", "List getFileUploads(HttpServletRequest request) throws ValidationException;", "List getFileUploads(HttpServletRequest request, File finalDir) throws ValidationException;", "@Override\n public Map<String, List<String>> getSubmissionFiles(SubmissionFilesRequest request) {\n...
[ "0.7194266", "0.6895134", "0.6591982", "0.640345", "0.6320835", "0.63202703", "0.6185271", "0.61405635", "0.6093241", "0.60197514", "0.60115284", "0.5976406", "0.59754896", "0.5971174", "0.5923033", "0.5914955", "0.5895589", "0.58947194", "0.58769846", "0.5864883", "0.5862098...
0.58843017
18
get a map of redirect original URLS and matching location URLs to redirect client
private Map<String, String> getRedirects(String sRedirectFileName) { try { // create Buffered reader to read file and String to store each line BufferedReader reader = new BufferedReader(new FileReader(sRedirectFileName)); String line; // read each line with space delimiter in form: sOriginal sNewURL while ((line = reader.readLine()) != null) { StringTokenizer tokenizer = new StringTokenizer(line); String sOriginalRequest = tokenizer.nextToken(); String sNewURL = tokenizer.nextToken(); sRedirects.put(sOriginalRequest, sNewURL); } reader.close(); } catch (IOException e) { System.out.println("There was an error created the map of redirects:"); System.out.println(" " + e); } return sRedirects; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private RedirectUrls getRedirectURLs() {\n RedirectUrls redirectUrls = new RedirectUrls();\n redirectUrls.setReturnUrl(URL_RETURN);\n redirectUrls.setCancelUrl(URL_CANCEL);\n\n return redirectUrls;\n }", "private RedirectUrls getRedirectUrls() {\n\t\tRedirectUrls redirectUrls = new...
[ "0.67063427", "0.63159674", "0.59595245", "0.58435005", "0.5681132", "0.5599178", "0.5597897", "0.5524204", "0.543943", "0.53952587", "0.5367893", "0.5362365", "0.53368735", "0.5330481", "0.53286254", "0.5324975", "0.52926224", "0.527794", "0.5251526", "0.5245726", "0.522658"...
0.71731055
0
Public constructor is required by servlet spec
public ServletContextListener() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ServletPersonne() {\n super();\n }", "private AppServlet() {\r\n\r\n }", "public ToptenServlet() {\r\n\t\tsuper();\r\n\t}", "public JsonServlet() {\n\t\tsuper();\n\t}", "public HttpServlet() {\r\n\t\tsuper();\r\n\t}", "private Request() {}", "private Request() {}", "public Control...
[ "0.7728938", "0.7638955", "0.7390061", "0.735874", "0.7355245", "0.735245", "0.735245", "0.7327141", "0.72331125", "0.7219205", "0.7211854", "0.7208325", "0.7189762", "0.71581805", "0.7106087", "0.7078185", "0.7071745", "0.70598465", "0.7052743", "0.7047305", "0.7012284", "...
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.nav, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.6862...
0.0
-1
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.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ...
[ "0.7904163", "0.7805678", "0.7766155", "0.77271765", "0.7631901", "0.76217514", "0.75843245", "0.7530648", "0.74879694", "0.74575084", "0.74575084", "0.7438342", "0.742121", "0.7402876", "0.7391506", "0.7386729", "0.7379215", "0.73702943", "0.7361895", "0.7355702", "0.7345358...
0.0
-1
Handle navigation view item clicks here.
@SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.nav_dashboard) { Intent intent = new Intent(DashboardActivity.this, DashboardActivity.class); startActivity(intent); } else if (id == R.id.nav_activities) { Intent intent = new Intent(DashboardActivity.this, CategoryActivity.class); startActivity(intent); } else if (id == R.id.nav_explore) { Intent intent = new Intent(DashboardActivity.this, ExploreActivity.class); startActivity(intent); } else if (id == R.id.nav_feed) { Intent intent = new Intent(DashboardActivity.this, FeedActivity.class); startActivity(intent); } else if (id == R.id.nav_settings) { Intent intent = new Intent(DashboardActivity.this, SettingsActivity.class); startActivity(intent); } else if (id == R.id.nav_sign_out) { sharedPref.edit().clear().commit(); Intent intent = new Intent(DashboardActivity.this, MainActivity.class); startActivity(intent); finish(); } else if (id == R.id.nav_profile){ Intent intent = new Intent(DashboardActivity.this, UserProfileActivity.class); startActivity(intent); } DrawerLayout drawer = findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "void onDialogNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tr...
[ "0.7882124", "0.7236464", "0.698732", "0.6946372", "0.6916901", "0.6916901", "0.68844694", "0.6873591", "0.686708", "0.676677", "0.6742629", "0.67214864", "0.6717165", "0.6713329", "0.669872", "0.6698353", "0.66798544", "0.6661854", "0.66607356", "0.66481036", "0.6642803", ...
0.0
-1
Test of findDuplicates method, of class LexicalChecker.
public void testFindDuplicates() { System.out.println("findDuplicates"); List<String> elements = new ArrayList<>(); elements.add("foo"); elements.add("bar"); elements.add("abc"); elements.add("foo"); elements.add("cde"); elements.add("cde"); elements.add("efg"); elements.add("cde"); Set<String> expResult = new LinkedHashSet<>(); expResult.add("foo"); LexicalChecker instance = new LexicalChecker(); Set<String> result = instance.findDuplicates(elements); assertNotSame(expResult, result); expResult.add("cde"); assertEquals(expResult, result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void findDuplicate()\n\t{\n\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toList = new ArrayList<String>();\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Dog\");\n\t\t\toList.add(\"Eagle\");\n\t\t\toList.add(\"Frog\");...
[ "0.7097055", "0.68297446", "0.6616557", "0.6405332", "0.6365893", "0.6356367", "0.62772185", "0.61961114", "0.6163668", "0.61538523", "0.6109795", "0.60349774", "0.5971091", "0.59332323", "0.5931462", "0.589783", "0.5884179", "0.5860663", "0.58359694", "0.5826971", "0.581536"...
0.8333545
0
/ name for display purposes only
public String getDisplayName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String nameLabel();", "String getDisplay_name();", "String getDisplayName();", "String getDisplayName();", "String getDisplayName();", "String getDisplayName();", "String getDisplayName();", "String getDisplayName();", "String getName() ;", "public String toString() {return name;}", "String dis...
[ "0.7705845", "0.7657129", "0.7390206", "0.7390206", "0.7390206", "0.7390206", "0.7390206", "0.7390206", "0.73523337", "0.7351575", "0.73483753", "0.73483753", "0.7322878", "0.7308588", "0.7308588", "0.7308588", "0.7308588", "0.7308588", "0.7308588", "0.72923017", "0.7225764",...
0.72701186
23
/ user ID may be autogenerated or some other unique key
public String getUserID();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String getUserID() {\n return user_id;\n }", "long getUserId();", "long getUserId();", "java.lang.String getUserID();", "java.lang.String getUserID();", "java.lang.String getUserID();", "Long getUserId();", "protected long getUserID() {\n return userID;\n }",...
[ "0.7366919", "0.7154586", "0.7154586", "0.712868", "0.712868", "0.712868", "0.7042434", "0.7021363", "0.7011084", "0.70104825", "0.70104825", "0.70104825", "0.70104825", "0.70104825", "0.70104825", "0.70104825", "0.70104825", "0.70104825", "0.70104825", "0.70104825", "0.70104...
0.7125488
6
TODO Autogenerated method stub
@Override protected boolean isValueIsValid(String value) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override protected boolean updateCriteriaSet(String value) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override protected ProductCriteriaSets getCriteriaSet(String values, ProductDetail existingProduct, ProductCriteriaSets matchedCriteriaSet, int currentSetValueId) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
The Adapter is the central manager in the framework. It has knowledge of both IReceivers as well as the PipeLine and statistics. The Adapter is the class that is responsible for configuring, initializing and accessing/activating IReceivers, Pipelines, statistics etc.
public interface IAdapter extends IManagable { /** * Instruct the adapter to configure itself. The adapter will call the * pipeline to configure itself, the pipeline will call the individual * pipes to configure themselves. * @see nl.nn.adapterframework.pipes.AbstractPipe#configure() * @see PipeLine#configure() */ public void configure() throws ConfigurationException; /** * The messagekeeper is used to keep the last x messages, relevant to * display in the web-functions. */ public MessageKeeper getMessageKeeper(); public IReceiver getReceiverByName(String receiverName); public Iterator getReceiverIterator(); public PipeLineResult processMessage(String messageId, String message, IPipeLineSession pipeLineSession); public PipeLineResult processMessageWithExceptions(String messageId, String message, IPipeLineSession pipeLineSession) throws ListenerException; public void registerPipeLine (PipeLine pipeline) throws ConfigurationException; public void setName(String name); public boolean isAutoStart(); public String toString(); public String formatErrorMessage(String errorMessage, Throwable t, String originalMessage, String messageID, INamedObject objectInError, long receivedTime); public void forEachStatisticsKeeperBody(StatisticsKeeperIterationHandler hski, Object data, int action) throws SenderException ; /** * state to put in PipeLineResult when a PipeRunException occurs. */ public String getErrorState(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public NetworkMonitorAdapter( Adapter adapter )\r\n {\r\n super( adapter );\r\n }", "public interface AdapterInterface {\n}", "@Override\n public void getAdapters() {\n // standard Cricket adapters\n logAdapter = (LoggerAdapterIface) getRegistered(\"Logger\");\n echoAdapter...
[ "0.69092524", "0.6554723", "0.5979439", "0.5945353", "0.593535", "0.59060276", "0.5895108", "0.58854455", "0.58165073", "0.5814965", "0.5804324", "0.5802508", "0.57488614", "0.5734375", "0.5721545", "0.56754285", "0.56380796", "0.5637041", "0.56364465", "0.5624382", "0.560654...
0.76848495
0
Instruct the adapter to configure itself. The adapter will call the pipeline to configure itself, the pipeline will call the individual pipes to configure themselves.
public void configure() throws ConfigurationException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPipelineConfiguration(PipelineConfiguration pipe) {\r\n super.setPipelineConfiguration(pipe);\r\n bufferedAttributes = new AttributeCollection(pipe.getConfiguration());\r\n }", "public abstract IOpipeConfiguration config();", "@Override\n\t\t\tprotected void configure() {\n\t\t\...
[ "0.63833964", "0.6253544", "0.5999952", "0.5925481", "0.59215313", "0.58939344", "0.57768345", "0.57724315", "0.56794465", "0.5674608", "0.56612974", "0.5625391", "0.5532799", "0.54901123", "0.5478373", "0.54751897", "0.5424742", "0.5395256", "0.53872824", "0.5352655", "0.535...
0.50507
31
The messagekeeper is used to keep the last x messages, relevant to display in the webfunctions.
public MessageKeeper getMessageKeeper();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendPreviousMessagesToClient() throws IOException {\n String previousMessages = messagesManager.toString(); // Gets the contents of the queue containing the last 15 messages\n outputFromServer.println(previousMessages); // Sends a message to client\n }", "private void viewMessage()\...
[ "0.65880984", "0.617201", "0.61423296", "0.60404146", "0.59649634", "0.57678473", "0.5764888", "0.5725078", "0.56924284", "0.5683256", "0.56735945", "0.5666019", "0.5645528", "0.5642446", "0.5634659", "0.5630443", "0.56282294", "0.5627082", "0.5612544", "0.5600778", "0.559113...
0.70025235
0
state to put in PipeLineResult when a PipeRunException occurs.
public String getErrorState();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic String pipeWithException(String... args) {\r\n\t\treturn pipeCaller(args);\r\n\t}", "@Override\n public int getPipeType() { \n return 3;\n }", "public interface PoolPipe { \n\n /**\n * Put a runnable in the queue for execution. The semantics\n * of the queue is dep...
[ "0.5974799", "0.5386003", "0.53133285", "0.525563", "0.5226148", "0.5198884", "0.5154507", "0.5153245", "0.51258004", "0.51189464", "0.50926286", "0.49992132", "0.4931928", "0.49316654", "0.4922574", "0.49185637", "0.49184573", "0.48938897", "0.48932302", "0.48620734", "0.481...
0.0
-1
return openConn("MySQL", "192.168.0.189", "3306", "BDIA?useUnicode=true&characterEncoding=gbk", "root", "123456");
public static Connection getMySQLConnection() { return openConn("MySQL", "192.168.0.189", "3306", "BDIA?useUnicode=true&characterEncoding=utf-8", "root", "123456"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Connection\");\n //characterEncoding=latin1&\n //Class.forName(\"org.apache.derby.jdbc.EmbeddedDriver\");\n //Connection conn = new Connection();\n url += \"?characterEncoding=latin1&useCo...
[ "0.7208701", "0.6892503", "0.6816078", "0.6718644", "0.66929525", "0.6659893", "0.66250557", "0.6618051", "0.65995353", "0.65995353", "0.65995353", "0.65995353", "0.65518695", "0.65415573", "0.65367734", "0.65207887", "0.6518735", "0.65180314", "0.65118057", "0.64615804", "0....
0.78670794
0
Creates a new CryptFile object.
public CryptFile(File file, CryptFile parentFile) { this.file = file; this.parentFile = parentFile; users = new Properties(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static PicoFile create(String filename, byte[] key) throws IOException {\n if (filename == null) {\n throw new NullPointerException(\"The filename is null.\");\n }\n if (key == null) {\n throw new NullPointerException(\"The key is null.\");\n }\n if (...
[ "0.6039879", "0.57998514", "0.57131565", "0.5583892", "0.5511923", "0.5312367", "0.530882", "0.5307578", "0.52918994", "0.52806455", "0.52599007", "0.52113724", "0.52090627", "0.5187801", "0.5158652", "0.5150973", "0.51482403", "0.5102252", "0.5088004", "0.5086804", "0.508315...
0.67706454
0
Gets the worldspace direction for the specified side relative to the specified entity.
public static Direction toGlobal(final Entity entity, @Nullable final RobotOperationSide side) { Direction direction = side == null ? RobotOperationSide.FRONT.direction : side.direction; if (direction.getAxis().isHorizontal()) { final int horizontalIndex = entity.getDirection().get2DDataValue(); for (int i = 0; i < horizontalIndex; i++) { direction = direction.getClockWise(); } } return direction; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Vector getDirection(){\n\t\treturn new Vector(_direction);\n\t}", "public Direction right() {\r\n\t\tif (this.direction == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tswitch (this.direction) {\r\n\t\tcase NORTH:\r\n\t\t\tthis.direction = Direction.EAST;\r\n\t\t\tbreak;\r\n\t\tcase WEST:\r\n\t\t\tthi...
[ "0.5993839", "0.59481895", "0.5938546", "0.5789631", "0.573445", "0.57256037", "0.57029736", "0.56948566", "0.5675382", "0.56609154", "0.56599605", "0.5624653", "0.5615822", "0.56102556", "0.55922794", "0.55821383", "0.5529905", "0.552799", "0.55245477", "0.5519573", "0.55174...
0.7331426
0
/ JADX WARNING: Code restructure failed: missing block: B:10:0x002e, code lost: if (kotlin.jvm.internal.C8271i.m35384a((java.lang.Object) r2.avatar, (java.lang.Object) r3.avatar) != false) goto L_0x0033;
public boolean equals(java.lang.Object r3) { /* r2 = this; if (r2 == r3) goto L_0x0033 boolean r0 = r3 instanceof com.jiayouya.travel.module.common.data.AliUserRsp if (r0 == 0) goto L_0x0031 com.jiayouya.travel.module.common.data.AliUserRsp r3 = (com.jiayouya.travel.module.common.data.AliUserRsp) r3 java.lang.String r0 = r2.uid java.lang.String r1 = r3.uid boolean r0 = kotlin.jvm.internal.C8271i.m35384a(r0, r1) if (r0 == 0) goto L_0x0031 java.lang.String r0 = r2.nickname java.lang.String r1 = r3.nickname boolean r0 = kotlin.jvm.internal.C8271i.m35384a(r0, r1) if (r0 == 0) goto L_0x0031 java.lang.String r0 = r2.city java.lang.String r1 = r3.city boolean r0 = kotlin.jvm.internal.C8271i.m35384a(r0, r1) if (r0 == 0) goto L_0x0031 java.lang.String r0 = r2.avatar java.lang.String r3 = r3.avatar boolean r3 = kotlin.jvm.internal.C8271i.m35384a(r0, r3) if (r3 == 0) goto L_0x0031 goto L_0x0033 L_0x0031: r3 = 0 return r3 L_0x0033: r3 = 1 return r3 */ throw new UnsupportedOperationException("Method not decompiled: com.jiayouya.travel.module.common.data.AliUserRsp.equals(java.lang.Object):boolean"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final synchronized void mo5320b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r1 = 0;\t Catch:{ all -> 0x004c }\n r2 = 0;\t Catch:...
[ "0.6473304", "0.6448246", "0.6401136", "0.6360934", "0.63470304", "0.62605035", "0.61686045", "0.61288047", "0.60985935", "0.60753447", "0.60634154", "0.60565186", "0.60486025", "0.6020886", "0.59959006", "0.5942019", "0.59311485", "0.5922769", "0.5913288", "0.5907221", "0.58...
0.0
-1
Execute Step: Do nothing
@Override public void execute(RuntimeStep exe, RuntimePlan plan) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void execute() {\n \t// literally still do nothing\n }", "protected void runBeforeStep() {}", "protected void runAfterStep() {}", "@Override\n public boolean step() {\n return false;\n }", "@Override\r\n\tprotected void doExecute(StepExecution stepExecution) throws Exception {\...
[ "0.67741406", "0.6613015", "0.66005427", "0.64736044", "0.6420864", "0.63921064", "0.63873464", "0.6307337", "0.6295142", "0.6243571", "0.6243571", "0.62058544", "0.61770636", "0.6152938", "0.6152938", "0.61463094", "0.61138594", "0.61073655", "0.6041435", "0.6041435", "0.597...
0.56406075
37
Abort Step: Do nothing
@Override public void abort(RuntimeStep exe) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void abort() { \n abortFlag = true ;\n }", "@Override\n\tpublic void abortWorkItem(WorkItem arg0, WorkItemManager arg1) {\n\t}", "public void abort() {\n isAborted = true;\n cancelCommands();\n cancel(true);\n }", "public void halt();", "p...
[ "0.746227", "0.72248214", "0.7033402", "0.69554317", "0.695081", "0.68294674", "0.68218297", "0.6817698", "0.6769618", "0.675364", "0.675364", "0.675364", "0.675364", "0.67507887", "0.6726022", "0.6588114", "0.65870726", "0.6572392", "0.65625775", "0.65291244", "0.6518296", ...
0.8011418
0
save an user to the database
public User saveUser(User user) { return userRepository.save(user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void saveUser(User user);", "void save(User user);", "public boolean save(User user);", "public int saveUser(User user);", "@Override\r\n\tpublic int saveUser(User user) {\n\t\tString sql = \"insert into user values(?,?,?,?)\";\r\n\t\treturn this.update(sql,user.getId(), user.getUsername(),user.getP...
[ "0.8371134", "0.82545733", "0.8137273", "0.8122306", "0.80577874", "0.8013841", "0.7973027", "0.790793", "0.7856885", "0.7834047", "0.7791332", "0.7790805", "0.7775419", "0.7688465", "0.76876205", "0.7663023", "0.7650871", "0.761281", "0.75703204", "0.7563522", "0.75369066", ...
0.71991885
42
find all users in the database
public List<User> findAll() { return userRepository.findAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic List<User> queryAllUsers() {\n\t\tList<User> users = userMapper.queryAllUsers();\r\n\t\treturn users;\r\n\t}", "public Users findAll() {\n\tthis.createConnection();\n try {\n Connection con = this.getCon();\n PreparedStatement stmnt = con.prepareStatement(this.getAllQuery());\n...
[ "0.8064507", "0.8062169", "0.8001574", "0.79771394", "0.79435796", "0.7919645", "0.791317", "0.78462905", "0.78246725", "0.7790758", "0.77763385", "0.7751547", "0.77280825", "0.77122694", "0.7699921", "0.7690665", "0.7680586", "0.7663504", "0.7655758", "0.7651756", "0.7649631...
0.753845
45
find an user by his email
public User findByEmail(String email){ return userRepository.findByEmail(email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "User getUserByEmail(final String email);", "User getUserByEmail(String email);", "public User findUserByEmail(final String email);", "User find(String email);", "User findUserByEmail(String email) throws Exception;", "public User getUserByEmail(String email);", "public User getUserByEmail(String email)...
[ "0.842916", "0.8396041", "0.8388113", "0.8383915", "0.834853", "0.82367176", "0.82367176", "0.80517405", "0.80070454", "0.80070454", "0.80070454", "0.80070454", "0.80070454", "0.80070454", "0.800134", "0.79906845", "0.79682297", "0.7953833", "0.7953833", "0.7953833", "0.79516...
0.7745731
35
find an user by his user Id
public User findById(Long id){ return userRepository.findOne(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "User findUser(String userId);", "User find(long id);", "public User findUserById(int id);", "User findUserById(Long id) throws Exception;", "User getUserById(Long id);", "User getUserById(Long id);", "User getUserById(int id);", "User getUser(Long id);", "User findUserById(int id);", "public User...
[ "0.82270294", "0.80368525", "0.80271417", "0.8020392", "0.80134", "0.80134", "0.79820925", "0.7973666", "0.79319274", "0.7885722", "0.7833208", "0.78098947", "0.7770052", "0.776096", "0.7732062", "0.77310264", "0.7646249", "0.7623208", "0.76079583", "0.7597742", "0.7560258", ...
0.7746565
14
check if the user with queried email has existed already
public boolean isExistingUser(String email){ Long count = userRepository.countByEmail(email); return count > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean userExists(String email) {\n\t\treturn (searchIndex(email) >= 0);\n\t}", "@Override\n public boolean isUserAlreadyExist(String email) throws UserException {\n User user;\n\n if (email == null || email.equals(\"\")) {\n logger.error(\"invalid user id: \" + e...
[ "0.8043553", "0.8036127", "0.7958721", "0.79460955", "0.77453077", "0.7731493", "0.75660455", "0.7540515", "0.75344217", "0.75290537", "0.7527902", "0.7474591", "0.74673927", "0.7451186", "0.74380493", "0.74205756", "0.74151874", "0.74150467", "0.7400582", "0.73812187", "0.73...
0.7905696
4
delete an user from database
public void delete(User user){ userRepository.delete(user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteUserById(Long id);", "public void deleteUser(User userToDelete) throws Exception;", "void deleteUserById(Integer id);", "public void deleteUser(String name);", "void deleteUser(int id);", "public void deleteUser(User user) {\n update(\"DELETE FROM user WHERE id = ?\",\n n...
[ "0.8340065", "0.83326626", "0.83053344", "0.82760215", "0.8205663", "0.8192728", "0.81905395", "0.8156736", "0.8154711", "0.8136525", "0.81118995", "0.81029135", "0.8101628", "0.80966824", "0.8094775", "0.80897826", "0.8077173", "0.8077173", "0.8051861", "0.80474925", "0.8024...
0.8092446
15
Test cli = new Test(); cli.callService(); System.out.println(257&0x00000100);
public static void main(String[] args) throws Exception{ Date currentTime = new Date(95,7,6); SimpleDateFormat formatter = new SimpleDateFormat("dd/MMM/YYYY"); String dateString = formatter.format(currentTime); System.out.println(dateString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int method_2686(int var0) {\r\n return var0 & 7;\r\n }", "@Test(timeout = 4000)\n public void test075() throws Throwable {\n int int0 = JavaCharStream.hexval('b');\n assertEquals(11, int0);\n }", "public static void test() {\n\t\tbyte[] get = makeACommandByte(1,(byte) 0x01, (...
[ "0.55119145", "0.5383482", "0.5348717", "0.5329167", "0.5228785", "0.52198", "0.5196467", "0.5163856", "0.512699", "0.51171464", "0.50930166", "0.5085551", "0.50767475", "0.5046274", "0.50055766", "0.50012326", "0.4995292", "0.4975378", "0.49587783", "0.49375597", "0.49214044...
0.0
-1
here it's similar to RequestListener, but with less information (e.g. no model available)
@Override public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) { super.onResourceReady(resource, animation); // here you can be sure it's already set detectLight(BitmapHelper.readBitmapFromImageView(panoramaImageView), 45); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}", "public interface RequestListener {\n\n /**\n * Called when a request completes with the given response. Executed by a\n * background thread: do not update the UI in this method.\n */\n public void onComplete(Bundle data);\n\n ...
[ "0.6917111", "0.68642", "0.6704476", "0.6568008", "0.6476404", "0.646121", "0.64275384", "0.64176613", "0.6266916", "0.6242223", "0.61933017", "0.6144009", "0.60576206", "0.6046902", "0.6029277", "0.6012329", "0.59611994", "0.5940523", "0.59398454", "0.5924348", "0.59199655",...
0.0
-1
Constructs a new action for the given repository view.
public OpenAction(BasicRepositoryView view) { super(view); this.setText("Open Artifact"); this.setToolTipText("Open Artifact"); this.setImageDescriptor(artifactImage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GrabActionController createGrabActionController(PersistentView view);", "private View create(PersistedView pView) {\n DsmSorting sorting = nameToSorting.get(pView.dsmSortingName);\n if (null == sorting) {\n sorting = DsmSorting.values()[0];\n }\n\n View view = new View();\n...
[ "0.60701716", "0.5637007", "0.5526387", "0.5526387", "0.5526387", "0.5412698", "0.5366801", "0.53431743", "0.5268383", "0.5158297", "0.5153141", "0.5142841", "0.51276976", "0.5111657", "0.5097397", "0.50870067", "0.50828236", "0.5050135", "0.5044929", "0.50070137", "0.5004414...
0.6531074
0
Storage methods Determines if a task is done or not from a line read in from the file.
public String determineTaskDoneStatusFromFileLine(String line) { int indexOfFirstSquareBracket = line.indexOf("["); String doneStatus = String.valueOf(line.charAt(indexOfFirstSquareBracket + 1)); assert (doneStatus.equals("V") || doneStatus.equals("X")) : "Done status can only be X or V"; return doneStatus; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean read(String line);", "boolean hasCompleteFile();", "boolean hasTask();", "protected boolean isFinished() {\r\n if (lineHasBeenFound) {\r\n lineTrackTime = System.currentTimeMillis();\r\n }\r\n if(System.currentTimeMillis()-lineTrackTime > 4000){\r\n ...
[ "0.6265767", "0.6218766", "0.6148132", "0.6115604", "0.6106502", "0.6052001", "0.60247713", "0.60247713", "0.5968446", "0.5896221", "0.5776483", "0.57720536", "0.5763516", "0.57165027", "0.5708336", "0.56469697", "0.56457", "0.5634439", "0.5634439", "0.5619801", "0.5604216", ...
0.68087626
0
Determines the type of Task, either a ToDo, Event, or DeadLine.
public String determineTaskTypeFromFileLine(String line) { int indexOfFirstSquareBracket = line.indexOf("["); String taskType = String.valueOf(line.charAt(indexOfFirstSquareBracket + 5)); return taskType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getType() {\n return \"Task\";\n }", "@Override\n public String getTaskType() {\n return this.taskType;\n }", "@Override\n public String getTaskType() {\n return \"T\";\n }", "public String getTaskType() {\n return taskType;\n }", "public String g...
[ "0.7383763", "0.70532477", "0.69824976", "0.6949126", "0.69377786", "0.69178194", "0.6910966", "0.6734206", "0.67199653", "0.66776943", "0.62481123", "0.61771506", "0.6045911", "0.6029678", "0.5919709", "0.5904985", "0.5884058", "0.5820582", "0.5808819", "0.5794204", "0.57709...
0.5271625
53
Determines the Task Details like date limits or time of happening.
public String determineTaskDetailsFromFileLine(String line) { int indexOfFirstSquareBracket = line.indexOf("["); String details = line.substring(indexOfFirstSquareBracket + 8); // from unnecessary info at the front of line. return details; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getTaskTimeRange() {\n return taskTimeRange;\n }", "@Override\n public String toString() {\n if (timeEnd == null) {\n stop();\n }\n return task + \" in \" + (timeEnd - timeStart) + \"ms\";\n }", "List<Task> getTaskdetails();", "public void viewTas...
[ "0.66196775", "0.64301443", "0.6416767", "0.63667876", "0.63178205", "0.6272974", "0.61885387", "0.61420214", "0.6130772", "0.6110617", "0.60577774", "0.6041577", "0.60200477", "0.5949283", "0.59478414", "0.58965653", "0.5857895", "0.58576345", "0.58432746", "0.58301073", "0....
0.0
-1
Checks if the String obtained from lastSavedTasks.txt represents a completed Task.
public boolean isDone(String s) { return (s.equals("V")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean done() {\n\t\tfor(Task t : details.getPendingTasks()){\n\t\t\tif(!t.isComplete())\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean is_completed();", "public boolean isCompleteSchedule() {\n if (this.getScheduledTask() != null) {\n return this....
[ "0.6408938", "0.64088184", "0.62692523", "0.62610936", "0.61985755", "0.61634934", "0.6109337", "0.60801977", "0.6074419", "0.6069411", "0.6040174", "0.6033828", "0.5965446", "0.59620965", "0.5951066", "0.59425694", "0.5932424", "0.5932424", "0.59085715", "0.5874597", "0.5873...
0.6331015
2
TaskList methods Gives String representing the command type.
public String findKeywordFromString(String command) { // Split String command to find the intention of the user (first word) String[] commandWords = command.split("\\s"); return commandWords[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getType() {\n return theTaskType ;\n }", "public String getType() {\n return \"Task\";\n }", "@Override\r\n\tpublic List<ExecuteTask> getByType(String taskType) {\n\t\tString sql = \"SELECT et_id id,et_member_id memberId,et_task_id taskId,et_comments comments FROM executetask ...
[ "0.71196127", "0.70734054", "0.7003877", "0.69029677", "0.68627787", "0.6841545", "0.68373907", "0.6650617", "0.66184527", "0.6345418", "0.6297707", "0.6278918", "0.6274096", "0.62312055", "0.6216222", "0.61822724", "0.61480373", "0.61277795", "0.61194384", "0.6041123", "0.60...
0.0
-1
Checks if this is capable of being a valid done command based on the criteria of length being more than 1.
public boolean satisfiesMinimumDoneCommandLength(String[] command) { return (command.length > 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean determineIfValidDoneCommand(String[] commandWords, int taskListSize) {\n int taskNumber = Integer.parseInt(commandWords[1]);\n return (taskNumber <= taskListSize);\n }", "private boolean isComplete() {\n return redisCommand != null && redisCommand.getAction() != null && !\"...
[ "0.68322885", "0.6542408", "0.59945947", "0.59693927", "0.5957672", "0.5819153", "0.58176786", "0.580031", "0.5760006", "0.5737941", "0.56672907", "0.5623074", "0.56123936", "0.5587107", "0.5565559", "0.55560136", "0.55540395", "0.5524831", "0.5490796", "0.548598", "0.5459315...
0.77659065
0
Checks if this is an actual done command.
public boolean determineIfValidDoneCommand(String[] commandWords, int taskListSize) { int taskNumber = Integer.parseInt(commandWords[1]); return (taskNumber <= taskListSize); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isDone(String command) {\r\n\t\tassert command != null;\r\n\t\tcommandType = Logic.determineCommandType(command);\r\n\t\tswitch (commandType) {\r\n\t\tcase DONE:\r\n\t\t\treturn true;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isDone()\n {\n ...
[ "0.7578319", "0.70671695", "0.70130044", "0.70130044", "0.6954545", "0.6933368", "0.6901516", "0.68708265", "0.6848425", "0.68443745", "0.6818054", "0.6818054", "0.6798842", "0.6795911", "0.6753369", "0.6746836", "0.6744269", "0.6683662", "0.6594399", "0.6594399", "0.6594399"...
0.0
-1
VertexServer constructor initializes the JobServer address and port.
public VertexServer(Properties props) { this.jobServerAddr = props.getProperty("jobserver.address"); this.jobServerPort = Integer.parseInt(props.getProperty("jobserver.port")); this.numThreads = Integer.parseInt(props.getProperty("threads")); this.execSrv = Executors.newFixedThreadPool(numThreads); try{ hdfs = new HdfsUtils(props.getProperty("namenode.address"), Integer.parseInt(props.getProperty("namenode.port"))); }catch(IOException e){ logger.log(Level.SEVERE, "Failed connecting to HDFS", e); throw new RuntimeException(e); } vManager = new VertexManager(numThreads); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }", "public EchoJob(){\n\t\tsuper.vertexStages = new ArrayList<VertexStage>();\n\t\t\n\t\t// note: input/output job directory HDFS pa...
[ "0.63472927", "0.6336557", "0.6202085", "0.6138721", "0.6069022", "0.60644644", "0.6010659", "0.5976945", "0.59768844", "0.59598565", "0.59130937", "0.5905501", "0.5894565", "0.5894565", "0.5887882", "0.5862267", "0.5855141", "0.5826486", "0.58261186", "0.5825844", "0.5815787...
0.78474414
0
Start method to start execution of the VertexServer.
public void start() { Timer t = new Timer("vertex periodic heartbeat"); TimerTask task = new TimerTask() { // Heartbeat timer. @Override public void run() { try { // Initialize our VertexHeartbeat VertexHeartbeat vhb = new VertexHeartbeat(); vhb.setUid(uid.toString()); vhb.setNumThreads(vManager.getAvailableThreads()); vhb.setVertexDescriptor(vManager.getCompVertex()); logger.info("sending heartbeat to " + VertexServer.this.jobServerAddr + " on port " + VertexServer.this.jobServerPort + " compVert:" + vhb.getVertexDescriptor().size()); VertexHeartbeatResponse vhbr = (VertexHeartbeatResponse)RequestResponseUtil. clientRequest(new VertexHeartbeatProtocol(vhb), jobServerAddr, jobServerPort); // Get our VertexContexts. List<VertexDescriptor> vertexDescriptor = vhbr.getVertexDescriptor(); if ( vertexDescriptor != null ) { for ( int i = 0; i < vertexDescriptor.size(); i++ ) { // We have a valid VertexContext, submit this to our executor service. vManager.decrementAvailableThreads(); execSrv.submit(new VertexThread(vManager, vertexDescriptor.get(i), hdfs)); } } } catch(Exception e) { throw new RuntimeException(e); } } }; // Schedule our next heartbeat message. t.scheduleAtFixedRate(task, Calendar.getInstance().getTime(), 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void start(){\n // Retrieve the configuration, and init the verticle.\n JsonObject config = config();\n init(config);\n // Every `period` ms, the given Handler is called.\n vertx.setPeriodic(period, l -> {\n mining();\n send();\n ...
[ "0.69873387", "0.6896987", "0.68103725", "0.6730814", "0.67044073", "0.664305", "0.6552733", "0.65398693", "0.6474858", "0.6452749", "0.6412407", "0.6376012", "0.6355282", "0.63172376", "0.6296889", "0.6291574", "0.6266059", "0.6249397", "0.6249397", "0.6224123", "0.6223301",...
0.68696517
2
This starts application. Input file is read and parsed. Then students eligible for scholarship are determined and saved to the output file. Also, min score for scholarship and student rating are print to System.out.
public static void main(String[] args) { try { List<Student> students = loadStudentList(new File(INPUT_FILE_NAME)); List<Student> studentsWithScholarship = selectTopNonContractStudents(students, SCHOLARSHIP_PERCENTAGE); double minScoreForScholarship = getMinScoreForScholarship(studentsWithScholarship); System.out.printf("Min score for scholarship: %f%n", minScoreForScholarship); System.out.printf("Students with scholarship (%d total):%n", studentsWithScholarship.size()); studentsWithScholarship.forEach(System.out::println); saveStudentsList(studentsWithScholarship, new File(OUTPUT_FILE_NAME)); } catch (IOException e) { System.err.println("Failed to read/write file"); e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n //\tThis code is given to you. There is NO NEED TO CHANGE IT\n AltFinal altFinal = new AltFinal(\"College.csv\");\n\n //\tThis is some sample code to show all students in the Students List and how to iterate through the list\n //\tmany of you...
[ "0.63413715", "0.6270564", "0.6188552", "0.61821073", "0.6150732", "0.613973", "0.61103356", "0.60469985", "0.6037532", "0.594287", "0.5936674", "0.59228367", "0.58466995", "0.5831503", "0.58115876", "0.5811013", "0.5808632", "0.5804203", "0.5790236", "0.57815874", "0.5775973...
0.7521482
0
Load student list from file.
private static List<Student> loadStudentList(File file) throws IOException { return loadStudentList(new FileInputStream(file)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static ArrayList<Student> loadListOfStudents(String fileName) {\n ArrayList<Student> students = new ArrayList<>();\r\n String str = TextReader.StringFromFile(fileName);//Uses the method that returns a complete string with newlines for each studentline.\r\n if (validateInput(str)) {//Use...
[ "0.7232717", "0.7219571", "0.71985143", "0.71688735", "0.7149905", "0.7073705", "0.6986897", "0.67931193", "0.6761055", "0.67464733", "0.6715512", "0.66587925", "0.66538984", "0.6633142", "0.6598312", "0.6548275", "0.65442824", "0.6464118", "0.64520407", "0.63618594", "0.6348...
0.8529146
0
Load student list from csv data input stream.
static List<Student> loadStudentList(InputStream in) { return new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8)) .lines() .skip(1) .map(Student::fromCsv) .collect(Collectors.toList()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadListFromCsv() {\n List<Publication> list = new ArrayList<>();\n String line;\n try(BufferedReader bufferedReader = new BufferedReader(new FileReader(\"saves/data.csv\"))){\n while ((line = bufferedReader.readLine()) != null){\n String[] attributes = li...
[ "0.7247635", "0.72460604", "0.66753143", "0.6651086", "0.6611883", "0.64808154", "0.6386331", "0.63328683", "0.63144577", "0.62617964", "0.6249435", "0.6244701", "0.62343454", "0.6227997", "0.6221771", "0.6219366", "0.6194645", "0.61308354", "0.6088568", "0.6087337", "0.60630...
0.7821375
0
Save student list to file (as csv).
private static void saveStudentsList(List<Student> students, File file) throws IOException { saveStudentsList(students, new FileOutputStream(file)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void writeToStudentsFile() throws IOException{\n\t\tFileWriter fw = new FileWriter(STUDENTS_FILE, false); //overwrites the students.txt file\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\n\t\tIterator<StudentDetails> iter = ALL_STUDENTS.listIterator(1); //Get all StudentDetails objects from...
[ "0.7156864", "0.7096417", "0.70749116", "0.69732803", "0.6900457", "0.6898588", "0.68957514", "0.68082833", "0.66950524", "0.66845846", "0.6681555", "0.6632648", "0.6601198", "0.6498064", "0.64667296", "0.6459523", "0.64544445", "0.64525884", "0.64321446", "0.6419272", "0.631...
0.7502504
0
Select top noncontract students from the list.
static List<Student> selectTopNonContractStudents(List<Student> students, double topPercentage) { if (topPercentage < 0 || topPercentage > 1) { throw new IllegalArgumentException( "Percentage of students to select should be in bounds of 0...1" ); } List<Student> rating = students.stream() .filter(s -> !s.isContract()) .sorted(Comparator.comparingDouble(s -> -s.getAverageScore())) .collect(Collectors.toList()); return rating.subList(0, (int) Math.floor(rating.size() * topPercentage)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Student findWithoutSectionsBy(int studentNumber);", "public ArrayList<Student> filterSearchStudentList(int stuNum){\n \n ArrayList<Student> filteredList = new ArrayList<Student>();\n \n int existance = 0;\n\n for(int i = 0; i<studList.size(); i++){\n \n if...
[ "0.6264537", "0.5732596", "0.5706817", "0.5367516", "0.53522676", "0.53206825", "0.52792704", "0.5259719", "0.5191936", "0.5190113", "0.51622665", "0.5054745", "0.5015574", "0.49605986", "0.49547023", "0.49522048", "0.49164492", "0.49106663", "0.49065527", "0.4902191", "0.489...
0.72806305
0
Returns min score for student to be eligible for scholarship.
static double getMinScoreForScholarship(List<Student> studentsWithScholarship) { return studentsWithScholarship.stream() .mapToDouble(Student::getAverageScore) .min() .orElseThrow(() -> new RuntimeException("No students eligible for scholarship")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getMinScore() {\r\n return minScore;\r\n\t}", "public Score lowestScore()\n {\n Score lowest = new Score();\n int smallSoFar = 201;\n if(scores[0] == null)\n {\n return null;\n }\n else\n {\n for(int i = 0; i < scores.length; i++)\n {...
[ "0.68675333", "0.67281973", "0.65287125", "0.6370942", "0.6342272", "0.63057977", "0.6198123", "0.61707264", "0.61186886", "0.60729", "0.6029748", "0.6006297", "0.5929599", "0.5897073", "0.58766115", "0.58592224", "0.58050793", "0.5783224", "0.5779675", "0.5758092", "0.575809...
0.8341573
0
Creates new form ChatFrame
public ChatFrame() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createGUI() {\r\n\t\t// Create the frame for client window.\r\n\t\tJFrame frame = new JFrame(\"Client\");\r\n\t\t/*\r\n\t\t * Set the layout as null as using setbounds to set complonents set size\r\n\t\t * and close the frame when clicked on exit\r\n\t\t */\r\n\t\tframe.setLayout(null);\r\n\t\t// exit...
[ "0.6714546", "0.66212344", "0.65663457", "0.656171", "0.6505759", "0.64770114", "0.6420834", "0.64027596", "0.63900775", "0.63824886", "0.6332738", "0.6325345", "0.630826", "0.62653613", "0.6236725", "0.6231431", "0.6230276", "0.62241846", "0.6221226", "0.6217778", "0.6204892...
0.77232003
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); chatList = new javax.swing.JList<>(); chatText = new javax.swing.JTextField(); sendButton = new javax.swing.JButton(); clearButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("ChatFrame"); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); chatList.setModel(new DefaultListModel()); chatList.setCellRenderer(new ChatMessageRenderer()); jScrollPane1.setViewportView(chatList); sendButton.setText("send"); clearButton.setText("clear"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(chatText, javax.swing.GroupLayout.PREFERRED_SIZE, 618, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(sendButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(clearButton) .addContainerGap(41, Short.MAX_VALUE)) .addComponent(jScrollPane1) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(chatText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(sendButton) .addComponent(clearButton))) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.73197734", "0.72908777", "0.72908777", "0.72908777", "0.72870827", "0.7248368", "0.7213462", "0.7208004", "0.7195763", "0.7189973", "0.7184436", "0.7159332", "0.71478266", "0.709268", "0.7080727", "0.7057287", "0.6986775", "0.6977119", "0.69554067", "0.69548035", "0.694574...
0.0
-1
End of variables declaration//GENEND:variables
public void addMessage(TextMessagePacket messagePacket) { DefaultListModel m = (DefaultListModel) this.chatList.getModel(); m.addElement(messagePacket); this.scrollDown(); this.revalidate(); this.repaint(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void lavar() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "private void assignment() {\n\n\t\t\t}", "private void kk12() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n pu...
[ "0.6359434", "0.6280371", "0.61868024", "0.6094568", "0.60925734", "0.6071678", "0.6052686", "0.60522056", "0.6003249", "0.59887564", "0.59705925", "0.59680873", "0.5967989", "0.5965816", "0.5962006", "0.5942372", "0.5909877", "0.5896588", "0.5891321", "0.5882983", "0.5881482...
0.0
-1
Created by interface on 2017/2/16.
@Repository public interface ProductDAO extends BaseDAO<Product> { public List<Product> queryByPagerAndCriteria(@Param("pager")Pager4EasyUI<Product> pager, @Param("product")Product t); public int countByCriteria(Product t); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r...
[ "0.623372", "0.6096103", "0.6077073", "0.6053847", "0.59988683", "0.59988683", "0.5945949", "0.5857009", "0.5853034", "0.5837431", "0.5813736", "0.58012795", "0.57978094", "0.5796985", "0.5779782", "0.576935", "0.576935", "0.576935", "0.576935", "0.576935", "0.576935", "0.5...
0.0
-1
This service handles logic behind Notes
public interface NoteService { /** * Retrieves all notes from the database and converts it to a model that's exposed through the API * * @return the collection of notes {@link List<NoteView>} * @throws ApiErrorException if there is an issue */ List<NoteView> getAllNotes(); /** * Retrieves a single note {@link NoteView} from the database by the given id and converts it to a model * that's exposed through the API * * @param id the Id of the note we want to retrieve * @throws ApiErrorException if there is an issue */ NoteView getNoteById(long id); /** * Creates a new note from the noteForm {@link NoteForm} object * @throws ApiErrorException if there is an issue */ void createNote(NoteForm noteForm); /** * Updates an existing note from the noteForm {@link NoteForm} object * @throws ApiErrorException if there is an issue */ void updateNote(NoteForm noteForm); /** * Deletes single note with given id * * @param id the Id of the note we want to delete * @throws ApiErrorException if there is an issue */ void deleteNoteByNoteId(long id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface NoteService {\n //添加公告\n void addNote(Note note);\n\n //根据id删除公告\n void removeNote(Integer id);\n\n //修改公告\n void modifyNote(Note note);\n\n //根据id查询公告\n Note findNoteById(Integer id);\n\n //获得所有公告\n List<Note> findNote(Note note);\n}", "public interface NoteService...
[ "0.7215182", "0.7165251", "0.684767", "0.6644862", "0.66262394", "0.66232985", "0.6553641", "0.6535063", "0.64491636", "0.6410771", "0.63728493", "0.635993", "0.6336529", "0.63316673", "0.63049936", "0.62647426", "0.62647426", "0.62352186", "0.6182425", "0.6133371", "0.61298"...
0.69454116
2
Initializes configurations from default configurations file
public static void Init() throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document dom = db.parse("bin\\configurations\\Configurations.xml"); Root = new Configurations(dom.getFirstChild()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initialize() {\n if (!BungeeBan.getInstance().getDataFolder().exists()) {\n BungeeBan.getInstance().getDataFolder().mkdirs();\n }\n File file = this.getConfigurationFile();\n if (!file.exists()) {\n try {\n file.createNewFile();\n ...
[ "0.7057059", "0.70035636", "0.69701624", "0.68637156", "0.6844059", "0.6831242", "0.67811304", "0.67533034", "0.67150426", "0.6643743", "0.6608892", "0.6608636", "0.65983564", "0.65874153", "0.6582454", "0.65792215", "0.6560508", "0.6559659", "0.65071297", "0.6499553", "0.643...
0.0
-1
Get generic element for given configName Configurations, String, or Float
public <T> T Get(String configName) { // divide path if(configName.contains(".")) { String firstName = configName.substring(0, configName.indexOf(".")); String lastName = configName.substring(configName.indexOf(".") + 1); Configurations firstConfigurations = this.<Configurations>Get(firstName); if(firstConfigurations == null) { return null; } return firstConfigurations.<T>Get(lastName); } // return first castable object if(configurationMap.get(configName.toLowerCase()) != null) { for(Object obj : configurationMap.get(configName.toLowerCase())) { try { return (T) obj; } catch(Exception e) {} } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <T> T getElement(String name) {\n return elements.get(name);\n }", "Element getGenericElement();", "public abstract String getConfigElementName();", "public String getConfigurationValue(String name);", "Configuration getConfigByKey(String configKey);", "IElementDef parse(ConfigSource configSou...
[ "0.6157134", "0.6039885", "0.58539546", "0.5751693", "0.5593752", "0.5561005", "0.55150867", "0.5452988", "0.5410651", "0.5295434", "0.5240112", "0.5208432", "0.518534", "0.51784766", "0.51221174", "0.512003", "0.51118135", "0.5109878", "0.5108155", "0.50685537", "0.5038267",...
0.64334565
0
Get a list of generic elements for given configName Configurations, String, or Float
public <T> ArrayList<T> GetAll(String configName) { ArrayList<T> ret = new ArrayList<T>(); // divide path if(configName.contains(".")) { String firstName = configName.substring(0, configName.indexOf(".")); String lastName = configName.substring(configName.indexOf(".") + 1); ArrayList<Configurations> allFirstConfigurations = this.<Configurations>GetAll(firstName); if(allFirstConfigurations == null) { return null; } for(Configurations firstConfigurations : allFirstConfigurations) { ret.addAll(firstConfigurations.<T>GetAll(lastName)); } return ret; } // return all castable objects if(configurationMap.get(configName.toLowerCase()) != null) { for(Object obj : configurationMap.get(configName.toLowerCase())) { try { ret.add((T) obj); } catch(Exception e) {} } } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static List<IConfigElement> getConfigElements()\n {\n\n List<IConfigElement> configElements = new ArrayList<IConfigElement>();\n\n if (ConfigReference.getInstance().isLoaded())\n {\n\n IConfigElement generalConfigs = new ConfigElement(ConfigReference.getInstance().getCategory(Configuration.C...
[ "0.625231", "0.61384344", "0.5614437", "0.55502677", "0.55239886", "0.54327106", "0.5398889", "0.53955775", "0.5114174", "0.508927", "0.50598687", "0.5054969", "0.5033326", "0.5031744", "0.4988656", "0.4957663", "0.4947994", "0.49461055", "0.49354243", "0.4906633", "0.4902705...
0.67671263
0
The ID of the spreadsheet to retrieve data from.
public static void main(String args[]) throws IOException, GeneralSecurityException { String spreadsheetId = "1er12_Tp-m1IJNRfz-72VwVY14Gj10b-IexY60fzZiGg"; // TODO: Update placeholder value. // The A1 notation of the values to retrieve. String range = "a1:b4"; // TODO: Update placeholder value. // How values should be represented in the output. // The default render option is ValueRenderOption.FORMATTED_VALUE. String valueRenderOption = ""; // TODO: Update placeholder value. // How dates, times, and durations should be represented in the output. // This is ignored if value_render_option is // FORMATTED_VALUE. // The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. String dateTimeRenderOption = ""; // TODO: Update placeholder value. /* Sheets sheetsService = createSheetsService(); Sheets.Spreadsheets.Values.Get request = sheetsService.spreadsheets().values().get(spreadsheetId, range); request.setValueRenderOption(valueRenderOption); request.setDateTimeRenderOption(dateTimeRenderOption); ValueRange response = request.execute(); // TODO: Change code below to process the `response` object: System.out.println(response); } /* public static Sheets createSheetsService() throws IOException, GeneralSecurityException { HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); // TODO: Change placeholder below to generate authentication credentials. See // https://developers.google.com/sheets/quickstart/java#step_3_set_up_the_sample // // Authorize using one of the following scopes: // "https://www.googleapis.com/auth/drive" // "https://www.googleapis.com/auth/drive.file" // "https://www.googleapis.com/auth/drive.readonly" // "https://www.googleapis.com/auth/spreadsheets" // "https://www.googleapis.com/auth/spreadsheets.readonly" /* static Urlshortener newUrlshortener() { AppIdentityCredential credential = new AppIdentityCredential(Arrays.asList(UrlshortenerScopes.URLSHORTENER)); return new Urlshortener.Builder(new UrlFetchTransport(), JacksonFactory.getDefaultInstance(), credential) .build(); return new Sheets.Builder(httpTransport, jsonFactory, credential) .setApplicationName("Google-SheetsSample/0.1") .build();*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long getSheetId() {\r\n return sheetId;\r\n }", "public StrColumn getSheetId() {\n return delegate.getColumn(\"sheet_id\", DelegatingStrColumn::new);\n }", "public String getWorkbookId() {\n return this.workbookId;\n }", "public void setSheetId(long value) {\r\n th...
[ "0.783562", "0.7429824", "0.6793672", "0.67700356", "0.6485121", "0.62853557", "0.61633486", "0.6116779", "0.6059787", "0.59288454", "0.5836401", "0.57963854", "0.5793852", "0.5767531", "0.5767531", "0.5759368", "0.5745798", "0.5740203", "0.5740203", "0.5740203", "0.5740203",...
0.0
-1
Called after an edge is added to the DAG.
public boolean addEdge(Edge edge) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addEdge(JNode edge) {\n List<JNode> newEdges = this.getEdges();\n newEdges.add(edge);\n this.setEdges(newEdges);\n }", "protected void addEdge(CyEdge edge) {\n\tLayoutEdge newEdge = new LayoutEdge(edge);\n\tupdateWeights(newEdge);\n\tedgeList.add(newEdge);\n }", ...
[ "0.69456834", "0.685111", "0.67814755", "0.67713034", "0.67600846", "0.6655925", "0.6632346", "0.66241556", "0.66232073", "0.6604492", "0.65794486", "0.6518183", "0.6491171", "0.64885056", "0.6453364", "0.6435259", "0.6415736", "0.6403648", "0.63744575", "0.6370784", "0.63420...
0.63123703
23
Called after a node is added to the DAG.
public boolean addNode(DAGNode node) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void nodeAdded(GraphEvent e);", "@Override\n\tpublic void postProcess(NodeCT node) {\n\t}", "@Override\n public void visit(Node node) {\n nodes.add(node);\n }", "public void addNode(NodeImpl node) {\n supervisedNodes.add(node);\n \n colorNodes();\n shor...
[ "0.680011", "0.6744793", "0.6548229", "0.6498146", "0.63134897", "0.6235182", "0.62167084", "0.62094057", "0.6204657", "0.6150065", "0.6127071", "0.61233896", "0.611074", "0.610892", "0.60903627", "0.6043352", "0.6037898", "0.6032591", "0.60145473", "0.5998638", "0.59954053",...
0.6342002
4
A method that is called once initialisation of a DAG is complete. Note that this method may not be called, and no functionality is required.
public void initialisationComplete(Collection<DAGNode> nodes, Collection<DAGEdge> edges) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void DAGfinished() {\n\t\t\r\n\t}", "public void performInitialisation() {\n \t\t// subclasses can override the behaviour for this method\n \t}", "@Override\n public void init() {\n this.log.pri1(LoggingInterface.INIT_START, \"\");\n // Any task initialization code goes h...
[ "0.7352745", "0.60236967", "0.5965964", "0.59451354", "0.5908111", "0.58830494", "0.5864451", "0.5842484", "0.5808993", "0.5808887", "0.5760516", "0.5755972", "0.5743766", "0.5730262", "0.57237536", "0.5679281", "0.5679281", "0.5679281", "0.5661698", "0.56575847", "0.5632206"...
0.67717105
1