blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
4555ed7bd86e108d78260b475b8d1e56e7e4e216
d1d79c769156693f5b8e0eb921207bd1bf0e7ba2
/src/main/java/br/com/guilherme/cursomc/domain/Categoria.java
7a80b59866e199c3199b7f62a8e2917cb12bbd8a
[]
no_license
guilhermedigue/cursomc
bea90736d8e113b1eb1568708c4692da055cd838
52c75a723d7578ffee91af2ce171af8e056d08e6
refs/heads/master
2020-08-21T10:13:35.874271
2019-10-19T18:27:53
2019-10-19T18:27:53
216,138,191
0
0
null
null
null
null
UTF-8
Java
false
false
1,191
java
package br.com.guilherme.cursomc.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.io.Serializable; import java.util.Objects; @Entity public class Categoria implements Serializable { private static final long seriaVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String nome; public Categoria() { } public Categoria(Integer id, String nome) { this.id = id; this.nome = nome; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Categoria categoria = (Categoria) o; return Objects.equals(id, categoria.id); } @Override public int hashCode() { return Objects.hash(id); } }
[ "guilherme_digue@hotmail.com" ]
guilherme_digue@hotmail.com
a3e1638ddf3d2ec1a9419fdab3fc252fede548e8
69deb05dc31c2e33de28738191a402011b61c855
/src/pl/AdamWisniewski/car/Car.java
ece0bc04eacd1f7d0f265cb3d218f5f51a933e80
[]
no_license
AdamWisniewski/VimExercise01
7479561b26da92cb6c03af53a3fcf12fc825d34d
9867be3c1b1280379f1ea06de32822b771fdae2e
refs/heads/master
2021-03-31T01:42:44.171167
2018-03-08T17:27:44
2018-03-08T17:27:44
124,422,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,079
java
package pl.AdamWisniewski.car; public class Car { private ElectricEngine electricEngine; private ConventionalEngine conventionalEngine; private boolean carWorks = false; private int fuel = 100; // Electric car public Car(ElectricEngine electricEngine) { this.electricEngine = electricEngine; } // Conventional Car public Car(ConventionalEngine conventionalEngine) { this.conventionalEngine = conventionalEngine; } // Hybrid Car public Car(ElectricEngine electricEngine, ConventionalEngine conventionalEngine) { this.electricEngine = electricEngine; this.conventionalEngine = conventionalEngine; } public void turnOnCar() { carWorks = true; } public void turnOfCar() { carWorks = false; } public void refuelCar(int fuelAdded) { if (conventionalEngine == null) { System.out.println("You can't fuel electric Car! Look for charging distributor."); } else { fuel += fuelAdded; } } public void move(String pointA, String pointB) { System.out.println("So lets take a ride from " + pointA + " to " + pointB + "!"); } }
[ "awisniewski27@gmail.com" ]
awisniewski27@gmail.com
4593b59e868f3c57bcc075305136be093f0cf5e0
5af057e66e70dae899a87bdc1407f169b46e0038
/plgE/AnalizadorLexico.java
18be569c63c91765e1bb6873e5d8313efc779c5d
[]
no_license
BackupTheBerlios/plg0506
ad249382fe0e719a9e6733b629e27f6feae7168d
4962c1c55d575c72a75caf8ff68d3898a626d3d8
refs/heads/master
2021-01-01T17:21:08.351401
2008-06-08T17:35:34
2008-06-08T17:35:34
40,042,713
0
0
null
null
null
null
ISO-8859-1
Java
false
false
8,503
java
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; /** * Clase que implementa el analizador léxico.<p> * @author */ public class AnalizadorLexico { // Archivo a analizar; private BufferedReader in; // Puntero a la tabla de símbolos. private tablaSimbolos ts; // Buffer para guardar el lexema que se está leyendo actualmente. // La posición cero la utilizamos de centinela. private char[] bufferLex; // Puntero al último carácter leido. private int puntero; // Buffer que guarda el carácter actualmente procesado. private char bufferCar; // Estado en el que se encuentra el analizador léxico. private int estado; // Linea en la que estamos leyendo. private int linea; // Constantes que se corresponden con los estados en los que //se puede encontrar el analizador léxico. Equivalente a hacer un //enum en C. private static final int S0 = 0; private static final int S1 = 1; private static final int S2 = 2; private static final int S3 = 3; private static final int S4 = 4; private static final int S5 = 5; private static final int S6 = 6; private static final int S7 = 7; private static final int S8 = 8; private static final int S9 = 9; private static final int S10 = 10; private static final int S11 = 11; private static final int S12 = 12; private static final int S13 = 13; private static final int S14 = 14; private static final int S15 = 15; /** * Constructora de la clase. * @param fichero Archivo a analizar. */ public AnalizadorLexico(String fichero, tablaSimbolos ts) { try { in = new BufferedReader(new FileReader(fichero)); bufferLex = new char[256]; puntero = 0; linea = 1; //Dejamos el primer carácter en bufferCar. bufferCar = (char)in.read(); this.ts = ts; } catch(IOException e) { System.out.println(e.getMessage()); } } /** * Función principal del analizador léxico. * @return Devuelve el siguiente token leido. */ public Object[] siguienteToken() { puntero = 0; estado = S0; boolean completado = false; Object[] token = new Object[2]; while(!completado) { switch(estado) { case S0: if(bufferCar == (char)-1){ token[0] = new Integer(Constantes.END); completado = true; } else if(bufferCar == '\t' || bufferCar == '\r' || bufferCar == '\n' || bufferCar == ' ') { // Control de nueva linea de lectura. if(bufferCar == '\n') linea += 1; transita(S0); puntero = 0; } else if(bufferCar == '=') transita(S1); else if(bufferCar == '>') transita(S2); else if(bufferCar == '<') transita(S3); else if(bufferCar == '!') transita(S4); else if(bufferCar == '&') transita(S6); else if(bufferCar == '|') transita(S8); else if(bufferCar == '*' || bufferCar == '%' || bufferCar == '0' || bufferCar == '{' || bufferCar == '}' || bufferCar == '(' || bufferCar == ')' || bufferCar == ';') transita(S10); else if((bufferCar >= 'A' && bufferCar <= 'Z') || (bufferCar >= 'a' && bufferCar <= 'z')) transita(S11); else if(bufferCar == '+' || bufferCar == '-') transita(S12); else if(bufferCar >= '1' && bufferCar <= '9') transita(S13); else if(bufferCar == '/') transita(S14); else transita(S15); break; case S1: if(bufferCar == '=') transita(S5); else { token[0] = new Integer(Constantes.ASIG); completado = true; } break; case S2: if(bufferCar == '=') transita(S5); else { token[0] = new Integer(Constantes.MAYOR); completado = true; } break; case S3: if(bufferCar == '=') transita(S5); else { token[0] = new Integer(Constantes.MENOR); completado = true; } break; case S4: if(bufferCar == '=') transita(S5); else { token[0] = new Integer(Constantes.NOT); completado = true; } break; case S5: String rel = String.valueOf(bufferLex); rel = rel.substring(1,3); if(rel.equals((String)"==")) { token[0] = new Integer(Constantes.IGUAL); completado = true; } else if(rel.equals((String)">=")) { token[0] = new Integer(Constantes.MAYORIGUAL); completado = true; } else if(rel.equals((String)"<=")) { token[0] = new Integer(Constantes.MENORIGUAL); completado = true; } else if(rel.equals((String)"!=")) { token[0] = new Integer(Constantes.DISTINTO); completado = true; } break; case S6: if(bufferCar == '&') transita(S7); else { transita(S15); } break; case S7: token[0] = new Integer(Constantes.AND); completado = true; break; case S8: if(bufferCar == '|') transita(S9); else { transita(S15); } break; case S9: token[0] = new Integer(Constantes.OR); completado = true; break; case S10: if(bufferLex[1] == '*') { token[0] = new Integer(Constantes.MULTIPLICA); completado = true; } else if(bufferLex[1] == '%') { token[0] = new Integer(Constantes.MOD); completado = true; } else if(bufferLex[1] == '{') { token[0] = new Integer(Constantes.LLAVEAB); completado = true; } else if(bufferLex[1] == '}') { token[0] = new Integer(Constantes.LLAVECERR); completado = true; } else if(bufferLex[1] == '(') { token[0] = new Integer(Constantes.PARENTAB); completado = true; } else if(bufferLex[1] == ')') { token[0] = new Integer(Constantes.PARENTCERR); completado = true; } else if(bufferLex[1] == ';') { token[0] = new Integer(Constantes.PUNTOYCOMA); completado = true; } else if(bufferLex[1] == '0') { token[0] = new Integer(Constantes.ENTERO); token[1] = new Integer(0); completado = true; } break; case S11: if((bufferCar >= 'A' && bufferCar <= 'Z') || (bufferCar >= 'a' && bufferCar <= 'z') || (bufferCar >= '0' && bufferCar <= '9')) transita(S11); else { // Verifico si es una palabra clave. String caracs = String.valueOf(bufferLex); caracs = caracs.substring(1, puntero +1); if(caracs.equals((String)"true")) { token[0] = new Integer(Constantes.TRUE); } else if(caracs.equals((String)"false")) token[0] = new Integer(Constantes.FALSE); else if(caracs.equals((String)"int")) token[0] = new Integer(Constantes.INT); else if(caracs.equals((String)"bool")) token[0] = new Integer(Constantes.BOOL); else { token[0] = new Integer(Constantes.ID); if(!ts.existeID(caracs)) ts.añadeID(caracs,linea); token[1] = caracs; } completado = true; } break; case S12: if(bufferCar >= '1' && bufferCar <= '9') transita(S13); else { if(bufferLex[1] == '+') token[0] = new Integer(Constantes.SUMA); else if(bufferLex[1] == '-') token[0] = new Integer(Constantes.RESTA); completado = true; } break; case S13: if(bufferCar >= '0' && bufferCar <= '9') transita(S13); else { token[0] = new Integer(Constantes.ENTERO); token[1] = new Integer(char_to_int()); completado = true; } break; case S14: if(bufferCar == '/') { try { if(in.readLine() != null) linea += 1; } catch(IOException e) { System.out.println(e.getMessage()); } transita(S0); puntero = 0; } else { token[0] = new Integer(Constantes.DIVIDE); completado = true; } break; case S15: token[0] = new Integer(Constantes.ERROR); token[1] = new String("Carácter no válido: " + bufferLex[puntero] + ", error en linea " + String.valueOf(linea)); completado = true; break; } } return token; } /** * Hace la trasición a otro estado. * @param estado Estado al que ir. */ private void transita(int estado) { try { puntero += 1; bufferLex[puntero] = bufferCar; bufferCar = (char)in.read(); this.estado = estado; } catch(IOException e) { System.out.println(e.getMessage()); } } /** * Tranforma carácteres a un entero. * @return La transformación a entero. */ private int char_to_int() { String caracs = String.valueOf(bufferLex); if(bufferLex[1] == '+') caracs = caracs.substring(2,puntero+1); else caracs = caracs.substring(1,puntero+1); return Integer.parseInt(caracs); } }
[ "scaramouche" ]
scaramouche
4d19d7ceae4a7ae7dc8c055f5582fa6b339d2d0c
362fe7b4b63d89c14e6a69549d6cda215b268204
/Mechanics.java
6878b1ad02b024ec87549ec0b15742f73ffd75e2
[]
no_license
tcloudb/Java-Wars
722881eb9ec6e04aed55111e64d98fb82f5fc24e
7c93347dd045950cf0407021963e14495619bc85
refs/heads/master
2021-01-19T14:45:52.138697
2017-04-13T21:06:21
2017-04-13T21:06:21
88,188,012
0
0
null
null
null
null
UTF-8
Java
false
false
762
java
public class Mechanics { private int turn; public Mechanics() { turn = 1; } public void battle(Unit a, Unit b) { a.damage(b); calcDeath(b); if (!b.getIsDead()) { b.damage(a); calcDeath(a); } } private void calcDeath(Unit a) { if (a.getHP() == 0) { a.setIsDead(true); } } public void endTurn() { turn++; } // returns a number which represents the player who's turn it is. Ex: 0 = player 1, 1 = player 2, etc. public int getTurn() { return turn%2; } // returns 0 if nobody has won, 1 if player 1 won, and 2 if player 2 won. public int calcVictory() { //if player 1 has no units, return 2 //if player 2 has no units, return 1 //else return 0 return 0; } }
[ "tcloudb@gmail.com" ]
tcloudb@gmail.com
eac0a88286d07c50a89e1375a892df44977d1cc0
e789eec798176e5ac3836680c7b458332151cceb
/src/persistentie/JPAUtil.java
ed24300902928cb196ea04e3f735e5b25f926e9c
[]
no_license
thomasdejagere/SaniManage
7ac5ac9213762259d4d8f7b95f78fd00c39074dd
503ce4b004a9539c2901d668ef33bbf443b4ce3c
refs/heads/master
2021-01-10T02:34:40.154927
2015-12-16T19:01:44
2015-12-16T19:01:44
48,129,117
0
0
null
null
null
null
UTF-8
Java
false
false
652
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 persistentie; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; /** * * @author Seppe */ public class JPAUtil { private final static EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("BarcodeSystemSV"); public static EntityManagerFactory getEntityManagerFactory() { return entityManagerFactory; } private JPAUtil() { } }
[ "thomas.dejagere.x7268@student.hogent.be" ]
thomas.dejagere.x7268@student.hogent.be
6a6d36bc0a9f8d6934f2ecd2aee6d16913dd3e03
5e2cab8845e635b75f699631e64480225c1cf34d
/modules/core/org.jowidgets.tools/src/main/java/org/jowidgets/tools/powo/JoCheckedMenuItem.java
49f4b96252b84b6a8c19b95d8da8bbc1f2935636
[ "BSD-3-Clause" ]
permissive
alec-liu/jo-widgets
2277374f059500dfbdb376333743d5507d3c57f4
a1dde3daf1d534cb28828795d1b722f83654933a
refs/heads/master
2022-04-18T02:36:54.239029
2018-06-08T13:08:26
2018-06-08T13:08:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,518
java
/* * Copyright (c) 2010, grossmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the jo-widgets.org nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL jo-widgets.org BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ package org.jowidgets.tools.powo; import org.jowidgets.api.toolkit.Toolkit; import org.jowidgets.api.widgets.ISelectableMenuItem; import org.jowidgets.api.widgets.blueprint.ICheckedMenuItemBluePrint; import org.jowidgets.api.widgets.descriptor.ICheckedMenuItemDescriptor; import org.jowidgets.common.image.IImageConstant; /** * @deprecated The idea of POWO's (Plain Old Widget Object's) has not been established. * For that, POWO's will no longer be supported and may removed completely in middle term. * Feel free to move them to your own open source project. */ @Deprecated public class JoCheckedMenuItem extends SelectableMenuItem<ISelectableMenuItem, ICheckedMenuItemBluePrint> implements ISelectableMenuItem { public JoCheckedMenuItem(final String text, final IImageConstant icon) { this(bluePrint(text, icon)); } public JoCheckedMenuItem(final String text) { this(bluePrint(text)); } public JoCheckedMenuItem(final String text, final String tooltipText) { this(bluePrint(text, tooltipText)); } public JoCheckedMenuItem(final ICheckedMenuItemDescriptor descriptor) { super(bluePrint().setSetup(descriptor)); } public static ICheckedMenuItemBluePrint bluePrint() { return Toolkit.getBluePrintFactory().checkedMenuItem(); } public static ICheckedMenuItemBluePrint bluePrint(final String text) { return Toolkit.getBluePrintFactory().checkedMenuItem(text); } public static ICheckedMenuItemBluePrint bluePrint(final String text, final String tooltipText) { return Toolkit.getBluePrintFactory().checkedMenuItem(text).setToolTipText(tooltipText); } public static ICheckedMenuItemBluePrint bluePrint(final String text, final IImageConstant icon) { return Toolkit.getBluePrintFactory().checkedMenuItem(text).setIcon(icon); } }
[ "herrgrossmann@users.noreply.github.com" ]
herrgrossmann@users.noreply.github.com
5616561a5995cc6c55762fa6caa3e93775c7e43f
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_e4d8a80c639d59173672634a9acb90c9a4f55c1f/BoxAndWhiskerRenderer/5_e4d8a80c639d59173672634a9acb90c9a4f55c1f_BoxAndWhiskerRenderer_s.java
a8fefff22d8c72051c89cc7faf7d8d7e0db595d8
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
42,171
java
/* =========================================================== * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * * (C) Copyright 2000-2009, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * -------------------------- * BoxAndWhiskerRenderer.java * -------------------------- * (C) Copyright 2003-2009, by David Browning and Contributors. * * Original Author: David Browning (for the Australian Institute of Marine * Science); * Contributor(s): David Gilbert (for Object Refinery Limited); * Tim Bardzil; * Rob Van der Sanden (patches 1866446 and 1888422); * Peter Becker (patches 2868585 and 2868608); * * Changes * ------- * 21-Aug-2003 : Version 1, contributed by David Browning (for the Australian * Institute of Marine Science); * 01-Sep-2003 : Incorporated outlier and farout symbols for low values * also (DG); * 08-Sep-2003 : Changed ValueAxis API (DG); * 16-Sep-2003 : Changed ChartRenderingInfo --> PlotRenderingInfo (DG); * 07-Oct-2003 : Added renderer state (DG); * 12-Nov-2003 : Fixed casting bug reported by Tim Bardzil (DG); * 13-Nov-2003 : Added drawHorizontalItem() method contributed by Tim * Bardzil (DG); * 25-Apr-2004 : Added fillBox attribute, equals() method and added * serialization code (DG); * 29-Apr-2004 : Changed drawing of upper and lower shadows - see bug report * 944011 (DG); * 05-Nov-2004 : Modified drawItem() signature (DG); * 09-Mar-2005 : Override getLegendItem() method so that legend item shapes * are shown as blocks (DG); * 20-Apr-2005 : Generate legend labels, tooltips and URLs (DG); * 09-Jun-2005 : Updated equals() to handle GradientPaint (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 12-Oct-2006 : Source reformatting and API doc updates (DG); * 12-Oct-2006 : Fixed bug 1572478, potential NullPointerException (DG); * 05-Feb-2006 : Added event notifications to a couple of methods (DG); * 20-Apr-2007 : Updated getLegendItem() for renderer change (DG); * 11-May-2007 : Added check for visibility in getLegendItem() (DG); * 17-May-2007 : Set datasetIndex and seriesIndex in getLegendItem() (DG); * 18-May-2007 : Set dataset and seriesKey for LegendItem (DG); * 03-Jan-2008 : Check visibility of average marker before drawing it (DG); * 15-Jan-2008 : Add getMaximumBarWidth() and setMaximumBarWidth() * methods (RVdS); * 14-Feb-2008 : Fix bar position for horizontal chart, see patch * 1888422 (RVdS); * 27-Mar-2008 : Boxes should use outlinePaint/Stroke settings (DG); * 17-Jun-2008 : Apply legend shape, font and paint attributes (DG); * 02-Oct-2008 : Check item visibility in drawItem() method (DG); * 21-Jan-2009 : Added flags to control visibility of mean and median * indicators (DG); * 28-Sep-2009 : Added fireChangeEvent() to setMedianVisible (DG); * 28-Sep-2009 : Added useOutlinePaintForWhiskers flag, see patch 2868585 * by Peter Becker (DG); * 28-Sep-2009 : Added whiskerWidth attribute, see patch 2868608 by Peter * Becker (DG); * */ package org.jfree.chart.renderer.category; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import org.jfree.chart.LegendItem; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.event.RendererChangeEvent; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.renderer.Outlier; import org.jfree.chart.renderer.OutlierList; import org.jfree.chart.renderer.OutlierListCollection; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; import org.jfree.io.SerialUtilities; import org.jfree.ui.RectangleEdge; import org.jfree.util.PaintUtilities; import org.jfree.util.PublicCloneable; /** * A box-and-whisker renderer. This renderer requires a * {@link BoxAndWhiskerCategoryDataset} and is for use with the * {@link CategoryPlot} class. The example shown here is generated * by the <code>BoxAndWhiskerChartDemo1.java</code> program included in the * JFreeChart Demo Collection: * <br><br> * <img src="../../../../../images/BoxAndWhiskerRendererSample.png" * alt="BoxAndWhiskerRendererSample.png" /> */ public class BoxAndWhiskerRenderer extends AbstractCategoryItemRenderer implements Cloneable, PublicCloneable, Serializable { /** For serialization. */ private static final long serialVersionUID = 632027470694481177L; /** The color used to paint the median line and average marker. */ private transient Paint artifactPaint; /** A flag that controls whether or not the box is filled. */ private boolean fillBox; /** The margin between items (boxes) within a category. */ private double itemMargin; /** * The maximum bar width as percentage of the available space in the plot. * Take care with the encoding - for example, 0.05 is five percent. */ private double maximumBarWidth; /** * A flag that controls whether or not the median indicator is drawn. * * @since 1.0.13 */ private boolean medianVisible; /** * A flag that controls whether or not the mean indicator is drawn. * * @since 1.0.13 */ private boolean meanVisible; /** * A flag that, if <code>true</code>, causes the whiskers to be drawn * using the outline paint for the series. The default value is * <code>false</code> and in that case the regular series paint is used. * * @since 1.0.14 */ private boolean useOutlinePaintForWhiskers; /** * The width of the whiskers as fraction of the bar width. * * @since 1.0.14 */ private double whiskerWidth; /** * Default constructor. */ public BoxAndWhiskerRenderer() { this.artifactPaint = Color.black; this.fillBox = true; this.itemMargin = 0.20; this.maximumBarWidth = 1.0; this.medianVisible = true; this.meanVisible = true; this.useOutlinePaintForWhiskers = false; this.whiskerWidth = 1.0; setBaseLegendShape(new Rectangle2D.Double(-4.0, -4.0, 8.0, 8.0)); } /** * Returns the paint used to color the median and average markers. * * @return The paint used to draw the median and average markers (never * <code>null</code>). * * @see #setArtifactPaint(Paint) */ public Paint getArtifactPaint() { return this.artifactPaint; } /** * Sets the paint used to color the median and average markers and sends * a {@link RendererChangeEvent} to all registered listeners. * * @param paint the paint (<code>null</code> not permitted). * * @see #getArtifactPaint() */ public void setArtifactPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.artifactPaint = paint; fireChangeEvent(); } /** * Returns the flag that controls whether or not the box is filled. * * @return A boolean. * * @see #setFillBox(boolean) */ public boolean getFillBox() { return this.fillBox; } /** * Sets the flag that controls whether or not the box is filled and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param flag the flag. * * @see #getFillBox() */ public void setFillBox(boolean flag) { this.fillBox = flag; fireChangeEvent(); } /** * Returns the item margin. This is a percentage of the available space * that is allocated to the space between items in the chart. * * @return The margin. * * @see #setItemMargin(double) */ public double getItemMargin() { return this.itemMargin; } /** * Sets the item margin and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param margin the margin (a percentage). * * @see #getItemMargin() */ public void setItemMargin(double margin) { this.itemMargin = margin; fireChangeEvent(); } /** * Returns the maximum bar width as a percentage of the available drawing * space. Take care with the encoding, for example 0.10 is ten percent. * * @return The maximum bar width. * * @see #setMaximumBarWidth(double) * * @since 1.0.10 */ public double getMaximumBarWidth() { return this.maximumBarWidth; } /** * Sets the maximum bar width, which is specified as a percentage of the * available space for all bars, and sends a {@link RendererChangeEvent} * to all registered listeners. * * @param percent the maximum bar width (a percentage, where 0.10 is ten * percent). * * @see #getMaximumBarWidth() * * @since 1.0.10 */ public void setMaximumBarWidth(double percent) { this.maximumBarWidth = percent; fireChangeEvent(); } /** * Returns the flag that controls whether or not the mean indicator is * draw for each item. * * @return A boolean. * * @see #setMeanVisible(boolean) * * @since 1.0.13 */ public boolean isMeanVisible() { return this.meanVisible; } /** * Sets the flag that controls whether or not the mean indicator is drawn * for each item, and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param visible the new flag value. * * @see #isMeanVisible() * * @since 1.0.13 */ public void setMeanVisible(boolean visible) { if (this.meanVisible == visible) { return; } this.meanVisible = visible; fireChangeEvent(); } /** * Returns the flag that controls whether or not the median indicator is * draw for each item. * * @return A boolean. * * @see #setMedianVisible(boolean) * * @since 1.0.13 */ public boolean isMedianVisible() { return this.medianVisible; } /** * Sets the flag that controls whether or not the median indicator is drawn * for each item, and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param visible the new flag value. * * @see #isMedianVisible() * * @since 1.0.13 */ public void setMedianVisible(boolean visible) { if (this.medianVisible == visible) { return; } this.medianVisible = visible; fireChangeEvent(); } /** * Returns the flag that, if <code>true</code>, causes the whiskers to * be drawn using the series outline paint. * * @return A boolean. * * @since 1.0.14 */ public boolean getUseOutlinePaintForWhiskers() { return useOutlinePaintForWhiskers; } /** * Sets the flag that, if <code>true</code>, causes the whiskers to * be drawn using the series outline paint, and sends a * {@link RendererChangeEvent} to all registered listeners. * * @@param flag the new flag value. * * @since 1.0.14 */ public void setUseOutlinePaintForWhiskers(boolean flag) { if (this.useOutlinePaintForWhiskers == flag) { return; } this.useOutlinePaintForWhiskers = flag; fireChangeEvent(); } /** * Returns the width of the whiskers as fraction of the bar width. * * @return The width of the whiskers. * * @see #setWhiskerWidth(double) * * @since 1.0.14 */ public double getWhiskerWidth() { return this.whiskerWidth; } /** * Sets the width of the whiskers as a fraction of the bar width and sends * a {@link RendererChangeEvent} to all registered listeners. * * @param width a value between 0 and 1 indicating how wide the * whisker is supposed to be compared to the bar. * @see #getWhiskerWidth() * @see CategoryItemRendererState#getBarWidth() * * @since 1.0.14 */ public void setWhiskerWidth(double width) { if (width < 0 || width > 1) { throw new IllegalArgumentException( "Value for whisker width out of range"); } if (width == this.whiskerWidth) { return; } this.whiskerWidth = width; fireChangeEvent(); } /** * Returns a legend item for a series. * * @param datasetIndex the dataset index (zero-based). * @param series the series index (zero-based). * * @return The legend item (possibly <code>null</code>). */ public LegendItem getLegendItem(int datasetIndex, int series) { CategoryPlot cp = getPlot(); if (cp == null) { return null; } // check that a legend item needs to be displayed... if (!isSeriesVisible(series) || !isSeriesVisibleInLegend(series)) { return null; } CategoryDataset dataset = cp.getDataset(datasetIndex); String label = getLegendItemLabelGenerator().generateLabel(dataset, series); String description = label; String toolTipText = null; if (getLegendItemToolTipGenerator() != null) { toolTipText = getLegendItemToolTipGenerator().generateLabel( dataset, series); } String urlText = null; if (getLegendItemURLGenerator() != null) { urlText = getLegendItemURLGenerator().generateLabel(dataset, series); } Shape shape = lookupLegendShape(series); Paint paint = lookupSeriesPaint(series); Paint outlinePaint = lookupSeriesOutlinePaint(series); Stroke outlineStroke = lookupSeriesOutlineStroke(series); LegendItem result = new LegendItem(label, description, toolTipText, urlText, shape, paint, outlineStroke, outlinePaint); result.setLabelFont(lookupLegendTextFont(series)); Paint labelPaint = lookupLegendTextPaint(series); if (labelPaint != null) { result.setLabelPaint(labelPaint); } result.setDataset(dataset); result.setDatasetIndex(datasetIndex); result.setSeriesKey(dataset.getRowKey(series)); result.setSeriesIndex(series); return result; } /** * Returns the range of values from the specified dataset that the * renderer will require to display all the data. * * @param dataset the dataset. * * @return The range. */ public Range findRangeBounds(CategoryDataset dataset) { return super.findRangeBounds(dataset, true); } /** * Initialises the renderer. This method gets called once at the start of * the process of drawing a chart. * * @param g2 the graphics device. * @param dataArea the area in which the data is to be plotted. * @param plot the plot. * @param rendererIndex the renderer index. * @param info collects chart rendering information for return to caller. * * @return The renderer state. */ public CategoryItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info) { CategoryItemRendererState state = super.initialise(g2, dataArea, plot, rendererIndex, info); // calculate the box width CategoryAxis domainAxis = getDomainAxis(plot, rendererIndex); CategoryDataset dataset = plot.getDataset(rendererIndex); if (dataset != null) { int columns = dataset.getColumnCount(); int rows = dataset.getRowCount(); double space = 0.0; PlotOrientation orientation = plot.getOrientation(); if (orientation == PlotOrientation.HORIZONTAL) { space = dataArea.getHeight(); } else if (orientation == PlotOrientation.VERTICAL) { space = dataArea.getWidth(); } double maxWidth = space * getMaximumBarWidth(); double categoryMargin = 0.0; double currentItemMargin = 0.0; if (columns > 1) { categoryMargin = domainAxis.getCategoryMargin(); } if (rows > 1) { currentItemMargin = getItemMargin(); } double used = space * (1 - domainAxis.getLowerMargin() - domainAxis.getUpperMargin() - categoryMargin - currentItemMargin); if ((rows * columns) > 0) { state.setBarWidth(Math.min(used / (dataset.getColumnCount() * dataset.getRowCount()), maxWidth)); } else { state.setBarWidth(Math.min(used, maxWidth)); } } return state; } /** * Draw a single data item. * * @param g2 the graphics device. * @param state the renderer state. * @param dataArea the area in which the data is drawn. * @param plot the plot. * @param domainAxis the domain axis. * @param rangeAxis the range axis. * @param dataset the data (must be an instance of * {@link BoxAndWhiskerCategoryDataset}). * @param row the row index (zero-based). * @param column the column index (zero-based). * @param pass the pass index. */ public void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass) { // do nothing if item is not visible if (!getItemVisible(row, column)) { return; } if (!(dataset instanceof BoxAndWhiskerCategoryDataset)) { throw new IllegalArgumentException( "BoxAndWhiskerRenderer.drawItem() : the data should be " + "of type BoxAndWhiskerCategoryDataset only."); } PlotOrientation orientation = plot.getOrientation(); if (orientation == PlotOrientation.HORIZONTAL) { drawHorizontalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column); } else if (orientation == PlotOrientation.VERTICAL) { drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column); } } /** * Draws the visual representation of a single data item when the plot has * a horizontal orientation. * * @param g2 the graphics device. * @param state the renderer state. * @param dataArea the area within which the plot is being drawn. * @param plot the plot (can be used to obtain standard color * information etc). * @param domainAxis the domain axis. * @param rangeAxis the range axis. * @param dataset the dataset (must be an instance of * {@link BoxAndWhiskerCategoryDataset}). * @param row the row index (zero-based). * @param column the column index (zero-based). */ public void drawHorizontalItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column) { BoxAndWhiskerCategoryDataset bawDataset = (BoxAndWhiskerCategoryDataset) dataset; double categoryEnd = domainAxis.getCategoryEnd(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double categoryStart = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double categoryWidth = Math.abs(categoryEnd - categoryStart); double yy = categoryStart; int seriesCount = getRowCount(); int categoryCount = getColumnCount(); if (seriesCount > 1) { double seriesGap = dataArea.getHeight() * getItemMargin() / (categoryCount * (seriesCount - 1)); double usedWidth = (state.getBarWidth() * seriesCount) + (seriesGap * (seriesCount - 1)); // offset the start of the boxes if the total width used is smaller // than the category width double offset = (categoryWidth - usedWidth) / 2; yy = yy + offset + (row * (state.getBarWidth() + seriesGap)); } else { // offset the start of the box if the box width is smaller than // the category width double offset = (categoryWidth - state.getBarWidth()) / 2; yy = yy + offset; } g2.setPaint(getItemPaint(row, column)); Stroke s = getItemStroke(row, column); g2.setStroke(s); RectangleEdge location = plot.getRangeAxisEdge(); Number xQ1 = bawDataset.getQ1Value(row, column); Number xQ3 = bawDataset.getQ3Value(row, column); Number xMax = bawDataset.getMaxRegularValue(row, column); Number xMin = bawDataset.getMinRegularValue(row, column); Shape box = null; if (xQ1 != null && xQ3 != null && xMax != null && xMin != null) { double xxQ1 = rangeAxis.valueToJava2D(xQ1.doubleValue(), dataArea, location); double xxQ3 = rangeAxis.valueToJava2D(xQ3.doubleValue(), dataArea, location); double xxMax = rangeAxis.valueToJava2D(xMax.doubleValue(), dataArea, location); double xxMin = rangeAxis.valueToJava2D(xMin.doubleValue(), dataArea, location); double yymid = yy + state.getBarWidth() / 2.0; double halfW = (state.getBarWidth() / 2.0) * this.whiskerWidth; // draw the box... box = new Rectangle2D.Double(Math.min(xxQ1, xxQ3), yy, Math.abs(xxQ1 - xxQ3), state.getBarWidth()); if (this.fillBox) { g2.fill(box); } Paint outlinePaint = getItemOutlinePaint(row, column); if (this.useOutlinePaintForWhiskers) { g2.setPaint(outlinePaint); } // draw the upper shadow... g2.draw(new Line2D.Double(xxMax, yymid, xxQ3, yymid)); g2.draw(new Line2D.Double(xxMax, yymid - halfW, xxMax, yymid + halfW)); // draw the lower shadow... g2.draw(new Line2D.Double(xxMin, yymid, xxQ1, yymid)); g2.draw(new Line2D.Double(xxMin, yymid - halfW, xxMin, yy + halfW)); g2.setStroke(getItemOutlineStroke(row, column)); g2.setPaint(outlinePaint); g2.draw(box); } // draw mean - SPECIAL AIMS REQUIREMENT... g2.setPaint(this.artifactPaint); double aRadius = 0; // average radius if (this.meanVisible) { Number xMean = bawDataset.getMeanValue(row, column); if (xMean != null) { double xxMean = rangeAxis.valueToJava2D(xMean.doubleValue(), dataArea, location); aRadius = state.getBarWidth() / 4; // here we check that the average marker will in fact be // visible before drawing it... if ((xxMean > (dataArea.getMinX() - aRadius)) && (xxMean < (dataArea.getMaxX() + aRadius))) { Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xxMean - aRadius, yy + aRadius, aRadius * 2, aRadius * 2); g2.fill(avgEllipse); g2.draw(avgEllipse); } } } // draw median... if (this.medianVisible) { Number xMedian = bawDataset.getMedianValue(row, column); if (xMedian != null) { double xxMedian = rangeAxis.valueToJava2D(xMedian.doubleValue(), dataArea, location); g2.draw(new Line2D.Double(xxMedian, yy, xxMedian, yy + state.getBarWidth())); } } // collect entity and tool tip information... if (state.getInfo() != null && box != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null) { addItemEntity(entities, dataset, row, column, box); } } } /** * Draws the visual representation of a single data item when the plot has * a vertical orientation. * * @param g2 the graphics device. * @param state the renderer state. * @param dataArea the area within which the plot is being drawn. * @param plot the plot (can be used to obtain standard color information * etc). * @param domainAxis the domain axis. * @param rangeAxis the range axis. * @param dataset the dataset (must be an instance of * {@link BoxAndWhiskerCategoryDataset}). * @param row the row index (zero-based). * @param column the column index (zero-based). */ public void drawVerticalItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column) { BoxAndWhiskerCategoryDataset bawDataset = (BoxAndWhiskerCategoryDataset) dataset; double categoryEnd = domainAxis.getCategoryEnd(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double categoryStart = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double categoryWidth = categoryEnd - categoryStart; double xx = categoryStart; int seriesCount = getRowCount(); int categoryCount = getColumnCount(); if (seriesCount > 1) { double seriesGap = dataArea.getWidth() * getItemMargin() / (categoryCount * (seriesCount - 1)); double usedWidth = (state.getBarWidth() * seriesCount) + (seriesGap * (seriesCount - 1)); // offset the start of the boxes if the total width used is smaller // than the category width double offset = (categoryWidth - usedWidth) / 2; xx = xx + offset + (row * (state.getBarWidth() + seriesGap)); } else { // offset the start of the box if the box width is smaller than the // category width double offset = (categoryWidth - state.getBarWidth()) / 2; xx = xx + offset; } double yyAverage = 0.0; double yyOutlier; Paint itemPaint = getItemPaint(row, column); g2.setPaint(itemPaint); Stroke s = getItemStroke(row, column); g2.setStroke(s); double aRadius = 0; // average radius RectangleEdge location = plot.getRangeAxisEdge(); Number yQ1 = bawDataset.getQ1Value(row, column); Number yQ3 = bawDataset.getQ3Value(row, column); Number yMax = bawDataset.getMaxRegularValue(row, column); Number yMin = bawDataset.getMinRegularValue(row, column); Shape box = null; if (yQ1 != null && yQ3 != null && yMax != null && yMin != null) { double yyQ1 = rangeAxis.valueToJava2D(yQ1.doubleValue(), dataArea, location); double yyQ3 = rangeAxis.valueToJava2D(yQ3.doubleValue(), dataArea, location); double yyMax = rangeAxis.valueToJava2D(yMax.doubleValue(), dataArea, location); double yyMin = rangeAxis.valueToJava2D(yMin.doubleValue(), dataArea, location); double xxmid = xx + state.getBarWidth() / 2.0; double halfW = (state.getBarWidth() / 2.0) * this.whiskerWidth; // draw the body... box = new Rectangle2D.Double(xx, Math.min(yyQ1, yyQ3), state.getBarWidth(), Math.abs(yyQ1 - yyQ3)); if (this.fillBox) { g2.fill(box); } Paint outlinePaint = getItemOutlinePaint(row, column); if (this.useOutlinePaintForWhiskers) { g2.setPaint(outlinePaint); } // draw the upper shadow... g2.draw(new Line2D.Double(xxmid, yyMax, xxmid, yyQ3)); g2.draw(new Line2D.Double(xx - halfW, yyMax, xx + halfW, yyMax)); // draw the lower shadow... g2.draw(new Line2D.Double(xxmid, yyMin, xxmid, yyQ1)); g2.draw(new Line2D.Double(xx - halfW, yyMin, xx + halfW, yyMin)); g2.setStroke(getItemOutlineStroke(row, column)); g2.setPaint(outlinePaint); g2.draw(box); } g2.setPaint(this.artifactPaint); // draw mean - SPECIAL AIMS REQUIREMENT... if (this.meanVisible) { Number yMean = bawDataset.getMeanValue(row, column); if (yMean != null) { yyAverage = rangeAxis.valueToJava2D(yMean.doubleValue(), dataArea, location); aRadius = state.getBarWidth() / 4; // here we check that the average marker will in fact be // visible before drawing it... if ((yyAverage > (dataArea.getMinY() - aRadius)) && (yyAverage < (dataArea.getMaxY() + aRadius))) { Ellipse2D.Double avgEllipse = new Ellipse2D.Double( xx + aRadius, yyAverage - aRadius, aRadius * 2, aRadius * 2); g2.fill(avgEllipse); g2.draw(avgEllipse); } } } // draw median... if (this.medianVisible) { Number yMedian = bawDataset.getMedianValue(row, column); if (yMedian != null) { double yyMedian = rangeAxis.valueToJava2D( yMedian.doubleValue(), dataArea, location); g2.draw(new Line2D.Double(xx, yyMedian, xx + state.getBarWidth(), yyMedian)); } } // draw yOutliers... double maxAxisValue = rangeAxis.valueToJava2D( rangeAxis.getUpperBound(), dataArea, location) + aRadius; double minAxisValue = rangeAxis.valueToJava2D( rangeAxis.getLowerBound(), dataArea, location) - aRadius; g2.setPaint(itemPaint); // draw outliers double oRadius = state.getBarWidth() / 3; // outlier radius List outliers = new ArrayList(); OutlierListCollection outlierListCollection = new OutlierListCollection(); // From outlier array sort out which are outliers and put these into a // list If there are any farouts, set the flag on the // OutlierListCollection List yOutliers = bawDataset.getOutliers(row, column); if (yOutliers != null) { for (int i = 0; i < yOutliers.size(); i++) { double outlier = ((Number) yOutliers.get(i)).doubleValue(); Number minOutlier = bawDataset.getMinOutlier(row, column); Number maxOutlier = bawDataset.getMaxOutlier(row, column); Number minRegular = bawDataset.getMinRegularValue(row, column); Number maxRegular = bawDataset.getMaxRegularValue(row, column); if (outlier > maxOutlier.doubleValue()) { outlierListCollection.setHighFarOut(true); } else if (outlier < minOutlier.doubleValue()) { outlierListCollection.setLowFarOut(true); } else if (outlier > maxRegular.doubleValue()) { yyOutlier = rangeAxis.valueToJava2D(outlier, dataArea, location); outliers.add(new Outlier(xx + state.getBarWidth() / 2.0, yyOutlier, oRadius)); } else if (outlier < minRegular.doubleValue()) { yyOutlier = rangeAxis.valueToJava2D(outlier, dataArea, location); outliers.add(new Outlier(xx + state.getBarWidth() / 2.0, yyOutlier, oRadius)); } Collections.sort(outliers); } // Process outliers. Each outlier is either added to the // appropriate outlier list or a new outlier list is made for (Iterator iterator = outliers.iterator(); iterator.hasNext();) { Outlier outlier = (Outlier) iterator.next(); outlierListCollection.add(outlier); } for (Iterator iterator = outlierListCollection.iterator(); iterator.hasNext();) { OutlierList list = (OutlierList) iterator.next(); Outlier outlier = list.getAveragedOutlier(); Point2D point = outlier.getPoint(); if (list.isMultiple()) { drawMultipleEllipse(point, state.getBarWidth(), oRadius, g2); } else { drawEllipse(point, oRadius, g2); } } // draw farout indicators if (outlierListCollection.isHighFarOut()) { drawHighFarOut(aRadius / 2.0, g2, xx + state.getBarWidth() / 2.0, maxAxisValue); } if (outlierListCollection.isLowFarOut()) { drawLowFarOut(aRadius / 2.0, g2, xx + state.getBarWidth() / 2.0, minAxisValue); } } // collect entity and tool tip information... if (state.getInfo() != null && box != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null) { addItemEntity(entities, dataset, row, column, box); } } } /** * Draws a dot to represent an outlier. * * @param point the location. * @param oRadius the radius. * @param g2 the graphics device. */ private void drawEllipse(Point2D point, double oRadius, Graphics2D g2) { Ellipse2D dot = new Ellipse2D.Double(point.getX() + oRadius / 2, point.getY(), oRadius, oRadius); g2.draw(dot); } /** * Draws two dots to represent the average value of more than one outlier. * * @param point the location * @param boxWidth the box width. * @param oRadius the radius. * @param g2 the graphics device. */ private void drawMultipleEllipse(Point2D point, double boxWidth, double oRadius, Graphics2D g2) { Ellipse2D dot1 = new Ellipse2D.Double(point.getX() - (boxWidth / 2) + oRadius, point.getY(), oRadius, oRadius); Ellipse2D dot2 = new Ellipse2D.Double(point.getX() + (boxWidth / 2), point.getY(), oRadius, oRadius); g2.draw(dot1); g2.draw(dot2); } /** * Draws a triangle to indicate the presence of far-out values. * * @param aRadius the radius. * @param g2 the graphics device. * @param xx the x coordinate. * @param m the y coordinate. */ private void drawHighFarOut(double aRadius, Graphics2D g2, double xx, double m) { double side = aRadius * 2; g2.draw(new Line2D.Double(xx - side, m + side, xx + side, m + side)); g2.draw(new Line2D.Double(xx - side, m + side, xx, m)); g2.draw(new Line2D.Double(xx + side, m + side, xx, m)); } /** * Draws a triangle to indicate the presence of far-out values. * * @param aRadius the radius. * @param g2 the graphics device. * @param xx the x coordinate. * @param m the y coordinate. */ private void drawLowFarOut(double aRadius, Graphics2D g2, double xx, double m) { double side = aRadius * 2; g2.draw(new Line2D.Double(xx - side, m - side, xx + side, m - side)); g2.draw(new Line2D.Double(xx - side, m - side, xx, m)); g2.draw(new Line2D.Double(xx + side, m - side, xx, m)); } /** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return <code>true</code> or <code>false</code>. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof BoxAndWhiskerRenderer)) { return false; } BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj; if (this.fillBox != that.fillBox) { return false; } if (this.itemMargin != that.itemMargin) { return false; } if (this.maximumBarWidth != that.maximumBarWidth) { return false; } if (this.meanVisible != that.meanVisible) { return false; } if (this.medianVisible != that.medianVisible) { return false; } if (this.useOutlinePaintForWhiskers != that.useOutlinePaintForWhiskers) { return false; } if (this.whiskerWidth != that.whiskerWidth) { return false; } if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint)) { return false; } return super.equals(obj); } /** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.artifactPaint, stream); } /** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.artifactPaint = SerialUtilities.readPaint(stream); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
0cd52a92f948162ee91cab8cbb49b7503f1e306f
4e7cc60be0d5b68da137506f4336a6a17167afa1
/src/stegen/client/gui/score/ScoreTableRow.java
d18491d7eab440094cf0992b944913571c1c3e2c
[]
no_license
askeew/Vinnarstegen
e0b75c91b2635442b8a036b18f8f40f5f2a0d6a9
c940703af68a77f4ecdbef7da01366431d687a4d
refs/heads/master
2021-01-15T18:14:52.260393
2011-12-04T22:51:27
2011-12-04T22:51:27
2,666,763
0
0
null
null
null
null
UTF-8
Java
false
false
642
java
package stegen.client.gui.score; import stegen.shared.*; // Går det att få bort PlayerDTO? public class ScoreTableRow { public final PlayerDto player; public final String score; public final String ranking; public final String changedDateTime; public final String changedBy; public final boolean currentUser; public ScoreTableRow(PlayerDto player, String score, String ranking, String changedDateTime, String changedBy, boolean currentUser) { this.player = player; this.score = score; this.ranking = ranking; this.changedDateTime = changedDateTime; this.changedBy = changedBy; this.currentUser = currentUser; } }
[ "bjorn.ekryd@gmail.com" ]
bjorn.ekryd@gmail.com
28272552d8bec107c216c4ac627bc5cf271bf6ce
3d12c4dd59406e12fa60cec790d9b3236a1a8ad8
/strings/anagrams/anagrams.java
9793651080e1b51277b465ae4bd6b4b12782c242
[]
no_license
toyotathon/leetcode_problems
5aec33d8ba810c63d73819400df0f5ca2b51e84e
b885f0e2c842902ba25bbd85859fccacad7bebb4
refs/heads/master
2021-09-04T01:28:17.944235
2018-01-14T03:19:05
2018-01-14T03:19:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,403
java
import java.util.*; class Solution { private static Map<Character, Integer> createMap(String s) { Map<Character, Integer> returnMap = new HashMap<Character, Integer>(); int length = s.length(); for (int i = 0; i < length; i++) { char current = s.charAt(i); if (returnMap.get(current) == null) { returnMap.put(current, 1); } else { int incrementValue = returnMap.get(current) + 1; returnMap.put(current, incrementValue); } } return returnMap; } private static boolean anagramMatch(Map<Character, Integer> sMap, Map<Character, Integer> tMap) { for (Map.Entry<Character, Integer> entry : sMap.entrySet()) { int entryValue = entry.getValue(); char entryKey = entry.getKey(); if (tMap.get(entryKey) == null) { return false; } else if (tMap.get(entryKey) != entryValue) { return false; } } return true; } public boolean isAnagram(String s, String t) { Map<Character, Integer> sMap = createMap(s); Map<Character, Integer> tMap = createMap(t); if (sMap.size() >= tMap.size()) { return anagramMatch(sMap, tMap); } return anagramMatch(tMap, sMap); } }
[ "Jason_Valenzuela@comcast.com" ]
Jason_Valenzuela@comcast.com
682b4ad86804011a0bc5d1cc4cb672b1a45e5192
5c206806f5c612d14400682030cda0bd23b98981
/src/main/java/org/cyclops/integrateddynamics/core/inventory/container/ContainerMultipart.java
4b60725b049eb059f755d9ef388597e89f1329af
[ "MIT" ]
permissive
way2muchnoise/IntegratedDynamics
1ed49a413a21492e18e9bbe9ab51c03ccc81e41e
fcd4d71623a5a70d929bb7f6a9bed15745ac039f
refs/heads/master-1.10
2021-05-04T09:06:40.797829
2016-11-01T10:21:15
2016-11-01T10:21:15
70,403,691
0
0
null
2016-10-09T13:08:23
2016-10-09T13:08:23
null
UTF-8
Java
false
false
3,709
java
package org.cyclops.integrateddynamics.core.inventory.container; import com.google.common.collect.Maps; import lombok.Data; import lombok.EqualsAndHashCode; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.cyclops.cyclopscore.helper.MinecraftHelpers; import org.cyclops.cyclopscore.inventory.IGuiContainerProvider; import org.cyclops.cyclopscore.inventory.container.ExtendedInventoryContainer; import org.cyclops.cyclopscore.inventory.container.InventoryContainer; import org.cyclops.cyclopscore.inventory.container.button.IButtonActionServer; import org.cyclops.cyclopscore.persist.IDirtyMarkListener; import org.cyclops.integrateddynamics.IntegratedDynamics; import org.cyclops.integrateddynamics.api.part.IPartContainer; import org.cyclops.integrateddynamics.api.part.IPartState; import org.cyclops.integrateddynamics.api.part.IPartType; import org.cyclops.integrateddynamics.api.part.PartTarget; import org.cyclops.integrateddynamics.api.part.aspect.IAspect; import org.cyclops.integrateddynamics.core.client.gui.ExtendedGuiHandler; import org.cyclops.integrateddynamics.core.helper.PartHelpers; import org.cyclops.integrateddynamics.core.part.PartTypeConfigurable; import java.util.Map; /** * Container for parts. * @author rubensworks */ @EqualsAndHashCode(callSuper = false) @Data public abstract class ContainerMultipart<P extends IPartType<P, S> & IGuiContainerProvider, S extends IPartState<P>> extends ExtendedInventoryContainer implements IDirtyMarkListener { public static final int BUTTON_SETTINGS = 1; private static final int PAGE_SIZE = 3; private final PartTarget target; private final IPartContainer partContainer; private final P partType; private final World world; private final BlockPos pos; private final Map<IAspect, Integer> aspectPropertyButtons = Maps.newHashMap(); protected final EntityPlayer player; /** * Make a new instance. * @param target The target. * @param player The player. * @param partContainer The part container. * @param partType The part type. */ public ContainerMultipart(EntityPlayer player, PartTarget target, IPartContainer partContainer, P partType) { super(player.inventory, partType); this.target = target; this.partContainer = partContainer; this.partType = partType; this.world = player.getEntityWorld(); this.pos = player.getPosition(); this.player = player; putButtonAction(BUTTON_SETTINGS, new IButtonActionServer<InventoryContainer>() { @Override public void onAction(int buttonId, InventoryContainer container) { IGuiContainerProvider gui = ((PartTypeConfigurable) getPartType()).getSettingsGuiProvider(); IntegratedDynamics._instance.getGuiHandler().setTemporaryData(ExtendedGuiHandler.PART, getTarget().getCenter().getSide()); // Pass the side as extra data to the gui if(!MinecraftHelpers.isClientSide()) { BlockPos cPos = getTarget().getCenter().getPos().getBlockPos(); ContainerMultipart.this.player.openGui(gui.getModGui(), gui.getGuiID(), world, cPos.getX(), cPos.getY(), cPos.getZ()); } } }); } @SuppressWarnings("unchecked") public S getPartState() { return (S) partContainer.getPartState(getTarget().getCenter().getSide()); } @Override public boolean canInteractWith(EntityPlayer playerIn) { return PartHelpers.canInteractWith(getTarget(), player, this.partContainer); } }
[ "rubensworks@gmail.com" ]
rubensworks@gmail.com
d833795a1123b348c5226f027c35f0ec45fc6b57
a8e47979b45aa428a32e16ddc4ee2578ec969dfe
/base/config/src/main/java/org/artifactory/descriptor/repo/distribution/rule/package-info.java
dc7e8858814b341d6143eb9803fc30dbfb38d12c
[]
no_license
nuance-sspni/artifactory-oss
da505cac1984da131a61473813ee2c7c04d8d488
af3fcf09e27cac836762e9957ad85bdaeec6e7f8
refs/heads/master
2021-07-22T20:04:08.718321
2017-11-02T20:49:33
2017-11-02T20:49:33
109,313,757
0
1
null
null
null
null
UTF-8
Java
false
false
1,175
java
/* * * Artifactory is a binaries repository manager. * Copyright (C) 2016 JFrog Ltd. * * Artifactory is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Artifactory is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Artifactory. If not, see <http://www.gnu.org/licenses/>. * */ @XmlSchema(namespace = Descriptor.NS, elementFormDefault = XmlNsForm.QUALIFIED) @XmlAccessorType(XmlAccessType.FIELD) package org.artifactory.descriptor.repo.distribution.rule; import org.artifactory.descriptor.Descriptor; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema;
[ "tuan-anh.nguyen@nuance.com" ]
tuan-anh.nguyen@nuance.com
716ca392e5a6f141cd967c2f2948df6bef710bad
6dfe44a8e2c8c577536e0757164a4647eb020b3e
/src/me/naithantu/ArenaPVP/Gamemodes/Gamemodes/Paintball/PaintballTimer.java
60f1e883a45ccdaf88738b220ae47fc474643bc7
[]
no_license
SlapGaming/ArenaPVP
0e2fd47fe5a6e1cc2bc3e2c6a8f9f55a6044fd68
685ede15b91f8e7330ef49c92e0057e19eb1acfa
refs/heads/master
2016-09-05T23:09:28.002571
2015-03-02T20:52:31
2015-03-02T20:52:31
11,369,390
0
0
null
null
null
null
UTF-8
Java
false
false
1,159
java
package me.naithantu.ArenaPVP.Gamemodes.Gamemodes.Paintball; import me.naithantu.ArenaPVP.Arena.ArenaExtras.ArenaPlayerState; import me.naithantu.ArenaPVP.Arena.ArenaPlayer; import me.naithantu.ArenaPVP.Arena.ArenaTeam; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; import java.util.List; public class PaintballTimer extends BukkitRunnable { private List<ArenaTeam> teams; private ItemStack snowBall; public PaintballTimer(List<ArenaTeam> teams){ this.teams = teams; snowBall = new ItemStack(Material.SNOW_BALL, 1); } @Override public void run() { for(ArenaTeam team: teams){ for(ArenaPlayer arenaPlayer: team.getPlayers()){ if(arenaPlayer.getPlayerState() == ArenaPlayerState.PLAYING){ Player player = Bukkit.getPlayerExact(arenaPlayer.getPlayerName()); if(!player.isDead()){ player.getInventory().addItem(snowBall); } } } } } }
[ "m.tebraake.95@gmail.com" ]
m.tebraake.95@gmail.com
11cc14546abab3722f4a4c107b2948a0b97c627f
431ccc0276d045e34c1749782e2d99c1179d219f
/dayTwo/Expression/ComparisonOperators.java
b5101dd50434da31ed469613e305fc9f37a0b277
[]
no_license
Abeleencon/Core_java
16c8daf5bf7df8dd8760bb4f58176e457ccdc162
25d6482b56cfe3511112ff231313fd4aebdd715f
refs/heads/master
2020-04-01T15:32:21.879417
2018-10-16T19:26:01
2018-10-16T19:26:01
153,341,311
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
package dayTwo.Expression; public class ComparisonOperators { //We have six relational operators in Java: ==, !=, <, >, <=, >= public static void main(String[] args) { int num1 = 10; int num2 = 50; if (num1 == num2) { System.out.println("Num1 and num2 are the same"); } else { System.out.println("Num1 and Num2 are not the same"); } if (num1 != num2) { System.out.println("Num1 and num2 are not the same"); } else { System.out.println("Num1 and Num2 are the same"); } if (num1 >= num2) { System.out.println("Num1 is greater or equal to num2 "); } else { System.out.println("Num1 is less than Num2"); } } }
[ "abiodunowoseje@gmail.com" ]
abiodunowoseje@gmail.com
f448a5cd6b58dfdc803561758843f90235d72534
4cc020d488db5e7f856276fc4f6ec96efa9e25a0
/src/main/java/io/praveen/reactbootapp/model/UserRepository.java
70e9db30adef276482cb15e238c13903d5388ceb
[]
no_license
praveen270794/react-boot
abd2134b1ac47e8688761ddb56246131c2f65e0b
7f54c3267078853049775e4b2eb963b75e49ed19
refs/heads/master
2023-02-09T21:59:11.145829
2020-05-31T11:45:23
2020-05-31T11:45:23
268,070,341
0
0
null
2021-01-06T03:43:54
2020-05-30T11:56:47
JavaScript
UTF-8
Java
false
false
174
java
package io.praveen.reactbootapp.model; import org.springframework.data.jpa.repository.JpaRepository; public interface UserRepository extends JpaRepository<User, String> { }
[ "praveen.gupta@magicbricks.com" ]
praveen.gupta@magicbricks.com
f1fd5fb76369efbcbe4d6d867c51223389866c4f
1932273022878e5adcf56d0309c2e25d9c40e7da
/src/main/java/jp/bananafish/spark/sample/Address.java
3bd437135479cda5863fb22028667732947be712
[ "MIT" ]
permissive
border-aloha/SparkSample
47a5f2899d1aa8f0b7fc265a1d705c09d47b3ef5
f3e3e4b65afc3f8db56427dc54ef35462279fa79
refs/heads/master
2020-05-31T16:04:07.867432
2014-11-03T13:10:10
2014-11-03T13:10:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,943
java
/** * */ package jp.bananafish.spark.sample; import java.io.Serializable; /** * 郵便番号CSVのレコード * * @author border * */ public class Address implements Serializable { /** * 全国地方公共団体コード(JIS X0401、X0402) */ private String jisCode; /** * (旧)郵便番号(5桁) */ private String oldPostalCode; /** * 郵便番号(7桁) */ private String postalCode; /** * 都道府県名カナ */ private String prefectureNameKana; /** * 市区町村名カナ */ private String cityNameKana; /** * 町域名カナ */ private String townAreaNameKana; /** * 都道府県名 */ private String prefectureName; /** * 市区町村名 */ private String cityName; /** * 町域名 */ private String townAreaName; /** * 一町域が二以上の郵便番号で表される場合の表示 */ private String flag1; /** * 小字毎に番地が起番されている町域の表示 */ private String flag2; /** * 丁目を有する町域の場合の表示 */ private String flag3; /** * 一つの郵便番号で二以上の町域を表す場合の表示 */ private String flag4; /** * 更新の表示 */ private String updateType; /** * 変更理由 */ private String reasonForChange; /** * @return the jisCode */ public String getJisCode() { return jisCode; } /** * @param jisCode * the jisCode to set */ public void setJisCode(String jisCode) { this.jisCode = jisCode; } /** * @return the oldPostalCode */ public String getOldPostalCode() { return oldPostalCode; } /** * @param oldPostalCode * the oldPostalCode to set */ public void setOldPostalCode(String oldPostalCode) { this.oldPostalCode = oldPostalCode; } /** * @return the postalCode */ public String getPostalCode() { return postalCode; } /** * @param postalCode * the postalCode to set */ public void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** * @return the prefectureNameKana */ public String getPrefectureNameKana() { return prefectureNameKana; } /** * @param prefectureNameKana * the prefectureNameKana to set */ public void setPrefectureNameKana(String prefectureNameKana) { this.prefectureNameKana = prefectureNameKana; } /** * @return the cityNameKana */ public String getCityNameKana() { return cityNameKana; } /** * @param cityNameKana * the cityNameKana to set */ public void setCityNameKana(String cityNameKana) { this.cityNameKana = cityNameKana; } /** * @return the townAreaNameKana */ public String getTownAreaNameKana() { return townAreaNameKana; } /** * @param townAreaNameKana * the townAreaNameKana to set */ public void setTownAreaNameKana(String townAreaNameKana) { this.townAreaNameKana = townAreaNameKana; } /** * @return the prefectureName */ public String getPrefectureName() { return prefectureName; } /** * @param prefectureName * the prefectureName to set */ public void setPrefectureName(String prefectureName) { this.prefectureName = prefectureName; } /** * @return the cityName */ public String getCityName() { return cityName; } /** * @param cityName * the cityName to set */ public void setCityName(String cityName) { this.cityName = cityName; } /** * @return the townAreaName */ public String getTownAreaName() { return townAreaName; } /** * @param townAreaName * the townAreaName to set */ public void setTownAreaName(String townAreaName) { this.townAreaName = townAreaName; } /** * @return the flag1 */ public String getFlag1() { return flag1; } /** * @param flag1 * the flag1 to set */ public void setFlag1(String flag1) { this.flag1 = flag1; } /** * @return the flag2 */ public String getFlag2() { return flag2; } /** * @param flag2 * the flag2 to set */ public void setFlag2(String flag2) { this.flag2 = flag2; } /** * @return the flag3 */ public String getFlag3() { return flag3; } /** * @param flag3 * the flag3 to set */ public void setFlag3(String flag3) { this.flag3 = flag3; } /** * @return the flag4 */ public String getFlag4() { return flag4; } /** * @param flag4 * the flag4 to set */ public void setFlag4(String flag4) { this.flag4 = flag4; } /** * @return the updateType */ public String getUpdateType() { return updateType; } /** * @param updateType * the updateType to set */ public void setUpdateType(String updateType) { this.updateType = updateType; } /** * @return the reasonForChange */ public String getReasonForChange() { return reasonForChange; } /** * @param reasonForChange * the reasonForChange to set */ public void setReasonForChange(String reasonForChange) { this.reasonForChange = reasonForChange; } }
[ "tmikami@gmail.com" ]
tmikami@gmail.com
d01d4cab57c46cb4c1f20fb8e394c4d0ab5e4984
06810721513d822ee66f72b0c3de355899510597
/src/main/java/com/cis/project/config/CacheConfiguration.java
14a2e99d6d4dc8e74869c751520f7f9cd221dc76
[]
no_license
bonnefoipatrick/CisProjectApplication
776c4070c55b961b3691c34600de08331ab3675e
174598b4cc371e4a4e93ff2aff8eb440038e7398
refs/heads/master
2020-03-09T13:56:43.980452
2018-04-09T19:54:43
2018-04-09T19:54:43
128,823,204
0
0
null
2018-04-10T19:57:14
2018-04-09T19:28:13
Java
UTF-8
Java
false
false
2,457
java
package com.cis.project.config; import io.github.jhipster.config.JHipsterProperties; import org.ehcache.config.builders.CacheConfigurationBuilder; import org.ehcache.config.builders.ResourcePoolsBuilder; import org.ehcache.expiry.Duration; import org.ehcache.expiry.Expirations; import org.ehcache.jsr107.Eh107Configuration; import java.util.concurrent.TimeUnit; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.client.serviceregistry.Registration; import org.springframework.context.annotation.*; @Configuration @EnableCaching @AutoConfigureAfter(value = { MetricsConfiguration.class }) @AutoConfigureBefore(value = { WebConfigurer.class, DatabaseConfiguration.class }) public class CacheConfiguration { private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration; public CacheConfiguration(JHipsterProperties jHipsterProperties) { JHipsterProperties.Cache.Ehcache ehcache = jHipsterProperties.getCache().getEhcache(); jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration( CacheConfigurationBuilder.newCacheConfigurationBuilder(Object.class, Object.class, ResourcePoolsBuilder.heap(ehcache.getMaxEntries())) .withExpiry(Expirations.timeToLiveExpiration(Duration.of(ehcache.getTimeToLiveSeconds(), TimeUnit.SECONDS))) .build()); } @Bean public JCacheManagerCustomizer cacheManagerCustomizer() { return cm -> { cm.createCache(com.cis.project.repository.UserRepository.USERS_BY_LOGIN_CACHE, jcacheConfiguration); cm.createCache(com.cis.project.repository.UserRepository.USERS_BY_EMAIL_CACHE, jcacheConfiguration); cm.createCache(com.cis.project.domain.User.class.getName(), jcacheConfiguration); cm.createCache(com.cis.project.domain.Authority.class.getName(), jcacheConfiguration); cm.createCache(com.cis.project.domain.User.class.getName() + ".authorities", jcacheConfiguration); // jhipster-needle-ehcache-add-entry }; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
304573aedc00f46d3c1a923ad2ac4f8f3e49d26e
ee83062efa5a231fcac01a074880138687966a06
/src/main/java/cn/wanglei/bi/utils/MissInfo2Redis.java
294e60e02351fc25121f8bb3fd24c1e67ee825fc
[]
no_license
blake-wang/MyXiaoPeng_BI
6f5a7549d2560c14fac4bca30ee862b80f149cd7
412b1bebc8761b7c4390cfc0c5b53c6f6671ff19
refs/heads/master
2021-01-01T15:37:31.407048
2018-02-10T10:37:11
2018-02-10T10:37:11
97,658,415
1
0
null
null
null
null
UTF-8
Java
false
false
3,370
java
package cn.wanglei.bi.utils; import cn.xiaopeng.bi.utils.JdbcUtil; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import testdemo.redis.JedisUtil; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import java.util.Map; /** * Created by bigdata on 17-8-18. * 由于redis中可能出现帐号或者通行证等信息的遗漏,避免出现问题,半个小时监测一次 */ public class MissInfo2Redis { public static int checkAccount(String accountList) throws SQLException { Connection conn = JdbcUtil.getXiaopeng2Conn(); int flag = 1; Statement stmt = null; try { stmt = conn.createStatement(); } catch (SQLException e) { e.printStackTrace(); flag = 0; } String sql = "select '00' requestid,'' as userid,a.account as game_account,a.gameid as game_id,a.addtime as reg_time,'' reg_resource,a.account_channel as channel_id,a.uid as owner_id,a.bind_member as bind_member_id,a.state status,if(a.os='','UNKNOW',os) from bgameaccount a left join promo_user b on a.uid=b.member_id where a.account in ('accountList')".replace("accountList", accountList); ResultSet rs = stmt.executeQuery(sql); try { JedisPool pool = JedisUtil.getJedisPool(); Jedis jedis = pool.getResource(); while(rs.next()){ Map<String,String> account = new HashMap<String,String>(); account.put("requestid",rs.getString("requestid")==null? "":rs.getString("requestid")); account.put("userid",rs.getString("userid")==null?"":rs.getString("userid")); account.put("game_account",rs.getString("game_account")==null?"":rs.getString("game_account").trim().toLowerCase()); account.put("game_id",rs.getString("game_id")==null?"0":rs.getString("game_id")); account.put("reg_time",rs.getString("reg_time")==null?"0000-00-00":rs.getString("reg_time")); account.put("reg_resource",rs.getString("reg_resource")==null?"2":rs.getString("reg_resource")); account.put("channel_id",rs.getString("channel_id")==null?"0":rs.getString("channel_id")); account.put("owner_id",rs.getString("owner_id")==null?"0":rs.getString("owner_id")); account.put("bind_member_id",rs.getString("bind_member_id")==null?"0":rs.getString("bind_member_id")); account.put("status",rs.getString("status")==null?"1":rs.getString("status")); account.put("reg_os_type",rs.getString("reg_os_type")==null?"UNKNOW":rs.getString("reg_os_type")); account.put("expand_code",rs.getString("expand_code")==null?"":rs.getString("expand_code")); account.put("expand_channel",rs.getString("expand_channel")); if(rs.getString("game_account")!=null){ jedis.hmset(rs.getString("game_account").trim().toLowerCase(),account); } } stmt.close(); conn.close(); pool.returnResource(jedis); pool.destroy(); } catch (SQLException e) { e.printStackTrace(); System.out.println(e); flag=0; } return flag; } }
[ "wangl@yyft.com" ]
wangl@yyft.com
2af779dfc27eb5d2174641d6146807e2161b921e
51db985d221ee30b35f103adb07e3107426c33dc
/app/src/main/java/example/com/android_note/model/Note.java
09e7853de46a7ea806eebca329c7661062b1fc00
[]
no_license
andrei1994rus/Android_Note
5f879359cc6c7e814b8ebca2495904cf619d3ec0
9608ae63b08abbcba996f8634fccb1774a956adc
refs/heads/master
2020-04-19T18:33:09.665242
2020-01-29T17:26:50
2020-01-29T17:26:50
168,366,271
0
0
null
null
null
null
UTF-8
Java
false
false
1,404
java
package example.com.android_note.model; import java.io.Serializable; /** * This class is used for work with information of every note. */ public class Note implements Serializable { /** * Date of creating/editing of note. */ private String date; /** * Identifier of note. */ private long id; /** * Path of image in note. */ private String imagePath; /** * Text of note. */ private String text; /** * Constructor of class Note. * * @param id * id of note. * * @param date * date of creating/updating note. * * @param text * text of note. * * @param imagePath * path of image in note. * */ public Note(long id, String date, String text, String imagePath) { this.id=id; this.date=date; this.text=text; this.imagePath=imagePath; } /** * Gets date. * * @return date of note's creating/updating. */ public String getDate() { return date; } /** * Gets identifier. * * @return id of note. * */ public long getID() { return id; } /** * Gets path of image. * * @return path of image in note. * */ public String getImagePath() { return imagePath; } /** * Gets text. * * @return text of note. * */ public String getText() { return text; } }
[ "parkur193@gmail.com" ]
parkur193@gmail.com
b53279da1c7a21c5ff4713b8b3cbaed4e9a26ed0
fe9d840eefd1034d86531678077513df021a6bad
/app/src/main/java/com/huoxy/androidheros/chapter3/CustomMeasureView.java
c953479516152a9acc92695c5340a104c40ed8e4
[ "Apache-2.0" ]
permissive
ContinueCoding/AndroidHeros
1d3496a4c3f8fb009adf9ee026a6dd6e6cde482f
0d71bf022e037340a3627b38494e139bca9fce54
refs/heads/master
2021-01-20T06:15:17.020652
2018-01-31T00:32:48
2018-01-31T00:32:48
101,497,348
0
0
null
null
null
null
UTF-8
Java
false
false
3,038
java
package com.huoxy.androidheros.chapter3; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.util.Log; import android.view.View; /** * Created by huoxy on 2017/8/16. * 自定义View - 测量测试 */ public class CustomMeasureView extends View { private static final String TAG = "CustomMeasureView"; public CustomMeasureView(Context context) { super(context); } public CustomMeasureView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); } public CustomMeasureView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec)); } private int measureWidth(int widthMeasureSpec){ int result = 0; //分别获取测量模式和大小 int specMode = MeasureSpec.getMode(widthMeasureSpec); int specSize = MeasureSpec.getSize(widthMeasureSpec); Log.i(TAG, "********** measureWidth() --- specMode = " + specMode + ", specSize = " + specSize); if(specMode == MeasureSpec.EXACTLY){ result = specSize; Log.i(TAG, "********** measureWidth() --- MeasureSpec.EXACTLY"); } else { //指定一个默认大小 —— 待优化 result = 300; if(specMode == MeasureSpec.AT_MOST){ result = Math.min(result, specSize); Log.i(TAG, "********** measureWidth() --- MeasureSpec.AT_MOST"); } if(specMode == MeasureSpec.UNSPECIFIED){ Log.i(TAG, "********** measureWidth() --- MeasureSpec.UNSPECIFIED"); } } return result; } private int measureHeight(int heightMeasureSpec){ int result = 0; //分别获取测量模式和大小 int specMode = MeasureSpec.getMode(heightMeasureSpec); int specSize = MeasureSpec.getSize(heightMeasureSpec); Log.i(TAG, "measureHeight() --- specMode = " + specMode + ", specSize = " + specSize); if(specMode == MeasureSpec.EXACTLY){ result = specSize; Log.i(TAG, "measureHeight() --- MeasureSpec.EXACTLY"); } else { //指定一个默认大小 —— 待优化 result = 300; if(specMode == MeasureSpec.AT_MOST){ result = Math.min(result, specSize); Log.i(TAG, "measureHeight() --- MeasureSpec.AT_MOST"); } if(specMode == MeasureSpec.UNSPECIFIED){ Log.i(TAG, "measureHeight() --- MeasureSpec.UNSPECIFIED"); } } return result; } @Override protected void onDraw(Canvas canvas) { canvas.drawColor(Color.RED); } }
[ "huoxiaoyi@didapinche.com" ]
huoxiaoyi@didapinche.com
9eadbbf238528a51c55eebc82f60658220b8745b
96f23ab49d69dff1431d81ae1428d4ef205774c1
/src/main/java/com/capgemini/movieManagement/dao/MovieDao.java
ba814ebc1f41b43a06df2f137c5f20bb42d9f89c
[]
no_license
andy077/movieManagement
6abe3a3245f8937ca0e1cc9e1008c9b51c25cda1
a766e7435611340c8798bda265ccf13ee7b4a8ed
refs/heads/master
2021-01-07T01:48:54.787059
2020-03-23T11:33:57
2020-03-23T11:33:57
241,543,336
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
package com.capgemini.movieManagement.dao; import com.capgemini.movieManagement.dto.Movie; import com.capgemini.movieManagement.util.MovieRepository; public class MovieDao implements MovieDaoInterface { public Movie searchMovieById(int id) { for(int i=0;i<MovieRepository.getMoviesList().size();i++) { if(MovieRepository.getMoviesList().get(i).getMovieId()==id)return MovieRepository.getMoviesList().get(i); } return null; } }
[ "anandrajanand720@gmail.com" ]
anandrajanand720@gmail.com
769221ba660c3e35fb1dbe543fecb3fa0fd44de9
dca1f809072be590af0d518a488a173d4dd259c9
/AndroidApp/Android911Client/app/src/main/java/com/example/cuixuelai/android911client/TaggingFragment.java
d60173a92aef6d3075fb004dd72afcc38e670491
[]
no_license
yiwen-luo/911-Call-Indoor-Positioning
a6a18f138dc22b0ea15597314f3dc9c513103187
5bfd1b7ce56ab5e9d970db468499953486af417e
refs/heads/master
2023-01-11T20:57:03.178096
2019-12-03T06:28:54
2019-12-03T06:28:54
70,303,164
0
0
null
2022-12-26T20:23:15
2016-10-08T04:13:25
Python
UTF-8
Java
false
false
3,454
java
package com.example.cuixuelai.android911client; import android.app.Activity; import android.app.Fragment; import android.hardware.SensorEvent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.Switch; import org.json.JSONException; public class TaggingFragment extends Fragment { TaggingCommunication myTaggingCommunication; Button tagButton; EditText street1; EditText zip; EditText state; EditText city; EditText building; EditText floor; EditText room; Switch mySwitch; boolean tagging_permission; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //get edit text by id... View view = inflater.inflate(R.layout.tagging_fragment, container, false); this.street1 = (EditText) view.findViewById(R.id.editText_street1); this.zip = (EditText) view.findViewById(R.id.editText_Zip); this.city = (EditText) view.findViewById(R.id.editText_City); this.state = (EditText) view.findViewById(R.id.editText_State); this.floor = (EditText) view.findViewById(R.id.editText_Floor); this.room = (EditText) view.findViewById(R.id.editText_Room); this.building = (EditText) view.findViewById(R.id.editText_Building); this.tagging_permission = false; this.mySwitch = (Switch) view.findViewById(R.id.switch1); mySwitch.setChecked(false); mySwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { tagging_permission = true; } else { tagging_permission = false; } } }); this.tagButton = (Button) view.findViewById(R.id.tagging_button); this.tagButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //pass data through passTaggedData to main activity if (tagging_permission) { try { myTaggingCommunication.passTaggedData( street1.getText().toString(), zip.getText().toString(), city.getText().toString(), state.getText().toString(), floor.getText().toString(), room.getText().toString(), building.getText().toString()); } catch (JSONException e) { e.printStackTrace(); } } } }); return view; } interface TaggingCommunication { void onSensorChanged(SensorEvent event); public void passTaggedData(String street1, String zip, String city, String state, String floor, String room, String building) throws JSONException; } @Override public void onAttach(Activity a) { super.onAttach(a); myTaggingCommunication = (TaggingCommunication) a; } }
[ "lyw920203@gmail.com" ]
lyw920203@gmail.com
784716ccd7a95a0788ab43e82f72df63bee4e9d7
54f352a242a8ad6ff5516703e91da61e08d9a9e6
/Source Codes/CodeJamData/14/52/7.java
6d740833a1fb6426268c1c2d013843319594dc85
[]
no_license
Kawser-nerd/CLCDSA
5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb
aee32551795763b54acb26856ab239370cac4e75
refs/heads/master
2022-02-09T11:08:56.588303
2022-01-26T18:53:40
2022-01-26T18:53:40
211,783,197
23
9
null
null
null
null
UTF-8
Java
false
false
2,037
java
package round3; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; public class B { public static void main(String[] args) throws FileNotFoundException { Kattio io; // io = new Kattio(System.in, System.out); // io = new Kattio(new FileInputStream("round3/B-sample.in"), System.out); // io = new Kattio(new FileInputStream("round3/B-small-0.in"), new FileOutputStream("round3/B-small-0.out")); io = new Kattio(new FileInputStream("round3/B-large-0.in"), new FileOutputStream("round3/B-large-0.out")); int cases = io.getInt(); for (int i = 1; i <= cases; i++) { io.print("Case #" + i + ": "); System.err.println(i); new B().solve(io); } io.close(); } int myPower, towerPower; int health[], gold[]; private void solve(Kattio io) { myPower = io.getInt(); towerPower = io.getInt(); int n = io.getInt(); health = new int[n]; gold = new int[n]; for (int i = 0; i < n; i++) { health[i] = io.getInt(); gold[i] = io.getInt(); } memo = new int[n][201*n+10]; io.println(go(0, 1)); } int memo[][]; private int go(int monster, int savedTurns) { if (monster == health.length) return 0; int orgSavedTurns = savedTurns; if (memo[monster][savedTurns] > 0) return memo[monster][savedTurns] - 1; // skip it int towerShots = (health[monster] + towerPower - 1) / towerPower; int best = go(monster + 1, savedTurns + towerShots); int h = health[monster] % towerPower; if (h == 0) h = towerPower; int shotsReq = (h + myPower - 1) / myPower; savedTurns += towerShots - 1; if (shotsReq <= savedTurns) { best = Math.max(best, gold[monster] + go(monster + 1, savedTurns - shotsReq)); } memo[monster][orgSavedTurns] = best + 1; return best; } }
[ "kwnafi@yahoo.com" ]
kwnafi@yahoo.com
85074a20bb8809ca03fc3d0f1e1f13c662296100
b4f4e0fda77d0d58cac2fad2d753e2a1925224de
/src/main/java/com/hekaihang/service/AccountServiceImpl.java
39a97e706d6b8d117d09e349daad46b6437e22e8
[]
no_license
1yujian1/ssmbuild
aa4180c428cfce00dbc647f5e3a91dceb946f409
38ffcac3190b0d77e1e06e4e43e9592e8034f72e
refs/heads/master
2023-01-05T15:53:48.897936
2020-10-20T01:48:38
2020-10-20T01:48:38
305,560,358
0
0
null
null
null
null
UTF-8
Java
false
false
2,104
java
package com.hekaihang.service; import com.hekaihang.dao.AccountMapper; import com.hekaihang.pojo.Accounts; import javax.servlet.http.HttpSession; import java.util.HashMap; import java.util.List; import java.util.Map; public class AccountServiceImpl implements AccountService { private AccountMapper accountMapper; public void setAccountMapper(AccountMapper accountMapper) { this.accountMapper = accountMapper; } @Override public int addAccount(Accounts accounts) { return accountMapper.addAccount(accounts); } @Override public int deleteAccountById(int id) { return accountMapper.deleteAccountById(id); } @Override public int updateAccount(Accounts accounts) { return accountMapper.updateAccount(accounts); } @Override public int updateAccountPass(Accounts accounts) { return accountMapper.updateAccountPass(accounts); } @Override public int updateAccountDepart(Accounts accounts) { return accountMapper.updateAccountDepart(accounts); } @Override public Accounts queryAccountById(int id) { return accountMapper.queryAccountById(id); } @Override public List<Accounts> queryAllAccount() { return accountMapper.queryAllAccount(); } @Override public List<Accounts> queryAllAccount0() { return accountMapper.queryAllAccount0(); } @Override public List<Accounts> queryAccountByName(String name) { return accountMapper.queryAccountByName(name); } @Override public List<Accounts> queryAccountByDepart(String department) { return accountMapper.queryAccountByDepart(department); } @Override public boolean login(int id,String password, HttpSession session) { List<Accounts> accounts=accountMapper.queryAccountByIdPass(id,password); //如果用户存在,放入session域 if(accounts.size()>0) { session.setAttribute("account", accounts.get(0)); return true; }else { return false; } } }
[ "1637601056@qq.com" ]
1637601056@qq.com
688aab9fdd3b8d9489174c7538e2f9e22429bfb6
1a3b0a73d52d029e709bfb1486fa1eb35c867a28
/src/java/Main/DeleteCommentServlet.java
ec92bd2fcf37a0c3a06d7175c5679fccfebc2c1e
[]
no_license
almontasser/LearnRemotely
d68834fad68d9070a1f84c7a3aea04bc482cb901
96913545d59e903c5036448eef32dd5d5cef38d9
refs/heads/main
2023-02-18T09:57:22.604537
2021-01-20T04:49:33
2021-01-20T04:49:33
323,308,077
0
0
null
null
null
null
UTF-8
Java
false
false
1,495
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 Main; import Main.Helpers.Auth; import Main.Helpers.DataAccess; import Main.Models.Comment; import Main.Models.Post; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Mahmoud */ @WebServlet(name = "DeleteComment", urlPatterns = {"/delete-comment"}) public class DeleteCommentServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Integer id = Integer.parseInt(req.getParameter("id")); Comment comment = DataAccess.getCommentById(id); Integer postId = comment.getPostId(); Post post = DataAccess.getPostById(postId); if (!Auth.isAdmin(req, resp) && !Auth.isTeacher(req, resp) && !req.getSession().getAttribute("auth.id").equals(comment.getUserId())) { resp.sendRedirect("/"); return; } Main.Helpers.DataAccess.executeUpdate("DELETE FROM comments WHERE id='"+id+"';"); resp.sendRedirect("/subject?id=" + post.getSubjectId()); } }
[ "almontasser@outlook.com" ]
almontasser@outlook.com
9bb315b17c7d93e8f80aaf4892d801386d800629
0689f3b456ddce965659abcd4d2de68903de59a1
/src/main/java/com/example/jooq/demo_jooq/introduction/db/pg_catalog/routines/GinExtractJsonb.java
8894d219518d2e3e6406aae81bfc2e230803e650
[]
no_license
vic0692/demo_spring_jooq
c92d2d188bbbb4aa851adab5cc301d1051c2f209
a5c1fd1cb915f313f40e6f4404fdc894fffc8e70
refs/heads/master
2022-09-18T09:38:30.362573
2020-01-23T17:09:40
2020-01-23T17:09:40
220,638,715
0
0
null
2022-09-08T01:04:47
2019-11-09T12:25:46
Java
UTF-8
Java
false
true
4,037
java
/* * This file is generated by jOOQ. */ package com.example.jooq.demo_jooq.introduction.db.pg_catalog.routines; import com.example.jooq.demo_jooq.introduction.db.pg_catalog.PgCatalog; import javax.annotation.Generated; import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Parameter; import org.jooq.impl.AbstractRoutine; import org.jooq.impl.Internal; /** * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration. */ @java.lang.Deprecated @Generated( value = { "http://www.jooq.org", "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class GinExtractJsonb extends AbstractRoutine<Object> { private static final long serialVersionUID = -1040339210; /** * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration. */ @java.lang.Deprecated public static final Parameter<Object> RETURN_VALUE = Internal.createParameter("RETURN_VALUE", org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"internal\""), false, false); /** * The parameter <code>pg_catalog.gin_extract_jsonb._1</code>. */ public static final Parameter<JSONB> _1 = Internal.createParameter("_1", org.jooq.impl.SQLDataType.JSONB, false, true); /** * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration. */ @java.lang.Deprecated public static final Parameter<Object> _2 = Internal.createParameter("_2", org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"internal\""), false, true); /** * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration. */ @java.lang.Deprecated public static final Parameter<Object> _3 = Internal.createParameter("_3", org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"internal\""), false, true); /** * Create a new routine call instance */ public GinExtractJsonb() { super("gin_extract_jsonb", PgCatalog.PG_CATALOG, org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"internal\"")); setReturnParameter(RETURN_VALUE); addInParameter(_1); addInParameter(_2); addInParameter(_3); } /** * Set the <code>_1</code> parameter IN value to the routine */ public void set__1(JSONB value) { setValue(_1, value); } /** * Set the <code>_1</code> parameter to the function to be used with a {@link org.jooq.Select} statement */ public void set__1(Field<JSONB> field) { setField(_1, field); } /** * Set the <code>_2</code> parameter IN value to the routine */ public void set__2(Object value) { setValue(_2, value); } /** * Set the <code>_2</code> parameter to the function to be used with a {@link org.jooq.Select} statement */ public void set__2(Field<Object> field) { setField(_2, field); } /** * Set the <code>_3</code> parameter IN value to the routine */ public void set__3(Object value) { setValue(_3, value); } /** * Set the <code>_3</code> parameter to the function to be used with a {@link org.jooq.Select} statement */ public void set__3(Field<Object> field) { setField(_3, field); } }
[ "vic0692@gmail.com" ]
vic0692@gmail.com
9d09bb9e3a5c75dec2ecf3ad0d3f4410aaa05447
a1646e8ba2488f0fff0137eecc0306c1d880f5f4
/app/src/main/java/com/example/tvapp/activities/MainActivity.java
fce367f7960da54d4aab87765b95262424769d10
[]
no_license
Winhour/TVApp
ebf1da149ebc0135aadfd159c63a291d4b92e553
cec1c201a9e4b3f176a87ab7d3d8cd844a94456f
refs/heads/master
2023-04-04T04:17:34.977797
2021-04-08T09:49:53
2021-04-08T09:49:53
355,847,817
0
0
null
null
null
null
UTF-8
Java
false
false
4,462
java
package com.example.tvapp.activities; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.view.View; import com.example.tvapp.R; import com.example.tvapp.adapters.TVShowsAdapter; import com.example.tvapp.databinding.ActivityMainBinding; import com.example.tvapp.listeners.TVShowsListener; import com.example.tvapp.models.TVShow; import com.example.tvapp.viewmodels.MostPopularTVShowsViewModel; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity implements TVShowsListener { private ActivityMainBinding activityMainBinding; private MostPopularTVShowsViewModel viewModel; private List<TVShow> tvShows = new ArrayList<>(); private TVShowsAdapter tvShowsAdapter; private int currentPage = 1; private int totalAvailablePages = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); activityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main); doInitialization(); } private void doInitialization() { activityMainBinding.tvShowsRecyclerView.setHasFixedSize(true); viewModel = new ViewModelProvider(this).get(MostPopularTVShowsViewModel.class); tvShowsAdapter = new TVShowsAdapter(tvShows, this); activityMainBinding.tvShowsRecyclerView.setAdapter(tvShowsAdapter); activityMainBinding.tvShowsRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (!activityMainBinding.tvShowsRecyclerView.canScrollVertically(1)){ if (currentPage <= totalAvailablePages) { currentPage++; getMostPopularTVShows(); } } } }); activityMainBinding.imageWatchlist.setOnClickListener(view -> startActivity(new Intent(getApplicationContext(), WatchlistActivity.class))); activityMainBinding.imageSearch.setOnClickListener(view -> startActivity(new Intent(getApplicationContext(), SearchActivity.class))); getMostPopularTVShows(); } private void getMostPopularTVShows() { toggleLoading(); viewModel.getMostPopularTVShows(currentPage).observe(this, mostPopularTVShowsResponse ->{ toggleLoading(); if (mostPopularTVShowsResponse != null) { totalAvailablePages = mostPopularTVShowsResponse.getTotalPages(); if(mostPopularTVShowsResponse.getTvShows() != null) { int oldCount = tvShows.size(); tvShows.addAll(mostPopularTVShowsResponse.getTvShows()); tvShowsAdapter.notifyItemRangeInserted(oldCount, tvShows.size()); } } }); } private void toggleLoading() { if (currentPage == 1) { if (activityMainBinding.getIsLoading() != null && activityMainBinding.getIsLoading()) { activityMainBinding.setIsLoading(false); } else { activityMainBinding.setIsLoading(true); } } else { if (activityMainBinding.getIsLoadingMore() != null && activityMainBinding.getIsLoadingMore()) { activityMainBinding.setIsLoadingMore(false); } else { activityMainBinding.setIsLoadingMore(true); } } } @Override public void onTVShowClicked(TVShow tvShow) { Intent intent = new Intent (getApplicationContext(), TVShowDetailsActivity.class); /*intent.putExtra("id", tvShow.getId()); intent.putExtra("name", tvShow.getName()); intent.putExtra("startDate", tvShow.getStartDate()); intent.putExtra("country", tvShow.getCountry()); intent.putExtra("network", tvShow.getNetwork()); intent.putExtra("status", tvShow.getStatus());*/ intent.putExtra("tvShow", tvShow); startActivity(intent); } }
[ "81164377+Winhour@users.noreply.github.com" ]
81164377+Winhour@users.noreply.github.com
255d15959da3a65b9235e8cf06906f6d14f8012d
0a053c3321ca12ef5d8f8f018f481f0537d8bc1a
/java-jdi/src/main/java/com/baeldung/jdi/ProgramTrace.java
e4f9e87864dfc793c20610ba0befd5021e11d1c0
[]
no_license
jeremyVienne/CAL_DEBUG
b791883a0e4c5a2228a9955860654a5ce7376a85
9f2efde4dca170f2949d1ab5e44b11a09239fba6
refs/heads/master
2020-11-24T09:38:21.439303
2019-12-14T20:37:23
2019-12-14T20:37:23
228,085,254
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
import java.util.ArrayList; public class ProgramTrace{ private static final ProgramTrace pgm = new ProgramTrace(); private ArrayList<Trace> traces; private int index; private ProgramTrace(){ this.traces = new ArrayList<Trace>(); this.index = 0; } public static ProgramTrace getPgm(){ return pgm; } public void addTrace(Trace t ){ this.index ++; this.traces.add(t); } public Trace next(){ if(this.index < this.traces.size()-1){this.index ++ ;} return this.traces.get(this.index); } public Trace previous(){ if(this.index > 0){ this.index --; } return this.traces.get(this.index); } }
[ "https://gitlab-etu.fil.univ-lille1.fr" ]
https://gitlab-etu.fil.univ-lille1.fr
2458f3a4ad44835fbf8b0350148633349beefa16
4dcca2f0b3e2649ce000b1af139bb5833d307f87
/RobotSpring/src/main/java/com/voytovych/basic/impls/sony/SonyLeg.java
f0fbd9e14dcdedb35ef6c25fd140896d14ad04bb
[]
no_license
Voytovych/spring-basic-repository-014
e006b32f8a1d584859a5904f55090801daa44b76
fd010cbc5b53cbdf24e64ddafeda12ac912f659e
refs/heads/master
2021-01-20T20:45:20.196636
2016-07-21T10:44:51
2016-07-21T10:44:51
63,598,625
0
0
null
null
null
null
UTF-8
Java
false
false
198
java
package com.voytovych.basic.impls.sony; import com.voytovych.basic.interfaces.Leg; public class SonyLeg implements Leg { public void go(){ System.out.println("Go to Sony!"); } }
[ "voytovych.ua@gmail.com" ]
voytovych.ua@gmail.com
66a21cf490f8c011efd63bd375bae8363f7d6f63
7dafd999eeef3092e7462ecb975a91b13e7ed6b7
/src/main/java/org/audit4j/core/RunStatus.java
51a6d53f5447edbb3b0e282d307339d5e0ca4c10
[ "Apache-2.0" ]
permissive
hascode/audit4j-core
937329a8a494e10e44ac6512ae362db21e5b8dda
60f075c1828164c7d1041561ab12978bb5d4b687
refs/heads/master
2021-01-16T20:04:47.137389
2015-02-16T18:59:44
2015-02-16T18:59:44
30,883,039
0
0
null
2015-02-16T18:57:13
2015-02-16T18:57:12
null
UTF-8
Java
false
false
963
java
/* * Copyright 2014 Janith Bandara, This source is a part of * Audit4j - An open source auditing framework. * http://audit4j.org * * 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.audit4j.core; /** * The Enum RunStatus. * * @author <a href="mailto:janith3000@gmail.com">Janith Bandara</a> */ public enum RunStatus { /** The start. */ READY, RUNNING, /** The stop. */ STOPPED, /** The terminated. */ DISABLED, TERMINATED; }
[ "janith3000@gmail.com" ]
janith3000@gmail.com
097a6821d33387b61a7c7912629801328285cfef
079ca0da2c1ab66569894f2a73d7375fca579c2b
/utils-apl-derived-table/src/main/java/org/omnaest/utils/table/StripeTransformer.java
62ad8793788805149e90d4dd2bb3eb61cb7e1d96
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
zizopen/utils-apl-derived
63666ccb6eb19502f73e19a1086283f7452d4626
f97f31bd4f0b86c930f15ee53e6dc742a158bdba
refs/heads/master
2021-01-23T19:45:42.197296
2015-02-01T16:10:05
2015-02-01T16:10:05
34,396,787
0
0
null
null
null
null
UTF-8
Java
false
false
2,634
java
/******************************************************************************* * Copyright 2012 Danny Kunz * * 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.omnaest.utils.table; import java.io.Serializable; import java.util.List; import java.util.Map; import java.util.Set; /** * Transforms the elements of a {@link Stripe} into a new independent other container instance * * @see StripeTransformerPlugin * @see ImmutableStripe#to() * @author Omnaest * @param <E> */ public interface StripeTransformer<E> extends Serializable { /** * Returns a new {@link Set} instance containing all elements * * @return */ public Set<E> set(); /** * Returns an new array containing all elements * * @return */ public E[] array(); /** * Returns an array of the given {@link Class} type * * @param type * @return */ public <T> T[] array( Class<T> type ); /** * Returns a new {@link List} instance containing all elements * * @return */ public List<E> list(); /** * Returns a new {@link StripeEntity} instance * * @return */ public StripeEntity<E> entity(); /** * Returns the {@link Stripe} transformed into the given type. <br> * <br> * To allow this to work there has to be a {@link StripeTransformerPlugin} registered to the underlying {@link Table}. * * @param type * {@link Class} * @return */ public <T> T instanceOf( Class<T> type ); /** * Similar to {@link #instanceOf(Class)} using a given instance which is returned enriched with the data of the {@link Stripe} * * @param instance * @return given instance */ public <T> T instance( T instance ); /** * Returns the {@link Stripe} as a {@link Map}. The keys are the orthogonal titles and the values are the actual elements of the * {@link Stripe} * * @return */ public Map<String, E> map(); }
[ "awonderland6@googlemail.com@4c589bc5-3898-6224-771f-302820b144f8" ]
awonderland6@googlemail.com@4c589bc5-3898-6224-771f-302820b144f8
2c947c6adecafeb117303493ba97399b4519ae95
53874726c184947a6f08beb9c0d990bfe3da8038
/Anastasiya_Bezmen/OOP-task/src/by/task/soundrecording/Main.java
72e0ff9784a50610a83f820f43d691d1da44d80e
[]
no_license
IharSuvorau1/training2020
839efd20cd08fc8d469102435f1088890db4e8f4
9e4d559b0cf875d86ebacd8b9067cb3bd44d46f5
refs/heads/master
2023-03-11T23:21:12.943371
2021-03-02T09:31:14
2021-03-02T09:31:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,151
java
package by.task.soundrecording; import by.task.soundrecording.domain.Disk; import by.task.soundrecording.domain.MusicComposition; import by.task.soundrecording.exception.SystemInputException; import by.task.soundrecording.service.DiskService; import by.task.soundrecording.service.IDiskService; import by.task.soundrecording.service.IMusicService; import by.task.soundrecording.service.MusicService; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { private static IMusicService musicService = MusicService.getInstance(); private static IDiskService diskService = DiskService.getInstance(); private static boolean isRunning = true; public static void main(String[] args) { while (isRunning) { printActionList(); handleSelection(enterIntValue()); } } private static void printActionList() { System.out.println("=============================="); System.out.println("Выберите необходимое действие:"); System.out.println(); System.out.println("1. Вывести всю музыку"); System.out.println("2. Вывести всe имеющиеся диски"); System.out.println("3. Создать чистый диск"); System.out.println("4. Записать сборку на диск"); System.out.println("5. Вывести весь список композиций на диске"); System.out.println("6. Сортировать композиции на диске по жанрам"); System.out.println("7. Рассчитать общую продолжительность треков на диске"); System.out.println("8. Фильтровать композиции на диске по заданному диапазону длины треков"); System.out.println("9. Выход"); } private static int enterIntValue() { Scanner scan = new Scanner(System.in); if (scan.hasNextInt()) { return scan.nextInt(); } return 0; } private static String enterStringValue() { Scanner scan = new Scanner(System.in); return scan.nextLine(); } private static void handleSelection(int choice) { if (choice == 1) { printAllMusic(); } else if (choice == 2) { printAllDisks(); } else if (choice == 3) { createDisc(); } else if (choice == 4) { writeDiskWithMusic(); } else if (choice == 5) { printMusicOnDisk(); } else if (choice == 6) { printMusicSortedByGenre(); } else if (choice == 7) { getMusicLength(); } else if (choice == 8) { filterByLength(); } else if (choice == 9) { isRunning = false; } else { System.out.println("Выберите один из предложенных вариантов!!!"); } } private static String enterDiscName() throws SystemInputException { System.out.println("Введите название необходимого диска"); String diskName = selectDisk(); if (diskName == null) { throw new SystemInputException("Вы ввели не правильное имя диска"); } return diskName; } private static void filterByLength() { try { String discName = enterDiscName(); System.out.println("Введите минимальное значение продолжительности композиций"); int minLength = enterIntValue(); System.out.println("Введите максимальное значение продолжительности композиций"); int maxLength = enterIntValue(); List<MusicComposition> musicRange = diskService.getMusicRange(discName, minLength, maxLength); for (MusicComposition musicComposition : musicRange) { System.out.println(musicComposition); } } catch (SystemInputException ex) { System.out.println(ex.getMessage()); } } private static void getMusicLength() { try { System.out.println(diskService.getMusicLength(enterDiscName())); } catch (SystemInputException ex) { System.out.println(ex.getMessage()); } } private static void printMusic(List<MusicComposition> musicCompositions) { if (musicCompositions == null || musicCompositions.isEmpty()) { System.out.println("Диск пуст"); } else { for (MusicComposition musicComposition : musicCompositions) { System.out.println(musicComposition); } } } private static void printMusicSortedByGenre() { try { String discName = enterDiscName(); List<MusicComposition> sortedMusic = diskService.getSortedMusic(discName); printMusic(sortedMusic); } catch (SystemInputException ex) { System.out.println(ex.getMessage()); } } private static void printMusicOnDisk() { try { String discName = enterDiscName(); List<MusicComposition> musicOnDisk = diskService.getMusicOnDisk(discName); printMusic(musicOnDisk); } catch (SystemInputException ex) { System.out.println(ex.getMessage()); } } private static void printAllDisks() { List<Disk> disks = diskService.getAll(); disks.forEach(System.out::println); } private static void printAllMusic() { List<MusicComposition> allMusic = musicService.getAll(); allMusic.forEach(System.out::println); } private static void createDisc() { System.out.println("Введите название диска"); String diskName = enterStringValue(); while (diskName.trim().equals("")) { System.out.println("Введите название диска (не может быть пустым)."); diskName = enterStringValue(); } diskService.createNewDisk(diskName); } private static void writeDiskWithMusic() { try { String discName = enterDiscName(); List<Long> musicIds = selectMusic(); if (musicIds.isEmpty()) { System.out.println("Выберите композиции для записи"); } else { writeMusic(discName, musicIds); } } catch (SystemInputException ex) { System.out.println(ex.getMessage()); } } private static List<Long> selectMusic() throws SystemInputException { System.out.println("Введите через пробел Id музыкальных композиций"); String musicIds = enterStringValue(); String[] musicIdsArray = musicIds.split(""); List<Long> result = new ArrayList<>(); try { for (int i = 0; i < musicIdsArray.length; i++) { result.add(Long.valueOf(musicIdsArray[i])); } } catch (NumberFormatException e) { throw new SystemInputException("id композиций введены не корректно"); } return result; } private static void writeMusic(String diskName, List<Long> musicIds) { diskService.writeMusic(diskName, musicIds); } private static String selectDisk() { String diskName = enterStringValue().trim(); if (diskName.equals("")) { return null; } if (diskService.isDiskExists(diskName)) { return diskName; } else { return null; } } }
[ "aliaksandr_radkevich@epam.com" ]
aliaksandr_radkevich@epam.com
8e52cbaec30ed0164f955f4d2ac7ed363462b655
ac93221d4f938ef525c75a0936ef99ab1ff545f2
/lib/src/main/java/plainbus/Listener.java
8721b29fd037a291226e1203204ada4897343792
[]
no_license
KidNox/plainbus
c16bc74bcaff30aecbe70dd5ff95144b6713c80a
b3ca854e60bfce1494eb443ea0f25373f0718433
refs/heads/master
2021-04-28T18:40:30.442325
2018-03-09T10:25:23
2018-03-09T10:25:23
121,878,662
0
0
null
null
null
null
UTF-8
Java
false
false
298
java
package plainbus; public interface Listener<Event> { void onEvent(Event event); static void reject() { throw new Rejection(); } class Rejection extends RuntimeException { @Override public Throwable fillInStackTrace() { return null; } } }
[ "truthno3@gmail.com" ]
truthno3@gmail.com
7cabb8f1c4926b8ecd06c3c82da9c62c20170a57
1213f1dcf5500859a248de45c1ff986c48c56c43
/flightSearch/src/com/iss/controller/ForgetPwd.java
3185e15c2dbdcf3451544e39e28b214c55bf4c06
[]
no_license
Crisgene/JavaDemo
a6f7ac9c3f565b31f95d0c7181d5c35802b6f28b
028e60261fabb211512f92bd9100f13def8165b5
refs/heads/master
2020-12-07T21:43:26.891298
2020-01-09T13:06:26
2020-01-09T13:06:26
232,808,325
3
0
null
null
null
null
GB18030
Java
false
false
3,290
java
package com.iss.controller; import java.io.IOException; import java.io.PrintWriter; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.google.gson.Gson; import com.iss.po.t_person; import com.iss.util.DBUtil; import com.iss.util.MailUtil; /** * Servlet implementation class ForgetPwd */ @WebServlet("/ForgetPwd") public class ForgetPwd extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public ForgetPwd() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.setCharacterEncoding("UTF-8"); response.setContentType("text/json"); response.setHeader("Access-Control-Allow-Origin", "*"); PrintWriter out=response.getWriter(); Gson gson=new Gson(); List list=new ArrayList<>(); String username=""; String id=""; String password=""; String ccode=""; String receiveMailAccount=""; //System.out.println(request.getParameter("t_user_pwd")); try { if (request.getParameter("email")!=null) { receiveMailAccount=request.getParameter("email"); Random random = new Random(); String result=""; for (int i=0;i<6;i++) { result+=random.nextInt(10); } String string="亲爱的用户,您好!您现在正在通过邮箱找回密码,您的验证码是"+result+",如果不是本人请无视~"; ccode=result; MailUtil.sendMail(receiveMailAccount,string); } if(request.getParameter("ForgetPwd")!=null&&request.getParameter("ForgetPwdUsername")!=null){ username=request.getParameter("ForgetPwdUsername"); Statement statement=DBUtil.getConnection().createStatement(); String sql2="SELECT * FROM `t_sys_user` where t_user_name='"+username+"' " ; System.out.println(sql2); ResultSet resultSet2=statement.executeQuery(sql2); if(resultSet2.next()) id=resultSet2.getString(1); System.out.println(id); System.out.println(request.getParameter("ForgetPwd")); password=request.getParameter("ForgetPwd"); //Statement statement1=DBUtil.getConnection().createStatement(); String sql="UPDATE `t_sys_user` SET t_user_pwd='"+password+"' WHERE t_user_id='"+id+"' "; System.out.println(sql); statement.execute(sql); } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } out.print(gson.toJson(ccode)); out.flush(); out.close(); } }
[ "htyu_cauc@outlook.com" ]
htyu_cauc@outlook.com
c6189b5d71de87668657f83a1b4aae38ad7ab6bc
116447e0159b96bbdbd08c387e2ee774a0e31316
/src/main/java/com/web/liuda/business/service/impl/.svn/text-base/PrizeOptionServiceImpl.java.svn-base
27211bfafb19a0a33383466a164e7b9f30b3d247
[]
no_license
SongJian0926/liuda
675037dd38b5d7755b4a22ce43ac391e65a24076
438a81833c092fca27b3e91a13f0d707000d7457
refs/heads/master
2021-01-20T15:23:29.125554
2017-05-09T15:26:17
2017-05-09T15:26:17
90,762,347
0
0
null
null
null
null
UTF-8
Java
false
false
12,006
package com.web.liuda.business.service.impl; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Direction; import org.springframework.data.domain.Sort.Order; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; import com.web.webstart.base.service.impl.BaseService; import com.web.webstart.base.exception.BusinessException; import com.web.webstart.base.constant.XaConstant; import com.web.webstart.base.util.DynamicSpecifications; import com.web.webstart.base.util.SearchFilter; import com.web.webstart.base.util.SearchFilter.Operator; import com.web.webstart.base.util.XaResult; import com.web.webstart.base.util.XaUtil; import com.web.liuda.business.entity.GuessLog; import com.web.liuda.business.entity.PrizeOption; import com.web.liuda.business.entity.PrizeResult; import com.web.liuda.business.repository.GuessLogRepository; import com.web.liuda.business.repository.PrizeOptionRepository; import com.web.liuda.business.repository.PrizeResultRepository; import com.web.liuda.business.service.PrizeOptionService; import com.web.liuda.remote.vo.PrizeOptionVo; import com.web.liuda.remote.vo.PrizeResultVo; import com.web.liuda.remote.vo.UserVo; @Service("PrizeOptionService") @Transactional(readOnly = false) public class PrizeOptionServiceImpl extends BaseService<PrizeOption> implements PrizeOptionService { @Autowired private PrizeOptionRepository prizeOptionRepository; @Autowired private PrizeResultRepository prizeResultRepository; @Autowired private GuessLogRepository guessLogRepository; /** * 查询单条PrizeOption信息 * @param tId * @return 返回单个PrizeOption对象 * @throws BusinessException */ @Transactional(readOnly = true, rollbackFor = Exception.class) public XaResult<PrizeOption> findOne(Long modelId) throws BusinessException { PrizeOption obj = new PrizeOption(); if(modelId != 0){ obj = prizeOptionRepository.findByIdAndStatusNot(modelId,XaConstant.Status.delete); } XaResult<PrizeOption> xr = new XaResult<PrizeOption>(); if (XaUtil.isNotEmpty(obj)) { xr.setObject(obj); } else { throw new BusinessException(XaConstant.Message.object_not_find); } return xr; } /** * 分页查询状态非status的PrizeOption数据 * @param status * @param filterParams * @param pageable * @return 返回对象PrizeOption集合 * @throws BusinessException */ @Transactional(readOnly = true, rollbackFor = Exception.class) public XaResult<Page<PrizeOption>> findListNEStatusByFilter( Integer status, Map<String, Object> filterParams, Pageable pageable) throws BusinessException { Map<String, SearchFilter> filters = SearchFilter.parse(filterParams); if(status == null){// 默认显示非删除的所有数据 status = XaConstant.Status.delete; } filters.put("status", new SearchFilter("status", Operator.NE, status)); Page<PrizeOption> page = prizeOptionRepository.findAll(DynamicSpecifications .bySearchFilter(filters.values(), PrizeOption.class), pageable); XaResult<Page<PrizeOption>> xr = new XaResult<Page<PrizeOption>>(); xr.setObject(page); return xr; } /** * 分页查询状态status的PrizeOption数据 * @param status * @param filterParams * @param pageable * @return 返回对象PrizeOption集合 * @throws BusinessException */ @Transactional(readOnly = true, rollbackFor = Exception.class) public XaResult<Page<PrizeOption>> findListEQStatusByFilter( Integer status, Map<String, Object> filterParams, Pageable pageable) throws BusinessException { Map<String, SearchFilter> filters = SearchFilter.parse(filterParams); if(status == null){// 默认显示正常数据 status = XaConstant.Status.valid; } filters.put("status", new SearchFilter("status", Operator.EQ, status)); Page<PrizeOption> page = prizeOptionRepository.findAll(DynamicSpecifications .bySearchFilter(filters.values(), PrizeOption.class), pageable); XaResult<Page<PrizeOption>> xr = new XaResult<Page<PrizeOption>>(); xr.setObject(page); return xr; } /** * 保存PrizeOption信息 * @param model * @return * @throws BusinessException */ @Transactional(rollbackFor = Exception.class) public XaResult<PrizeOption> saveOrUpdate(PrizeOption model) throws BusinessException { PrizeOption obj = null; if(XaUtil.isNotEmpty(model.getId())){ obj = prizeOptionRepository.findOne(model.getId()); }else{ obj = new PrizeOption(); } obj.setMatchId(model.getMatchId()); obj.setLevel(model.getLevel()); obj.setNum(model.getNum()); obj.setPrize(model.getPrize()); obj = prizeOptionRepository.save(obj); XaResult<PrizeOption> xr = new XaResult<PrizeOption>(); xr.setObject(obj); return xr; } /** * 修改PrizeOption状态,可一次修改多条 3删除 -1锁定 1正常 * @param userId * @param modelIds * @param status * @return 返回PrizeOption对象 * @throws BusinessException */ @Transactional(rollbackFor = Exception.class) public XaResult<PrizeOption> multiOperate( String modelIds,Integer status) throws BusinessException { XaResult<PrizeOption> xr = new XaResult<PrizeOption>(); if(status == null){ status = XaConstant.Status.delete; } if(modelIds != null){ String[] ids = modelIds.split(","); for(String id : ids){ PrizeOption obj = prizeOptionRepository.findByIdAndStatusNot(Long.parseLong(id),status); if (XaUtil.isNotEmpty(obj)) { obj.setStatus(status); obj = prizeOptionRepository.save(obj); } else { throw new BusinessException(XaConstant.Message.object_not_find); } } } return xr; } @Override public XaResult<List<PrizeOptionVo>> findByMacthIdAndNotStatus(Long matchId, Integer status) throws BusinessException { Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>(); if(XaUtil.isNotEmpty(status)) { filters.put("status", new SearchFilter("status", Operator.NE, status)); } if(XaUtil.isNotEmpty(matchId)) { filters.put("matchId", new SearchFilter("matchId", Operator.EQ, matchId)); } //查二次抽奖内容 List<PrizeOption> polst = prizeOptionRepository.findAll(DynamicSpecifications.bySearchFilter(filters.values(), PrizeOption.class)); List<PrizeOptionVo> lstpo = new ArrayList<PrizeOptionVo>(); Map<Long,PrizeOptionVo> mappo = new HashMap<Long,PrizeOptionVo>(); for(int i=0;i<polst.size();i++) { PrizeOptionVo pov = JSON.parseObject(JSON.toJSONString(polst.get(i)),PrizeOptionVo.class); pov.setPrizeResultList(new ArrayList<PrizeResultVo>()); lstpo.add(pov); mappo.put(pov.getId(), pov); } //查二次抽奖中奖人数 if(polst.size()>0) { List<Object[]> prlst = prizeResultRepository.findByMatchIdAndStatusNot(XaConstant.Status.delete,matchId); for(Object[] obj : prlst) { if(mappo.containsKey(Long.parseLong(obj[4].toString()))) { PrizeResultVo grv = new PrizeResultVo(); grv.setId(Long.parseLong(obj[0].toString())); grv.setCreateTime(obj[1]==null?null:obj[1].toString()); grv.setUserId(Long.parseLong(obj[2].toString())); grv.setMatchId(Long.parseLong(obj[3].toString())); grv.setPrizeOptionId(Long.parseLong(obj[4].toString())); grv.setStatus(Integer.parseInt(obj[7].toString())); UserVo userVo = new UserVo(); userVo.setId(Long.parseLong(obj[2].toString())); userVo.setUserName(obj[5]==null?null:obj[5].toString()); userVo.setPhoto(obj[6]==null?null:obj[6].toString()); userVo.setMobile(obj[8]==null?null:obj[8].toString()); grv.setUserVo(userVo); mappo.get(Long.parseLong(obj[4].toString())).getPrizeResultList().add(grv); } } } XaResult<List<PrizeOptionVo>> xr = new XaResult<List<PrizeOptionVo>>(); xr.setObject(lstpo); return xr; } @Override public XaResult<List<PrizeOptionVo>> setPrizeOptionResult(Long matchId) throws BusinessException { XaResult<List<PrizeOptionVo>> xr = new XaResult<List<PrizeOptionVo>>(); //查询是否已经发布抽奖 List<Object[]> prlst = prizeResultRepository.findByMatchId(XaConstant.Status.publish,matchId); if(prlst.size()>0) { xr.error("抽奖结果已经发布,无法再次抽奖"); return xr; } Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>(); filters.put("status", new SearchFilter("status", Operator.NE, XaConstant.Status.delete)); filters.put("matchId", new SearchFilter("matchId", Operator.EQ, matchId)); //查二次抽奖内容(抽奖内容要排序) Sort sort = new Sort(new Order(Direction.ASC, "level")); List<PrizeOption> polst = prizeOptionRepository.findAll(DynamicSpecifications.bySearchFilter(filters.values(), PrizeOption.class),sort); if(polst.size()==0) { xr.error("未设置抽奖内容,无法抽奖"); return xr; } //查询竞猜总人数 List<GuessLog> gllst = guessLogRepository.findAll(DynamicSpecifications.bySearchFilter(filters.values(), GuessLog.class)); if(gllst.size()==0) { xr.error("没有人竞猜,无法抽奖"); return xr; } //删除之前的抽奖结果 List<PrizeResult> oprlst = prizeResultRepository.findAll(DynamicSpecifications.bySearchFilter(filters.values(), PrizeResult.class)); prizeResultRepository.delete(oprlst); //以下开始抽奖 Integer totlePrize = 0; //所有奖品总数 //Map<Long,Integer> plmap = new HashMap<Long,Integer>(); //奖品等级,奖品数量 List<Long> plist = new ArrayList<Long>(); for(PrizeOption po : polst) { totlePrize += po.getNum(); //plmap.put(po.getId(), po.getNum()); for(int i=0;i<po.getNum();i++) { plist.add(po.getId()); } } Collections.shuffle(gllst);//把候选人名单排序打乱 List<GuessLog> prizePople;//中奖人名单 if(totlePrize>=gllst.size())//所有人都中奖 { prizePople = gllst; } else//选取部分人中奖 { prizePople = new ArrayList<GuessLog>(); int totalPople = gllst.size(); //总人数 for(int i=0;i<totlePrize;i++) { int num = (int) (Math.random() * totalPople); // 注意不要写成(int)Math.random()*3,这个结果为0,因为先执行了强制转换 prizePople.add(gllst.get(num)); gllst.remove(num); totalPople --; } } Collections.shuffle(prizePople);//把中奖人名单排序打乱 //中奖过程赋值 for(int i=0;i<prizePople.size();i++) { PrizeResult pr = new PrizeResult(); pr.setMatchId(matchId); pr.setStatus(XaConstant.Status.valid); pr.setPrizeOptionId(plist.get(i)); pr.setUserId(prizePople.get(i).getUserId()); pr.setCreateTime(XaUtil.getToDayStr()); prizeResultRepository.save(pr); } return xr; } @Override public XaResult<List<PrizeOptionVo>> publishPrize(Long matchId) throws BusinessException { XaResult<List<PrizeOptionVo>> xr = new XaResult<List<PrizeOptionVo>>(); //查询是否已经发布抽奖 List<Object[]> prlst = prizeResultRepository.findByMatchId(XaConstant.Status.publish,matchId); if(prlst.size()>0) { xr.error("抽奖结果已经发布过了"); return xr; } Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>(); filters.put("status", new SearchFilter("status", Operator.NE, XaConstant.Status.delete)); filters.put("matchId", new SearchFilter("matchId", Operator.EQ, matchId)); List<PrizeResult> oprlst = prizeResultRepository.findAll(DynamicSpecifications.bySearchFilter(filters.values(), PrizeResult.class)); if(oprlst.size()==0) { xr.error("尚未抽奖,无法发布"); return xr; } for(PrizeResult pr : oprlst) { pr.setStatus(XaConstant.Status.publish); prizeResultRepository.save(pr); } return xr; } }
[ "sj092678@163.com" ]
sj092678@163.com
91c3f2af06caa41186737cbbab219d5d4b145544
53f895ac58cb7c9e1e8976c235df9c4544e79d33
/18_Polymorphism (115- 123 in Section8)/com/source/polymorphism/D.java
65755f39c02a6d2c4d062eceb994f7918f06de60
[]
no_license
alagurajan/CoreJava
c336356b45cdbcdc88311efbba8f57503e050b66
be5a8c2a60aac072f777d8b0320e4c94a1266cb3
refs/heads/master
2021-01-11T01:33:11.447570
2016-12-16T22:24:58
2016-12-16T22:24:58
70,690,915
0
0
null
null
null
null
UTF-8
Java
false
false
121
java
package com.source.polymorphism; class D extends C { void test() { System.out.println("from D-test"); } }
[ "AlaguAishu@192.168.1.5" ]
AlaguAishu@192.168.1.5
462fc5d36ebd8a454c5a66ee34049cf52dea90c4
40717edf78e7eeafdb28d7c9f133f45b5cd7d9f8
/src/com/fuyue/util/ui/adapter/SectionAdapter.java
ef10af5e200fb3f2ba8ef40ce21239147dcf496b
[]
no_license
CalvinXuw/FuYueFrame
965d6b9b002a8245786e5c012d485e1f7bcf62e3
9d8f71d9f587d413fb21aedacd71799efacc2fbe
refs/heads/master
2021-01-10T21:28:22.207667
2013-12-19T08:50:29
2013-12-19T08:50:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,931
java
package com.fuyue.util.ui.adapter; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; /** * section适配器 * * @author Calvin * */ public abstract class SectionAdapter extends BaseAdapter { @Override public int getCount() { int sectionCount = sectionCount(); int count = 0; for (int i = 0; i < sectionCount; i++) { count += getCountWithSection(i); } return count; } @Override public Object getItem(int position) { // 分配给各个section for (int i = 0; i < sectionCount(); i++) { if (getCountWithSection(i) > position) { return getItemWithSection(i, position); } else { position -= getCountWithSection(i); } } return null; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { // 分配给各个section for (int i = 0; i < sectionCount(); i++) { if (getCountWithSection(i) > position) { return getViewWithSection(i, position, convertView); } else { position -= getCountWithSection(i); } } return null; } /** * 获取分栏条数 * * @return */ public abstract int sectionCount(); /** * 获取指定sectionId下的item数量 * * @param sectionId * @return */ public abstract int getCountWithSection(int sectionId); /** * 获取是定sectionId下的某个item * * @param sectionId * @param position * @return */ public abstract Object getItemWithSection(int sectionId, int position); /** * 获取指定sectionId下的section name * * @param sectionId * @return */ public abstract String getSectionName(int sectionId); /** * 根据sectionId和postion获取View * * @param sectionId * @param position * @param convertView * @return */ public abstract View getViewWithSection(int sectionId, int position, View convertView); }
[ "199169153@qq.com" ]
199169153@qq.com
2bb1bbf324868fc16acfe4825294660c8ca8f0ca
b44c72e97af3180df9b779d5a62a8018a138f3ff
/app/src/main/java/com/openwebsolutions/propertybricks/ForgetPassword_Page/ForgetPasswordActivity.java
e9f8a3bca06c9ed5d9e90ad9d860b7b6af2779cd
[]
no_license
mou2706/PropertyBricks
54aacc0de9c23b803b11eac8b4ade6cfe9c786ed
bc08d36e4f6c82238e2505b49f8a060310f6c5a1
refs/heads/master
2023-03-31T12:02:36.634191
2021-04-03T08:49:36
2021-04-03T08:49:36
354,238,733
0
0
null
null
null
null
UTF-8
Java
false
false
6,636
java
package com.openwebsolutions.propertybricks.ForgetPassword_Page; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.github.ybq.android.spinkit.style.ThreeBounce; import com.openwebsolutions.propertybricks.Api.MainApplication; import com.openwebsolutions.propertybricks.Model.Forget_Password.ForgetPassword; import com.openwebsolutions.propertybricks.R; import es.dmoral.toasty.Toasty; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class ForgetPasswordActivity extends AppCompatActivity implements View.OnClickListener { ImageView iv_forget_back; EditText et_email_check; TextView tv_continue; RelativeLayout rel_forgot_password; String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+"; String email=null; ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_forget_password); init(); } private void init() { iv_forget_back=findViewById(R.id.iv_forget_back); et_email_check=findViewById(R.id.et_email_check); tv_continue=findViewById(R.id.tv_continue); rel_forgot_password=findViewById(R.id.rel_forgot_password); iv_forget_back.setOnClickListener(this); tv_continue.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.iv_forget_back: super.onBackPressed(); ForgetPasswordActivity.this.overridePendingTransition(R.anim.left_to_right, R.anim.right_to_left); break; case R.id.tv_continue: email=et_email_check.getText().toString(); if(valid()){ progressBar= (ProgressBar) findViewById(R.id.spin_kit2_forget); progressBar.setVisibility(View.VISIBLE); ThreeBounce threeBounce = new ThreeBounce(); progressBar.setIndeterminateDrawable(threeBounce); getForget_password(email); LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.custom_toast, (ViewGroup) findViewById(R.id.custom_toast_container)); TextView text = (TextView) layout.findViewById(R.id.text); text.setText("Link send Successfully.. "); Toast toast = new Toast(getApplicationContext()); toast.setGravity(Gravity.CENTER, 0, 0); toast.setDuration(Toast.LENGTH_LONG); toast.setView(layout); toast.show(); // Toast.makeText(this,"Link send to your valid email address",Toast.LENGTH_SHORT).show(); rel_forgot_password.setVisibility(View.INVISIBLE); } break; } } private void getForget_password(String email) { ConnectivityManager conMgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); if ( conMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState() == NetworkInfo.State.CONNECTED || conMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED ) { try{ MainApplication.apiManager.getforget_password(email, new Callback<ForgetPassword>() { @Override public void onResponse(Call<ForgetPassword> call, Response<ForgetPassword> response) { ForgetPassword responseUser = response.body(); // response.isSuccessful(); if (response.isSuccessful() && responseUser != null) { tv_continue.setVisibility(View.VISIBLE); progressBar.setVisibility(View.GONE); try { if (responseUser.getSuccess().equals(false)) { Toasty.error(ForgetPasswordActivity.this, "" + responseUser.getMessage(), Toast.LENGTH_SHORT, true).show(); } else { Toast.makeText(ForgetPasswordActivity.this, "" + responseUser.getMessage(), Toast.LENGTH_SHORT).show(); } et_email_check.setText(""); } catch (Exception e) { } } else{ Toasty.error(ForgetPasswordActivity.this, "" + responseUser.getMessage(), Toast.LENGTH_SHORT, true).show(); } } @Override public void onFailure(Call<ForgetPassword> call, Throwable t) { Toasty.error(getApplicationContext(), "Internal Error", Toast.LENGTH_SHORT, true).show(); } }); } catch (Exception e){ } } else { Toasty.error(ForgetPasswordActivity.this, "Please check internet connection", Toast.LENGTH_SHORT).show(); } } private boolean valid() { boolean isvalid=true; if(email.equalsIgnoreCase("")){ isvalid=false; Toasty.warning(getApplicationContext(), "Please Enter email address", Toast.LENGTH_SHORT, true).show(); return isvalid; } else if(!email.matches(emailPattern) ){ isvalid=false; Toasty.error(getApplicationContext(), "Please Enter valid email address", Toast.LENGTH_SHORT, true).show(); return isvalid; } return isvalid; } @Override public void onBackPressed() { super.onBackPressed(); ForgetPasswordActivity.this.overridePendingTransition(R.anim.left_to_right, R.anim.right_to_left); } }
[ "majumdar2706@gmail.com" ]
majumdar2706@gmail.com
6ac600a3d1fb8076336de3f2131ec99af47caaea
53c33acafd582501bd21c359ef55f4f9425911d2
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RobotDirectionDrive.java
147ed6336a71a3de3087bf81f53be422b27afac6
[ "BSD-3-Clause" ]
permissive
MessMaker236/HFRoboticsAppMaster
8e3676136b484fdc60d43936efa57cf5467429e0
57c5de44670b09a87214e89f9c3c61563b6f111f
refs/heads/master
2020-06-16T03:03:58.139851
2017-01-16T17:43:55
2017-01-16T17:43:55
75,250,996
0
0
null
2016-12-03T22:54:47
2016-12-01T03:22:26
Java
UTF-8
Java
false
false
256
java
package org.firstinspires.ftc.teamcode; /** * Created by bm121 on 12/14/2016. */ public enum RobotDirectionDrive { FORWARD, BACK, LEFT, RIGHT, DFLEFT, DFRIGHT, DBLEFT, DBRIGHT, SPINLEFT, SPINRIGHT; //Sets enum values for direction driving }
[ "bm121512@gmail.com" ]
bm121512@gmail.com
52c355b96755a65f43a0f6cc8729f638cd27fc2e
7130882e0708a1835dc6bc13ee92bbde1ef4abda
/src/main/java/org/monarch/golr/GolrLoaderModule.java
ad83f7edffa887268fcba6e94691a8840bbabe2a
[ "Apache-2.0" ]
permissive
SciGraph/golr-loader
cc95a5f6d16efd7f88d3d06f211862f47d87ba86
7368d11d074c3d010e824d58a9337466ab1f8f39
refs/heads/master
2022-11-23T03:44:34.760371
2021-12-09T20:04:07
2021-12-10T16:13:54
34,288,103
2
4
Apache-2.0
2022-11-16T09:30:47
2015-04-20T21:41:40
Java
UTF-8
Java
false
false
420
java
package org.monarch.golr; import io.scigraph.neo4j.Graph; import io.scigraph.neo4j.GraphTransactionalImpl; import javax.inject.Singleton; import com.google.inject.AbstractModule; import com.google.inject.assistedinject.FactoryModuleBuilder; class GolrLoaderModule extends AbstractModule { @Override protected void configure() { bind(Graph.class).to(GraphTransactionalImpl.class).in(Singleton.class); } }
[ "condit@sdsc.edu" ]
condit@sdsc.edu
98a8c2a98ded4b706c3c386eb025ea3931d580f0
d54c7360b13e84aeab5daabde9aa504b1ce457e0
/Ess/src/main/java/com/ulfric/ess/commands/CommandSetmotd.java
3f2b3ed0845f7f2420b8e3f3b94171a77e355259
[]
no_license
ThatForkyDev/LuckyPrison
0fa1abfd4a83280522c6f100de2ac72c0e97c754
ea0dd1a57986c2f8a5f8f6200f705bdb49f16e69
refs/heads/master
2022-01-17T18:30:15.317081
2016-12-27T13:29:19
2016-12-27T13:29:19
77,457,692
0
0
null
null
null
null
UTF-8
Java
false
false
1,017
java
package com.ulfric.ess.commands; import java.util.regex.Pattern; import com.ulfric.ess.modules.ModuleMotd; import com.ulfric.lib.api.command.Argument; import com.ulfric.lib.api.command.SimpleCommand; import com.ulfric.lib.api.command.arg.ArgStrategy; import com.ulfric.lib.api.java.Strings; import com.ulfric.lib.api.locale.Locale; public class CommandSetmotd extends SimpleCommand { public CommandSetmotd() { this.withIndexUnusedArgs(); this.withArgument(Argument.builder().withPath("start").withStrategy(ArgStrategy.STRING).withRemovalExclusion()); } @Override public void run() { if (!this.hasObjects()) { ModuleMotd.get().disable(); ModuleMotd.get().enable(); Locale.sendSuccess(this.getSender(), "ess.motd_reset"); return; } String[] parts = this.getUnusedArgs().split(Pattern.quote("-b")); ModuleMotd.get().clear(); ModuleMotd.get().addMotd(parts[0].trim(), parts.length == 1 ? Strings.BLANK : parts[1].trim()); Locale.send(this.getSender(), "ess.motd_set"); } }
[ "DeclaredMC@gmail.com" ]
DeclaredMC@gmail.com
6c605c82905cdf1a99d08bfa67cfac2df8d07080
3ab5f3c529e281b7a83e499368c94eb79094dd3a
/src/main/java/ar/gob/gcba/dgisis/aplicaciones/config/FeignConfiguration.java
954737697d152e622a25e44330b9d607b570bfd3
[]
no_license
scarabetta/mapa360-aplicaciones
6cabaa0c5aebe15337f8d76406647e5b0c98152d
9410977eb5c2813d7a19347c0dea5213be8a768d
refs/heads/master
2020-03-29T10:25:25.364175
2018-09-21T18:48:44
2018-09-21T18:48:44
149,804,528
0
0
null
null
null
null
UTF-8
Java
false
false
533
java
package ar.gob.gcba.dgisis.aplicaciones.config; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration @EnableFeignClients(basePackages = "ar.gob.gcba.dgisis.aplicaciones") public class FeignConfiguration { /** * Set the Feign specific log level to log client REST requests */ @Bean feign.Logger.Level feignLoggerLevel() { return feign.Logger.Level.BASIC; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
cc64da55ee4035f147185c98e022e12e6d28dbd7
29693c21f1958f1dc8573d47828726e2ed41bdc1
/src/engine/network/SomeRequest.java
a83b447dcd97e4af003f405725075cdaf8ce9f4c
[ "MIT" ]
permissive
mikeant42/Vulture
ff82fe40ef07d95975b40db59d6869dde40e6575
e944fefe30eb489401b39f6077e49c59d34ade70
refs/heads/master
2021-09-09T09:53:56.534256
2018-03-14T22:44:51
2018-03-14T22:44:51
77,869,585
0
0
null
null
null
null
UTF-8
Java
false
false
78
java
package engine.network; public class SomeRequest { public String text; }
[ "antkiewicz@protonmail.com" ]
antkiewicz@protonmail.com
a705965170f2f2f3c49c133580ddc0534263ecfc
4bbc98f4e9fa92f350b4816fa331d470880e1df6
/testdocbuild11/src/main/java/com/fastcode/testdocbuild11/addons/reporting/application/reportversion/dto/UpdateReportversionInput.java
cbec8d1959fbd96dcd08c167a422e8e84cc4147e
[]
no_license
sunilfastcode/testdocbuild11
07d7b8a96df7d07ef8e08325463e8eb85ac0da5c
d6a22d880015ed8cd7e10dae67f6b70e222a1849
refs/heads/master
2023-02-12T17:43:15.443849
2020-12-26T22:57:11
2020-12-26T22:57:11
319,411,987
0
0
null
null
null
null
UTF-8
Java
false
false
588
java
package com.fastcode.testdocbuild11.addons.reporting.application.reportversion.dto; import lombok.Getter; import lombok.Setter; import org.json.simple.JSONObject; @Getter @Setter public class UpdateReportversionInput { private String ctype; private String description; private JSONObject query; private String reportType; private String title; private String reportVersion; private Long userId; private String userDescriptiveField; private String reportWidth; private Long reportId; private Boolean isRefreshed; private Long versiono; }
[ "info@nfinityllc.com" ]
info@nfinityllc.com
6befa2b7b43cb6b309c1cef57c5acb4af60b7fa3
c120a7bcd77f4911a4a19ad14ef806cb86226e39
/bucketlist/src/main/java/com/example/bucket/demo/services/PersonServiceImpl.java
84dfba5954634bb6e52dfcb255e0182eda20b47b
[]
no_license
vjanosigergely/projects
f51a1fccceab78677bf4d6eab93b62fb7afedba8
55ad5d4751845470e2484c3c60a07c8ae0dbfc7c
refs/heads/master
2021-05-22T16:57:45.259197
2020-04-21T14:57:59
2020-04-21T14:57:59
253,012,475
0
0
null
null
null
null
UTF-8
Java
false
false
694
java
package com.example.bucket.demo.services; import com.example.bucket.demo.models.Person; import com.example.bucket.demo.repos.PersonRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class PersonServiceImpl implements PersonService { private PersonRepository personRepository; @Autowired public PersonServiceImpl(PersonRepository personRepository) { this.personRepository = personRepository; } @Override public void save(Person person) { personRepository.save(person); } @Override public Person findById(long id) { return personRepository.findById(id).orElse(null); } }
[ "v.janosi.gergely@gmail.com" ]
v.janosi.gergely@gmail.com
81190acf62de3b3f74e55e99b8e6822c9fd54373
28e6915a086ec5b5bbdb0008cac479fe98d1dc4e
/Android/UdacityProjects/QuizApp/app/src/main/java/com/example/android/quizapp/MainActivity.java
fdae67155d7137121dd620a6625ef750ed086425
[]
no_license
Humad/Project-Playground
38215c208025d22a6e8ec90d203b8937f0f29ba1
a6ccd01edee7f136dc6aa6be36519ad1b5d0bfee
refs/heads/master
2018-10-10T03:31:11.400971
2018-08-17T01:05:35
2018-08-17T01:05:35
94,341,886
0
0
null
null
null
null
UTF-8
Java
false
false
1,399
java
package com.example.android.quizapp; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.CheckBox; import android.widget.RadioButton; import android.widget.Toast; public class MainActivity extends AppCompatActivity { private int score; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); score = 0; setContentView(R.layout.activity_main); } public void submit(View view){ boolean isCorrect = ((CheckBox) findViewById(R.id.correct1)).isChecked() && ((CheckBox) findViewById(R.id.correct2)).isChecked(); updateScore(isCorrect); isCorrect = ((RadioButton) findViewById(R.id.correct3)).isChecked(); updateScore(isCorrect); isCorrect = ((RadioButton) findViewById(R.id.correct4)).isChecked(); updateScore(isCorrect); isCorrect = ((RadioButton) findViewById((R.id.correct5))).isChecked(); updateScore(isCorrect); Toast.makeText(this, "You scored " + score + " out of 4", Toast.LENGTH_SHORT).show(); score = 0; } private void updateScore(boolean correct){ if (correct){ score++; } } public void reset(View view){ score = 0; setContentView(R.layout.activity_main); } }
[ "humad@live.com" ]
humad@live.com
0d113c3db80e0397a276b2d5bc7f25d14a93fc07
66b630094446e0456033f2a06348f21ea17bd3e1
/src/main/java/tch/impl/UserServiceImpl.java
11289eb745c15735e97debb826a206d9ebca3a99
[]
no_license
FiseTch/anaylse
ccaa0d73135a18ba33517f96178d46a8a742cde4
40e92ab766a8a1dd83e58e51ffbf7d06ff613fea
refs/heads/master
2022-12-21T22:32:53.526537
2018-06-07T04:29:12
2018-06-07T04:29:12
124,012,351
2
0
null
2022-12-16T08:39:17
2018-03-06T03:04:02
Java
UTF-8
Java
false
false
3,186
java
package tch.impl; import java.util.List; import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import tch.dao.UserMapper; import tch.model.User; import tch.service.IUserService; import tch.util.ConstantTch; /** * * * Copyright:tch * * @class: tch.impl * @Description: * * @version: v1.0.0 * @author: tongch * @date: 2018-04-05 * Modification History: * date Author Version Description *------------------------------------------------------------ * 2018-04-05 tongch v1.1.0 */ @Service("userService") @Scope("prototype") public class UserServiceImpl implements IUserService { private Log log = LogFactory.getLog(UserServiceImpl.class); @Resource//放在set方法也可以,不过需要考虑名称与属性类型的问题 private UserMapper userMapper; /* public UserMapper getUserMapper() { return userMapper; } @Autowired与resource的区别在于一个根据名称,一个根据属性类型 public void setUserMapper(UserMapper userMapper) { this.userMapper = userMapper; }*/ /** * 通过id查询用户 */ public User getUserById(String username) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); User user = new User(); user = userMapper.getUserByPrimaryKey(username); if (user != null) { log.info("user:" + user.toString()); return user; }else{ log.error("当前查询用户为空"); return ConstantTch.DEFAULT_USER; } } /** * 查询所有用户 */ public List<User> getAllUser() { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.getAll() ; } /** * 插入记录,不允许为空 */ public int insertUser(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.insert(user); } /** * 插入记录,允许为空(包括主键) */ public int insertUserSelective(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.insertSelective(user); } /** * 根据主键id 删除记录 */ public void deleteUserById(String username) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); userMapper.deleteByPrimaryKey(username); } /** * 根据主键id更新记录(其余属性不允许为空) */ public int updateUserById(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.updateByPrimaryKey(user); } /** * 根据主键id更新记录(其余属性允许为空) */ public int updateUserByIdSelective(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.updateByPrimaryKeySelective(user); } /** * 根据属性值查记录 */ public User getUserByAttr(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.getUserByAttr(user); } }
[ "2289717264@qq.com" ]
2289717264@qq.com
adafd1bdd46d2d5ecf290d55eb16d681b2b10e95
163332a7912b1d385f431289df963744d0d7916f
/src/utils/GsonTest.java
7651948292268abe37a52cc290ca5809d2d2bb70
[ "MIT" ]
permissive
ivanbravi/RinascimentoFramework
90ee1016a67e303d30f038d18a63c4ec92ba1e78
ce31592f78572096ceedd5ced1bac4f82c5f08db
refs/heads/master
2023-05-25T12:18:07.777143
2023-05-11T06:53:03
2023-05-11T06:53:03
188,228,414
6
2
null
null
null
null
UTF-8
Java
false
false
1,023
java
package utils; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.io.FileReader; import java.io.FileWriter; import java.io.Reader; import java.io.Writer; import java.util.ArrayList; public class GsonTest { public static void main(String[] args){ String path = "agents.json"; AgentsConfig playerData = new AgentsConfig(new AgentDescription[]{new AgentDescription("RHEA",new int[]{0,0,0,0,0,0}), new AgentDescription("MCTS",new int[]{0,0,0,0,0,0}), new AgentDescription("SRHEA", new int[]{1,3}), new AgentDescription("OSLA",null)}); try (Writer w = new FileWriter(path)){ Gson writer = new GsonBuilder().setPrettyPrinting().create(); writer.toJson(playerData, w); }catch (Exception e){ e.printStackTrace(); } AgentsConfig playerDataRead = null; try (Reader r = new FileReader(path)) { Gson parser = new Gson(); playerDataRead = parser.fromJson(r, AgentsConfig.class); }catch (Exception e){ e.printStackTrace(); } System.out.println(); } }
[ "acw383@qmul.ac.uk" ]
acw383@qmul.ac.uk
31718fa460065ce49369ae6b21d2e39491e1ed87
700afb7d46b6042cc344eed044c5bfee758010bc
/at.o2xfs.win32/src/at/o2xfs/win32/SHORT.java
c225a46161fb93b2b14904c2c3a29b0d170faf08
[ "BSD-2-Clause" ]
permissive
techhyuk/O2Xfs
3488b9b8b60a18c8c6c6465733a4dae136bbc18e
a307775652459d830d363f3e9c8ec0df9bdc2d73
refs/heads/master
2021-01-01T17:06:16.375800
2012-11-24T18:41:48
2012-11-24T18:41:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,010
java
/* * Copyright (c) 2012, Andreas Fagschlunger. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package at.o2xfs.win32; /** * A 16-bit integer. The range is –32768 through 32767 decimal. * * {@link http://msdn.microsoft.com/en-us/library/aa383751%28v=vs.85%29.aspx} * * @author Andreas Fagschlunger */ public class SHORT extends Type { private final static int SIZE = 2; public SHORT(final short s) { allocate(); put(s); } public void put(final short value) { buffer().putShort(getOffset(), value); } public short shortValue() { return buffer().getShort(getOffset()); } @Override public int getSize() { return SIZE; } }
[ "andreas.fagschlunger@reflex.at" ]
andreas.fagschlunger@reflex.at
3610f5ab7c61879e1c0e2ead219c4ffbafd045bb
8af2ec5f19c6bfc1af4b8552f64bc6b8b1ea51ec
/src/main/java/az/company/resume/ResumeApplication.java
69c74f0e7f9fb82768dd3b6f145bb073ead32c52
[]
no_license
ism4i1ov/resume-web-app-with-spring-boot
7f5718761e065dbee3b5c309c82f180d50221699
9d239cbc92fec36a1f940ddf2479d7af02da2006
refs/heads/master
2023-04-22T00:47:35.045157
2021-05-12T10:40:39
2021-05-12T10:40:39
366,680,365
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package az.company.resume; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ResumeApplication { public static void main(String[] args) { SpringApplication.run(ResumeApplication.class, args); } }
[ "ism4i1ov@gmail.com" ]
ism4i1ov@gmail.com
3ee2379660c06ed28ed88721ab2a723da8309113
8a49c7bbb56caff8f51db02e7fa8ae9f6ac74f2c
/src/arg_component/ComboBoxItem.java
89fab1be6e039d5190ca239fabf4cd99f1828256
[]
no_license
qwert2603/Radio-Database
542d7fc26bf4d7ee68c06780affa3526c4e0ca46
c36b97e70184c8c5467898d1e93628ff7fbacd01
refs/heads/master
2016-09-14T14:49:19.765278
2016-05-14T11:37:34
2016-05-14T11:37:34
56,308,770
0
0
null
null
null
null
UTF-8
Java
false
false
399
java
package arg_component; public class ComboBoxItem { public ComboBoxItem(int id, String s) { this.s = s; this.id = id; } public String s; public int id; @Override public boolean equals(Object obj) { return (obj instanceof ComboBoxItem) && (id == ((ComboBoxItem) obj).id); } @Override public String toString() { return s; } }
[ "qwert2603@mail.ru" ]
qwert2603@mail.ru
e13243b3e84e1dc0f4716fa0d11c5a0ef7095053
10dd0d94b749e7f10fbbd50b4344704561d415f2
/algorithm/src/algorithm/chapter2/template/LeetCode_105_519.java
59c7e88b029a0c82981152e3be212415b71a7b40
[]
no_license
chying/algorithm_group
79d0bffea56e6dc0b327f879a309cfd7c7e4133e
cd85dd08f065ae0a6a9d57831bd1ac8c8ce916ce
refs/heads/master
2020-09-13T19:10:19.074546
2020-02-13T04:12:56
2020-02-13T04:12:56
222,877,592
7
3
null
null
null
null
UTF-8
Java
false
false
670
java
package algorithm.chapter2.template; import javax.swing.tree.TreeNode; /** * 【105. 从前序与中序遍历序列构造二叉树】根据一棵树的前序遍历与中序遍历构造二叉树。 注意: 你可以假设树中没有重复的元素。 例如,给出 前序遍历 * preorder = [3,9,20,15,7] 中序遍历 inorder = [9,3,15,20,7] 来源:力扣(LeetCode) * 链接:https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal * * @author chying * */ public class LeetCode_105_519 { public TreeNode buildTree(int[] preorder, int[] inorder) { return null; } public static void main(String[] args) { } }
[ "852342406@qq.com" ]
852342406@qq.com
433b88c94dc28abfb52c0fa2042ec3e9bb8e4b74
36e40efcfa317432c192f169da2d330b1b284831
/src/main/java/Rasad/Core/Net/IPAddressRangeGenerator/Bits.java
87ea8bd2683f4669199d50494a2db346590224d8
[]
no_license
MrezaPasha/Communication
06a31879e089c4f14985add67d958b414332e4cf
b312ef27dd60037086f0e32ddf235a9cc103a793
refs/heads/master
2020-05-29T21:38:59.551104
2019-05-31T09:52:28
2019-05-31T09:52:28
189,385,266
0
0
null
null
null
null
UTF-8
Java
false
false
5,247
java
package Rasad.Core.Net.IPAddressRangeGenerator; import Rasad.Core.*; import Rasad.Core.Net.*; public final class Bits { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static byte[] Not(byte[] bytes) public static byte[] Not(byte[] bytes) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return bytes.Select(b => (byte)~b).ToArray(); return bytes.Select(b -> (byte)~b).ToArray(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static byte[] And(byte[] A, byte[] B) public static byte[] And(byte[] A, byte[] B) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return A.Zip(B, (a, b) => (byte)(a & b)).ToArray(); return A.Zip(B, (a, b) -> (byte)(a & b)).ToArray(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static byte[] Or(byte[] A, byte[] B) public static byte[] Or(byte[] A, byte[] B) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return A.Zip(B, (a, b) => (byte)(a | b)).ToArray(); return A.Zip(B, (a, b) -> (byte)(a | b)).ToArray(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static bool GE(byte[] A, byte[] B) public static boolean GE(byte[] A, byte[] B) { return A.Zip(B, (a, b) -> a == b ? 0 : a < b ? 1 : -1).SkipWhile(c -> c == 0).FirstOrDefault() >= 0; } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static bool LE(byte[] A, byte[] B) public static boolean LE(byte[] A, byte[] B) { return A.Zip(B, (a, b) -> a == b ? 0 : a < b ? 1 : -1).SkipWhile(c -> c == 0).FirstOrDefault() <= 0; } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static byte[] GetBitMask(int sizeOfBuff, int bitLen) public static byte[] GetBitMask(int sizeOfBuff, int bitLen) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: var maskBytes = new byte[sizeOfBuff]; byte[] maskBytes = new byte[sizeOfBuff]; int bytesLen = bitLen / 8; int bitsLen = bitLen % 8; for (int i = 0; i < bytesLen; i++) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: maskBytes[i] = 0xff; maskBytes[i] = (byte)0xff; } if (bitsLen > 0) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: maskBytes[bytesLen] = (byte)~Enumerable.Range(1, 8 - bitsLen).Select(n => 1 << n - 1).Aggregate((a, b) => a | b); maskBytes[bytesLen] = (byte)~Enumerable.Range(1, 8 - bitsLen).Select(n -> 1 << n - 1).Aggregate((a, b) -> a | b); } return maskBytes; } /** Counts the number of leading 1's in a bitmask. Returns null if value is invalid as a bitmask. @param bytes @return */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static Nullable<int> GetBitMaskLength(byte[] bytes) public static Integer GetBitMaskLength(byte[] bytes) { if (bytes == null) { throw new NullPointerException("bytes"); } int bitLength = 0; int idx = 0; // find beginning 0xFF for (; idx < bytes.length && bytes[idx] == 0xff; idx++) { ; } bitLength = 8 * idx; if (idx < bytes.length) { switch (bytes[idx]) { case 0xFE: bitLength += 7; break; case 0xFC: bitLength += 6; break; case 0xF8: bitLength += 5; break; case 0xF0: bitLength += 4; break; case 0xE0: bitLength += 3; break; case 0xC0: bitLength += 2; break; case 0x80: bitLength += 1; break; case 0x00: break; default: // invalid bitmask return null; } // remainder must be 0x00 if (bytes.Skip(idx + 1).Any(x -> x != 0x00)) { return null; } } return bitLength; } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static byte[] Increment(byte[] bytes) public static byte[] Increment(byte[] bytes) { if (bytes == null) { throw new NullPointerException("bytes"); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: var incrementIndex = Array.FindLastIndex(bytes, x => x < byte.MaxValue); int incrementIndex = Array.FindLastIndex(bytes, x -> x < Byte.MAX_VALUE); if (incrementIndex < 0) { throw new OverflowException(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return bytes.Take(incrementIndex).Concat(new byte[] { (byte)(bytes[incrementIndex] + 1) }).Concat(new byte[bytes.Length - incrementIndex - 1]).ToArray(); return bytes.Take(incrementIndex).Concat(new byte[] {(byte)(bytes[incrementIndex] + 1)}).Concat(new byte[bytes.length - incrementIndex - 1]).ToArray(); } }
[ "umz1387@gmail.com" ]
umz1387@gmail.com
8ccc82f19b6c3d72296b2ba04ce3de301bece3c0
b99dbac37852ef4210409e577d00c670fe7da48c
/src/main/java/com/manager/common/service/impl/DoiTuongServiceImpl.java
cb6051e2da56e93816bebc812637bc2266ea0ec0
[]
no_license
devhvm/snv_common
e0973888d3422ab16a98566e51445dd214db0b10
5a862c8a2470c66fe4f263e853c985d066dd619a
refs/heads/master
2022-12-11T02:56:42.890668
2019-04-01T01:43:19
2019-04-01T01:43:19
178,160,963
0
0
null
2022-12-08T19:47:11
2019-03-28T08:36:36
Java
UTF-8
Java
false
false
2,596
java
package com.manager.common.service.impl; import com.manager.common.service.DoiTuongService; import com.manager.common.domain.DoiTuong; import com.manager.common.repository.DoiTuongRepository; import com.manager.common.service.dto.DoiTuongDTO; import com.manager.common.service.mapper.DoiTuongMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Optional; /** * Service Implementation for managing DoiTuong. */ @Service @Transactional public class DoiTuongServiceImpl implements DoiTuongService { private final Logger log = LoggerFactory.getLogger(DoiTuongServiceImpl.class); private final DoiTuongRepository doiTuongRepository; private final DoiTuongMapper doiTuongMapper; public DoiTuongServiceImpl(DoiTuongRepository doiTuongRepository, DoiTuongMapper doiTuongMapper) { this.doiTuongRepository = doiTuongRepository; this.doiTuongMapper = doiTuongMapper; } /** * Save a doiTuong. * * @param doiTuongDTO the entity to save * @return the persisted entity */ @Override public DoiTuongDTO save(DoiTuongDTO doiTuongDTO) { log.debug("Request to save DoiTuong : {}", doiTuongDTO); DoiTuong doiTuong = doiTuongMapper.toEntity(doiTuongDTO); doiTuong = doiTuongRepository.save(doiTuong); return doiTuongMapper.toDto(doiTuong); } /** * Get all the doiTuongs. * * @param pageable the pagination information * @return the list of entities */ @Override @Transactional(readOnly = true) public Page<DoiTuongDTO> findAll(Pageable pageable) { log.debug("Request to get all DoiTuongs"); return doiTuongRepository.findAll(pageable) .map(doiTuongMapper::toDto); } /** * Get one doiTuong by id. * * @param id the id of the entity * @return the entity */ @Override @Transactional(readOnly = true) public Optional<DoiTuongDTO> findOne(Long id) { log.debug("Request to get DoiTuong : {}", id); return doiTuongRepository.findById(id) .map(doiTuongMapper::toDto); } /** * Delete the doiTuong by id. * * @param id the id of the entity */ @Override public void delete(Long id) { log.debug("Request to delete DoiTuong : {}", id); doiTuongRepository.deleteById(id); } }
[ "vu.nguyenthach@asoview.vn" ]
vu.nguyenthach@asoview.vn
1ad37e2558a417f5f775b07cb1c3e94e855e15e7
5783dc53ae048651c7730958562cec22bd0e0d59
/src/javaapplication9/asdf/NewJInternalFrame.java
d9c633e70ab0105d69f45864740b75e7759dd94d
[]
no_license
jagannath311/DailyHunt
02b0638b23800d695efaac2a38ce10ef291d9cbe
98078e260f41bd219eea0a4da37c9678ab8445d1
refs/heads/master
2022-10-03T00:52:08.497226
2020-04-18T12:49:12
2020-04-18T12:49:12
270,144,741
1
0
null
null
null
null
UTF-8
Java
false
false
91,340
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 javaapplication9.asdf; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; /** * * @author sai */ public class NewJInternalFrame extends javax.swing.JInternalFrame { private Object bundle; /** * Creates new form NewJInternalFrame */ public NewJInternalFrame() { 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() { jToggleButton9 = new javax.swing.JToggleButton(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jScrollPane3 = new javax.swing.JScrollPane(); jTextArea2 = new javax.swing.JTextArea(); jMenu1 = new javax.swing.JMenu(); jLabel21 = new javax.swing.JLabel(); jScrollPane5 = new javax.swing.JScrollPane(); jTextPane1 = new javax.swing.JTextPane(); jScrollPane6 = new javax.swing.JScrollPane(); jEditorPane1 = new javax.swing.JEditorPane(); jPanel8 = new javax.swing.JPanel(); jTextField6 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); jScrollPane4 = new javax.swing.JScrollPane(); jPanel7 = new javax.swing.JPanel(); jPanel9 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jToggleButton3 = new javax.swing.JToggleButton(); jToggleButton4 = new javax.swing.JToggleButton(); jToggleButton6 = new javax.swing.JToggleButton(); jToggleButton7 = new javax.swing.JToggleButton(); jToggleButton5 = new javax.swing.JToggleButton(); jToggleButton1 = new javax.swing.JToggleButton(); jToggleButton8 = new javax.swing.JToggleButton(); jScrollPane1 = new javax.swing.JScrollPane(); jPanel3 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jScrollPane8 = new javax.swing.JScrollPane(); jTextPane3 = new javax.swing.JTextPane(); jScrollPane10 = new javax.swing.JScrollPane(); jTextPane5 = new javax.swing.JTextPane(); jLabel7 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel(); jLabel27 = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); jLabel29 = new javax.swing.JLabel(); jPanel6 = new javax.swing.JPanel(); jLabel24 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jScrollPane11 = new javax.swing.JScrollPane(); jTextPane6 = new javax.swing.JTextPane(); jScrollPane13 = new javax.swing.JScrollPane(); jTextPane7 = new javax.swing.JTextPane(); jPanel4 = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); textArea1 = new java.awt.TextArea(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); jLabel20 = new javax.swing.JLabel(); jPanel5 = new javax.swing.JPanel(); jScrollPane7 = new javax.swing.JScrollPane(); jTextPane2 = new javax.swing.JTextPane(); jLabel23 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel22 = new javax.swing.JLabel(); jPanel10 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel30 = new javax.swing.JLabel(); jLabel31 = new javax.swing.JLabel(); jLabel32 = new javax.swing.JLabel(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("javaapplication9/asdf/Bundle"); // NOI18N jToggleButton9.setText(bundle.getString("NewJInternalFrame.jToggleButton9.text")); // NOI18N jLabel4.setText(bundle.getString("NewJInternalFrame.jLabel4.text")); // NOI18N jLabel5.setText(bundle.getString("NewJInternalFrame.jLabel5.text")); // NOI18N jTextArea2.setColumns(20); jTextArea2.setRows(5); jScrollPane3.setViewportView(jTextArea2); jMenu1.setText(bundle.getString("NewJInternalFrame.jMenu1.text")); // NOI18N jLabel21.setText(bundle.getString("NewJInternalFrame.jLabel21.text")); // NOI18N jScrollPane5.setViewportView(jTextPane1); jScrollPane6.setViewportView(jEditorPane1); javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout.setHorizontalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); jPanel8Layout.setVerticalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); jTextField6.setText(bundle.getString("NewJInternalFrame.jTextField6.text")); // NOI18N jTextField3.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextField3.setText(bundle.getString("NewJInternalFrame.jTextField3.text")); // NOI18N jTextField3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField3ActionPerformed(evt); } }); jTextField1.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextField1.setText(bundle.getString("NewJInternalFrame.jTextField1.text")); // NOI18N jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jTextField2.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextField2.setText(bundle.getString("NewJInternalFrame.jTextField2.text")); // NOI18N jTextField5.setText(bundle.getString("NewJInternalFrame.jTextField5.text")); // NOI18N jTextField5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField5ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1181, Short.MAX_VALUE) ); jPanel7Layout.setVerticalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 412, Short.MAX_VALUE) ); jScrollPane4.setViewportView(jPanel7); javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); jPanel9Layout.setVerticalGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 367, Short.MAX_VALUE) ); getContentPane().setLayout(new java.awt.CardLayout()); jPanel2.setBackground(java.awt.Color.white); jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT); jToggleButton3.setBackground(java.awt.Color.red); jToggleButton3.setText(bundle.getString("NewJInternalFrame.jToggleButton3.text")); // NOI18N jToggleButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton3ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton3.TabConstraints.tabTitle"), jToggleButton3); // NOI18N jToggleButton4.setBackground(java.awt.Color.white); jToggleButton4.setText(bundle.getString("NewJInternalFrame.jToggleButton4.text")); // NOI18N jToggleButton4.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jToggleButton4MouseClicked(evt); } }); jToggleButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton4ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton4.TabConstraints.tabTitle"), jToggleButton4); // NOI18N jToggleButton6.setText(bundle.getString("NewJInternalFrame.jToggleButton6.text")); // NOI18N jToggleButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton6ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton6.TabConstraints.tabTitle"), jToggleButton6); // NOI18N jToggleButton7.setText(bundle.getString("NewJInternalFrame.jToggleButton7.text")); // NOI18N jToggleButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton7ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton7.TabConstraints.tabTitle"), jToggleButton7); // NOI18N jToggleButton5.setText(bundle.getString("NewJInternalFrame.jToggleButton5.text")); // NOI18N jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton5.TabConstraints.tabTitle"), jToggleButton5); // NOI18N jToggleButton1.setText(bundle.getString("NewJInternalFrame.jToggleButton1.text")); // NOI18N jToggleButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton1ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton1.TabConstraints.tabTitle"), jToggleButton1); // NOI18N jToggleButton8.setText(bundle.getString("NewJInternalFrame.jToggleButton8.text")); // NOI18N jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton8.TabConstraints.tabTitle"), jToggleButton8); // NOI18N jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RAHULGANDHI.jpeg"))); // NOI18N jLabel3.setText(bundle.getString("NewJInternalFrame.jLabel3.text")); // NOI18N jLabel3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel3MouseClicked(evt); } }); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); // NOI18N jLabel1.setText(bundle.getString("NewJInternalFrame.jLabel1.text")); // NOI18N jLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel1MouseClicked(evt); } }); jTextPane3.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane3.setText(bundle.getString("NewJInternalFrame.jTextPane3.text")); // NOI18N jTextPane3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTextPane3MouseClicked(evt); } }); jScrollPane8.setViewportView(jTextPane3); jTextPane5.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane5.setText(bundle.getString("NewJInternalFrame.jTextPane5.text")); // NOI18N jTextPane5.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTextPane5MouseClicked(evt); } }); jScrollPane10.setViewportView(jTextPane5); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 369, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 367, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 356, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(268, Short.MAX_VALUE)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 453, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(10, 10, 10) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 404, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0)) ); jScrollPane1.setViewportView(jPanel3); jLabel7.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-menu-26.png")); // NOI18N jLabel7.setText(bundle.getString("NewJInternalFrame.jLabel7.text")); // NOI18N jLabel7.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel7MouseClicked(evt); } }); jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50(1).png")); // NOI18N jLabel25.setText(bundle.getString("NewJInternalFrame.jLabel25.text")); // NOI18N jLabel25.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel25MouseClicked(evt); } }); jLabel26.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-star-50.png")); // NOI18N jLabel26.setText(bundle.getString("NewJInternalFrame.jLabel26.text")); // NOI18N jLabel26.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel26MouseClicked(evt); } }); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); // NOI18N jLabel27.setText(bundle.getString("NewJInternalFrame.jLabel27.text")); // NOI18N jLabel27.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel27MouseClicked(evt); } }); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); // NOI18N jLabel28.setText(bundle.getString("NewJInternalFrame.jLabel28.text")); // NOI18N jLabel28.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel28MouseClicked(evt); } }); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); // NOI18N jLabel29.setText(bundle.getString("NewJInternalFrame.jLabel29.text")); // NOI18N jLabel29.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel29MouseClicked(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel25) .addGap(18, 18, 18) .addComponent(jLabel29) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel26) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 470, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))) ); getContentPane().add(jPanel2, "card2"); jLabel24.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-left-64(2).png")); // NOI18N jLabel24.setText(bundle.getString("NewJInternalFrame.jLabel24.text")); // NOI18N jLabel24.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel24MouseClicked(evt); } }); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); // NOI18N jLabel6.setText(bundle.getString("NewJInternalFrame.jLabel6.text")); // NOI18N jTextPane6.setFont(new java.awt.Font("Ubuntu", 1, 24)); // NOI18N jScrollPane11.setViewportView(jTextPane6); jScrollPane13.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jScrollPane13.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); jTextPane7.setText(bundle.getString("NewJInternalFrame.jTextPane7.text")); // NOI18N jScrollPane13.setViewportView(jTextPane7); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 392, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); getContentPane().add(jPanel6, "card3"); jLabel12.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-left-64.png")); // NOI18N jLabel12.setText(bundle.getString("NewJInternalFrame.jLabel12.text")); // NOI18N jLabel12.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel12MouseClicked(evt); } }); jLabel13.setText(bundle.getString("NewJInternalFrame.jLabel13.text")); // NOI18N jLabel14.setText(bundle.getString("NewJInternalFrame.jLabel14.text")); // NOI18N jLabel15.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-around-the-globe-64.png")); // NOI18N jLabel15.setText(bundle.getString("NewJInternalFrame.jLabel15.text")); // NOI18N jLabel16.setText(bundle.getString("NewJInternalFrame.jLabel16.text")); // NOI18N jLabel17.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-dancing-64.png")); // NOI18N jLabel17.setText(bundle.getString("NewJInternalFrame.jLabel17.text")); // NOI18N jLabel18.setText(bundle.getString("NewJInternalFrame.jLabel18.text")); // NOI18N jLabel19.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-trophy-64.png")); // NOI18N jLabel19.setText(bundle.getString("NewJInternalFrame.jLabel19.text")); // NOI18N jLabel20.setText(bundle.getString("NewJInternalFrame.jLabel20.text")); // NOI18N javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel16)) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(77, 77, 77) .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(48, 48, 48) .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(77, 77, 77)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(30, 30, 30) .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel16) .addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGap(392, 392, 392)) ); getContentPane().add(jPanel4, "card5"); jPanel5.setBackground(java.awt.Color.white); jScrollPane7.setViewportView(jTextPane2); jLabel23.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-left-64(2).png")); // NOI18N jLabel23.setText(bundle.getString("NewJInternalFrame.jLabel23.text")); // NOI18N jLabel23.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel23MouseClicked(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane7) .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 449, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(627, Short.MAX_VALUE)) ); getContentPane().add(jPanel5, "card6"); jPanel1.setBackground(java.awt.Color.white); jLabel8.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); // NOI18N jLabel8.setText(bundle.getString("NewJInternalFrame.jLabel8.text")); // NOI18N jLabel8.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel8MouseClicked(evt); } }); jLabel9.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-star-50.png")); // NOI18N jLabel9.setText(bundle.getString("NewJInternalFrame.jLabel9.text")); // NOI18N jLabel9.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel9MouseClicked(evt); } }); jLabel10.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); // NOI18N jLabel10.setText(bundle.getString("NewJInternalFrame.jLabel10.text")); // NOI18N jLabel10.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel10MouseClicked(evt); } }); jLabel11.setIcon(new javax.swing.ImageIcon("/home/sai/Pictures/2019/IMG_20190428_184750.jpg")); // NOI18N jLabel11.setText(bundle.getString("NewJInternalFrame.jLabel11.text")); // NOI18N jLabel22.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-help-64.png")); // NOI18N jLabel22.setText(bundle.getString("NewJInternalFrame.jLabel22.text")); // NOI18N jLabel22.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel22MouseClicked(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 168, Short.MAX_VALUE)) .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(315, Short.MAX_VALUE)) ); getContentPane().add(jPanel1, "card4"); jLabel2.setBackground(java.awt.Color.white); jLabel2.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-sad-40.png")); // NOI18N jLabel2.setText(bundle.getString("NewJInternalFrame.jLabel2.text")); // NOI18N jLabel30.setBackground(java.awt.Color.white); jLabel30.setText(bundle.getString("NewJInternalFrame.jLabel30.text")); // NOI18N jLabel31.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-left-64(2).png")); // NOI18N jLabel31.setText(bundle.getString("NewJInternalFrame.jLabel31.text")); // NOI18N jLabel31.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel31MouseClicked(evt); } }); jLabel32.setIcon(new javax.swing.ImageIcon("/home/sai/Pictures/index1.jpeg")); // NOI18N jLabel32.setText(bundle.getString("NewJInternalFrame.jLabel32.text")); // NOI18N javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); jPanel10Layout.setHorizontalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() .addComponent(jLabel31) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel10Layout.createSequentialGroup() .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(45, Short.MAX_VALUE)) ); jPanel10Layout.setVerticalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 206, Short.MAX_VALUE)) ); getContentPane().add(jPanel10, "card7"); pack(); }// </editor-fold>//GEN-END:initComponents private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField1ActionPerformed private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField3ActionPerformed private void jToggleButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton4ActionPerformed // TODO add your handling code here: jToggleButton6.setBackground(java.awt.Color.white); jToggleButton6.setBackground(java.awt.Color.white); jToggleButton4.setBackground(java.awt.Color.red); jToggleButton3.setBackground(java.awt.Color.white); jToggleButton7.setBackground(java.awt.Color.white); try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/DH1","user","password"); Statement st=con.createStatement(); String q= "select * from NewsContent i where i.Nid=800;"; ResultSet rs=st.executeQuery(q); if(rs.next()){ String a=rs.getString("NHeader"); //String b=rs.getString("NContent"); jTextPane5.setText(a); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/VBK-MILITANTDEN-BANGLADESH-REUTERS.jpeg"))); }} catch(ClassNotFoundException | SQLException e){ jLabel5.setText("Error while establishing connection"); System.out.println(e); } try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/DH1","user","password"); Statement st=con.createStatement(); String q= "select * from NewsContent i where i.Nid=801;"; ResultSet rs=st.executeQuery(q); if(rs.next()){ String a=rs.getString("NHeader"); //String b=rs.getString("NContent"); jTextPane3.setText(a); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SRILANKA.jpeg"))); }} catch(ClassNotFoundException | SQLException e){ jLabel5.setText("Error while establishing connection"); System.out.println(e); } }//GEN-LAST:event_jToggleButton4ActionPerformed private void jLabel7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel7MouseClicked jPanel1.setVisible(true); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_jLabel7MouseClicked private void jLabel8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel8MouseClicked jPanel2.setVisible(true); jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50(1).png")); jPanel1.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_jLabel8MouseClicked private void jLabel9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel9MouseClicked jPanel4.setVisible(true); jPanel2.setVisible(false); jPanel1.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel9MouseClicked private void jToggleButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton3ActionPerformed // TODO add your handling code here: // jTextPane5.setText("IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal "); //jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); //jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); //jLabel1.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/ROHITSHARMA.jpeg")); //jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); //jTextField2.setText("‘Nyay’ is diesel for Indian economy’s engine, says Rahul Gandhi "); //jLabel1.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/RAHULGANDHI.jpeg")); //jTextField3.setText(" BJP's Jadavpur candidate meets Trinamool's Birbhum leader on polling day, fuels speculation "); //jLabel1.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/Birbhum.jpeg")); jToggleButton7.setBackground(java.awt.Color.white); jToggleButton6.setBackground(java.awt.Color.white); jToggleButton6.setBackground(java.awt.Color.white); jToggleButton3.setBackground(java.awt.Color.red); jToggleButton4.setBackground(java.awt.Color.white); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); // NOI18N jTextPane5.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane5.setText("IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal"); }//GEN-LAST:event_jToggleButton3ActionPerformed private void jLabel12MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel12MouseClicked jPanel1.setVisible(true); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel12MouseClicked private void jLabel22MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel22MouseClicked jTextPane2.setText("for any queries contact us at hgadjs@gmail.com"); jPanel5.setVisible(true); jPanel1.setVisible(false); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel6.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_jLabel22MouseClicked private void jLabel23MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel23MouseClicked jPanel1.setVisible(true); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_jLabel23MouseClicked private void jLabel24MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel24MouseClicked jPanel1.setVisible(false); jPanel2.setVisible(true); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel24MouseClicked private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jToggleButton1ActionPerformed private void jLabel25MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel25MouseClicked jPanel2.setVisible(true); jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50(1).png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jPanel1.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel25MouseClicked private void jLabel26MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel26MouseClicked jPanel4.setVisible(true); jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jPanel2.setVisible(false); jPanel1.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel26MouseClicked private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField5ActionPerformed private void jTextPane5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextPane5MouseClicked // TODO add your handling code here: jPanel2.setVisible(false); jPanel6.setVisible(true); String a=jTextPane5.getText(); String b="IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal"; String c; c = "Does Exercise Help or Hurt Sleep?"; if(a.equals(b)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); String d; d = "Rohit admitted to the Level 1 offence 2.2 of the IPLs code of conduct and accepted the sanction. Mumbai Indians skipper Rohit Sharma has been fined 15 percent of his match fee for hitting the stumps with his bat after his dismissal during their IPL match against Kolkata Knight Riders in Kolkata.Expressing his frustration after being given out leg before wicket, the batsman hit the stumps with his bat at the non-strikers end, violating the Indian Premier League’s code of conduct at the Eden Gardens Sunday night.Mumbai Indians lost the high-scoring match by 34-runs, helping the hosts snap a six-match losing streak.Rohit admitted to the Level 1 offence 2.2 of the IPL’s code of conduct and accepted the sanction.“Mr. Sharma admitted to the Level 1 offence 2.2 of the IPL’s Code of Conduct and accepted the sanction,” an IPL release said.With MI chasing an imposing target of 233 to win and ensure a play-offs berth, Rohit looked in good touch before misreading a Harry Gurney delivery which hit his back leg.While the umpire had no hesitation in ruling the batsman out, Rohit opted for DRS, which upheld the field official’s decision.Rohit was earlier fined ₹12 lakh for his team’s slow over-rate against Kings XI Punjab"; jTextPane7.setText(d); } else if(a.equals(c)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/step0005.jpg"))); String d; d="Exercise is one of the best things you can do for your health. But how about for your sleep? It turns out, being active during the day can improve the sleep people get at night—with a few caveats. Learn more about the exercise-sleep relationship, including answers to these common questions.How does exercise influence sleeIndividuals who exercise regularly report better sleep than those who don’t, according to a National Sleep Foundation poll. Three-fourths of exercisers said their sleep quality was fairly good or very good over a two-week period, versus just over half or non-exercisers. Other research indicates that exercise increases total sleep time, delays REM sleep onset, and increases slow-wave sleep, all things that lead to greater sleep satisfaction.The reason for these sleep benefits is due in part to the fact that exercise increases the amount of adenosine in the body. Adenosine is a chemical that can cause drowsiness, increase body temperature, and improve circadian rhythm regulation, explains Shawn Youngstedt, PhD, a professor at Arizona State University. In addition, an increase in body temperature due to daytime exercise may lead to a decrease in body temperature at night, allowing people to experience deeper sleep cycles.\n" + "What time of day is best for exercise?For most people, the specific hour that they work out doesn’t matter—the main thing is that they make time to prioritize it. However, “in a minority of individuals, vigorous exercise ending two hours or closer to bedtime can have negative effects on sleep,” says Youngstedt. He adds that for strenuous exercise, the late afternoon might be the best time, allowing the body’s heart rate and other vital signs to return to normal before bed. For ongoing training (for a sporting event such as a race), morning might be preferable, if only to ensure you get the workout in before the day gets too busy.If you feel too amped up after exercising at night to sleep, try moving your workouts to earlier in the day. If night is the only time you have available to work out, you can also try a longer cool down and gentle stretching session after exercising. This will help let your body know it is time to wind down.Which type of exercise is best for sleep?In simplest terms, the best type of exercise is the type of exercise you enjoy enough to stick with it and make it a regular part of your routine. “Sleep-promoting effects have been found for both aerobic exercise and resistance exercise,” says Youngstedt. In other words, either spin class or lifting weights can help you sleep well, as long as you do it consistently.How much exercise do you need for better sleep?There is no magic number (and the amount will vary depending on factors such as age and fitness level), but it’s wise to aim for about 150 minutes of moderate-intensity aerobic exercise (such as brisk walking) every week, or about 30 minutes, five days a week. Alternately, you can aim for 75 minutes of vigorous exercise (running, cycling) each week, to get your heart rate pumping.If finding 30 minutes in your schedule seems impossible, know that it’s not just about the 30 minutes you spend in the gym that counts: Little things you do all day long can add up, from taking the stairs to walking instead of driving when you run local errands. Try to spend fewer minutes sitting during the day. The less sedentary you are, the better you’ll sleep at night"; jTextPane7.setText(d); } else { // jTextPane6.setText(a); //jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SRILANKA.jpeg"))); //String d="Covering the face in a manner which prevents identification will be banned from today.A statement from the President’s Media Division on Sunday said covering of the face with veils, in a manner that prevents identification of a person, will be banned from Monday under emergency regulations.Meanwhile, the father and two brothers of Zahran Hashim, who is believed to have led the Easter attacks in Sri Lanka, were killed in Friday’s overnight gun battle between troops and suspects in the eastern Ampara district, the police said on Sunday.Hashim was earlier identified as one of the two suicide bombers who blew themselves up at Shangri-La Hotel in Colombo.Wife, daughter rescuedFurther, a woman and a four-year-old child, rescued from a safe house stormed in the search operation on Saturday, have been identified as the wife and daughter of Hashim, police sources told The Hindu."; //jTextPane7.setText(d); try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/DH1","user","password"); Statement st=con.createStatement(); String q= "select * from NewsContent i where i.Nid=800;"; ResultSet rs=st.executeQuery(q); if(rs.next()){ String l=rs.getString("NHeader"); String s=rs.getString("NContent"); jTextPane6.setText(l); //jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/VBK-MILITANTDEN-BANGLADESH-REUTERS.jpeg"))); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SRILANKA.jpeg"))); jTextPane7.setText(s); }} catch(ClassNotFoundException | SQLException e){ jLabel5.setText("Error while establishing connection"); System.out.println(e); } } }//GEN-LAST:event_jTextPane5MouseClicked private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked // TODO add your handling code here: jPanel2.setVisible(false); jPanel6.setVisible(true); String a=jTextPane5.getText(); String b="IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal"; String c; c = "Does Exercise Help or Hurt Sleep?"; if(a.equals(b)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); String d; d = "Rohit admitted to the Level 1 offence 2.2 of the IPLs code of conduct and accepted the sanction. Mumbai Indians skipper Rohit Sharma has been fined 15 percent of his match fee for hitting the stumps with his bat after his dismissal during their IPL match against Kolkata Knight Riders in Kolkata.Expressing his frustration after being given out leg before wicket, the batsman hit the stumps with his bat at the non-strikers end, violating the Indian Premier League’s code of conduct at the Eden Gardens Sunday night.Mumbai Indians lost the high-scoring match by 34-runs, helping the hosts snap a six-match losing streak.Rohit admitted to the Level 1 offence 2.2 of the IPL’s code of conduct and accepted the sanction.“Mr. Sharma admitted to the Level 1 offence 2.2 of the IPL’s Code of Conduct and accepted the sanction,” an IPL release said.With MI chasing an imposing target of 233 to win and ensure a play-offs berth, Rohit looked in good touch before misreading a Harry Gurney delivery which hit his back leg.While the umpire had no hesitation in ruling the batsman out, Rohit opted for DRS, which upheld the field official’s decision.Rohit was earlier fined ₹12 lakh for his team’s slow over-rate against Kings XI Punjab"; jTextPane7.setText(d); } else if(a.equals(c)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/step0005.jpg"))); String d; d="Exercise is one of the best things you can do for your health. But how about for your sleep? It turns out, being active during the day can improve the sleep people get at night—with a few caveats. Learn more about the exercise-sleep relationship, including answers to these common questions.How does exercise influence sleeIndividuals who exercise regularly report better sleep than those who don’t, according to a National Sleep Foundation poll. Three-fourths of exercisers said their sleep quality was fairly good or very good over a two-week period, versus just over half or non-exercisers. Other research indicates that exercise increases total sleep time, delays REM sleep onset, and increases slow-wave sleep, all things that lead to greater sleep satisfaction.The reason for these sleep benefits is due in part to the fact that exercise increases the amount of adenosine in the body. Adenosine is a chemical that can cause drowsiness, increase body temperature, and improve circadian rhythm regulation, explains Shawn Youngstedt, PhD, a professor at Arizona State University. In addition, an increase in body temperature due to daytime exercise may lead to a decrease in body temperature at night, allowing people to experience deeper sleep cycles.\n" + "What time of day is best for exercise?For most people, the specific hour that they work out doesn’t matter—the main thing is that they make time to prioritize it. However, “in a minority of individuals, vigorous exercise ending two hours or closer to bedtime can have negative effects on sleep,” says Youngstedt. He adds that for strenuous exercise, the late afternoon might be the best time, allowing the body’s heart rate and other vital signs to return to normal before bed. For ongoing training (for a sporting event such as a race), morning might be preferable, if only to ensure you get the workout in before the day gets too busy.If you feel too amped up after exercising at night to sleep, try moving your workouts to earlier in the day. If night is the only time you have available to work out, you can also try a longer cool down and gentle stretching session after exercising. This will help let your body know it is time to wind down.Which type of exercise is best for sleep?In simplest terms, the best type of exercise is the type of exercise you enjoy enough to stick with it and make it a regular part of your routine. “Sleep-promoting effects have been found for both aerobic exercise and resistance exercise,” says Youngstedt. In other words, either spin class or lifting weights can help you sleep well, as long as you do it consistently.How much exercise do you need for better sleep?There is no magic number (and the amount will vary depending on factors such as age and fitness level), but it’s wise to aim for about 150 minutes of moderate-intensity aerobic exercise (such as brisk walking) every week, or about 30 minutes, five days a week. Alternately, you can aim for 75 minutes of vigorous exercise (running, cycling) each week, to get your heart rate pumping.If finding 30 minutes in your schedule seems impossible, know that it’s not just about the 30 minutes you spend in the gym that counts: Little things you do all day long can add up, from taking the stairs to walking instead of driving when you run local errands. Try to spend fewer minutes sitting during the day. The less sedentary you are, the better you’ll sleep at night"; jTextPane7.setText(d); } else { jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SRILANKA.jpeg"))); String d="Covering the face in a manner which prevents identification will be banned from today.A statement from the President’s Media Division on Sunday said covering of the face with veils, in a manner that prevents identification of a person, will be banned from Monday under emergency regulations.Meanwhile, the father and two brothers of Zahran Hashim, who is believed to have led the Easter attacks in Sri Lanka, were killed in Friday’s overnight gun battle between troops and suspects in the eastern Ampara district, the police said on Sunday.Hashim was earlier identified as one of the two suicide bombers who blew themselves up at Shangri-La Hotel in Colombo.Wife, daughter rescuedFurther, a woman and a four-year-old child, rescued from a safe house stormed in the search operation on Saturday, have been identified as the wife and daughter of Hashim, police sources told The Hindu."; jTextPane7.setText(d); } }//GEN-LAST:event_jLabel1MouseClicked private void jToggleButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton6ActionPerformed // TODO add your handling code here: jToggleButton6.setBackground(java.awt.Color.white); jToggleButton6.setBackground(java.awt.Color.red); jToggleButton3.setBackground(java.awt.Color.white); jToggleButton7.setBackground(java.awt.Color.white); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); // NOI18N jTextPane5.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jToggleButton4.setBackground(java.awt.Color.white); jTextPane5.setText("IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal"); jTextPane3.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane3.setText("La Liga | Real Madrid sink to 10th league loss at hands of lowly Rayo Vallecano "); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SOCCER-SPAIN-RAY-MADTHNAK.jpeg"))); }//GEN-LAST:event_jToggleButton6ActionPerformed private void jTextPane3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextPane3MouseClicked // TODO add your handling code here: jPanel2.setVisible(false); jPanel6.setVisible(true); String a=jTextPane3.getText(); String b="La Liga | Real Madrid sink to 10th league loss at hands of lowly Rayo Vallecano "; String c; c="Two suspected militants blow themselves up during raid by Bangladesh’s anti-terrorism unit "; if(a.equals(b)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SOCCER-SPAIN-RAY-MADTHNAK.jpeg"))); String d; //d = "Rohit admitted to the Level 1 offence 2.2 of the IPLs code of conduct and accepted the sanction. Mumbai Indians skipper Rohit Sharma has been fined 15 percent of his match fee for hitting the stumps with his bat after his dismissal during their IPL match against Kolkata Knight Riders in Kolkata.Expressing his frustration after being given out leg before wicket, the batsman hit the stumps with his bat at the non-strikers end, violating the Indian Premier League’s code of conduct at the Eden Gardens Sunday night.Mumbai Indians lost the high-scoring match by 34-runs, helping the hosts snap a six-match losing streak.Rohit admitted to the Level 1 offence 2.2 of the IPL’s code of conduct and accepted the sanction.“Mr. Sharma admitted to the Level 1 offence 2.2 of the IPL’s Code of Conduct and accepted the sanction,” an IPL release said.With MI chasing an imposing target of 233 to win and ensure a play-offs berth, Rohit looked in good touch before misreading a Harry Gurney delivery which hit his back leg.While the umpire had no hesitation in ruling the batsman out, Rohit opted for DRS, which upheld the field official’s decision.Rohit was earlier fined ₹12 lakh for his team’s slow over-rate against Kings XI Punjab"; d=" 'We did nothing today on any level, from the first minute until the last'Zidane told reporters.A toothless and haggard Real Madrid slumped to a humiliating 10th Liga defeat of the season on Sunday as they lost 1-0 at struggling neighbours Rayo Vallecano, who began the weekend bottom of the standings but dominated the game.The only goal came when Adri Embarba sent Real goalkeeper Thibaut Courtois the wrong way with a penalty midway through the first half, giving Rayo a deserved lead after an ambitious start in front of the home crowd.The spot kick, given for a foul by Jesus Vallejo on Javi Guerra, was awarded following a VAR review after the referee had waved play on and Gareth Bale had narrowly failed to score as Madrid counter-attacked.Real later had a goal from Mariano ruled out for a clear offside, one of the rare occasions in the game in which Zinedine Zidane's side troubled the hosts, who looked far likelier to score again than concede a goal to Madrid's toothless attack.'We did nothing today on any level, from the first minute until the last,'Zidane told reporters.'Sometimes you are not able to score but today we didn't even create chances, we did nothing well. We have to all be angry with our performance. I am angry because we gave an awful image of ourselves.'Madrid are third in the standings on 65 points after 35 games, nine behind second-placed Atletico Madrid and 18 adrift of champions Barcelona, and look destined to finish third for the second season in a row.'Yes we can'Rayo moved above SD Huesca to 19th on 31 points and are still six away from escaping the relegation zone, but their supporters showed they believe they can still avoid the drop, chanting “Yes we can” when the final whistle blew.It was Rayo's first win over their illustrious neighbours since 1997, when Fabio Capello was in charge of Madrid.The build up to the game was dominated by Real's refusal to allow Rayo's top scorer Raul de Tomas, who is on loan from Zidane's side and prevented from facing his parent club due to a clause in his contract, to turn out for the home side.Real were also without their top scorer as Karim Benzema, who had netted 10 times in his last eight games, was missing with a hamstring injury, while captain Sergio Ramos was also out.\n" + "Madrid's attack was lead by the inexperienced Mariano and out-of-form Bale and, despite the huge gap in riches between the two sides, Rayo always looked in control and were well worthy of the victory.\n" + "'We didn't suffer much but that shouldn't take anything away from us,' said Rayo coach Paco Jemez, who had lost his previous eight games against Madrid in his previous spell with the club, including a harrowing 10-2 defeat in 2015.'We played a spectacular game in every aspect. I dreamt once that I would never beat Real Madrid in my entire life but now we have done it I can die happy.'"; jTextPane7.setText(d); } else if(a.equals(c)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/VBK-MILITANTDEN-BANGLADESH-REUTERS.jpeg"))); String d; d="Two suspected militants blow themselves up during raid by Bangladesh’s anti-terrorism unit | NULL | Two suspected militants were killed on Monday after they blew themselves up during a raid at their hideout by the Bangladesh’s elite anti-terrorism unit in Mohammadpur area in Dhaka, officials said.The Rapid Action Battalion (RAB) surrounded a single-storey tin-shed house in Mohammadpur’s Basila area, on the outskirts of Dhaka, following a tip off.The personnel of the elite anti-crime and anti-terrorism unit met with gunfire, followed by a powerful blast, they said.“We, overnight, laid a siege to the house. They [suspected militants] staged a blast early on Monday in which at least two of them were killed,” a RAB spokesman said.He said that those living in the neighbourhood were evacuated ahead of the raid.According to witnesses, the blast was so powerful that it shook the whole area. A fire also broke out following the blast and fire-fighters were called in to douse the blaze.RAB chief Benazir Ahmed said that at least two (suspected) militants have been killed in the blast.In a nationwide raids since then, the security forces have killed around 100 terrorists and detained several others."; jTextPane7.setText(d); } else { jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RAHULGANDHI.jpeg"))); //String d="Covering the face in a manner which prevents identification will be banned from today.A statement from the President’s Media Division on Sunday said covering of the face with veils, in a manner that prevents identification of a person, will be banned from Monday under emergency regulations.Meanwhile, the father and two brothers of Zahran Hashim, who is believed to have led the Easter attacks in Sri Lanka, were killed in Friday’s overnight gun battle between troops and suspects in the eastern Ampara district, the police said on Sunday.Hashim was earlier identified as one of the two suicide bombers who blew themselves up at Shangri-La Hotel in Colombo.Wife, daughter rescuedFurther, a woman and a four-year-old child, rescued from a safe house stormed in the search operation on Saturday, have been identified as the wife and daughter of Hashim, police sources told The Hindu."; String d="A 28-page formal response from Congress president Rahul Gandhi to a notice on a criminal contempt plea expressed “regret” for juxtaposing a political slogan ‘ Chowkidar chor hai’ with Supreme Court proceedings in a moment of euphoria, but there was no word of apology in it.He also said the Rafale deal was a 'tainted transaction' and a 'gross, brazen abuse of power' by the 'BJP government led by Prime Minister Narendra Modi'. He said it deserved to be investigated by a Joint Parliamentary Committee.He made his position clear a day before the court is to hear the Rafale review petitions along with this contempt plea. It is to be seen whether the hearing takes place on Tuesday as the government on Monday sought more time to respond to the review petitions.Mr. Gandhi’s counter-affidavit was identical to an earlier ‘explanation’ with regard to the contempt plea. It had also expressed “regret” without apologising. In his counter-affidavit, he reiterated that the comment was made with rhetorical flourish in the heat of campaigning."; jTextPane7.setText(d); } }//GEN-LAST:event_jTextPane3MouseClicked private void jLabel3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel3MouseClicked // TODO add your handling code here: // TODO add your handling code here: jPanel2.setVisible(false); jPanel6.setVisible(true); String a=jTextPane3.getText(); String b="La Liga | Real Madrid sink to 10th league loss at hands of lowly Rayo Vallecano "; String c; c="Two suspected militants blow themselves up during raid by Bangladesh’s anti-terrorism unit "; if(a.equals(b)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SOCCER-SPAIN-RAY-MADTHNAK.jpeg"))); String d; //d = "Rohit admitted to the Level 1 offence 2.2 of the IPLs code of conduct and accepted the sanction. Mumbai Indians skipper Rohit Sharma has been fined 15 percent of his match fee for hitting the stumps with his bat after his dismissal during their IPL match against Kolkata Knight Riders in Kolkata.Expressing his frustration after being given out leg before wicket, the batsman hit the stumps with his bat at the non-strikers end, violating the Indian Premier League’s code of conduct at the Eden Gardens Sunday night.Mumbai Indians lost the high-scoring match by 34-runs, helping the hosts snap a six-match losing streak.Rohit admitted to the Level 1 offence 2.2 of the IPL’s code of conduct and accepted the sanction.“Mr. Sharma admitted to the Level 1 offence 2.2 of the IPL’s Code of Conduct and accepted the sanction,” an IPL release said.With MI chasing an imposing target of 233 to win and ensure a play-offs berth, Rohit looked in good touch before misreading a Harry Gurney delivery which hit his back leg.While the umpire had no hesitation in ruling the batsman out, Rohit opted for DRS, which upheld the field official’s decision.Rohit was earlier fined ₹12 lakh for his team’s slow over-rate against Kings XI Punjab"; d=" 'We did nothing today on any level, from the first minute until the last'Zidane told reporters.A toothless and haggard Real Madrid slumped to a humiliating 10th Liga defeat of the season on Sunday as they lost 1-0 at struggling neighbours Rayo Vallecano, who began the weekend bottom of the standings but dominated the game.The only goal came when Adri Embarba sent Real goalkeeper Thibaut Courtois the wrong way with a penalty midway through the first half, giving Rayo a deserved lead after an ambitious start in front of the home crowd.The spot kick, given for a foul by Jesus Vallejo on Javi Guerra, was awarded following a VAR review after the referee had waved play on and Gareth Bale had narrowly failed to score as Madrid counter-attacked.Real later had a goal from Mariano ruled out for a clear offside, one of the rare occasions in the game in which Zinedine Zidane's side troubled the hosts, who looked far likelier to score again than concede a goal to Madrid's toothless attack.'We did nothing today on any level, from the first minute until the last,'Zidane told reporters.'Sometimes you are not able to score but today we didn't even create chances, we did nothing well. We have to all be angry with our performance. I am angry because we gave an awful image of ourselves.'Madrid are third in the standings on 65 points after 35 games, nine behind second-placed Atletico Madrid and 18 adrift of champions Barcelona, and look destined to finish third for the second season in a row.'Yes we can'Rayo moved above SD Huesca to 19th on 31 points and are still six away from escaping the relegation zone, but their supporters showed they believe they can still avoid the drop, chanting “Yes we can” when the final whistle blew.It was Rayo's first win over their illustrious neighbours since 1997, when Fabio Capello was in charge of Madrid.The build up to the game was dominated by Real's refusal to allow Rayo's top scorer Raul de Tomas, who is on loan from Zidane's side and prevented from facing his parent club due to a clause in his contract, to turn out for the home side.Real were also without their top scorer as Karim Benzema, who had netted 10 times in his last eight games, was missing with a hamstring injury, while captain Sergio Ramos was also out.\n" + "Madrid's attack was lead by the inexperienced Mariano and out-of-form Bale and, despite the huge gap in riches between the two sides, Rayo always looked in control and were well worthy of the victory.\n" + "'We didn't suffer much but that shouldn't take anything away from us,' said Rayo coach Paco Jemez, who had lost his previous eight games against Madrid in his previous spell with the club, including a harrowing 10-2 defeat in 2015.'We played a spectacular game in every aspect. I dreamt once that I would never beat Real Madrid in my entire life but now we have done it I can die happy.'"; jTextPane7.setText(d); } else if(a.equals(c)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/VBK-MILITANTDEN-BANGLADESH-REUTERS.jpeg"))); String d; d="Two suspected militants blow themselves up during raid by Bangladesh’s anti-terrorism unit | NULL | Two suspected militants were killed on Monday after they blew themselves up during a raid at their hideout by the Bangladesh’s elite anti-terrorism unit in Mohammadpur area in Dhaka, officials said.The Rapid Action Battalion (RAB) surrounded a single-storey tin-shed house in Mohammadpur’s Basila area, on the outskirts of Dhaka, following a tip off.The personnel of the elite anti-crime and anti-terrorism unit met with gunfire, followed by a powerful blast, they said.“We, overnight, laid a siege to the house. They [suspected militants] staged a blast early on Monday in which at least two of them were killed,” a RAB spokesman said.He said that those living in the neighbourhood were evacuated ahead of the raid.According to witnesses, the blast was so powerful that it shook the whole area. A fire also broke out following the blast and fire-fighters were called in to douse the blaze.RAB chief Benazir Ahmed said that at least two (suspected) militants have been killed in the blast.In a nationwide raids since then, the security forces have killed around 100 terrorists and detained several others."; jTextPane7.setText(d); } else { jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RAHULGANDHI.jpeg"))); //String d="Covering the face in a manner which prevents identification will be banned from today.A statement from the President’s Media Division on Sunday said covering of the face with veils, in a manner that prevents identification of a person, will be banned from Monday under emergency regulations.Meanwhile, the father and two brothers of Zahran Hashim, who is believed to have led the Easter attacks in Sri Lanka, were killed in Friday’s overnight gun battle between troops and suspects in the eastern Ampara district, the police said on Sunday.Hashim was earlier identified as one of the two suicide bombers who blew themselves up at Shangri-La Hotel in Colombo.Wife, daughter rescuedFurther, a woman and a four-year-old child, rescued from a safe house stormed in the search operation on Saturday, have been identified as the wife and daughter of Hashim, police sources told The Hindu."; String d="A 28-page formal response from Congress president Rahul Gandhi to a notice on a criminal contempt plea expressed “regret” for juxtaposing a political slogan ‘ Chowkidar chor hai’ with Supreme Court proceedings in a moment of euphoria, but there was no word of apology in it.He also said the Rafale deal was a 'tainted transaction' and a 'gross, brazen abuse of power' by the 'BJP government led by Prime Minister Narendra Modi'. He said it deserved to be investigated by a Joint Parliamentary Committee.He made his position clear a day before the court is to hear the Rafale review petitions along with this contempt plea. It is to be seen whether the hearing takes place on Tuesday as the government on Monday sought more time to respond to the review petitions.Mr. Gandhi’s counter-affidavit was identical to an earlier ‘explanation’ with regard to the contempt plea. It had also expressed “regret” without apologising. In his counter-affidavit, he reiterated that the comment was made with rhetorical flourish in the heat of campaigning."; jTextPane7.setText(d); } }//GEN-LAST:event_jLabel3MouseClicked private void jToggleButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton7ActionPerformed // TODO add your handling code here: jToggleButton7.setBackground(java.awt.Color.red); jToggleButton6.setBackground(java.awt.Color.white); jToggleButton3.setBackground(java.awt.Color.white); jToggleButton4.setBackground(java.awt.Color.white); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/step0005.jpg"))); // NOI18N jTextPane5.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane5.setText("Does Exercise Help or Hurt Sleep?"); jTextPane3.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane3.setText("La Liga | Real Madrid sink to 10th league loss at hands of lowly Rayo Vallecano "); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SOCCER-SPAIN-RAY-MADTHNAK.jpeg"))); }//GEN-LAST:event_jToggleButton7ActionPerformed private void jLabel29MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel29MouseClicked // TODO add your handling code here: jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64(1).png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jPanel10.setVisible(true); jPanel1.setVisible(false); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); }//GEN-LAST:event_jLabel29MouseClicked private void jLabel27MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel27MouseClicked // TODO add your handling code here: jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64(1).png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); }//GEN-LAST:event_jLabel27MouseClicked private void jLabel28MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel28MouseClicked // TODO add your handling code here: jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100(1).png")); }//GEN-LAST:event_jLabel28MouseClicked private void jToggleButton4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jToggleButton4MouseClicked // TODO add your handling code here: }//GEN-LAST:event_jToggleButton4MouseClicked private void jLabel31MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel31MouseClicked // TODO add your handling code here: jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50(1).png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jPanel10.setVisible(false); jPanel1.setVisible(false); jPanel2.setVisible(true); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); }//GEN-LAST:event_jLabel31MouseClicked private void jLabel10MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel10MouseClicked // TODO add your handling code here: jPanel10.setVisible(true); jPanel1.setVisible(false); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); }//GEN-LAST:event_jLabel10MouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables public javax.swing.JEditorPane jEditorPane1; public javax.swing.JLabel jLabel1; public javax.swing.JLabel jLabel10; public javax.swing.JLabel jLabel11; public javax.swing.JLabel jLabel12; public javax.swing.JLabel jLabel13; public javax.swing.JLabel jLabel14; public javax.swing.JLabel jLabel15; public javax.swing.JLabel jLabel16; public javax.swing.JLabel jLabel17; public javax.swing.JLabel jLabel18; public javax.swing.JLabel jLabel19; public javax.swing.JLabel jLabel2; public javax.swing.JLabel jLabel20; public javax.swing.JLabel jLabel21; public javax.swing.JLabel jLabel22; public javax.swing.JLabel jLabel23; public javax.swing.JLabel jLabel24; public javax.swing.JLabel jLabel25; public javax.swing.JLabel jLabel26; public javax.swing.JLabel jLabel27; public javax.swing.JLabel jLabel28; public javax.swing.JLabel jLabel29; public javax.swing.JLabel jLabel3; public javax.swing.JLabel jLabel30; public javax.swing.JLabel jLabel31; public javax.swing.JLabel jLabel32; public javax.swing.JLabel jLabel4; public javax.swing.JLabel jLabel5; public javax.swing.JLabel jLabel6; public javax.swing.JLabel jLabel7; public javax.swing.JLabel jLabel8; public javax.swing.JLabel jLabel9; public javax.swing.JMenu jMenu1; public javax.swing.JPanel jPanel1; public javax.swing.JPanel jPanel10; public javax.swing.JPanel jPanel2; public javax.swing.JPanel jPanel3; public javax.swing.JPanel jPanel4; public javax.swing.JPanel jPanel5; public javax.swing.JPanel jPanel6; public javax.swing.JPanel jPanel7; public javax.swing.JPanel jPanel8; public javax.swing.JPanel jPanel9; public javax.swing.JScrollPane jScrollPane1; public javax.swing.JScrollPane jScrollPane10; public javax.swing.JScrollPane jScrollPane11; public javax.swing.JScrollPane jScrollPane13; public javax.swing.JScrollPane jScrollPane3; public javax.swing.JScrollPane jScrollPane4; public javax.swing.JScrollPane jScrollPane5; public javax.swing.JScrollPane jScrollPane6; public javax.swing.JScrollPane jScrollPane7; public javax.swing.JScrollPane jScrollPane8; public javax.swing.JTabbedPane jTabbedPane1; public javax.swing.JTextArea jTextArea2; public javax.swing.JTextField jTextField1; public javax.swing.JTextField jTextField2; public javax.swing.JTextField jTextField3; public javax.swing.JTextField jTextField5; public javax.swing.JTextField jTextField6; public javax.swing.JTextPane jTextPane1; public javax.swing.JTextPane jTextPane2; public javax.swing.JTextPane jTextPane3; public javax.swing.JTextPane jTextPane5; public javax.swing.JTextPane jTextPane6; public javax.swing.JTextPane jTextPane7; public javax.swing.JToggleButton jToggleButton1; public javax.swing.JToggleButton jToggleButton3; public javax.swing.JToggleButton jToggleButton4; public javax.swing.JToggleButton jToggleButton5; public javax.swing.JToggleButton jToggleButton6; public javax.swing.JToggleButton jToggleButton7; public javax.swing.JToggleButton jToggleButton8; public javax.swing.JToggleButton jToggleButton9; public java.awt.TextArea textArea1; // End of variables declaration//GEN-END:variables
[ "" ]
0bffa7dba36af31b8b8b82afe808a7a046f51147
8c8e721bb3dca431bd8e29f0f6d28afa7410184e
/src/test/java/com/application/pages/EmailPage.java
7390d081ef50e7e36166785be8a32e15442a0123
[]
no_license
qashack/numberz
888ae56c63d9dced9c90e934ff0dfddfded2840b
8021a9640539432c9292cbc565dd6cd8ffe96467
refs/heads/master
2021-05-07T15:46:34.997058
2017-12-20T12:28:12
2017-12-20T12:28:12
108,539,592
0
0
null
null
null
null
UTF-8
Java
false
false
3,763
java
package com.application.pages; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import org.testng.Assert; import com.application.libraries.GenericUtils; public class EmailPage extends TaxInvoicePage { WebDriver driver; @FindBy(xpath = "//div[@class='modal-body']//button[text()='Send']") private WebElement emailSendButton; @FindBy(xpath = "//div[@class='modal-body']//button[text()='Cancel']") private WebElement emailcancelButton; @FindBy(xpath = "//div[@class='modal-body']//input[@placeholder='Email ID']") private WebElement emailtoField1; @FindBy(xpath = "//div[@class='modal-body']//input[@placeholder='Use comma(,) to add multiple emails']") private WebElement emailccField1; @FindBy(xpath = "//div[@class='modal-body']//input[@placeholder='Subject']") private WebElement emailSubjectField; @FindBy(xpath = "//body[@id='tinymce']/p") private WebElement emailBody; @FindBy(xpath = "(//div[@class='modal-body']//input[@type='checkbox'])[1]") private WebElement emailGetFinance; @FindBy(xpath = "(//div[@class='modal-body']//input[@type='checkbox'])[2]") private WebElement emailPayNow; public EmailPage(WebDriver driver) { super(driver); this.driver = driver; PageFactory.initElements(driver, this); } public EmailPage addEmailTo(String emailto) { emailtoField1.clear(); emailtoField1.sendKeys(emailto); return this; } public EmailPage addEmailCc(String emailcc) { emailccField1.clear(); emailccField1.sendKeys(emailcc); return this; } public EmailPage verifyEmailTocc() { String emailTo = emailtoField1.getAttribute("value"); String emailcc = emailccField1.getAttribute("value"); System.out.println("email to" + emailTo + ":emailcc" + emailcc); int et = emailTo.length(); int et1 = emailcc.length(); System.out.println("t and t1" + et + " :" + et1); if ((et1 == 0) || (et == 0)) { Assert.assertFalse(true, "Email to and cc not populated Automatically"); } else { Assert.assertTrue(true); } return this; } public EmailPage verifyEmailSubject(String data) { String subject = emailSubjectField.getAttribute("value"); if (subject.contains(data)) { Assert.assertFalse(true, "Subject not populated properly"); } else { Assert.assertTrue(true); } return this; } public EmailPage verifyEmailBody(String data) { driver.switchTo().frame("react-tinymce-0_ifr"); String subject = emailBody.getText(); if (subject.contains(data)) { Assert.assertFalse(true, "Subject not populated properly"); } else { Assert.assertTrue(true); } return this; } public EmailPage clickOnGetFinance() { GenericUtils.delay(2); if (!emailGetFinance.isSelected()) { emailGetFinance.click(); } return this; } public EmailPage verifyGetFianance(int k) { System.out.println("k is" + k); if (k > 0) { } else { Assert.fail("Get fianance is not in recieved email"); } return this; } public EmailPage setEmailTo(String email_to) { emailtoField1.clear(); emailtoField1.sendKeys(email_to); return this; } public EmailPage clickOnPayNow() { if (!emailPayNow.isSelected()) { emailPayNow.click(); } return this; } public EmailPage verifyPaynowOptions() { GenericUtils.delay(2); int op1 = driver.findElements(By.id("rzp-key-number")).size(); int op2 = driver.findElements(By.id("rzp-secret-number")).size(); int op0 = driver.findElements(By.xpath("//label[text()='Select Payment Method']")).size(); if (op1 == 0 || op0 == 0 || op2 == 0) { Assert.fail("Pay now all options are not displayed"); } else { Assert.assertTrue(true); } return this; } }
[ "chandrashekar@qashack.com" ]
chandrashekar@qashack.com
d641dbc199adcedc5c412dfc72b395ebf3618000
2f3824f2b7478e222b8b90b9d8ebbf1892b39a68
/app/src/main/java/com/vignesh/healthcare/validator/MedicineValidator.java
4e87ba06bb4971317bdd84e5634e02964296b655
[]
no_license
BVigneshwar/HealthCare
2bd4269619382965e2db5e0d953cf60e487983a0
0449157bd8b875113658b0f6483a82b37474bc9e
refs/heads/master
2021-02-08T09:04:32.670876
2020-06-22T13:34:35
2020-06-22T13:34:35
244,133,602
0
0
null
null
null
null
UTF-8
Java
false
false
1,736
java
package com.vignesh.healthcare.validator; import com.vignesh.healthcare.R; import com.vignesh.healthcare.entity.MedicineEntity; import java.util.LinkedList; import java.util.List; public class MedicineValidator { MedicineEntity medicineEntity; List<Integer> error_list; public MedicineValidator(MedicineEntity medicineEntity){ this.medicineEntity = medicineEntity; error_list = new LinkedList<>(); } public List<Integer> getError_list(){ return error_list; } public boolean validate_and_SetName(String value){ if(value == null || value.equals("")){ error_list.add(R.string.name); return false; } medicineEntity.setName(value); return true; } public boolean validate_and_SetDescription(String value){ medicineEntity.setDescription(value); return true; } public boolean validate_and_SetDuration(String value, String unit){ if(value == null || value.equals("") || unit == null || unit.equals("")){ error_list.add(R.string.duration); return false; } medicineEntity.setDuration(value+" "+unit); return true; } public boolean validate_and_SetMorning(boolean value){ medicineEntity.setMorning(value); return true; } public boolean validate_and_SetAfternoon(boolean value){ medicineEntity.setAfternoon(value); return true; } public boolean validate_and_SetNight(boolean value){ medicineEntity.setNight(value); return true; } public boolean validate_and_SetAfterMeal(boolean value){ medicineEntity.setAfter_meal(value); return true; } }
[ "bvigneshwar643@gmail.com" ]
bvigneshwar643@gmail.com
c6e5d62760a4ab3a3e024d0f73233a7d41d13035
013025053382ff1d1b68b89cc497e05d462aa0be
/hw3/gnuplot/src/main/java/SplitResult.java
ddeda47c9f05f8b1f74a125f094e3e9d2231eaec
[]
no_license
sanha/CM2016
fae5d5cdc0f02bb5970ef8ae505684b8afc7d511
3955602c3c0cb7e9064dbd54b1128719427ef70f
refs/heads/master
2021-01-24T09:16:13.753009
2016-12-15T15:00:14
2016-12-15T15:00:14
69,885,048
0
0
null
2016-12-15T15:00:14
2016-10-03T15:40:53
C++
UTF-8
Java
false
false
3,063
java
import java.io.FileInputStream; import java.io.FileOutputStream; public final class SplitResult { final static int scale = 100; public static void main(final String[] args) throws Exception { splitResult(); } private static void splitResult() { final String filePath = "ideal/L/"; final String targetName = "AnalL"; final boolean LOrW = true; final FileInputStream fileStream; final FileOutputStream outputStream1; final FileOutputStream outputStream2; final FileOutputStream outputStream3; final FileOutputStream outputStream4; FileOutputStream outputStream5 = null; try { fileStream = new FileInputStream(filePath + "ideal" + targetName + ".txt"); outputStream1 = new FileOutputStream(filePath + targetName + "1.txt"); outputStream2 = new FileOutputStream(filePath + targetName + "2.txt"); outputStream3 = new FileOutputStream(filePath + targetName + "3.txt"); outputStream4 = new FileOutputStream(filePath + targetName + "4.txt"); if (LOrW) { outputStream5 = new FileOutputStream(filePath + targetName + ".txt"); } byte[ ] readBuffer = new byte[fileStream.available()]; while (fileStream.read(readBuffer) != -1); final String result = new String(readBuffer); final String[] array = result.split("\n"); for(int i = 0; i < array.length; i++) { final String[] tmpStr = array[i].trim().replaceAll(" + ", " ").split(" "); outputStream1.write((tmpStr[0] + " " + tmpStr[1] + "\n").getBytes()); outputStream2.write((tmpStr[0] + " " + tmpStr[2] + "\n").getBytes()); outputStream3.write((tmpStr[0] + " " + tmpStr[3] + "\n").getBytes()); outputStream4.write((tmpStr[0] + " " + tmpStr[4] + "\n").getBytes()); if (LOrW) { outputStream5.write((tmpStr[0] + " " + tmpStr[5] + "\n").getBytes()); } } outputStream1.close(); outputStream2.close(); outputStream3.close(); outputStream4.close(); if (LOrW) { outputStream1.close(); } fileStream.close(); } catch (final Exception e) { System.err.println(e); } } private static void makeCmd(final int clusterCount) { String filePath = "plot/plot.cmd"; final FileOutputStream outputStream; try { String result = "set nokey\n" + "set xlab \"x\" \n" + "set ylab \"y\" \n" + "set grid\n" + "set xrange[-" + scale + ".0:" + scale + ".0]\n" + "set yrange[-" + scale + ".0:" + scale + ".0]\n" + "set xtics -" + scale + ".0, 10.0, " + scale + ".0\n" + "set ytics -" + scale + ".0, 10.0, " + scale + ".0\n" + "plot \"cluster1.txt\"\n"; for (int i = 2; i <= clusterCount; i++) { result += "replot \"cluster" + i + ".txt\"\n"; } outputStream = new FileOutputStream(filePath); outputStream.write(result.getBytes()); outputStream.close(); } catch (final Exception e) { System.err.println(e); } } }
[ "sanhaleehana@naver.com" ]
sanhaleehana@naver.com
2498f8fb554492ea27a7192945988421d61306bc
ac7444d1612a3639a297fa6cc88b8d9a2b89417c
/src/com/tomica/nioserver/events/EventListener.java
6b8b3ce81464f13de1d2eba97e069b99ba1b6393
[]
no_license
trapstar321/NIOServer_Java
2cdab1051fdc2b27337fb3ca89c320a0c6ead4c9
348d5a60074010501eec5ef11491c300a6163523
refs/heads/master
2021-01-17T09:11:08.790818
2017-03-05T15:39:38
2017-03-05T15:39:38
83,981,287
0
0
null
null
null
null
UTF-8
Java
false
false
75
java
package com.tomica.nioserver.events; public interface EventListener { }
[ "jadrejcictomica@gmail.com" ]
jadrejcictomica@gmail.com
9af0bb17c85a95d3e29ea8fd8cef1c1d8eb69cd4
7178ee1842813f270eaecfda6db98ff5eb05632f
/common-module/src/main/java/ch/selise/assessment/model/request/TransactionRequest.java
f202706f8de3fa73e82bed42035c7894d42c8b40
[]
no_license
shahedbhuiyan/selise-assessment
a33d043f2a8077e20ba8772783c7efaf0553f9b1
62f1e285030806d81834560c89bdfa6af777cba5
refs/heads/main
2023-06-25T23:31:43.458066
2021-07-31T10:07:26
2021-07-31T10:07:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
885
java
package ch.selise.assessment.model.request; import lombok.Getter; import lombok.Setter; import javax.validation.constraints.NotBlank; /** * @author dipanjal * @since 0.0.1 */ @Getter @Setter public class TransactionRequest { @NotBlank(message = "Request ID can not be empty") private String requestId; @NotBlank(message = "Requester can not be empty") private String requester; @NotBlank(message = "Transaction Type can not be empty") private String transactionType; @NotBlank(message = "Source Account Number can not be empty") private String sourceAccountNumber; @NotBlank(message = "Amount can not be empty") private String amount; @NotBlank(message = "Destination Account Number can not be empty") private String destinationAccountNumber; @NotBlank(message = "Transaction Note can not be empty") private String note; }
[ "dipanjal.maitra@bs-23.net" ]
dipanjal.maitra@bs-23.net
95e460b5f5f49c093f7bc519961ab0ebb5e3ed93
ef8bbfe9cc17412e9d97cc530edb8eb561f548e2
/src/com/jfernandez/categoria/model/Categoria.java
6112803b1947781db43b0322a27beaf1ad450f95
[]
no_license
juanymdq/Facturacion-JAVA
f86fed7a618827cdb0240c481671804984a82848
ea69becffe1b28eefe70ebd560317c9f7b4788ef
refs/heads/master
2022-12-22T05:29:09.779716
2019-11-04T22:58:28
2019-11-04T22:58:28
216,685,594
0
0
null
2022-12-15T23:38:55
2019-10-21T23:49:17
Java
UTF-8
Java
false
false
865
java
package com.jfernandez.categoria.model; public class Categoria { private int id_categoria; private String nombre_categoria; //-----CONSTRUCTORES--------------------------------------------------- public Categoria() {} public Categoria(int id_categoria) { this.id_categoria = id_categoria; } public Categoria(int id_categoria, String nombre_categoria) { this.id_categoria = id_categoria; this.nombre_categoria = nombre_categoria; } //-------GETTERS AND SETTERS------------------------------------------- public int getId_categoria() { return id_categoria; } public void setId_categoria(int id_categoria) { this.id_categoria = id_categoria; } public String getNombre_categoria() { return nombre_categoria; } public void setNombre_categoria(String nombre_categoria) { this.nombre_categoria = nombre_categoria; } }
[ "jifernandez04@hotmail.com" ]
jifernandez04@hotmail.com
7c6a0c436a2027bc46f6a31463b5c6fa3c8c939a
37500a2105ed2f82144761f5093acfb6a86202b6
/src/main/java/org/bank/me/metier/PageOperations.java
16b27f52a4b8abd4a81ee1dbeb9b69cecc6d0f98
[]
no_license
MedRist/Spring-Boot-App
d9d91306156237c734e17dfdba410dcec96b555c
8009e3cd5c5179805065f8635e3e464307e8fb82
refs/heads/master
2021-08-31T14:23:37.991718
2017-12-21T17:07:19
2017-12-21T17:07:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
973
java
package org.bank.me.metier; import org.bank.me.entities.Operation; import java.io.Serializable; import java.util.List; public class PageOperations implements Serializable{ private List<Operation> operations; private int page; private int nombre_Operations; private int total_page; public List<Operation> getOperations() { return operations; } public void setOperations(List<Operation> operations) { this.operations = operations; } public int getPage() { return page; } public void setPage(int page) { this.page = page; } public int getNombre_Operations() { return nombre_Operations; } public void setNombre_Operations(int nombre_Operations) { this.nombre_Operations = nombre_Operations; } public int getTotal_page() { return total_page; } public void setTotal_page(int total_page) { this.total_page = total_page; } }
[ "mboudouar@gmail.com" ]
mboudouar@gmail.com
6c838dab55e37c5d8411f3c4106586a500054ff7
043c40bae28ee71147e0746524cf61b1c643de4a
/app/src/main/java/auroratech/traber/TBMyCarAddCarActivity.java
02517aa878735293c3dc8499eacc7b12beb02978
[]
no_license
zhuanglm/Traffic_Ticket
9a4d36a7314af03a93561f612250ac03e85572c0
6026b4ac81bbe0e4fbe508710d297651d37767e8
refs/heads/master
2021-01-01T05:15:55.595570
2016-05-04T15:10:41
2016-05-04T15:10:41
57,993,296
0
0
null
null
null
null
UTF-8
Java
false
false
7,825
java
package auroratech.traber; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import auroratech.traber.base.TBActivityBase; import auroratech.traber.common.ui.TBUIBindingObj; import auroratech.traber.managers.TBTransitionObjectManager; import auroratech.traber.managers.TBUIManager; import auroratech.traber.util.ITBViewAnimator; public class TBMyCarAddCarActivity extends TBActivityBase implements ITBViewAnimator { TBActivityBase current; auroratech.traber.common.ui.TBHeader profileHeaderSection; RelativeLayout myCarViewListItemsContent; RelativeLayout myCarAddNewItemsContent; RelativeLayout car_picture_section; ImageView crossBox; ImageView car_picture; TextView my_ticket_press_to_take_picture; LinearLayout plate_number_content; EditText plate_number; LinearLayout insurance_section; TextView insurance_section_title; TextView add_car_company_text; EditText insurance_company; TextView add_car_number_text; EditText insurance_number; TextView add_car_exp_text; EditText insurance_expiry_date; ImageButton insurance_expiry_date_button; LinearLayout car_info_section; TextView car_info_section_title; TextView car_info_sticker_exp_date_text; EditText car_info_sticker_expiry_date; ImageButton car_info_sticker_expiry_date_button; TextView car_info_car_model_date_text; EditText car_info_car_model_date; TextView car_info_car_year_text; EditText car_info_car_year; Button car_info_add_car_btn; auroratech.traber.common.ui.TBFooter profileFooterSection; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tb_my_car_add_car); current = this; profileHeaderSection = (auroratech.traber.common.ui.TBHeader) findViewById(R.id.profileHeaderSection); myCarViewListItemsContent = (RelativeLayout) findViewById(R.id.myCarViewListItemsContent); myCarAddNewItemsContent = (RelativeLayout) findViewById(R.id.myCarAddNewItemsContent); car_picture_section = (RelativeLayout) findViewById(R.id.car_picture_section); crossBox = (ImageView) findViewById(R.id.crossBox); car_picture = (ImageView) findViewById(R.id.car_picture); my_ticket_press_to_take_picture = (TextView) findViewById(R.id.my_ticket_press_to_take_picture); plate_number_content = (LinearLayout) findViewById(R.id.plate_number_content); plate_number = (EditText) findViewById(R.id.plate_number); insurance_section = (LinearLayout) findViewById(R.id.insurance_section); insurance_section_title = (TextView) findViewById(R.id.insurance_section_title); add_car_company_text = (TextView) findViewById(R.id.add_car_company_text); insurance_company = (EditText) findViewById(R.id.insurance_company); add_car_number_text = (TextView) findViewById(R.id.add_car_number_text); insurance_number = (EditText) findViewById(R.id.insurance_number); add_car_exp_text = (TextView) findViewById(R.id.add_car_exp_text); insurance_expiry_date = (EditText) findViewById(R.id.insurance_expiry_date); insurance_expiry_date_button = (ImageButton) findViewById(R.id.insurance_expiry_date_button); car_info_section = (LinearLayout) findViewById(R.id.car_info_section); car_info_section_title = (TextView) findViewById(R.id.car_info_section_title); car_info_sticker_exp_date_text = (TextView) findViewById(R.id.car_info_sticker_exp_date_text); car_info_sticker_expiry_date = (EditText) findViewById(R.id.car_info_sticker_expiry_date); car_info_sticker_expiry_date_button = (ImageButton) findViewById(R.id.car_info_sticker_expiry_date_button); car_info_car_model_date_text = (TextView) findViewById(R.id.car_info_car_model_date_text); car_info_car_model_date = (EditText) findViewById(R.id.car_info_car_model_date); car_info_car_year_text = (TextView) findViewById(R.id.car_info_car_year_text); car_info_car_year = (EditText) findViewById(R.id.car_info_car_year); car_info_add_car_btn = (Button) findViewById(R.id.car_info_add_car_btn); profileFooterSection = (auroratech.traber.common.ui.TBFooter) findViewById(R.id.profileFooterSection); // need reference profileHeaderSection.setActivityReference(current); profileFooterSection.setActivityReference(current); // hardware accelerate this... (apparently needed for quick fix) myCarViewListItemsContent.setLayerType(View.LAYER_TYPE_SOFTWARE, null); car_picture_section.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { TBUIManager.getInstance().ToPhotoActivity(current, TBPhotoActivity.CONST_FROM_ADD_CAR); } }); // load initial state of the page loadInitialState(); loadTakenImage(); } private void loadInitialState() { } @Override public void BackPressed() { // TBTransitionObjectManager.getInstance().deleteAllImage(); TBUIManager.getInstance().ToMyCarList(current); } @Override public void addButtonPressed() { } @Override public void itemPressed(TBUIBindingObj data) { } @Override public void onAnimationStart(View fromView, View toView) { } @Override public void onAnimationEnd(View fromView, View toView) { } private void loadTakenImage() { Uri fileUri = TBTransitionObjectManager.getInstance().acceptableFile; if(fileUri != null) { crossBox.setVisibility(View.GONE); my_ticket_press_to_take_picture.setVisibility(View.GONE); // bitmap factory BitmapFactory.Options options = new BitmapFactory.Options(); // downsizing image as it throws OutOfMemory Exception for larger // images options.inSampleSize = 8; final Bitmap bitmap = BitmapFactory.decodeFile(fileUri.getPath(), options); car_picture.setImageBitmap(bitmap); } } @Override protected void onDestroy() { super.onDestroy(); profileHeaderSection.deReference(); profileFooterSection.deReference(); profileHeaderSection = null; myCarViewListItemsContent = null; myCarAddNewItemsContent = null; car_picture_section = null; car_picture = null; my_ticket_press_to_take_picture = null; plate_number_content = null; plate_number = null; insurance_section = null; insurance_section_title = null; add_car_company_text = null; insurance_company = null; add_car_number_text = null; insurance_number = null; add_car_exp_text = null; insurance_expiry_date = null; insurance_expiry_date_button = null; car_info_section = null; car_info_section_title = null; car_info_sticker_exp_date_text = null; car_info_sticker_expiry_date = null; car_info_sticker_expiry_date_button = null; car_info_car_model_date_text = null; car_info_car_model_date = null; car_info_car_year_text = null; car_info_car_year = null; car_info_add_car_btn = null; profileFooterSection = null; } }
[ "zhuanglm@gmail.com" ]
zhuanglm@gmail.com
1db5037019e06ca7bd12bdbcd568769f484c8e28
248ebd7387994ac1aae4cf480395a13ace28c6e4
/src/main/java/com/huawei/ibc/model/common/NodeType.java
450ee24e5e853df172f5406e7bcd9712c06f0903
[]
no_license
oferby/sim-net
e40bf499b06a89996c1db27e9bb031e1f4b4d1db
697c240fa102ea15b264bf33d3edd18cb415bd6d
refs/heads/master
2023-04-29T04:48:24.787066
2021-05-19T07:46:10
2021-05-19T07:46:10
290,185,471
0
0
null
null
null
null
UTF-8
Java
false
false
227
java
package com.huawei.ibc.model.common; public enum NodeType { COMPUTE_NODE, SWITCH, ROUTER, FIREWALL, GATEWAY, NAT, APPLICATION, INTERNET, SUBNET, ACL, LB, GROUP, POLICY, POLICY_ALLOW, POLICY_DENY, SERVICE, MPLS_SWITCH; }
[ "ofer.benyacov@toganetworks.com" ]
ofer.benyacov@toganetworks.com
7adb18a56692ae5de96f79ffdd631c307b326b36
028478a70cedced94e81703f7165cba89038c7cb
/app/src/main/java/com/example/filipinoapp/Results.java
9ff1986d4c95a050efc56655237e7e0e83829e6f
[]
no_license
Yinkci/FillApp
0bbb9b377323875b15e0c7ad4c38ace40dcd9232
5b560a7238e4646e9cdfdb978c34825e6669a172
refs/heads/master
2020-06-03T19:35:01.301024
2019-06-13T06:38:15
2019-06-13T06:38:15
191,704,425
0
0
null
null
null
null
UTF-8
Java
false
false
1,916
java
package com.example.filipinoapp; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; public class Results extends AppCompatActivity { TextView time, time2, score1, score2; Button back; String timeread; LinearLayout reading; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_results); reading = (LinearLayout) findViewById(R.id.LinearReading); time = (TextView) findViewById(R.id.tvTimer); time2 = (TextView) findViewById(R.id.tvTimer2); score1 = (TextView) findViewById(R.id.tvScore1); score2 = (TextView) findViewById(R.id.tvScore2); back = (Button) findViewById(R.id.btnBack); timeread = getIntent().getStringExtra("timerread"); time2.setText(timeread); int a = time2.length(); if (a == 0) { reading.setVisibility(View.GONE); } else { time2.setText(timeread); reading.setVisibility(View.VISIBLE); } time.setText(getIntent().getStringExtra("timer")); score1.setText(getIntent().getStringExtra("score") + " sa 10 mga tanong ay nasagutan mo ng tama."); score2.setText("(" + getIntent().getStringExtra("score") + " of 10 questions you answered correctly)"); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Results.this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); finish(); } }); } }
[ "yinkciworks@gmail.com" ]
yinkciworks@gmail.com
28b46c5ed9c5fa0055bc4ecb61008165234ac8d1
6ec5469ec2bca932a2418de61fee961a04a503e3
/CtyManager-shoper/src/main/java/com/yard/manager/platform/action/LoginAction.java
321a6e23d1e91238d2d00b011f4cd814da30ff09
[]
no_license
Qiuyingx/CtyManager
e6cdb83c15dc9c46936c4d09046f25f9ce2ad250
8ec9ae87fe580b32f28fa77f8b182cb94119087d
refs/heads/master
2020-12-31T07:32:16.224703
2016-05-08T13:20:53
2016-05-08T13:20:53
58,313,077
0
1
null
null
null
null
UTF-8
Java
false
false
3,392
java
package com.yard.manager.platform.action; import java.io.IOException; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.LockedAccountException; import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.subject.Subject; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Result; import org.apache.struts2.convention.annotation.Results; import com.yard.core.kaptcha.Constants; import com.yard.core.security.sha.sha4j.ShaUtil; import com.yard.core.struts.action.JsonServletAction; /** * 登录验证 * * @Description:用户登录处理,后台主界面 */ @Results({ // 管理中心 @Result(name = "CENTER", type = "chain", location = "center"), // 登录页面 @Result(name = "LOGIN", type = "freemarker", location = "/WEB-INF/content/login.html"), // 商户登录页面 @Result(name = "SHOPLOGIN", type = "freemarker", location = "/WEB-INF/content/shopLogin.html"), // 主界面 @Result(name = "LOGOUT", type = "redirect", location = "main") }) public class LoginAction extends JsonServletAction { private static final long serialVersionUID = 1L; private static final String LOGIN = "LOGIN"; // 用户登陆信息 private String account; private String pwd; private String code; /** * 直接跳转到主界面(后台登录界面) * * @return * @throws Exception */ @Action("/main") public String main() throws Exception { return LOGIN; } /** * 商户后台登录页面 * * @return * @throws Exception */ @Action("/") public String shopLogin() throws Exception { return LOGIN; } /** * 登录处理 * * @return */ @Action("/login") public String login() { try { // 判断验证码是否正确 String kaptchaExpected = (String) request.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY); if (code == null || !code.equalsIgnoreCase(kaptchaExpected)) { setResult(false, "验证码错误"); return MAP; } // 验证用户名密码 Subject currentUser = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(account, ShaUtil.toSha256String(pwd)); currentUser.login(token); setResult(true, "成功"); } catch (UnknownAccountException uae) { setResult(false, "用户名无效"); } catch (IncorrectCredentialsException ice) { setResult(false, "密码无效"); } catch (LockedAccountException lae) { setResult(false, "帐号锁定"); } catch (AuthenticationException ae) { setResult(false, "认证未通过,请输入正确的用户名和密码"); } catch (IOException e) { e.printStackTrace(); setResult(false, "认证未通过,发生异常"); } return MAP; } /** * 登出 * * @return */ @Action("/logout") public String logout() { Subject currentUser = SecurityUtils.getSubject(); currentUser.logout(); return LOGIN; } public void setAccount(String account) { this.account = account; } public void setPwd(String pwd) { this.pwd = pwd; } public void setCode(String code) { this.code = code; } }
[ "472128216@qq.com" ]
472128216@qq.com
092d2f62b72c20d1331ad836c29638584950a2c1
13286918b4614fc6d4c55dbcc620fc38a198e841
/app/src/main/java/id/or/pelkesi/actmedis/data/component/AboutActivityComponent.java
0fcebf50db9eb858d3ea5f8cad5eb054a9d5f445
[]
no_license
jeruji/actmedis
792630520a4fb017a95e94b66fbce34c8665f7c7
a9f0ff934cf0f9fba0ec501c4ec1f86b05d748df
refs/heads/master
2020-05-18T06:37:03.600597
2019-05-05T01:16:54
2019-05-05T01:16:54
184,239,640
0
0
null
2019-05-05T01:08:36
2019-04-30T10:09:54
Java
UTF-8
Java
false
false
427
java
package id.or.pelkesi.actmedis.data.component; import dagger.Component; import id.or.pelkesi.actmedis.data.module.AboutActivityModule; import id.or.pelkesi.actmedis.util.CustomScope; import id.or.pelkesi.actmedis.view.about.AboutActivity; @CustomScope @Component(dependencies = NetComponent.class, modules = AboutActivityModule.class) public interface AboutActivityComponent { void inject(AboutActivity aboutActivity); }
[ "lonelybutts@gmail.com" ]
lonelybutts@gmail.com
9921cd5d6add7da66d334da4c978287391e854db
74b47b895b2f739612371f871c7f940502e7165b
/aws-java-sdk-opensearch/src/main/java/com/amazonaws/services/opensearch/model/transform/VPCDerivedInfoMarshaller.java
3e32d0f8a419cc7d6edaa65cbf5c990f80978be5
[ "Apache-2.0" ]
permissive
baganda07/aws-sdk-java
fe1958ed679cd95b4c48f971393bf03eb5512799
f19bdb30177106b5d6394223a40a382b87adf742
refs/heads/master
2022-11-09T21:55:43.857201
2022-10-24T21:08:19
2022-10-24T21:08:19
221,028,223
0
0
Apache-2.0
2019-11-11T16:57:12
2019-11-11T16:57:11
null
UTF-8
Java
false
false
2,929
java
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.opensearch.model.transform; import java.util.List; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.opensearch.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * VPCDerivedInfoMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class VPCDerivedInfoMarshaller { private static final MarshallingInfo<String> VPCID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("VPCId").build(); private static final MarshallingInfo<List> SUBNETIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("SubnetIds").build(); private static final MarshallingInfo<List> AVAILABILITYZONES_BINDING = MarshallingInfo.builder(MarshallingType.LIST) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("AvailabilityZones").build(); private static final MarshallingInfo<List> SECURITYGROUPIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("SecurityGroupIds").build(); private static final VPCDerivedInfoMarshaller instance = new VPCDerivedInfoMarshaller(); public static VPCDerivedInfoMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(VPCDerivedInfo vPCDerivedInfo, ProtocolMarshaller protocolMarshaller) { if (vPCDerivedInfo == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(vPCDerivedInfo.getVPCId(), VPCID_BINDING); protocolMarshaller.marshall(vPCDerivedInfo.getSubnetIds(), SUBNETIDS_BINDING); protocolMarshaller.marshall(vPCDerivedInfo.getAvailabilityZones(), AVAILABILITYZONES_BINDING); protocolMarshaller.marshall(vPCDerivedInfo.getSecurityGroupIds(), SECURITYGROUPIDS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
27bfcf556abfa06c13f87a8e13bea5238571d0a1
cfb9ed3866d459daef66b06f19c3296856ab0f15
/Java/Javalin/src/main/java/io/kidbank/WebEntrypoint.java
8ae670300c2b79ce6909779cced5602aa54c41da
[]
no_license
marwan1023/Toolbelt
ef465b5dd19dd6b58b3061b9377450fe92735c6d
c0a65bbb40b2a68bb1843993421cf9cb26550244
refs/heads/master
2023-02-21T05:53:03.297250
2021-01-24T15:06:40
2021-01-24T15:06:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
690
java
package io.kidbank; import com.google.inject.Inject; import io.alzuma.AppEntrypoint; import io.alzuma.Routing; import io.javalin.Javalin; import javax.inject.Singleton; import java.util.Collections; import java.util.Set; @Singleton class WebEntrypoint implements AppEntrypoint { private Javalin app; @Inject(optional = true) private Set<Routing> routes = Collections.emptySet(); @Inject public WebEntrypoint(Javalin app) { this.app = app; } @Override public void boot(String[] args) { bindRoutes(); app.port(7000); app.start(); } private void bindRoutes() { routes.forEach(r -> r.bindRoutes()); } }
[ "darthbison@gmail.com" ]
darthbison@gmail.com
8bcc5e2ee4154096bdc14ffb8f6cd4e2a95ffd9b
45f424aebe870b4ba7d771dbde302ade51f3186d
/app/src/main/java/com/zby/ibeacon/agreement/CmdParse.java
e275dac0f6ff441f9d929d2c729fca44ace5a61c
[]
no_license
dashuizhu/LED
313e57ce29c1f73b4d185d2911a5346a5141f25a
d9dd85231ba440967e02e4cd84885168c3ca6aa0
refs/heads/master
2021-07-13T21:32:08.447906
2019-09-25T03:47:51
2019-09-25T03:47:51
91,320,711
0
0
null
null
null
null
UTF-8
Java
false
false
4,474
java
package com.zby.ibeacon.agreement; import java.io.UnsupportedEncodingException; import android.app.Activity; import android.content.Intent; import android.os.Handler; import android.util.Log; import android.widget.Toast; import com.zby.ibeacon.bean.DeviceBean; import com.zby.ibeacon.bean.TimingBean; import com.zby.ibeacon.bluetooth.DataProtocolInterface; import com.zby.ibeacon.constants.AppConstants; import com.zby.ibeacon.util.MyByte; import com.zby.ibeacon.util.Myhex; public class CmdParse implements DataProtocolInterface { public static final int Cmd_A0_status = 160; public static final int Cmd_A1_timing = 161; public static final int Cmd_A2_password = 162; public static final int Cmd_A3_name = 163; public static final int Cmd_D5_timer = (0xD5); private DeviceBean bean; private final static String TAG = "cmdParseTag"; private Activity mContext; private CmdParse() { }; public CmdParse(Activity activity, DeviceBean bean) { this.mContext = activity; this.bean = bean; } public void parseData(byte[] buffer) { Log.i(TAG, "解析 " + Myhex.buffer2String(buffer)); if(buffer==null ) return; String name; byte[] nameBuff; int type; switch (buffer[0]) { case (byte) 0xA0:// 开关,亮, 黄, 白 bean.setOnOff(MyByte.byteToInt(buffer[1]) == 1); bean.setBrightness(MyByte.byteToInt(buffer[2])); bean.setColorYellow(MyByte.byteToInt(buffer[3])); // 这里有隐患, 这里是算 字节的 10进制 type = MyByte.byteToInt(0xA0); handlerSendBroadcast(type); break; case (byte) 0xD0: bean.setOnOff(MyByte.byteToInt(buffer[1]) >0); bean.setBrightness(MyByte.byteToInt(buffer[1])); bean.setColorYellow(MyByte.byteToInt(buffer[2])); // 这里有隐患, 这里是算 字节的 10进制 type = MyByte.byteToInt(0xD0); handlerSendBroadcast(type); break; case (byte) 0xA1:// timing case (byte) 0xD2: TimingBean bin = new TimingBean(); bin.setId( MyByte.byteToInt(buffer[1])); bin.setYear(MyByte.byteToInt(buffer[2]) * 256 + MyByte.byteToInt(buffer[3])); bin.setMonth(MyByte.byteToInt(buffer[4])); //if(bin.getMonth()>12 || bin.getMonth()<=0 ) return; bin.setDay(MyByte.byteToInt(buffer[5])); bin.setHour(MyByte.byteToInt(buffer[6])); bin.setMinute(MyByte.byteToInt(buffer[7])); bin.setBrightness(MyByte.byteToInt(buffer[8])); bin.setColorYellow(MyByte.byteToInt(buffer[9])); //只有0-9 if (bin.getId()>=10) { break; } if(MyByte.byteToInt(buffer[11]) !=2) { //2是删除的意思 bin.setEnable(MyByte.byteToInt(buffer[11])==1); bean.updateTimingBean(bin); // 这里有隐患, 这里是算 字节的 10进制 type = MyByte.byteToInt(0xA1); handlerSendBroadcast(type); } break; case (byte) 0xA2:// password case (byte) 0xD3: nameBuff = new byte[6]; System.arraycopy(buffer, 1, nameBuff, 0, nameBuff.length); //name = Myhex.parse02DString(nameBuff); name = new String(nameBuff); name = name.replace("0", ""); bean.setDevicePassword(name.replace(" ", "")); // 这里有隐患, 这里是算 字节的 10进制 type = MyByte.byteToInt(0xA2); handlerSendBroadcast(type); break; case (byte) 0xA3:// name case (byte) 0xD4: nameBuff = new byte[buffer.length-1]; System.arraycopy(buffer, 1, nameBuff, 0, nameBuff.length); try { name = new String(nameBuff, AppConstants.charSet); bean.setName(name); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } // 这里有隐患, 这里是算 字节的 10进制 type = MyByte.byteToInt(0xA3); handlerSendBroadcast(type); break; case (byte) 0xD5: bean.setTimerCount(MyByte.byteToInt(MyByte.byteToInt(buffer[2]))); type = MyByte.byteToInt(0xD5); handlerSendBroadcast(type); break; default: } } private void handlerSendBroadcast(int type) {// 发送广播 if (mContext != null) { Intent intent = new Intent( ConnectBroadcastReceiver.BROADCAST_ACTION); intent.putExtra(ConnectBroadcastReceiver.BROADCAST_DATA_TYPE, type); // intent.putExtra(ConnectBroadcastReceiver.BROADCAST_DATA_KEY, // data); intent.putExtra(ConnectBroadcastReceiver.BROADCAST_DEVICE_MAC, bean.getDeviceAddress()); Log.d("ConnectBraodcast", TAG + ".sendBroadcast " + type + " " + bean.getDeviceAddress()); mContext.sendBroadcast(intent); } } }
[ "328860252@qq.com" ]
328860252@qq.com
461cbdf34d50e52867cb9facc74acea43143413f
cdbd53ceb24f1643b5957fa99d78b8f4efef455a
/vertx-gaia/vertx-co/src/main/java/io/vertx/up/commune/exchange/BType.java
c8f8498fdbcb1f2f86db4c79fcf16f86168a0afd
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
chundcm/vertx-zero
f3dcb692ae6b9cc4ced52386cab01e5896e69d80
d2a2d096426c30d90be13b162403d66c8e72cc9a
refs/heads/master
2023-04-27T18:41:47.489584
2023-04-23T01:53:40
2023-04-23T01:53:40
244,054,093
0
0
Apache-2.0
2020-02-29T23:00:59
2020-02-29T23:00:58
null
UTF-8
Java
false
false
947
java
package io.vertx.up.commune.exchange; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /* * Type Mapping here * Definition for type conversation of `DualItem` */ class BType { private static final ConcurrentMap<String, Class<?>> TYPES = new ConcurrentHashMap<String, Class<?>>() { { this.put("BOOLEAN", Boolean.class); this.put("INT", Integer.class); this.put("LONG", Long.class); this.put("DECIMAL", BigDecimal.class); this.put("DATE1", LocalDate.class); this.put("DATE2", LocalDateTime.class); this.put("DATE3", Long.class); this.put("DATE4", LocalTime.class); } }; static Class<?> type(final String typeFlag) { return TYPES.get(typeFlag); } }
[ "silentbalanceyh@126.com" ]
silentbalanceyh@126.com
52ffb4eb100fe7dcf1ce68a6b01c2d188ec70e89
ca35a94b1dbf356d55f47ad890d78b45b7ffb399
/src/questions/q_024.java
1152318ecbe8921e34948b32212f7e044fef8b3f
[]
no_license
jkpark512/CodeUp_Basics100
f92f101f19a3dd56cbf42af4c217afbf7292c2f7
a8c2df3ff5b786efdb7a89e75120f47ea3baaa62
refs/heads/master
2020-08-29T20:19:41.113693
2020-03-23T12:58:16
2020-03-23T12:58:16
218,164,157
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
// 기초 입출력 : 단어 1개 입력받아 나누어 출력하기 package questions; import java.util.Scanner; public class q_024 { public static void main(String[] args) { String inputVoca; int VocaLength; char[] array = null; Scanner sc = new Scanner(System.in); inputVoca = sc.nextLine(); VocaLength = inputVoca.length(); for(int i=0; i<VocaLength; i++) { array = inputVoca.toCharArray(); } for(int i=0; i<VocaLength; i++) { System.out.println("'"+array[i]+"'"); } } }
[ "43334484+jkpark512@users.noreply.github.com" ]
43334484+jkpark512@users.noreply.github.com
fb2224d514cbf449ee47a32918e214494c05a2e4
676057a83fde9c388445b311ef00be306070fa63
/019.巨大なソース修正/JavaUserManagementSystem_ver2.0/src/java/jums/UpdateResult.java
d5d15454cb8ceb146510d250efdcbd51f48fda10
[]
no_license
kanon2810/GEEK-JOB_Challenge
2e820b5d4069cfbb2de3fdc0a424cf060a3c9a2d
43bbd2c7181c1223a6c9615e79788813389c1bf7
refs/heads/master
2020-03-14T21:34:03.659920
2018-07-30T17:16:08
2018-07-30T17:16:08
131,799,437
0
0
null
null
null
null
UTF-8
Java
false
false
4,563
java
package jums; import java.beans.Beans; import java.io.IOException; import java.io.PrintWriter; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * * @author hayashi-s */ public class UpdateResult extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { /* TODO output your page here. You may use following sample code. */ out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet UpdateResult</title>"); out.println("</head>"); out.println("<body>"); //パラメーター文字コードの取得 request.setCharacterEncoding("UTF-8"); //セッションのセッティング HttpSession session = request.getSession(); UserDataDTO ud = (UserDataDTO)session.getAttribute("resultData"); ud.setUserID(Integer.parseInt(request.getParameter("id"))); //getで"Bean"を再度呼び出す UserDataBeans Bean = (UserDataBeans)session.getAttribute("Bean"); Bean.setName(request.getParameter("name")); Bean.setYear(request.getParameter("year")); Bean.setMonth(request.getParameter("month")); Bean.setDay(request.getParameter("day")); Bean.setType(request.getParameter("type")); Bean.setTell(request.getParameter("tell")); Bean.setComment(request.getParameter("comment")); //DB型にしてマッピングを行う Bean.UD2DTOMapping(ud); //DBへデータの挿入 UserDataDAO.getInstance().UPdata(ud); //uddを格納する これにてResultDatailのデータを再度jsp側で呼び出せるようになる session.setAttribute("UpData",Bean); //成功したのでセッションの値を削除 session.invalidate(); request.getRequestDispatcher("./updateresult.jsp").forward(request, response); out.println("</body>"); out.println("</html>"); }catch(Exception e){ request.setAttribute("error", e.getMessage()); request.getRequestDispatcher("/error.jsp").forward(request, response); }finally { out.close(); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "kanonduut@gmail.com" ]
kanonduut@gmail.com
3bee105930310acf2fdbf15bc7add903d0f745d1
163a66e7865093d4ea1043f2c307fff1bc74f8aa
/app/src/main/java/com/atendimento/adapter/AdapterEmpresasApp.java
6b53cf951137b5cd4eb6996227cd205f716da7c4
[]
no_license
HendrixGit/Atendimento
1478e1c2655826c875b4e85ac0f3541151a18655
b8730b4d60d666f607856ce1e38bb5ac3f27f75d
refs/heads/master
2021-05-09T18:44:50.318975
2018-11-30T17:37:53
2018-11-30T17:37:53
119,171,783
0
0
null
null
null
null
UTF-8
Java
false
false
1,643
java
package com.atendimento.adapter; import android.content.Context; import android.view.View; import com.atendimento.R; import com.atendimento.model.Empresa; import com.squareup.picasso.Callback; import com.squareup.picasso.Picasso; import java.util.List; public class AdapterEmpresasApp extends AdapterGenerico { private List<Empresa> empresas; public AdapterEmpresasApp(List<Empresa> objects ,Context context) { super(context); this.empresas = objects; } @Override public void onBindViewHolder(final MyViewHoder holder, int position) { holder.progressBar.setVisibility(View.VISIBLE); Empresa empresa = empresas.get(position); holder.textViewTitulo.setText(empresa.getNome()); holder.textViewSubTitulo.setText(empresa.getCategoria()); Picasso.with(contexto).load(empresa.getUrlImagem()).error(R.drawable.atendimento).into(holder.circleImageViewImagemListagem, new Callback() { @Override public void onSuccess() { holder.progressBar.setVisibility(View.GONE); } @Override public void onError() { holder.progressBar.setVisibility(View.GONE); } }); if (empresa.getSelecionado()){ Picasso.with(contexto).load(R.drawable.checkmarkblue).resize(64,64).into(holder.circleImageViewSelecaoListagem);} else{ holder.circleImageViewSelecaoListagem.setImageDrawable(null); } } @Override public int getItemCount() { return empresas.size(); } @Override public List getList() { return empresas; } }
[ "brunosalustiano303@hotmail.com" ]
brunosalustiano303@hotmail.com
4ef6112340e1c78de21e698ef0aa45c8e97f6b86
ddb08f5c2c7a8412a663df7b90d02b4a79af88ab
/fundamentals/src/main/java/co/edu/sena/fundamentals/les09/ClassMap.java
e430b5ec3ba36c2539da2ddcfba1c17abb17a515
[]
no_license
ParticleDuality/hm-t4g12s4-ra19-actividades-Dasapugo4444
baee49de1aebf7599fecded4f9545d723969aa83
de2f8587f6d958a9b9ec4692b1144d3c4a6444d0
refs/heads/master
2021-09-26T01:05:50.992421
2018-10-26T20:00:08
2018-10-26T20:00:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,691
java
package co.edu.sena.fundamentals.les09; public class ClassMap { public String[][] deskArray; public String name; public void setClassMap(){ deskArray=new String[3][4]; } public void setDesk(){ boolean flag=false; for (int row = 0; row < 3; row++) { for (int col = 0; col < 4; col++) { if (deskArray[row][col]==null) { deskArray[row][col] = name; System.out.println (name+" está ubicado en el escritorio: "+row+", "+col); flag=true; break; } } if (flag==true){ break; } } if (flag==false){ System.out.println("Todos los escritorios están ocupados"); } } public void displayDeskMap(){ for (int row = 0; row < 3; row++) { for (int col = 0; col < 4; col++) { System.out.print(" "+deskArray[row][col]+" "); } System.out.println(); } } public void searchDesk(){ boolean flag=false; for (int row = 0; row < 3; row++) { for (int col = 0; col < 4; col++) { if (deskArray[row][col]!=null && deskArray[row][col].equals(name)){ System.out.println(name+" está en: "+row+" "+col); flag=true; break; } } if (flag==true){ break; } } if (flag==false){ System.out.println(name + " No encontrado"); } } }
[ "dspulido13@misena.edu.co" ]
dspulido13@misena.edu.co
b84b27be17275c1e6acd783e4fb29fe2defc9388
9e517eba94bdb135dd87399d87cdb63dc9632b1a
/app/src/main/java/com/troyanskiievgen/carowners/repository/dao/CarDAO.java
82664f4763c8c8619b777b8511e9b80c8ccd2862
[]
no_license
Troyanskii/CarOwners
680f869710ffb8ca2ca7395c7211424507fcd6df
febaf340f868c90f07564e4f8bf52eaedb41294c
refs/heads/master
2020-12-02T06:45:00.078523
2017-07-11T13:55:01
2017-07-11T13:55:01
96,892,803
0
0
null
2017-07-11T13:55:02
2017-07-11T12:53:39
Java
UTF-8
Java
false
false
254
java
/* * Copyright (c) 2017. Eugene Troyanskii * Troyanskii.evgen@gmail.com */ package com.troyanskiievgen.carowners.repository.dao; import android.arch.persistence.room.Dao; /** * Created by Relax on 11.07.2017. */ @Dao public interface CarDAO { }
[ "troyanskii.evgen@gmail.com" ]
troyanskii.evgen@gmail.com
397bb33746ef400ab11abf3d7ecdc811d017946c
57a056fe4c33e53a84b986d081cd457a09da6f2f
/Project_01/src/main/java/com/dxc/controller/MarksController.java
c5bdf596012c8f3bc3a22590459b6afdf52d365a
[]
no_license
hnimmagadda/spring-jpa
403393e8cd62c0eedcb414ecef89d5a8b6a311de
d887cb190de10455314978cc15feadafcba0fc67
refs/heads/master
2022-12-16T01:19:59.642987
2020-09-19T14:34:05
2020-09-19T14:34:05
296,887,412
0
0
null
null
null
null
UTF-8
Java
false
false
2,004
java
package com.dxc.controller; import java.text.ParseException; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import com.dxc.beans.Marks; import com.dxc.beans.Student; import com.dxc.repository.MarksRepository; @Controller public class MarksController { @Autowired MarksRepository marksRepository; @RequestMapping("displaymarks") public ModelAndView displaymarks() { ModelAndView modelAndView = new ModelAndView("displaymarks"); List<Marks> marks = (List<Marks>) marksRepository.findAll(); modelAndView.addObject("mrks", marks); return modelAndView; } @RequestMapping("addmarks") public String newmarksform() { return "addmarks"; } @RequestMapping("savemarks") public String addMarks(@RequestParam("exid") String exid, @RequestParam("stid") int stid, @RequestParam("sub1") int sub1, @RequestParam("sub2") int sub2, @RequestParam("sub3") int sub3) throws ParseException { Marks marks = new Marks(exid, stid, sub1, sub2, sub3); marksRepository.save(marks); return "redirect:/displaymarks"; } @RequestMapping("editmarks") public String editmarksform() { return "editmarks"; } @RequestMapping("updatemarks") public String updatemarks(@RequestParam("exid") String exid, @RequestParam("stid") int stid, @RequestParam("sub1") int sub1, @RequestParam("sub2") int sub2, @RequestParam("sub3") int sub3) throws ParseException { Marks marks = new Marks(exid, stid, sub1, sub2, sub3); marksRepository.save(marks); return "redirect:/displaymarks"; } @RequestMapping("marksdelete") public String deleteStudent(@RequestParam("stid") int stid) { marksRepository.deleteById(stid); return "redirect:/displaymarks"; } }
[ "hnimmagadda@IN-5CG0251NNP" ]
hnimmagadda@IN-5CG0251NNP
90c88ad4fa6beb1bc836ffaccbff75612705f5ec
1acd3611676bf717320e8a7b05b23517c5ffe5b2
/src/main/java/com/selenium/configure/environment/PropertiesHandler.java
0bb19de5331a2c388aabd17a9c7b0a4749aeac04
[ "Apache-2.0" ]
permissive
estefafdez/selenium-cucumber
f5e3de19d1258364d8326118c1f11945873e73d2
942dd9f679032f17ef28a81981d627c552f2ea1d
refs/heads/master
2023-08-07T22:44:56.296053
2023-07-27T06:35:24
2023-07-27T06:35:24
81,545,385
10
34
Apache-2.0
2023-09-06T16:43:22
2017-02-10T08:45:15
Java
UTF-8
Java
false
false
2,619
java
package com.selenium.configure.environment; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.apache.log4j.Logger; import org.openqa.selenium.By; /** * Custom class to handle the properties files. * @author estefafdez * */ public class PropertiesHandler { private static String properties = "selector.properties"; private static Properties selectorProp = new Properties(); private static InputStream in = WebDriverFactory.class.getResourceAsStream("/selectors/selector.properties"); static String selector; /******** Log Attribute ********/ private static Logger log = Logger.getLogger(PropertiesHandler.class); private PropertiesHandler(){ } /** * Get the selector of a properties file with its key. */ public static String getSelectorFromProperties(String key){ try { log.info("***********************************************************************************************************"); log.info("[ Properties Configuration ] - Read the selector properties from: " + properties); selectorProp.load(in); selector = selectorProp.getProperty(key); } catch (IOException e) { log.error("getSelectorFromProperties Error", e); } return selector; } /** * Get the complete element with a selected type and key. */ public static By getCompleteElement(String type, String key) { By result; String selector = getSelectorFromProperties(key); switch (type) { case "className": result = By.className(selector); break; case "cssSelector": result = By.cssSelector(selector); break; case "id": result = By.id(selector); break; case "linkText": result = By.linkText(selector); break; case "name": result = By.name(selector); break; case "partialLinkText": result = By.partialLinkText(selector); break; case "tagName": result = By.tagName(selector); break; case "xpath": result = By.xpath(selector); break; default: throw new IllegalArgumentException("By type " + type + " is not found."); } return result; } }
[ "estefafdez@gmail.com" ]
estefafdez@gmail.com
ff51c5f97c95a009f5ff1a55be83047521a56196
ff87d16bd74624d4953449cc4c408cf70229bfcb
/app/src/main/java/com/huyingbao/rxflux2/base/application/BaseApplication.java
c065c734aa97475be7ea2924bebc0212193ed524
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
HuYingBao/DmRxFlux
f380b8b9d6162c1b8134f65a44cfc9160ca4fe36
ea32e015d044ac468b8c77caa120bcd6ed3b28df
refs/heads/master
2021-08-15T03:52:25.628555
2017-11-17T08:47:39
2017-11-17T08:47:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,721
java
package com.huyingbao.rxflux2.base.application; import android.app.Application; import android.content.Context; import android.support.multidex.MultiDex; import com.alibaba.sdk.android.man.MANService; import com.alibaba.sdk.android.man.MANServiceProvider; import com.huyingbao.dm.BuildConfig; import com.huyingbao.rxflux2.inject.component.ApplicationComponent; import com.huyingbao.rxflux2.inject.component.DaggerApplicationComponent; import com.huyingbao.rxflux2.inject.module.application.ApplicationModule; import com.huyingbao.rxflux2.store.AppStore; import com.huyingbao.rxflux2.util.AppUtils; import com.huyingbao.rxflux2.util.CommonUtils; import com.huyingbao.rxflux2.util.DevUtils; import com.orhanobut.logger.AndroidLogAdapter; import com.orhanobut.logger.FormatStrategy; import com.orhanobut.logger.Logger; import com.orhanobut.logger.PrettyFormatStrategy; import com.taobao.sophix.PatchStatus; import com.taobao.sophix.SophixManager; import javax.inject.Inject; /** * Application multidex分包 依赖注入 初始化注释 * Created by liujunfeng on 2017/1/1. */ public class BaseApplication extends Application { @Inject AppStore mAppStore; @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this);// multidex分包 } @Override public void onCreate() { super.onCreate(); // 初始化hotfix initHotfix(); // 初始化analytics initAnalytics(); // 保存application实例对象 AppUtils.setApplication(this); //初始化debug initDebug(); // 初始化dagger initDagger(); // 依赖注入 AppUtils.getApplicationComponent().inject(this); // 注册全局store mAppStore.register(); // Stetho调试 //Stetho.initializeWithDefaults(this); } /** * 初始化hotfix */ private void initHotfix() { SophixManager.getInstance().setContext(this) .setAppVersion(DevUtils.getAppVersion(this)) .setAesKey(null) .setEnableDebug(BuildConfig.LOG_DEBUG) .setPatchLoadStatusStub((mode, code, info, handlePatchVersion) -> { // 补丁加载回调通知 switch (code) { case PatchStatus.CODE_LOAD_SUCCESS://表明补丁加载成功 Logger.d("表明补丁加载成功"); break; case PatchStatus.CODE_LOAD_RELAUNCH://表明新补丁生效需要重启. 开发者可提示用户或者强制重启; 建议: 用户可以监听进入后台事件, 然后应用自杀 Logger.d("表明新补丁生效需要重启"); if (!CommonUtils.isTopActivity(this) || !CommonUtils.isVisible(this)) android.os.Process.killProcess(android.os.Process.myPid()); break; case PatchStatus.CODE_LOAD_FAIL://内部引擎异常, 推荐此时清空本地补丁, 防止失败补丁重复加载 Logger.d("内部引擎异常"); SophixManager.getInstance().cleanPatches(); break; default:// 其它错误信息, 查看PatchStatus类说明 Logger.d("hotfix:" + code + "\n" + info); break; } }) .initialize(); } /** * 初始化analytics */ private void initAnalytics() { // 获取MAN服务 MANService manService = MANServiceProvider.getService(); // 打开调试日志,线上版本建议关闭 if (BuildConfig.DEBUG) manService.getMANAnalytics().turnOnDebug(); // MAN初始化方法之一,从AndroidManifest.xml中获取appKey和appSecret初始化 manService.getMANAnalytics().init(this, getApplicationContext()); } /** * 初始化debug工具 */ private void initDebug() { //.logStrategy(customLog) // (Optional) Changes the log strategy to print out. Default LogCat //.methodOffset(5) // (Optional) Hides internal method calls up to offset. Default 5 FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder() .showThreadInfo(false) // (Optional) Whether to show thread info or not. Default true .methodCount(2) // (Optional) How many method line to show. Default 2 .tag("DmRxFlux") // (Optional) Global tag for every log. Default PRETTY_LOGGER .build(); Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy) { @Override public boolean isLoggable(int priority, String tag) { return BuildConfig.LOG_DEBUG; } }); // if (BuildConfig.LOG_DEBUG) { // if (LeakCanary.isInAnalyzerProcess(this)) return; // LeakCanary.install(this); // } } /** * 初始化dagger */ private void initDagger() { // Module实例的创建 // 如果Module只有有参构造器,则必须显式传入Module实例, // 单例的有效范围随着其依附的Component, // 为了使得@Singleton的作用范围是整个Application,需要添加以下代码 ApplicationComponent applicationComponent = DaggerApplicationComponent.builder() .applicationModule(new ApplicationModule(this)).build(); AppUtils.setApplicationComponent(applicationComponent); } }
[ "K0170016@test.htsc.com.cn" ]
K0170016@test.htsc.com.cn
9a2a8177ad9bc7ba83ca5f0d7968f89ea7f7aca9
2a2e6b194d85678176ae4c4022dbd341073a9610
/app/src/main/java/com/meiquick/vitimageload/MainActivity.java
b0d510a1ddef19b7cc635b917b2d7735915503e5
[]
no_license
KeWeize/VitImageLoader
2fb093ed5f21d8a1a28afd5ba04720a17aa4919c
d900b7bc70d3ff5e4bcbc6f653f880a8f47f8852
refs/heads/master
2020-03-28T05:55:51.340099
2018-09-10T08:15:23
2018-09-10T08:15:23
147,804,061
0
0
null
null
null
null
UTF-8
Java
false
false
1,497
java
package com.meiquick.vitimageload; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.meiquick.imageload.MImageLoader; import com.meiquick.imageload.config.GlobalConfig; import com.meiquick.imageload.config.ImageConfig; import com.meiquick.imageload.loader.GlideLoader; public class MainActivity extends AppCompatActivity { TextView tvCacheSize; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ImageView image01 = findViewById(R.id.test01); ImageView image02 = findViewById(R.id.test02); ImageView image03 = findViewById(R.id.test03); ImageView image04 = findViewById(R.id.test04); ImageView image05 = findViewById(R.id.test05); MImageLoader.with(this).res(R.drawable.test01).into(image01); MImageLoader.with(this).url("http://pic1.win4000.com/wallpaper/2017-12-04/5a24c0e98479b.jpg") // .withCrossFade() .asCircle() // .centerCrop() .into(image02); MImageLoader.with(this).asserts("test03.jpg").into(image03); MImageLoader.with(this).res(R.drawable.testgif).into(image04); MImageLoader.with(this).raw(R.raw.test05).into(image05); } }
[ "vitar5@foxmail.com" ]
vitar5@foxmail.com
52bba51f3bfd6d9612156304b3378c6ab19f5835
9e15febb6dc37e6e17d7ab06b4157232aa054fb3
/Week14/week14day1/src/main/java/com/tts/week14day1/model/Greeting.java
b86928445fcf5bf4f5c2b11f604bbe6c56fad04d
[ "MIT" ]
permissive
Phillip-Revak/WIN
c8d2689b708e3288f177e9fc890dec0206317c3f
4a5032e84c60bd34ebbe45c48efe6601c1f421ec
refs/heads/main
2023-05-07T12:33:14.763134
2021-06-03T13:54:50
2021-06-03T13:54:50
343,567,447
0
1
null
null
null
null
UTF-8
Java
false
false
481
java
package com.tts.week14day1.model; public class Greeting { private Long id; private String content; public Greeting(Long id, String content) { this.id = id; this.content = content; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } }
[ "phillip.revak@gmail.com" ]
phillip.revak@gmail.com
38e9ec94cc9eb9eedb79f2a158a4c9f7b96c90a4
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/game/ui/w.java
db8036910da03f8d5c36386700af9eca83d5716a
[]
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
1,906
java
package com.tencent.mm.plugin.game.ui; import android.graphics.Color; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.ImageView; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.plugin.appbrand.jsapi.g.n; public final class w implements OnTouchListener { private int mColor; public w() { this(Color.argb(221, n.CTRL_INDEX, n.CTRL_INDEX, n.CTRL_INDEX)); AppMethodBeat.i(112218); AppMethodBeat.o(112218); } private w(int i) { this.mColor = i; } public final boolean onTouch(View view, MotionEvent motionEvent) { AppMethodBeat.i(112219); int action = motionEvent.getAction(); Drawable drawable; if (action == 0) { if (view instanceof ImageView) { ImageView imageView = (ImageView) view; drawable = imageView.getDrawable(); if (drawable != null) { drawable.setColorFilter(this.mColor, Mode.MULTIPLY); imageView.setImageDrawable(drawable); } } else if (view.getBackground() != null) { view.getBackground().setColorFilter(this.mColor, Mode.MULTIPLY); } } else if (action == 1 || action == 3) { if (view instanceof ImageView) { drawable = ((ImageView) view).getDrawable(); if (drawable != null) { drawable.clearColorFilter(); } } else { drawable = view.getBackground(); if (drawable != null) { drawable.clearColorFilter(); } } } AppMethodBeat.o(112219); return false; } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
6ec264ac82ac3475b8ca89a81283c2a9f17d77e3
f2feced5772f7b2be4fb299d60a84e7dd292c665
/app/src/main/java/com/example/hp/railwaymanager/TrainSearchActivity.java
ddee94aa60fcb4df991115904eef6a2d983f3db4
[]
no_license
sadia-sust/RailwayManager
ed02216a8059f1bf7226d26d5f45ae8f85427a11
4df416ff4f80f46884bba05b5eadf257f148a0be
refs/heads/master
2021-07-25T02:51:18.489965
2017-11-06T07:41:56
2017-11-06T07:41:56
109,662,643
1
0
null
null
null
null
UTF-8
Java
false
false
3,385
java
package com.example.hp.railwaymanager; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.ListView; import java.util.ArrayList; public class TrainSearchActivity extends ActionBarActivity { ListView list2; static int tSA; @Override protected void onCreate(Bundle savedInstanceState) { tSA = -1; super.onCreate(savedInstanceState); setContentView(R.layout.activity_train_search); list2 = (ListView)findViewById(R.id.trainlist); ArrayList<String> items = new ArrayList<String>(); // items.add(Integer.toString(TrackTrainActivity.toStation) +" "+ Integer.toString(TrackTrainActivity.frmStation)); if(TrackTrainActivity.frmStation==2 && TrackTrainActivity.toStation==0) { items.add("Parabot"); items.add("Kalni"); items.add("Joyontica"); items.add("Upaban"); } if(TrackTrainActivity.frmStation==0 && TrackTrainActivity.toStation==2) { items.add("parabot"); items.add("kalni"); items.add("joyontica"); items.add("upaban"); } if(TrackTrainActivity.frmStation==1 && TrackTrainActivity.toStation==2) { items.add("udayan"); items.add("paharika"); } if(TrackTrainActivity.frmStation==2 && TrackTrainActivity.toStation==1) { items.add("Udayan"); items.add("Paharika"); } if(TrackTrainActivity.frmStation==1 && TrackTrainActivity.toStation==0) { items.add("Mahanagar Provati"); items.add("Shuborno Express"); items.add("Mohanagar Godhuli"); items.add("Turna Nishitha"); } if(TrackTrainActivity.frmStation==0 && TrackTrainActivity.toStation==1) { items.add("mahanagar provati"); items.add("shuborno express"); items.add("mohanagar godhuli"); items.add("turna nishitha"); } if(TrackTrainActivity.frmStation==0 && TrackTrainActivity.toStation==3) { items.add("silkCity express"); items.add("padma express"); items.add("dhumkatu express"); } if(TrackTrainActivity.frmStation==3 && TrackTrainActivity.toStation==0) { items.add("SilkCity Express"); items.add("Padma Express"); items.add("Dhumkatu Express"); } list2.setAdapter(new CustomAdapter2(this, items)); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_train_search, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "sadiatasnimswarna@gamil.com" ]
sadiatasnimswarna@gamil.com
fd9602b8aae8d2a363f97c30592faa76a78f62bb
714fe59341fbaee9c8e899fbb35e5b16fd361718
/src/main/java/com/study/hu/rpc/common/protocol/Response.java
e495fbdd42540bf64edd5b5d233500c55da67c07
[]
no_license
hudongdong129/rpc
09fdfd6731bd46c5999fba552aaa62f808f029a3
94cd605424fdf8d81a93fbb5bfb5d5aa2341cabc
refs/heads/master
2022-06-24T21:57:42.622214
2019-12-25T05:34:49
2019-12-25T05:34:49
229,012,328
0
0
null
2022-06-17T02:48:24
2019-12-19T08:45:31
Java
UTF-8
Java
false
false
1,413
java
package com.study.hu.rpc.common.protocol; import java.io.Serializable; import java.util.HashMap; import java.util.Map; /** * @Author hudongdong * @Date 2019/12/19 14:33 */ public class Response implements Serializable { private static final long serialVersionUID = -4444706353612846553L; private Status status; private Map<String, String> headers = new HashMap<String, String>(); private Object returnValue; private Exception exception; public Response(Status status) { this.status = status; } public Status getStatus() { return status; } public void setStatus(Status status) { this.status = status; } public Map<String, String> getHeaders() { return headers; } public void setHeaders(Map<String, String> headers) { this.headers = headers; } public Object getReturnValue() { return returnValue; } public void setReturnValue(Object returnValue) { this.returnValue = returnValue; } public Exception getException() { return exception; } public void setException(Exception exception) { this.exception = exception; } public void setHeader(String key, String value) { this.headers.put(key, value); } public String getHeader(String key) { return this.headers == null ? null : this.headers.get(key); } }
[ "924859690@qq.com" ]
924859690@qq.com
626bc877496256460d5483eba2e170e596442326
7bc4e9bed9a114329acd358785e1e34f8fe21cdb
/app/src/main/java/com/example/ex9/credits.java
cad22d777d395ea1ea04141e89fed1ff33bdd44e
[]
no_license
ns6991/ex9
97fec01af0f373527b471c47aa597b110aeec634
4e975b145a3e0bf017f9cd4a8b4cab7068d7abe5
refs/heads/master
2023-04-17T20:36:40.890262
2021-05-05T22:17:08
2021-05-05T22:17:08
364,719,387
0
0
null
null
null
null
UTF-8
Java
false
false
967
java
package com.example.ex9; import androidx.appcompat.app.AppCompatActivity; import android.annotation.SuppressLint; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import android.widget.Toast; public class credits extends AppCompatActivity { double result; Intent gi; TextView textView; @SuppressLint("SetTextI18n") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_credits); textView = findViewById(R.id.textView); gi = getIntent(); result = gi.getDoubleExtra("result", 1); textView.setText("the last result is " + result + "\n Thank to Albert Levi the best teacher :)"); } public void backTo(View view) { Intent si = new Intent(this,MainActivity.class); si.putExtra("result",result); startActivity(si); } }
[ "ns6991@bs.amalnet.k12.il" ]
ns6991@bs.amalnet.k12.il
1a7f33686fe3f0d15619ad95161bd54d7a84fca4
322c962b1058ea654d382b83a1225047bcc34a00
/src/main/java/com/bigdatapassion/prodcon/KafkaProducerExample.java
5023f4b66ebb9035059d29177ca538832a080914
[]
no_license
zkarol/kafka-training
712d09c51d77174cf2aa09aef2fcfc85c40b37a6
e66af2dfaa0cd87cfa1a882eeb18f598ad8b6b38
refs/heads/master
2020-12-12T16:09:01.092678
2019-08-23T14:10:04
2019-08-23T14:10:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,920
java
package com.bigdatapassion.prodcon; import com.bigdatapassion.callback.LoggerCallback; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.log4j.Logger; import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; import static com.bigdatapassion.KafkaConfigurationFactory.*; public class KafkaProducerExample { private static final Logger LOGGER = Logger.getLogger(KafkaProducerExample.class); private static final AtomicInteger MESSAGE_ID = new AtomicInteger(1); private static final String[] MESSAGES = {"Ala ma kota, Ela ma psa", "W Szczebrzeszynie chrzaszcz brzmi w trzcinie", "Byc albo nie byc"}; public static void main(String[] args) { Producer<String, String> producer = new KafkaProducer<>(createProducerConfig()); LoggerCallback callback = new LoggerCallback(); Random random = new Random(System.currentTimeMillis()); try { while (true) { for (long i = 0; i < 10; i++) { int id = random.nextInt(MESSAGES.length); String key = "key-" + id; String value = MESSAGES[id]; ProducerRecord<String, String> data = new ProducerRecord<>(TOPIC, key, value); producer.send(data, callback); // async with callback // producer.send(data); // async without callback // producer.send(data).get(); // sync send MESSAGE_ID.getAndIncrement(); } LOGGER.info("Sended messages"); Thread.sleep(SLEEP); } } catch (Exception e) { LOGGER.error("Błąd...", e); } finally { producer.flush(); producer.close(); } } }
[ "radoslawszmit@gmail.com" ]
radoslawszmit@gmail.com
ac877d235df0433f97fe87158391405a37d77d74
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_9b910f6ffc295254d91d7a258c9cb0e33c646005/LWCPlugin/2_9b910f6ffc295254d91d7a258c9cb0e33c646005_LWCPlugin_s.java
17972cebdda2d53926e73435cc77209c48cd5932
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
16,672
java
package com.griefcraft.lwc; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.logging.Level; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.ContainerBlock; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.event.Event.Priority; import org.bukkit.event.Event.Type; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockListener; import org.bukkit.event.entity.EntityListener; import org.bukkit.event.player.PlayerListener; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import com.griefcraft.listeners.LWCBlockListener; import com.griefcraft.listeners.LWCEntityListener; import com.griefcraft.listeners.LWCPlayerListener; import com.griefcraft.logging.Logger; import com.griefcraft.model.Protection; import com.griefcraft.modules.admin.AdminCache; import com.griefcraft.modules.admin.AdminCleanup; import com.griefcraft.modules.admin.AdminClear; import com.griefcraft.modules.admin.AdminConfig; import com.griefcraft.modules.admin.AdminConvert; import com.griefcraft.modules.admin.AdminFind; import com.griefcraft.modules.admin.AdminFlush; import com.griefcraft.modules.admin.AdminForceOwner; import com.griefcraft.modules.admin.AdminGetLimits; import com.griefcraft.modules.admin.AdminLimits; import com.griefcraft.modules.admin.AdminLocale; import com.griefcraft.modules.admin.AdminPurge; import com.griefcraft.modules.admin.AdminReload; import com.griefcraft.modules.admin.AdminRemove; import com.griefcraft.modules.admin.AdminReport; import com.griefcraft.modules.admin.AdminUpdate; import com.griefcraft.modules.admin.AdminVersion; import com.griefcraft.modules.admin.AdminView; import com.griefcraft.modules.admin.BaseAdminModule; import com.griefcraft.modules.create.CreateModule; import com.griefcraft.modules.destroy.DestroyModule; import com.griefcraft.modules.flag.FlagModule; import com.griefcraft.modules.free.FreeModule; import com.griefcraft.modules.info.InfoModule; import com.griefcraft.modules.lists.ListsModule; import com.griefcraft.modules.menu.MenuModule; import com.griefcraft.modules.modes.DropTransferModule; import com.griefcraft.modules.modes.PersistModule; import com.griefcraft.modules.modify.ModifyModule; import com.griefcraft.modules.owners.OwnersModule; import com.griefcraft.modules.redstone.RedstoneModule; import com.griefcraft.modules.unlock.UnlockModule; import com.griefcraft.modules.worldguard.WorldGuardModule; import com.griefcraft.scripting.Module; import com.griefcraft.scripting.Module.Result; import com.griefcraft.scripting.ModuleLoader; import com.griefcraft.scripting.ModuleLoader.Event; import com.griefcraft.sql.Database; import com.griefcraft.util.Colors; import com.griefcraft.util.LWCResourceBundle; import com.griefcraft.util.LocaleClassLoader; import com.griefcraft.util.StringUtils; import com.griefcraft.util.UTF8Control; import com.griefcraft.util.Updater; public class LWCPlugin extends JavaPlugin { /** * The block listener */ private BlockListener blockListener; /** * The entity listener */ private EntityListener entityListener; /** * The locale for LWC */ private LWCResourceBundle locale; /** * The logging object */ private Logger logger = Logger.getLogger("LWC"); /** * The LWC instance */ private LWC lwc; /** * The player listener */ private PlayerListener playerListener; /** * LWC updater * * TODO: Remove when Bukkit has an updater that is working */ private Updater updater; public LWCPlugin() { log("Loading shared objects"); updater = new Updater(); lwc = new LWC(this); playerListener = new LWCPlayerListener(this); blockListener = new LWCBlockListener(this); entityListener = new LWCEntityListener(this); /* * Set the SQLite native library path */ System.setProperty("org.sqlite.lib.path", updater.getOSSpecificFolder()); // we want to force people who used sqlite.purejava before to switch: System.setProperty("sqlite.purejava", ""); // BUT, some can't use native, so we need to give them the option to use // pure: String isPureJava = System.getProperty("lwc.purejava"); if (isPureJava != null && isPureJava.equalsIgnoreCase("true")) { System.setProperty("sqlite.purejava", "true"); } log("Native library: " + updater.getFullNativeLibraryPath()); } /** * @return the locale */ public ResourceBundle getLocale() { return locale; } /** * @return the LWC instance */ public LWC getLWC() { return lwc; } /** * @return the Updater instance */ public Updater getUpdater() { return updater; } /** * Verify a command name * * @param name * @return */ public boolean isValidCommand(String name) { name = name.toLowerCase(); if (name.equals("lwc")) { return true; } else if (name.equals("cpublic")) { return true; } else if (name.equals("cpassword")) { return true; } else if (name.equals("cprivate")) { return true; } else if (name.equals("cinfo")) { return true; } else if (name.equals("cmodify")) { return true; } else if (name.equals("cunlock")) { return true; } else if (name.equals("cremove")) { return true; } else if (name.equals("climits")) { return true; } else { return false; } } /** * Load the database */ public void loadDatabase() { String database = lwc.getConfiguration().getString("database.adapter"); if (database.equals("mysql")) { Database.DefaultType = Database.Type.MySQL; } else { Database.DefaultType = Database.Type.SQLite; } } @Override public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) { String commandName = command.getName().toLowerCase(); String argString = StringUtils.join(args, 0); boolean isPlayer = (sender instanceof Player); // check if they're a player if (!isValidCommand(commandName)) { return false; } // these can only apply to players, not the console (who has absolute player :P) if (isPlayer) { if (lwc.getPermissions() != null && !lwc.getPermissions().permission((Player) sender, "lwc.protect")) { sender.sendMessage(Colors.Red + "You do not have permission to do that"); return true; } /* * Aliases */ if (commandName.equals("cpublic")) { lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, "create", "public".split(" ")); return true; } else if (commandName.equals("cpassword")) { lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, "create", ("password" + argString).split(" ")); return true; } else if (commandName.equals("cprivate")) { lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, "create", ("private" + argString).split(" ")); return true; } else if (commandName.equals("cmodify")) { lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, "modify", argString.split(" ")); return true; } else if (commandName.equals("cinfo")) { lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, "info", "".split(" ")); return true; } else if (commandName.equals("cunlock")) { lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, "unlock", argString.split(" ")); return true; } else if (commandName.equals("cremove")) { lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, "remove", "protection".split(" ")); return true; } else if (commandName.equals("climits")) { lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, "info", "limits".split(" ")); return true; } } if (args.length == 0) { lwc.sendFullHelp(sender); return true; } ///// Dispatch command to modules if(lwc.getModuleLoader().dispatchEvent(Event.COMMAND, sender, args[0].toLowerCase(), args.length > 1 ? StringUtils.join(args, 1).split(" ") : new String[0]) == Result.CANCEL) { sender.sendMessage("(MODULE)"); return true; } if (!isPlayer) { sender.sendMessage(Colors.Red + "That LWC command is not supported through the console :-)"); return true; } return false; } @Override public void onDisable() { if (lwc != null) { LWC.ENABLED = false; lwc.destruct(); } } @Override public void onEnable() { String localization = lwc.getConfiguration().getString("core.locale"); try { ResourceBundle defaultBundle = null; ResourceBundle optionalBundle = null; // load the default locale first defaultBundle = ResourceBundle.getBundle("lang.lwc", new Locale("en"), new UTF8Control()); // and now check if a bundled locale the same as the server's locale exists try { optionalBundle = ResourceBundle.getBundle("lang.lwc", new Locale(localization), new UTF8Control()); } catch (MissingResourceException e) { } // ensure both bundles arent the same if(defaultBundle == optionalBundle) { optionalBundle = null; } locale = new LWCResourceBundle(defaultBundle); if(optionalBundle != null) { locale.addExtensionBundle(optionalBundle); } } catch (MissingResourceException e) { log("We are missing the default locale in LWC.jar.. What happened to it? :-("); log("###########################"); log("## SHUTTING DOWN LWC !!! ##"); log("###########################"); getServer().getPluginManager().disablePlugin(this); return; } // located in plugins/LWC/locale/, values in that overrides the ones in the default :-) ResourceBundle optionalBundle = null; try { optionalBundle = ResourceBundle.getBundle("lwc", new Locale(localization), new LocaleClassLoader(), new UTF8Control()); } catch (MissingResourceException e) { } if (optionalBundle != null) { locale.addExtensionBundle(optionalBundle); log("Loaded override bundle: " + optionalBundle.getLocale().toString()); } int overrides = optionalBundle != null ? optionalBundle.keySet().size() : 0; log("Loaded " + locale.keySet().size() + " locale strings (" + overrides + " overrides)"); loadDatabase(); registerEvents(); updater.loadVersions(false); lwc.load(); registerCoreModules(); LWC.ENABLED = true; log("At version: " + LWCInfo.FULL_VERSION); Runnable runnable = new Runnable() { public void run() { for(World world : getServer().getWorlds()) { String worldName = world.getName(); List<Entity> entities = world.getEntities(); Iterator<Entity> iterator = entities.iterator(); while(iterator.hasNext()) { Entity entity = iterator.next(); if(!(entity instanceof Item)) { continue; } Item item = (Item) entity; ItemStack itemStack = item.getItemStack(); Location location = item.getLocation(); int x = location.getBlockX(); int y = location.getBlockY(); int z = location.getBlockZ(); List<Protection> protections = lwc.getPhysicalDatabase().loadProtections(worldName, x, y, z, 3); Block block = null; Protection protection = null; for(Protection temp : protections) { protection = temp; block = world.getBlockAt(protection.getX(), protection.getY(), protection.getZ()); if(!(block.getState() instanceof ContainerBlock)) { continue; } if(!protection.hasFlag(Protection.Flag.MAGNET)) { continue; } // Remove the items and suck them up :3 Map<Integer, ItemStack> remaining = lwc.depositItems(block, itemStack); if(remaining.size() == 1) { ItemStack other = remaining.values().iterator().next(); if(itemStack.getTypeId() == other.getTypeId() && itemStack.getAmount() == other.getAmount() && itemStack.getData() == other.getData() && itemStack.getDurability() == other.getDurability()) { break; } } // remove the item on the ground item.remove(); // if we have a remainder, we need to drop them if(remaining.size() > 0) { for(ItemStack stack : remaining.values()) { world.dropItemNaturally(location, stack); } } break; } } } } }; getServer().getScheduler().scheduleSyncRepeatingTask(this, runnable, 50, 50); } /** * Register the core modules for LWC */ private void registerCoreModules() { // core registerModule(new CreateModule()); registerModule(new ModifyModule()); registerModule(new DestroyModule()); registerModule(new FreeModule()); registerModule(new InfoModule()); registerModule(new MenuModule()); registerModule(new UnlockModule()); registerModule(new OwnersModule()); // admin commands registerModule(new BaseAdminModule()); registerModule(new AdminCache()); registerModule(new AdminCleanup()); registerModule(new AdminClear()); registerModule(new AdminConfig()); registerModule(new AdminConvert()); registerModule(new AdminFind()); registerModule(new AdminFlush()); registerModule(new AdminForceOwner()); registerModule(new AdminGetLimits()); registerModule(new AdminLimits()); registerModule(new AdminLocale()); registerModule(new AdminPurge()); registerModule(new AdminReload()); registerModule(new AdminRemove()); registerModule(new AdminReport()); registerModule(new AdminUpdate()); registerModule(new AdminVersion()); registerModule(new AdminView()); // flags registerModule(new FlagModule()); registerModule(new RedstoneModule()); // modes registerModule(new PersistModule()); registerModule(new DropTransferModule()); // non-core modules but are included with LWC anyway registerModule(new ListsModule()); registerModule(new WorldGuardModule()); } /** * Register a module * * @param module */ private void registerModule(Module module) { lwc.getModuleLoader().registerModule(this, module); } /** * Log a string to the console * * @param str */ private void log(String str) { logger.log(str); } /** * Register a hook with default priority * * TODO: Change priority back to NORMAL when real permissions are in * * @param hook * the hook to register */ private void registerEvent(Listener listener, Type eventType) { registerEvent(listener, eventType, Priority.Highest); } /** * Register a hook * * @param hook * the hook to register * @priority the priority to use */ private void registerEvent(Listener listener, Type eventType, Priority priority) { logger.log("-> " + eventType.toString(), Level.CONFIG); getServer().getPluginManager().registerEvent(eventType, listener, priority, this); } /** * Register all of the events used by LWC * * TODO: Change priority back to NORMAL when real permissions are in */ private void registerEvents() { /* Player events */ registerEvent(playerListener, Type.PLAYER_QUIT, Priority.Monitor); registerEvent(playerListener, Type.PLAYER_DROP_ITEM); registerEvent(playerListener, Type.PLAYER_INTERACT); /* Entity events */ registerEvent(entityListener, Type.ENTITY_EXPLODE); /* Block events */ registerEvent(blockListener, Type.BLOCK_DAMAGE); registerEvent(blockListener, Type.BLOCK_BREAK); registerEvent(blockListener, Type.BLOCK_PLACE); registerEvent(blockListener, Type.REDSTONE_CHANGE); registerEvent(blockListener, Type.SIGN_CHANGE); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4b5085d4b66d1f2df87d1020a9e2165fe21603dd
4068b4a2e477f177efc3932de044d011d74b8b25
/picocli-codegen/src/main/java/picocli/codegen/annotation/processing/internal/CompletionCandidatesMetaData.java
9e4eb3edaac821fadeb222bcbc7f930ec9b52d97
[ "LicenseRef-scancode-free-unknown", "Apache-2.0" ]
permissive
kakawait/picocli
d80b5ed0efb8cbe76a440dbf413b7393433d2bc7
3ba184ef0330df3052afe64aa0039f67bca38528
refs/heads/master
2020-06-07T21:14:59.559002
2019-06-26T08:06:58
2019-06-26T08:06:58
193,094,608
0
0
Apache-2.0
2019-06-21T12:31:07
2019-06-21T12:31:07
null
UTF-8
Java
false
false
3,323
java
package picocli.codegen.annotation.processing.internal; import picocli.codegen.annotation.processing.ITypeMetaData; import picocli.codegen.util.Assert; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.AnnotationValue; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeMirror; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Implementation of the {@link Iterable} interface that provides metadata on the * {@code @Command(completionCandidates = xxx.class)} annotation. * * @since 4.0 */ public class CompletionCandidatesMetaData implements Iterable<String>, ITypeMetaData { private final TypeMirror typeMirror; public CompletionCandidatesMetaData(TypeMirror typeMirror) { this.typeMirror = Assert.notNull(typeMirror, "typeMirror"); } /** * Returns the completion candidates from the annotations present on the specified element. * @param element the method or field annotated with {@code @Option} or {@code @Parameters} * @return the completion candidates or {@code null} if not found */ public static Iterable<String> extract(Element element) { List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors(); for (AnnotationMirror mirror : annotationMirrors) { DeclaredType annotationType = mirror.getAnnotationType(); if (TypeUtil.isOption(annotationType) || TypeUtil.isParameter(annotationType)) { Map<? extends ExecutableElement, ? extends AnnotationValue> elementValues = mirror.getElementValues(); for (ExecutableElement attribute : elementValues.keySet()) { if ("completionCandidates".equals(attribute.getSimpleName().toString())) { AnnotationValue typeMirror = elementValues.get(attribute); return new CompletionCandidatesMetaData((TypeMirror) typeMirror); } } } } return null; } /** * Returns {@code true} if the command did not have a {@code completionCandidates} annotation attribute. * @return {@code true} if the command did not have a {@code completionCandidates} annotation attribute. */ public boolean isDefault() { return false; } /** * Returns the TypeMirror that this TypeConverterMetaData was constructed with. * @return the TypeMirror of the {@code @Command(completionCandidates = xxx.class)} annotation. */ public TypeMirror getTypeMirror() { return typeMirror; } public TypeElement getTypeElement() { return (TypeElement) ((DeclaredType) typeMirror).asElement(); } /** Always returns {@code null}. */ @Override public Iterator<String> iterator() { return null; } /** * Returns a string representation of this object, for debugging purposes. * @return a string representation of this object */ @Override public String toString() { return String.format("%s(%s)", getClass().getSimpleName(), isDefault() ? "default" : typeMirror); } }
[ "remkop@yahoo.com" ]
remkop@yahoo.com
2f685e24f4e4b12e57a288150d6de1d06de0c3a7
68f8b810d485022394ef107b0360aa03df2b4a1d
/app/src/main/java/com/example/a50/vocabulary/MyViewPager.java
d5f01d0e5e3be29c6c16af4c2a7ea6cbd417aa34
[ "MIT" ]
permissive
50mengzhu/vocabulary
a01cd35ede2360ef42ba012eaada1aa70a0288af
b06b80c9df4936697634f64c9bc07505103c683b
refs/heads/master
2021-01-20T13:17:49.134255
2017-09-03T02:08:09
2017-09-03T02:08:09
101,742,469
2
0
null
null
null
null
UTF-8
Java
false
false
1,289
java
package com.example.a50.vocabulary; import android.content.Context; import android.content.res.TypedArray; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; /** * Created by 50萌主 on 2017/9/1. */ public class MyViewPager extends ViewPager { private boolean canScroll; public MyViewPager(Context context) { super(context); canScroll = true; } public MyViewPager(Context context, AttributeSet attrs) { super(context, attrs); canScroll = true; } public void setCanScroll(boolean isScroll){ this.canScroll = isScroll; } public boolean isCanScroll() { return canScroll; } /*重写这个方法能够实现对viewPager的滑动进行控制, 如果允许滑动则直接继承父类的方法就好,若不允许滑动则是返回false使事件不在继续向下传递*/ @Override public boolean onTouchEvent(MotionEvent ev) { if (isCanScroll()){ return super.onTouchEvent(ev); } return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (isCanScroll()){ return super.onInterceptTouchEvent(ev); } return false; } }
[ "1670041876@qq.com" ]
1670041876@qq.com
de7e9981cbfd28a2c60de5dee21bbde84af0ef84
2040b6b739beb73a744e4b6e635c0d86192ff39e
/src/main/java/com/matthewyao/designpattern/template/Teacher.java
9cb13fe5c349547becba3ce3a7f9ef461844b8ce
[]
no_license
matthewyao/JavaLearning
fc7d173406b4ee83cbd52cdb16bd6050cbb674b2
e12d4d634a71e82e00d1ab4a769c3785bb518cbe
refs/heads/master
2020-05-21T04:45:53.127910
2018-10-25T06:05:41
2018-10-25T06:05:41
49,195,263
0
0
null
null
null
null
UTF-8
Java
false
false
440
java
package com.matthewyao.designpattern.template; /** * Created by yaokuan on 2018/6/6. */ public class Teacher extends AbstractPerson { @Override public void getUp() { System.out.println("洗漱、换衣服"); } @Override public void eatBreakfast() { System.out.println("吃了:面包+鸡蛋"); } @Override public void goToWork() { System.out.println("开车去学校"); } }
[ "yaokuan@meituan.com" ]
yaokuan@meituan.com
4b258295a52d99b302c3f3784c5ac47dcfef0f80
3f811f5d0bcaa52d527b75bf30b0fa2133715675
/app/src/main/java/com/example/r569642/imagescalingpoc/MyFragment.java
c413c7e0cbbbea79685b032d7a1b0f74fa52302f
[]
no_license
sheetal-hemrom/ImageScalingSample
1dc2900b540f813601fce9165f0d552a011d8c9d
2370c5c31def00b6f522418bfc5c2bf002a9cba9
refs/heads/master
2021-01-18T18:18:45.137939
2016-05-31T23:33:44
2016-05-31T23:33:44
60,130,536
0
0
null
null
null
null
UTF-8
Java
false
false
1,325
java
package com.example.r569642.imagescalingpoc; import android.content.Context; import android.media.Image; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; /** * Created by r569642 on 5/12/16. */ public class MyFragment extends Fragment { public static final String EXTRA_MESSAGE = "EXTRA_MESSAGE"; private ImageLoader imageLoader; public static final MyFragment newInstance(String url,ImageLoader loader) { MyFragment f = new MyFragment(); Bundle bdl = new Bundle(1); f.imageLoader = loader; bdl.putString(EXTRA_MESSAGE, url); f.setArguments(bdl); return f; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { String message = getArguments().getString(EXTRA_MESSAGE); View v = inflater.inflate(R.layout.grid_view_cell, container, false); ImageView imageView = (ImageView)v.findViewById(R.id.imageView1); //DisplayImage function from ImageLoader Class imageLoader.displayImage(message,imageView); return v; } }
[ "sheetal.hemrom@chase.com" ]
sheetal.hemrom@chase.com
6a87b17c837028c87e4894f66ecc1a70bba8cb69
9c059f377181921723fb68081687c649b4e51a6c
/msg-exchange-repository/src/main/java/zw/co/dobadoba/msgexchange/repository/config/DevelopmentDataSourceConfig.java
9c488d7819f1d4ef0e71449fd12959bc37fe1e12
[]
no_license
DeeObah/msg-exchange-service
c13e6a2dab89c81652e8c75914a9924d9fb5a458
e03ddd59b007c80e94a3cbf50e0efd5cd7f63954
refs/heads/master
2020-12-02T11:13:52.861175
2017-09-27T13:20:22
2017-09-27T13:20:22
96,618,557
0
0
null
null
null
null
UTF-8
Java
false
false
1,079
java
package zw.co.dobadoba.msgexchange.repository.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.jdbc.datasource.DriverManagerDataSource; import javax.sql.DataSource; /** * Created by dobadoba on 7/8/17. */ @Configuration @PropertySource("classpath:jdbc.development.properties") public class DevelopmentDataSourceConfig { @Bean public DataSource dataSource(Environment environment) { final DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName(environment.getProperty("jdbc.driverClassName")); dataSource.setUrl(environment.getProperty("jdbc.url")); dataSource.setPassword(environment.getProperty("jdbc.password")); dataSource.setUsername(environment.getProperty("jdbc.username")); return dataSource; } }
[ "Arnold.Doba@econet.co.zw" ]
Arnold.Doba@econet.co.zw
f8f206ec400e61c36b45cd6bb0a1b9b7fc70b654
907d7b42f1277f929bdcfe6e73266b5071f524c5
/common/src/main/java/com/example/runner/ExampleRunner.java
f1033289886ca8dd5e52c3954c0447c8ae9ad3f1
[]
no_license
faleev/testing-example-java
10171fb653645003d6ab6cbf281d66cd30a801be
befb254fd722777c90ae5aef11919d3d35ea285f
refs/heads/master
2020-04-25T11:50:20.326864
2014-10-24T12:42:38
2014-10-24T12:42:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
183
java
package com.example.runner; public class ExampleRunner { public static void main(String[] args) { //TODO: Interaction with the outside world will be added here. } }
[ "pavel.faleev@gmail.com" ]
pavel.faleev@gmail.com
c7cc2eca37ff7df9c4bfe22350a659c38a25c522
93613d9ab42e023a5b1ecab0918691b93b698607
/activity/src/main/java/com/yonyou/aco/cloudydisk/test/TableToEntity.java
218a1c3ca712d8807e7070f4a6a59ac67fd5e324
[]
no_license
lihuihui123456/OA
6aafe4b93a09305ee9b169d1f8974a07855f3e79
f50787dd1d8517989d2ffa16d4c24bdccc477f3c
refs/heads/master
2022-12-24T08:56:17.793951
2019-12-17T06:09:06
2019-12-17T06:09:06
228,515,435
0
2
null
2022-12-16T00:59:51
2019-12-17T02:24:31
JavaScript
UTF-8
Java
false
false
2,646
java
package com.yonyou.aco.cloudydisk.test; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; public class TableToEntity { public static void main(String[] args) { String schema = "cap-aco-test"; String tableName = "cloud_authority_ref_user"; try { createFields(schema, tableName); } catch (Exception e) { e.printStackTrace(); } } public static void createFields(String schema, String tableName) throws Exception { String url = "jdbc:mysql://127.0.0.1:3306/cap-aco-test?useUnicode=true&characterEncoding=utf-8"; String username = "root"; String passwd = "root"; String classDriver = "com.mysql.jdbc.Driver"; Class.forName(classDriver); Connection connection = DriverManager.getConnection(url, username, passwd); Statement statement = connection.createStatement(); String sql = "select column_name,column_comment,column_key,is_nullable,data_type from information_schema.columns where table_schema = '" + schema + "' and table_name='" + tableName + "'"; ResultSet resultSet = statement.executeQuery(sql); List<java.util.HashMap<String, Object>> list = resultSetToList(resultSet); for (java.util.HashMap<String, Object> column : list) { System.out.println("/** " + column.get("COLUMN_COMMENT").toString() + " */\nprivate String " + getSName(column.get("COLUMN_NAME").toString()) + ";"); } } private static String getSName(String columnName) { if ((columnName.charAt(columnName.length() - 1)+"").equals("_")) { return columnName; } String name = ""; String[] str = columnName.split("_"); for (int i = 0; i < str.length; i++) { if (i == 0) { name = name + str[i].toLowerCase(); } else { name = name + str[i].charAt(0) + str[i].substring(1).toLowerCase(); } } return name; } @SuppressWarnings({ "unchecked", "rawtypes" }) private static List<java.util.HashMap<String, Object>> resultSetToList(ResultSet rs) throws SQLException { List<java.util.HashMap<String, Object>> list = new ArrayList(); ResultSetMetaData md = rs.getMetaData(); int columnCount = md.getColumnCount(); while (rs.next()) { java.util.HashMap<String, Object> rowData = new java.util.HashMap(); for (int i = 1; i <= columnCount; i++) { rowData.put(md.getColumnName(i), rs.getObject(i)); } list.add(rowData); } return list; } }
[ "1833607032@163.com" ]
1833607032@163.com
955f947e5ecfe581b0379dac902dcab71d767850
d234cc1777205a569a026a1f1f45a6633bc502c9
/Android/UniversalRemote/src/com/remote/universalremote/irapi/IrApi.java
402816df6e6a3fcc7fbaab0379add6271dfdff7d
[]
no_license
deepalidk/andemos
ed0c5c590ce6e9982d43e1518116431b8c7cf5f3
03f7cf5d69d6ff9c4e4d60b7bcfa88eeae73ac63
refs/heads/master
2021-01-10T11:54:11.237390
2013-01-10T09:34:14
2013-01-10T09:34:14
51,981,513
0
0
null
null
null
null
GB18030
Java
false
false
20,450
java
package com.remote.universalremote.irapi; import java.util.LinkedList; import android.text.format.Time; import android.util.Log; /** * @author walker * @date 2011.06.23 */ public class IrApi implements IOnRead { // Debugging private static final String TAG = "Irapi"; private static final boolean D = false; /** * IO Control handle */ private IIo mmIIo; /** * the ack packet recevied from RT300 */ private LinkedList<Frame> mmFrames; /** * the state of Parser */ private EParseState mmParseState; /** * Frame data of RT300 */ private Frame mmFrame; /** * temp of current command id; */ private byte mmTempCmdId; /** * time to Retransimit(ms) */ private int mmRetransimitTime = 500; /** * time to Retransimit(ms) */ private int mmRetransimitCount = 2; public static IrApi getHandle() { return mmIrApi; } private static IrApi mmIrApi = new IrApi(); private IrApi() { mmIIo = null; mmParseState = EParseState.cmd; mmFrames = new LinkedList<Frame>(); } /* RT300 and 400 header */ private static final byte[] RT400_HEADER = new byte[] { 0x45, 0x5a }; private static final byte[] RT300_HEADER = new byte[] { 0x45, 0x34 }; /* RT400 Key Code */ private static final byte[] RT400_ENCY_KEY = new byte[] { 0x38, 0x34, 0x33, 0x30 }; /* * RT300 marker. Set in function Init(). true-rt300 false-rt400 */ private boolean mIsRT300 = false; /* * THE Header for communication. */ private byte[] getHeader() { if (mIsRT300 == true) { return RT400_HEADER; } else { return RT300_HEADER; } } /** * transmit data with RT300 * * @param TXbuf * data to send to RT300 * @param timeOut * retransmit timeout * @param retransmitCount * retransmit count * @return Ack packet * @throws InterruptedException */ private boolean transmit_data(byte[] TXbuf, int timeOut, int retransmitCount) throws InterruptedException { if (mmIIo == null) return false; mmFrames.clear(); Time t1 = new Time(); // or Time t=new Time("GMT+8"); 加上Time Zone资料。 Time t2 = new Time(); // or Time t=new Time("GMT+8"); 加上Time Zone资料。 Time t3; t1.setToNow(); // 取得系统时间。 do { mmIIo.write(TXbuf); synchronized (mmFrames) { mmFrames.wait(timeOut); if (mmFrames.size() > 0) { if (mmFrames.getLast().getPayloadBuffer()[0] == EFrameStatus.Succeed .getValue()) { t2.setToNow(); long t = t2.toMillis(true) - t1.toMillis(true); String msg = String.format("%d", t); if (D) Log.d("TimeElapsed", msg); return true; } else { return false; } } } } while (retransmitCount-- > 0); return false; } /** * transmit data with RT300 * * @param TXbuf * data to send to RT300 * @return Ack packet * @throws InterruptedException */ private boolean transmit_data(byte[] TXbuf) throws InterruptedException { return transmit_data(TXbuf, mmRetransimitTime, mmRetransimitCount); } /** * transmit data with RT300 * * @param TXbuf * data to send to RT300 * @return Ack status * @throws InterruptedException */ private byte transmit_data_ex(byte[] TXbuf) throws InterruptedException { if (mmIIo == null) return (byte) EFrameStatus.ErrorGeneral.getValue(); mmIIo.write(TXbuf); synchronized (mmFrames) { mmFrames.wait(3000); if (mmFrames.size() > 0) { return mmFrames.getLast().getPayloadBuffer()[0]; } } return (byte) EFrameStatus.ErrorGeneral.getValue(); } /***** IR API *******************/ /** * @param in * iIo the interface of IO * * @return the firmware version of RT300. * */ public String init(IIo iIo) { if(D) Log.d(TAG, "init"); mmIIo = iIo; mmIIo.setOnReadFunc(this); mmParseState = EParseState.cmd; /* try rt400 protocol */ mIsRT300 = false; byte[] versionTemp = IrGetVersion(); /* try rt400 protocol */ if (versionTemp == null) { mIsRT300 = true; versionTemp = IrGetVersion(); } String result = null; if (!D) { if (versionTemp == null) { mmIIo.setOnReadFunc(null); mmIIo = null; } else { result = String.format("%02x%02x", versionTemp[1], versionTemp[2]); } } return result; } /** * get RT300 version info * * @param version * @return true-success false-failed */ public byte[] IrGetVersion() { if (D) Log.d(TAG, "IrGetVersion"); Frame frame = new Frame(0); frame.setCmdID((byte) 0x09); byte[] version = null; try { boolean result = transmit_data(frame.getPacketBuffer()); if (result) { if (D) Log.d(TAG, "IRGetVersion, mmFrames.removeFirst()"); Frame rsultframe = mmFrames.removeFirst(); if (D) Log.d(TAG, "rsultframe.getPayloadBuffer();"); version = rsultframe.getPayloadBuffer(); } } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "IRGetVersion, exception"); e.printStackTrace(); } return version; } /******************************* * stop IR transmission *******************************/ public void IrTransmitStop() { byte buffer[] = new byte[1]; buffer[0] = 0x00; mmIIo.write(buffer); } /** * TRANSMIT PREPROGRAMMED IR CODE * * @param type * IR transmission type * @param devId * device ID * @param codeNum * code Number or Code location Number * @param keyId * Key ID * @return */ public boolean transmitPreprogramedCode(byte type, byte devId, int codeNum, byte keyId) { if (D) Log.d(TAG, "transmitPreprogramedCode"); Frame frame = new Frame(5); frame.setCmdID((byte) 0x01); boolean result = false; try { frame.addPayload(type); frame.addPayload(devId); frame.addPayload((byte) (codeNum >> 8)); frame.addPayload((byte) (codeNum & 0xFF)); frame.addPayload(keyId); result = transmit_data(frame.getPacketBuffer()); } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "transmitPreprogramedCode, exception"); e.printStackTrace(); } return result; } /** * TRANSMIT PREPROGRAMMED IR CODE * * @param type * IR transmission type * @param devId * device ID * @param codeNum * code Number or Code location Number * @param keyId * Key ID * @return */ public boolean transmitIrData(byte type, byte[] data) { if (mIsRT300 == true) { return transmitIrDataRT300(type, data); } else { return transmitIrDataRT400(type, data); } } /** * TRANSMIT PREPROGRAMMED IR CODE * * @param type * IR transmission type * @param devId * device ID * @param codeNum * code Number or Code location Number * @param keyId * Key ID * @return */ public boolean transmitIrDataRT300(byte type, byte[] data) { if (D) Log.d(TAG, "transmitPreprogramedCode"); if (data == null) { return false; } Frame frame = new Frame(81); frame.setCmdID((byte) 0x20); boolean result = false; try { frame.addPayload(type); frame.addPayload(data); Log.d("DeviceKeyActivity", "" + "changed"); result = transmit_data(frame.getPacketBuffer()); Log.d("DeviceKeyActivity", "result" + result); } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "transmitPreprogramedCode, exception"); e.printStackTrace(); } return result; } /** * TRANSMIT PREPROGRAMMED IR CODE * * @param type * IR transmission type * @param devId * device ID * @param codeNum * code Number or Code location Number * @param keyId * Key ID * @return */ public boolean transmitIrDataRT400(byte type, byte[] data) { if (D) Log.d(TAG, "transmitPreprogramedCode"); if (data == null) { return false; } Frame frame = new Frame(85); frame.setCmdID((byte) 0x26); boolean result = false; try { frame.addPayload(type); frame.addPayload(RT400_ENCY_KEY); frame.addPayload(data); Log.d("DeviceKeyActivity", "" + "changed"); result = transmit_data(frame.getPacketBuffer()); Log.d("DeviceKeyActivity", "result" + result); } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "transmitPreprogramedCode, exception"); e.printStackTrace(); } return result; } /** * GET KEY FLAG * * @param devId * device ID * @param codeNum * code Number or Code location Number * @return 1 byte status 8 bytes flag. */ public byte[] getKeyFlag(byte devId, int codeNum) { if (D) Log.d(TAG, "getKeyFlag"); Frame frame = new Frame(3); frame.setCmdID((byte) 0x03); byte flags[] = null; try { boolean result = false; frame.addPayload(devId); frame.addPayload((byte) (codeNum >> 8)); frame.addPayload((byte) (codeNum & 0xFF)); result = transmit_data(frame.getPacketBuffer()); if (result) { flags = mmFrames.getLast().getPayloadBuffer(); } } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "getKeyFlag, exception"); e.printStackTrace(); } return flags; } /** * STORE SUPPLEMENTRARY LIBRARY TO E2PROM * * @param location * the location of library. * * @param data * the data to be write. * * @return */ public boolean StoreLibrary2E2prom(byte location, byte[] data) { if (D) Log.d(TAG, "StoreLibrary2E2prom"); boolean result = false; if (data.length != 592) { return result; } try { // transform the first 4 packages. int curStart = 0; int curLength = 121; byte status = 0; Frame frame; int i = 0; for (i = 0; i < 4; i++) { frame = new Frame(123); frame.setCmdID((byte) 0x07); frame.addPayload(location); frame.addPayload((byte) i); frame.addPayload(data, curStart, curLength); status = transmit_data_ex(frame.getPacketBuffer()); if (status != 0x31) { break; } if (D) Log.d(TAG, " " + status); curStart += 121; } if (status != 0x31) { return result; } frame = new Frame(110); frame.setCmdID((byte) 0x07); frame.addPayload(location); frame.addPayload((byte) 4); frame.addPayload(data, 484, 108); if (D) Log.d(TAG, " " + status); status = transmit_data_ex(frame.getPacketBuffer()); result = (status == 0x30); } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "transmitPreprogramedCode, exception"); e.printStackTrace(); } return result; } /** * TRANSMIT PREPROGRAMMED IR CODE * * @param type * type: 0 av * type: 1 ac * @return */ public byte[] learnIrCode(byte type) { if (D) Log.d(TAG, "transmitPreprogramedCode"); // byte[] leanCmd; // = new byte[] { 0x45, 0x34, 0x24, 0x04, (byte) 0xa1 }; Frame frame = new Frame(0); if(type==0){ frame.setCmdID((byte) 0x24); }else{ frame.setCmdID((byte)0x27); } byte[] result = null; try { boolean tResult = transmit_data(frame.getPacketBuffer()); if (tResult) { synchronized (mmFrames) { mmFrames.wait(20000); if (mmFrames.size() > 1) { byte[] payloadBuffer = mmFrames.getLast() .getPayloadBuffer(); if (payloadBuffer[0] == EFrameStatus.Succeed.getValue()) { result = new byte[80]; for (int i = 0; i < 80; i++) { result[i] = payloadBuffer[i + 1]; } } } } } } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "transmitPreprogramedCode, exception"); e.printStackTrace(); } return result; } /** * TRANSMIT PREPROGRAMMED IR CODE * * @param loc * IR Code Storage Location(0-100) * @return 81 byte data. */ public byte[] readLearnData(byte loc) { if (D) Log.d(TAG, "transmitPreprogramedCode"); Frame frame = new Frame(1); frame.setCmdID((byte) 0x12); boolean result = false; byte[] resultFrame = null; try { frame.addPayload(loc); result = transmit_data(frame.getPacketBuffer()); if (result) { Frame resultframe = mmFrames.removeFirst(); if (D) Log.d(TAG, "rsultframe.getPayloadBuffer();"); resultFrame = resultframe.getPayloadBuffer(); } } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "transmitPreprogramedCode, exception"); e.printStackTrace(); } return resultFrame; } /** * TRANSMIT LEARNED IR CODE * * @param type * IR transmission type * @param loc * Learned IR Code Storage Location * @return * */ public boolean transmitLearnData(byte type, byte[] data) { if (D) Log.d(TAG, "transmitPreprogramedCode"); if (data == null) { return false; } Frame frame = new Frame(81); frame.setCmdID((byte) 0x25); boolean result = false; try { frame.addPayload(type); frame.addPayload(data); Log.d("DeviceKeyActivity", "" + "changed"); result = transmit_data(frame.getPacketBuffer()); Log.d("DeviceKeyActivity", "result" + result); } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "transmitPreprogramedCode, exception"); e.printStackTrace(); } return result; } /** * TRANSMIT PREPROGRAMMED IR CODE * * @param type * IR Code Storage Location(0-100) * @param data * IR learn data. * @return * */ public boolean storeLearnData(byte loc, byte[] data) { if (D) Log.d(TAG, "transmitPreprogramedCode"); if (data == null) return false; Frame frame = new Frame(82); frame.setCmdID((byte) 0x13); boolean result = false; try { frame.addPayload(loc); frame.addPayload(data); result = transmit_data(frame.getPacketBuffer()); } catch (InterruptedException e) { // TODO Auto-generated catch block if (D) Log.d(TAG, "transmitPreprogramedCode, exception"); e.printStackTrace(); } return result; } /***** end of ir api *******************/ /** * parse of RT300 protocol ack packet * * @param buffer * data to be Parse */ private void Parse(byte buffer) { if (D) Log.d(TAG, "state=" + mmParseState + String.format("Buffer=%H ", buffer)); if (mmParseState == EParseState.cmd) { mmTempCmdId = buffer; mmParseState = EParseState.length; } else if (mmParseState == EParseState.length) { mmFrame = new Frame(buffer - 2); mmFrame.setCmdID(mmTempCmdId); if (buffer != 2) { mmParseState = EParseState.data; } else { mmParseState = EParseState.checkSum; } } else if (mmParseState == EParseState.data) { mmFrame.addPayload(buffer); if (mmFrame.isPayloadFull()) { mmParseState = EParseState.checkSum; } } else if (mmParseState == EParseState.checkSum) { if (buffer == mmFrame.calcAckChecksum()) { // if (mmFrame.getPayloadBuffer()[0] == EFrameStatus.Succeed // .getValue()) { synchronized (mmFrames) { mmFrames.add(mmFrame); mmFrames.notify(); } // } } mmParseState = EParseState.cmd; } } @Override public void OnRead(byte[] buffer, int len) { // TODO Auto-generated method stub for (int i = 0; i < len; i++) { Parse(buffer[i]); } } /** * Frame of the RT300 protocol * * @author walker * */ class Frame { /** * data buffer */ private byte[] mmPayloadBuffer; /* * buffer len */ private int mmPayloadLen; /** * the idx of current data buffer */ private int mmPayloadIdx; /** * max length of data buffer */ private int MaxBufLen = 150; /* * command id of frame */ private byte mmCmdId; /** * set the frame cmd id; * * @param cmdId */ public void setCmdID(byte cmdId) { mmCmdId = cmdId; } /** * set the frame cmd id; * * @param cmdId */ public byte getCmdID() { return mmCmdId; } public Frame(int len) { mmPayloadBuffer = new byte[300]; mmPayloadLen=len; mmPayloadIdx = 0; } /** * get the frame data * * @return */ public byte[] getPayloadBuffer() { byte[] result=new byte[mmPayloadIdx]; System.arraycopy(mmPayloadBuffer, 0, result, 0, mmPayloadIdx); return result; } /** * get frame is complete. */ public boolean isPayloadFull() { return mmPayloadIdx == mmPayloadLen; } /** * add data to frame * * @param buffer * the data to be added. */ public void addPayload(byte buffer) { mmPayloadBuffer[mmPayloadIdx++] = buffer; } /** * add data to frame * * @param buffer * the data to be added. */ public void addPayload(byte[] buffer) { System.arraycopy(buffer, 0, mmPayloadBuffer, mmPayloadIdx, buffer.length); mmPayloadIdx += buffer.length; } /** * add data to frame * * @param buffer * the data to be added. */ public void addPayload(byte[] buffer, int start, int length) { System.arraycopy(buffer, start, mmPayloadBuffer, mmPayloadIdx, length); mmPayloadIdx += length; } public void clearPayload() { mmPayloadIdx = 0; } /** * calculate ack packet checksum * * @param pData * : the data for calculate checksum * @return: the length of pData */ public byte calcAckChecksum() { byte result = 0; result += mmCmdId; result += mmPayloadIdx + 2; for (int i = 0; i < mmPayloadIdx; i++) { result += mmPayloadBuffer[i]; } return result; } /** * get ack packet buffer * * @return */ public byte[] getAckPacketBuffer() { byte[] result = new byte[mmPayloadIdx + 3]; result[0] = mmCmdId; result[1] = (byte) (mmPayloadIdx + 2); System.arraycopy(mmPayloadBuffer, 0, result, 2, mmPayloadIdx); result[result.length - 1] = calcAckChecksum(); return result; } /** * calculate ack packet checksum * * @param pData * : the data for calculate checksum * @return: the length of pData */ public byte calcChecksum() { byte result = 0; byte[] header = getHeader(); result += header[0]; result += header[1]; result += mmCmdId; result += mmPayloadIdx + 4; for (int i = 0; i < mmPayloadIdx; i++) { result += mmPayloadBuffer[i]; } return result; } /** * get ack packet buffer * * @return */ public byte[] getPacketBuffer() { byte[] result = new byte[mmPayloadIdx + 5]; byte[] header = getHeader(); result[0] = header[0]; result[1] = header[1]; result[2] = mmCmdId; result[3] = (byte) (mmPayloadIdx + 4); System.arraycopy(mmPayloadBuffer, 0, result, 4, mmPayloadIdx); result[result.length - 1] = calcChecksum(); return result; } }; /** * Parse State * * @author walker * */ enum EParseState { cmd, // cmd Id length, // data length data, // data checkSum, // checksum }; /** * the status of current frame. * * @author walker * */ enum EFrameStatus { Succeed(0x30), ErrorGeneral(0x40); private int value; EFrameStatus(int value) { this.value = value; } public int getValue() { return value; } }; }
[ "walkerwk@febdd8de-34b2-09fa-199c-44fb402a6750" ]
walkerwk@febdd8de-34b2-09fa-199c-44fb402a6750
c96d2cdb53fa6155f94ba73ac93dfe8a487fbd55
1a4f308ba2778c9af35a60f8f5cbc14109cc6882
/Commit1/src/commit1/Commit1.java
aa8cc8cdb1808652c8f5da9db7fb6118265dc5cf
[]
no_license
JeffersonAguirre/DeberConTravis
99c772048376603293188ba6e0b681f4e28c716e
961869edff1ed871f4f3587cc7e1659460b4291b
refs/heads/master
2020-12-05T07:10:55.773740
2016-09-14T14:12:21
2016-09-14T14:12:21
67,429,532
0
0
null
null
null
null
UTF-8
Java
false
false
482
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 commit1; /** * * @author Pc */ public class Commit1 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here System.out.println(" Hola Profe "); } }
[ "Pc@DESKTOP-2VUBUTH" ]
Pc@DESKTOP-2VUBUTH
ef2ad276e42e4e6aa2e6c2161eefd120592729e6
f2ff306022ff235b50b3b990ca57a976c1b81ac7
/JungchanLee-HW9/src/HearthstoneCard.java
3792e779fdb78db8ec097b52f7020e5df46b1c4a
[]
no_license
Chanthebigbro/Chan-HW9
a936552cf1839517a4eba923f0d92b44560380cc
08edcebc7bd87a7ed73e29980485670f347d85fc
refs/heads/main
2023-03-12T19:12:14.956652
2021-03-01T17:22:20
2021-03-01T17:22:20
343,498,376
0
0
null
null
null
null
UTF-8
Java
false
false
775
java
public class HearthstoneCard { private int cost; private int attack; private int defense; private String name; public HearthstoneCard(String name, int cost, int attack, int defense) { this.cost = cost; this.attack = attack; this.defense = defense; this.name = name; } public int getCost() { return this.cost; } //setters allow us to conditionally change the value of a private member public void setName(String name) { if(name.length() >= 5) { this.name = name; } } void display() { //System.out.println("Name: " + this.name + "\nCost" + this.cost + "\nAttack: " + this.attack + " Defense: " + this.defense); System.out.format("Name: %s Cost: %d Attack: %d Defense: %d\n", this.name, this.cost, this.attack,this.defense); } }
[ "Chanthebigbro@users.noreply.github.com" ]
Chanthebigbro@users.noreply.github.com
caf174db3b4f344d8032394fdb2c054a922e888d
fb80d88d8cdc81d0f4975af5b1bfb39d194e0d97
/Platform_TreeFramework/src/net/sf/anathema/platform/tree/presenter/view/ISpecialNodeView.java
6c01a0eb245e30f75af815a6fa55081c18ebacb2
[]
no_license
mindnsoul2003/Raksha
b2f61d96b59a14e9dfb4ae279fc483b624713b2e
2533cdbb448ee25ff355f826bc1f97cabedfdafe
refs/heads/master
2021-01-17T16:43:35.551343
2014-02-19T19:28:43
2014-02-19T19:28:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
137
java
package net.sf.anathema.platform.tree.presenter.view; public interface ISpecialNodeView extends SpecialControl { String getNodeId(); }
[ "ursreupke@gmail.com" ]
ursreupke@gmail.com
e8b94c658cab6c762190c4ff255decd0dfb320e8
84d35af6e763527dfc4f2af66db9aace76f12eb1
/kit/src/androidTest/java/com/jerryjin/kit/ExampleInstrumentedTest.java
8eb14d617f9301df52cd6af4a9e22ef1286e696d
[ "Apache-2.0" ]
permissive
JerryJin93/AndroidCommonKit
af27866fe00bb6c232733aedd4439e93e1b60e67
e99df0640b1ca9fa6c1eef4b8995f14cc370d750
refs/heads/master
2022-06-05T06:23:02.808669
2022-05-12T03:21:00
2022-05-12T03:21:00
193,690,561
0
0
null
null
null
null
UTF-8
Java
false
false
708
java
package com.jerryjin.kit; import android.content.Context; import androidx.test.InstrumentationRegistry; import androidx.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.jerryjin.kit.test", appContext.getPackageName()); } }
[ "JerryJin93@users.noreply.github.com" ]
JerryJin93@users.noreply.github.com
904b98a3d10fa9ecc26e26c0732d9d06a47da215
074c1ac5890ec4fff064e435486de496219aed19
/java.src/br/com/fatec/model/factory/FabricaConexao.java
a0a7ecb816525dd109834b4948a88cf375ee54d4
[]
no_license
fatecanos/Crud-Callcenter
4de396b26d0a4ec62a385435188506d96a857c69
f20bc2f7c19d4ea2e67b3d265b9249ce5605e3a0
refs/heads/master
2020-05-18T08:15:52.158027
2019-05-04T22:13:01
2019-05-04T22:13:01
184,288,814
0
0
null
2019-05-04T22:13:02
2019-04-30T15:39:43
Java
MacCentralEurope
Java
false
false
1,933
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 br.com.fatec.model.factory; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class FabricaConexao { private static final String DRIVER = "org.mysql.Driver"; private static final String URL = "jdbc:mysql://localhost:5432/callcenter"; private static final String USER = ""; private static final String PASS = ""; public static Connection getConexao(){ try { Class.forName(DRIVER); return DriverManager.getConnection(URL, USER, PASS); } catch (ClassNotFoundException | SQLException e){ throw new RuntimeException("Erro de conex„o", e); } } public static void fecharConexao(Connection conn){ if(conn != null){ try { conn.close(); } catch (SQLException ex) { System.err.println("Erro ao fechar conexao"+ex.getMessage()); } } } public static void fecharConexao(Connection conn, PreparedStatement pstm){ if(pstm!=null){ try { pstm.close(); } catch (SQLException ex) { System.err.println("Erro ao fechar conexao"+ex.getMessage()); } } fecharConexao(conn); } public static void fecharConexao(Connection conn, PreparedStatement pstm, ResultSet rs){ if(rs!=null){ try { rs.close(); } catch (SQLException ex){ System.err.println("Erro ao fechar conexao"+ex.getMessage()); } } fecharConexao(conn, pstm); } }
[ "lucasnogueiratdm@hotmail.com" ]
lucasnogueiratdm@hotmail.com
9c3a1925fe8b9401d8afebf00f998e587368e7c5
d05cf6ca0ec1c1155de78d5e14b39f7773756eac
/src/main/java/br/edu/ifpb/collegialis/model/Coordenacao.java
e52b93b180f3f66d2ec7d12f98d2fb1f28f6e4c1
[]
no_license
henriquefeIix/collegialis
6b531aff89af98485fff9d0c7531944a7572a3a1
f4663c782ac3c1df8269e70d7ae01d9e2711369a
refs/heads/master
2022-05-21T05:03:50.539142
2022-03-23T12:31:07
2022-03-23T12:31:07
216,666,666
0
0
null
null
null
null
UTF-8
Java
false
false
1,594
java
package br.edu.ifpb.collegialis.model; import java.io.Serializable; import java.util.Objects; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; @Entity public class Coordenacao implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "coordenacao_sequence") @SequenceGenerator(name = "coordenacao_sequence", sequenceName = "coordenacao_seq_id", initialValue = 3, allocationSize = 1) private Long id; @OneToOne private Curso curso; private boolean ativo; @OneToOne private Professor coordenador; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Curso getCurso() { return curso; } public void setCurso(Curso curso) { this.curso = curso; } public boolean isAtivo() { return ativo; } public void setAtivo(boolean ativo) { this.ativo = ativo; } public Professor getCoordenador() { return coordenador; } public void setCoordenador(Professor coordenador) { this.coordenador = coordenador; } @Override public int hashCode() { return Objects.hash(id); } @Override public boolean equals(Object obj) { Coordenacao other = (Coordenacao) obj; return this.id == other.id; } }
[ "henriquefelix@outlook.com.br" ]
henriquefelix@outlook.com.br