blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
12c8aeba8ab94d0ddf56b3c211ad47e1dd017392
1f98f978e78ea6e0835a57ce5371c034fbd2948f
/src/test/java/miggy/cpu/instructions/SWAPTest.java
46839365168883a9efcb3a4766de1b5283733a40
[ "BSD-3-Clause" ]
permissive
fedex81/m68k
125fa8cedb3e3658c357da7c92dc87a7dfe84f03
58a8e2de552050281e8ad5113ac2302e45b2fd2d
refs/heads/master
2023-08-25T00:04:40.330579
2023-08-03T12:58:23
2023-08-03T12:58:23
157,892,407
1
1
BSD-3-Clause
2023-08-02T03:39:54
2018-11-16T16:19:23
Java
UTF-8
Java
false
false
1,572
java
package miggy.cpu.instructions; import miggy.BasicSetup; import miggy.SystemModel; import miggy.SystemModel.CpuFlag; import org.junit.jupiter.api.Test; import static m68k.util.TestCpuUtil.*; // $Revision: 21 $ public class SWAPTest extends BasicSetup { @Test public void testSwapPos() { setInstructionAtPC(0x4840); //swap d0 SystemModel.CPU.setDataRegister(0, 0x87654321); SystemModel.CPU.setCCR((byte) 0); int time = SystemModel.CPU.execute(); assertEquals("Check result", 0x43218765, SystemModel.CPU.getDataRegister(0)); assertFalse("Check X", SystemModel.CPU.isSet(CpuFlag.X)); assertFalse("Check N", SystemModel.CPU.isSet(CpuFlag.N)); assertFalse("Check Z", SystemModel.CPU.isSet(CpuFlag.Z)); assertFalse("Check V", SystemModel.CPU.isSet(CpuFlag.V)); assertFalse("Check C", SystemModel.CPU.isSet(CpuFlag.C)); } @Test public void testSwapNeg() { setInstructionAtPC(0x4840); //swap d0 SystemModel.CPU.setDataRegister(0, 0x43218765); SystemModel.CPU.setCCR((byte) 0); int time = SystemModel.CPU.execute(); assertEquals("Check result", 0x87654321, SystemModel.CPU.getDataRegister(0)); assertFalse("Check X", SystemModel.CPU.isSet(CpuFlag.X)); assertTrue("Check N", SystemModel.CPU.isSet(CpuFlag.N)); assertFalse("Check Z", SystemModel.CPU.isSet(CpuFlag.Z)); assertFalse("Check V", SystemModel.CPU.isSet(CpuFlag.V)); assertFalse("Check C", SystemModel.CPU.isSet(CpuFlag.C)); } }
[ "berti@leet.it" ]
berti@leet.it
54f5b1d728615ada66f5373889baa4a91e61b8ea
54a5587fcbf15912f698aba38c73073010afbe15
/Booking System/src/AppPackage/CheckInClerkGUI.java
c93f7d3717a8d1c8650d88e5e294926168df6f88
[]
no_license
alexandra15/260CT
21521f8e90f50f4401e992e79f41d5fd13fc6198
9512069129d72e282b24f4c07e9106031cece464
refs/heads/master
2021-01-10T14:29:02.750741
2016-03-25T18:34:14
2016-03-25T18:34:14
52,788,293
0
0
null
null
null
null
UTF-8
Java
false
false
8,165
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package AppPackage; import javax.swing.JOptionPane; /** * * @author A */ public class CheckInClerkGUI extends javax.swing.JFrame { /** * Creates new form VerifyBookingGUI */ public CheckInClerkGUI() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); BookingIDTextfield = new javax.swing.JTextField(); VerifyButton = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton2.setText("Return to Main Screen"); jButton3.setText("Return to Main Screen"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Verify Booking"); setPreferredSize(new java.awt.Dimension(600, 400)); setResizable(false); jLabel2.setText("Enter Booking ID:"); BookingIDTextfield.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BookingIDTextfieldActionPerformed(evt); } }); VerifyButton.setText("Verify Booking"); VerifyButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { VerifyButtonActionPerformed(evt); } }); jButton4.setText("Return to Main Screen"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(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() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jButton4) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 48, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(BookingIDTextfield, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(45, 45, 45)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(VerifyButton) .addGap(125, 125, 125)))))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(83, 83, 83) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(BookingIDTextfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addGap(18, 18, 18) .addComponent(VerifyButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 96, Short.MAX_VALUE) .addComponent(jButton4) .addContainerGap()) ); setSize(new java.awt.Dimension(392, 329)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void BookingIDTextfieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BookingIDTextfieldActionPerformed }//GEN-LAST:event_BookingIDTextfieldActionPerformed private void VerifyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VerifyButtonActionPerformed if(BookingIDTextfield.getText().equalsIgnoreCase("abcd1234")){ BookingInformationGUI itemloader=new BookingInformationGUI(); itemloader.setTitle("Booking no. "+BookingIDTextfield.getText().toUpperCase()); itemloader.setVisible(true); this.setVisible(false); JOptionPane.showMessageDialog(null,"The booking ID is valid."); } else{ JOptionPane.showMessageDialog(null,"The booking ID is invalid.", "Error",JOptionPane.WARNING_MESSAGE); } }//GEN-LAST:event_VerifyButtonActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed this.setVisible(false); MainGUI itemloader=new MainGUI (); itemloader.setVisible(true); }//GEN-LAST:event_jButton4ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(CheckInClerkGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(CheckInClerkGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(CheckInClerkGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(CheckInClerkGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CheckInClerkGUI().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField BookingIDTextfield; private javax.swing.JButton VerifyButton; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JLabel jLabel2; // End of variables declaration//GEN-END:variables }
[ "mihalcea@uni.coventry.ac.uk" ]
mihalcea@uni.coventry.ac.uk
db8a82daaf2968e775764c5a8fd8d9489ab97e61
90070847de299a2890fd446ca06aae8731651f31
/src/main/java/br/com/portabilit/wsmarcaponto/configuration/ProdConfig.java
07526805349a43a129d40d2d56da445d8310584b
[]
no_license
jailtonurbano/ws-marcaponto-fatec-public
d89608ccfa02bf8bf3131c32392a193ff39e57c9
0d7a0ddec394b70c27c1340c3824bd7b991dfdd3
refs/heads/master
2023-01-30T18:59:54.243806
2020-12-16T10:33:53
2020-12-16T10:33:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,044
java
package br.com.portabilit.wsmarcaponto.configuration; import java.text.ParseException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import br.com.portabilit.wsmarcaponto.service.email.EmailService; import br.com.portabilit.wsmarcaponto.service.email.SmtpEmailService; import br.com.portabilit.wsmarcaponto.service.utils.DatabaseService; @Configuration @Profile("prod") public class ProdConfig { @Value("${spring.jpa.hibernate.ddl-auto}") private String strategy; @Autowired private DatabaseService databaseService; @Bean public boolean instantiateDatabase() throws ParseException { if (!"update".equals(strategy)) { return false; } databaseService.instantiateTestDatabase(); return true; } @Bean public EmailService emailService() { return new SmtpEmailService(); } }
[ "heitor.amaral90@outlook.com" ]
heitor.amaral90@outlook.com
ec9c1d4271ddae18930e7d625ccc987a0c4ce4f9
e2f12250e3d4cf14512ea68b8eefcb19924c30c8
/services/portal/src/main/java/com/loriepocket/dto/validation/ValidationErrorDTO.java
f1c837dd123b3d660da5fbbffad62a6dcbe440f2
[ "MIT" ]
permissive
ccoloradoc/loriepocket
95b2fc01f6aa2089c751884ff5e36c93446d71e0
3d95b4e89bfd89de91a94cc1da4edba665a00221
refs/heads/master
2021-07-12T11:55:31.816405
2017-10-15T18:44:12
2017-10-15T18:44:12
104,373,818
0
0
null
2017-09-29T18:25:47
2017-09-21T16:43:26
Java
UTF-8
Java
false
false
653
java
package com.loriepocket.dto.validation; import java.util.ArrayList; import java.util.List; /** * Created by cristian.colorado on 9/28/2017. */ public class ValidationErrorDTO { private List<FieldErrorDTO> fieldErrors = new ArrayList<>(); public ValidationErrorDTO() { } public void addFieldError(String path, String message) { FieldErrorDTO error = new FieldErrorDTO(path, message); fieldErrors.add(error); } public List<FieldErrorDTO> getFieldErrors() { return fieldErrors; } public void setFieldErrors(List<FieldErrorDTO> fieldErrors) { this.fieldErrors = fieldErrors; } }
[ "cristian.colorado@hbr.org" ]
cristian.colorado@hbr.org
174cd554c85af35169dd6dc01369dc267d202287
1b100f1da3ea611f5a7e9c68484ea2a9c4ac03d9
/kie-pmml-trusty/kie-pmml-models/kie-pmml-models-drools/kie-pmml-models-drools-common/src/test/java/org/kie/pmml/models/drools/commons/factories/KiePMMLDescrTypesFactoryTest.java
8934eeedafa7fa9de105c3411423ea798d35b309
[ "Apache-2.0" ]
permissive
tanxujie/drools
33228fe1ff4fda4bd6097af12672774e1596bd61
fcd54a983c49bb79f50dfc479c9e13ea6fb4beaf
refs/heads/master
2021-08-28T07:38:41.043182
2021-08-05T07:44:33
2021-08-05T07:44:33
222,059,888
0
0
Apache-2.0
2019-11-16T06:55:32
2019-11-16T06:55:32
null
UTF-8
Java
false
false
3,019
java
/* * Copyright 2020 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kie.pmml.models.drools.commons.factories; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.stream.IntStream; import org.drools.compiler.lang.api.DescrFactory; import org.drools.compiler.lang.api.PackageDescrBuilder; import org.drools.compiler.lang.descr.TypeDeclarationDescr; import org.junit.Before; import org.junit.Test; import org.kie.pmml.models.drools.ast.KiePMMLDroolsType; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class KiePMMLDescrTypesFactoryTest { private static final String PACKAGE_NAME = "package"; private PackageDescrBuilder builder; @Before public void setUp() throws Exception { builder = DescrFactory.newPackage().name(PACKAGE_NAME); } @Test public void declareTypes() { List<KiePMMLDroolsType> types = new ArrayList<>(); types.add(KiePMMLDescrTestUtils.getDroolsType()); types.add(KiePMMLDescrTestUtils.getDottedDroolsType()); assertTrue(builder.getDescr().getTypeDeclarations().isEmpty()); KiePMMLDescrTypesFactory.factory(builder).declareTypes(types); assertEquals(2, builder.getDescr().getTypeDeclarations().size()); IntStream.range(0, types.size()) .forEach(i -> commonVerifyTypeDeclarationDescr(Objects.requireNonNull(types.get(i)), builder.getDescr().getTypeDeclarations().get(i))); } @Test public void declareType() { KiePMMLDroolsType type = KiePMMLDescrTestUtils.getDroolsType(); KiePMMLDescrTypesFactory.factory(builder).declareType(type); assertEquals(1, builder.getDescr().getTypeDeclarations().size()); commonVerifyTypeDeclarationDescr(type, builder.getDescr().getTypeDeclarations().get(0)); } private void commonVerifyTypeDeclarationDescr(KiePMMLDroolsType type, final TypeDeclarationDescr typeDeclarationDescr) { String expectedGeneratedType = type.getName(); String expectedMappedOriginalType = type.getType(); assertEquals(expectedGeneratedType, typeDeclarationDescr.getTypeName()); assertEquals(1, typeDeclarationDescr.getFields().size()); assertTrue(typeDeclarationDescr.getFields().containsKey("value")); assertEquals(expectedMappedOriginalType, typeDeclarationDescr.getFields().get("value").getPattern().getObjectType()); } }
[ "noreply@github.com" ]
tanxujie.noreply@github.com
f5e771c6e3b7a7a01e06fdc08ff64b73e2029bc1
fef5d4856dcd86ef5ed417283203b20d88483edd
/src/loop/controller/LoopRunner.java
fad2837059de7271d7a56a4c1066e43283d48982
[]
no_license
spencerd25/LoopProject
f9fb1203ea92841e186ec92bc2bb391d3cf0ffb6
0ba044bd91ba97da2fe6031e362996616aca5931
refs/heads/master
2016-09-06T12:29:19.490037
2014-01-23T15:27:11
2014-01-23T15:27:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
187
java
package loop.controller; public class LoopRunner { public static void main(String[]args) { LoopController myLoopController = new LoopController(); myLoopController.start(); } }
[ "spencerdavy@rocketmail.com" ]
spencerdavy@rocketmail.com
61a801b055606a2d407574c5f73ec26c24973ee2
6f129a4f5bcff32864a7699ac0f36eb493f07be3
/amier/app/src/main/java/com/buyint/mergerbot/view/chart/charts/PieChart.java
7a6e8f5beae585304334e86a6f0e1c6719300ae1
[]
no_license
GHHMBird/aimer
4a3588578a19d12103db18670bdcf64f10ab9ff1
d2eda168400c16acb06c83503dd934dc303be93f
refs/heads/master
2020-04-08T21:48:23.750489
2018-11-30T03:36:23
2018-11-30T03:36:23
159,759,114
1
0
null
null
null
null
UTF-8
Java
false
false
16,892
java
package com.buyint.mergerbot.view.chart.charts; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PointF; import android.graphics.RectF; import android.graphics.Typeface; import android.util.AttributeSet; import com.buyint.mergerbot.view.chart.components.XAxis; import com.buyint.mergerbot.view.chart.data.Entry; import com.buyint.mergerbot.view.chart.data.PieData; import com.buyint.mergerbot.view.chart.highlight.Highlight; import com.buyint.mergerbot.view.chart.interfaces.datasets.IPieDataSet; import com.buyint.mergerbot.view.chart.renderer.PieChartRenderer; import com.buyint.mergerbot.view.chart.utils.Utils; import java.util.List; /** * View that represents a pie chart. Draws cake like slices. * * @author Philipp Jahoda */ public class PieChart extends com.buyint.mergerbot.view.chart.charts.PieRadarChartBase<PieData> { /** * rect object that represents the bounds of the piechart, needed for * drawing the circle */ private RectF mCircleBox = new RectF(); /** * flag indicating if the x-labels should be drawn or not */ private boolean mDrawXLabels = true; /** * array that holds the width of each pie-slice in degrees */ private float[] mDrawAngles; /** * array that holds the absolute angle in degrees of each slice */ private float[] mAbsoluteAngles; /** * if true, the cicle_f4f5f7 hole inside the chart will be drawn */ private boolean mDrawHole = true; /** * if true, the hole will see-through to the inner tips of the slices */ private boolean mDrawSlicesUnderHole = false; /** * if true, the values inside the piechart are drawn as percent values */ private boolean mUsePercentValues = false; /** * if true, the slices of the piechart are rounded */ private boolean mDrawRoundedSlices = false; /** * variable for the text that is drawn in the center of the pie-chart */ private CharSequence mCenterText = ""; /** * indicates the size of the hole in the center of the piechart, default: * radius / 2 */ private float mHoleRadiusPercent = 50f; /** * the radius of the transparent circle next to the chart-hole in the center */ protected float mTransparentCircleRadiusPercent = 55f; /** * if enabled, centertext is drawn */ private boolean mDrawCenterText = true; private float mCenterTextRadiusPercent = 100.f; protected float mMaxAngle = 360f; public PieChart(Context context) { super(context); } public PieChart(Context context, AttributeSet attrs) { super(context, attrs); } public PieChart(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void init() { super.init(); mRenderer = new PieChartRenderer(this, mAnimator, mViewPortHandler); mXAxis = null; } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if (mData == null) return; mRenderer.drawData(canvas); if (valuesToHighlight()) mRenderer.drawHighlighted(canvas, mIndicesToHighlight); mRenderer.drawExtras(canvas); mRenderer.drawValues(canvas); // mLegendRenderer.renderLegend(canvas); drawDescription(canvas); drawMarkers(canvas); } @Override public void calculateOffsets() { super.calculateOffsets(); // prevent nullpointer when no data set if (mData == null) return; float diameter = getDiameter(); float radius = diameter / 2f - 20;// 减去二十 可以避免文字被遮挡 PointF c = getCenterOffsets(); float shift = mData.getDataSet().getSelectionShift(); // create the circle box that will contain the pie-chart (the bounds of // the pie-chart) mCircleBox.set(c.x - radius + shift, c.y - radius + shift, c.x + radius - shift, c.y + radius - shift); } @Override protected void calcMinMax() { calcAngles(); } @Override protected float[] getMarkerPosition(Entry e, Highlight highlight) { PointF center = getCenterCircleBox(); float r = getRadius(); float off = r / 10f * 3.6f; if (isDrawHoleEnabled()) { off = (r - (r / 100f * getHoleRadius())) / 2f; } r -= off; // offset to keep things inside the chart float rotationAngle = getRotationAngle(); int i = e.getXIndex(); // offset needed to center the drawn text in the slice float offset = mDrawAngles[i] / 2; // calculate the text position float x = (float) (r * Math.cos(Math.toRadians((rotationAngle + mAbsoluteAngles[i] - offset) * mAnimator.getPhaseY())) + center.x); float y = (float) (r * Math.sin(Math.toRadians((rotationAngle + mAbsoluteAngles[i] - offset) * mAnimator.getPhaseY())) + center.y); return new float[]{x, y}; } /** * calculates the needed angles for the chart slices */ private void calcAngles() { mDrawAngles = new float[mData.getYValCount()]; mAbsoluteAngles = new float[mData.getYValCount()]; float yValueSum = mData.getYValueSum(); List<IPieDataSet> dataSets = mData.getDataSets(); int cnt = 0; for (int i = 0; i < mData.getDataSetCount(); i++) { IPieDataSet set = dataSets.get(i); for (int j = 0; j < set.getEntryCount(); j++) { mDrawAngles[cnt] = calcAngle(Math.abs(set.getEntryForIndex(j).getVal()), yValueSum); if (cnt == 0) { mAbsoluteAngles[cnt] = mDrawAngles[cnt]; } else { mAbsoluteAngles[cnt] = mAbsoluteAngles[cnt - 1] + mDrawAngles[cnt]; } cnt++; } } } /** * checks if the given index in the given DataSet is set for highlighting or * not * * @param xIndex * @param dataSetIndex * @return */ public boolean needsHighlight(int xIndex, int dataSetIndex) { // no highlight if (!valuesToHighlight() || dataSetIndex < 0) return false; for (int i = 0; i < mIndicesToHighlight.length; i++) // check if the xvalue for the given dataset needs highlight if (mIndicesToHighlight[i].getXIndex() == xIndex && mIndicesToHighlight[i].getDataSetIndex() == dataSetIndex) return true; return false; } /** * calculates the needed angle for a given value * * @param value * @return */ private float calcAngle(float value) { return calcAngle(value, mData.getYValueSum()); } /** * calculates the needed angle for a given value * * @param value * @param yValueSum * @return */ private float calcAngle(float value, float yValueSum) { return value / yValueSum * mMaxAngle; } /** * This will throw an exception, PieChart has no XAxis object. * * @return */ @Deprecated @Override public XAxis getXAxis() { throw new RuntimeException("PieChart has no XAxis"); } @Override public int getIndexForAngle(float angle) { // take the current angle of the chart into consideration float a = Utils.getNormalizedAngle(angle - getRotationAngle()); for (int i = 0; i < mAbsoluteAngles.length; i++) { if (mAbsoluteAngles[i] > a) return i; } return -1; // return -1 if no index found } /** * Returns the index of the DataSet this x-index belongs to. * * @param xIndex * @return */ public int getDataSetIndexForIndex(int xIndex) { List<IPieDataSet> dataSets = mData.getDataSets(); for (int i = 0; i < dataSets.size(); i++) { if (dataSets.get(i).getEntryForXIndex(xIndex) != null) return i; } return -1; } /** * returns an integer array of all the different angles the chart slices * have the angles in the returned array determine how much space (of 360°) * each slice takes * * @return */ public float[] getDrawAngles() { return mDrawAngles; } /** * returns the absolute angles of the different chart slices (where the * slices end) * * @return */ public float[] getAbsoluteAngles() { return mAbsoluteAngles; } /** * Sets the color for the hole that is drawn in the center of the PieChart * (if enabled). * * @param color */ public void setHoleColor(int color) { ((PieChartRenderer) mRenderer).getPaintHole().setColor(color); } /** * Enable or disable the visibility of the inner tips of the slices behind the hole */ public void setDrawSlicesUnderHole(boolean enable) { mDrawSlicesUnderHole = enable; } /** * Returns true if the inner tips of the slices are visible behind the hole, * false if not. * * @return true if slices are visible behind the hole. */ public boolean isDrawSlicesUnderHoleEnabled() { return mDrawSlicesUnderHole; } /** * set this to true to draw the pie center empty * * @param enabled */ public void setDrawHoleEnabled(boolean enabled) { this.mDrawHole = enabled; } /** * returns true if the hole in the center of the pie-chart is set to be * visible, false if not * * @return */ public boolean isDrawHoleEnabled() { return mDrawHole; } /** * Sets the text String that is displayed in the center of the PieChart. * * @param text */ public void setCenterText(CharSequence text) { if (text == null) mCenterText = ""; else mCenterText = text; } /** * returns the text that is drawn in the center of the pie-chart * * @return */ public CharSequence getCenterText() { return mCenterText; } /** * set this to true to draw the text that is displayed in the center of the * pie chart * * @param enabled */ public void setDrawCenterText(boolean enabled) { this.mDrawCenterText = enabled; } /** * returns true if drawing the center text is enabled * * @return */ public boolean isDrawCenterTextEnabled() { return mDrawCenterText; } @Override protected float getRequiredLegendOffset() { return mLegendRenderer.getLabelPaint().getTextSize() * 2.f; } @Override protected float getRequiredBaseOffset() { return 0; } @Override public float getRadius() { if (mCircleBox == null) return 0; else return Math.min(mCircleBox.width() / 2f, mCircleBox.height() / 2f); } /** * returns the circlebox, the boundingbox of the pie-chart slices * * @return */ public RectF getCircleBox() { return mCircleBox; } /** * returns the center of the circlebox * * @return */ public PointF getCenterCircleBox() { return new PointF(mCircleBox.centerX(), mCircleBox.centerY()); } /** * sets the typeface for the center-text paint * * @param t */ public void setCenterTextTypeface(Typeface t) { ((PieChartRenderer) mRenderer).getPaintCenterText().setTypeface(t); } /** * Sets the size of the center text of the PieChart in dp. * * @param sizeDp */ public void setCenterTextSize(float sizeDp) { ((PieChartRenderer) mRenderer).getPaintCenterText().setTextSize( Utils.convertDpToPixel(sizeDp)); } /** * Sets the size of the center text of the PieChart in pixels. * * @param sizePixels */ public void setCenterTextSizePixels(float sizePixels) { ((PieChartRenderer) mRenderer).getPaintCenterText().setTextSize(sizePixels); } /** * Sets the color of the center text of the PieChart. * * @param color */ public void setCenterTextColor(int color) { ((PieChartRenderer) mRenderer).getPaintCenterText().setColor(color); } /** * sets the radius of the hole in the center of the piechart in percent of * the maximum radius (max = the radius of the whole chart), default 50% * * @param percent */ public void setHoleRadius(final float percent) { mHoleRadiusPercent = percent; } /** * Returns the size of the hole radius in percent of the total radius. * * @return */ public float getHoleRadius() { return mHoleRadiusPercent; } /** * Sets the color the transparent-circle should have. * * @param color */ public void setTransparentCircleColor(int color) { Paint p = ((PieChartRenderer) mRenderer).getPaintTransparentCircle(); int alpha = p.getAlpha(); p.setColor(color); p.setAlpha(alpha); } /** * sets the radius of the transparent circle that is drawn next to the hole * in the piechart in percent of the maximum radius (max = the radius of the * whole chart), default 55% -> means 5% larger than the center-hole by * default * * @param percent */ public void setTransparentCircleRadius(final float percent) { mTransparentCircleRadiusPercent = percent; } public float getTransparentCircleRadius() { return mTransparentCircleRadiusPercent; } /** * Sets the amount of transparency the transparent circle should have 0 = fully transparent, * 255 = fully opaque. * Default value is 100. * * @param alpha 0-255 */ public void setTransparentCircleAlpha(int alpha) { ((PieChartRenderer) mRenderer).getPaintTransparentCircle().setAlpha(alpha); } /** * set this to true to draw the x-value text into the pie slices * * @param enabled */ public void setDrawSliceText(boolean enabled) { mDrawXLabels = enabled; } /** * returns true if drawing x-values is enabled, false if not * * @return */ public boolean isDrawSliceTextEnabled() { return mDrawXLabels; } /** * Returns true if the chart is set to draw each end of a pie-slice * "rounded". * * @return */ public boolean isDrawRoundedSlicesEnabled() { return mDrawRoundedSlices; } /** * If this is enabled, values inside the PieChart are drawn in percent and * not with their original value. Values provided for the ValueFormatter to * format are then provided in percent. * * @param enabled */ public void setUsePercentValues(boolean enabled) { mUsePercentValues = enabled; } /** * Returns true if using percentage values is enabled for the chart. * * @return */ public boolean isUsePercentValuesEnabled() { return mUsePercentValues; } /** * the rectangular radius of the bounding box for the center text, as a percentage of the pie * hole * default 1.f (100%) */ public void setCenterTextRadiusPercent(float percent) { mCenterTextRadiusPercent = percent; } /** * the rectangular radius of the bounding box for the center text, as a percentage of the pie * hole * default 1.f (100%) */ public float getCenterTextRadiusPercent() { return mCenterTextRadiusPercent; } public float getMaxAngle() { return mMaxAngle; } /** * Sets the max angle that is used for calculating the pie-circle. 360f means * it's a full PieChart, 180f results in a half-pie-chart. Default: 360f * * @param maxangle min 90, max 360 */ public void setMaxAngle(float maxangle) { if (maxangle > 360) maxangle = 360f; if (maxangle < 90) maxangle = 90f; this.mMaxAngle = maxangle; } @Override protected void onDetachedFromWindow() { // releases the bitmap in the renderer to avoid oom error if (mRenderer != null && mRenderer instanceof PieChartRenderer) { ((PieChartRenderer) mRenderer).releaseBitmap(); } super.onDetachedFromWindow(); } }
[ "245760047@qq.com" ]
245760047@qq.com
a4c96e7c5717854566c23d6bd491d08a6de9f417
0cc95c67df97dc6c4eb6b6e90b51533ffbe035e7
/src/org/testhk/message/request/LinkMessage.java
b9aded7b031147c0082c618e18bab73d1cebf751
[]
no_license
wolfhk1/testhk
7c01d2ed092129871cf2645773641a7c1d3a5c8a
0c744dfec45bd76fd60e25cc229e163c29df9523
refs/heads/master
2021-01-21T12:59:07.560260
2016-04-20T09:31:33
2016-04-20T09:31:33
55,743,076
0
0
null
null
null
null
UTF-8
Java
false
false
800
java
package org.testhk.message.request; /** * 链接消息 * @author Administrator * */ public class LinkMessage extends BaseMessage { // 消息标题 private String Title; // 消息描述 private String Description; // 消息链接 private String Url; public String getTitle() { return Title; } public void setTitle(String title) { Title = title; } public String getDescription() { return Description; } public void setDescription(String description) { Description = description; } public String getUrl() { return Url; } public void setUrl(String url) { Url = url; } }
[ "wolfhk@qq.com" ]
wolfhk@qq.com
cfd80e7fb0b3042ca88cfaebec762232777278c9
79715503133e26faf3a12d303ae82dfd73704ccb
/service/src/main/java/cooleye/service/download/ProgressListener.java
b029959e1c2efedaf0ef534efa0674eaf1d1ea61
[]
no_license
wshychbydh/Trip
7ae19e1902c9b9cc7f17d93b660fab77a03a807c
3247e40ac7f940bb15c321088686b56b8dce23b1
refs/heads/master
2020-04-06T07:04:54.808693
2016-08-29T09:09:32
2016-08-29T09:09:32
65,193,848
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
package cooleye.service.download; public interface ProgressListener { /** * @param progress 已经下载或上传字节数 * @param total 总字节数 * @param done 是否完成 */ void onProgress(long progress, long total, boolean done); }
[ "443495586@qq.com" ]
443495586@qq.com
19a01598a94db31f664b3111b92bd01ed2af2b60
7656174301d03b5c4ca5c1b8f38196154b56f283
/vbmp-common/src/main/java/com/etekcity/vbmp/common/comm/dto/SupportedTypesResponse.java
64f4ce76b6e1256f6cac32fce3e0238d375656ee
[]
no_license
huangrongya/someDemos
45ff8c32532b7b2fc93b8778f87ca13e3ef5e6f0
bf8777d01364ef5e91fa4b87ffefaa46aec1e503
refs/heads/master
2021-09-25T14:57:10.340557
2018-10-23T07:25:23
2018-10-23T07:25:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package com.etekcity.vbmp.common.comm.dto; import java.util.List; import com.etekcity.vbmp.common.config.VBMPResponse; import com.etekcity.vbmp.common.comm.dto.inner.SupportedType; import lombok.Data; @Data public class SupportedTypesResponse extends VBMPResponse { private List<SupportedType> supportedTypes; }
[ "roylehuang@etekcity.com.cn" ]
roylehuang@etekcity.com.cn
834a97254ff4549f2412bf56aee71071fc035e42
c2ba431e73b52478de1b09c378e3cd56d150814c
/antsso-datacenter/src/main/java/com/gang/antsso/datacenter/repository/SsoRoleRepository.java
13fc01b78cfa9e1b8ba2a35ad198badecba34298
[]
no_license
black-ant/antsso
a3389b00039c93c6569c1cae933bf38fc1385a77
c6277be846cefac553836c599f6503fb98d3218c
refs/heads/master
2022-06-21T18:58:32.866111
2020-11-17T15:18:08
2020-11-17T15:18:08
222,889,699
0
0
null
2022-06-21T03:44:52
2019-11-20T08:37:53
JavaScript
UTF-8
Java
false
false
421
java
package com.gang.antsso.datacenter.repository; import com.gang.antsso.datacenter.entity.SsoRoleEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * @Classname SsoRoleRepository * @Description TODO * @Date 2020/1/25 21:50 * @Created by zengzg */ @Repository public interface SsoRoleRepository extends JpaRepository<SsoRoleEntity, String> { }
[ "1016930479@qq.com" ]
1016930479@qq.com
de06c2de3a7c00d346be9b013825108ab44301c9
3284e4db88aefedcd6dafc505ccc96ff5e7785d6
/src/main/java/com/tooltar/service/PermissionServiceI.java
2a9f95ed3e0fcd8e795d4125d55d1d7a925b1092
[]
no_license
zhihui1382/rep_pu1
938a5531ec79dfd1ae7374bc89f375cb5c4e1cc7
a198bd00760e1ed2810c560c2412e53370786498
refs/heads/master
2020-05-17T18:25:31.361108
2019-04-28T08:50:07
2019-04-28T08:50:07
183,883,023
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
package com.tooltar.service; import java.util.List; import com.tooltar.bean.PermissionBean; import com.tooltar.bean.RoleBean; /** * 权限相关Service * @author 赵国正 * */ public interface PermissionServiceI { /** * 查询所有权限信息 * @return 所有权限的集合 */ public List<PermissionBean> getPermission(); /** * 修改角色的权限 * @param roleBean 修改之后的角色信息 包含角色的id 和修改之后的权限id * @return */ public Integer setPermission(RoleBean roleBean); }
[ "189406@qq.com" ]
189406@qq.com
e79b0d71813b28a5fe3998a38a301903f0b614bb
144c4cf646338f833936bc897b78b4c9896d640f
/app/src/test/java/com/example/my_fruits_diary/ExampleUnitTest.java
3385e4142dde63c09c6a9bcc2a778e2b6fe4d285
[]
no_license
AnastasijaGurejeva/My_Fruits_Diary
aac9c99421ac7a098901ed691bf1456fcc2a22c9
712a36b00e70fb08be0690606432e336a50c8e19
refs/heads/master
2020-05-31T15:12:29.041414
2019-06-14T08:01:11
2019-06-14T08:01:11
190,347,897
0
0
null
2019-06-14T00:59:07
2019-06-05T07:34:15
Java
UTF-8
Java
false
false
388
java
package com.example.my_fruits_diary; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "anastasija@Faizhals-MBP.net" ]
anastasija@Faizhals-MBP.net
f5dc49e87527fae0cef1ddaddd8fb9429e251c58
c093f537d7937966a8649c7825989694b5bf6f83
/polish-design-pattern/src/main/java/com/ly/iterator/iterator/Client.java
94288edf7844f08ca9a26dd3cfe9047404ee4b1a
[]
no_license
8989-9898/Java-Guide
9122a0df1404a993432fe8d77e5d23dd9cef6e08
ca41d7782cd202247e31e8f6e78bed97b8d5e1bb
refs/heads/master
2022-06-24T13:37:20.769467
2020-01-20T08:23:36
2020-01-20T08:23:36
196,115,860
1
0
null
2022-06-21T01:34:08
2019-07-10T02:27:11
Java
UTF-8
Java
false
false
2,082
java
package com.ly.iterator.iterator; /** * @ProjectName: Java-Guide * @Package: com.ly.iterator.iterator * @ClassName: Client * @Author: lin * @Description: 测试使用数组的迭代器模式 * @Date: 2019/8/4 16:39 * @Version: 1.0 */ public class Client { public static void main(String[] args) { String[] strings = new String[]{"张三", "李四", "王五", "赵六"}; // 创建聚合对象 Aggregate aggregate = new ConcreteAggregate(strings); // 通过聚合对象,创建迭代器对象 Iterator iterator = aggregate.createIterator(); // 首先迭代到第一个元素 iterator.first(); // 循环迭代输出 while (!iterator.isDone()) { // 获取当前元素输出 System.out.println(iterator.currentItem()); // 迭代下一个元素 iterator.next(); } } /** * 迭代器模式的优点: * 更好的封装性 * 迭代器模式可以让你访问一个聚合对象的内容,而无需暴露该聚合对象的内部表示,从而提供聚合对象的封装性。 * 可以以不同的方式来遍历一个聚合对象 * 使用迭代器模式,使得聚合对象和具体的迭代算法分离开。这样可以实现不同的迭代器事例、不同的遍历方法来 * 遍历同一个聚合对象。 * 迭代器模式简化了聚合对象。 * 有了迭代器的接口,则聚合本身就不需要在定义这些接口了,从而简化的聚合的接口定义。 * 简化客户端调用。 * 迭代器模式为遍历不同的聚合对象提供了一个统一的接口,是的客户端遍历聚合对象的内容更简单。 * 同一个聚合对象上可以有多个遍历。 * 每个迭代器保持它自己的状态,比如迭代时的索引位置,因此可以同一个聚合对象同时进行多个遍历 * * 迭代器模式的本质:控制访问聚合对象中得的元素。 * */ }
[ "1475304280@qq.com" ]
1475304280@qq.com
7ee97224efd04602ded256486f7a6b03a80bf25c
c05c52b0340602ce737ae7272014480ed8a96a85
/app/src/androidTest/java/com/ghoststudiosonline/ghoststudioswebsiteanalysis/ExampleInstrumentedTest.java
a0ec2f2327c419bccbb0da4fe4c4e5894afcd762
[]
no_license
ChrisBonner/GhostStudiosWebsiteAnalysis
2e3a1380a0d22a5485793712322c0f67dec64cc5
b3566b226a2d66ae837e13f0560990da23e4e5ea
refs/heads/master
2020-03-19T01:09:01.052049
2018-08-24T17:23:06
2018-08-24T17:23:06
135,525,991
0
0
null
null
null
null
UTF-8
Java
false
false
784
java
package com.ghoststudiosonline.ghoststudioswebsiteanalysis; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.ghoststudiosonline.ghoststudioswebsiteanalysis", appContext.getPackageName()); } }
[ "31518439+ChrisBonner@users.noreply.github.com" ]
31518439+ChrisBonner@users.noreply.github.com
ef25faa1f0099966893aed37148d6b484a16f5c6
1fdff085c550ca2be8d9b2bca5bed3079dcb9268
/org.xtext.sensinact.sna.ui/src-gen/org/eclipse/sensinact/studio/language/ui/contentassist/AbstractSensinactProposalProvider.java
7a26c90a1b945c1060d69aea1e0f679b1f203ddf
[]
no_license
hakimuga/Sensinact-to-BIP
f3d2cb043ad17f97b84d23916daf0fac7d7dd59f
37990b13c9d82a2b794883da7abefdc2d0ff96a8
refs/heads/main
2023-04-09T05:10:33.470938
2021-04-13T17:17:34
2021-04-13T17:17:34
351,398,759
0
0
null
null
null
null
UTF-8
Java
false
false
24,226
java
/* * generated by Xtext */ package org.eclipse.sensinact.studio.language.ui.contentassist; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.*; import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext; /** * Represents a generated, default implementation of superclass {@link org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider}. * Methods are dynamically dispatched on the first parameter, i.e., you can override them * with a more concrete subtype. */ @SuppressWarnings("all") public class AbstractSensinactProposalProvider extends org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider { public void completeSensinact_Eca(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_SENSINACT_Autostart(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_SENSINACT_Resources(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_SENSINACT_Prob(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_SENSINACT_Cep(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_SENSINACT_On(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_SENSINACT_Eca(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CLOCK_STOCHASTIC_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); } public void completeDSL_CLOCK_STOCHASTIC_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CLOCK_STOCHASTIC_Param1(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CLOCK_STOCHASTIC_Param2(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_FLAG_AUTOSTART_Activated(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Resource_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Resource_GatewayID(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Resource_DeviceID(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Resource_ServiceID(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Resource_ResourceID(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_On_Triggers(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ECA_STATEMENT_Ifdo(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ECA_STATEMENT_ElseIfdo(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ECA_STATEMENT_Elsedo(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_IfDo_Condition(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_IfDo_Actions(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ElseIfDo_Condition(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ElseIfDo_Actions(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ElseDo_Actions(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_REF_CONDITION_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_STATEMENT_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_STATEMENT_Operation(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(0)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(1)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(2)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(3)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(4)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(5)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(6)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(7)), context, acceptor); } public void completeDSL_CEP_AFTER_Ref1(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_AFTER_Ref2(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_AFTER_Start(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_AFTER_End(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_BEFORE_Ref1(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_BEFORE_Ref2(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_BEFORE_Start(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_BEFORE_End(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_COINCIDE_Ref1(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_COINCIDE_Ref2(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_COINCIDE_Window(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_MIN_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_MIN_Window(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_MAX_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_MAX_Window(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_AVG_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_AVG_Window(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_SUM_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_SUM_Window(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_COUNT_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_COUNT_Window(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_DURATION_Units(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(0)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(1)), context, acceptor); } public void completeDSL_CEP_DURATION_MIN_Min(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_CEP_DURATION_SEC_Sec(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ListActions_ActionList(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ResourceAction_Variable(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ResourceAction_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); } public void completeDSL_ResourceAction_Actiontype(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override // subclasses may override } public void completeDSL_ResourceAction_ListParam(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_ListParam_Param(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Expression_Or_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Expression_And_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Expression_DiffEqual_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Expression_Compare_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Expression_PlusMinus_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Expression_MultiplicationDivision_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeDSL_Expression_Unary_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { if (assignment.getTerminal() instanceof RuleCall) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } if (assignment.getTerminal() instanceof CrossReference) { lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); } } public void completeDSL_Expression_Unary_Exp(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void complete_Sensinact(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_SENSINACT(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CLOCK_STOCHASTIC(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_FLAG_AUTOSTART(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_Resource(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_On(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_ECA_STATEMENT(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_IfDo(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_ElseIfDo(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_ElseDo(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_BOOLEAN(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_INT(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_NUMBER(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_ID(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_EXTENDED_ID(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_REF(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_REF_CONDITION(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_STATEMENT(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_AFTER(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_BEFORE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_COINCIDE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_MIN(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_MAX(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_AVG(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_SUM(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_COUNT(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_DURATION(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_DURATION_MIN(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_CEP_DURATION_SEC(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_ListActions(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_ResourceAction(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_ListParam(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_Expression_Or(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_Expression_And(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_Expression_DiffEqual(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_Expression_Compare(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_Expression_PlusMinus(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_Expression_MultiplicationDivision(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } public void complete_DSL_Expression_Unary(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } }
[ "abdelhakim.baouya@univ-grenoble-alpes.fr" ]
abdelhakim.baouya@univ-grenoble-alpes.fr
ea88209ca83c3622e9ead039dfa789fcd5cea998
0b4844d550c8e77cd93940e4a1d8b06d0fbeabf7
/JavaSource/dream/work/cal/pmperiod/dao/oraImpl/MaWoSchedListDAOOraImpl.java
ac883efbf8b4511fce7f121e16863d3647e29a5b
[]
no_license
eMainTec-DREAM/DREAM
bbf928b5c50dd416e1d45db3722f6c9e35d8973c
05e3ea85f9adb6ad6cbe02f4af44d941400a1620
refs/heads/master
2020-12-22T20:44:44.387788
2020-01-29T06:47:47
2020-01-29T06:47:47
236,912,749
0
0
null
null
null
null
UHC
Java
false
false
26,132
java
package dream.work.cal.pmperiod.dao.oraImpl; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.List; import org.springframework.jdbc.core.BatchPreparedStatementSetter; import common.bean.User; import common.spring.BaseJdbcDaoSupportOra; import common.util.DateUtil; import common.util.QueryBuffer; import dream.work.cal.pmperiod.dao.MaWoSchedListDAO; import dream.work.cal.pmperiod.dto.MaWoSchedCommonDTO; import dream.work.cal.pmperiod.dto.MaWoSchedDetailDTO; /** * 예방작업일정(기간) - 목록 dao * @author kim21017 * @version $Id: MaWoSchedListDAO.java,v 1.0 2015/12/02 09:14:12 kim21017 Exp $ * @since 1.0 * @spring.bean id="maWoSchedListDAOTarget" * @spring.txbn id="maWoSchedListDAO" * @spring.property name="dataSource" ref="dataSource" */ public class MaWoSchedListDAOOraImpl extends BaseJdbcDaoSupportOra implements MaWoSchedListDAO { /** * grid find * @author kim21017 * @version $Id: MaWoSchedListDAO.java,v 1.0 2015/12/02 09:14:12 kim21017 Exp $ * @since 1.0 * * @param maWoSchedCommonDTO * @return List */ public List findSchedList(MaWoSchedCommonDTO maWoSchedCommonDTO, User user) { QueryBuffer query = new QueryBuffer(); query.append("SELECT "); query.append(" '' seqNo, "); query.append(" '' isDelCheck, "); query.append(" x.pmsched_id pmSchedId, "); query.getDate("x.plan_date", "PLANDATE"); query.append(", "); query.getDate("x.actual_date", "COMPLETEDATE"); query.append(", "); query.append(" x.sched_date SCHEDDATE, "); query.append(" y.pm_no pmNo, "); query.append(" SFACODE_TO_DESC(x.pmsched_status,'PMSCHED_STATUS','SYS','','"+user.getLangId()+"') pmSchedStatus, "); query.append(" (SELECT emp_id FROM TAWORKORDER WHERE pm_id = x.pm_id AND wkor_id = x.wkor_id) empId, "); query.append(" (SELECT emp_name FROM TAEMP WHERE emp_id = (SELECT emp_id FROM TAWORKORDER WHERE pm_id = x.pm_id AND wkor_id = x.wkor_id)) empDesc, "); query.append(" y.description pmDesc, "); query.append(" (SELECT b.full_desc "); query.append(" FROM TAEQUIPMENT a, TAEQLOC b "); query.append(" WHERE a.comp_no = b.comp_no "); query.append(" AND a.eqloc_id = b.eqloc_id "); query.append(" AND a.comp_no = x.comp_no "); query.append(" AND a.equip_id = x.equip_id) AS eqLocDesc, "); query.append(" (SELECT TO_CHAR(DECODE(b.eqctg_type,'MD','('||b.old_eq_no||')'||b.item_no,b.item_no)) "); query.append(" FROM TAPMEQUIP a, TAEQUIPMENT b "); query.append(" WHERE a.comp_no = b.comp_no "); query.append(" AND a.equip_id = b.equip_id "); query.append(" AND a.pm_id = y.pm_id "); query.append(" AND a.pmequip_id = x.pmequip_id "); query.append(" AND a.comp_no = y.comp_no "); query.append(" ) AS equipNo, "); query.append(" (SELECT TO_CHAR(DECODE(b.eqctg_type,'MD','('||b.old_eq_no||')'||b.description,b.description)) "); query.append(" FROM TAPMEQUIP a, TAEQUIPMENT b "); query.append(" WHERE a.comp_no = b.comp_no "); query.append(" AND a.equip_id = b.equip_id "); query.append(" AND a.pm_id = y.pm_id "); query.append(" AND a.pmequip_id = x.pmequip_id "); query.append(" AND a.comp_no = y.comp_no "); query.append(" ) AS equipDesc, "); query.append(" (SELECT description "); query.append(" FROM TADEPT "); query.append(" WHERE comp_no = y.comp_no "); query.append(" AND dept_id = y.dept_id) deptDesc, "); query.append(" (SELECT description "); query.append(" FROM TAWKCTR "); query.append(" WHERE comp_no = y.comp_no "); query.append(" AND wkctr_id = y.wkctr_id) wkCtrDesc, "); query.append(" SFACODE_TO_DESC(y.pm_type,y.wo_type||'_TYPE','SYS','','"+user.getLangId()+"') pmTypeDesc, "); query.append(" y.pm_type pmType, "); query.append(" y.wo_type woType, "); query.append(" SFACODE_TO_DESC(y.schedule_type,'SCHEDULE_TYPE','SYS','','"+user.getLangId()+"') scheduleTypeDesc, "); query.append(" y.cycle||y.period_type cycle, "); query.append(" y.USAGE USAGE, "); query.append(" (SELECT wo_status "); query.append(" FROM TAWORKORDER "); query.append(" WHERE comp_no = x.comp_no "); query.append(" AND wkor_id = x.wkor_id) woStatus, "); query.append(" x.pmsched_status pmStatusCode, "); query.append(" y.pm_id pmId, "); query.append(" (SELECT param2 FROM TACDSYSD WHERE cdsysd_no=y.pm_type AND list_type= y.wo_type||'_TYPE') param, "); query.append(" (SELECT (SELECT b.param1 FROM TACDSYSD b WHERE b.list_type=a.wo_type||'_TYPE' AND b.cdsysd_no= a.pm_type) "); query.append(" FROM TAWORKORDER a "); query.append(" WHERE a.comp_no = x.comp_no "); query.append(" AND a.wkor_id = x.wkor_id ) woparam, "); query.append(" x.wkor_id wkorId "); query.append(" ,z.vendor_id vendorId "); query.append(" ,SFAIDTODESC(z.vendor_id, '', 'VENDOR', z.comp_no) vendorDesc "); query.append(" ,z.tot_amt totAmt "); query.append(" ,SFACODE_TO_DESC(z.self_vendor_type, 'SELF_VENDOR_TYPE', 'SYS', '', '"+user.getLangId()+"') selfVendorTypeDesc "); query.append(" ,(SELECT a.description "); query.append(" FROM TAPLANT a "); query.append(" WHERE a.comp_no = y.comp_no "); query.append(" AND a.plant = y.plant) AS plantDesc "); query.append(" , (SELECT (SELECT b.description FROM TADEPT b WHERE b.comp_no = a.comp_no AND b.dept_id = a.usage_dept) "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE a.comp_no = x.comp_no "); query.append(" AND a.equip_id = x.equip_id) AS usageDeptDesc "); query.append(" , (SELECT a.item_no "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE a.comp_no = x.comp_no "); query.append(" AND a.equip_id = (SELECT c.p_equip_id FROM TAEQUIPMENT c WHERE c.comp_no = a.comp_no AND c.equip_id = x.equip_id)) AS pequipNo "); query.append(" , (SELECT a.description "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE a.comp_no = x.comp_no "); query.append(" AND a.equip_id = (SELECT c.p_equip_id FROM TAEQUIPMENT c WHERE c.comp_no = a.comp_no AND c.equip_id = x.equip_id)) AS pequipDesc "); query.append(" , (SELECT (SELECT b.description FROM TADEPT b WHERE b.comp_no = a.comp_no AND b.dept_id = a.usage_dept) "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE a.comp_no = x.comp_no "); query.append(" AND a.equip_id = (SELECT c.p_equip_id FROM TAEQUIPMENT c WHERE c.comp_no = a.comp_no AND c.equip_id = x.equip_id)) AS pequipUsaDeptDesc "); query.append(" ,x.remark remark "); query.append(" FROM TAPMSCHED x INNER JOIN TAPMLST y "); query.append(" ON x.comp_no = y.comp_no AND x.pm_id = y.pm_id "); query.append(" INNER JOIN TAPMEQUIP yy "); query.append(" ON yy.pm_id = y.pm_id AND yy.comp_no = y.comp_no AND yy.pmequip_id = x.pmequip_id "); query.append(" LEFT OUTER JOIN taworkorder z "); query.append(" ON x.comp_no = z.comp_no AND x.wkor_id = z.wkor_id "); query.append(" WHERE 1=1 "); query.append(this.getWhere(maWoSchedCommonDTO, user)); query.getOrderByQuery("x.sched_date, y.description", maWoSchedCommonDTO.getOrderBy(), maWoSchedCommonDTO.getDirection()); return getJdbcTemplate().queryForList(query.toString(maWoSchedCommonDTO.getIsLoadMaxCount(), maWoSchedCommonDTO.getFirstRow())); } /** * Filter 조건 * @author kim21017 * @version $Id: MaWoSchedListDAO.java,v 1.0 2015/12/02 09:14:12 kim21017 Exp $ * @since 1.0 * * @param day * @param status * @param compNo * @param deptId * @param deptDesc * @return * @throws Exception */ private String getWhere(MaWoSchedCommonDTO maWoSchedCommonDTO, User user) { QueryBuffer query = new QueryBuffer(); query.getStringEqualQuery("x.comp_no", user.getCompNo()); query.getStringEqualQuery("x.IS_DELETED", "N"); query.getAndNumKeyQuery("x.pmequip_id", maWoSchedCommonDTO.getPmEquipId()); query.getSysCdQuery("x.pmsched_status", maWoSchedCommonDTO.getPmSchedStatus(), "", "PMSCHED_STATUS", user.getCompNo(), user.getLangId()); //날짜 전체 검색(리스트조회 사용) query.getAndDateQuery("x.sched_date", maWoSchedCommonDTO.getFilterStartDate(), maWoSchedCommonDTO.getFilterEndDate()); //예방점검기준 번호 query.getAndQuery("y.pm_no", maWoSchedCommonDTO.getFilterPmNo()); //부서 query.getDeptLevelQuery("y.dept_id", maWoSchedCommonDTO.getFilterDeptId(), maWoSchedCommonDTO.getFilterDeptDesc(), maWoSchedCommonDTO.getCompNo()); //설비 if(!"".equals(maWoSchedCommonDTO.getFilterEquipId())||!"".equals(maWoSchedCommonDTO.getFilterEquipDesc())){ query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1 = 1 "); query.getStringEqualQuery("a.is_deleted", "N"); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getCodeLikeQuery("a.equip_id", "a.description||a.item_no", maWoSchedCommonDTO.getFilterEquipId(), maWoSchedCommonDTO.getFilterEquipDesc()); query.append(" ) "); } //위치 if(!"".equals(maWoSchedCommonDTO.getFilterEqLocId())||!"".equals(maWoSchedCommonDTO.getFilterEqLocDesc())){ query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1 = 1 "); query.getStringEqualQuery("a.is_deleted", "N"); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getEqLocLevelQuery("a.eqloc_id", maWoSchedCommonDTO.getFilterEqLocId(), maWoSchedCommonDTO.getFilterEqLocDesc(), maWoSchedCommonDTO.getCompNo()); query.append(" ) "); } //종류 if(!"".equals(maWoSchedCommonDTO.getFilterEqCtgId())||!"".equals(maWoSchedCommonDTO.getFilterEqCtgDesc())){ query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1 = 1 "); query.getStringEqualQuery("a.is_deleted", "N"); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getEqCtgLevelQuery("a.eqctg_id", maWoSchedCommonDTO.getFilterEqCtgId(), maWoSchedCommonDTO.getFilterEqCtgDesc(), maWoSchedCommonDTO.getCompNo()); query.append(" ) "); } //설비유형 if(!"".equals(maWoSchedCommonDTO.getFilterEqCtgTypeId())||!"".equals(maWoSchedCommonDTO.getFilterEqCtgTypeDesc())){ query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1 = 1 "); query.getStringEqualQuery("a.is_deleted", "N"); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getSysCdQuery("a.eqctg_type", maWoSchedCommonDTO.getFilterEqCtgTypeId(), maWoSchedCommonDTO.getFilterEqCtgTypeDesc(), "EQCTG_TYPE", maWoSchedCommonDTO.getCompNo(),user.getLangId()); query.append(" ) "); } //법정설비여부 if(!"".equals(maWoSchedCommonDTO.getFilterIsLawEq())){ query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1 = 1 "); query.getStringEqualQuery("a.is_deleted", "N"); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getLikeQuery("a.is_law_eq", maWoSchedCommonDTO.getFilterIsLawEq()); query.append(" ) "); } //담당자(정) if(!"".equals(maWoSchedCommonDTO.getFilterMainMngId())||!"".equals(maWoSchedCommonDTO.getFilterMainMngName())){ query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1 = 1 "); query.getStringEqualQuery("a.is_deleted", "N"); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getCodeLikeQuery("a.main_mng_id", "(SELECT aa.emp_name FROM TAEMP aa WHERE aa.emp_id = a.main_mng_id AND aa.comp_no='"+maWoSchedCommonDTO.getCompNo()+"')", maWoSchedCommonDTO.getFilterMainMngId(), maWoSchedCommonDTO.getFilterMainMngName()); query.append(" ) "); } //담당자(부) if(!"".equals(maWoSchedCommonDTO.getFilterSubMngId())||!"".equals(maWoSchedCommonDTO.getFilterSubMngName())){ query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1 = 1 "); query.getStringEqualQuery("a.is_deleted", "N"); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getCodeLikeQuery("a.sub_mng_id", "(SELECT aa.emp_name FROM TAEMP aa WHERE aa.emp_id = a.sub_mng_id AND aa.comp_no='"+maWoSchedCommonDTO.getCompNo()+"')", maWoSchedCommonDTO.getFilterSubMngId(), maWoSchedCommonDTO.getFilterSubMngName()); query.append(" ) "); } //작업형태 query.getSysCdQuery("y.pm_type", maWoSchedCommonDTO.getFilterPmTypeId(), maWoSchedCommonDTO.getFilterPmTypeDesc(), "y.wo_type||'_TYPE'", maWoSchedCommonDTO.getCompNo(),user.getLangId()); //작업종류 query.getSysCdQuery("y.wo_type", maWoSchedCommonDTO.getFilterWoTypeId(), maWoSchedCommonDTO.getFilterWoTypeDesc(), "WO_TYPE", maWoSchedCommonDTO.getCompNo(),user.getLangId()); //작업그룹 query.getWkCtrLevelQuery("y.wkctr_id", maWoSchedCommonDTO.getFilterWkCtrId(), maWoSchedCommonDTO.getFilterWkCtrDesc(), maWoSchedCommonDTO.getCompNo()); //담당자 query.getCodeLikeQuery("(SELECT emp_id FROM TAWORKORDER " + "WHERE pm_id = x.pm_id AND wkor_id = x.wkor_id)" , "(SELECT a.emp_name FROM TAEMP a WHERE a.emp_id = (SELECT emp_id FROM TAWORKORDER WHERE pm_id = x.pm_id AND wkor_id = x.wkor_id)" + " AND a.comp_no='"+user.getCompNo()+"')", maWoSchedCommonDTO.getFilterEmpId(), maWoSchedCommonDTO.getFilterEmpDesc()); //공장코드 query.getCodeLikeQuery("y.plant", "(SELECT a.description FROM TAPLANT a WHERE a.comp_no = '"+user.getCompNo()+"' AND a.plant = y.plant )", maWoSchedCommonDTO.getFilterPlantId(), maWoSchedCommonDTO.getFilterPlantDesc()); //최신버전의 설비의 작업만 보여줌. query.append("AND NOT EXISTS (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1=1 "); query.append(" AND a.equip_id = x.equip_id "); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getAndQuery("a.is_last_version", "N"); query.append(" ) "); //설비번호 if(!"".equals(maWoSchedCommonDTO.getFilterEquipNo())) { query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1=1 "); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getLikeQuery("a.item_no", maWoSchedCommonDTO.getFilterEquipNo()); query.append(" ) "); } //설비사용부서 if(!"".equals(maWoSchedCommonDTO.getFilterEqUsaDeptId()) || !"".equals(maWoSchedCommonDTO.getFilterEqUsaDeptDesc())) { query.append("AND x.equip_id IN (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE 1=1 "); query.getStringEqualQuery("a.comp_no", user.getCompNo()); query.getDeptLevelQuery("a.usage_dept", maWoSchedCommonDTO.getFilterEqUsaDeptId(), maWoSchedCommonDTO.getFilterEqUsaDeptDesc(), user.getCompNo()); query.append(" ) "); } //상위설비명 if(!"".equals(maWoSchedCommonDTO.getFilterPequipId()) || !"".equals(maWoSchedCommonDTO.getFilterPequipDesc())) { query.append(" AND (SELECT c.p_equip_id FROM TAEQUIPMENT c WHERE c.comp_no = x.comp_no AND c.equip_id = x.equip_id) IN "); query.append(" (SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE a.comp_no = x.comp_no "); query.getCodeLikeQuery("a.equip_id", "a.description", maWoSchedCommonDTO.getFilterPequipId(), maWoSchedCommonDTO.getFilterPequipDesc()); query.append(" ) "); } //상위설비사용부서 if(!"".equals(maWoSchedCommonDTO.getFilterPEqUsaDeptId()) || !"".equals(maWoSchedCommonDTO.getFilterPEqUsaDeptDesc())) { query.append(" AND x.equip_id IN "); query.append("(SELECT a.equip_id "); query.append(" FROM TAEQUIPMENT a "); query.append(" WHERE a.comp_no = x.comp_no "); query.append(" AND a.p_equip_id IN (SELECT c.equip_id FROM TAEQUIPMENT c "); query.append(" WHERE c.comp_no = a.comp_no "); query.append(" AND c.usage_dept IN ( SELECT d.dept_id FROM TADEPT d WHERE d.comp_no = c.comp_no "); query.getDeptLevelQuery("d.dept_id", maWoSchedCommonDTO.getFilterPEqUsaDeptId(), maWoSchedCommonDTO.getFilterPEqUsaDeptDesc(), user.getCompNo()); query.append(" ) "); query.append(" ) "); query.append(" ) "); } return query.toString(); } @Override public String findTotalCount(MaWoSchedCommonDTO maWoSchedCommonDTO, User user) { QueryBuffer query = new QueryBuffer(); query.append("SELECT "); query.append(" COUNT(1) "); query.append("FROM TAPMSCHED x INNER JOIN TAPMLST y "); query.append("ON x.comp_no = y.comp_no AND x.pm_id = y.pm_id "); query.append("INNER JOIN TAPMEQUIP yy "); query.append("ON yy.pm_id = y.pm_id AND yy.comp_no = y.comp_no and yy.pmequip_id = x.pmequip_id "); query.append("LEFT OUTER JOIN taworkorder z "); query.append("ON x.comp_no = z.comp_no AND x.wkor_id = z.wkor_id "); query.append("WHERE 1=1 "); query.append(this.getWhere(maWoSchedCommonDTO, user)); List resultList= getJdbcTemplate().queryForList(query.toString()); return QueryBuffer.listToString(resultList); } @Override public int[] updateDeleteTag(final List<MaWoSchedDetailDTO> list, final User user) throws Exception { QueryBuffer query = new QueryBuffer(); final String deleteTime = DateUtil.getTimeStamp(user.getOffset(), "yyyyMMddHHmmss"); query.append("UPDATE TAPMSCHED SET "); query.append(" IS_DELETED = 'Y' "); query.append(" ,DELETE_BY = ? "); query.append(" ,DELETE_TIME = ? "); query.append("WHERE COMP_NO = ? "); query.append(" AND PMSCHED_ID = ? "); query.append(" AND PMSCHED_STATUS != 'C' "); return getJdbcTemplate().batchUpdate(query.toString(), new BatchPreparedStatementSetter() { @Override public int getBatchSize() { return list.size(); } @Override public void setValues(PreparedStatement ps, int i) throws SQLException { MaWoSchedDetailDTO maWoSchedDetailDTO = list.get(i); Object[] objects = new Object[]{ user.getEmpId() ,deleteTime ,user.getCompNo() ,maWoSchedDetailDTO.getPmSchedId() }; for(int j=0;j<objects.length;j++){ ps.setObject(j+1, objects[j]); } } }); } }
[ "HN4741@10.31.0.185" ]
HN4741@10.31.0.185
8b8bb131d26e65145fc5083bc9b3f624859e9c7a
b4c754c465fde53ddc60183265ddaad24ec43c39
/src/main/java/Artists.java
788f7c2a46923df118b38e2b61dc1f9d4eff5b99
[]
no_license
Russspruce/cdOrganizer
6d7451af5553e37ed444b0dbd1df626940e07c5d
2206d8804402790442da3ccfc85096ac29821ed2
refs/heads/master
2021-01-01T05:06:25.868281
2016-04-27T23:54:09
2016-04-27T23:54:09
57,252,657
0
0
null
null
null
null
UTF-8
Java
false
false
184
java
// public class Artists { // private CompactDisk mAlbum; // // public Artists(CompactDisk compactdisk) { // mAlbum = compactdisk; // } // // public String { // // } // }
[ "andrew@" ]
andrew@
448fcfcabd3f70b43d46ce99937bbaf67ee3063f
6a6a5e790b79c77a33b9c3a4d98c8a64bb1af515
/BlogSite/website/src/main/java/com/appmigos/website/dtos/Role.java
e2f210d42ae1291fd07f6c0bdfa667eec5eea2e8
[]
no_license
DougSchmitz/Public-Projects
8ae1ae5e6a3fad2369635bb26b4bd174bd07dbcd
1f1047c86b4fa3d3514dcd9ad945b7e0c77706ef
refs/heads/master
2022-11-22T04:00:56.873177
2020-07-28T15:10:21
2020-07-28T15:10:21
280,463,270
0
0
null
null
null
null
UTF-8
Java
false
false
1,904
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.appmigos.website.dtos; import java.util.Objects; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; /** * * @author Isaia */ public class Role { private int id; @NotBlank(message="Please enter a role") @Size(max=30, message="Role title cannot be more than 30 characters") private String role; public Role(){ } // creation constructor public Role(String role){ this.role = role; } // for testing purposes public Role(int id, String role){ this.id = id; this.role = role; } @Override public int hashCode() { int hash = 5; hash = 29 * hash + this.id; hash = 29 * hash + Objects.hashCode(this.role); return hash; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Role other = (Role) obj; if (this.id != other.id) { return false; } if (!Objects.equals(this.role, other.role)) { return false; } return true; } /** * @return the id */ public int getId() { return id; } /** * @param id the id to set */ public void setId(int id) { this.id = id; } /** * @return the role */ public String getRole() { return role; } /** * @param role the role to set */ public void setRole(String role) { this.role = role; } }
[ "schmitz.doug@gmail.com" ]
schmitz.doug@gmail.com
7873d8ba300d22b298c00bedea0c86d871239be3
f65d8efd8488c3f26ec272067534453916bb433b
/spring-custom-validation/src/main/java/org/woodwhales/validation/demo3/controller/Demo3Controller.java
fc81c5881962795d644df290c7a947acfa8646bd
[ "WTFPL" ]
permissive
woodwhales/woodwhales-study
3c63d08e7aff503484905ea857ba389d5ee972d6
d8b95c559d3223b54211418bce78b9d9d41f9b08
refs/heads/master
2023-03-04T16:04:59.516245
2022-08-21T07:16:20
2022-08-21T07:16:20
184,915,908
2
3
WTFPL
2023-03-01T03:42:52
2019-05-04T16:00:32
Java
UTF-8
Java
false
false
1,064
java
package org.woodwhales.validation.demo3.controller; import java.util.HashMap; import java.util.List; import org.springframework.validation.BindingResult; import org.springframework.validation.ObjectError; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import org.woodwhales.validation.demo3.dto.User; import lombok.extern.slf4j.Slf4j; @Slf4j @RestController public class Demo3Controller { @PostMapping("/demo3/") public Object demo3(@Validated @RequestBody User user, BindingResult bindingResult) { HashMap<String, Object> map = new HashMap<>(); if(bindingResult.hasErrors()) { List<ObjectError> allErrors = bindingResult.getAllErrors(); for (ObjectError objectError : allErrors) { log.debug("errorMessage -> {}", objectError.getDefaultMessage()); } map.put("code", false); return map; } map.put("code", true); return map; } }
[ "woodwhales@163.com" ]
woodwhales@163.com
27c2233898139ed156d85ac5b6a59ca7a5364c47
89a4c0019e89ed04e2674494fe9f6553957b8bee
/groundsdk/src/main/java/com/parrot/drone/groundsdk/value/StringSetting.java
679a63064599970507a8c3a2d4372e956167566c
[]
permissive
isabella232/groundsdk-android
8013f2b22909af5223d3ab8b424430477f67bf1e
33fca10377a90bc26f3470a05dd80fa7cf0c2855
refs/heads/master
2023-04-03T04:24:51.114740
2020-12-11T14:56:19
2020-12-11T14:56:19
353,310,929
0
0
BSD-3-Clause
2021-03-31T10:06:59
2021-03-31T10:06:09
null
UTF-8
Java
false
false
2,142
java
/* * Copyright (C) 2019 Parrot Drones SAS * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of the Parrot Company nor the names * of its contributors may be used to endorse or promote products * derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ package com.parrot.drone.groundsdk.value; import androidx.annotation.NonNull; /** * Represents a setting with a string value. */ public abstract class StringSetting extends Setting { /** * Gets the current value. * * @return the current value */ @NonNull public abstract String getValue(); /** * Sets the current setting value. * * @param value setting value to set */ public abstract void setValue(@NonNull String value); }
[ "mathieu.vinel@parrot.com" ]
mathieu.vinel@parrot.com
49f669ccb14d0732aa81c1d356be560c9e340c61
51ebda360dd00ad7d50b335679f123b2dfedc114
/src/main/java/com/epam/battleship/components/Dimension.java
e252c2195be13a9aa0257a7c91dbdc90e76da110
[]
no_license
scriptmage/battleship
c2775314ea6998930606310103b6c2d3af5cd7e9
64ca57454f05bfd7e61bd31f1c7f7bb341c18614
refs/heads/master
2020-12-31T07:55:29.770285
2015-05-31T15:58:49
2015-05-31T15:58:49
36,401,391
0
0
null
null
null
null
UTF-8
Java
false
false
1,169
java
package com.epam.battleship.components; public class Dimension { private int width; private int height; public Dimension(int width, int height) { setWidth(width); setHeight(height); } public void setWidth(int width) { if (!isValidWidth(width)) { throw new IllegalArgumentException("The width must be between 1 and " + Integer.MAX_VALUE); } this.width = width; } private boolean isValidWidth(int width) { return width > 0 && width <= Integer.MAX_VALUE; } public void setHeight(int height) { if (!isValidHeight(height)) { throw new IllegalArgumentException("The height must be between 1 and " + Integer.MAX_VALUE); } this.height = height; } private boolean isValidHeight(int height) { return isValidWidth(height); } public int getWidth() { return width; } public int getHeight() { return height; } @Override public String toString() { return width + " " + height; } }
[ "gdevbox@gmail.com" ]
gdevbox@gmail.com
9d551da2e4adaf6e0a6d949b9dd826d44fae4fab
deaae7ef67ec8ed86adce5967f634c299c928c17
/ancba-shrio-demo/src/main/java/club/neters/shrio/demo/core/exception/CommonExceptionHandler.java
bf55c030a165abadb591552dd29623f7dc671525
[ "MIT" ]
permissive
DtCoreCommunity/ancba
829724fc5b18dde64bbec290c7025f4c3c3db40f
e9b13b9010cac302b59e468e1c5be5bb4fc1ca3f
refs/heads/master
2023-06-15T23:54:59.531988
2021-07-08T07:08:41
2021-07-08T07:08:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,273
java
package club.neters.shrio.demo.core.exception; import club.neters.shrio.demo.domain.vo.ApiResultVo; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.BindException; import org.springframework.validation.BindingResult; import org.springframework.validation.ObjectError; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; /** * common exception handler * * @author wuare * @date 2021/6/16 */ @Slf4j @ControllerAdvice public class CommonExceptionHandler { /** * <code>@Valid @RequestBody</code>抛出的异常 */ @ExceptionHandler(value = {MethodArgumentNotValidException.class}) @ResponseBody public ApiResultVo<?> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { return handleValidException(e); } /** * <code>@Valid</code>没有@RequestBody时抛出的异常 */ @ExceptionHandler(value = {BindException.class}) @ResponseBody public ApiResultVo<?> handleBindException(BindException e) { return handleValidException(e); } private ApiResultVo<?> handleValidException(BindException e) { log.error("参数绑定异常", e); BindingResult bindingResult = e.getBindingResult(); if (bindingResult.hasErrors()) { List<ObjectError> allErrors = bindingResult.getAllErrors(); return ApiResultVo.error(allErrors.get(0).getDefaultMessage()); } return ApiResultVo.error("参数错误"); } /** * 自定义异常处理 */ @ExceptionHandler(value = {ServiceException.class}) @ResponseBody public ApiResultVo<?> handleServiceException(final ServiceException e) { log.error("未处理Service异常", e); return ApiResultVo.error(e.getMessage()); } /** * 处理异常 */ @ExceptionHandler(value = {Exception.class}) @ResponseBody public ApiResultVo<?> handleException(Exception e) { log.error("未处理异常", e); return ApiResultVo.error("服务异常"); } }
[ "wuareb@gmail.com" ]
wuareb@gmail.com
153879dd9f05dab653f6b0c06ec6e6d21b79434c
d7becd44936c69220d3f20dbf3dff8b869e6b9f4
/app/src/main/java/com/codepath/edurelate/fragments/SearchGroupsFragment.java
5c798318350878411fae36d36dc9d38087970c59
[]
no_license
engrtosin/Edurelate
2eba19a9247768dd2ed3dd1339e6ba99c07f72e1
f0a51500e51a19cd5ab69d004455244334cf7c4a
refs/heads/master
2023-07-03T20:35:43.346833
2021-08-07T18:51:59
2021-08-07T18:51:59
385,401,499
0
0
null
null
null
null
UTF-8
Java
false
false
9,904
java
package com.codepath.edurelate.fragments; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.codepath.edurelate.R; import com.codepath.edurelate.activities.AllGroupsActivity; import com.codepath.edurelate.adapters.GroupsAdapter; import com.codepath.edurelate.adapters.SearchGroupsAdapter; import com.codepath.edurelate.databinding.FragmentSearchGroupsBinding; import com.codepath.edurelate.models.Group; import com.codepath.edurelate.models.Member; import com.codepath.edurelate.models.SearchResult; import com.parse.ParseUser; import org.jetbrains.annotations.NotNull; import org.parceler.Parcels; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class SearchGroupsFragment extends Fragment { public static final String TAG = "SearchGroupsFragment"; FragmentSearchGroupsBinding binding; View rootView; SearchFragInterface mListener; String queryTxt; List<Member> members; List<Group> groupsByName; List<Group> groupsByRank; List<String> requestIds; GroupsAdapter byNameAdapter; GroupsAdapter byRankAdapter; List<Group> resultsByName; List<Group> resultsByRank; // SearchGroupsAdapter groupsAdapter; // SearchGroupsAdapter byRankAdapter; LinearLayoutManager llManager; ArrayAdapter<String> sortAdapter; String[] sortOptions = new String[]{"Name (A-Z)","Name (Z-A)", "Recommended"}; boolean groupsIsReversed = false; /* ------------------- INTERFACE -------------------------- */ public interface SearchFragInterface { void fragmentClosed(); void joinGroup(Group group); void goToGroup(Group group); } public void setFragListener(SearchFragInterface listener) { mListener = listener; } /* ---------------- CONSTRUCTOR -------------------------- */ public SearchGroupsFragment() { // Required empty public constructor } public static SearchGroupsFragment newInstance(List<Group> groupsByName,List<Group> groupsByRank, List<String> requestIds) { SearchGroupsFragment fragment = new SearchGroupsFragment(); Bundle args = new Bundle(); args.putParcelable(AllGroupsActivity.GROUPS_BY_NAME,Parcels.wrap(groupsByName)); args.putParcelable(AllGroupsActivity.GROUPS_BY_RANK,Parcels.wrap(groupsByRank)); args.putParcelable(AllGroupsActivity.REQUEST_IDS,Parcels.wrap(requestIds)); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); queryTxt = ""; if (getArguments() != null) { groupsByName = Parcels.unwrap(getArguments().getParcelable(AllGroupsActivity.GROUPS_BY_NAME)); groupsByRank = Parcels.unwrap(getArguments().getParcelable(AllGroupsActivity.GROUPS_BY_RANK)); requestIds = Parcels.unwrap(getArguments().getParcelable(AllGroupsActivity.REQUEST_IDS)); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { binding = FragmentSearchGroupsBinding.inflate(inflater,container,false); rootView = binding.getRoot(); return rootView; } @Override public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); resultsByName = new ArrayList<>(); resultsByRank = new ArrayList<>(); // groupsAdapter = new SearchGroupsAdapter(getContext(), resultsByName,""); // byRankAdapter = new SearchGroupsAdapter(getContext(), resultsByRank,""); byNameAdapter = new GroupsAdapter(getContext(),resultsByName,requestIds); byRankAdapter = new GroupsAdapter(getContext(),resultsByRank,requestIds); binding.rvSearchItems.setAdapter(byNameAdapter); llManager = new LinearLayoutManager(getContext()); binding.rvSearchItems.setLayoutManager(llManager); setupSortSpinner(); setListeners(); setAdapterListeners(); } /* ------------------- SPINNERS ------------------ */ private void setupSortSpinner() { sortAdapter = new ArrayAdapter<>(getContext(), R.layout.support_simple_spinner_dropdown_item,sortOptions); binding.spSortBy.setAdapter(sortAdapter); binding.spSortBy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { sortItemSelected(position); } @Override public void onNothingSelected(AdapterView<?> parent) { } }); } private void sortItemSelected(int position) { Log.i(TAG,"Sort item selected at " + position); Log.i(TAG,"Position is new"); if (position == 0) { binding.rvSearchItems.setAdapter(byNameAdapter); if (groupsIsReversed) { Log.i(TAG,"Groups is reversed"); Collections.reverse(groupsByName); groupsIsReversed = false; byNameAdapter.notifyDataSetChanged(); } return; } if (position == 1) { binding.rvSearchItems.setAdapter(byNameAdapter); if (!groupsIsReversed) { Log.i(TAG,"Groups is not reversed"); Collections.reverse(groupsByName); groupsIsReversed = true; byNameAdapter.notifyDataSetChanged(); } return; } if (position == 2) { binding.rvSearchItems.setAdapter(byRankAdapter); } } private void setListeners() { binding.etSearchTxt.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER) { startSearch(); return true; } if (actionId == EditorInfo.IME_ACTION_GO) { startSearch(); return true; } return false; } }); binding.ivCancelSearch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mListener.fragmentClosed(); clearAllData(); } }); binding.ivSearchGo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startSearch(); } }); } private void startSearch() { resultsByName.clear(); queryTxt = binding.etSearchTxt.getText().toString(); queryTxt = queryTxt.trim(); binding.etSearchTxt.setText(queryTxt); binding.etSearchTxt.setSelection(queryTxt.length()); if (!queryTxt.isEmpty()) { createResults(); } } private void createResults() { resultsByRank.clear(); resultsByName.clear(); for (int i = 0; i < groupsByName.size(); i++) { Log.i(TAG,i + ": Group: " + groupsByName.get(i).getGroupName()); Group group = groupsByName.get(i); String groupName = group.getGroupName(); if (groupName.toLowerCase().contains(queryTxt.toLowerCase())) { // SearchResult result = new SearchResult(group); resultsByName.add(group); byNameAdapter.notifyItemInserted(resultsByName.size()-1); } group = groupsByRank.get(i); groupName = group.getGroupName(); if (groupName.toLowerCase().contains(queryTxt.toLowerCase())) { // SearchResult result = new SearchResult(group); resultsByRank.add(group); byRankAdapter.notifyItemChanged(resultsByRank.size()-1); } } // groupsAdapter.notifyDataSetChanged(); byNameAdapter.notifyDataSetChanged(); byRankAdapter.notifyDataSetChanged(); } private void clearAllData() { } /* ------------------- SET ADAPTER LISTENERS ------------------ */ private void setAdapterListeners() { byNameAdapter.setAdapterListener(new GroupsAdapter.GroupsAdapterInterface() { @Override public void groupClicked(Group group, View groupPic) { mListener.goToGroup(group); } @Override public void ownerClicked(ParseUser owner) { } @Override public void joinGroup(Group group) { } }); byRankAdapter.setAdapterListener(new GroupsAdapter.GroupsAdapterInterface() { @Override public void groupClicked(Group group, View groupPic) { mListener.goToGroup(group); } @Override public void ownerClicked(ParseUser owner) { } @Override public void joinGroup(Group group) { } }); } }
[ "oluwatosinaj@fb.com" ]
oluwatosinaj@fb.com
e492d7909e881a64d5bfba1063dba637db1a7016
72e9d4a9caf6c18f7aa1b66d9319b87668d5d2c2
/entity-view/impl/src/main/java/com/blazebit/persistence/view/impl/type/CurrencyBasicUserType.java
7ef714a67b8a3625d6d6e8d076419ced243389d3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
imanolache/blaze-persistence
f087355cd179fa21e4ed9f904b711be70365e9c6
41f7b0b45da372ba6c681e2b345b1ecdc1877530
refs/heads/master
2023-08-16T06:16:51.774550
2021-10-10T09:12:51
2021-10-10T09:12:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,277
java
/* * Copyright 2014 - 2021 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.blazebit.persistence.view.impl.type; import com.blazebit.persistence.view.spi.type.BasicUserType; import com.blazebit.persistence.view.spi.type.ImmutableBasicUserType; import java.util.Currency; /** * * @author Christian Beikov * @since 1.6.3 */ public class CurrencyBasicUserType extends ImmutableBasicUserType<Currency> { public static final BasicUserType<Currency> INSTANCE = new CurrencyBasicUserType(); @Override public Currency fromString(CharSequence sequence) { return Currency.getInstance(sequence.toString()); } @Override public String toStringExpression(String expression) { return expression; } }
[ "christian.beikov@gmail.com" ]
christian.beikov@gmail.com
86ceb20126e3f628e3746cc9c5574798002bda76
9e945481781c8c8fd94cdd7d8e10cc452a1b4d44
/src/com/tetng/InvocationCountTest.java
49afdbe177381671ed875738642f2e580ac94e1f
[]
no_license
kavitagpawar/TestNG
1b7c47f040ec775b06213c947ca1611b336c72d8
7a8e4fc9b5ac07a9370d68fb22c06022e8284f3f
refs/heads/master
2023-03-18T11:23:57.805410
2021-03-08T16:34:11
2021-03-08T16:34:11
345,714,036
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package com.tetng; import org.testng.annotations.Test; public class InvocationCountTest { // execute same test for 10 times @Test(invocationCount=3) public void sum() { int a =10; int b =20; int c = a+b; System.out.println("sum is == " + c); } }
[ "gajen@DESKTOP-C2IM9GU.(none)" ]
gajen@DESKTOP-C2IM9GU.(none)
fefc68baa2e84d1f3a5fa491f426ac9e9e1ce04d
be686144f9f83970edf3ff81f273eda9dfba2684
/src/main/java/ejercicios/interpreter_ejercicio3/AbstractExpresion.java
297ef0c727446e16559804597ada614f1895a18e
[]
no_license
recespinoza/PatronesDiseno
37ef820bb09af70aee8a7571fbbf037c4b5ed2c7
880dc9f4b6d254a1861b6f8102298c9168b8604e
refs/heads/master
2022-03-16T22:59:33.247511
2019-11-04T12:40:07
2019-11-04T12:40:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
143
java
package ejercicios.interpreter_ejercicio3; public abstract class AbstractExpresion { public abstract void interpreter(Context context); }
[ "eynar-pari" ]
eynar-pari
a77394bd47bd944860ed66ee04b9983448fc9632
5f09f9ca6e8761c3fa7ceccd1b64f39780f37959
/src/main/java/com/sroy/webserver/filter/post/KeepAlivePostFilter.java
ae1b69f0ce367556f51fedf97c50d914c3478c53
[]
no_license
shamalroy/SimpleWebServer
ebdc014a33264f0a2a2a1041f6f04d56c393a963
811c193c14f02b1ebf100856a5277f2a99c2cf3c
refs/heads/master
2021-09-07T03:37:42.915601
2018-02-16T18:26:21
2018-02-16T18:26:21
121,604,192
0
0
null
null
null
null
UTF-8
Java
false
false
1,333
java
package com.sroy.webserver.filter.post; import com.sroy.webserver.filter.Filter; import com.sroy.webserver.http.HttpRequest; import com.sroy.webserver.utility.Constants; import com.sroy.webserver.utility.Status; import java.net.SocketException; import java.util.logging.Level; import java.util.logging.Logger; /** * Created by shamalroy */ public class KeepAlivePostFilter extends Filter { private static final Logger LOGGER = Logger.getLogger(KeepAlivePostFilter.class.getName()); @Override public void doFilter(HttpRequest httpRequest) { if (httpRequest.getHttpResponse().getResponseContext().getStatus() == Status.HTTP_200) { if (httpRequest.getRequestContext().getRequestHeaders().containsKey(Constants.HTTP_HEADER_CONNECTION) && httpRequest.getRequestContext().getRequestHeaders().get(Constants.HTTP_HEADER_CONNECTION).equalsIgnoreCase(Constants.KEEP_ALIVE)) { httpRequest.getHttpResponse().getResponseContext().addResponseHeader(Constants.HTTP_HEADER_CONNECTION, Constants.KEEP_ALIVE); } } else { try { httpRequest.getSocket().setKeepAlive(false); } catch (SocketException e) { LOGGER.log(Level.SEVERE, "Error updating Keep-Alive status.", e); } } } }
[ "shamal.roy@gmail.com" ]
shamal.roy@gmail.com
0249a8ad8cf2853e686f093e01f9517e1169d2db
5d64f850b5d764ac404db81cc1ea2cbd48f0d7b7
/javaCalisma1/src/javaCalisma2/ornek06_VeriTipler.java
25971111624ff344f5663f2b011c8df2ad26f9c9
[]
no_license
Kdrbyrz/JavaWorks
d52d762cf8af610db7ff583335fe3356e8a5f80f
5b4eefcfab14ce87fbf01b4fec7cdfd10fbaf8ca
refs/heads/master
2020-05-17T20:48:57.134596
2014-12-26T13:07:45
2014-12-26T13:07:45
null
0
0
null
null
null
null
ISO-8859-13
Java
false
false
191
java
package javaCalisma2; public class ornek06_VeriTipler { public static void main(String[] args) { int sayi=1453; System.out.println("Integer tipindeki sayż: "+sayi); } }
[ "boyraz@10.50.13.115" ]
boyraz@10.50.13.115
d2d89f1995efb77425d4d088b24e3af6058169f5
6ec322d187c5d30f8acf40d6ef0dd8ac50d9a1bd
/string_compression/string_compression.java
279b9f1da4c4562b447f8e9b050e95e81963cc80
[ "Apache-2.0" ]
permissive
ggupta2005/Programming-and-Algorithm-Questions
7fe94c2cb555ef59563d3255fe6fa036843709e5
4e21553d40f9cbc104fb1fbe4006a9c59de86f95
refs/heads/master
2020-04-04T07:51:13.585331
2017-11-30T08:22:14
2017-11-30T08:22:14
54,095,432
1
0
null
null
null
null
UTF-8
Java
false
false
6,226
java
/* * This program compresses the string in the following manner:- * string "aaabbbbcccaaa" -> "a3b4c3a3" * string "abcdeeeeeeeee" -> "a1b1c1d1e9" * If the compresses string's length is greater than the original * string, then the program returns the string itself. */ import java.io.*; import java.util.*; public class string_compression { /* * This function compresses a given character string and returns the * compressed string. The time complexity of this function is O(n), * where 'n' is the number of characters in the character string. */ public static String string_compression (String input) { char[] result; char[] ch; int i, count, j, k, len; char[] count_to_str; String result_string; /* * If the character string is null or its length is zero, then * Return null */ if ((input == null) || (input.length() == 0)) { return(null); } /* * Get the character array for the input string */ ch = input.toCharArray(); /* * Get the length of the character array */ len = ch.length; /* * The length of the compressed string can be twice as long the * input string. So allocate a separate memory for the compressed * string */ result = new char[2 * len + 1]; /* * If the string allocation fail, then return null. */ if (result == null) { return(null); } /* * Iterate through the string and do the following:- * Compare the current character with the next character * If both are same, then increment the 'count'. Otherwise * add the current character into the buffer and convert the * 'count' into a string and add the numbered string into the * buffer. */ i = 0; count = 1; j = 0; while (i < (len - 1)) { if (ch[i] == ch[i+1]) { /* * Since the current character and the next character are * same, so increment 'count'. */ ++count; } else { /* * Add the current character into the return buffer */ result[j] = ch[i]; ++j; /* * Convert the 'count' into string */ count_to_str = String.valueOf(count).toCharArray(); /* * Add the numbered string to the return buffer. */ if (count_to_str != null) { k = 0; while (k < count_to_str.length) { result[j] = count_to_str[k]; ++j; ++k; } } /* * Reset count to maintain loop invariance */ count = 1; } /* * Increment the index into the character string */ ++i; } /* * Since we iterated through the second last character in the * string, add the last character and its count to the return * buffer. */ result[j] = ch[i]; ++j; count_to_str = String.valueOf(count).toCharArray(); if (count_to_str != null) { k = 0; while (k < count_to_str.length) { result[j] = count_to_str[k]; ++j; ++k; } } /* * Construct a string from characters within 0 to j */ result_string = new String(result, 0, j); /* * If the length of the input string is less than the return * string, then return the pointer to the input string. */ if (input.length() <= result_string.length()) { return(input); } /* * Return the compressed string */ return(String.valueOf(result_string)); } public static void main (String[] args) { /* * Test 1: Test a string which can be compressed */ String str1 = "aaaabbbcccd"; String expected_str1 = "a4b3c3d1"; String actual_str1 = string_compression(str1); assert true == expected_str1.equals(actual_str1); /* * Test 2: Test a string which has only one character */ String str2 = "aaaaaaaaaa"; String expected_str2 = "a10"; String actual_str2 = string_compression(str2); assert true == expected_str2.equals(actual_str2); /* * Test 3: Test a string for which compression will give * string larger than the original string */ String str3 = "abcde"; String expected_str3 = "abcde"; String actual_str3 = string_compression(str3); assert true == expected_str3.equals(actual_str3); /* * Test 4: Test a string which is null */ String str4 = null; String expected_str4 = null; String actual_str4 = string_compression(str4); assert expected_str4 == actual_str4; /* * Test 5: Test a string which has only one character */ String str5 = "a"; String expected_str5 = "a"; String actual_str5 = string_compression(str5); assert true == expected_str5.equals(actual_str5); /* * Test 6: Test a string whose length is zero */ String str6 = ""; String expected_str6 = null; String actual_str6 = string_compression(str6); assert expected_str6 == actual_str6; /* * Test 7: Test a case in which all characters have same * number of contigous characters */ String str7 = "aaaa....,,,,yyyy////$$$$))))"; String expected_str7 = "a4.4,4y4/4$4)4"; String actual_str7 = string_compression(str7); assert true == expected_str7.equals(actual_str7); } }
[ "ggupta2005@gmail.com" ]
ggupta2005@gmail.com
a539a2909e05a5d14d7bc2a57dfb0625674c78d9
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-iotsoc/src/main/java/com/aliyuncs/iotsoc/model/v20190815/QueryCveListForElfPatchRequest.java
cdd457ecd04ddd68ed69d8094d408281527fa4d6
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
1,660
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.iotsoc.model.v20190815; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.iotsoc.Endpoint; /** * @author auto create * @version */ public class QueryCveListForElfPatchRequest extends RpcAcsRequest<QueryCveListForElfPatchResponse> { private String patchName; public QueryCveListForElfPatchRequest() { super("Iotsoc", "2019-08-15", "QueryCveListForElfPatch", "Iotsoc"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getPatchName() { return this.patchName; } public void setPatchName(String patchName) { this.patchName = patchName; if(patchName != null){ putBodyParameter("PatchName", patchName); } } @Override public Class<QueryCveListForElfPatchResponse> getResponseClass() { return QueryCveListForElfPatchResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
437444ecb95e7b1af8a662b503851c67bf2d6217
3dcd6ad72924dbc6105e053879aad6782b03da5a
/src/main/java/com/dcj/factory/abstractFactory/ModelFactory.java
dbd6ff2675543e5f5e07fc4c3cc9ebcb59052a2f
[ "Apache-2.0" ]
permissive
ChenJiesBucket/designPatterns
ed65f261ac78b0f9f050e90ddbec79026d78772a
2f1bbb0754142453ba01d0d67dab24fc76ac7ade
refs/heads/master
2022-11-26T01:53:59.259609
2020-08-06T01:20:45
2020-08-06T01:20:45
279,183,350
1
0
null
null
null
null
UTF-8
Java
false
false
341
java
package com.dcj.factory.abstractFactory; //继承实现方法 public class ModelFactory extends AbstractFactory{ @Override Food createFood() { return new Bread(); } @Override Vehicle createVehicle() { return new Car(); } @Override Weapon createWeapon() { return new Ak47(); } }
[ "duanchenjie@foxmail.com" ]
duanchenjie@foxmail.com
4444ded82f6e41e5a446f3800bfed8be8b465265
5cfaeebdc7c50ca23ee368fa372d48ed1452dfeb
/xiaodou-mapi/src/main/java/com/xiaodou/server/mapi/enums/ExamType.java
ac259a4b9e4b5cf63d2d039bec27ba788b3bf3a2
[]
no_license
zdhuangelephant/xd_pro
c8c8ff6dfcfb55aead733884909527389e2c8283
5611b036968edfff0b0b4f04f0c36968333b2c3b
refs/heads/master
2022-12-23T16:57:28.306580
2019-12-05T06:05:43
2019-12-05T06:05:43
226,020,526
0
2
null
2022-12-16T02:23:20
2019-12-05T05:06:27
JavaScript
UTF-8
Java
false
false
1,650
java
package com.xiaodou.server.mapi.enums; import java.util.Map; import com.google.common.collect.Maps; public enum ExamType { REAL_PAPER("1", "真题练习", true), CHAPTER_PAPER("4", "章练习答题", false), CHAPTER_BREAKTHROUGH_PAPER( "5", "章总结答题", false), ITEM_BREAKTHROUGH_PAPER("6", "节闯关答题", false), RANDOM_CHALLENGE_PAPER( "7", "随机PK答题", true), FRIEND_CHALLENGE_PAPER("8", "好友挑战答题", true), DAILY_PRACTICE("9", "每日一练答题", true), FINAL_EXAM_PAPER("10", "期末测试答题", true), LEAK_FILLING("11", "查漏补缺答题", true); private ExamType(String code, String name, boolean allCourse) { this._code = code; this._name = name; this._allCourse = allCourse; } private String _code; private String _name; private boolean _allCourse; public boolean isAllCourse() { return _allCourse; } public void setAllCourse(boolean _allCourse) { this._allCourse = _allCourse; } public String getCode() { return _code; } public void setCode(String code) { this._code = code; } public String getName() { return _name; } public void setName(String name) { this._name = name; } private final static Map<String, ExamType> _allExamType = Maps.newHashMap(); private static void init() { for (ExamType exam : ExamType.values()) { if (null == exam) continue; _allExamType.put(exam.getCode(), exam); } } static { init(); } public static ExamType getByCode(String code) { return _allExamType.get(code); } }
[ "zedong.huang@bitmain.com" ]
zedong.huang@bitmain.com
a7ffdbf5348cd4b85caf3e90105fa4fd66e839d0
48be0041df38acac523557f871135751a4501ad3
/backend-ps/src/main/java/net/skhu/domain/Weekly.java
7653c2f07fd05df99987e4d5349abfb0673ae8be
[]
no_license
bom04/SKHU_PS
99b95e8f16ec44a6c497a1856897ee8f79e310b5
e4c5e9f42556b6caf497f077bc44cdff63ed4896
refs/heads/master
2023-01-08T20:52:29.204773
2020-11-09T05:07:06
2020-11-09T05:07:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
903
java
package net.skhu.domain; import java.time.LocalDate; import java.util.List; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @Data @ToString(exclude = { "todos" }) @EqualsAndHashCode(exclude = { "todos" }) @Entity public class Weekly { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) int weeklyId; LocalDate startTime; String detail; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "projectId") Project project; @JsonIgnore @OneToMany(mappedBy = "weekly", fetch = FetchType.LAZY) List<Todo> todos; }
[ "jungea2241@gmail.com" ]
jungea2241@gmail.com
9d5ea45c6de04cf207c7423da2a5b150cc783ca1
b592a9687c9195540dcf6d390b90c64067fffbdf
/Buyers.java
0f47f960726c6d4a00e84d9521743f68f693e4c7
[]
no_license
Brajesh912/Online-shopping-site
682d70f2c6695e3f56a3d4033a523e522f822ea5
86c77d0ce4b806e20df4701933627c7556534de1
refs/heads/master
2022-11-07T09:30:25.173737
2020-06-25T13:45:28
2020-06-25T13:45:28
274,862,808
0
0
null
null
null
null
UTF-8
Java
false
false
3,098
java
package com.myapp.struts; // Generated Apr 25, 2015 10:09:26 AM by Hibernate Tools 3.2.1.GA import java.util.HashSet; import java.util.Set; /** * Buyers generated by hbm2java */ public class Buyers extends org.apache.struts.action.ActionForm implements java.io.Serializable { private String username; private String password; private String name; private String address; private String city; private String state; private Integer pincode; private String email; private Long mobile; private Set confirmations = new HashSet(0); private Set orderses = new HashSet(0); public Buyers() { } public Buyers(String username) { this.username = username; } public Buyers(String username, String password, String name, String address, String city, String state, Integer pincode, String email, Long mobile, Set confirmations, Set orderses) { this.username = username; this.password = password; this.name = name; this.address = address; this.city = city; this.state = state; this.pincode = pincode; this.email = email; this.mobile = mobile; this.confirmations = confirmations; this.orderses = orderses; } public String getUsername() { return this.username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getAddress() { return this.address; } public void setAddress(String address) { this.address = address; } public String getCity() { return this.city; } public void setCity(String city) { this.city = city; } public String getState() { return this.state; } public void setState(String state) { this.state = state; } public Integer getPincode() { return this.pincode; } public void setPincode(Integer pincode) { this.pincode = pincode; } public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } public Long getMobile() { return this.mobile; } public void setMobile(Long mobile) { this.mobile = mobile; } public Set getConfirmations() { return this.confirmations; } public void setConfirmations(Set confirmations) { this.confirmations = confirmations; } public Set getOrderses() { return this.orderses; } public void setOrderses(Set orderses) { this.orderses = orderses; } }
[ "noreply@github.com" ]
Brajesh912.noreply@github.com
4b25e96f57df14e667200712eca43233d45e4b2b
b26dc59a776bfd704aeab02b1680b3fd83b6e733
/HintSizeEditText/app/src/main/java/com/rinfon/view/HintEditText.java
c9c6be3e8e41123ad0ac1237b3d4b57c5498ca20
[]
no_license
rinfon/AndroidUI
77479b9d666fb6ef10f124204d7f3cff2010c7c3
6985c57e066f50e96b9cfc1f35d8cf612ddf563a
refs/heads/master
2021-01-10T22:08:26.607995
2015-06-17T15:48:05
2015-06-17T15:48:05
37,046,731
0
0
null
null
null
null
UTF-8
Java
false
false
1,424
java
package com.rinfon.view; /** * Created by rinfon on 15/6/17. */ import android.content.Context; import android.content.res.TypedArray; import android.text.SpannableString; import android.text.Spanned; import android.text.style.AbsoluteSizeSpan; import android.util.AttributeSet; import android.widget.EditText; import com.rinfon.hintsizetext.R; public class HintEditText extends EditText { public HintEditText(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs, 0); } public HintEditText(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs, defStyleAttr); } public void init(Context context, AttributeSet attrs, int defStyleAttr) { TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.EditTextViewStyle, defStyleAttr, 0); int hintSize = attributes.getDimensionPixelSize(R.styleable.EditTextViewStyle_hintSize, -1); String hint = attributes.getString(R.styleable.EditTextViewStyle_hintText); if (hintSize != -1 && hint != null) { SpannableString text = new SpannableString(hint); AbsoluteSizeSpan abs = new AbsoluteSizeSpan(hintSize, true); text.setSpan(abs, 0, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); this.setHint(new SpannableString(text)); } } }
[ "rinfonchan@gmail.com" ]
rinfonchan@gmail.com
97f9d1177e740bed9f0d487a60adfaeba5d31779
9abaefa6924d180f3304044fad4240ff9a9488a7
/src/main/java/com/fxiaoke/common/reflection/Parameters.java
a653051d80b6021df6cb097d9fc30211dcb7158e
[]
no_license
bee-cloud/character-util
f256aeaee6597e7e672238b226e88cdbe6a72cfd
9539ec8fa0662685896dc23ad3af986756385f03
refs/heads/master
2020-05-20T21:59:40.081258
2017-02-28T10:32:44
2017-02-28T10:32:44
84,533,450
0
0
null
null
null
null
UTF-8
Java
false
false
4,793
java
package com.fxiaoke.common.reflection; import com.github.trace.annotation.RpcParameterToString; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; import lombok.experimental.UtilityClass; import lombok.extern.slf4j.Slf4j; import java.lang.reflect.Array; import java.lang.reflect.Method; import java.util.*; /** * 处理请求参数 * Created by lirui on 2017-02-28 14:25. */ @UtilityClass @Slf4j public class Parameters { private static final Set<String> NAMES = ImmutableSet.of("Boolean", "Character", "Byte", "Short", "Long", "Integer", "Byte", "Float", "Double", "Void", "String"); private static final TimeZone CHINA_ZONE = TimeZone.getTimeZone("GMT+08:00"); private static final Locale CHINA_LOCALE = Locale.CHINA; private static final Object NULL = new Object(); private static final Map<Class, Object> PARAM_CACHES = Maps.newConcurrentMap(); private static final int OBJECT_TO_STRING_LIMIT = 1024; private static final int PRIMITIVE_TO_STRING_LIMIT = 256; /** * 函数参数信息 * * @param args 参数列表 * @return 格式化输出 */ public String toString(Object[] args) { if (args == null) { return ""; } java.lang.StringBuilder sbd = new StringBuilder(); if (args.length > 0) { for (Object i : args) { if (i == null) { sbd.append("null"); } else { Class<?> clz = i.getClass(); if (isPrimitive(clz)) { sbd.append(evalPrimitive(i)); } else if (clz.isArray()) { sbd.append("arr[").append(Array.getLength(i)).append(']'); } else if (Collection.class.isAssignableFrom(clz)) { sbd.append("col[").append(((Collection<?>) i).size()).append(']'); } else if (i instanceof Date) { sbd.append('"').append(formatYmdHis(((Date) i))).append('"'); } else { sbd.append(getObjectToString(clz, i)); } } sbd.append(','); } sbd.setLength(sbd.length() - 1); } return sbd.toString(); } /** * 获取一个类的字符串标识 * * @param clazz 类对象 * @param target 目标对象 * @return */ private String getObjectToString(Class<?> clazz, Object target) { Object m = PARAM_CACHES.get(clazz); if (null == m) { RpcParameterToString annotation = clazz.getAnnotation(RpcParameterToString.class); m = annotation != null ? tryFindTargetMethod(clazz, annotation.value()) : NULL; PARAM_CACHES.putIfAbsent(clazz, m); } if (m != NULL) { try { String s = (String) ((Method) m).invoke(target); if (s.length() > OBJECT_TO_STRING_LIMIT) { s = s.substring(0, OBJECT_TO_STRING_LIMIT) + "..."; } return s; } catch (Exception ignored) { log.error("invoke error", ignored); } } return clazz.getSimpleName() + ":OBJ"; } private Object tryFindTargetMethod(Class<?> clazz, String name) { for (Class<?> clz = clazz; clz != Object.class; clz = clz.getSuperclass()) { try { Method m = clz.getDeclaredMethod(name); m.setAccessible(true); return m; } catch (NoSuchMethodException ignored) { log.error("{} cannot found method: {}", clazz, name); } } log.error("{} cannot found method: {}", clazz, name); return NULL; } private boolean isPrimitive(Class clz) { return clz.isPrimitive() || NAMES.contains(clz.getSimpleName()); } private String evalPrimitive(Object obj) { String s = String.valueOf(obj); if (s.length() > PRIMITIVE_TO_STRING_LIMIT) { return s.substring(0, PRIMITIVE_TO_STRING_LIMIT) + "..."; } return s; } /** * 构造时间的显示,带上时分秒的信息,如 2013-06-11 03:14:25 * * @param date 时间 * @return 字符串表示 */ private String formatYmdHis(Date date) { Calendar ca = Calendar.getInstance(CHINA_ZONE, CHINA_LOCALE); ca.setTimeInMillis(date.getTime()); StringBuilder sbd = new StringBuilder(); sbd.append(ca.get(Calendar.YEAR)).append('-'); int month = 1 + ca.get(Calendar.MONTH); if (month < 10) { sbd.append('0'); } sbd.append(month).append('-'); int day = ca.get(Calendar.DAY_OF_MONTH); if (day < 10) { sbd.append('0'); } sbd.append(day).append(' '); int hour = ca.get(Calendar.HOUR_OF_DAY); if (hour < 10) { sbd.append('0'); } sbd.append(hour).append(':'); int minute = ca.get(Calendar.MINUTE); if (minute < 10) { sbd.append('0'); } sbd.append(minute).append(':'); int second = ca.get(Calendar.SECOND); if (second < 10) { sbd.append('0'); } sbd.append(second); return sbd.toString(); } }
[ "lir@fxiaoke.com" ]
lir@fxiaoke.com
31398530bc5eb98721b53a77d0f893e094540293
92fc60b356d60b51b60e4bc62e09b70ffd165e73
/Topics/Topic_0/exercise1/singletonExample.java
114710af46c652384dc9a30fe79f600179c526bc
[ "Apache-2.0" ]
permissive
diesazul96/java-bootcamp-2016
419c83639a963e18f048ccdd3eb1399e2b01dd74
f0272966c4162eee85dd33626944e35d85dd1030
refs/heads/master
2020-12-25T06:32:37.523307
2016-03-04T03:16:18
2016-03-04T03:16:18
52,326,019
0
0
null
2016-02-24T16:43:26
2016-02-23T03:14:32
null
UTF-8
Java
false
false
720
java
public class singletonExample { //This variable is Static to be used by any instance of this class private static SingletonExample singletontest = null; //The constructor is private to avoid other classes to use it private SingletonExample() { } //This method will create a new instance of the class //if there's no one, and if there's an instance this //one will be returned public static SingletonExample getInstance() { if (singletontest == null) { singletontest = new SingletonExample(); } return singletonExample; } //This method sends a message to simulate the conection to a DB public void saySomething() { System.out.println("Sucessfull Conection"); } }
[ "diesazul96@hotmail.com" ]
diesazul96@hotmail.com
f601dbc15f01cff38e656545cdbbfb23056b3957
e408b2cb5e28832a0bd905a367097bd902fce760
/EcommerceShop/src/main/java/io/github/thang86/common/LineChartData.java
574fd4dc0ff1a20145a6a42b366d498a619fb989
[]
no_license
thangtx86/EcommerceShop-SpringBoot
4159390c43d0fbe5fa658b93a16beb677cd615e8
49b894bb50330a500477363abca7670478519ac0
refs/heads/master
2021-11-30T06:36:07.691417
2019-01-18T11:31:45
2019-01-18T11:31:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,105
java
package io.github.thang86.common; import java.util.List; /** * LineChartData.java * * Version 1.0 * * Copyright * * Modification Logs: * DATE AUTHOR DESCRIPTION * ------------------------------------- * 2018-12-12 ThangTX Create */ public class LineChartData { List<Integer> data; String label; String borderColor; Boolean fill; public LineChartData(List<Integer> data, String label, String borderColor, Boolean fill) { this.data = data; this.label = label; this.borderColor = borderColor; this.fill = fill; } public List<Integer> getData() { return data; } public void setData(List<Integer> data) { this.data = data; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public String getBorderColor() { return borderColor; } public void setBorderColor(String borderColor) { this.borderColor = borderColor; } public Boolean getFill() { return fill; } public void setFill(Boolean fill) { this.fill = fill; } }
[ "tranthang8696@gmail.com" ]
tranthang8696@gmail.com
9c43790a12b3c9f2b0b259a7e9a0fe560103f651
866472fe68696c141bf2fb8c830e8e91ad5fe4ba
/jpa-utils-core/src/main/java/com/zoowii/jpa_utils/annotations/QuerySqls.java
f05f5886236c8ce04c6bcc345f62fbe3ff71ccb2
[ "MIT" ]
permissive
zoowii/jpa-utils
07b1b095585d46cec83f63a8d2b0184d79a4791a
dcfe7838f3ad4c1ff752f0ee34678e8b4682d826
refs/heads/master
2020-04-05T02:00:34.538709
2018-06-01T02:02:00
2018-06-01T02:02:00
22,515,258
7
1
null
null
null
null
UTF-8
Java
false
false
422
java
package com.zoowii.jpa_utils.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Created by zoowii on 2015/8/17. */ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface QuerySqls { QuerySql[] rawQueries() default {}; QuerySql[] queries() default {}; }
[ "1992zhouwei@gmail.com" ]
1992zhouwei@gmail.com
9274c608918a92066e3246619da338f801aaae99
0b9629533f2d3c327f8e222ea25fe788ef3d802d
/src/test/java/com/microsoft/azure/functions/worker/broker/tests/TestCustomBinding.java
0113731ec1c01f63cc2e8b9fc434f34fd7198f9e
[ "MIT" ]
permissive
Azure/azure-functions-java-worker
8f1f214e975c26cc88961341e12cf18c67ac5bed
dc9dead3d3689cae14bf4ea054f7cdc890534871
refs/heads/dev
2023-09-04T00:35:44.133349
2023-08-22T16:25:30
2023-08-22T16:25:30
90,009,576
88
54
MIT
2023-09-14T17:36:23
2017-05-02T08:29:46
Java
UTF-8
Java
false
false
516
java
package com.microsoft.azure.functions.worker.broker.tests; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.ElementType; import com.microsoft.azure.functions.annotation.CustomBinding; @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) @CustomBinding(direction = "in", name = "", type = "customBinding") public @interface TestCustomBinding { String index(); String path(); String name(); }
[ "noreply@github.com" ]
Azure.noreply@github.com
639a6ccda9a1a42afaeb5ee29ff85b17e48453f8
fd496577c309442d105f1a1c6c3b6b2f1d0e938c
/M8_Rockets/src/com/application/Utilities.java
f45b258423066108f3f8f9b452505bec208b3bc7
[]
no_license
Exercises-BCN-Activa/M8_Rockets
6a00fb6e1945f1d2466860208f394cc9dc6aeb84
298a893a4428ef63f0a8591216f8f0b0f8ded960
refs/heads/master
2022-12-23T20:53:29.278259
2020-09-23T12:19:09
2020-09-23T12:19:09
296,345,525
0
0
null
2020-09-23T12:19:11
2020-09-17T14:07:42
Java
UTF-8
Java
false
false
1,410
java
package com.application; import javax.swing.JOptionPane; final class Utilities { Utilities() {} /** * Method that invokes JOptionPane Class to jump a window * asking the user to enter information and return a string. * This method does not allow the user to enter an empty input. * * @param msg that tells the user what to insert * @param option that define which regex will be used * to check user input (0 = Rocket Code | 1 = Amount of Propellant | 2 = Max Power) * @return string upper case */ public static String input3cases(String msg, int option) { String userInput = "", msgError, regexCase; switch (option) { case 0: regexCase = "(?=^.{8,8}$)(?=.*\\d)(?=.*\\w).*$"; msgError = "\neight alphanumeric characters"; break; case 1: regexCase = "[1-9]{1}[0-9]*"; msgError = "\ninteger number, at least one"; break; case 2: regexCase = "[1-9]{1}[0-9]*"; msgError = "\nvalue greater than one"; break; default: regexCase = "[A-zÀ-ÿ]*"; msgError = "\nonly letters"; break; } try { while (!userInput.matches(regexCase)) { userInput = JOptionPane.showInputDialog(msg) .trim().toUpperCase(); if (!userInput.matches(regexCase)) { msg=msg+msgError; } } } catch (Exception e) { System.out.println("Inputing canceled by user"); userInput = "NulL"; } return userInput; } }
[ "prof.guazina@gmail.com" ]
prof.guazina@gmail.com
519b8d7cb3798de6af4205d00ec2146fba59193a
79095b9361e1a3247ea666b7d4d184f154f2d6ea
/src/main/java/com/iboarding/demo/repository/RegistrationRepository.java
f31d6e3937793dfb65aa115e5e204627ab9dd874
[]
no_license
yasasvy/project-backend-
7a3382b4d5dd9370b335be8936eeb07c1e24b201
ca91088fa9118b79d8fe6fe18489ebe779909db4
refs/heads/main
2023-08-14T14:26:17.231783
2021-10-18T03:28:13
2021-10-18T03:28:13
418,330,091
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.iboarding.demo.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.iboarding.demo.model.User; public interface RegistrationRepository extends JpaRepository<User, Integer> { public User findByEmailId(String email); public User findByEmailIdAndPassword(String email, String password); }
[ "guntur.yasasvy@gmail.com" ]
guntur.yasasvy@gmail.com
41fa26c94d6687e3e15d20c433fd7b14f2c46458
4247c98a05329f19fd2fdc3dd9d954299a4ec926
/JAVA_Project/src/GameObject/Book.java
12b5d9be9dcd34cb09ddb93cac7dfda7dd9ace77
[]
no_license
jeongsuly/JAVA_project
de63a47da8df18f3b437bf256e828978c4f77348
dd4587728f82b76580990be0dfc990dba2a05794
refs/heads/master
2021-08-24T16:00:32.933812
2017-12-10T09:43:25
2017-12-10T09:43:25
113,679,018
0
0
null
null
null
null
UHC
Java
false
false
1,138
java
package GameObject; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.util.ArrayList; import Manager.Content; import TileMap.TileMap; public class Book extends GameObject { private BufferedImage[] sprites; //애니메이션구현을위한 sprites 선언 private ArrayList<int[]> tileChanges; //Book의 애니메이션을 Arraylist로 구현하기위해 선언 public Book(TileMap tm) { //16*16이미지를 배열을 통해 반복하여 애니메이션을 구현하도록 초기화 super(tm); width = 16; height = 16; sprites = Content.BOOK[0]; animation.setFrames(sprites); animation.setDelay(7); tileChanges = new ArrayList<int[]>(); } public ArrayList<int[]> getChanges() { return tileChanges; //tileChanges의 Get메소드 } public void addChange(int[] i) { tileChanges.add(i); //Pencil을 들고 있을때 Space키를 사용하여 Book을 획득하는 구현 } public void update() { animation.update(); //애니메이션 구동 } public void draw(Graphics2D g) { super.draw(g); //화면에 뿌리는 draw } }
[ "user1@DESKTOP-0ONFKAR" ]
user1@DESKTOP-0ONFKAR
25416a5481ae03da4f7dd16c444ce805650be07a
65174fb3109a6950829215c0bbddbef5f01b5ce3
/AlgorithmAndDataStruct/src/main/java/org/bobo/algorithm/sort/select/HeapSort.java
1e4d2c4699d04f9bb1e15afd63eb49401377bc72
[]
no_license
KiraYamto/springcloudTest
fb33f1a5be0a8b56183cef5bda38b104e472a4be
cb76e39ef252cf38aa16505c92c5406a1ecf168b
refs/heads/master
2021-06-30T16:38:53.885860
2019-05-09T08:50:22
2019-05-09T08:50:22
147,446,404
0
0
null
null
null
null
UTF-8
Java
false
false
1,685
java
package org.bobo.algorithm.sort.select; import org.bobo.algorithm.sort.BaseSort; /** * @author tian.xubo * @created 2019 - 05 - 06 10:09 */ public class HeapSort extends BaseSort { public HeapSort(int[] array) { super(array); } @Override public void sort() { buildInitMaxHeap(); for(int i = 0;i < array.length ;i++){ int heapSize = array.length - i - 1; swap(0,heapSize); heapAdjust(0,heapSize); } } public void buildInitMaxHeap(){ for(int i = array.length/2 - 1;i >= 0 ;i--){ heapAdjust(i,array.length); } System.out.println("build max heap is:"); printArray(); } public void heapAdjust(int adjIndex,int length){ if(array == null){ return; } if(array.length == 1){ return; } int leftChildIndex = 2 * adjIndex + 1; int rightChildIndex = 2 * adjIndex + 2; int maxIndex = adjIndex; if(leftChildIndex < length && array[maxIndex] < array[leftChildIndex]){ maxIndex = leftChildIndex; } if(rightChildIndex < length && array[maxIndex] < array[rightChildIndex]){ maxIndex = rightChildIndex; } if(adjIndex != maxIndex){ swap(adjIndex,maxIndex); heapAdjust(maxIndex,length); } } public static void main(String[] args) { int length = 10; int[] tmparr = HeapSort.generalArray(length); HeapSort heapSort = new HeapSort(tmparr); heapSort.sort(); System.out.println("sorted array :"); heapSort.printArray(); } }
[ "kiratianyi@hotmail.com" ]
kiratianyi@hotmail.com
e543084f182d2b805b2de6044280b6d52120bddd
36e98b00de5457f8dcbaa290c1924f8993819475
/src/main/java/com/denuncias/config/HerokuDatabaseConfiguration.java
0b0df96d2723412690469bb41c69934dbe9c07d5
[]
no_license
juanultimate/denuncias
20117c4992033c58e470d76500489db5a7455888
5d04b4c6ef6a9d08d15e1b48b9468db12344523e
refs/heads/master
2020-04-06T03:34:03.533339
2016-09-13T12:41:12
2016-09-13T12:41:12
52,638,211
0
1
null
2016-09-13T12:41:24
2016-02-26T22:58:44
JavaScript
UTF-8
Java
false
false
1,864
java
package com.denuncias.config; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.context.ApplicationContextException; import org.springframework.context.annotation.*; import javax.sql.DataSource; @Configuration @Profile(Constants.SPRING_PROFILE_HEROKU) public class HerokuDatabaseConfiguration { private final Logger log = LoggerFactory.getLogger(HerokuDatabaseConfiguration.class); @Bean public DataSource dataSource(DataSourceProperties dataSourceProperties, JHipsterProperties jHipsterProperties) { log.debug("Configuring Heroku Datasource"); String herokuUrl = System.getenv("JDBC_DATABASE_URL"); if (herokuUrl != null) { HikariConfig config = new HikariConfig(); //MySQL optimizations, see https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration if ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource".equals(dataSourceProperties.getDriverClassName())) { config.addDataSourceProperty("cachePrepStmts", jHipsterProperties.getDatasource().isCachePrepStmts()); config.addDataSourceProperty("prepStmtCacheSize", jHipsterProperties.getDatasource().getPrepStmtCacheSize()); config.addDataSourceProperty("prepStmtCacheSqlLimit", jHipsterProperties.getDatasource().getPrepStmtCacheSqlLimit()); } config.setDataSourceClassName(dataSourceProperties.getDriverClassName()); config.addDataSourceProperty("url", herokuUrl); return new HikariDataSource(config); } else { throw new ApplicationContextException("Heroku database URL is not configured, you must set $JDBC_DATABASE_URL"); } } }
[ "juanultimate@hotmail.com" ]
juanultimate@hotmail.com
52b1a277aac3f6076438c0e965942a113a093c8d
ca5312b6c2c4bcf8a1382ded9c8e380f0df49388
/NumberFunDemo/src/Factorial.java
6beb8f6bf2bb3b0437643d74b8ae65f630faaa7f
[]
no_license
Shradha3394/NumberFun
40a37c0c458e86ac0a270370f45e5b0072d8aa2e
b862e899e2669762a01b3d2b33b15eca4801006d
refs/heads/master
2021-01-25T10:34:21.623366
2014-07-13T18:14:59
2014-07-13T18:14:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,993
java
import java.awt.Color; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author sashu */ public class Factorial extends javax.swing.JFrame { /** * Creates new form Factorial */ public Factorial() { initComponents(); this.jLabel2.setVisible(false); this.getContentPane().setBackground(Color.PINK); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setFont(new java.awt.Font("SansSerif", 1, 14)); // NOI18N jLabel1.setText("enter a number"); jButton1.setText("Factorial"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jLabel2.setText("jLabel2"); jButton2.setText("Main Menu"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("Exit"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(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) .addGroup(layout.createSequentialGroup() .addGap(139, 139, 139) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(63, 63, 63) .addComponent(jLabel2)) .addGroup(layout.createSequentialGroup() .addGap(39, 39, 39) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addContainerGap(110, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(45, 45, 45) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(34, 34, 34) .addComponent(jButton1) .addGap(40, 40, 40) .addComponent(jLabel2) .addGap(36, 36, 36) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton2) .addComponent(jButton3)) .addContainerGap(64, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed try{ int a=Integer.parseInt(this.jTextField1.getText()) ; int f=1; for (int i=1;i<=a;i++) { f=f*i; } this.jLabel2.setText("Double of the number is ="+Integer.toString(f)); } catch(Exception e) { this.jLabel2.setText("incorrect input"); } this.jLabel2.setVisible(true); // TODO add your handling code here: }//GEN-LAST:event_jButton1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed this.setVisible(false); NumberFun f=new NumberFun(); f.setVisible(true); f.getContentPane().setBackground(Color.PINK); // TODO add your handling code here: }//GEN-LAST:event_jButton2ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed System.exit(0); // TODO add your handling code here: }//GEN-LAST:event_jButton3ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Factorial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Factorial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Factorial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Factorial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Factorial().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JTextField jTextField1; // End of variables declaration//GEN-END:variables }
[ "shradha3394@gmail.com" ]
shradha3394@gmail.com
556e997c21b05897b87332943b8999bb3f5d9b22
6db762a149ab58cf199af4e05ac24dbecfd800ff
/src/main/java/cn/focus/qademo/util/WordSeg.java
507a39400339c148f6467aa3a1eb4369a0905779
[]
no_license
androidzhaoxiaogang/qademo
45b20dc3e1ed964069433b8b2a63fbecb75ad252
0755d8108cc2f75c97c8c6787f658b94fe201743
refs/heads/master
2020-07-11T11:47:11.308902
2014-09-12T16:53:56
2014-09-12T16:53:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,802
java
package cn.focus.qademo.util; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import org.ansj.domain.Term; import org.ansj.splitWord.analysis.ToAnalysis; import org.ansj.util.FilterModifWord; public class WordSeg { static { initStopWordsAndStopNatures(); } public static ArrayList<String> parse(String str) { List<Term> parse = ToAnalysis.parse(str); List<Term> terms = FilterModifWord.modifResult(parse); ArrayList<String> words = new ArrayList<String>(); for (Term t : terms) { if (t.getNatureStr() != null) { words.add(t.getName()); } } return words; } public static void initStopWordsAndStopNatures() { List<String> stopWord = new ArrayList<String>(); System.out.println("init stopwords and natures"); // 停词表 String stopWordFile = "temp/stopword.txt"; BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(stopWordFile), "UTF-8")); String line = reader.readLine(); while ((line = reader.readLine()) != null) { stopWord.add(line); } } catch (Exception e) { System.out.println("创建停词表失败"); e.printStackTrace(); } finally { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } FilterModifWord.insertStopWords(stopWord); stopWord.clear(); System.out.println("init stopwords and natures success!!"); } }
[ "724382029@qq.com" ]
724382029@qq.com
6bcc263b31e97be31c6efa7a5021a985c5daf3a3
8a529c7404879a075cf7386ebd5cffbd1dcb40db
/app/src/main/java/com/ndtlg/dzb/item/Banner.java
a25c2718f99ffab7394a81df25e4fd958ac5f9d9
[]
no_license
phx1314/Dzb
25e444da984ed62390f83705bed902000097d33f
3894154a1d2e36a5a3a50b453913fcbb018c20de
refs/heads/master
2020-08-27T02:44:36.485219
2019-10-24T05:50:44
2019-10-24T05:50:44
217,220,474
0
0
null
null
null
null
UTF-8
Java
false
false
1,427
java
// // Banner // // Created by DELL on 2018-01-05 11:03:20 // Copyright (c) DELL All rights reserved. /** */ package com.ndtlg.dzb.item; import android.annotation.SuppressLint; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.bean.fx.proto.MIndex; import com.mdx.framework.widget.MImageView; import com.ndtlg.dzb.R; public class Banner extends BaseItem { public MImageView mImageView; @SuppressLint("InflateParams") public static View getView(Context context, ViewGroup parent) { LayoutInflater flater = LayoutInflater.from(context); View convertView = flater.inflate(R.layout.item_banner, null); convertView.setTag(new Banner(convertView)); return convertView; } public Banner(View view) { this.contentview = view; this.context = contentview.getContext(); initView(); } private void initView() { this.contentview.setTag(this); findVMethod(); } private void findVMethod() { mImageView = (MImageView) contentview.findViewById(R.id.mImageView); } public void set(MIndex.MImg item) { // new AbImageLoader(context).display(mImageView, item.img); mImageView.setObj(item.img); // mImageView.setObj("http://czww.viphk.ngrok.org/download/6a14f277bca84bcbbe106ee4a50ec154"); } }
[ "1163096519@qq.com" ]
1163096519@qq.com
612e6ae9d78e82175427e95864f4bda3a516d7bd
cba7355f66a247ac75e1fe1d870e34635afd2210
/com/owen/masters/eventapi/EventManager.java
aadaf93c913f95d9b74436dc319e0275d935c20c
[]
no_license
TaxPvP/Masters
00121b7792020aa0f5b254805c86d53d965ce831
d933a3cf1cb2bcfef8e4a74631122e70b05a7bf3
refs/heads/master
2021-01-17T16:48:09.331776
2016-05-31T22:21:06
2016-05-31T22:21:06
60,127,358
0
0
null
null
null
null
UTF-8
Java
false
false
3,830
java
package com.owen.masters.eventapi; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; import com.owen.masters.eventapi.callable.Event; public final class EventManager { private static final Map<Class<? extends Event>, List<MethodData>> REGISTRY_MAP = new HashMap<Class<? extends Event>, List<MethodData>>(); private EventManager() { } public static void listen(Object object) { for (final Method method : object.getClass().getDeclaredMethods()) { if (isMethodBad(method)) { continue; } listen(method, object); } } public static void listen(Object object, Class<? extends Event> eventClass) { for (final Method method : object.getClass().getDeclaredMethods()) { if (isMethodBad(method)) { continue; } listen(method, object); } } public static void flush(Object object) { for (final List<MethodData> dataList : REGISTRY_MAP.values()) { for (final MethodData data : dataList) { if (data.getSource().equals(object)) { dataList.remove(data); } } } cleanMap(true); } public static void flush(Object object, Class<? extends Event> eventClass) { if (REGISTRY_MAP.containsKey(eventClass)) { for (final MethodData data : REGISTRY_MAP.get(eventClass)) { if (data.getSource().equals(object)) { REGISTRY_MAP.get(eventClass).remove(data); } } cleanMap(true); } } private static void listen(Method method, Object object) { Class<? extends Event> indexClass = (Class<? extends Event>) method .getParameterTypes()[0]; final MethodData data = new MethodData(object, method); if (!data.getTarget().isAccessible()) { data.getTarget().setAccessible(true); } if (REGISTRY_MAP.containsKey(indexClass)) { if (!REGISTRY_MAP.get(indexClass).contains(data)) { REGISTRY_MAP.get(indexClass).add(data); } } else { REGISTRY_MAP.put(indexClass, new CopyOnWriteArrayList<MethodData>() { private static final long serialVersionUID = 666L; { add(data); } }); } } public static void removeEntry(Class<? extends Event> indexClass) { Iterator<Map.Entry<Class<? extends Event>, List<MethodData>>> mapIterator = REGISTRY_MAP .entrySet().iterator(); while (mapIterator.hasNext()) { if (mapIterator.next().getKey().equals(indexClass)) { mapIterator.remove(); break; } } } public static void cleanMap(boolean onlyEmptyEntries) { Iterator<Map.Entry<Class<? extends Event>, List<MethodData>>> mapIterator = REGISTRY_MAP .entrySet().iterator(); while (mapIterator.hasNext()) { if (!onlyEmptyEntries || mapIterator.next().getValue().isEmpty()) { mapIterator.remove(); } } } private static boolean isMethodBad(Method method) { return method.getParameterTypes().length != 1 || !method.isAnnotationPresent(Subscriber.class); } public static final Event call(final Event event) { List<MethodData> dataList = REGISTRY_MAP.get(event.getClass()); if (dataList != null) { for (final MethodData data : dataList) { invoke(data, event); } } return event; } private static void invoke(MethodData data, Event argument) { try { data.getTarget().invoke(data.getSource(), argument); } catch (IllegalAccessException e) { } catch (IllegalArgumentException e) { } catch (InvocationTargetException e) { } } private static final class MethodData { private final Object source; private final Method target; public MethodData(Object source, Method target) { this.source = source; this.target = target; } public Object getSource() { return source; } public Method getTarget() { return target; } } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
00ef2f2947b6ddc1476024f94f2adb271143f3f1
51121d23b70b953930b2261aa2c0880dfc22a29e
/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-registration/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/registration/IntegrationServiceDescription.java
1cf44d8deb5576693df38828049fdbe2bb12c742
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
xrokrx/egeria
53bea28f55eaadc8bd9b945f2d4f28a538392f94
3b636d0a6d5ed13dcce27c83aaecf5c1066bdec4
refs/heads/master
2023-06-11T18:58:33.077765
2021-07-02T11:17:08
2021-07-02T11:17:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,499
java
/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.governanceservers.integrationdaemonservices.registration; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; import java.io.Serializable; /** * IntegrationServiceDescription provides a list of registered integration services. */ public enum IntegrationServiceDescription implements Serializable { CATALOG_INTEGRATOR_OMIS(4000, "Catalog Integrator", "Catalog Integrator OMIS", "catalog-integrator", "Exchange metadata with third party data catalogs.", "https://egeria.odpi.org/open-metadata-implementation/integration-services/catalog-integrator/", "Asset Manager OMAS", PermittedSynchronization.BOTH_DIRECTIONS), API_INTEGRATOR_OMIS(4001, "API Integrator", "API Integrator OMIS", "api-integrator", "Exchange metadata with third party API Gateways.", "https://egeria.odpi.org/open-metadata-implementation/integration-services/api-integrator/", "Data Manager OMAS", PermittedSynchronization.BOTH_DIRECTIONS), TOPIC_INTEGRATOR_OMIS(4002, "Topic Integrator", "Topic Integrator OMIS", "topic-integrator", "Exchange metadata with third party event-based brokers.", "https://egeria.odpi.org/open-metadata-implementation/integration-services/topic-integrator/", "Data Manager OMAS", PermittedSynchronization.BOTH_DIRECTIONS), DATABASE_INTEGRATOR_OMIS (4004, "Database Integrator", "Database Integrator OMIS", "database-integrator", "Extract metadata such as schema, tables and columns from database managers.", "https://egeria.odpi.org/open-metadata-implementation/integration-services/database-integrator/", "Data Manager OMAS", PermittedSynchronization.FROM_THIRD_PARTY), FILES_INTEGRATOR_OMIS(4005, "Files Integrator", "Files Integrator OMIS", "files-integrator", "Extract metadata about files stored in a file system or file manager.", "https://egeria.odpi.org/open-metadata-implementation/integration-services/files-integrator/", "Data Manager OMAS", PermittedSynchronization.FROM_THIRD_PARTY), LINEAGE_INTEGRATOR_OMIS(4006, "Lineage Integrator", "Lineage Integrator OMIS", "lineage-integrator", "Manage capture of lineage from a third party tool.", "https://egeria.odpi.org/open-metadata-implementation/integration-services/lineage-integrator/", "Asset Manager OMAS", PermittedSynchronization.FROM_THIRD_PARTY), ORGANIZATION_INTEGRATOR_OMIS (4007, "Organization Integrator", "Organization Integrator OMIS", "organization-integrator", "Load information about the teams and people in an organization and return collaboration activity.", "https://egeria.odpi.org/open-metadata-implementation/integration-services/organization-integrator/", "Community Profile OMAS", PermittedSynchronization.FROM_THIRD_PARTY), SECURITY_INTEGRATOR_OMIS(4008, "Security Integrator", "Security Integrator OMIS", "security-integrator", "Distribute security properties to security enforcement points.", "https://egeria.odpi.org/open-metadata-implementation/integration-services/security-integrator/", "Security Manager OMAS", PermittedSynchronization.TO_THIRD_PARTY), ; private static final long serialVersionUID = 1L; private int integrationServiceCode; private String integrationServiceName; private String integrationServiceFullName; private String integrationServiceURLMarker; private String integrationServiceDescription; private String integrationServiceWiki; private String integrationServicePartnerOMAS; private PermittedSynchronization defaultPermittedSynchronization; /** * Default Constructor * * @param integrationServiceCode ordinal for this integration service * @param integrationServiceName symbolic name for this integration service * @param integrationServiceFullName full name for this integration service * @param integrationServiceURLMarker string used in URLs * @param integrationServiceDescription short description for this integration service * @param integrationServiceWiki wiki page for the integration service for this integration service * @param integrationServicePartnerOMAS name of the OMAS that is partnered with this integration service */ IntegrationServiceDescription(int integrationServiceCode, String integrationServiceName, String integrationServiceFullName, String integrationServiceURLMarker, String integrationServiceDescription, String integrationServiceWiki, String integrationServicePartnerOMAS, PermittedSynchronization defaultPermittedSynchronization) { /* * Save the values supplied */ this.integrationServiceCode = integrationServiceCode; this.integrationServiceName = integrationServiceName; this.integrationServiceFullName = integrationServiceFullName; this.integrationServiceURLMarker = integrationServiceURLMarker; this.integrationServiceDescription = integrationServiceDescription; this.integrationServiceWiki = integrationServiceWiki; this.integrationServicePartnerOMAS = integrationServicePartnerOMAS; this.defaultPermittedSynchronization = defaultPermittedSynchronization; } /** * Return the code for this enum instance * * @return int type code */ public int getIntegrationServiceCode() { return integrationServiceCode; } /** * Return the default name for this enum instance. * * @return String default name */ public String getIntegrationServiceName() { return integrationServiceName; } /** * Return the formal name for this enum instance. * * @return String default name */ public String getIntegrationServiceFullName() { return integrationServiceFullName; } /** * Return the string that appears in the REST API URL that identifies the owning service. * * @return String default URL marker */ public String getIntegrationServiceURLMarker() { return integrationServiceURLMarker; } /** * Return the default description for the type for this enum instance. * * @return String default description */ public String getIntegrationServiceDescription() { return integrationServiceDescription; } /** * Return the URL for the wiki page describing this integration service. * * @return String URL name for the wiki page */ public String getIntegrationServiceWiki() { return integrationServiceWiki; } /** * Return the full name of the Open Metadata Access Service (OMAS) that this integration service is partnered with. * * @return Full name of OMAS */ public String getIntegrationServicePartnerOMAS() { return integrationServicePartnerOMAS; } /** * Return the default value for permitted synchronization that should be set up for the integration connectors * as they are configured. * * @return enum default */ public PermittedSynchronization getDefaultPermittedSynchronization() { return defaultPermittedSynchronization; } }
[ "mandy_chessell@uk.ibm.com" ]
mandy_chessell@uk.ibm.com
6b5c30e08aa05a318b6141d6d269541b43136c96
1385cc60c565aec57293bbbe5086aa837aa33618
/uebungsfolien/felder-matrix/FelderMatrixA.java
b113836750f7026c000059b4a7387a90fd61e2f5
[]
no_license
albertmink/am_nw
0b2229443fc9b39b5b6fc218fa041d2d90e920f1
6ace1a8a3eaa2a432127fbd2307d2dbc9b9c5ca6
refs/heads/master
2021-06-08T08:15:59.741191
2020-01-07T15:03:08
2020-01-07T15:03:08
153,626,861
0
0
null
null
null
null
UTF-8
Java
false
false
514
java
// Author: A. Mink, Nov.2017, multidimensional arrays import java.util.Arrays; public class FelderMatrix{ public static double[][] getIdentity() { // row major, [m][n] -> m-row and n-column return new double[][]{{1,0,0},{0,1,0},{0,0,1}}; } public static double[] getTrace(double[][] A) { return new double[]{A[0][0],A[1][1],A[2][2]}; } public static void printMatrix(double[][] A) { for ( int m = 0; m < A.length; m++ ) { System.out.println(Arrays.toString(A[m])); } } ... }
[ "38354196+albertmink@users.noreply.github.com" ]
38354196+albertmink@users.noreply.github.com
8fdbf576b44ed0f09b92ae1a74eb78b486cf49fc
92e79f38a66d0875d2b611a6b518ecfcc167dc94
/app/src/main/java/eu/uk/ncl/pet5o/esper/view/std/AddPropertyValueOptionalView.java
92a1be32178a7a998705fdd47c3a805263f9d5d2
[]
no_license
PetoMichalak/EsperOn
f8f23d24db21269070e302c0a6c329312491388b
688012d2a92217f4b24bf072dac04ed8902a313d
refs/heads/master
2020-03-24T01:06:17.446804
2018-07-25T15:53:50
2018-07-25T15:53:50
142,322,329
0
0
null
null
null
null
UTF-8
Java
false
false
8,044
java
/* *************************************************************************************** * Copyright (C) 2006 EsperTech, Inc. All rights reserved. * * http://www.espertech.com/esper * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * *************************************************************************************** */ package eu.uk.ncl.pet5o.esper.view.std; import eu.uk.ncl.pet5o.esper.client.EventBean; import eu.uk.ncl.pet5o.esper.client.EventType; import eu.uk.ncl.pet5o.esper.collection.MultiKeyUntyped; import eu.uk.ncl.pet5o.esper.collection.OneEventCollection; import eu.uk.ncl.pet5o.esper.core.context.util.AgentInstanceViewFactoryChainContext; import eu.uk.ncl.pet5o.esper.event.EventAdapterService; import eu.uk.ncl.pet5o.esper.view.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.*; /** * This view simply adds a property to the events posted to it. This is useful for the group-merge views. */ public final class AddPropertyValueOptionalView extends ViewSupport implements StoppableView { private final AgentInstanceViewFactoryChainContext agentInstanceContext; private final String[] propertyNames; private final Object propertyValues; private final EventType eventType; private boolean mustAddProperty; // Keep a history of posted old events to avoid reconstructing the event // and adhere to the contract of posting the same reference to child views. // Only for must-add-property. private Map<EventBean, EventBean> newToOldEventMap; /** * Constructor. * * @param propertyNames is the name of the field that is added to any events received by this view. * @param mergeValues is the values of the field that is added to any events received by this view. * @param mergedResultEventType is the event type that the merge view reports to it's child views * @param agentInstanceContext contains required view services */ public AddPropertyValueOptionalView(AgentInstanceViewFactoryChainContext agentInstanceContext, String[] propertyNames, Object mergeValues, EventType mergedResultEventType) { this.propertyNames = propertyNames; this.propertyValues = mergeValues; this.eventType = mergedResultEventType; this.agentInstanceContext = agentInstanceContext; this.newToOldEventMap = Collections.emptyMap(); } public void setParent(Viewable parent) { if (log.isDebugEnabled()) { log.debug(".setParent parent=" + parent); } super.setParent(parent); if (parent.getEventType() != eventType) { mustAddProperty = true; newToOldEventMap = new HashMap<EventBean, EventBean>(); } else { mustAddProperty = false; } } /** * Returns field name for which to set the merge value for. * * @return field name to use to set value */ public final String[] getPropertyNames() { return propertyNames; } /** * Returns the value to set for the field. * * @return value to set */ public final Object getPropertyValues() { return propertyValues; } public final void update(EventBean[] newData, EventBean[] oldData) { if (!mustAddProperty) { updateChildren(newData, oldData); return; } EventBean[] newEvents = null; EventBean[] oldEvents = null; if (newData != null) { newEvents = new EventBean[newData.length]; int index = 0; for (EventBean newEvent : newData) { EventBean theEvent = addProperty(newEvent, propertyNames, propertyValues, eventType, agentInstanceContext.getStatementContext().getEventAdapterService()); newEvents[index++] = theEvent; newToOldEventMap.put(newEvent, theEvent); } } if (oldData != null) { oldEvents = new EventBean[oldData.length]; int index = 0; for (EventBean oldEvent : oldData) { EventBean outgoing = newToOldEventMap.remove(oldEvent); if (outgoing != null) { oldEvents[index++] = outgoing; } else { EventBean theEvent = addProperty(oldEvent, propertyNames, propertyValues, eventType, agentInstanceContext.getStatementContext().getEventAdapterService()); oldEvents[index++] = theEvent; } } } updateChildren(newEvents, oldEvents); } public final EventType getEventType() { return eventType; } public final Iterator<EventBean> iterator() { final Iterator<EventBean> parentIterator = parent.iterator(); return new Iterator<EventBean>() { public boolean hasNext() { return parentIterator.hasNext(); } public EventBean next() { EventBean nextEvent = parentIterator.next(); if (mustAddProperty) { return addProperty(nextEvent, propertyNames, propertyValues, eventType, agentInstanceContext.getStatementContext().getEventAdapterService()); } else { return nextEvent; } } public void remove() { throw new UnsupportedOperationException(); } }; } @Override public void stop() { if (!newToOldEventMap.isEmpty()) { OneEventCollection oldEvents = new OneEventCollection(); for (Map.Entry<EventBean, EventBean> oldEvent : newToOldEventMap.entrySet()) { oldEvents.add(oldEvent.getValue()); } if (!oldEvents.isEmpty()) { updateChildren(null, oldEvents.toArray()); } newToOldEventMap.clear(); } } /** * Add a property to the event passed in. * * @param originalEvent - event to add property to * @param propertyNames - names of properties to add * @param propertyValues - value of properties to add * @param targetEventType - new event type * @param eventAdapterService - service for generating events and handling event types * @return event with added property */ protected static EventBean addProperty(EventBean originalEvent, String[] propertyNames, Object propertyValues, EventType targetEventType, EventAdapterService eventAdapterService) { Map<String, Object> values = new HashMap<String, Object>(); if (propertyValues instanceof MultiKeyUntyped) { MultiKeyUntyped props = (MultiKeyUntyped) propertyValues; Object[] propertyValuesArr = props.getKeys(); for (int i = 0; i < propertyNames.length; i++) { values.put(propertyNames[i], propertyValuesArr[i]); } } else { values.put(propertyNames[0], propertyValues); } return eventAdapterService.adapterForTypedWrapper(originalEvent, values, targetEventType); } public final String toString() { return this.getClass().getName() + " propertyNames=" + Arrays.toString(propertyNames) + " propertyValue=" + propertyValues; } private static final Logger log = LoggerFactory.getLogger(AddPropertyValueOptionalView.class); }
[ "P.Michalak1@newcastle.ac.uk" ]
P.Michalak1@newcastle.ac.uk
d3b4c3b62947d49453970abfe207b14e7a5715a5
86ee9b075053cbfe5960cc3f5f2fc1f25c832e62
/JavaThread/src/org/circularbufferthreading/ProduceIntegerBuffer.java
9fcc948a038149d18fcac1ebf08836663c1bd16e
[]
no_license
danielxu1987/LearnThread_Java
ac446b9e46960b3675d87ef7d1dbd1e6bfc59bcd
ef8c44e3b4ab156598bb89e78ce722b3d716e4dc
refs/heads/master
2021-01-10T22:11:00.033123
2014-03-27T12:57:02
2014-03-27T12:57:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
998
java
package org.circularbufferthreading; import javax.swing.JTextArea; public class ProduceIntegerBuffer extends Thread { private HoldIntegerSyncBuffer pHold; private JTextArea outputTextArea; // private StopWatch stopWatch; public static double pStartMoment; public ProduceIntegerBuffer(HoldIntegerSyncBuffer h, JTextArea out) { super("ProduceInteger"); pHold = h; outputTextArea = out; } @Override public void run() { pStartMoment = System.currentTimeMillis(); for(int count = 1; count <= 10; count++) { // sleep for a random interval // note: interval shortened purposely to speed up // buffer filling. Consumer's sleep interval should be larger try { Thread.sleep((int) (Math.random() * 500)); } catch (InterruptedException ex) { System.out.println(ex.toString()); } pHold.setSharedInt(count); } outputTextArea.append("\n" + getName() + " finished producing values" + "\nTerminating " + getName() + "\n"); } }
[ "xusifeng@gmail.com" ]
xusifeng@gmail.com
a8c51612e380cab325975c7615fb7c8df915aed7
e8b33db9a90fd170364bfe42530a188859377618
/zkdemo-basics/src/main/java/net/empego/zkbasics/util/ZKCDIUtil.java
81f071ba77ddff92e6e5b65a337d8880eba010f3
[]
no_license
w19901h/zkdemo
6f923fdca51f2da1dffc711200760806c9048e40
7607d34ee07d0641479b8d11ecfb573d5f23e6db
refs/heads/master
2020-04-30T01:22:58.682827
2013-05-22T16:08:38
2013-05-22T16:08:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,340
java
package net.empego.zkbasics.util; import javax.enterprise.context.spi.CreationalContext; import javax.enterprise.inject.spi.AnnotatedType; import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.InjectionTarget; import org.zkoss.zkplus.cdi.CDIUtil; public class ZKCDIUtil { /** * Perform injection in obj which is instantiated by the framework but not by CDI. * * @param <T> * @param obj * - The instance to inject beans into */ public static <T> void inject(final Object obj) { final BeanManager beanManager = CDIUtil.getBeanManager(); // CDI uses an AnnotatedType object to read the annotations of a class final AnnotatedType<T> type = (AnnotatedType<T>) beanManager.createAnnotatedType(obj.getClass()); // The extension uses an InjectionTarget to delegate instantiation, // dependency injection // and lifecycle callbacks to the CDI container final InjectionTarget<T> it = beanManager.createInjectionTarget(type); // each instance needs its own CDI CreationalContext final CreationalContext<T> instanceContext = beanManager.createCreationalContext(null); it.inject((T) obj, instanceContext); // call initializer methods and // perform field injection it.postConstruct((T) obj); // call the @PostConstruct method } }
[ "t.mueller@micromata.de" ]
t.mueller@micromata.de
ac3d83fbca5face93a9601081d4945e80b720f5d
8049e03e3c673697c3b79a789d019c37df9f0bfd
/web/src/main/java/com/czx/web/about/APP.java
0c728b603d33588fe49d72a2065352087292415d
[]
no_license
Morgan-JL/RF
9d98a524c57bb2156f7e845525af201572ccef39
4950dbae0b3c93ce18f83f953e744ef8c0721d38
refs/heads/master
2023-02-22T02:13:37.549626
2021-01-28T01:53:21
2021-01-28T01:53:21
333,021,938
0
0
null
null
null
null
UTF-8
Java
false
false
1,829
java
package com.czx.web.about; import com.alibaba.fastjson.JSON; import com.czx.framework.utils.JsonReaderUtil; import java.net.URL; import java.util.Map; /** * @author Morgan * @date 2020/12/18 09:51 */ public class APP { private static APP app; private static String name; private static String author; private static String version; private static String ctime; public void init() { URL resource = this.getClass().getClassLoader().getResource("app-info.json"); String path = resource.getPath(); String jsonFile = JsonReaderUtil.readJsonFile(path); Map map = (Map) JSON.parse(jsonFile); String name = map.get("name").toString(); String author = map.get("author").toString(); String version = map.get("version").toString(); String ctime = map.get("ctime").toString(); new APP(name, author, version, ctime); } public static void main(String[] args) { APP.create().init(); System.out.println(APP.getCtime()); } public static APP create() { if (app == null) { return new APP(); } return app; } public APP() { } public APP(String name, String author, String version, String ctime) { APP.name = name; APP.author = author; APP.version = version; APP.ctime = ctime; } public static String getName() { return name; } public static void setName(String name) { APP.name = name; } public static String getAuthor() { return author; } public static void setAuthor(String author) { APP.author = author; } public static String getVersion() { return version; } public static void setVersion(String version) { APP.version = version; } public static String getCtime() { return ctime; } public static void setCtime(String ctime) { APP.ctime = ctime; } }
[ "1073774840@qq.com" ]
1073774840@qq.com
e65ef541692035f0cbb749280a7cd5cfd9c704ff
844b0c78c465b28cceeb8d5e1db346fefbb032b2
/data.structures/src/joao/calhau/CacheStructure.java
dd29871024bf02943ff8c17e158c36ad30029bc7
[]
no_license
JoaoCalhau/TeseMestrado
1550a75f5a657086c9e8e5b7596afb9f597e5bc6
c3e0f655372331bf24b405c0805ef84a3193d456
refs/heads/master
2021-03-16T08:57:52.985163
2018-09-23T17:29:33
2018-09-23T17:29:33
111,671,783
0
0
null
null
null
null
UTF-8
Java
false
false
2,128
java
package joao.calhau; import java.io.*; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; public class CacheStructure { private Map<String, LinkedList<Inode>> cache; private String folder; public CacheStructure(String folder) { this.folder = folder; readFromFile(); } public void addToCache(String key, LinkedList<Inode> ll) { cache.put(key, ll); } public boolean existsInCache(String key) { return cache.containsKey(key); } public LinkedList<Inode> getListFromCache(String key) { return cache.get(key); } private void readFromFile() { try { File cacheFile = new File("./cache/" + this.folder + ".cache"); if(cacheFile.exists()) { FileInputStream fin = new FileInputStream(cacheFile); ObjectInputStream ois = new ObjectInputStream(fin); cache = (HashMap) ois.readObject(); ois.close(); fin.close(); } else { cache = new HashMap<>(); } } catch (FileNotFoundException fnfe) { System.err.println("File not found...\nCheck your file paths"); } catch (IOException ioe) { ioe.printStackTrace(); } catch (ClassNotFoundException cnfe) { cnfe.printStackTrace(); } } public void saveToFile() { try { File cacheFile = new File("./cache/" + this.folder + ".cache"); if(!cacheFile.exists()) cacheFile.createNewFile(); FileOutputStream fos = new FileOutputStream(cacheFile, false); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(cache); oos.close(); fos.close(); } catch (FileNotFoundException fnfe) { System.err.println("File not found...\nCheck your file paths"); } catch (IOException ioe) { ioe.printStackTrace(); } } }
[ "joaocalhau6@live.com.pt" ]
joaocalhau6@live.com.pt
a06c3660accff1255a90f0ae8dbc7c02619707c8
e34064e3c0a24808b6472468a45ac0c0c5e19a8a
/src/customAnnotation/AutoGenerate.java
f93f334d08c6d8e4232f23f084203b1ac3c39bd5
[]
no_license
Ducdong94/NewsCrawler
60ddfb11322b91fb00536512474cbbc8f349ba72
6ff90d9344d3af4c6853fe71e876df44c4ab1cff
refs/heads/master
2020-03-16T13:14:04.057458
2018-05-09T01:25:53
2018-05-09T01:25:53
132,684,295
0
0
null
null
null
null
UTF-8
Java
false
false
540
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package customAnnotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * * @author dongvu * @since 04/2018 * @version 1.0 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface AutoGenerate { }
[ "Dongvud00422" ]
Dongvud00422
de1d8b6d41b18eb95bf576de57ae7a1ce8a06a9b
461b9a7146044e0f477ba3b9f5ae8374cf6c585d
/gogo_service_api/gogo_service_user_api/src/main/java/com/store/user/pojo/User.java
222f79a0830e008058db459b8711945131412e3b
[]
no_license
yourZhang/gogoStore
02cd2cd6eaed5aa5df5ac9b3508c43cb5235107f
60cb1993d353268a6b01c08a72562764dacc0d0a
refs/heads/master
2023-01-20T04:16:10.924638
2020-11-16T13:27:30
2020-11-16T13:27:30
307,307,014
1
0
null
null
null
null
UTF-8
Java
false
false
3,809
java
package com.store.user.pojo; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; /** * user实体类 * * */ @Table(name="tb_user") public class User implements Serializable { @Id private String username;//用户名 private String password;//密码,加密存储 private String phone;//注册手机号 private String email;//注册邮箱 private java.util.Date created;//创建时间 private java.util.Date updated;//修改时间 private String sourceType;//会员来源:1:PC,2:H5,3:Android,4:IOS private String nickName;//昵称 private String name;//真实姓名 private String status;//使用状态(1正常 0非正常) private String headPic;//头像地址 private String qq;//QQ号码 private String isMobileCheck;//手机是否验证 (0否 1是) private String isEmailCheck;//邮箱是否检测(0否 1是) private String sex;//性别,1男,0女 private Integer userLevel;//会员等级 private Integer points;//积分 private Integer experienceValue;//经验值 private java.util.Date birthday;//出生年月日 private java.util.Date lastLoginTime;//最后登录时间 public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public java.util.Date getCreated() { return created; } public void setCreated(java.util.Date created) { this.created = created; } public java.util.Date getUpdated() { return updated; } public void setUpdated(java.util.Date updated) { this.updated = updated; } public String getSourceType() { return sourceType; } public void setSourceType(String sourceType) { this.sourceType = sourceType; } public String getNickName() { return nickName; } public void setNickName(String nickName) { this.nickName = nickName; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getHeadPic() { return headPic; } public void setHeadPic(String headPic) { this.headPic = headPic; } public String getQq() { return qq; } public void setQq(String qq) { this.qq = qq; } public String getIsMobileCheck() { return isMobileCheck; } public void setIsMobileCheck(String isMobileCheck) { this.isMobileCheck = isMobileCheck; } public String getIsEmailCheck() { return isEmailCheck; } public void setIsEmailCheck(String isEmailCheck) { this.isEmailCheck = isEmailCheck; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public Integer getUserLevel() { return userLevel; } public void setUserLevel(Integer userLevel) { this.userLevel = userLevel; } public Integer getPoints() { return points; } public void setPoints(Integer points) { this.points = points; } public Integer getExperienceValue() { return experienceValue; } public void setExperienceValue(Integer experienceValue) { this.experienceValue = experienceValue; } public java.util.Date getBirthday() { return birthday; } public void setBirthday(java.util.Date birthday) { this.birthday = birthday; } public java.util.Date getLastLoginTime() { return lastLoginTime; } public void setLastLoginTime(java.util.Date lastLoginTime) { this.lastLoginTime = lastLoginTime; } }
[ "1169277016@qq.com" ]
1169277016@qq.com
dafee341f4e97037f4ca35a2f1ab85f2af1b8f5f
9aa0a3b645bb649ed57a015eddd16ae8cbf4847e
/src/main/java/samples/websocket/snake/Location.java
6774dbc32ebe90b85c41e679db6750a1560d6857
[ "Apache-2.0" ]
permissive
george-hawkins/spring-boot-webjars
8fb0970a62137fa9e70e1c0d8ef214ef0725120d
f41abe1dff0cfba3735c61de4ac50f36b284a536
refs/heads/master
2020-05-29T08:51:22.273195
2016-10-05T20:09:59
2016-10-05T20:09:59
70,075,487
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package samples.websocket.snake; public class Location { public int x; public int y; public static final int GRID_SIZE = 10; public static final int PLAYFIELD_HEIGHT = 480; public static final int PLAYFIELD_WIDTH = 640; public Location(int x, int y) { this.x = x; this.y = y; } public Location getAdjacentLocation(Direction direction) { switch (direction) { case NORTH: return new Location(this.x, this.y - Location.GRID_SIZE); case SOUTH: return new Location(this.x, this.y + Location.GRID_SIZE); case EAST: return new Location(this.x + Location.GRID_SIZE, this.y); case WEST: return new Location(this.x - Location.GRID_SIZE, this.y); case NONE: // fall through default: return this; } } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Location location = (Location) o; if (this.x != location.x) { return false; } if (this.y != location.y) { return false; } return true; } @Override public int hashCode() { int result = this.x; result = 31 * result + this.y; return result; } }
[ "george-hawkins@users.noreply.github.com" ]
george-hawkins@users.noreply.github.com
1f0b5cb6366171d477edafe13e3400e99b93e7ba
79959164d00497ea0734ea4eae87b8fa6285b798
/src/main/java/smt/SmtFileGenerator.java
408c5bf2dcebe038c1cf79982b2a6eba34929c55
[]
no_license
DReigada/ACL-Project
5cb6c072925a127bbb0fccd9ae36691d8273400b
dd150f33b3f8400afc95d09800603484042e5ffe
refs/heads/master
2021-09-05T06:34:18.079963
2018-01-24T21:10:26
2018-01-24T21:10:26
107,902,599
0
0
null
null
null
null
UTF-8
Java
false
false
3,038
java
package smt; import fomatters.IParser; import lombok.val; import table.Table; import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.util.stream.Collectors; import java.util.stream.Stream; import static smt.MovementConditionsGenerator.generateMovementConditions; import static smt.PositionConditionsGenerator.*; public class SmtFileGenerator { private static final String possibleMovementsExpr = exprQuoted("possibleMovements"); private static final String maxPositionExpr = exprQuoted("maxPosition"); private static final String initialPositionsExpr = exprQuoted("initialPositions"); private static final String objectivePositionExpr = exprQuoted("objectivePosition"); public final Table table; private final IParser.ParsedInput input; public SmtFileGenerator(IParser.ParsedInput input) { this.input = input; this.table = new Table(input); } public void generateAndSave(Path path) throws IOException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(getMainTemplateFile()))) { val newLines = replaceLines(reader.lines()); Files.write(path, (Iterable<String>) newLines::iterator); } } public String generateStepConditions(InputStream templateFile, int time) throws IOException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(templateFile))) { Stream<String> newLines = reader.lines() .map(a -> replaceStepConditionLine(a, time, time + 1)); return newLines.collect(Collectors.joining("\n", "\n", "\n")); } } private String replaceStepConditionLine(String str, int t0, int t1) { return str .replace("$0", Integer.toString(t0)) .replace("$1", Integer.toString(t1)); } private Stream<String> replaceLines(Stream<String> lines) throws IOException { return lines.flatMap(this::replaceIfMatches); } public String replaceIfMatchesObjective(String line, int step) { if (line.contains(objectivePositionExpr)) return generateObjectivePosition(input, table, Integer.toString(step)); else return line; } private InputStream getMainTemplateFile() { return getClass().getResourceAsStream("/MainTemplate.smt"); } public InputStream getCheckStepTemplate() { return getClass().getResourceAsStream("/CheckSatTemplate.smt"); } public InputStream getStepTemplateFile() { return getClass().getResourceAsStream("/StepsTemplate.smt"); } private Stream<String> replaceIfMatches(String line) { if (line.contains(possibleMovementsExpr)) return generateMovementConditions(table); else if (line.contains(maxPositionExpr)) return generateMaxPosition(table); else if (line.contains(initialPositionsExpr)) return generateInitialPositions(input, table); // else if (line.contains(objectivePositionExpr)) return generateObjectivePosition(input, table, USEd); else return Stream.of(line); } private static final String exprQuoted(String expr) { return ";;;{" + expr + "}"; } }
[ "daniel.reigada@gmail.com" ]
daniel.reigada@gmail.com
624abc07419f201408eca325049dea25e1d9d1e3
68f1e953ae84150fcfdd704bc37c3a50b50dde1c
/Assignment 2/Question_7/ConstructorOverloading.java
f60eb80adbbfd60d7569aa751a0269645157e5f2
[]
no_license
ayush0402/apl-java
295a86f693fce19cdf5917a24fa088c11d2474ea
8c3760d63da3a09b8874a52f55422a34649a805d
refs/heads/main
2023-07-16T22:34:54.857002
2021-09-01T17:48:36
2021-09-01T17:48:36
398,388,479
0
0
null
null
null
null
UTF-8
Java
false
false
591
java
public class ConstructorOverloading { private double result; private int result1; public ConstructorOverloading(int a, int b){ result1 = a + b; } public ConstructorOverloading(int a, int b, int c){ result1 = a + b + c; } public ConstructorOverloading(double a , double b){ result = a + b; } public ConstructorOverloading(double a , double b, double c){ result = a + b +c; } public void display(){ System.out.println(result); } public void display1(){ System.out.println(result1); } }
[ "lit2020024@iiitl.ac.in" ]
lit2020024@iiitl.ac.in
3284e95cfc0f5a7f5365189e86eb9977e1bc3ab4
33004333e9ae923ff3ee39734941abdf68489183
/app/src/main/java/com/testsite/reddittop/utils/exceptions/NoConnectivityException.java
1aeef788fc73a286d89f20631cad8a10ed4df5bf
[ "Apache-2.0" ]
permissive
paul-freez/example.reddittop
7dce728d8c102a49709ad2a8d78eda0206853a8d
e4e172e892c1c6a7b13ab7eacb2286d86f0953c5
refs/heads/master
2020-04-04T17:17:31.578853
2018-11-14T20:37:35
2018-11-14T20:37:35
156,114,784
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.testsite.reddittop.utils.exceptions; import com.testsite.reddittop.App; import com.testsite.reddittop.R; import java.io.IOException; /** * Created by paulf */ public class NoConnectivityException extends IOException { @Override public String getMessage() { return App.getContext().getString(R.string.error_noconnection); } }
[ "paul.freez.b@gmail.com" ]
paul.freez.b@gmail.com
1db187f32c263753bb8635f8423e3d6f8d9a8622
d351f7efe0e2b01d93044d38e66fe5c2d6de87cf
/src/main/java/bomberman/entities/WorldObject.java
f626e33125d154cd49a473624b99b5a7efc0548a
[]
no_license
gaonmaor/bomberman
e2999a04c4703bd63720ce9a346f71628eb354c8
ffc358eb94390bc502e41ccfdafe0ea6033b346a
refs/heads/master
2020-06-03T21:09:29.671171
2015-04-22T17:20:04
2015-04-22T17:20:04
34,402,445
0
0
null
null
null
null
UTF-8
Java
false
false
896
java
package bomberman.entities; import bomberman.entities.BasicObject; import java.io.Serializable; public class WorldObject extends BasicObject implements Serializable { public enum Types { METAL('M', "Metal"), STONE('S', "Stone"); private final char value; private final String name; Types(char value, String name) { this.value = value; this.name = name; } public char getValue() { return value; } public String getName() { return name; } } private char code; public WorldObject(String name, char code, int x, int y, int width, int height) { super(x, y, width, height, name); setCode(code); } public char getCode() { return this.code; } public void setCode(char code) { this.code = code; } }
[ "gaonmaor@gmail.com" ]
gaonmaor@gmail.com
314ff8218c683cd7786ecc3968093f07ad86ece8
b905fbc16a3e4c1765ce4b4eb270d017e6b4b5d2
/HRMS/HRMS-Domain/src/main/java/com/csipl/hrms/dto/report/DesignationChart.java
f4f862033bee83e573ced0c592e529a263c7e8b3
[]
no_license
ravindra2017bangalore/FabHR
76ed00741be81b6219b565bb38c4c4a68a364dc1
c77e5d4c99d5e9bdb042efea5e30fa25e7e0561e
refs/heads/master
2021-07-03T22:56:55.877324
2019-03-11T15:13:02
2019-03-11T15:13:02
175,022,830
1
0
null
null
null
null
UTF-8
Java
false
false
4,434
java
package com.csipl.hrms.dto.report; public class DesignationChart { String caption, numberPrefix,formatnumberscale,showBorder,use3DLighting; String enableSmartLabels,startingAngle,showLabels,showPercentValues,showLegend; String thousandSeparatorPosition,baseFont,baseFontSize,baseFontColor, centerLabelBold; String showTooltip,decimals,theme; public DesignationChart() { } public DesignationChart(String caption,String numberPrefix,String formatnumberscale,String showBorder,String use3DLighting, String enableSmartLabels,String startingAngle,String showLabels,String showPercentValues,String showLegend, String thousandSeparatorPosition,String baseFont,String baseFontSize,String baseFontColor,String centerLabelBold, String showTooltip,String decimals,String theme) { this.caption=caption; this.numberPrefix=numberPrefix; this.formatnumberscale=formatnumberscale; this.showBorder=showBorder; this.use3DLighting=use3DLighting; this.enableSmartLabels=enableSmartLabels; this.startingAngle=startingAngle; this.showLabels=showLabels; this.showPercentValues=showPercentValues; this.showLegend=showLegend; this.thousandSeparatorPosition=thousandSeparatorPosition; this.baseFont=baseFont; this.baseFontSize=baseFontSize; this.baseFontColor=baseFontColor; this.centerLabelBold=centerLabelBold; this.showTooltip=showTooltip; this.decimals=decimals; this.theme=theme; } public String getCaption() { return caption; } public void setCaption(String caption) { this.caption = caption; } public String getNumberPrefix() { return numberPrefix; } public void setNumberPrefix(String numberPrefix) { this.numberPrefix = numberPrefix; } public String getFormatnumberscale() { return formatnumberscale; } public void setFormatnumberscale(String formatnumberscale) { this.formatnumberscale = formatnumberscale; } public String getShowBorder() { return showBorder; } public void setShowBorder(String showBorder) { this.showBorder = showBorder; } public String getUse3DLighting() { return use3DLighting; } public void setUse3DLighting(String use3dLighting) { use3DLighting = use3dLighting; } public String getEnableSmartLabels() { return enableSmartLabels; } public void setEnableSmartLabels(String enableSmartLabels) { this.enableSmartLabels = enableSmartLabels; } public String getStartingAngle() { return startingAngle; } public void setStartingAngle(String startingAngle) { this.startingAngle = startingAngle; } public String getShowLabels() { return showLabels; } public void setShowLabels(String showLabels) { this.showLabels = showLabels; } public String getShowPercentValues() { return showPercentValues; } public void setShowPercentValues(String showPercentValues) { this.showPercentValues = showPercentValues; } public String getShowLegend() { return showLegend; } public void setShowLegend(String showLegend) { this.showLegend = showLegend; } public String getThousandSeparatorPosition() { return thousandSeparatorPosition; } public void setThousandSeparatorPosition(String thousandSeparatorPosition) { this.thousandSeparatorPosition = thousandSeparatorPosition; } public String getBaseFont() { return baseFont; } public void setBaseFont(String baseFont) { this.baseFont = baseFont; } public String getBaseFontSize() { return baseFontSize; } public void setBaseFontSize(String baseFontSize) { this.baseFontSize = baseFontSize; } public String getBaseFontColor() { return baseFontColor; } public void setBaseFontColor(String baseFontColor) { this.baseFontColor = baseFontColor; } public String getCenterLabelBold() { return centerLabelBold; } public void setCenterLabelBold(String centerLabelBold) { this.centerLabelBold = centerLabelBold; } public String getShowTooltip() { return showTooltip; } public void setShowTooltip(String showTooltip) { this.showTooltip = showTooltip; } public String getDecimals() { return decimals; } public void setDecimals(String decimals) { this.decimals = decimals; } public String getTheme() { return theme; } public void setTheme(String theme) { this.theme = theme; } }
[ "parihar.ravindrasingh@gmail.com" ]
parihar.ravindrasingh@gmail.com
62e98feb2de76a563ac0def8f268a50663a45153
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/radar/ui/i.java
0ee5e2c9261d8bb25d651f79474ca578d9da5f72
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,308
java
package com.tencent.mm.plugin.radar.ui; import a.f; import a.f.b.j; import a.f.b.k; import a.l; import a.v; import android.app.Activity; import android.view.View; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.R; @l(dWo = {1, 1, 13}, dWp = {"\u0000 \n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\u001a\"\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0004H\u0002\u001a$\u0010\u0005\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u0006*\u00020\u00072\b\b\u0001\u0010\b\u001a\u00020\t\u001a$\u0010\u0005\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u0006*\u00020\u00062\b\b\u0001\u0010\b\u001a\u00020\t¨\u0006\n"}, dWq = {"unsafeLazy", "Lkotlin/Lazy;", "T", "initializer", "Lkotlin/Function0;", "bind", "Landroid/view/View;", "Landroid/app/Activity;", "idRes", "", "plugin-radar_release"}) public final class i { @l(dWo = {1, 1, 13}, dWp = {"\u0000\f\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u0002H\u0001\"\b\b\u0000\u0010\u0001*\u00020\u0002H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, dWq = {"<anonymous>", "T", "Landroid/view/View;", "invoke", "()Landroid/view/View;"}) static final class b extends k implements a.f.a.a<T> { final /* synthetic */ int pEE; final /* synthetic */ View pEF; b(View view, int i) { this.pEF = view; this.pEE = i; super(0); } public final /* synthetic */ Object invoke() { AppMethodBeat.i(103139); View findViewById = this.pEF.findViewById(this.pEE); if (findViewById == null) { v vVar = new v("null cannot be cast to non-null type T"); AppMethodBeat.o(103139); throw vVar; } AppMethodBeat.o(103139); return findViewById; } } @l(dWo = {1, 1, 13}, dWp = {"\u0000\f\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u0002H\u0001\"\b\b\u0000\u0010\u0001*\u00020\u0002H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, dWq = {"<anonymous>", "T", "Landroid/view/View;", "invoke", "()Landroid/view/View;"}) static final class a extends k implements a.f.a.a<T> { final /* synthetic */ Activity pED; final /* synthetic */ int pEE = R.id.du5; a(Activity activity) { this.pED = activity; super(0); } public final /* synthetic */ Object invoke() { AppMethodBeat.i(103138); View findViewById = this.pED.findViewById(this.pEE); if (findViewById == null) { v vVar = new v("null cannot be cast to non-null type T"); AppMethodBeat.o(103138); throw vVar; } AppMethodBeat.o(103138); return findViewById; } } public static final <T extends View> f<T> aa(View view, int i) { AppMethodBeat.i(103140); j.p(view, "receiver$0"); f a = a.i.a(a.k.NONE, new b(view, i)); AppMethodBeat.o(103140); return a; } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
89bebbe427db4ac78d18dde71913f191ce5bb5ab
d15ac85fbbc191974e707980e90cac621f74ebd6
/app/src/main/java/com/ghizzoniandrea/tomatoalarmclock/util/TimerUtil.java
d034e839aab19a309db28d7e414f050fccc99f73
[ "Apache-2.0" ]
permissive
shangxiazuoyou/TomatoAlarmClock
582ffe80bb1967187cc344bea0af49cbfb7324da
d45cccc4550852eebac46f93949b113d390c83f7
refs/heads/master
2021-06-20T10:03:48.067767
2017-06-30T05:50:38
2017-06-30T05:50:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,821
java
package com.ghizzoniandrea.tomatoalarmclock.util; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.SystemClock; import com.ghizzoniandrea.tomatoalarmclock.module.time.TimerOnTimeActivity; /** * Created by ghizzoniandrea on 2017/2/4. */ public class TimerUtil { /** * 格式化时间 * * @param hour 小时 * @param minute 分钟 * @return 格式化后的时间:[xx:xx] */ public static String formatTime(int hour, int minute) { return addZero(hour) + ":" + addZero(minute); } /** * 时间补零 * * @param time 需要补零的时间 * @return 补零后的时间 */ public static String addZero(int time) { if (String.valueOf(time).length() == 1) { return "0" + time; } return String.valueOf(time); } /** * 开启倒计时 * * @param context context * @param timeRemain 剩余时间 */ public static void startAlarmTimer(Context context, long timeRemain) { Intent intent = new Intent(context, TimerOnTimeActivity.class); PendingIntent pi = PendingIntent.getActivity(context, 1000, intent, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager alarmManager = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); long countdownTime = timeRemain + SystemClock.elapsedRealtime(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { alarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, countdownTime, pi); } else { alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, countdownTime, pi); } } }
[ "megzzi@163.com" ]
megzzi@163.com
936669340f34becdd96be477653942577d780fe7
9ca9dddda8f89513bc4dfa3a3fc8f3c10d0d8ba4
/src/main/java/com/cricket46/games/cricketcards/controller/CricketCardUserController.java
46762c45a856c25536f73c6a35fa87938263842f
[]
no_license
devadiganagaraja/cricket-cards
4a44d712922ad89a9440d677be9faf4653269cca
16d5421d976b75c8944e093a41d211928f0edae9
refs/heads/main
2023-05-11T09:17:29.299963
2021-06-04T18:32:06
2021-06-04T18:32:06
372,124,690
0
0
null
null
null
null
UTF-8
Java
false
false
1,400
java
package com.cricket46.games.cricketcards.controller; import com.cricket46.games.cricketcards.model.User; import com.cricket46.games.cricketcards.services.CricketCardUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import java.net.URI; import java.util.List; @CrossOrigin @RestController public class CricketCardUserController { @Autowired CricketCardUserService cricketCardUserService; @PostMapping("/authenticate") public ResponseEntity<User> authenticateUser(@RequestBody User user) { System.out.println("user--"+user); User userLoggedIn = cricketCardUserService.authenticateUser(user.getMobile(), user.getPassword()); System.out.println("userLoggedIn--"+userLoggedIn); return new ResponseEntity<User>(userLoggedIn, HttpStatus.OK); } @PostMapping("/users") public ResponseEntity<Boolean> createUser(@RequestBody User user){ Boolean status = cricketCardUserService.addUser(user); return new ResponseEntity<Boolean>(status, HttpStatus.OK); } @GetMapping("/users") public List<User> getUserList(){ return cricketCardUserService.getUsersList(); } }
[ "connect2devadigan@gmail.com" ]
connect2devadigan@gmail.com
f82e0ecc6d825235e4abd9f1e6d74dc08a4ac3de
56346a16a3182283ab21fe50359093e804e5a532
/src/br/com/projeto/view/FrmProdutos.java
de29300904b8fb635b0560cad2f39af9f3e1890b
[]
no_license
Paulolimak5/POOD3-Estoque
b469e7354ae6f86372ee0258bf76152f9781e7ab
d1d26bc3bf6a1653eab609ee577c2a80bbf2c712
refs/heads/main
2023-03-06T01:38:25.947982
2021-02-06T17:38:19
2021-02-06T17:38:19
336,596,757
0
0
null
null
null
null
UTF-8
Java
false
false
29,454
java
package br.com.projeto.view; import br.com.projeto.dao.ClientesDAO; import br.com.projeto.dao.FornecedoresDAO; import br.com.projeto.dao.ProdutosDAO; import br.com.projeto.model.Clientes; import br.com.projeto.model.Fornecedores; import br.com.projeto.model.Produtos; import br.com.projeto.model.Utilitarios; import java.awt.event.KeyEvent; import java.util.List; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; public class FrmProdutos extends javax.swing.JFrame { public void listar() { ProdutosDAO dao = new ProdutosDAO(); List<Produtos> lista = dao.listarProdutos(); DefaultTableModel dados = (DefaultTableModel) tabelaProdutos.getModel(); dados.setNumRows(0); for (Produtos c : lista) { dados.addRow(new Object[]{ c.getId(), c.getDescricao(), c.getPreco(), c.getQtd_estoque(), c.getFornecedor().getNome() }); } } public FrmProdutos() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jTabbedPane4 = new javax.swing.JTabbedPane(); painel_dados_pessoais = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); txtcodigo = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); txtdescricao = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); txtpreco = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); cbfornecedor = new javax.swing.JComboBox(); btnbusca = new javax.swing.JButton(); txtqtdestoque = new javax.swing.JTextField(); painel_consulta_clientes = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); txtpesquisa = new javax.swing.JTextField(); btnpesquisar = new javax.swing.JToggleButton(); jScrollPane1 = new javax.swing.JScrollPane(); tabelaProdutos = new javax.swing.JTable(); btnnovo = new javax.swing.JToggleButton(); btnsalvar = new javax.swing.JToggleButton(); btneditar = new javax.swing.JToggleButton(); btnexcluir = new javax.swing.JToggleButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Cadastro de Produtos"); addWindowListener(new java.awt.event.WindowAdapter() { public void windowActivated(java.awt.event.WindowEvent evt) { formWindowActivated(evt); } }); jPanel1.setBackground(new java.awt.Color(102, 102, 255)); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Cadastro de Produtos"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(29, 29, 29) .addComponent(jLabel1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(25, 25, 25) .addComponent(jLabel1) .addContainerGap(27, Short.MAX_VALUE)) ); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel2.setText("Código:"); txtcodigo.setEditable(false); txtcodigo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N txtcodigo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtcodigoActionPerformed(evt); } }); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel3.setText("Descrição:"); txtdescricao.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N txtdescricao.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtdescricaoActionPerformed(evt); } }); jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel4.setText("Preço:"); txtpreco.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N txtpreco.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtprecoActionPerformed(evt); } }); jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel8.setText("Qtd Estoque:"); jLabel15.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel15.setText("Fornecedores:"); cbfornecedor.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N cbfornecedor.addAncestorListener(new javax.swing.event.AncestorListener() { public void ancestorMoved(javax.swing.event.AncestorEvent evt) { } public void ancestorAdded(javax.swing.event.AncestorEvent evt) { cbfornecedorAncestorAdded(evt); } public void ancestorRemoved(javax.swing.event.AncestorEvent evt) { } }); cbfornecedor.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cbfornecedorActionPerformed(evt); } }); btnbusca.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N btnbusca.setText("Pesquisar"); btnbusca.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnbuscaActionPerformed(evt); } }); txtqtdestoque.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N txtqtdestoque.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtqtdestoqueActionPerformed(evt); } }); javax.swing.GroupLayout painel_dados_pessoaisLayout = new javax.swing.GroupLayout(painel_dados_pessoais); painel_dados_pessoais.setLayout(painel_dados_pessoaisLayout); painel_dados_pessoaisLayout.setHorizontalGroup( painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(painel_dados_pessoaisLayout.createSequentialGroup() .addGroup(painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(painel_dados_pessoaisLayout.createSequentialGroup() .addGap(58, 58, 58) .addGroup(painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(painel_dados_pessoaisLayout.createSequentialGroup() .addGroup(painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel2) .addComponent(jLabel3)) .addGap(8, 8, 8)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painel_dados_pessoaisLayout.createSequentialGroup() .addGap(32, 32, 32) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addGroup(painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(painel_dados_pessoaisLayout.createSequentialGroup() .addComponent(txtpreco, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(47, 47, 47) .addComponent(jLabel8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txtqtdestoque, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(cbfornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(painel_dados_pessoaisLayout.createSequentialGroup() .addComponent(txtdescricao, javax.swing.GroupLayout.PREFERRED_SIZE, 523, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnbusca)) .addComponent(txtcodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(594, Short.MAX_VALUE)) ); painel_dados_pessoaisLayout.setVerticalGroup( painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(painel_dados_pessoaisLayout.createSequentialGroup() .addGap(36, 36, 36) .addGroup(painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(txtcodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtdescricao, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnbusca) .addComponent(jLabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(txtpreco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8) .addComponent(txtqtdestoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(painel_dados_pessoaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel15) .addComponent(cbfornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(300, Short.MAX_VALUE)) ); painel_dados_pessoaisLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {txtdescricao, txtpreco}); jTabbedPane4.addTab("Dados do Produto", painel_dados_pessoais); jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel5.setText("Nome:"); txtpesquisa.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N txtpesquisa.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtpesquisaActionPerformed(evt); } }); txtpesquisa.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { txtpesquisaKeyPressed(evt); } }); btnpesquisar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N btnpesquisar.setText("Pesquisar"); btnpesquisar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnpesquisarActionPerformed(evt); } }); tabelaProdutos.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Código", "Descrição", "Preço", "Qtd. Estoque", "Fornecedor" } )); tabelaProdutos.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { tabelaProdutosMouseClicked(evt); } }); jScrollPane1.setViewportView(tabelaProdutos); javax.swing.GroupLayout painel_consulta_clientesLayout = new javax.swing.GroupLayout(painel_consulta_clientes); painel_consulta_clientes.setLayout(painel_consulta_clientesLayout); painel_consulta_clientesLayout.setHorizontalGroup( painel_consulta_clientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(painel_consulta_clientesLayout.createSequentialGroup() .addGap(29, 29, 29) .addGroup(painel_consulta_clientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1306, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(painel_consulta_clientesLayout.createSequentialGroup() .addComponent(jLabel5) .addGap(3, 3, 3) .addComponent(txtpesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnpesquisar))) .addContainerGap(25, Short.MAX_VALUE)) ); painel_consulta_clientesLayout.setVerticalGroup( painel_consulta_clientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(painel_consulta_clientesLayout.createSequentialGroup() .addGap(30, 30, 30) .addGroup(painel_consulta_clientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(txtpesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnpesquisar)) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(223, Short.MAX_VALUE)) ); jTabbedPane4.addTab("Consulta de Produtos", painel_consulta_clientes); btnnovo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N btnnovo.setText("Novo"); btnnovo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnnovoActionPerformed(evt); } }); btnsalvar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N btnsalvar.setText("Salvar"); btnsalvar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnsalvarActionPerformed(evt); } }); btneditar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N btneditar.setText("Editar"); btneditar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btneditarActionPerformed(evt); } }); btnexcluir.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N btnexcluir.setText("Excluir"); btnexcluir.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnexcluirActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTabbedPane4) .addGroup(layout.createSequentialGroup() .addGap(492, 492, 492) .addComponent(btnnovo) .addGap(18, 18, 18) .addComponent(btnsalvar) .addGap(18, 18, 18) .addComponent(btneditar) .addGap(18, 18, 18) .addComponent(btnexcluir) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jTabbedPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 491, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnnovo) .addComponent(btnsalvar) .addComponent(btneditar) .addComponent(btnexcluir)) .addGap(0, 46, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void txtcodigoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtcodigoActionPerformed }//GEN-LAST:event_txtcodigoActionPerformed private void txtdescricaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtdescricaoActionPerformed }//GEN-LAST:event_txtdescricaoActionPerformed private void txtprecoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtprecoActionPerformed }//GEN-LAST:event_txtprecoActionPerformed private void txtpesquisaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtpesquisaActionPerformed }//GEN-LAST:event_txtpesquisaActionPerformed private void btnpesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnpesquisarActionPerformed String nome = "%" + txtpesquisa.getText() + "%"; ProdutosDAO dao = new ProdutosDAO(); List<Produtos> lista = dao.buscaProdutosPorNome(nome); DefaultTableModel dados = (DefaultTableModel) tabelaProdutos.getModel(); dados.setNumRows(0); for (Produtos c : lista) { dados.addRow(new Object[]{ c.getId(), c.getDescricao(), c.getPreco(), c.getQtd_estoque(), c.getFornecedor().getNome() }); } }//GEN-LAST:event_btnpesquisarActionPerformed private void btnsalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsalvarActionPerformed Produtos obj = new Produtos(); obj.setDescricao(txtdescricao.getText()); obj.setPreco(Double.parseDouble(txtpreco.getText())); obj.setQtd_estoque(Integer.parseInt(txtqtdestoque.getText())); Fornecedores f = new Fornecedores(); f = (Fornecedores) cbfornecedor.getSelectedItem(); obj.setFornecedor(f); ProdutosDAO dao = new ProdutosDAO(); dao.cadastrarProduto(obj); new Utilitarios().LimpaTela(painel_dados_pessoais); }//GEN-LAST:event_btnsalvarActionPerformed private void btneditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btneditarActionPerformed Produtos obj = new Produtos(); obj.setId(Integer.parseInt(txtcodigo.getText())); obj.setDescricao(txtdescricao.getText()); obj.setPreco(Double.parseDouble(txtpreco.getText())); obj.setQtd_estoque(Integer.parseInt(txtqtdestoque.getText())); Fornecedores f = new Fornecedores(); f = (Fornecedores)cbfornecedor.getSelectedItem(); obj.setFornecedor(f); ProdutosDAO dao = new ProdutosDAO(); dao.alterarProduto(obj); new Utilitarios().LimpaTela(painel_dados_pessoais); }//GEN-LAST:event_btneditarActionPerformed private void btnexcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnexcluirActionPerformed Produtos obj = new Produtos(); obj.setId(Integer.parseInt(txtcodigo.getText())); ProdutosDAO dao = new ProdutosDAO(); dao.excluirProduto(obj); new Utilitarios().LimpaTela(painel_dados_pessoais); }//GEN-LAST:event_btnexcluirActionPerformed private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated // TODO add your handling code here: listar(); }//GEN-LAST:event_formWindowActivated private void tabelaProdutosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaProdutosMouseClicked jTabbedPane4.setSelectedIndex(0); txtcodigo.setText(tabelaProdutos.getValueAt(tabelaProdutos.getSelectedRow(), 0).toString()); txtdescricao.setText(tabelaProdutos.getValueAt(tabelaProdutos.getSelectedRow(), 1).toString()); txtpreco.setText(tabelaProdutos.getValueAt(tabelaProdutos.getSelectedRow(), 2).toString()); cbfornecedor.setSelectedItem(tabelaProdutos.getValueAt(tabelaProdutos.getSelectedRow(), 3).toString()); Fornecedores f = new Fornecedores(); FornecedoresDAO dao = new FornecedoresDAO(); f = dao.consultaPorNome(tabelaProdutos.getValueAt(tabelaProdutos.getSelectedRow(), 4).toString()); cbfornecedor.removeAllItems(); cbfornecedor.getModel().setSelectedItem(f); }//GEN-LAST:event_tabelaProdutosMouseClicked private void txtpesquisaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtpesquisaKeyPressed String nome = "%" + txtpesquisa.getText() + "%"; ProdutosDAO dao = new ProdutosDAO(); List<Produtos> lista = dao.buscaProdutosPorNome(nome); DefaultTableModel dados = (DefaultTableModel) tabelaProdutos.getModel(); dados.setNumRows(0); for (Produtos c : lista) { dados.addRow(new Object[]{ c.getId(), c.getDescricao(), c.getPreco(), c.getQtd_estoque(), c.getFornecedor().getNome() }); } }//GEN-LAST:event_txtpesquisaKeyPressed private void btnnovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnnovoActionPerformed new Utilitarios().LimpaTela(painel_dados_pessoais); }//GEN-LAST:event_btnnovoActionPerformed private void btnbuscaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnbuscaActionPerformed String nome = txtdescricao.getText(); Produtos obj = new Produtos(); ProdutosDAO dao = new ProdutosDAO(); obj = dao.consultaPorNome(nome); cbfornecedor.removeAllItems(); if(obj.getDescricao() != null){ txtcodigo.setText(String.valueOf(obj.getId())); txtdescricao.setText(obj.getDescricao()); txtpreco.setText(String.valueOf(obj.getPreco())); txtqtdestoque.setText(String.valueOf(obj.getQtd_estoque())); Fornecedores f = new Fornecedores(); FornecedoresDAO fdao = new FornecedoresDAO(); f = fdao.consultaPorNome(obj.getFornecedor().getNome()); cbfornecedor.getModel().setSelectedItem(f); } else{ JOptionPane.showMessageDialog(null, "Cliente não econtrado!"); } }//GEN-LAST:event_btnbuscaActionPerformed private void cbfornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbfornecedorActionPerformed // TODO add your handling code here: }//GEN-LAST:event_cbfornecedorActionPerformed private void txtqtdestoqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtqtdestoqueActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtqtdestoqueActionPerformed private void cbfornecedorAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_cbfornecedorAncestorAdded FornecedoresDAO daof = new FornecedoresDAO(); List<Fornecedores> listadefornecedores = daof.listarFornecedores(); cbfornecedor.removeAllItems(); for(Fornecedores f : listadefornecedores){ cbfornecedor.addItem(f); } }//GEN-LAST:event_cbfornecedorAncestorAdded /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(FrmProdutos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(FrmProdutos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(FrmProdutos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(FrmProdutos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new FrmProdutos().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnbusca; private javax.swing.JToggleButton btneditar; private javax.swing.JToggleButton btnexcluir; private javax.swing.JToggleButton btnnovo; private javax.swing.JToggleButton btnpesquisar; private javax.swing.JToggleButton btnsalvar; private javax.swing.JComboBox cbfornecedor; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel8; private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; public javax.swing.JTabbedPane jTabbedPane4; private javax.swing.JPanel painel_consulta_clientes; private javax.swing.JPanel painel_dados_pessoais; private javax.swing.JTable tabelaProdutos; private javax.swing.JTextField txtcodigo; private javax.swing.JTextField txtdescricao; private javax.swing.JTextField txtpesquisa; private javax.swing.JTextField txtpreco; private javax.swing.JTextField txtqtdestoque; // End of variables declaration//GEN-END:variables }
[ "p.manoel.m@gmail.com" ]
p.manoel.m@gmail.com
5b4bd879011259e18c759ae4d4df5e76e6a51c9e
a5b06de4058e4bdd23a41a60dc56c3d6f0c25426
/sample/src/main/java/wang/leal/agm/AGMApplication.java
1b79dd66600098aa1f2bb5b5488e6a3fc20f3d4d
[ "Apache-2.0" ]
permissive
wangleal/AGM
fdda5376cf9976b6d9fe7ae5fd36b465477633ef
3320f0008dbbe42ec346550a9fb0c83702e94d6f
refs/heads/master
2020-05-25T14:08:24.754927
2019-12-17T08:14:46
2019-12-17T08:14:46
187,836,637
0
0
null
null
null
null
UTF-8
Java
false
false
185
java
package wang.leal.agm; import android.app.Application; public class AGMApplication extends Application { @Override public void onCreate() { super.onCreate(); } }
[ "wangli@3commas.cn" ]
wangli@3commas.cn
35f214fb9088a406a69b697dd66faa035e05f502
fa17d3bb8071a07ad9018d96a84c26897ae46429
/app/src/main/java/com/itheima/takeout/utils/NumberFormatUtils.java
6660fcabad87470cc00b93fd4998893d8d4f9c90
[]
no_license
YmsStu/TakeoutProject
de15f7c751b363c93fcb04fba5cf8ec5767f81c4
eed2c827b927fb1b99052dc82e1ddea2a9491687
refs/heads/master
2021-01-23T03:13:38.233403
2017-03-31T09:44:46
2017-03-31T09:44:46
86,060,836
5
0
null
null
null
null
UTF-8
Java
false
false
429
java
package com.itheima.takeout.utils; import java.text.NumberFormat; /** * Created by p on 2016/8/25. */ public class NumberFormatUtils { private NumberFormatUtils(){ } //格式化数据保留两位小数 并且带¥ public static String formatDigits(double data){ NumberFormat nf = NumberFormat.getCurrencyInstance(); nf.setMaximumFractionDigits(2); return nf.format(data); } }
[ "924832073@qq.com" ]
924832073@qq.com
4c7f2577fa6c639243f1ab59b95f5f11635f7d9d
eee65ef0538e3598d19d3ebe77024d8ad1a6c8dc
/app/src/main/java/com/truedigital/vhealth/ui/main/MainActivityInterface.java
ff9212c939380254feb79d54344f56b99bb58020
[]
no_license
arnon010/app_true
1e895a9004eac32eecf72f97e54711a7a3fee5e1
eca7673c74e5a9b21b04d14633333c97e7b222d9
refs/heads/master
2023-04-21T09:52:09.337411
2021-05-30T14:01:27
2021-05-30T14:01:27
371,561,455
0
0
null
null
null
null
UTF-8
Java
false
false
8,165
java
package com.truedigital.vhealth.ui.main; import androidx.annotation.StringRes; import android.widget.ImageView; import com.truedigital.vhealth.model.BloodPressureObject; import com.truedigital.vhealth.model.BloodSugarObject; import com.truedigital.vhealth.model.ChildGrowthCriteriaObject; import com.truedigital.vhealth.model.CongenitalDiseaseObject; import com.truedigital.vhealth.model.DailyBloodPressureObject; import com.truedigital.vhealth.model.DailyBloodSugarObject; import com.truedigital.vhealth.model.DailyHeartBeatRateObject; import com.truedigital.vhealth.model.FoodAllergyObject; import com.truedigital.vhealth.model.HeartBeatRateObject; import com.truedigital.vhealth.model.ItemArticleDao; import com.truedigital.vhealth.model.ItemDoctorDao; import com.truedigital.vhealth.model.DoctorNoteObject; import com.truedigital.vhealth.model.LaboratoryOtherObject; import com.truedigital.vhealth.model.MedicationHistoryObject; import com.truedigital.vhealth.model.MedicineAllergyObject; import com.truedigital.vhealth.model.PregnantHistoryObject; import com.truedigital.vhealth.model.RowHeaderVaccineObject; import com.truedigital.vhealth.model.SystemConfigurationObject; import com.truedigital.vhealth.model.appointment.ApiAppointmentRequest; import com.truedigital.vhealth.model.appointment.ItemAppointmentDao; import com.truedigital.vhealth.ui.base.BaseMvpInterface; /** * Created by songkrit on 12/20/2017 AD. */ public class MainActivityInterface { public interface View extends BaseMvpInterface.View { void openLogin(); void showToolbarMain(boolean isShow); void updateToolbar(String title, boolean showImage, String urlImageDoctor, boolean showBtnAdd); void showToolbar(@StringRes int resId, boolean showHomeAsUp); void showToolbar(String title, boolean showHomeAsUp); void showToolbar(String title, boolean showHomeAsUp, String urlImage); void showToolbar(boolean showHomeAsUp, String image); void showToolbar(@StringRes int resId, boolean showHomeAsUp, boolean hideBgBottom); void showToolbar(String title, boolean showHomeAsUp, boolean hideBgBottom); void setShowBackButton(boolean isShow); void setSwipeRefreshLayout(boolean isShow); void hideToolbar(); void showCallingBar(); void hideCallingBar(); void openDoctorDetail(int id); void openDoctorDetail(ItemDoctorDao data); void canStartAppointment(boolean canStart); //..Setting void openSettingApp(); void openSettingAppLanguage(); void onSetLanguage(String language); //..Products void openListProducts(int groupId); void openProductDetail(int id); void openProductConfirm(int id); //..Doctor void openDoctorCalendar(int doctorId); //..Appointment void gotoAppointment(); void openAppointmentCreate(ItemDoctorDao data); void openAppointmentCreateDetail(ItemDoctorDao data); void openAppointmentConfirm(ItemDoctorDao data); void openAppointmentSuccess(ItemDoctorDao data, ApiAppointmentRequest appointmentData, double discountPrice); void openAppointmentDetail(int appointmentType, String appointmentNumber); void openAppointmentDetail(int position, ItemAppointmentDao data, ImageView shareView); void openAppointmentCancel(ItemAppointmentDao data, boolean isViewOnly); void openAppointmentHistory(final String appointmentNumber); void openAppointmentCancel(ItemAppointmentDao data); void openAppointmentCreateFromArticle(int doctorId); void openRoom(String appointmentNumber,String contactTypeCode); //..Articles void openListArticles(int doctorId, String doctorName, int articleGroupId); void openArticleDetail(int articleId); void openArticlePatientDetail(int articleId); void openArticleDetail(ItemArticleDao data); void openArticlePatientDetail(ItemArticleDao data); void openSimilarArticle(int articleId); void openDoctorNoteConfirm(ItemAppointmentDao data, boolean isViewOnly); void openDoctorNoteConfirm(ItemAppointmentDao data, boolean isViewOnly, boolean isShowPayment); void openRelationshipMenu(int patientId); void openHealthInformationMenu(int patientId, boolean isChild, String titleToolbar); void openDoctorNote(int patientId, int patientMenuId); void openDoctorNoteDetail(DoctorNoteObject data); void openPregnantHistory(int patientId, int patientMenuId); void openNewFormPregnantHistory(PregnantHistoryObject data, boolean isNewFromMenu); void openUpdateFormPregnantHistory(PregnantHistoryObject data); void openMedicationHistory(int patientId, int patientMenuId); void openNewFormMedicationHistory(MedicationHistoryObject data, Boolean isNewFromMenu); void openUpdateFormMedicationHistory(MedicationHistoryObject data); void openFormMedicationHistoryChiiwiiLive(MedicationHistoryObject data); void openVaccinationHistory(int patientId, int patientMenuId, String menuCode); void openVaccineDetail(RowHeaderVaccineObject data); void openLaboratory(int patientId, int patientMenuId, int defaultTap); void openNewFormLaboratoryOther(LaboratoryOtherObject data, boolean isNewFromMenu); void openUpdateFormLaboratoryOther(LaboratoryOtherObject data); void openHeartBeatRate(int patientId, int patientMenuId, String menuCode); void openViewAllHeartBeatRate(int patientId, int patientMenuId); void openTimeHeartBeatRate(DailyHeartBeatRateObject data); void openNewFormHeartBeatRate(HeartBeatRateObject data); void openUpdateFormHeartBeatRate(HeartBeatRateObject data); void openBloodPressure(int patientId, int patientMenuId, String menuCode); void openViewAllBloodPressure(int patientId, int patientMenuId); void openTimeBloodPressure(DailyBloodPressureObject data); void openNewFormBloodPressure(BloodPressureObject data); void openUpdateFormBloodPressure(BloodPressureObject data); void openBloodSugar(int patientId, int patientMenuId, String menuCode); void openViewAllBloodSugar(int patientId, int patientMenuId); void openTimeBloodSugar(DailyBloodSugarObject data); void openNewFormBloodSugar(BloodSugarObject data); void openUpdateFormBloodSugar(BloodSugarObject data); void openMenstrualPeriod(int patientId, int patientMenuId, String menuCode); void openChildGrowth(ChildGrowthCriteriaObject criteria); void openMedicineAllergy(int patientId, int patientMenuId); void openNewFormMedicineAllergy(MedicineAllergyObject data, Boolean isNewFromMenu); void openUpdateFormMedicineAllergy(MedicineAllergyObject data); void openFoodAllergy(int patientId, int patientMenuId); void openNewFormFoodAllergy(FoodAllergyObject data, Boolean isNewFromMenu); void openUpdateFormFoodAllergy(FoodAllergyObject data); void openCongenitalDisease(int patientId, int patientMenuId); void openNewFormCongenitalDisease(CongenitalDiseaseObject data, Boolean isNewFromMenu); void openUpdateFormCongenitalDisease(CongenitalDiseaseObject data); void openVideoCall(); void setSystemConfigurationApi(SystemConfigurationObject data); void onNavigateEHR(boolean hasPIN); SystemConfigurationObject getSystemConfiguration(); void foundNewVersion(); void openAddress(); void openShippingStatus(String appointmentNumber, String invoiceNo, String status); void setMenuHomeSelected(); void setMenuEhrSelected(); void setMenuAppointmentSelected(); void setMenuSettingSelected(); } public interface Presenter extends BaseMvpInterface.Presenter<MainActivityInterface.View> { void getSystemConfigurationApi(); void getPINStatus(); void callServiceGetAppointment(final String appointmentNumber); void getApplicationVersion(); } }
[ "" ]
8cc6cca296530586057ce3ea737fcd1d27329585
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Lang-7/org.apache.commons.lang3.math.NumberUtils/BBC-F0-opt-80/tests/13/org/apache/commons/lang3/math/NumberUtils_ESTest.java
f47140931da19b0aaa5ebb92069228f19630f5e4
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
57,356
java
/* * This file was automatically generated by EvoSuite * Thu Oct 21 03:25:18 GMT 2021 */ package org.apache.commons.lang3.math; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import java.math.BigDecimal; import java.math.BigInteger; import org.apache.commons.lang3.math.NumberUtils; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class NumberUtils_ESTest extends NumberUtils_ESTest_scaffolding { @Test(timeout = 4000) public void test000() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0xA blank string is not a valid number"); assertFalse(boolean0); } @Test(timeout = 4000) public void test001() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0xf"); assertTrue(boolean0); } @Test(timeout = 4000) public void test002() throws Throwable { boolean boolean0 = NumberUtils.isNumber("-0x0"); assertTrue(boolean0); } @Test(timeout = 4000) public void test003() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0z4M1^}q'.q0ukBV"); assertFalse(boolean0); } @Test(timeout = 4000) public void test004() throws Throwable { byte byte0 = NumberUtils.max((byte)58, (byte) (-120), (byte)58); assertEquals((byte)58, byte0); } @Test(timeout = 4000) public void test005() throws Throwable { short short0 = NumberUtils.max((short)2590, (short)2590, (short)2590); assertEquals((short)2590, short0); } @Test(timeout = 4000) public void test006() throws Throwable { short short0 = NumberUtils.max((short)0, (short) (-1300), (short) (-1300)); assertEquals((short)0, short0); } @Test(timeout = 4000) public void test007() throws Throwable { int int0 = NumberUtils.max(3984, 3628, 3984); assertEquals(3984, int0); } @Test(timeout = 4000) public void test008() throws Throwable { long long0 = NumberUtils.max((long) (short)8, (-1L), 1L); assertEquals(8L, long0); } @Test(timeout = 4000) public void test009() throws Throwable { float[] floatArray0 = new float[7]; floatArray0[0] = 829.9827F; float float0 = NumberUtils.max(floatArray0); assertEquals(829.9827F, float0, 0.01F); } @Test(timeout = 4000) public void test010() throws Throwable { byte[] byteArray0 = new byte[4]; byteArray0[1] = (byte) (-32); byte byte0 = NumberUtils.min(byteArray0); assertEquals((byte) (-32), byte0); } @Test(timeout = 4000) public void test011() throws Throwable { short[] shortArray0 = new short[7]; shortArray0[1] = (short) (-1260); short short0 = NumberUtils.min(shortArray0); assertEquals((short) (-1260), short0); } @Test(timeout = 4000) public void test012() throws Throwable { try { NumberUtils.createNumber(".AE9"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // no message in exception (getMessage() returned null) // verifyException("java.math.BigDecimal", e); } } @Test(timeout = 4000) public void test013() throws Throwable { try { NumberUtils.createNumber("}W$%e?Rs{F(tsff"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // }W$%e?Rs{F(tsff is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test014() throws Throwable { short short0 = NumberUtils.toShort("6S@@YhGBb~E:3C%Z~", (short)2); assertEquals((short)2, short0); } @Test(timeout = 4000) public void test015() throws Throwable { short short0 = NumberUtils.toShort("", (short) (-21)); assertEquals((short) (-21), short0); } @Test(timeout = 4000) public void test016() throws Throwable { short short0 = NumberUtils.toShort("0[%E%R"); assertEquals((short)0, short0); } @Test(timeout = 4000) public void test017() throws Throwable { short short0 = NumberUtils.toShort("-2"); assertEquals((short) (-2), short0); } @Test(timeout = 4000) public void test018() throws Throwable { long long0 = NumberUtils.toLong("", (-40L)); assertEquals((-40L), long0); } @Test(timeout = 4000) public void test019() throws Throwable { long long0 = NumberUtils.toLong("Sea"); assertEquals(0L, long0); } @Test(timeout = 4000) public void test020() throws Throwable { long long0 = NumberUtils.toLong("28"); assertEquals(28L, long0); } @Test(timeout = 4000) public void test021() throws Throwable { int int0 = NumberUtils.toInt("", 70); assertEquals(70, int0); } @Test(timeout = 4000) public void test022() throws Throwable { int int0 = NumberUtils.toInt("#Mb"); assertEquals(0, int0); } @Test(timeout = 4000) public void test023() throws Throwable { int int0 = NumberUtils.toInt("5"); assertEquals(5, int0); } @Test(timeout = 4000) public void test024() throws Throwable { float float0 = NumberUtils.toFloat("IHTLciJ", (float) (byte) (-93)); assertEquals((-93.0F), float0, 0.01F); } @Test(timeout = 4000) public void test025() throws Throwable { float float0 = NumberUtils.toFloat("28"); assertEquals(28.0F, float0, 0.01F); } @Test(timeout = 4000) public void test026() throws Throwable { double double0 = NumberUtils.toDouble("", 0.0); assertEquals(0.0, double0, 0.01); } @Test(timeout = 4000) public void test027() throws Throwable { double double0 = NumberUtils.toDouble("w", 2575.0); assertEquals(2575.0, double0, 0.01); } @Test(timeout = 4000) public void test028() throws Throwable { double double0 = NumberUtils.toDouble("--"); assertEquals(0.0, double0, 0.01); } @Test(timeout = 4000) public void test029() throws Throwable { double double0 = NumberUtils.toDouble("2"); assertEquals(2.0, double0, 0.01); } @Test(timeout = 4000) public void test030() throws Throwable { byte byte0 = NumberUtils.toByte("1e[Mdfu", (byte)4); assertEquals((byte)4, byte0); } @Test(timeout = 4000) public void test031() throws Throwable { byte byte0 = NumberUtils.toByte("{|%"); assertEquals((byte)0, byte0); } @Test(timeout = 4000) public void test032() throws Throwable { byte byte0 = NumberUtils.toByte("12"); assertEquals((byte)12, byte0); } @Test(timeout = 4000) public void test033() throws Throwable { short[] shortArray0 = new short[1]; shortArray0[0] = (short)97; short short0 = NumberUtils.min(shortArray0); assertEquals((short)97, short0); } @Test(timeout = 4000) public void test034() throws Throwable { long[] longArray0 = new long[1]; longArray0[0] = 448L; long long0 = NumberUtils.min(longArray0); assertEquals(448L, long0); } @Test(timeout = 4000) public void test035() throws Throwable { long[] longArray0 = new long[3]; longArray0[0] = (long) (byte) (-54); long long0 = NumberUtils.min(longArray0); assertEquals((-54L), long0); } @Test(timeout = 4000) public void test036() throws Throwable { int[] intArray0 = new int[1]; intArray0[0] = (int) (short)880; int int0 = NumberUtils.min(intArray0); assertEquals(880, int0); } @Test(timeout = 4000) public void test037() throws Throwable { int[] intArray0 = new int[2]; intArray0[0] = (-528); int int0 = NumberUtils.min(intArray0); assertEquals((-528), int0); } @Test(timeout = 4000) public void test038() throws Throwable { float[] floatArray0 = new float[3]; floatArray0[0] = 46.0F; floatArray0[1] = 1.0F; floatArray0[2] = 2590.0F; float float0 = NumberUtils.min(floatArray0); assertEquals(1.0F, float0, 0.01F); } @Test(timeout = 4000) public void test039() throws Throwable { float[] floatArray0 = new float[1]; floatArray0[0] = (float) (short) (-23); float float0 = NumberUtils.min(floatArray0); assertEquals((-23.0F), float0, 0.01F); } @Test(timeout = 4000) public void test040() throws Throwable { double[] doubleArray0 = new double[1]; doubleArray0[0] = (double) (byte)65; double double0 = NumberUtils.min(doubleArray0); assertEquals(65.0, double0, 0.01); } @Test(timeout = 4000) public void test041() throws Throwable { double[] doubleArray0 = new double[7]; doubleArray0[3] = (-1061.762643931929); double double0 = NumberUtils.min(doubleArray0); assertEquals((-1061.762643931929), double0, 0.01); } @Test(timeout = 4000) public void test042() throws Throwable { byte[] byteArray0 = new byte[1]; byteArray0[0] = (byte)118; byte byte0 = NumberUtils.min(byteArray0); assertEquals((byte)118, byte0); } @Test(timeout = 4000) public void test043() throws Throwable { short short0 = NumberUtils.min((short)0, (short)0, (short)0); assertEquals((short)0, short0); } @Test(timeout = 4000) public void test044() throws Throwable { short short0 = NumberUtils.min((short)1081, (short)1, (short)743); assertEquals((short)1, short0); } @Test(timeout = 4000) public void test045() throws Throwable { long long0 = NumberUtils.min(0L, 0L, 0L); assertEquals(0L, long0); } @Test(timeout = 4000) public void test046() throws Throwable { int int0 = NumberUtils.min(0, 0, 1517); assertEquals(0, int0); } @Test(timeout = 4000) public void test047() throws Throwable { int int0 = NumberUtils.min(1994, 1994, 1994); assertEquals(1994, int0); } @Test(timeout = 4000) public void test048() throws Throwable { float float0 = NumberUtils.min((float) 1318L, (float) (byte)118, 785.694F); assertEquals(118.0F, float0, 0.01F); } @Test(timeout = 4000) public void test049() throws Throwable { float float0 = NumberUtils.min((-1331.4F), (float) (short) (-642), (-506.6362F)); assertEquals((-1331.4F), float0, 0.01F); } @Test(timeout = 4000) public void test050() throws Throwable { double double0 = NumberUtils.min(1.0, 0.0, 0.0); assertEquals(0.0, double0, 0.01); } @Test(timeout = 4000) public void test051() throws Throwable { double double0 = NumberUtils.min(214.901004, (double) 10, 1711.37456174); assertEquals(10.0, double0, 0.01); } @Test(timeout = 4000) public void test052() throws Throwable { double double0 = NumberUtils.min(0.0, 0.0, (-1.0)); assertEquals((-1.0), double0, 0.01); } @Test(timeout = 4000) public void test053() throws Throwable { byte byte0 = NumberUtils.min((byte)2, (byte)17, (byte)100); assertEquals((byte)2, byte0); } @Test(timeout = 4000) public void test054() throws Throwable { short[] shortArray0 = new short[2]; shortArray0[0] = (short) (byte)46; short short0 = NumberUtils.max(shortArray0); assertEquals((short)46, short0); } @Test(timeout = 4000) public void test055() throws Throwable { short[] shortArray0 = new short[9]; shortArray0[0] = (short) (-23); shortArray0[1] = (short) (-23); shortArray0[2] = (short) (-23); shortArray0[3] = (short) (-23); shortArray0[4] = (short) (-23); shortArray0[5] = (short) (-23); shortArray0[6] = (short) (-23); shortArray0[7] = (short) (-23); shortArray0[8] = (short) (-23); short short0 = NumberUtils.max(shortArray0); assertEquals((short) (-23), short0); } @Test(timeout = 4000) public void test056() throws Throwable { long[] longArray0 = new long[1]; longArray0[0] = (-651L); long long0 = NumberUtils.max(longArray0); assertEquals((-651L), long0); } @Test(timeout = 4000) public void test057() throws Throwable { int[] intArray0 = new int[6]; intArray0[0] = 816; int int0 = NumberUtils.max(intArray0); assertEquals(816, int0); } @Test(timeout = 4000) public void test058() throws Throwable { int[] intArray0 = new int[1]; intArray0[0] = (int) (short) (-2); int int0 = NumberUtils.max(intArray0); assertEquals((-2), int0); } @Test(timeout = 4000) public void test059() throws Throwable { float[] floatArray0 = new float[2]; floatArray0[1] = 2260.913F; float float0 = NumberUtils.max(floatArray0); assertEquals(2260.913F, float0, 0.01F); } @Test(timeout = 4000) public void test060() throws Throwable { float[] floatArray0 = new float[1]; floatArray0[0] = (float) (short) (-2777); float float0 = NumberUtils.max(floatArray0); assertEquals((-2777.0F), float0, 0.01F); } @Test(timeout = 4000) public void test061() throws Throwable { double[] doubleArray0 = new double[3]; doubleArray0[0] = 674.0; double double0 = NumberUtils.max(doubleArray0); assertEquals(674.0, double0, 0.01); } @Test(timeout = 4000) public void test062() throws Throwable { double[] doubleArray0 = new double[1]; doubleArray0[0] = (-2773.67907494988); double double0 = NumberUtils.max(doubleArray0); assertEquals((-2773.67907494988), double0, 0.01); } @Test(timeout = 4000) public void test063() throws Throwable { byte[] byteArray0 = new byte[1]; byteArray0[0] = (byte) (-34); byte byte0 = NumberUtils.max(byteArray0); assertEquals((byte) (-34), byte0); } @Test(timeout = 4000) public void test064() throws Throwable { float float0 = NumberUtils.max(0.0F, 0.0F, 0.0F); assertEquals(0.0F, float0, 0.01F); } @Test(timeout = 4000) public void test065() throws Throwable { float float0 = NumberUtils.max((float) (short) (-36), (float) (byte)4, (-878.23F)); assertEquals(4.0F, float0, 0.01F); } @Test(timeout = 4000) public void test066() throws Throwable { double double0 = NumberUtils.max((-1.0), (-1.0), 0.0); assertEquals(0.0, double0, 0.01); } @Test(timeout = 4000) public void test067() throws Throwable { double double0 = NumberUtils.max((-1.0), (-1551.3812236), (-3157.2)); assertEquals((-1.0), double0, 0.01); } @Test(timeout = 4000) public void test068() throws Throwable { Number number0 = NumberUtils.createNumber("038"); assertEquals((byte)38, number0.byteValue()); } @Test(timeout = 4000) public void test069() throws Throwable { Long long0 = NumberUtils.createLong("0"); assertEquals(0L, (long)long0); } @Test(timeout = 4000) public void test070() throws Throwable { Long long0 = NumberUtils.createLong("-0x7"); assertEquals((-7L), (long)long0); } @Test(timeout = 4000) public void test071() throws Throwable { Integer integer0 = NumberUtils.createInteger("0"); assertEquals(0, (int)integer0); } @Test(timeout = 4000) public void test072() throws Throwable { Integer integer0 = NumberUtils.createInteger("0xB"); assertEquals(11, (int)integer0); } @Test(timeout = 4000) public void test073() throws Throwable { Integer integer0 = NumberUtils.createInteger("-0X5F"); assertEquals((-95), (int)integer0); } @Test(timeout = 4000) public void test074() throws Throwable { Float float0 = NumberUtils.createFloat("-0"); assertEquals(-0.0F, (float)float0, 0.01F); } @Test(timeout = 4000) public void test075() throws Throwable { Float float0 = NumberUtils.createFloat("-2"); assertEquals((-2.0F), (float)float0, 0.01F); } @Test(timeout = 4000) public void test076() throws Throwable { Double double0 = NumberUtils.createDouble("-0"); assertEquals(-0.0, (double)double0, 0.01); } @Test(timeout = 4000) public void test077() throws Throwable { Double double0 = NumberUtils.createDouble("5F"); assertEquals(5.0, (double)double0, 0.01); } @Test(timeout = 4000) public void test078() throws Throwable { BigInteger bigInteger0 = NumberUtils.createBigInteger("0"); assertEquals((byte)0, bigInteger0.byteValue()); } @Test(timeout = 4000) public void test079() throws Throwable { BigInteger bigInteger0 = NumberUtils.createBigInteger("-2"); assertEquals((short) (-2), bigInteger0.shortValue()); } @Test(timeout = 4000) public void test080() throws Throwable { BigDecimal bigDecimal0 = NumberUtils.createBigDecimal("0"); assertEquals((byte)0, bigDecimal0.byteValue()); } @Test(timeout = 4000) public void test081() throws Throwable { BigDecimal bigDecimal0 = NumberUtils.createBigDecimal("5"); assertEquals((short)5, bigDecimal0.shortValue()); } @Test(timeout = 4000) public void test082() throws Throwable { // Undeclared exception! try { NumberUtils.createLong("T|XZqjE4 .>m"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // For input string: \"T|XZqjE4 .>m\" // verifyException("java.lang.NumberFormatException", e); } } @Test(timeout = 4000) public void test083() throws Throwable { // Undeclared exception! try { NumberUtils.createFloat("0e("); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { } } @Test(timeout = 4000) public void test084() throws Throwable { // Undeclared exception! try { NumberUtils.createDouble("-0x0X"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { } } @Test(timeout = 4000) public void test085() throws Throwable { // Undeclared exception! try { NumberUtils.createBigInteger("--"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // Illegal embedded sign character // verifyException("java.math.BigInteger", e); } } @Test(timeout = 4000) public void test086() throws Throwable { // Undeclared exception! try { NumberUtils.createBigDecimal("IHTLciJ"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // no message in exception (getMessage() returned null) // verifyException("java.math.BigDecimal", e); } } @Test(timeout = 4000) public void test087() throws Throwable { boolean boolean0 = NumberUtils.isDigits("5"); assertTrue(boolean0); } @Test(timeout = 4000) public void test088() throws Throwable { boolean boolean0 = NumberUtils.isDigits("0x"); assertFalse(boolean0); } @Test(timeout = 4000) public void test089() throws Throwable { // Undeclared exception! try { NumberUtils.createBigDecimal(""); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // A blank string is not a valid number // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test090() throws Throwable { BigDecimal bigDecimal0 = NumberUtils.createBigDecimal("-2"); assertEquals((byte) (-2), bigDecimal0.byteValue()); } @Test(timeout = 4000) public void test091() throws Throwable { BigInteger bigInteger0 = NumberUtils.createBigInteger("28"); assertEquals((short)28, bigInteger0.shortValue()); } @Test(timeout = 4000) public void test092() throws Throwable { Long long0 = NumberUtils.createLong("0x5F"); assertEquals(95L, (long)long0); } @Test(timeout = 4000) public void test093() throws Throwable { // Undeclared exception! try { NumberUtils.createInteger("15eL"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // For input string: \"15eL\" // verifyException("java.lang.NumberFormatException", e); } } @Test(timeout = 4000) public void test094() throws Throwable { Double double0 = NumberUtils.createDouble("-2"); assertEquals((-2.0), (double)double0, 0.01); } @Test(timeout = 4000) public void test095() throws Throwable { Float float0 = NumberUtils.createFloat("038"); assertEquals(38.0F, (float)float0, 0.01F); } @Test(timeout = 4000) public void test096() throws Throwable { short short0 = NumberUtils.toShort("", (short)0); assertEquals((short)0, short0); } @Test(timeout = 4000) public void test097() throws Throwable { byte byte0 = NumberUtils.toByte("c`]0ihdi#", (byte) (-68)); assertEquals((byte) (-68), byte0); } @Test(timeout = 4000) public void test098() throws Throwable { double double0 = NumberUtils.toDouble("ima}7|`GTz&vPkR\"B", (-2386.155994)); assertEquals((-2386.155994), double0, 0.01); } @Test(timeout = 4000) public void test099() throws Throwable { float float0 = NumberUtils.toFloat((String) null, 0.0F); assertEquals(0.0F, float0, 0.01F); } @Test(timeout = 4000) public void test100() throws Throwable { float float0 = NumberUtils.toFloat("-qJQa{5&3SZ95wat.BU", 1039.7252F); assertEquals(1039.7252F, float0, 0.01F); } @Test(timeout = 4000) public void test101() throws Throwable { long long0 = NumberUtils.toLong("|M", 0L); assertEquals(0L, long0); } @Test(timeout = 4000) public void test102() throws Throwable { int int0 = NumberUtils.toInt("", 0); assertEquals(0, int0); } @Test(timeout = 4000) public void test103() throws Throwable { boolean boolean0 = NumberUtils.isNumber("l"); assertFalse(boolean0); } @Test(timeout = 4000) public void test104() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0L"); assertTrue(boolean0); } @Test(timeout = 4000) public void test105() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0f"); assertTrue(boolean0); } @Test(timeout = 4000) public void test106() throws Throwable { boolean boolean0 = NumberUtils.isNumber("D"); assertFalse(boolean0); } @Test(timeout = 4000) public void test107() throws Throwable { boolean boolean0 = NumberUtils.isNumber("d"); assertFalse(boolean0); } @Test(timeout = 4000) public void test108() throws Throwable { boolean boolean0 = NumberUtils.isNumber("5F"); assertTrue(boolean0); } @Test(timeout = 4000) public void test109() throws Throwable { boolean boolean0 = NumberUtils.isNumber("7e."); assertFalse(boolean0); } @Test(timeout = 4000) public void test110() throws Throwable { boolean boolean0 = NumberUtils.isNumber("."); assertFalse(boolean0); } @Test(timeout = 4000) public void test111() throws Throwable { boolean boolean0 = NumberUtils.isNumber(".."); assertFalse(boolean0); } @Test(timeout = 4000) public void test112() throws Throwable { boolean boolean0 = NumberUtils.isNumber("E"); assertFalse(boolean0); } @Test(timeout = 4000) public void test113() throws Throwable { boolean boolean0 = NumberUtils.isNumber("7e"); assertFalse(boolean0); } @Test(timeout = 4000) public void test114() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0e("); assertFalse(boolean0); } @Test(timeout = 4000) public void test115() throws Throwable { boolean boolean0 = NumberUtils.isNumber("77E+iu+qQ\"*+E#e<`"); assertFalse(boolean0); } @Test(timeout = 4000) public void test116() throws Throwable { boolean boolean0 = NumberUtils.isNumber("+7<%6{'"); assertFalse(boolean0); } @Test(timeout = 4000) public void test117() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0e.A"); assertFalse(boolean0); } @Test(timeout = 4000) public void test118() throws Throwable { boolean boolean0 = NumberUtils.isNumber("..."); assertFalse(boolean0); } @Test(timeout = 4000) public void test119() throws Throwable { boolean boolean0 = NumberUtils.isNumber("--.NM"); assertFalse(boolean0); } @Test(timeout = 4000) public void test120() throws Throwable { boolean boolean0 = NumberUtils.isNumber("15eL"); assertFalse(boolean0); } @Test(timeout = 4000) public void test121() throws Throwable { boolean boolean0 = NumberUtils.isNumber("-"); assertFalse(boolean0); } @Test(timeout = 4000) public void test122() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0x5F"); assertTrue(boolean0); } @Test(timeout = 4000) public void test123() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0xas,\"g}f"); assertFalse(boolean0); } @Test(timeout = 4000) public void test124() throws Throwable { boolean boolean0 = NumberUtils.isNumber("-0x19-hx["); assertFalse(boolean0); } @Test(timeout = 4000) public void test125() throws Throwable { boolean boolean0 = NumberUtils.isNumber("-0x"); assertFalse(boolean0); } @Test(timeout = 4000) public void test126() throws Throwable { boolean boolean0 = NumberUtils.isNumber("0ee("); assertFalse(boolean0); } @Test(timeout = 4000) public void test127() throws Throwable { boolean boolean0 = NumberUtils.isNumber("7"); assertTrue(boolean0); } @Test(timeout = 4000) public void test128() throws Throwable { boolean boolean0 = NumberUtils.isNumber("E(|a#cbb<KO"); assertFalse(boolean0); } @Test(timeout = 4000) public void test129() throws Throwable { boolean boolean0 = NumberUtils.isNumber((String) null); assertFalse(boolean0); } @Test(timeout = 4000) public void test130() throws Throwable { boolean boolean0 = NumberUtils.isDigits((String) null); assertFalse(boolean0); } @Test(timeout = 4000) public void test131() throws Throwable { byte byte0 = NumberUtils.max((byte)5, (byte)8, (byte)53); assertEquals((byte)53, byte0); } @Test(timeout = 4000) public void test132() throws Throwable { byte byte0 = NumberUtils.max((byte) (-12), (byte)0, (byte) (-82)); assertEquals((byte)0, byte0); } @Test(timeout = 4000) public void test133() throws Throwable { byte byte0 = NumberUtils.max((byte) (-120), (byte) (-120), (byte) (-120)); assertEquals((byte) (-120), byte0); } @Test(timeout = 4000) public void test134() throws Throwable { short short0 = NumberUtils.max((short) (-2632), (short)13, (short)0); assertEquals((short)13, short0); } @Test(timeout = 4000) public void test135() throws Throwable { short short0 = NumberUtils.max((short) (-9078), (short) (-9078), (short) (-1241)); assertEquals((short) (-1241), short0); } @Test(timeout = 4000) public void test136() throws Throwable { int int0 = NumberUtils.max((-1705), (-1705), 69); assertEquals(69, int0); } @Test(timeout = 4000) public void test137() throws Throwable { int int0 = NumberUtils.max((-874), (int) (byte)0, (-1162)); assertEquals(0, int0); } @Test(timeout = 4000) public void test138() throws Throwable { int int0 = NumberUtils.max((-708), (-708), (-1942)); assertEquals((-708), int0); } @Test(timeout = 4000) public void test139() throws Throwable { long long0 = NumberUtils.max(0L, 0L, 0L); assertEquals(0L, long0); } @Test(timeout = 4000) public void test140() throws Throwable { long long0 = NumberUtils.max((-1145L), 1L, 745L); assertEquals(745L, long0); } @Test(timeout = 4000) public void test141() throws Throwable { long long0 = NumberUtils.max((-1497L), (-1497L), (-1L)); assertEquals((-1L), long0); } @Test(timeout = 4000) public void test142() throws Throwable { byte byte0 = NumberUtils.min((byte)43, (byte)110, (byte) (-89)); assertEquals((byte) (-89), byte0); } @Test(timeout = 4000) public void test143() throws Throwable { byte byte0 = NumberUtils.min((byte)97, (byte)0, (byte)97); assertEquals((byte)0, byte0); } @Test(timeout = 4000) public void test144() throws Throwable { byte byte0 = NumberUtils.min((byte) (-34), (byte) (-34), (byte) (-34)); assertEquals((byte) (-34), byte0); } @Test(timeout = 4000) public void test145() throws Throwable { short short0 = NumberUtils.min((short)3, (short)93, (short) (-1630)); assertEquals((short) (-1630), short0); } @Test(timeout = 4000) public void test146() throws Throwable { int int0 = NumberUtils.min(674, (-127), (-1061)); assertEquals((-1061), int0); } @Test(timeout = 4000) public void test147() throws Throwable { int int0 = NumberUtils.min((-46502196), 8192, 8192); assertEquals((-46502196), int0); } @Test(timeout = 4000) public void test148() throws Throwable { long long0 = NumberUtils.min(3674L, 3674L, 3651L); assertEquals(3651L, long0); } @Test(timeout = 4000) public void test149() throws Throwable { long long0 = NumberUtils.min((long) 0, (-636L), 0L); assertEquals((-636L), long0); } @Test(timeout = 4000) public void test150() throws Throwable { float[] floatArray0 = new float[2]; floatArray0[0] = (-2120.0F); float float0 = NumberUtils.max(floatArray0); assertEquals(0.0F, float0, 0.01F); } @Test(timeout = 4000) public void test151() throws Throwable { float[] floatArray0 = new float[7]; floatArray0[5] = Float.NaN; float float0 = NumberUtils.max(floatArray0); assertEquals(Float.NaN, float0, 0.01F); } @Test(timeout = 4000) public void test152() throws Throwable { float[] floatArray0 = new float[0]; // Undeclared exception! try { NumberUtils.max(floatArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test153() throws Throwable { // Undeclared exception! try { NumberUtils.max((float[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test154() throws Throwable { double[] doubleArray0 = new double[7]; doubleArray0[0] = (-2497.120974057); double double0 = NumberUtils.max(doubleArray0); assertEquals(0.0, double0, 0.01); } @Test(timeout = 4000) public void test155() throws Throwable { double[] doubleArray0 = new double[7]; doubleArray0[2] = Double.NaN; double double0 = NumberUtils.max(doubleArray0); assertEquals(Double.NaN, double0, 0.01); } @Test(timeout = 4000) public void test156() throws Throwable { double[] doubleArray0 = new double[0]; // Undeclared exception! try { NumberUtils.max(doubleArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test157() throws Throwable { // Undeclared exception! try { NumberUtils.max((double[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test158() throws Throwable { byte[] byteArray0 = new byte[5]; byteArray0[1] = (byte)106; byte byte0 = NumberUtils.max(byteArray0); assertEquals((byte)106, byte0); } @Test(timeout = 4000) public void test159() throws Throwable { byte[] byteArray0 = new byte[0]; // Undeclared exception! try { NumberUtils.max(byteArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test160() throws Throwable { // Undeclared exception! try { NumberUtils.max((byte[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test161() throws Throwable { byte[] byteArray0 = new byte[5]; byte byte0 = NumberUtils.max(byteArray0); assertEquals((byte)0, byte0); } @Test(timeout = 4000) public void test162() throws Throwable { short[] shortArray0 = new short[6]; shortArray0[0] = (short) (-9); short short0 = NumberUtils.max(shortArray0); assertEquals((short)0, short0); } @Test(timeout = 4000) public void test163() throws Throwable { short[] shortArray0 = new short[0]; // Undeclared exception! try { NumberUtils.max(shortArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test164() throws Throwable { // Undeclared exception! try { NumberUtils.max((short[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test165() throws Throwable { int[] intArray0 = new int[4]; intArray0[0] = (-1279); int int0 = NumberUtils.max(intArray0); assertEquals(0, int0); } @Test(timeout = 4000) public void test166() throws Throwable { int[] intArray0 = new int[0]; // Undeclared exception! try { NumberUtils.max(intArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test167() throws Throwable { // Undeclared exception! try { NumberUtils.max((int[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test168() throws Throwable { long[] longArray0 = new long[12]; longArray0[1] = 1255L; long long0 = NumberUtils.max(longArray0); assertEquals(1255L, long0); } @Test(timeout = 4000) public void test169() throws Throwable { long[] longArray0 = new long[12]; long long0 = NumberUtils.max(longArray0); assertEquals(0L, long0); } @Test(timeout = 4000) public void test170() throws Throwable { long[] longArray0 = new long[0]; // Undeclared exception! try { NumberUtils.max(longArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test171() throws Throwable { // Undeclared exception! try { NumberUtils.max((long[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test172() throws Throwable { float[] floatArray0 = new float[6]; floatArray0[0] = 1.0F; float float0 = NumberUtils.min(floatArray0); assertEquals(0.0F, float0, 0.01F); } @Test(timeout = 4000) public void test173() throws Throwable { float[] floatArray0 = new float[8]; floatArray0[4] = Float.NaN; float float0 = NumberUtils.min(floatArray0); assertEquals(Float.NaN, float0, 0.01F); } @Test(timeout = 4000) public void test174() throws Throwable { float[] floatArray0 = new float[0]; // Undeclared exception! try { NumberUtils.min(floatArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test175() throws Throwable { // Undeclared exception! try { NumberUtils.min((float[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test176() throws Throwable { double[] doubleArray0 = new double[7]; doubleArray0[0] = 169.6937613; double double0 = NumberUtils.min(doubleArray0); assertEquals(0.0, double0, 0.01); } @Test(timeout = 4000) public void test177() throws Throwable { double[] doubleArray0 = new double[7]; doubleArray0[3] = Double.NaN; double double0 = NumberUtils.min(doubleArray0); assertEquals(Double.NaN, double0, 0.01); } @Test(timeout = 4000) public void test178() throws Throwable { double[] doubleArray0 = new double[0]; // Undeclared exception! try { NumberUtils.min(doubleArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test179() throws Throwable { // Undeclared exception! try { NumberUtils.min((double[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test180() throws Throwable { byte[] byteArray0 = new byte[9]; byteArray0[8] = (byte) (-98); byte byte0 = NumberUtils.min(byteArray0); assertEquals((byte) (-98), byte0); } @Test(timeout = 4000) public void test181() throws Throwable { byte[] byteArray0 = new byte[0]; // Undeclared exception! try { NumberUtils.min(byteArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test182() throws Throwable { // Undeclared exception! try { NumberUtils.min((byte[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test183() throws Throwable { byte[] byteArray0 = new byte[3]; byte byte0 = NumberUtils.min(byteArray0); assertEquals((byte)0, byte0); } @Test(timeout = 4000) public void test184() throws Throwable { short[] shortArray0 = new short[8]; shortArray0[0] = (short)2; short short0 = NumberUtils.min(shortArray0); assertEquals((short)0, short0); } @Test(timeout = 4000) public void test185() throws Throwable { short[] shortArray0 = new short[0]; // Undeclared exception! try { NumberUtils.min(shortArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test186() throws Throwable { // Undeclared exception! try { NumberUtils.min((short[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test187() throws Throwable { int[] intArray0 = new int[5]; intArray0[0] = 1567; int int0 = NumberUtils.min(intArray0); assertEquals(0, int0); } @Test(timeout = 4000) public void test188() throws Throwable { int[] intArray0 = new int[0]; // Undeclared exception! try { NumberUtils.min(intArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test189() throws Throwable { // Undeclared exception! try { NumberUtils.min((int[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test190() throws Throwable { long[] longArray0 = new long[7]; longArray0[0] = 1318L; long long0 = NumberUtils.min(longArray0); assertEquals(0L, long0); } @Test(timeout = 4000) public void test191() throws Throwable { long[] longArray0 = new long[0]; // Undeclared exception! try { NumberUtils.min(longArray0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Array cannot be empty. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test192() throws Throwable { // Undeclared exception! try { NumberUtils.min((long[]) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Array must not be null // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test193() throws Throwable { try { NumberUtils.createNumber("D"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // D is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test194() throws Throwable { BigDecimal bigDecimal0 = NumberUtils.createBigDecimal((String) null); assertNull(bigDecimal0); } @Test(timeout = 4000) public void test195() throws Throwable { BigInteger bigInteger0 = NumberUtils.createBigInteger((String) null); assertNull(bigInteger0); } @Test(timeout = 4000) public void test196() throws Throwable { Long long0 = NumberUtils.createLong((String) null); assertNull(long0); } @Test(timeout = 4000) public void test197() throws Throwable { Integer integer0 = NumberUtils.createInteger((String) null); assertNull(integer0); } @Test(timeout = 4000) public void test198() throws Throwable { Double double0 = NumberUtils.createDouble((String) null); assertNull(double0); } @Test(timeout = 4000) public void test199() throws Throwable { Float float0 = NumberUtils.createFloat((String) null); assertNull(float0); } @Test(timeout = 4000) public void test200() throws Throwable { Number number0 = NumberUtils.createNumber(".7"); assertEquals(0.7F, number0); } @Test(timeout = 4000) public void test201() throws Throwable { Number number0 = NumberUtils.createNumber(".0"); assertEquals((short)0, number0.shortValue()); } @Test(timeout = 4000) public void test202() throws Throwable { try { NumberUtils.createNumber("0E:e2"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // For input string: \"E:e2\" // verifyException("java.lang.NumberFormatException", e); } } @Test(timeout = 4000) public void test203() throws Throwable { Number number0 = NumberUtils.createNumber("0e8"); assertEquals((short)0, number0.shortValue()); } @Test(timeout = 4000) public void test204() throws Throwable { try { NumberUtils.createNumber("-0|L"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // -0|L is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test205() throws Throwable { Number number0 = NumberUtils.createNumber("-04L"); assertEquals((-4L), number0); } @Test(timeout = 4000) public void test206() throws Throwable { Number number0 = NumberUtils.createNumber("0L"); assertEquals(0L, number0); } @Test(timeout = 4000) public void test207() throws Throwable { try { NumberUtils.createNumber("Strings must not be null"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // Strings must not be null is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test208() throws Throwable { // Undeclared exception! try { NumberUtils.createNumber("l"); fail("Expecting exception: StringIndexOutOfBoundsException"); } catch(StringIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test209() throws Throwable { Number number0 = NumberUtils.createNumber("0f"); assertEquals((short)0, number0.shortValue()); } @Test(timeout = 4000) public void test210() throws Throwable { try { NumberUtils.createNumber("V4cMNid"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // V4cMNid is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test211() throws Throwable { Number number0 = NumberUtils.createNumber("5F"); assertEquals(5.0F, number0); } @Test(timeout = 4000) public void test212() throws Throwable { Number number0 = NumberUtils.createNumber("04D"); assertEquals(4.0, number0); } @Test(timeout = 4000) public void test213() throws Throwable { try { NumberUtils.createNumber("0e(:"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // 0e(: is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test214() throws Throwable { try { NumberUtils.createNumber("0e"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // 0e is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test215() throws Throwable { try { NumberUtils.createNumber("pDOEw_`0e;5"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // pDOEw_`0e;5 is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test216() throws Throwable { try { NumberUtils.createNumber("2#n9m]:`3wn.e4Ea"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // 2#n9m]:`3wn.e4Ea is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test217() throws Throwable { try { NumberUtils.createNumber("{|%z1cjijEPbyk.Hj"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // {|%z1cjijEPbyk.Hj is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test218() throws Throwable { Number number0 = NumberUtils.createNumber("0."); assertEquals(0.0F, number0); } @Test(timeout = 4000) public void test219() throws Throwable { try { NumberUtils.createNumber("8Q.!6SLEi3)SZFZfL"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // 8Q.!6SLEi3)SZFZfL is not a valid number. // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test220() throws Throwable { try { NumberUtils.createNumber("-0X^c\fTNq-n-2UXA,pCO"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // For input string: \"-^c\fTNq-n-2UXA,pCO\" // verifyException("java.lang.NumberFormatException", e); } } @Test(timeout = 4000) public void test221() throws Throwable { try { NumberUtils.createNumber("0X"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // For input string: \"\" // verifyException("java.lang.NumberFormatException", e); } } @Test(timeout = 4000) public void test222() throws Throwable { try { NumberUtils.createNumber("-0xlX"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // For input string: \"-lX\" // verifyException("java.lang.NumberFormatException", e); } } @Test(timeout = 4000) public void test223() throws Throwable { try { NumberUtils.createNumber("0x^Az[%Sg:"); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // For input string: \"^Az[%Sg:\" // verifyException("java.lang.NumberFormatException", e); } } @Test(timeout = 4000) public void test224() throws Throwable { Number number0 = NumberUtils.createNumber("--$AZ=9#[eD1"); assertNull(number0); } @Test(timeout = 4000) public void test225() throws Throwable { try { NumberUtils.createNumber(""); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // A blank string is not a valid number // verifyException("org.apache.commons.lang3.math.NumberUtils", e); } } @Test(timeout = 4000) public void test226() throws Throwable { Number number0 = NumberUtils.createNumber((String) null); assertNull(number0); } @Test(timeout = 4000) public void test227() throws Throwable { short short0 = NumberUtils.toShort((String) null, (short) (byte)0); assertEquals((short)0, short0); } @Test(timeout = 4000) public void test228() throws Throwable { byte byte0 = NumberUtils.toByte((String) null, (byte)0); assertEquals((byte)0, byte0); } @Test(timeout = 4000) public void test229() throws Throwable { double double0 = NumberUtils.toDouble((String) null, (-1491.55)); assertEquals((-1491.55), double0, 0.01); } @Test(timeout = 4000) public void test230() throws Throwable { float float0 = NumberUtils.toFloat((String) null); assertEquals(0.0F, float0, 0.01F); } @Test(timeout = 4000) public void test231() throws Throwable { long long0 = NumberUtils.toLong((String) null, 7L); assertEquals(7L, long0); } @Test(timeout = 4000) public void test232() throws Throwable { int int0 = NumberUtils.toInt((String) null, (int) (short) (-23)); assertEquals((-23), int0); } @Test(timeout = 4000) public void test233() throws Throwable { short short0 = NumberUtils.toShort("7"); assertEquals((short)7, short0); } @Test(timeout = 4000) public void test234() throws Throwable { float float0 = NumberUtils.toFloat("-2"); assertEquals((-2.0F), float0, 0.01F); } @Test(timeout = 4000) public void test235() throws Throwable { int int0 = NumberUtils.toInt("-2"); assertEquals((-2), int0); } @Test(timeout = 4000) public void test236() throws Throwable { long long0 = NumberUtils.toLong("-2"); assertEquals((-2L), long0); } @Test(timeout = 4000) public void test237() throws Throwable { double double0 = NumberUtils.max((double) (short)69, (double) (short)69, (double) (short)69); assertEquals(69.0, double0, 0.01); } @Test(timeout = 4000) public void test238() throws Throwable { byte byte0 = NumberUtils.toByte("-2"); assertEquals((byte) (-2), byte0); } @Test(timeout = 4000) public void test239() throws Throwable { NumberUtils numberUtils0 = new NumberUtils(); long long0 = NumberUtils.min((long) numberUtils0.INTEGER_MINUS_ONE, (long) numberUtils0.SHORT_ZERO, (long) numberUtils0.LONG_ONE); assertEquals((-1L), long0); } @Test(timeout = 4000) public void test240() throws Throwable { double double0 = NumberUtils.toDouble("-2"); assertEquals((-2.0), double0, 0.01); } @Test(timeout = 4000) public void test241() throws Throwable { float float0 = NumberUtils.min((float) 0, (float) 0, (float) (short)0); assertEquals(0.0F, float0, 0.01F); } @Test(timeout = 4000) public void test242() throws Throwable { float float0 = NumberUtils.max((-1516.0F), (float) (short) (-9), (float) (short) (-19974)); assertEquals((-9.0F), float0, 0.01F); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
016da92d0e63dfff7da7bfc7750e485e6175faf9
5c6e742c57a4f08fe8b4f302a6700a29e656c251
/src/coastwatch.vertigo/noaa/coastwatch/vertigo/NetCDFDataSource.java
a8a798d10c07fca5b202888569d7f124381b6376
[]
no_license
sypcloud/vertigo
f11aaf6ad5b4c24e7ea7e07d47530e92dbb7a482
2f66da6abd63a054cc336417f98b1946fb64f1ff
refs/heads/main
2023-01-30T14:29:25.155765
2020-12-20T12:36:13
2020-12-20T12:36:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,863
java
/* * Vertigo Project * Copyright (c) 2020 National Oceanic and Atmospheric Administration * All rights reserved. */ package noaa.coastwatch.vertigo; import ucar.nc2.dataset.DatasetUrl; import ucar.nc2.dataset.NetcdfDataset; import ucar.nc2.dataset.NetcdfDatasets; import ucar.nc2.util.CancelTask; import ucar.nc2.Variable; import ucar.ma2.Array; import ucar.ma2.Index; import ucar.ma2.Section; import java.io.IOException; import java.util.logging.Logger; import java.util.function.BooleanSupplier; import static noaa.coastwatch.vertigo.Helpers.isTrue; /** * The <code>NetCDFDataSource</code> class provides data values from a 2D slice * of a variable in a NetCDF dataset. * * @author Peter Hollemans * @since 0.5 */ public class NetCDFDataSource implements ImageDataSource<double[]> { private static final Logger LOGGER = Logger.getLogger (NetCDFDataSource.class.getName()); // Variables // --------- /** The NetCDF dataset, possibly remote. */ private String datasetName; /** The variable name to access. */ private String varName; /** The 2D slice of the variable to access. */ private int[] slice; ///////////////////////////////////////////////////////////////// static { var fileCache = NetcdfDatasets.getNetcdfFileCache(); if (fileCache == null) { LOGGER.fine ("Initializing NetCDF file cache"); NetcdfDatasets.initNetcdfFileCache (256, 512, 30); } // if // TODO: Where should we call NetcdfDatasets.shutdown() ? } // static ///////////////////////////////////////////////////////////////// /** * Creates a new NetCDF source. * * @param datasetName the full path to the dataset, including protocol if remote. * @param varName the name of the variable within the dataset to access. * @param slice the 2D slice of the dataset to access. This is an array * of values, two of which must be -1 to signify the dimensions to use for * the x and y indices of the slice. All other slice values are the variable * dimensions to read with stride = 1 and length = 1. */ public NetCDFDataSource ( String datasetName, String varName, int[] slice ) { this.datasetName = datasetName; this.varName = varName; this.slice = slice; } // NetCDFDataSource ///////////////////////////////////////////////////////////////// /** Holds data for cancelling a NetCDF dataset task. */ private static class NetCDFCancelTask implements CancelTask { private BooleanSupplier cancelled; @Override public boolean isCancel () { return (cancelled.getAsBoolean()); } @Override public void setError (String msg) { } @Override public void setProgress (String msg, int progress) { } public NetCDFCancelTask (BooleanSupplier cancelled) { this.cancelled = cancelled; } } // NetCDFCancelTask ///////////////////////////////////////////////////////////////// /** The context data from a call to {@link #access}. */ private static class NetCDFDataContext { private Array dataArray; private Index valueIndex; } // NetCDFDataContext class ///////////////////////////////////////////////////////////////// @Override public ImageAccessResult access ( ImageAccess access, BooleanSupplier cancelled ) { int rank = slice.length; int[] start = new int[rank]; int[] length = new int[rank]; int[] stride = new int[rank]; int[] xyStart = new int[] {access.tile.minX, access.tile.minY}; int[] xyLength = new int[] {access.tile.width, access.tile.height}; int[] xyStride = new int[] {access.strideX, access.strideY}; int xy = 0; for (int i = 0; i < rank; i++) { if (slice[i] < 0) { start[i] = xyStart[xy]; length[i] = xyLength[xy]; stride[i] = xyStride[xy]; xy++; } // if else { start[i] = slice[i]; length[i] = 1; stride[i] = 1; } // else } // for DatasetUrl url = null; try { url = DatasetUrl.findDatasetUrl (datasetName); } catch (IOException e) { throw new RuntimeException (e); } CancelTask task = (cancelled != null ? new NetCDFCancelTask (cancelled) : null); ImageAccessResult result = null; try (NetcdfDataset ncDataset = NetcdfDatasets.acquireDataset (url, task)) { var root = ncDataset.getRootGroup(); Variable variable = ncDataset.findVariable (root, varName); Section section = new Section (start, length, stride); if (!isTrue (cancelled)) { NetCDFDataContext context = new NetCDFDataContext(); context.dataArray = variable.read (section); context.valueIndex = context.dataArray.getIndex(); result = new ImageAccessResult (access, context); } // if } // try catch (Exception e) { throw new RuntimeException (e); } return (result); } // access ///////////////////////////////////////////////////////////////// @Override public void get ( ImageAccessResult result, int x, int y, double[] data ) { NetCDFDataContext context = (NetCDFDataContext) result.context; context.valueIndex.set (x, y); data[0] = context.dataArray.getDouble (context.valueIndex); } // get ///////////////////////////////////////////////////////////////// @Override public void getMany ( ImageAccessResult result, ImageCoordinateIterator iter, double[] data ) { NetCDFDataContext context = (NetCDFDataContext) result.context; int index = 0; while (iter.hasNext()) { iter.next(); context.valueIndex.set (iter.getX(), iter.getY()); data[index] = context.dataArray.getDouble (context.valueIndex); index++; } // while } // getMany ///////////////////////////////////////////////////////////////// } // NetCDFDataSource class
[ "peter@terrenus.ca" ]
peter@terrenus.ca
62c18543cd428e6c88c14d16b8691ea541711582
0e59dd845afd2579eedccad0498120f4d5e3556a
/Settings/com/android/settings/applications/PermissionsSummaryHelper.java
5cdd24aa0a8a103aa5abd1812b6ac8767f037768
[]
no_license
Thief007/x9pro
64cb51e4af78e68495ac87e42d912120109a0855
48ef78fcccb5fbab18d296d9c9d857ee499a3ce6
refs/heads/master
2021-01-19T23:33:19.317738
2017-04-22T08:12:26
2017-04-22T08:12:26
88,994,456
1
0
null
null
null
null
UTF-8
Java
false
false
1,609
java
package com.android.settings.applications; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; public class PermissionsSummaryHelper { public interface PermissionsResultCallback { void onPermissionSummaryResult(int[] iArr, CharSequence[] charSequenceArr); } public static BroadcastReceiver getPermissionSummary(Context context, String pkg, PermissionsResultCallback callback) { Intent request = new Intent("android.intent.action.GET_PERMISSIONS_COUNT"); request.putExtra("android.intent.extra.PACKAGE_NAME", pkg); return sendPermissionRequest(context, "com.android.settings.PERM_COUNT_RESPONSE", request, callback); } private static BroadcastReceiver sendPermissionRequest(Context context, String action, Intent request, final PermissionsResultCallback callback) { BroadcastReceiver receiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { callback.onPermissionSummaryResult(intent.getIntArrayExtra("android.intent.extra.GET_PERMISSIONS_COUNT_RESULT"), intent.getCharSequenceArrayExtra("android.intent.extra.GET_PERMISSIONS_GROUP_LIST_RESULT")); context.unregisterReceiver(this); } }; context.registerReceiver(receiver, new IntentFilter(action)); request.putExtra("android.intent.extra.GET_PERMISSIONS_RESONSE_INTENT", action); request.setFlags(268435456); context.sendBroadcast(request); return receiver; } }
[ "cat_007@ukr.net" ]
cat_007@ukr.net
c464ffca16f9fd30c6d279f0895ac82eb0aebc61
034094e7b821ac71931e146d69c93ce12e708b77
/src/dataRecords/CategoryRecord.java
d51103ff51f22bf4f6173d2eb51d7ecbade8e123
[]
no_license
chadsyarber/ItTicketDashboard
99d7d3a79349b76ad26c3a5927ee43082b43f473
9d5d98428b9981978f8d8aa2e5eeca65ba15e1e1
refs/heads/master
2020-04-05T16:11:44.631557
2018-11-10T16:50:03
2018-11-10T16:50:03
157,001,112
0
0
null
null
null
null
UTF-8
Java
false
false
1,849
java
package dataRecords; /** * Represents the HD_CATEGORY table * @author Chad Yarber * */ public class CategoryRecord { private long id; private long hdQueueId; private String name; private String ordinal; private long defaultOwnerId; private String ccList; private String userSettable; public CategoryRecord() { // TODO Auto-generated constructor stub } /** * @return the id */ public long getId() { return id; } /** * @param id the id to set */ public void setId(long id) { this.id = id; } /** * @return the hdQueueId */ public long getHdQueueId() { return hdQueueId; } /** * @param hdQueueId the hdQueueId to set */ public void setHdQueueId(long hdQueueId) { this.hdQueueId = hdQueueId; } /** * @return the name */ public String getName() { return name; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the ordinal */ public String getOrdinal() { return ordinal; } /** * @param ordinal the ordinal to set */ public void setOrdinal(String ordinal) { this.ordinal = ordinal; } /** * @return the defaultOwnerId */ public long getDefaultOwnerId() { return defaultOwnerId; } /** * @param defaultOwnerId the defaultOwnerId to set */ public void setDefaultOwnerId(long defaultOwnerId) { this.defaultOwnerId = defaultOwnerId; } /** * @return the ccList */ public String getCcList() { return ccList; } /** * @param ccList the ccList to set */ public void setCcList(String ccList) { this.ccList = ccList; } /** * @return the userSettable */ public String getUserSettable() { return userSettable; } /** * @param userSettable the userSettable to set */ public void setUserSettable(String userSettable) { this.userSettable = userSettable; } }
[ "noreply@github.com" ]
chadsyarber.noreply@github.com
b8c0c042dbbe95ec8e781c276e63d31f7c5be96e
1fcf1e284b5638f18fa4359e92469a78e6a6e9a9
/src/main/java/edu/lera/cursach/dao/schedule/impls/ScheduleDaoImplFake.java
c21bc3779be8a0c4503189e8b92d51c59aa6b9b7
[]
no_license
leralera2201/cursach
9a0d08fc11beb71a79951049ee8ef404bfce3ef6
0f0f81592d4ebf685ac9f0fa10939508492de663
refs/heads/master
2021-01-13T21:12:18.064480
2020-05-17T14:54:46
2020-05-17T14:54:46
242,496,210
0
0
null
null
null
null
UTF-8
Java
false
false
1,176
java
package edu.lera.cursach.dao.schedule.impls; import edu.lera.cursach.dao.schedule.interfaces.IScheduleDao; import edu.lera.cursach.dataSet.DataSet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; @Component public class ScheduleDaoImplFake implements IScheduleDao { @Autowired DataSet dataSet; // @Override // public edu.lera.cursach.model.Tourist save(edu.lera.cursach.model.Tourist tourist) { // dataSet.getTourists().add(tourist); // return tourist; // } @Override public edu.lera.cursach.model.Schedule save(edu.lera.cursach.model.Schedule schedule) { return null; } @Override public edu.lera.cursach.model.Schedule get(String id) { return null; } @Override public List<edu.lera.cursach.model.Schedule> getAll() { return dataSet.getSchedules(); } @Override public edu.lera.cursach.model.Schedule edit(edu.lera.cursach.model.Schedule schedule) { return null; } @Override public edu.lera.cursach.model.Schedule delete(String id) { return null; } }
[ "leravodancuk@gmail.com" ]
leravodancuk@gmail.com
66910f51ac127d3f226ca5cd8aef16c853486c9a
5a71d27c5f961da32a77ed3eda9123fb5894fb5f
/home_work_1/Hw4.java
5656a69ac8ac2220a25bd43ce34c18264213cc94
[]
no_license
maksimmgit/newrepo
affb47baa4a8b36bbc05b8ba6b0e587be82bc117
891a91ad1bce932aa3174eee9642eb6f3df42b1b
refs/heads/master
2023-06-13T02:06:24.498493
2021-07-10T07:51:09
2021-07-10T07:51:09
352,132,078
0
0
null
null
null
null
UTF-8
Java
false
false
790
java
package home_work_1; import java.util.Scanner; public class Hw4 { public static void main(String[] args) { int week = 5; int vaca = 7; Scanner sc = new Scanner (System.in); int day = sc.nextInt(); boolean weekday = true; boolean vacation = true; switch(day){ case 7: weekday = false; break; default: vacation = false; } if (sleepIn(weekday, vacation)) { System.out.println("Можно спать"); } else { System.out.println("работать"); } } public static boolean sleepIn(boolean weekday, boolean vacation){ return !weekday || vacation; } }
[ "maximum38@ya.ru" ]
maximum38@ya.ru
8ecd70234ea2c0f47172b47e0fd0ee2b84175b91
b14dd83b0b6c89e18d27ca9410ce0b3e53954276
/doric-android/devkit/src/main/java/pub/doric/devkit/ui/DoricDevActivity.java
b5900ecd035f6f30d440e91514cfe812ebbae12b
[ "Apache-2.0" ]
permissive
quietUncle/Doric
8c2f57ada33a4c059587041c05e87edb6c95d19f
b9d27e40a8686aca2e49031e91e9bd7aa7ce844f
refs/heads/master
2023-03-14T08:07:09.133571
2020-05-25T10:08:45
2020-05-25T10:08:45
255,601,166
1
0
Apache-2.0
2020-04-30T08:40:41
2020-04-14T12:19:54
JavaScript
UTF-8
Java
false
false
6,412
java
package pub.doric.devkit.ui; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import com.google.gson.JsonObject; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import pub.doric.DoricContext; import pub.doric.DoricContextManager; import pub.doric.devkit.DevKit; import pub.doric.devkit.DoricDev; import pub.doric.devkit.IDevKit; import pub.doric.devkit.R; import pub.doric.devkit.event.ConnectExceptionEvent; import pub.doric.devkit.event.EOFExceptionEvent; import pub.doric.devkit.event.OpenEvent; import pub.doric.devkit.event.StartDebugEvent; import pub.doric.devkit.qrcode.DisplayUtil; import pub.doric.devkit.qrcode.activity.CaptureActivity; import pub.doric.devkit.qrcode.activity.CodeUtils; public class DoricDevActivity extends AppCompatActivity { private int REQUEST_CODE = 100; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); DisplayUtil.initDisplayOpinion(getApplicationContext()); setContentView(R.layout.layout_debug_context); initDisconnect(); if (DoricDev.getInstance().isInDevMode()) { initViews(); } else { if (DevKit.isRunningInEmulator) { DevKit.ip = "10.0.2.2"; DevKit.getInstance().connectDevKit("ws://" + DevKit.ip + ":7777"); } else { if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA)) { } else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA,}, 1); } } else { Intent intent = new Intent(DoricDevActivity.this, CaptureActivity.class); startActivityForResult(intent, REQUEST_CODE); } } } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == 1) { for (int i = 0; i < permissions.length; i++) { if (grantResults[i] == PackageManager.PERMISSION_GRANTED) { Intent intent = new Intent(DoricDevActivity.this, CaptureActivity.class); startActivityForResult(intent, REQUEST_CODE); } } } } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if (null != data) { Bundle bundle = data.getExtras(); if (bundle == null) { return; } if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) { String result = bundle.getString(CodeUtils.RESULT_STRING); DevKit.ip = result; Toast.makeText(this, "dev kit connecting to " + result, Toast.LENGTH_LONG).show(); DevKit.getInstance().connectDevKit("ws://" + result + ":7777"); } } } @Override protected void onDestroy() { super.onDestroy(); EventBus.getDefault().unregister(this); } @Subscribe(threadMode = ThreadMode.MAIN) public void onOpenEvent(OpenEvent openEvent) { initViews(); } @Subscribe(threadMode = ThreadMode.MAIN) public void onEOFEvent(EOFExceptionEvent eofExceptionEvent) { finish(); } @Subscribe(threadMode = ThreadMode.MAIN) public void onConnectExceptionEvent(ConnectExceptionEvent connectExceptionEvent) { finish(); } private void initDisconnect() { LinearLayout container = findViewById(R.id.container); Button button = new Button(this); button.setText("断开连接"); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (DoricDev.getInstance().isInDevMode()) { DoricDev.getInstance().closeDevMode(); } finish(); } }); container.addView(button); } private void initViews() { LinearLayout container = findViewById(R.id.container); LayoutInflater inflater = LayoutInflater.from(this); for (final DoricContext doricContext : DoricContextManager.aliveContexts()) { View cell = inflater.inflate(R.layout.layout_debug_context_cell, container, false); TextView contextIdTextView = cell.findViewById(R.id.context_id_text_view); contextIdTextView.setText(doricContext.getContextId()); TextView sourceTextView = cell.findViewById(R.id.source_text_view); sourceTextView.setText(doricContext.getSource()); cell.findViewById(R.id.debug_text_view).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EventBus.getDefault().post(new StartDebugEvent(doricContext.getContextId())); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("contextId", doricContext.getContextId()); jsonObject.addProperty("source", doricContext.getSource().replace(".js", ".ts")); DevKit.getInstance().sendDevCommand(IDevKit.Command.DEBUG, jsonObject); } }); container.addView(cell); } } }
[ "pengfeizhou@foxmail.com" ]
pengfeizhou@foxmail.com
746beb8e1f84425b4c8f7a3f386ce2f112104a58
1ba1843a9894e496f833111960a57405d5a96111
/patterns/anyToany.java
35a42e8ab69a164742a9d6bfd8edb295d6577e1e
[]
no_license
rish6696/CompetitiveQuestions
75e6aaa1b435311398353087971f3309d06966d7
d04257da02da3fedc84c99a1dc43e61461223627
refs/heads/master
2022-12-24T07:01:41.203921
2022-03-21T08:10:09
2022-03-21T08:10:09
232,403,573
0
0
null
2022-12-11T19:39:47
2020-01-07T19:44:45
Java
UTF-8
Java
false
false
1,002
java
public class anyToany { public static void main(String[] args) { //System.out.println(anytoany(10, 10, 8)); System.out.println(dectoany(10, 2)); } public static int anytoany(int any0,int sb0,int db0) { int dec,y; dec=anytodec(any0,sb0); y=dectoany(dec,db0); return y; } public static int anytodec(int any00,int sb00) { int rem=0,y=0,p=0,i=0; while(any00!=0) { rem=any00%10; p=power1(i,sb00); y=y+rem*p; any00=any00/10; i++; } return y; } public static int power1(int x,int sb0) { int m=1,j; if(x==0) { return 1; } else { for(j=1;j<=x;j++) { m=m*sb0; } } return m; } public static int dectoany(int dec0,int db0) { int rem=0,y=0,p=0,i=0; while(dec0!=0) { rem=dec0%db0; p=power(i); y=y+rem*p; dec0=dec0/db0; i++; } return y; } public static int power(int x) { int m=1,j; if(x==0) { return 1; } else { for(j=1;j<=x;j++) { m=m*10; } } return m; } }
[ "rish6696.rs@gmail.com" ]
rish6696.rs@gmail.com
3cab191324875d0d3637ade0488d81b875a73a98
12ea9628e21bf5da20ba5ef4391add047c71cbc3
/src/java/anhnt/tbl_User/Tbl_UserDAO.java
759214a82b2d0373e48fa19dcd615ccbfc89faed
[]
no_license
yukiakira269/FilterController
bf591d077465359ddfe31de188c383dec5d1b09f
f2423483d319d5772eddc4cc58aeb15586646af7
refs/heads/main
2023-03-20T10:17:21.102002
2021-03-14T07:18:43
2021-03-14T07:18:43
347,567,742
0
0
null
null
null
null
UTF-8
Java
false
false
6,915
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package anhnt.tbl_User; import anhnt.Utilities.DBUtilities; import java.io.Serializable; import java.sql.*; import java.util.ArrayList; import java.util.List; import javax.naming.NamingException; /** * * @author DELL */ public class Tbl_UserDAO implements Serializable { public List<String> getColumnNames() throws SQLException, NamingException { Connection con = null; PreparedStatement stm = null; ResultSet rs = null; try { con = DBUtilities.makeConnection(); String sql = "SELECT * FROM tbl_User"; stm = con.prepareStatement(sql); rs = stm.executeQuery(); List<String> columnNames = new ArrayList<>(); ResultSetMetaData rsmd = rs.getMetaData(); for (int i = 1; i <= rsmd.getColumnCount(); i++) { columnNames.add(rsmd.getColumnName(i)); } if (!columnNames.isEmpty()) { return columnNames; } } finally { if (stm != null) { stm.close(); } if (con != null) { con.close(); } } return null; } public boolean checkLogin(String username, String password) throws NamingException, SQLException { Connection con = null; PreparedStatement stm = null; ResultSet rs = null; try { //1. Establish connection con = DBUtilities.makeConnection(); //2. Prepare sql String if (con != null) { String sql = "SELECT * FROM tbl_User " + "WHERE userID = ? AND password = ?"; stm = con.prepareStatement(sql); stm.setString(1, username); System.out.println(username); stm.setString(2, password); System.out.println(password); //3. Execute and store in ResultSet rs = stm.executeQuery(); if (rs.next()) { return true; } }//end if con } finally { if (stm != null) { stm.close(); } if (con != null) { con.close(); } } return false; } private List<Tbl_UserDTO> listAccount; public List<Tbl_UserDTO> getListAccount() { return listAccount; } public void searchLastName(String lastname) throws SQLException, NamingException { Connection con = null; PreparedStatement stm = null; ResultSet rs = null; try { //1. Establish DB connection con = DBUtilities.makeConnection(); if (con != null) { //2. Prepare SQL String String sql = "SELECT * FROM tbl_User " + "WHERE fullName LIKE ?"; stm = con.prepareStatement(sql); stm.setString(1, "%" + lastname + "%"); //3. Execute and store in result set rs = stm.executeQuery(); while (rs.next()) { String userId = rs.getString(1); String password = rs.getString(2); String fullName = rs.getString(3); boolean role = rs.getBoolean(4); Tbl_UserDTO dto = new Tbl_UserDTO(userId, password, fullName, role); if (this.listAccount == null) { this.listAccount = new ArrayList<>(); } this.listAccount.add(dto); } }//end if con } finally { if (stm != null) { stm.close(); } if (con != null) { con.close(); } } } public boolean deleteRecord(String userId) throws SQLException, NamingException { Connection con = null; PreparedStatement stm = null; try { //1. Establish DB connection con = DBUtilities.makeConnection(); if (con != null) { String sql = "DELETE " + "FROM tbl_User " + "WHERE userID = ?"; stm = con.prepareStatement(sql); stm.setString(1, userId); int affected = stm.executeUpdate(); if (affected > 0) { return true; } } } finally { if (stm != null) { stm.close(); } if (con != null) { con.close(); } } return false; } public boolean updateRole(String userID, String password, boolean role) throws SQLException, NamingException { Connection con = null; PreparedStatement stm = null; try { con = DBUtilities.makeConnection(); if (con != null) { String sql = "UPDATE tbl_User " + "SET password = ?, role=? " + "WHERE userID = ?"; stm = con.prepareStatement(sql); stm.setString(1, password); stm.setBoolean(2, role); stm.setString(3, userID); int affected = stm.executeUpdate(); if (affected > 0) { return true; } } } finally { if (con != null) { con.close(); } } return false; } public boolean createRecord(String userID, String password, String fullName, boolean role) throws SQLException, NamingException { Connection con = null; PreparedStatement stm = null; try { //1. Establish DB connection con = DBUtilities.makeConnection(); //2. Create SQL String String sql = "INSERT INTO tbl_User " + "VALUES(?,?,?,?)"; stm = con.prepareStatement(sql); stm.setString(1, userID); stm.setString(2, password); stm.setString(3, fullName); stm.setBoolean(4, role); //3. Execute and store inresult set int affected = stm.executeUpdate(); if (affected > 0) { return true; } } finally { if (stm != null) { stm.close(); } if (con != null) { con.close(); } } return false; } }
[ "yukiakira259@gmail.com" ]
yukiakira259@gmail.com
2cb716f7ec608b1dbf0929c2c8ca6276163f5f68
594b6532e1410ce32c9e8bdfbbb98c72e014f78f
/4 - Implementação/4.1 - Codigo_Fonte/souzacar/src/main/java/br/com/souzacar/controller/BudgetController.java
7fe0ba2aae6d6799ace4b3bfef2e4e6748a161e0
[ "MIT" ]
permissive
pcmartins/M64-Bela-Adormecida-
cd3431a43c111996e599e48f28eb3057e31a51dd
86f089080a2558a788550644ff144b39c5f96e6c
refs/heads/master
2021-01-20T16:58:40.402186
2017-05-27T19:51:53
2017-05-27T19:51:53
82,845,893
0
0
null
null
null
null
UTF-8
Java
false
false
3,161
java
//package br.com.souzacar.controller; // //import java.util.ArrayList; //import java.util.Iterator; //import java.util.List; // //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.web.bind.annotation.CrossOrigin; //import org.springframework.web.bind.annotation.PathVariable; //import org.springframework.web.bind.annotation.RequestBody; //import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMethod; //import org.springframework.web.bind.annotation.ResponseBody; //import org.springframework.web.bind.annotation.RestController; // //import br.com.souzacar.model.Budget; //import br.com.souzacar.repository.BudgetRepository; //import br.com.souzacar.utlis.Response; // //@RestController //@RequestMapping("/api/budgets") //public class BudgetController { // // @Autowired // private BudgetRepository budgetRepository; // @Autowired // private Response response; // @Autowired // private Budget budget; // // public BudgetController() { // super(); // } // // public BudgetController(BudgetRepository budgetRepository, Response response, Budget budget) { // super(); // this.budgetRepository = budgetRepository; // this.response = response; // this.budget = budget; // } // // @CrossOrigin(origins = "*") // @RequestMapping(value = "", method = RequestMethod.POST, produces = "application/json") // public @ResponseBody Response insert(@RequestBody Budget budget){ // try { // budgetRepository.save(budget); // response.setData(budget); // } catch (Exception e) { // response.setStatus(500, e.getMessage()); // } // return response; // } // // @CrossOrigin(origins = "*") // @RequestMapping(value = "/{id}", method = RequestMethod.PUT, produces = "application/json") // public @ResponseBody Response update(@PathVariable long id, @RequestBody Budget budget){ // try { // budgetRepository.save(budget); // response.setData(budget); // } catch (Exception e) { // response.setStatus(500, e.getMessage()); // } // // return response; // } // // @CrossOrigin(origins = "*") // @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "application/json") // public @ResponseBody Response delete(@PathVariable long id){ // budget = budgetRepository.findOne(id); // try { // budgetRepository.delete(budget); // } catch (Exception e) { // response.setStatus(500, e.getMessage()); // } // // return new Response(budget, null); // } // // @CrossOrigin(origins = "*") // @RequestMapping(value = "", method = RequestMethod.GET, produces = "application/json") // public Response list(){ // List<Budget> result = new ArrayList<Budget>(); // Iterator<Budget> iterator = budgetRepository.findAll().iterator(); // // while(iterator.hasNext()){ // result.add(iterator.next()); // } // // return new Response(result, null); // } // // @CrossOrigin(origins = "*") // @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = "application/json") // public Response get(@PathVariable long id){ // budget = budgetRepository.findOne(id); // // return new Response(budget, null); // } //}
[ "pcmartins.santos@gmail.com" ]
pcmartins.santos@gmail.com
a1c8c268f84800ac84816a17159fe179ab705cb2
7ec94d8f5ba6eb2b718e78d07b1e56fbeff3d52c
/src/test/java/com/pages/SearchHotelPage.java
9489c2ea923f17600e080a3bc487109649b09622
[]
no_license
vijayalakshmi2812/CucumberMaven
7263e2e75d4cd8dd069ac12488993ed4b9913006
d2fde45585444caa34dc9ca5855790e91a2b13d2
refs/heads/master
2022-11-25T13:11:24.079173
2020-07-28T14:57:39
2020-07-28T14:57:39
283,243,898
0
0
null
null
null
null
UTF-8
Java
false
false
1,323
java
package com.pages; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import com.base.LibGlobal; public class SearchHotelPage extends LibGlobal { public SearchHotelPage() { PageFactory.initElements(driver, this); } @FindBy(id="location") private WebElement location; @FindBy(id="hotels") private WebElement hotel; @FindBy(id="room_type") private WebElement roomType; @FindBy(id="room_nos") private WebElement noOfRoom; @FindBy(id="datepick_in") private WebElement checkInDate; @FindBy(id="datepick_out") private WebElement checkOutdate; @FindBy(id="adult_room") private WebElement adults; @FindBy(id="child_room") private WebElement children; @FindBy(id="Submit") private WebElement btnSearch; public WebElement getLocation() { return location; } public WebElement getHotel() { return hotel; } public WebElement getRoomType() { return roomType; } public WebElement getNoOfRoom() { return noOfRoom; } public WebElement getCheckInDate() { return checkInDate; } public WebElement getCHeckOutdate() { return checkOutdate; } public WebElement getAdults() { return adults; } public WebElement getChildren() { return children; } public WebElement getBtnSearch() { return btnSearch; } }
[ "akvijaya2812@gmail.com" ]
akvijaya2812@gmail.com
eb266ea1e07ac7ad2c08510025258304be74f81a
5d61ec945b29338f65d43acdf2531f5e1d4b0e90
/src/main/java/com/alibaba/tc/sp/dimension/OdpsDimensionTable.java
e084a72a326b8eb486c75ebf1f149e7111d81a4c
[ "Apache-2.0" ]
permissive
hxliuOrwise/table-computing
c5adae918a68ebb0c3b22b62a8f0b49d4adc5c70
6c087a689246bc8d94c14bab8190993bb58b10e8
refs/heads/main
2023-08-18T09:54:55.736434
2021-10-13T00:32:30
2021-10-13T00:32:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,182
java
package com.alibaba.tc.sp.dimension; import com.alibaba.tc.exception.UnknownTypeException; import com.alibaba.tc.table.Index; import com.alibaba.tc.table.Table; import com.alibaba.tc.table.TableBuilder; import com.alibaba.tc.table.Type; import com.aliyun.odps.Instance; import com.aliyun.odps.Odps; import com.aliyun.odps.OdpsException; import com.aliyun.odps.Partition; import com.aliyun.odps.PartitionSpec; import com.aliyun.odps.account.Account; import com.aliyun.odps.account.AliyunAccount; import com.aliyun.odps.data.Record; import com.aliyun.odps.data.RecordReader; import com.aliyun.odps.task.SQLTask; import com.aliyun.odps.tunnel.TableTunnel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.time.Duration; import java.util.List; import java.util.Map; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import static com.alibaba.tc.Threads.threadsNamed; import static java.lang.String.format; import static java.util.Objects.requireNonNull; public class OdpsDimensionTable extends DimensionTable { private static final Logger logger = LoggerFactory.getLogger(OdpsDimensionTable.class); private final String useProject; private final String projectName; private final String tableName; private final String partitionColumnName; private final String partition; private final String ak; private final String sk; private final Duration refreshInterval; private final Map<String, Type> columnTypeMap; private final String[] primaryKeyColumnNames; private final String myName; public OdpsDimensionTable(String endPoint, String projectName, String tableName, String partitionColumnName, String partition, String ak, String sk, Duration refreshInterval, Map<String, Type> columnTypeMap, String... primaryKeyColumnNames) { this(endPoint, projectName, projectName, tableName, partitionColumnName, partition, ak, sk, refreshInterval, columnTypeMap, primaryKeyColumnNames); } public OdpsDimensionTable(String endPoint, final String useProject, String projectName, String tableName, String partitionColumnName, String partition, String ak, String sk, Duration refreshInterval, Map<String, Type> columnTypeMap, String... primaryKeyColumnNames) { this.useProject = requireNonNull(useProject); this.projectName = requireNonNull(projectName); this.tableName = requireNonNull(tableName); this.partitionColumnName = requireNonNull(partitionColumnName); this.partition = requireNonNull(partition).replace(" ", "").toLowerCase(); this.ak = requireNonNull(ak); this.sk = requireNonNull(sk); this.refreshInterval = requireNonNull(refreshInterval); this.columnTypeMap = requireNonNull(columnTypeMap); if (columnTypeMap.size() < 1) { throw new IllegalArgumentException(); } this.primaryKeyColumnNames = requireNonNull(primaryKeyColumnNames); if (primaryKeyColumnNames.length < 1) { throw new IllegalArgumentException(); } this.myName = format("%s: %s.%s", this.getClass().getSimpleName(), projectName, tableName); new ScheduledThreadPoolExecutor(1, threadsNamed(myName)). scheduleWithFixedDelay(new Runnable() { @Override public void run() { try { long pre = System.currentTimeMillis(); logger.info("begin to load {}", myName); TableBuilder tableBuilder = new TableBuilder(columnTypeMap); Account account = new AliyunAccount(ak, sk); Odps odps = new Odps(account); odps.setEndpoint(endPoint); odps.setDefaultProject(useProject); String ptSpec = partition; if (partition.equals("max_pt()")) { ptSpec = getMaxPtSpec(odps, projectName, tableName); } TableTunnel tunnel = new TableTunnel(odps); TableTunnel.DownloadSession downloadSession = tunnel.createDownloadSession(projectName, tableName, new PartitionSpec(format("%s='%s'", partitionColumnName, ptSpec))); long recordNum = downloadSession.getRecordCount(); logger.info("{} will download {} records", myName, recordNum); RecordReader recordReader = downloadSession.openRecordReader(0, recordNum); Record record; int row = 0; while ((record = recordReader.read()) != null) { if (debug(row)) { break; } int i = 0; for (String columnName : columnTypeMap.keySet()) { Type type = columnTypeMap.get(columnName); switch (type) { case INT: tableBuilder.append(i, record.getBigint(columnName) == null ? null : record.getBigint(columnName).intValue()); break; case BIGINT: tableBuilder.append(i, record.getBigint(columnName)); break; case DOUBLE: tableBuilder.append(i, record.getDouble(columnName)); break; case VARCHAR: tableBuilder.append(i, record.getString(columnName)); break; default: throw new UnknownTypeException(type.name()); } i++; } row++; long now = System.currentTimeMillis(); if (now - pre > 5000) { logger.info("{} have loaded {} rows", myName, row); pre = now; } } Table table = tableBuilder.build(); Index index = table.createIndex(primaryKeyColumnNames); tableIndex = new TableIndex(table, index); logger.info("end to load {}, rows: {}, index.size: {}", myName, row, index.getColumns2Rows().size()); } catch (Throwable t) { logger.error("", t); try { Thread.sleep(10_000); run(); } catch (Throwable t1) { logger.error("", t1); } } } }, 0, refreshInterval.toMillis(), TimeUnit.MILLISECONDS); } private static String getMaxPtSpec(Odps odps, String projectName, String tableName) throws OdpsException { Instance instance = SQLTask.run(odps, "select max_pt('" + projectName + "." + tableName + "');"); instance.waitForSuccess(); List<Record> records = SQLTask.getResult(instance); return records.get(0).getString(0); } private static String getMaxPtSpecWithoutSql(Odps odps, String projectName, String tableName) { odps.setDefaultProject(projectName); List<Partition> partitions = odps.tables().get(tableName).getPartitions(); String maxPtSpec = null; for(Partition partition : partitions) { PartitionSpec partitionSpec = partition.getPartitionSpec(); String ptSpec = partitionSpec.get(partitionSpec.keys().iterator().next()); if (null == maxPtSpec || maxPtSpec.compareTo(ptSpec) < 0) { maxPtSpec = ptSpec; } } return maxPtSpec; } }
[ "shanqiang.sq@alibaba-inc.com" ]
shanqiang.sq@alibaba-inc.com
356f776bcff18cc1e7d2bafcd6597afbccc60474
2cda0249f8084a2f2635c9749623fe55def84d4b
/hrms/src/main/java/kodlamaio/hrms/entities/abstracts/JobCvEntity.java
18ae506f2b7f876e9282edb82663ba36dc5e6bec
[ "MIT" ]
permissive
BarisKocaman55/Hrms
a9e86e2532369922e57dde2b69ed5198e1fb630b
18d98a5c0592c94ba787c75ac532f71cd5f7e683
refs/heads/main
2023-05-30T10:35:11.630215
2021-06-15T19:48:21
2021-06-15T19:48:21
375,126,839
1
0
null
null
null
null
UTF-8
Java
false
false
78
java
package kodlamaio.hrms.entities.abstracts; public interface JobCvEntity { }
[ "54405338+BarisKocaman55@users.noreply.github.com" ]
54405338+BarisKocaman55@users.noreply.github.com
316a1ed71862bbc7121e9550de2a249fa740ab51
4d2abdac6046f0f5d2bf4b1d08e79170ac37e78f
/src/main/java/com/ddzhuan/manage/tool/MD5Tool.java
ef2a343ca0dc57661a59f44f0a5685cb2848f033
[]
no_license
hiopro2016/linkshow
c2c3843b7ae185e1a79eacc17a9d9026aafe5bd2
85b6854dc7b538b15816d28dd47f02de77b5648e
refs/heads/master
2022-09-20T06:02:13.095646
2020-05-26T10:02:28
2020-05-26T10:02:28
275,699,225
0
1
null
2020-06-29T01:14:15
2020-06-29T01:14:14
null
UTF-8
Java
false
false
1,465
java
package com.ddzhuan.manage.tool; import java.security.MessageDigest; public class MD5Tool { private final static String[] hexDigits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; /** * 转换字节数组为16进制字串 * * @param b * 字节数组 * @return 16进制字串 */ public static String byteArrayToHexString(byte[] b) { StringBuffer resultSb = new StringBuffer(); for (int i = 0; i < b.length; i++) { resultSb.append(byteToHexString(b[i])); } return resultSb.toString(); } private static String byteToHexString(byte b) { int n = b; if (n < 0) n = 256 + n; int d1 = n / 16; int d2 = n % 16; return hexDigits[d1] + hexDigits[d2]; } public static String MD5Encode(String origin) { String resultString = null; try { resultString = new String(origin); MessageDigest md = MessageDigest.getInstance("MD5"); resultString = byteArrayToHexString(md.digest(resultString .getBytes())); } catch (Exception ex) { } return resultString; } /** * 加密解密算法 执行一次加密,两次解密 */ public static String convertMD5(String inStr){ char[] a = inStr.toCharArray(); for (int i = 0; i < a.length; i++){ a[i] = (char) (a[i] ^ 't'); } String s = new String(a); return s; } }
[ "oncwnuBZjDbKc9fKyGzdgy_dYuKM@git.weixin.qq.com" ]
oncwnuBZjDbKc9fKyGzdgy_dYuKM@git.weixin.qq.com
3ac069c73d01ac2befc642f5a5e1afb675de1c9c
9b0585b1196e9d0e97474443c27d25ccf159d4f6
/robot_school/src/Pizza.java
9bacf22e8c8b0c0acd24a6ac534cc4e994be6522
[]
no_license
MarkKang05/Hello
dcd2e6e43486e02cdb417a09389e0f1ef973ada5
acb29ff0cd1988084b2a0f641d09d382f2d63d73
refs/heads/master
2023-06-16T04:00:35.416953
2021-07-13T02:24:44
2021-07-13T02:24:44
385,435,487
0
0
null
null
null
null
UTF-8
Java
false
false
506
java
public class Pizza { private String kind; private int size; public Pizza(){} public Pizza(String kind){ this.kind = kind; } public Pizza(String kind, int size){ this(kind); this.size = size; } void toPrint(){ System.out.println("종류:"+ this.kind+" 크기:"+this.size); } public String getKind() { return kind; } public void setKind(String kind) { this.kind = kind; } public int getSize() { return size; } public void setSize(int size) { this.size = size; } }
[ "markkang05@gmail.com" ]
markkang05@gmail.com
388d80de4a4f16c2a617968e6001eed1426cdef6
412c511f862cacdebc21f6b9406e0e895862bc6b
/app/src/main/java/com/example/onlineshop/RegisterActivity.java
e004daa1dcc4f1823b07123ea121b23667760931
[]
no_license
Omender123/Online-shop
74a283007e0c8b6c106e8eedb2d007f929899766
c5ac78abb32437f8c87b0eac24ed02ec9253c15a
refs/heads/master
2022-12-19T15:35:26.877403
2020-09-11T10:54:30
2020-09-11T10:54:30
294,667,753
1
0
null
null
null
null
UTF-8
Java
false
false
5,117
java
package com.example.onlineshop; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import com.example.onlineshop.R; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.HashMap; public class RegisterActivity extends AppCompatActivity { private Button CreateAccountButton; private EditText InputName, InputPhoneNumber, InputPassword; private ProgressDialog loadingBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); CreateAccountButton = (Button) findViewById(R.id.register_btn); InputName = (EditText) findViewById(R.id.register_username_input); InputPassword = (EditText) findViewById(R.id.register_password_input); InputPhoneNumber = (EditText) findViewById(R.id.register_phone_number_input); loadingBar = new ProgressDialog(this); CreateAccountButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { CreateAccount(); } }); } private void CreateAccount(){ String name = InputName.getText().toString(); String phone = InputPhoneNumber.getText().toString(); String password = InputPassword.getText().toString(); if (TextUtils.isEmpty(name)) { Toast.makeText(this, "Please write your name...", Toast.LENGTH_SHORT).show(); } else if (TextUtils.isEmpty(phone)) { Toast.makeText(this, "Please write your phone number...", Toast.LENGTH_SHORT).show(); } else if (TextUtils.isEmpty(password)) { Toast.makeText(this, "Please write your password...", Toast.LENGTH_SHORT).show(); } else { loadingBar.setTitle("Create Account"); loadingBar.setMessage("Please wait, while we are checking the credentials."); loadingBar.setCanceledOnTouchOutside(false); loadingBar.show(); ValidatephoneNumber(name, phone, password); } } private void ValidatephoneNumber(final String name, final String phone,final String password) { final DatabaseReference RootRef; RootRef = FirebaseDatabase.getInstance().getReference(); RootRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if (!(dataSnapshot.child("Users").child(phone).exists())){ HashMap<String, Object> userdataMap = new HashMap<>(); userdataMap.put("phone", phone); userdataMap.put("password", password); userdataMap.put("name", name); RootRef.child("Users").child(phone).updateChildren(userdataMap).addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { Toast.makeText(RegisterActivity.this, "Congratulations, your account has been created.", Toast.LENGTH_SHORT).show(); loadingBar.dismiss(); Intent intent = new Intent(RegisterActivity.this, LoginActivity.class); startActivity(intent); } else { loadingBar.dismiss(); Toast.makeText(RegisterActivity.this, "Network Error: Please try again after some time...", Toast.LENGTH_SHORT).show(); } } }); } else { Toast.makeText(RegisterActivity.this, "This " + phone + " already exists.", Toast.LENGTH_SHORT).show(); loadingBar.dismiss(); Toast.makeText(RegisterActivity.this, "Please try again using another phone number.", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(RegisterActivity.this, MainActivity.class); startActivity(intent); } } @Override public void onCancelled(DatabaseError databaseError) { } }); } }
[ "Os7290915329@gmail.com" ]
Os7290915329@gmail.com
7d890d752a59e4ec1a7e44f09e954aab95aeba8e
2180c30ca5912f1b17c2485e2cf3be7f60a5fe54
/src/main/java/com/example/customer/model/request/CustomerRequest.java
0b8156ee8c53986007ea0cf4a53bb7f2b5b37ecc
[]
no_license
DouglasSilvar/spring_crud
3ced84e56ac684cd7ec6d13963ddb37a74e33413
4921b57aff2e0c3598074f6c208ebebeac9adb9b
refs/heads/main
2023-06-03T00:13:49.478828
2021-06-10T03:25:54
2021-06-10T03:25:54
375,557,529
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package com.example.customer.model.request; import javax.validation.constraints.NotBlank; public class CustomerRequest { @NotBlank private String name; @NotBlank private String document; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDocument() { return document; } public void setDocument(String document) { this.document = document; } }
[ "gogaplay@gmail.com" ]
gogaplay@gmail.com
0fc5001f1275ba5cdd34321bfdb5627eade67d3c
63e24adc15dd2155767a477c5026608273d89323
/scm-data/src/test/java/org/xfs/scm/socket/demo2.java
b5db279b5d5730e4444592233ef55bf07a2168c0
[]
no_license
shenfengzhusheng/scm
17978a395182a3f164357372c5c44242659bc970
9b04e91d7c2d4dcac55d326b08606482aba2fea9
refs/heads/master
2022-12-21T14:31:37.214723
2018-11-17T03:24:01
2018-11-17T03:24:01
82,155,192
0
0
null
null
null
null
UTF-8
Java
false
false
52
java
package org.xfs.scm.socket; public class demo2 { }
[ "xixingyingzhongdui@gmail.com" ]
xixingyingzhongdui@gmail.com
9bae7374c7e950bf035f0a47d57252cdefadbce2
718d7289e7f5107d2651bde4643726fcead60753
/src/cn/com/mjsoft/cms/metadata/bean/ModelPersistenceMySqlCodeBean.java
86d6f5183d711313944dc7da3031229011f5acea
[]
no_license
heyuanhang/JTop
319ba104d6c0a6428ce335f4f30b0fc15c390d39
8e363a4eb9759e6a25dc1aa89735a8f021fed068
refs/heads/master
2020-07-11T01:57:45.087531
2019-08-26T08:24:46
2019-08-26T08:24:46
204,422,354
0
0
null
null
null
null
UTF-8
Java
false
false
1,595
java
package cn.com.mjsoft.cms.metadata.bean; public class ModelPersistenceMySqlCodeBean { private Long dataModelId = Long.valueOf( -1 ); private String insertSql; private String deleteSql; private String updateSql; private String selectSql; private String selectColumn; private String listSelectColumn; public Long getDataModelId() { return dataModelId; } public void setDataModelId( Long dataModelId ) { this.dataModelId = dataModelId; } public String getDeleteSql() { return deleteSql; } public void setDeleteSql( String deleteSql ) { this.deleteSql = deleteSql; } public String getInsertSql() { return insertSql; } public void setInsertSql( String insertSql ) { this.insertSql = insertSql; } public String getSelectSql() { return selectSql; } public void setSelectSql( String selectSql ) { this.selectSql = selectSql; } public String getUpdateSql() { return updateSql; } public void setUpdateSql( String updateSql ) { this.updateSql = updateSql; } public String getSelectColumn() { return selectColumn; } public void setSelectColumn( String selectColumn ) { this.selectColumn = selectColumn; } public String getListSelectColumn() { return listSelectColumn; } public void setListSelectColumn( String listSelectColumn ) { this.listSelectColumn = listSelectColumn; } }
[ "404236577@qq.com" ]
404236577@qq.com
1cd0ee45c4650a9bf5ee5df1b5d3bcdaa5351b4f
e8b0ae308d5fb5797eb8d4e628424c2a3d6f9b84
/src/main/java/application/interfaces/MessageSystem.java
e290590afba573fcdee335cf4d0b94227e6fee68
[]
no_license
flippybit/SeniorSense
923b353d25e909fc6d6db0c39f89c4784d3c83c4
3fd54c442ebebd3529fbe76bb705d83146a65613
refs/heads/main
2023-06-24T07:07:32.220140
2021-07-22T08:45:44
2021-07-22T08:45:44
388,386,011
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
package application.interfaces; import java.util.List; import application.implemet.MessageImpl; @SuppressWarnings("unused") public interface MessageSystem { public void send(Message m); public List<Message> getAllFrom(Usuario u,int limit); public List<Message> getAllFrom(String nombre,int limit); public Message getById(int id); public List<Message> getAllTo(Usuario u,int limit); public List<Message> getAllTo(String nombre,int limit); public List<Message> getAll(); }
[ "ruizbr2020@gmail.com" ]
ruizbr2020@gmail.com
26f848dd966d571a62c3a49a308f3a85c073654c
83c7668f1c06053f8382c62af19b6b94246c9a2a
/nsgl/src/nsgl/math/logic/Predicate.java
5279d1147c7d7cf24761ff326dbc737055057b09
[]
no_license
jgomezpe/nsgl-old
4cfb4aa9792c8179c6f6b5a4d6cf0767b27e23cb
899005b7e28a0d058d8084fc25fe374899e5333d
refs/heads/master
2022-01-11T19:35:30.059381
2019-07-16T03:04:23
2019-07-16T03:04:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package nsgl.math.logic; /** * <p>Defines the basic behavior of a logic predicate.</p> * * <p>Copyright: Copyright (c) 2010</p> * * @author Jonatan Gomez Perdomo * @version 1.0 */ public abstract class Predicate<T> { /** * Evaluates the predicate * @param object Predicates argument * @return true if the attributes of the predicate (arguments) satisfy the predicate, false in other case */ public abstract boolean evaluate(T object); /** * Initializes the internal state of the predicate */ public void init() {} }
[ "jgomezpe@unal.edu.co" ]
jgomezpe@unal.edu.co
1c4e3ae78b9b0ffe46594d10060d82e173ef2f37
306041f179afe4379fb0893b4723f9501a54326e
/moviles-masterBack/src/Modelo/Ciclo.java
798c3ffab1040325ca48980dbd344cbf3d8ee76a
[]
no_license
Pablex223/Moviles
df95381175e66396684ee8a99fdd2cabe2b64f70
431a924e9bb9f785b074cb8ba80ed71618804093
refs/heads/master
2021-01-01T20:45:20.812224
2017-12-06T17:03:26
2017-12-06T17:03:26
98,926,714
0
0
null
null
null
null
UTF-8
Java
false
false
1,238
java
package Modelo; public class Ciclo { private String id; private int anno; private int nciclo; private String Finicio; private String Ffinal; public Ciclo(String id, int anno, int nciclo, String Finicio, String Ffinal) { this.id = id; this.anno = anno; this.nciclo = nciclo; this.Finicio = Finicio; this.Ffinal = Ffinal; } public Ciclo() { this.id = ""; this.anno = 0; this.nciclo = 0; this.Finicio = ""; this.Ffinal = ""; } public String getId() { return id; } public void setId(String id) { this.id = id; } public int getAnno() { return anno; } public void setAnno(int anno) { this.anno = anno; } public int getNciclo() { return nciclo; } public void setNciclo(int nciclo) { this.nciclo = nciclo; } public String getFinicio() { return Finicio; } public void setFinicio(String Finicio) { this.Finicio = Finicio; } public String getFfinal() { return Ffinal; } public void setFfinal(String Ffinal) { this.Ffinal = Ffinal; } }
[ "psolano223@gmail.com" ]
psolano223@gmail.com
b2ef7a25a6fcd51c23660597c8f652a0acbbb8fd
cd3919996fd885982a2f83ec6c2ae5b06d1501d2
/Recipes/task/src/recipes/service/RecipeService.java
41d2876511ad98424bc6325c2b0fbe6f2f6db9ef
[]
no_license
ZodiacGP/Recipes
0d06850f4b09d6418f75eee4f80b3b629e39e346
557afce5729e2864c82896131aaa5b95475e5516
refs/heads/master
2023-08-18T22:05:04.638214
2021-09-29T13:30:39
2021-09-29T13:30:39
409,196,908
0
0
null
null
null
null
UTF-8
Java
false
false
1,647
java
package recipes.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import recipes.domain.recipe.Recipe; import recipes.domain.recipe.RecipeNotFoundException; import recipes.dao.RecipeRepository; import recipes.domain.user.ForbiddenException; import java.util.List; @Service public class RecipeService { @Autowired RecipeRepository recipeRepository; @Autowired UserService userService; public Recipe getRecipeById(int recipeId) { return recipeRepository.findById(recipeId).orElseThrow(RecipeNotFoundException::new); } public List<Recipe> getRecipeByName(String name) { return recipeRepository.findAllByNameContainingIgnoreCaseOrderByDateDesc(name); } public List<Recipe> getRecipeByCategory(String category) { return recipeRepository.findAllByCategoryIgnoreCaseEqualsOrderByDateDesc(category); } public int save(Recipe recipe) { recipe.setEmail(userService.getLoggedInUser()); return recipeRepository.save(recipe).getId(); } public void update(int recipeId, Recipe recipe) { Recipe recipeFromDB = recipeRepository.findById(recipeId).orElseThrow(RecipeNotFoundException::new); checkRights(recipeFromDB); recipeFromDB.copyOf(recipe); recipeRepository.save(recipeFromDB); } public void delete(int recipeId) { Recipe recipeFromDB = recipeRepository.findById(recipeId).orElseThrow(RecipeNotFoundException::new); checkRights(recipeFromDB); recipeRepository.delete(recipeFromDB); } private void checkRights(Recipe recipe) { if (!recipe.getEmail().equals(userService.getLoggedInUser())) { throw new ForbiddenException(); } } }
[ "pavelgutsu20@gmail.com" ]
pavelgutsu20@gmail.com
825cbc9b13086f7d61cdf819b58e41af5c6d7f70
dd6e4c4c6ae4915e1a5fa10f5890a8cb36439bf6
/src/org/omg/DynamicAny/DynUnionOperations.java
448d2a50c4c454db862384d7a05806f5d9d16cba
[]
no_license
TianTang2013/jdk-source
71acab4382cbfc3200ae9307d80040d7bcdc5948
29e736ac45425646bb94f81b181d9a24365c4786
refs/heads/master
2020-08-22T06:36:51.386468
2019-11-15T08:40:13
2019-11-15T08:40:13
216,338,828
3
0
null
null
null
null
UTF-8
Java
false
false
4,947
java
package org.omg.DynamicAny; /** * org/omg/DynamicAny/DynUnionOperations.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u211/12973/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl * Monday, April 1, 2019 8:55:04 PM PDT */ /** * DynUnion objects support the manipulation of IDL unions. * A union can have only two valid current positions: * <UL> * <LI>zero, which denotes the discriminator * <LI>one, which denotes the active member * </UL> * The component_count value for a union depends on the current discriminator: * it is 2 for a union whose discriminator indicates a named member, and 1 otherwise. */ public interface DynUnionOperations extends org.omg.DynamicAny.DynAnyOperations { /** * Returns the current discriminator value. */ org.omg.DynamicAny.DynAny get_discriminator (); /** * Sets the discriminator of the DynUnion to the specified value. * Setting the discriminator to a value that is consistent with the currently active union member * does not affect the currently active member. Setting the discriminator to a value that is inconsistent * with the currently active member deactivates the member and activates the member that is consistent * with the new discriminator value (if there is a member for that value) by initializing the member * to its default value. * Setting the discriminator of a union sets the current position to 0 if the discriminator value * indicates a non-existent union member (has_no_active_member returns true in this case). * Otherwise, if the discriminator value indicates a named union member, the current position is set to 1 * (has_no_active_member returns false and component_count returns 2 in this case). * * @exception TypeMismatch if the TypeCode of the parameter is not equivalent to the TypeCode * of the union's discriminator */ void set_discriminator (org.omg.DynamicAny.DynAny d) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch; /** * Sets the discriminator to a value that is consistent with the value of the default case of a union. * It sets the current position to zero and causes component_count to return 2. * * @exception TypeMismatch if the union does not have an explicit default case */ void set_to_default_member () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch; /** * Sets the discriminator to a value that does not correspond to any of the unions case labels. * It sets the current position to zero and causes component_count to return 1. * * @exception TypeMismatch if the union has an explicit default case or if it uses the entire range * of discriminator values for explicit case labels */ void set_to_no_active_member () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch; /** * Returns true if the union has no active member, that is, the unions value consists solely * of its discriminator because the discriminator has a value that is not listed as an explicit case label. * Calling this operation on a union that has a default case returns false. * Calling this operation on a union that uses the entire range of discriminator values * for explicit case labels returns false. */ boolean has_no_active_member (); /** * Returns the TCKind value of the discriminators TypeCode. */ org.omg.CORBA.TCKind discriminator_kind (); /** * Returns the TCKind value of the currently active members TypeCode. * * @exception InvalidValue if the union does not have a currently active member */ org.omg.CORBA.TCKind member_kind () throws org.omg.DynamicAny.DynAnyPackage.InvalidValue; /** * Returns the currently active member. Note that the returned reference remains valid only * for as long as the currently active member does not change. Using the returned reference * beyond the life time of the currently active member raises OBJECT_NOT_EXIST. * * @exception InvalidValue if the union has no active member */ org.omg.DynamicAny.DynAny member () throws org.omg.DynamicAny.DynAnyPackage.InvalidValue; /** * Returns the name of the currently active member. If the unions TypeCode does not contain * a member name for the currently active member, the operation returns an empty string. * * @exception InvalidValue if the union has no active member */ String member_name () throws org.omg.DynamicAny.DynAnyPackage.InvalidValue; } // interface DynUnionOperations
[ "liujinkun@coohua.com" ]
liujinkun@coohua.com
0b92f5e4749f52c9821abfc840f65f2059ffd827
deafb13f36b59f0b2b3e996d1b77a7c191ec5a48
/src/com/jinzht/pro/wheelview/OnWheelChangedListener.java
935ac767f04ca958184318ba8ab6a93530ec1a0b
[]
no_license
zanqging/PE
464f7393b295e0f12a0d50d829456ddfca12c911
09b3bfcdf489784dc3a55362b90ce08c1269df66
refs/heads/master
2021-01-01T05:17:17.481757
2016-04-13T09:04:01
2016-04-13T09:04:04
56,134,315
0
0
null
null
null
null
UTF-8
Java
false
false
763
java
/* * Copyright 2011 Yuri Kanivets * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.jinzht.pro.wheelview; /** */ public interface OnWheelChangedListener { /** */ void onChanged(WheelView wheel, int oldValue, int newValue); }
[ "csz1126@0314" ]
csz1126@0314
a121d157e884d8c7ae0a66b095aa40a9efa8fcb6
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t1_beam/Nicad_t1_beam1794.java
e32d3972a7bdd2a124a3044c5b3aa046529a6822
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
515
java
// clone pairs:6039:70% // 8893:beam/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/AvroCoder.java public class Nicad_t1_beam1794 { public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof AvroCoder)) { return false; } AvroCoder<?> that = (AvroCoder<?>) other; return Objects.equals(this.schemaSupplier.get(), that.schemaSupplier.get()) && Objects.equals(this.typeDescriptor, that.typeDescriptor); } }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
99d3093976163fcd44177f2eccdca6ac8f7889a0
5f066016f7dc0f26acaeace26c15f1c5f53cfef3
/backend/src/com/sdbrody/cahweb/CAHWebAppServlet.java
9db976edd732c103165fc80540ef820d2814347b
[]
no_license
sdbrody/CAH-WebApp
63a5db42b6d62f9e809ccf4933629cfcaa3cffac
7d21669b238576c344341f763c505bd3ae79a6dd
refs/heads/master
2020-04-02T07:22:36.510741
2014-10-09T02:08:49
2014-10-09T02:08:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,371
java
package com.sdbrody.cahweb; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; import java.util.ConcurrentModificationException; import java.util.HashSet; import java.util.Map; import java.util.Random; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; //import net.sf.json.JSONObject; import org.json.JSONObject; import com.google.appengine.api.channel.ChannelMessage; import com.google.appengine.api.channel.ChannelService; import com.google.appengine.api.channel.ChannelServiceFactory; import com.google.appengine.api.datastore.DatastoreService; import com.google.appengine.api.datastore.DatastoreServiceFactory; import com.google.appengine.api.datastore.Key; import com.google.appengine.api.datastore.KeyFactory; import com.google.appengine.api.datastore.Transaction; import org.apache.commons.codec.binary.Base64; import com.sdbrody.cahweb.GameConfiguration.VoteMode; import com.sdbrody.cahweb.Player.PlayerType; import com.sdbrody.cahweb.RoundManager.RoundPhase; @SuppressWarnings("serial") public class CAHWebAppServlet extends HttpServlet { private int[] CreateDecks(final Map<String, String[]> params) throws StatusException{ int b2 = 0; if (params.containsKey("b2")) b2 = getInt(params, "b2"); int b3 = 0; if (params.containsKey("b3")) b3 = getInt(params, "b3"); return new int[]{ getInt(params, "w"), getInt(params, "b1"), b2, b3}; } // Handlers // new game Post public void handleNewGame(DatastoreService datastore, String gameIdStr, int[] numCards, PrintWriter response) throws StatusException { System.out.println("Attempting create new game: " + gameIdStr); Key gameId = KeyFactory.createKey("Game", gameIdStr); GameConfiguration config = new GameConfiguration(10, VoteMode.VOTE, false, false); new Game(datastore, gameId).create(config, numCards); response.println(new JSONObject().put("gameid", gameIdStr).toString()); // TODO: invites? } public boolean notify(GameConfiguration config, String action) { ChannelService channelService = ChannelServiceFactory.getChannelService(); for (final Player player : config.players.values()) { System.out.println("notifying " + player.name + ": " + action); if (player.channel != null) { channelService.sendMessage(new ChannelMessage(player.channel, action)); } } return true; } private Boolean getBooleanWithDefault(final Map<String, String[]> params, String key, boolean defaultVal) throws StatusException { if (!params.containsKey(key)) return new Boolean(defaultVal); String str = getString(params, key, true); if ("true".equalsIgnoreCase(str) || "false".equalsIgnoreCase(str)) { return new Boolean(new Boolean(str)); } throw new StatusException(StatusException.StatusType.BAD_INPUT, "Expected boolean (\"true\" or \"false\"), got " + str); } private Integer getInt(final Map<String, String[]> params, String key) throws StatusException { String str = getString(params, key, true); try { return new Integer(str); } catch (Exception e) { throw new StatusException(StatusException.StatusType.BAD_INPUT, "Error parsing value of " + key); } } private String getString(final Map<String, String[]> params, String key, boolean lower) throws StatusException { if (!params.containsKey(key)) throw new StatusException(StatusException.StatusType.BAD_INPUT, "Parameter " + key + " not specified!"); if (params.get(key).length != 1) throw new StatusException(StatusException.StatusType.BAD_INPUT, "Multiple values for parameter " + key); if (lower) return new String(params.get(key)[0].toLowerCase()); else return new String(params.get(key)[0]); } private String getAction(final Map<String, String[]> params) throws StatusException { if (!params.containsKey("gameid")) return new String("newgame"); return getString(params, "action", true); } private String randomKey() { byte[] bytes = new byte[4]; new Random().nextBytes(bytes); return Base64.encodeBase64URLSafeString(bytes); } private void handlePuts(String gameIdStr, Map<String, String[]> params, DatastoreService datastore, String action, PrintWriter response) throws StatusException { Key gameId = KeyFactory.createKey("Game", gameIdStr); // Handle puts switch(action) { case "newgame": int[] numCards = CreateDecks(params); System.out.println("Starting game with numCards = " + Arrays.toString(numCards)); handleNewGame(datastore, gameIdStr, numCards, response); return; case "register": Player.PlayerType type = null; String typeStr = getString(params, "type", true); switch (typeStr) { case "web" : type = PlayerType.WEB; break; case "mobile" : case "android" : type = PlayerType.MOBILE; break; default : throw new StatusException(StatusException.StatusType.ILLEGAL, "bad player type : " + typeStr); } String pid = new String("P" + randomKey()); Boolean isPassive = getBooleanWithDefault(params, "watcher", false); String name = getString(params, "name", false); ChannelService channelService = ChannelServiceFactory.getChannelService(); String channel = channelService.createChannel(gameIdStr + ":" + pid); new Game(datastore, gameId).registerPlayer(pid, name, type, isPassive, channel); response.println(new JSONObject().put("playerid", pid).put("channel", channel).toString()); return; case "start": pid = getString(params, "playerid", false); new Game(datastore, gameId).startGame(pid); return; case "move": pid = getString(params, "playerid", false); String selectionStr = getString(params, "cards", false); String[] parts = selectionStr.split(","); int[] selection = new int[parts.length]; for (int i = 0; i < parts.length; ++i) { try { selection[i] = Integer.parseInt(parts[i]); } catch(NumberFormatException e) { throw new StatusException(StatusException.StatusType.BAD_INPUT, "Bad specification of selection: " + selectionStr); } } Game game = new Game(datastore, gameId); GameConfiguration config = game.getConfig(); RoundManager round = game.getRound(); if (round.getPhase() != RoundPhase.SELECTION) throw new StatusException(StatusException.StatusType.ILLEGAL, "move request outside of selection phase"); Player player = config.getPlayers().get(pid); if (player == null) throw new StatusException(StatusException.StatusType.BAD_INPUT, "player " + pid + "does not exist"); if (player.isPassive) throw new StatusException(StatusException.StatusType.ILLEGAL, "Passive player " + pid + " attempted to move"); round.addSelection(pid, selection); DeckManager deck = DeckManager.retrieve(datastore, gameId); HashSet<Integer> hand = round.getHandForPlayer(pid); deck.discard(hand, selection); deck.drawToSize(hand, config.cardsPerHand); /*if (round.getPhase() == RoundPhase.VOTING) { if (!notify(config, RoundPhase.VOTING)) System.err.println("notification error"); }*/ round.store(datastore, gameId); deck.store(datastore, gameId); return; case "vote": pid = getString(params, "playerid", false); String voteStr = getString(params, "vote", false); int vote; try { vote = Integer.parseInt(voteStr); } catch(NumberFormatException e) { throw new StatusException(StatusException.StatusType.BAD_INPUT, "Bad specification of vote: " + voteStr); } game = new Game(datastore, gameId); config = game.getConfig(); round = game.getRound(); if (round.getPhase() != RoundPhase.VOTING) throw new StatusException(StatusException.StatusType.ILLEGAL, "move request outside of voting phase"); player = config.getPlayers().get(pid); if (player == null) throw new StatusException(StatusException.StatusType.BAD_INPUT, "player " + pid + "does not exist"); if (player.isPassive) throw new StatusException(StatusException.StatusType.ILLEGAL, "Passive player " + pid + " attempted to vote"); round.addVote(pid, vote); deck = DeckManager.retrieve(datastore, gameId); if (round.getPhase() == RoundPhase.ROUND_DONE) { BlackCard black = deck.getBlackCard(); // TODO: game over!!! HistoricRound historic = round.nextRound(black); historic.store(datastore, gameId); // update scores /*if (!notify(config, RoundPhase.VOTING)) { System.err.println("notification error"); }*/ } round.store(datastore, gameId); deck.store(datastore, gameId); return; default: throw new StatusException(StatusException.StatusType.BAD_INPUT, "Action " + action + " is not valid"); } } private void handleDispatch(String gameIdStr, Map<String, String[]> params, PrintWriter response) throws StatusException { DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); String action = getAction(params); Key gameId = KeyFactory.createKey("Game", gameIdStr); GameConfiguration config = null; System.out.println("Handling action " + action); // ********************* Handle gets ************************ switch(action) { case "getconfig": config = new Game(datastore, gameId).getConfig(); response.println(config.toString()); return; case "getround" : config = new Game(datastore, gameId).getConfig(); RoundManager round = new Game(datastore, gameId).getRound(); response.println(round.getRoundStatus(config.getPlayers())); return; case "getscores" : config = new Game(datastore, gameId).getConfig(); round = new Game(datastore, gameId).getRound(); response.println(round.scoresToJSon(config.getPlayers()).toString()); return; case "getchannel" : config = new Game(datastore, gameId).getConfig(); String pid = getString(params, "playerid", false); response.println( new JSONObject().put("channel" , config.getPlayers().get(pid).channel).toString()); return; case "gethand" : pid = getString(params, "playerid", false); round = new Game(datastore, gameId).getRound(); HashSet<Integer> hand = round.getHandForPlayer(pid); response.println(round.handToJson(hand)); return; case "getvote" : pid = getString(params, "playerid", false); round = new Game(datastore, gameId).getRound(); if (round.getPhase() != RoundPhase.VOTING) throw new StatusException(StatusException.StatusType.ILLEGAL, "Vote selection request outside of voting phase"); Map<Integer, int[]> voteSelection = round.getVoteSelectionForPlayer(pid); response.println(round.voteSelectionToJson(voteSelection)); return; case "gethistory" : config = new Game(datastore, gameId).getConfig(); Integer index = getInt(params, "round"); HistoricRound historic = new Game(datastore, gameId).getHistoricRound(index); response.println(historic.toJSON(config.getPlayers()).toString()); return; default: System.out.println("action " + action + " is not a get request"); // do nothing } // ********************* Handle puts *************************** // move Post // vote Post // end/leave game? Post int retries = 3; while (true) { Transaction txn = datastore.beginTransaction(); try { handlePuts(gameIdStr, params, datastore, action, response); // end transaction txn.commit(); System.out.println("Transaction successful!"); config = new Game(datastore, gameId).getConfig(); notify(config, action); return; } catch (ConcurrentModificationException e) { System.err.println("failed, " + retries + " left"); if (retries == 0) { throw e; } // Allow retry to occur --retries; } catch (StatusException e) { throw e; } catch (Exception e) { throw new StatusException(StatusException.StatusType.DATASTORE_ERROR, e.getMessage()); } finally { if (txn.isActive()) { txn.rollback(); } } // finally - end of try } // end of while - all retries } // end of handleDispatch @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); resp.setHeader("Cache-control", "no-cache, no-store"); resp.setHeader("Pragma", "no-cache"); resp.setHeader("Expires", "-1"); resp.setHeader("Access-Control-Allow-Origin", "*"); resp.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS"); resp.setHeader("Access-Control-Allow-Headers", "Content-Type"); resp.setHeader("Access-Control-Max-Age", "86400"); HttpResponseOutput respOutput = new HttpResponseOutput(); StatusException error = null; @SuppressWarnings("unchecked") final Map<String, String[]> params = req.getParameterMap(); String gameIdStr; if (!params.containsKey("gameid")) { gameIdStr = "G" + randomKey(); } else { gameIdStr = req.getParameter("gameid"); if (gameIdStr == null) { error = new StatusException(StatusException.StatusType.BAD_INPUT, "No game ID provided"); } } if (error == null) { try { handleDispatch(gameIdStr, params, respOutput.out); } catch (StatusException e) { error = e; } } if (error != null) respOutput.err.println(error.toString()); respOutput.setResponse(resp); } }
[ "sdbrody@@users.noreply.github.com" ]
sdbrody@@users.noreply.github.com
fda152726b1ce0d6aaa49b3305df06c662efb945
6622f539a9ccd2deb5db7b013724974367811a47
/releases/aui-1.01/jeds-1.01/src/it/ascia/eds/msg/RispostaSetPointMessage.java
db23c4725af8148d8d9aa4acfb6c8a85fce4687a
[]
no_license
asciasrl/jais
52d27298e458c298ba7f8817c0f191fc4b88278d
2d04d1963fcc189aa161bffa9880ed6289827f6a
refs/heads/master
2021-01-23T21:16:05.432838
2015-01-03T22:01:53
2015-01-03T22:01:53
102,886,796
1
0
null
null
null
null
UTF-8
Java
false
false
1,148
java
package it.ascia.eds.msg; public class RispostaSetPointMessage extends PTPResponse { public RispostaSetPointMessage(int[] message) { load(message); } public int getMessageType() { return EDSMessage.MSG_RISPOSTA_SET_POINT; } public String getMessageDescription() { return "Risposta Set point cronotermostato"; } public double getSetPoint() { return ImpostaSetPointMessage.temperatura(Byte1 & 0x3F,(Byte1 & 0x80) >> 7); } public int getOra() { return (Byte2 & 0xF8) >> 3; } public int getGiorno() { return Byte2 & 0x07; } public int getStagione() { return (Byte1 & 0x40) >> 6; } public String toString() { StringBuffer s = new StringBuffer(); s.append(super.toString()); if (getOra() == 31) { s.append(" Manuale per "+getGiorno()+" ore"); } else { s.append(" Stagione:"+ImpostaSetPointMessage.stagione(getStagione())); s.append(" Giorno:"+ImpostaSetPointMessage.giorno(getGiorno())); s.append(" Orario:"+ImpostaSetPointMessage.fasciaOraria(getOra())); } s.append(" Temperatura: " + getSetPoint()+" gradi C"); return s.toString(); } }
[ "sergio.strampelli@gmail.com" ]
sergio.strampelli@gmail.com