blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
4379b22f149aab9f14a3f2b66f5cf48fd1768d46
d228e94c6215d2e4eafee7718e984250b7304ca7
/core/src/main/java/software/amazon/awssdk/internal/config/HostRegexToRegionMappingJsonHelper.java
a98f17dc495f452dd55e16e9d314c6901f9ff5bc
[ "Apache-2.0" ]
permissive
eliaslevy/aws-sdk-java-v2
2269ac24c53e846f4b710c74fbb14492c0d13ed9
0f83fa15ead8890f4f7137551868892d90a0744d
refs/heads/master
2021-01-23T18:24:19.083969
2017-09-06T17:01:38
2017-09-06T22:08:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,438
java
/* * Copyright 2010-2017 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 software.amazon.awssdk.internal.config; /** * Builder class for HostRegexToRegionMapping which exposes its property * setters. */ public class HostRegexToRegionMappingJsonHelper implements Builder<HostRegexToRegionMapping> { private String hostNameRegex; private String regionName; public HostRegexToRegionMappingJsonHelper() { } public String getHostNameRegex() { return hostNameRegex; } public void setHostNameRegex(String hostNameRegex) { this.hostNameRegex = hostNameRegex; } public String getRegionName() { return regionName; } public void setRegionName(String regionName) { this.regionName = regionName; } @Override public HostRegexToRegionMapping build() { return new HostRegexToRegionMapping(hostNameRegex, regionName); } }
9578eea2d12018c7be8f338dae78a195cfd3ec14
ddc8590202f124646dd662d5fd0444587c82bf6d
/src/dynamic/classGenerator/CodeReaderFromFile.java
4d4e19f8097fa031a5804c30b3a1ee47097ade25
[]
no_license
saharajiv/RunTimeClassGenerator
14ea6037fe597ad69814209dfed8e228abe5a121
221008b34b90001ff0c201b5bdb0da6f16a16e14
refs/heads/master
2021-04-26T23:58:37.186078
2018-03-05T08:41:34
2018-03-05T08:41:34
123,888,109
0
0
null
null
null
null
UTF-8
Java
false
false
4,164
java
package dynamic.classGenerator; import sun.misc.Unsafe; import javax.tools.*; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URI; import java.net.URISyntaxException; import static java.util.Collections.singletonList; import static javax.tools.JavaFileObject.Kind.SOURCE; /** * by Rajib Saha */ public class CodeReaderFromFile { public void dynamicClassCreation() throws ClassNotFoundException, IllegalAccessException, InstantiationException, URISyntaxException, NoSuchFieldException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException { Class noparams[] = {}; final String className = "HelloWorld"; final String path = "com.bounded.buffer"; final String fullClassName = path.replace('.', '/') + "/" + className; final StringBuilder source = new StringBuilder(); source.append("package " + path + ";"); source.append("public class " + className + " {\n"); source.append(" public void printIt() {\n"); source.append(" System.out.println( \"HelloWorld - Java Dynamic Class Creation written by Rajib. More are to come...\\n\");" + "printSomethingElse(\"this is wonderful\");"); source.append(" }\n"); //another method source.append(" public void printSomethingElse(String st) {\n"); source.append(" System.out.println( \"Here's something more to it. \");"); source.append(" System.out.println(st);"); source.append(" }\n"); source.append("}\n"); System.out.println(source); // A byte array output stream containing the bytes that would be written to the .class file final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); final SimpleJavaFileObject simpleJavaFileObject = new SimpleJavaFileObject(URI.create(fullClassName + ".java"), SOURCE) { @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) { return source; } @Override public OutputStream openOutputStream() throws IOException { return byteArrayOutputStream; } }; final JavaFileManager javaFileManager = new ForwardingJavaFileManager( ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null)) { @Override public JavaFileObject getJavaFileForOutput(Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException { return simpleJavaFileObject; } }; ToolProvider.getSystemJavaCompiler().getTask( null, javaFileManager, null, null, null, singletonList(simpleJavaFileObject)).call(); final byte[] bytes = byteArrayOutputStream.toByteArray(); // use the unsafe class to load in the class bytes final Field f = Unsafe.class.getDeclaredField("theUnsafe"); f.setAccessible(true); final Unsafe unsafe = (Unsafe) f.get(null); final Class aClass = unsafe.defineClass(fullClassName, bytes, 0, bytes.length,this.getClass().getClassLoader(),this.getClass().getProtectionDomain()); final Object o = aClass.newInstance(); Method method = aClass.getDeclaredMethod("printIt", noparams); method.invoke(o, null); //System.out.println(o); } public static final void main(String... args) throws ClassNotFoundException, URISyntaxException, NoSuchFieldException, InstantiationException, IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException { new CodeReaderFromFile().dynamicClassCreation(); } }
3e448dac756fdb3e4f130278c4cc97b67dca0bd6
633f9b4f288975ed75fdf680cfe781f978f44efc
/lib/src/test/java/com/auth0/jwt/impl/ClaimsHolderTest.java
87cc9800e69fbd5608ee655ee2eed593e603d6e4
[ "MIT" ]
permissive
SummersRemote/java-jwt
334632d85e2bd1809e91b3d9283ea2ff53252d52
79ed2431f0f3b35bff1e1a461ba1a240ca4aa8f2
refs/heads/master
2022-08-03T15:07:21.264756
2020-04-24T19:24:56
2020-04-24T19:24:56
271,160,468
1
0
MIT
2020-06-10T02:44:29
2020-06-10T02:44:28
null
UTF-8
Java
false
false
1,101
java
package com.auth0.jwt.impl; import org.hamcrest.collection.IsMapContaining; import org.junit.Test; import java.util.HashMap; import java.util.Map; import static org.hamcrest.Matchers.*; import static org.junit.Assert.assertThat; public class ClaimsHolderTest { @SuppressWarnings("RedundantCast") @Test public void shouldGetClaims() throws Exception { HashMap<String, Object> claims = new HashMap<>(); claims.put("iss", "auth0"); ClaimsHolder holder = new ClaimsHolder(claims); assertThat(holder, is(notNullValue())); assertThat(holder.getClaims(), is(notNullValue())); assertThat(holder.getClaims(), is(instanceOf(Map.class))); assertThat(holder.getClaims(), is(IsMapContaining.hasEntry("iss", (Object) "auth0"))); } @Test public void shouldGetNotNullClaims() throws Exception { ClaimsHolder holder = new ClaimsHolder(null); assertThat(holder, is(notNullValue())); assertThat(holder.getClaims(), is(notNullValue())); assertThat(holder.getClaims(), is(instanceOf(Map.class))); } }
b0891ebc0c4766f34c78214566c3173d7b56431b
955ea88f503860c4a7f973ccf383e0e093d719a9
/FPGA_Tool/src/com/nathanormond/network/components/MySocket.java
2cf898256382c7312a980b7607ac0697f0bcdde1
[]
no_license
NathOrmond/fpga-dev-tool
f69ad694362bcf51220114e3d9380252c43829ab
10c1afcffd789b345e78ca29744da0121b5fe27e
refs/heads/master
2022-06-20T02:26:07.191006
2020-05-09T07:53:52
2020-05-09T07:53:52
247,344,961
1
0
null
null
null
null
UTF-8
Java
false
false
1,017
java
package com.nathanormond.network.components; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; import java.net.UnknownHostException; public class MySocket { public DatagramSocket serverSocket; private static int timeout = 1000; private int myPort; /** * opens a socket on port * @return */ public boolean openSocket(int myPort) { try { this.myPort = myPort; this.serverSocket = new DatagramSocket(this.myPort); this.serverSocket.setSoTimeout(timeout); this.serverSocket.setReceiveBufferSize(99999999); System.out.printf("Listening on udp:%s:%d:%n", InetAddress.getLocalHost().getHostAddress(), this.myPort); return true; } catch (SocketException e) { e.printStackTrace(); } catch (UnknownHostException e) { e.printStackTrace(); } return false; } /** * closes my socket * * @return */ public boolean closeSocket() { this.serverSocket.close(); return true; } }
a1b307b7cf9f2ea3ab49a749669845878b34e8f5
3657bc95862cf72a359147ec60ff9bc35b2125bf
/src/br/registro/dnsshim/xfrd/ui/protocol/writer/RemoveKeyResponseWriter.java
2648da176fd055d24493985885a644387a891c58
[]
no_license
ctodobom/dnsshim
90beb09058c7b4d5ef2bfb55617f0f8bf0df51fc
4bb532eace8f7a6c0e5ed03be2841214838a6f25
refs/heads/master
2021-04-29T15:04:51.188557
2018-02-16T19:12:42
2018-02-16T19:12:42
121,789,822
0
0
null
2018-02-16T19:09:47
2018-02-16T19:09:47
null
UTF-8
Java
false
false
2,891
java
/* Copyright (C) 2009 Registro.br. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * 1. Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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 REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL REGISTRO.BR 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 br.registro.dnsshim.xfrd.ui.protocol.writer; import java.io.ByteArrayOutputStream; import java.io.IOException; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import br.registro.dnsshim.xfrd.ui.protocol.RemoveKeyResponse; public class RemoveKeyResponseWriter extends UiResponseWriter<RemoveKeyResponse> { private static RemoveKeyResponseWriter instance; private RemoveKeyResponseWriter() {} public static synchronized RemoveKeyResponseWriter getInstance() { if (instance == null) { instance = new RemoveKeyResponseWriter(); } return instance; } @Override public String write(RemoveKeyResponse response) throws XMLStreamException, IOException { XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); ByteArrayOutputStream stream = new ByteArrayOutputStream(); XMLStreamWriter writer = outputFactory.createXMLStreamWriter(stream, ENCODING); writer.writeStartDocument(ENCODING, ENCODING_VERSION); writer.writeStartElement("dnsshim"); writer.writeAttribute("version", DNSSHIM_PROTOCOL_VERSION); writer.writeStartElement("response"); writer.writeStartElement("status"); writer.writeCharacters(String.valueOf(response.getStatus().getValue())); writer.writeEndElement(); if (!response.getMsg().isEmpty()) { writer.writeStartElement("msg"); writer.writeCharacters(response.getMsg()); writer.writeEndElement(); } writer.writeEndElement(); writer.writeEndDocument(); writer.flush(); writer.close(); stream.close(); return stream.toString(); } }
665a253cb8870a2a5857109d653656f9a26fc1d2
521a130e155a7579da1775883d0694be36347896
/maven_demo/src/main/java/cn/itcast/Demo.java
1d0e6dc3e1e67a35db2be33c5597977193c2c316
[]
no_license
yuanshaohao/javaee326_1
4f7b826a622e1ad21e790e5198936177a7cf5a80
0ed6184c6338ee171b2dc8525a64352b20d86d42
refs/heads/master
2020-04-08T03:53:52.645597
2018-11-25T03:46:53
2018-11-25T03:46:53
158,994,198
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package cn.itcast; public class Demo { public static void main(String[] args) { System.out.println("aaaaaa"); System.out.println("bbbb"); System.out.println("ccccc"); System.out.println("idea"); System.out.println("xiaowugui"); } }
4950326d7fc12655d2d422923b9d8247b2b19931
fdd4cc6f8b5a473c0081af5302cb19c34433a0cf
/src/modules/agrega/ModificadorWeb/src/main/java/es/pode/modificador/presentacion/informes/tarea/InformeTareaFormImpl.java
a0c31637d9618736f38db231b6bcfe0d95286b42
[]
no_license
nwlg/Colony
0170b0990c1f592500d4869ec8583a1c6eccb786
07c908706991fc0979e4b6c41d30812d861776fb
refs/heads/master
2021-01-22T05:24:40.082349
2010-12-23T14:49:00
2010-12-23T14:49:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
34,403
java
// license-header java merge-point package es.pode.modificador.presentacion.informes.tarea; public class InformeTareaFormImpl extends org.apache.struts.validator.ValidatorForm implements java.io.Serializable , es.pode.modificador.presentacion.informes.tarea.ObtenerDatosForm { private java.lang.String id; private java.lang.Object[] idValueList; private java.lang.Object[] idLabelList; private java.lang.String resultadoTarea; private java.lang.Object[] resultadoTareaValueList; private java.lang.Object[] resultadoTareaLabelList; private java.lang.String action; private java.lang.Object[] actionValueList; private java.lang.Object[] actionLabelList; private java.lang.String tipoBusqueda; private java.lang.Object[] tipoBusquedaValueList; private java.lang.Object[] tipoBusquedaLabelList; private java.lang.String nombreTarea; private java.lang.Object[] nombreTareaValueList; private java.lang.Object[] nombreTareaLabelList; private java.util.List odes = null; private java.lang.Object[] odesValueList; private java.lang.Object[] odesLabelList; private java.lang.String idModificacion; private java.lang.Object[] idModificacionValueList; private java.lang.Object[] idModificacionLabelList; private java.lang.String idiomaBuscador; private java.lang.Object[] idiomaBuscadorValueList; private java.lang.Object[] idiomaBuscadorLabelList; private java.lang.String descResultado; private java.lang.Object[] descResultadoValueList; private java.lang.Object[] descResultadoLabelList; public InformeTareaFormImpl() { } /** * Resets the given <code>id</code>. */ public void resetId() { this.id = null; } public void setId(java.lang.String id) { this.id = id; } /** * */ public java.lang.String getId() { return this.id; } public java.lang.Object[] getIdBackingList() { java.lang.Object[] values = this.idValueList; java.lang.Object[] labels = this.idLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getIdValueList() { return this.idValueList; } public void setIdValueList(java.lang.Object[] idValueList) { this.idValueList = idValueList; } public java.lang.Object[] getIdLabelList() { return this.idLabelList; } public void setIdLabelList(java.lang.Object[] idLabelList) { this.idLabelList = idLabelList; } public void setIdBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setIdBackingList requires non-null property arguments"); } this.idValueList = null; this.idLabelList = null; if (items != null) { this.idValueList = new java.lang.Object[items.size()]; this.idLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.idValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.idLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setIdBackingList encountered an exception", ex); } } } /** * Resets the given <code>resultadoTarea</code>. */ public void resetResultadoTarea() { this.resultadoTarea = null; } public void setResultadoTarea(java.lang.String resultadoTarea) { this.resultadoTarea = resultadoTarea; } /** * */ public java.lang.String getResultadoTarea() { return this.resultadoTarea; } public java.lang.Object[] getResultadoTareaBackingList() { java.lang.Object[] values = this.resultadoTareaValueList; java.lang.Object[] labels = this.resultadoTareaLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getResultadoTareaValueList() { return this.resultadoTareaValueList; } public void setResultadoTareaValueList(java.lang.Object[] resultadoTareaValueList) { this.resultadoTareaValueList = resultadoTareaValueList; } public java.lang.Object[] getResultadoTareaLabelList() { return this.resultadoTareaLabelList; } public void setResultadoTareaLabelList(java.lang.Object[] resultadoTareaLabelList) { this.resultadoTareaLabelList = resultadoTareaLabelList; } public void setResultadoTareaBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setResultadoTareaBackingList requires non-null property arguments"); } this.resultadoTareaValueList = null; this.resultadoTareaLabelList = null; if (items != null) { this.resultadoTareaValueList = new java.lang.Object[items.size()]; this.resultadoTareaLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.resultadoTareaValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.resultadoTareaLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setResultadoTareaBackingList encountered an exception", ex); } } } /** * Resets the given <code>action</code>. */ public void resetAction() { this.action = null; } public void setAction(java.lang.String action) { this.action = action; } /** * */ public java.lang.String getAction() { return this.action; } public java.lang.Object[] getActionBackingList() { java.lang.Object[] values = this.actionValueList; java.lang.Object[] labels = this.actionLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getActionValueList() { return this.actionValueList; } public void setActionValueList(java.lang.Object[] actionValueList) { this.actionValueList = actionValueList; } public java.lang.Object[] getActionLabelList() { return this.actionLabelList; } public void setActionLabelList(java.lang.Object[] actionLabelList) { this.actionLabelList = actionLabelList; } public void setActionBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setActionBackingList requires non-null property arguments"); } this.actionValueList = null; this.actionLabelList = null; if (items != null) { this.actionValueList = new java.lang.Object[items.size()]; this.actionLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.actionValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.actionLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setActionBackingList encountered an exception", ex); } } } /** * Resets the given <code>tipoBusqueda</code>. */ public void resetTipoBusqueda() { this.tipoBusqueda = null; } public void setTipoBusqueda(java.lang.String tipoBusqueda) { this.tipoBusqueda = tipoBusqueda; } /** * */ public java.lang.String getTipoBusqueda() { return this.tipoBusqueda; } public java.lang.Object[] getTipoBusquedaBackingList() { java.lang.Object[] values = this.tipoBusquedaValueList; java.lang.Object[] labels = this.tipoBusquedaLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getTipoBusquedaValueList() { return this.tipoBusquedaValueList; } public void setTipoBusquedaValueList(java.lang.Object[] tipoBusquedaValueList) { this.tipoBusquedaValueList = tipoBusquedaValueList; } public java.lang.Object[] getTipoBusquedaLabelList() { return this.tipoBusquedaLabelList; } public void setTipoBusquedaLabelList(java.lang.Object[] tipoBusquedaLabelList) { this.tipoBusquedaLabelList = tipoBusquedaLabelList; } public void setTipoBusquedaBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setTipoBusquedaBackingList requires non-null property arguments"); } this.tipoBusquedaValueList = null; this.tipoBusquedaLabelList = null; if (items != null) { this.tipoBusquedaValueList = new java.lang.Object[items.size()]; this.tipoBusquedaLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.tipoBusquedaValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.tipoBusquedaLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setTipoBusquedaBackingList encountered an exception", ex); } } } /** * Resets the given <code>nombreTarea</code>. */ public void resetNombreTarea() { this.nombreTarea = null; } public void setNombreTarea(java.lang.String nombreTarea) { this.nombreTarea = nombreTarea; } /** * */ public java.lang.String getNombreTarea() { return this.nombreTarea; } public java.lang.Object[] getNombreTareaBackingList() { java.lang.Object[] values = this.nombreTareaValueList; java.lang.Object[] labels = this.nombreTareaLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getNombreTareaValueList() { return this.nombreTareaValueList; } public void setNombreTareaValueList(java.lang.Object[] nombreTareaValueList) { this.nombreTareaValueList = nombreTareaValueList; } public java.lang.Object[] getNombreTareaLabelList() { return this.nombreTareaLabelList; } public void setNombreTareaLabelList(java.lang.Object[] nombreTareaLabelList) { this.nombreTareaLabelList = nombreTareaLabelList; } public void setNombreTareaBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setNombreTareaBackingList requires non-null property arguments"); } this.nombreTareaValueList = null; this.nombreTareaLabelList = null; if (items != null) { this.nombreTareaValueList = new java.lang.Object[items.size()]; this.nombreTareaLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.nombreTareaValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.nombreTareaLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setNombreTareaBackingList encountered an exception", ex); } } } /** * Resets the given <code>odes</code>. */ public void resetOdes() { this.odes = null; } public void setOdes(java.util.List odes) { this.odes = odes; } /** * */ public java.util.List getOdes() { return this.odes; } public void setOdesAsArray(Object[] odes) { this.odes = (odes == null) ? null : java.util.Arrays.asList(odes); } /** * Returns this collection as an array, if the collection itself would be <code>null</code> this method * will also return <code>null</code>. * * @see es.pode.modificador.presentacion.informes.tarea.InformeTareaFormImpl#getOdes */ public java.lang.Object[] getOdesAsArray() { return (odes == null) ? null : odes.toArray(); } public java.lang.Object[] getOdesBackingList() { java.lang.Object[] values = this.odesValueList; java.lang.Object[] labels = this.odesLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getOdesValueList() { return this.odesValueList; } public void setOdesValueList(java.lang.Object[] odesValueList) { this.odesValueList = odesValueList; } public java.lang.Object[] getOdesLabelList() { return this.odesLabelList; } public void setOdesLabelList(java.lang.Object[] odesLabelList) { this.odesLabelList = odesLabelList; } public void setOdesBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setOdesBackingList requires non-null property arguments"); } this.odesValueList = null; this.odesLabelList = null; if (items != null) { this.odesValueList = new java.lang.Object[items.size()]; this.odesLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.odesValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.odesLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setOdesBackingList encountered an exception", ex); } } } /** * Resets the given <code>idModificacion</code>. */ public void resetIdModificacion() { this.idModificacion = null; } public void setIdModificacion(java.lang.String idModificacion) { this.idModificacion = idModificacion; } /** * */ public java.lang.String getIdModificacion() { return this.idModificacion; } public java.lang.Object[] getIdModificacionBackingList() { java.lang.Object[] values = this.idModificacionValueList; java.lang.Object[] labels = this.idModificacionLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getIdModificacionValueList() { return this.idModificacionValueList; } public void setIdModificacionValueList(java.lang.Object[] idModificacionValueList) { this.idModificacionValueList = idModificacionValueList; } public java.lang.Object[] getIdModificacionLabelList() { return this.idModificacionLabelList; } public void setIdModificacionLabelList(java.lang.Object[] idModificacionLabelList) { this.idModificacionLabelList = idModificacionLabelList; } public void setIdModificacionBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setIdModificacionBackingList requires non-null property arguments"); } this.idModificacionValueList = null; this.idModificacionLabelList = null; if (items != null) { this.idModificacionValueList = new java.lang.Object[items.size()]; this.idModificacionLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.idModificacionValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.idModificacionLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setIdModificacionBackingList encountered an exception", ex); } } } /** * Resets the given <code>idiomaBuscador</code>. */ public void resetIdiomaBuscador() { this.idiomaBuscador = null; } public void setIdiomaBuscador(java.lang.String idiomaBuscador) { this.idiomaBuscador = idiomaBuscador; } /** * */ public java.lang.String getIdiomaBuscador() { return this.idiomaBuscador; } public java.lang.Object[] getIdiomaBuscadorBackingList() { java.lang.Object[] values = this.idiomaBuscadorValueList; java.lang.Object[] labels = this.idiomaBuscadorLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getIdiomaBuscadorValueList() { return this.idiomaBuscadorValueList; } public void setIdiomaBuscadorValueList(java.lang.Object[] idiomaBuscadorValueList) { this.idiomaBuscadorValueList = idiomaBuscadorValueList; } public java.lang.Object[] getIdiomaBuscadorLabelList() { return this.idiomaBuscadorLabelList; } public void setIdiomaBuscadorLabelList(java.lang.Object[] idiomaBuscadorLabelList) { this.idiomaBuscadorLabelList = idiomaBuscadorLabelList; } public void setIdiomaBuscadorBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setIdiomaBuscadorBackingList requires non-null property arguments"); } this.idiomaBuscadorValueList = null; this.idiomaBuscadorLabelList = null; if (items != null) { this.idiomaBuscadorValueList = new java.lang.Object[items.size()]; this.idiomaBuscadorLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.idiomaBuscadorValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.idiomaBuscadorLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setIdiomaBuscadorBackingList encountered an exception", ex); } } } /** * Resets the given <code>descResultado</code>. */ public void resetDescResultado() { this.descResultado = null; } public void setDescResultado(java.lang.String descResultado) { this.descResultado = descResultado; } /** * */ public java.lang.String getDescResultado() { return this.descResultado; } public java.lang.Object[] getDescResultadoBackingList() { java.lang.Object[] values = this.descResultadoValueList; java.lang.Object[] labels = this.descResultadoLabelList; if (values == null || values.length == 0) { return values; } if (labels == null || labels.length == 0) { labels = values; } final int length = java.lang.Math.min(labels.length, values.length); java.lang.Object[] backingList = new java.lang.Object[length]; for (int i=0; i<length; i++) { backingList[i] = new LabelValue(labels[i], values[i]); } return backingList; } public java.lang.Object[] getDescResultadoValueList() { return this.descResultadoValueList; } public void setDescResultadoValueList(java.lang.Object[] descResultadoValueList) { this.descResultadoValueList = descResultadoValueList; } public java.lang.Object[] getDescResultadoLabelList() { return this.descResultadoLabelList; } public void setDescResultadoLabelList(java.lang.Object[] descResultadoLabelList) { this.descResultadoLabelList = descResultadoLabelList; } public void setDescResultadoBackingList(java.util.Collection items, java.lang.String valueProperty, java.lang.String labelProperty) { if (valueProperty == null || labelProperty == null) { throw new IllegalArgumentException("InformeTareaFormImpl.setDescResultadoBackingList requires non-null property arguments"); } this.descResultadoValueList = null; this.descResultadoLabelList = null; if (items != null) { this.descResultadoValueList = new java.lang.Object[items.size()]; this.descResultadoLabelList = new java.lang.Object[items.size()]; try { int i = 0; for (java.util.Iterator iterator = items.iterator(); iterator.hasNext(); i++) { final java.lang.Object item = iterator.next(); this.descResultadoValueList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, valueProperty); this.descResultadoLabelList[i] = org.apache.commons.beanutils.PropertyUtils.getProperty(item, labelProperty); } } catch (Exception ex) { throw new java.lang.RuntimeException("InformeTareaFormImpl.setDescResultadoBackingList encountered an exception", ex); } } } /** * @see org.apache.struts.validator.ValidatorForm#reset(org.apache.struts.action.ActionMapping,javax.servlet.http.HttpServletRequest) */ public void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { this.idiomaBuscador = null; } public java.lang.String toString() { org.apache.commons.lang.builder.ToStringBuilder builder = new org.apache.commons.lang.builder.ToStringBuilder(this); builder.append("id", this.id); builder.append("resultadoTarea", this.resultadoTarea); builder.append("action", this.action); builder.append("tipoBusqueda", this.tipoBusqueda); builder.append("nombreTarea", this.nombreTarea); builder.append("odes", this.odes); builder.append("idModificacion", this.idModificacion); builder.append("idiomaBuscador", this.idiomaBuscador); builder.append("descResultado", this.descResultado); return builder.toString(); } /** * Allows you to clean all values from this form. Objects will be set to <code>null</code>, numeric values will be * set to zero and boolean values will be set to <code>false</code>. Backinglists for selectable fields will * also be set to <code>null</code>. */ public void clean() { this.id = null; this.idValueList = null; this.idLabelList = null; this.resultadoTarea = null; this.resultadoTareaValueList = null; this.resultadoTareaLabelList = null; this.action = null; this.actionValueList = null; this.actionLabelList = null; this.tipoBusqueda = null; this.tipoBusquedaValueList = null; this.tipoBusquedaLabelList = null; this.nombreTarea = null; this.nombreTareaValueList = null; this.nombreTareaLabelList = null; this.odes = null; this.odesValueList = null; this.odesLabelList = null; this.idModificacion = null; this.idModificacionValueList = null; this.idModificacionLabelList = null; this.idiomaBuscador = null; this.idiomaBuscadorValueList = null; this.idiomaBuscadorLabelList = null; this.descResultado = null; this.descResultadoValueList = null; this.descResultadoLabelList = null; } /** * Override to provide population of current form with request parameters when validation fails. * * @see org.apache.struts.action.ActionForm#validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest) */ public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { final org.apache.struts.action.ActionErrors errors = super.validate(mapping, request); if (errors != null && !errors.isEmpty()) { // we populate the current form with only the request parameters Object currentForm = request.getSession().getAttribute("form"); // if we can't get the 'form' from the session, try from the request if (currentForm == null) { currentForm = request.getAttribute("form"); } if (currentForm != null) { final java.util.Map parameters = new java.util.HashMap(); for (final java.util.Enumeration names = request.getParameterNames(); names.hasMoreElements();) { final String name = String.valueOf(names.nextElement()); parameters.put(name, request.getParameter(name)); } try { org.apache.commons.beanutils.BeanUtils.populate(currentForm, parameters); } catch (java.lang.Exception populateException) { // ignore if we have an exception here (we just don't populate). } } } return errors; } public final static class LabelValue { private java.lang.Object label = null; private java.lang.Object value = null; public LabelValue(Object label, java.lang.Object value) { this.label = label; this.value = value; } public java.lang.Object getLabel() { return this.label; } public java.lang.Object getValue() { return this.value; } public java.lang.String toString() { return label + "=" + value; } } }
bd554e95ddd6c9828e193192b3eedd3c26b6fcc3
77af1003dcf1bb8106a5d1cef5fb8b0ab061124a
/java_tools/configuration_definition/src/main/java/com/rusefi/output/BaseCHeaderConsumer.java
db57b265e2615f891792ad0ad4c01d77d32993a5
[]
no_license
inalireza/rusefi
1712c28acc14a923aa4466f045c2f938d9603af8
41e8888cb4c237cc1470c6c802c9ac9e8bf05901
refs/heads/master
2023-08-06T00:09:22.603993
2021-10-06T04:38:37
2021-10-06T04:38:37
414,241,196
1
0
null
null
null
null
UTF-8
Java
false
false
2,698
java
package com.rusefi.output; import com.rusefi.*; import static com.rusefi.ConfigDefinition.EOL; public abstract class BaseCHeaderConsumer implements ConfigurationConsumer { private static final String BOOLEAN_TYPE = "bool"; private final StringBuilder content = new StringBuilder(); public static String getHeaderText(ConfigField configField, int currentOffset, int bitIndex) { if (configField.isBit()) { String comment = "\t/**" + EOL + ConfigDefinition.packComment(configField.getCommentContent(), "\t") + "\toffset " + currentOffset + " bit " + bitIndex + " */" + EOL; return comment + "\t" + BOOLEAN_TYPE + " " + configField.getName() + " : 1;" + EOL; } String cEntry = ConfigDefinition.getComment(configField.getCommentContent(), currentOffset, configField.getUnits()); if (!configField.isArray()) { // not an array cEntry += "\t" + configField.getType() + " " + configField.getName(); if (ConfigDefinition.needZeroInit && TypesHelper.isPrimitive(configField.getType())) { // we need this cast in case of enums cEntry += " = (" + configField.getType() + ")0"; } cEntry += ";" + EOL; } else { cEntry += "\t" + configField.getType() + " " + configField.getName() + "[" + configField.arraySizeVariableName + "];" + EOL; } return cEntry; } @Override public void handleEndStruct(ConfigStructure structure) { if (structure.comment != null) { content.append("/**" + EOL + ConfigDefinition.packComment(structure.comment, "") + EOL + "*/" + EOL); } content.append("// start of " + structure.name + EOL); content.append("struct " + structure.name + " {" + EOL); if (structure.isWithConstructor()) { content.append("\t" + structure.name + "();" + EOL); } int currentOffset = 0; BitState bitState = new BitState(); for (int i = 0; i < structure.cFields.size(); i++) { ConfigField cf = structure.cFields.get(i); content.append(BaseCHeaderConsumer.getHeaderText(cf, currentOffset, bitState.get())); ConfigField next = i == structure.cFields.size() - 1 ? ConfigField.VOID : structure.cFields.get(i + 1); bitState.incrementBitIndex(cf, next); currentOffset += cf.getSize(next); } content.append("\t/** total size " + currentOffset + "*/" + EOL); content.append("};" + EOL + EOL); } public StringBuilder getContent() { return content; } @Override public void startFile() { } }
[ "sdfsdfqsf2334234234" ]
sdfsdfqsf2334234234
12fc92990a1aef458760af7c05d7365faedf2180
615f89b20f3363b4b238215f9ae4a78e2aaae4f9
/app/src/main/java/net/movilbox/dcsuruguay/Model/ReferenciasEquipos.java
582b144fb1f08cba848dcfa3cc5091f000454acf
[]
no_license
dpatricialopez/DCSURUGUA
bbe2b86f85d7d28909c03dc75ff794e9c4c6d2f8
37ef6beb108126af33fa8500e939cef36bb39674
refs/heads/master
2021-01-12T15:13:11.679250
2016-11-12T20:42:43
2016-11-12T20:42:43
69,876,683
0
0
null
null
null
null
UTF-8
Java
false
false
6,774
java
package net.movilbox.dcsuruguay.Model; import com.google.gson.annotations.SerializedName; import java.io.Serializable; import java.util.List; public class ReferenciasEquipos implements Serializable { @SerializedName("id") private int id; @SerializedName("descripcion") private String descripcion; @SerializedName("precioventa") private double precioventa; @SerializedName("speech") private String speech; @SerializedName("pantalla") private String pantalla; @SerializedName("cam_frontal") private String cam_frontal; @SerializedName("cam_tras") private String cam_tras; @SerializedName("flash") private String flash; @SerializedName("banda") private String banda; @SerializedName("memoria") private String memoria; @SerializedName("expandible") private String expandible; @SerializedName("bateria") private String bateria; @SerializedName("bluetooth") private String bluetooth; @SerializedName("tactil") private String tactil; @SerializedName("tec_fisico") private String tec_fisico; @SerializedName("carrito_compras") private String carrito_compras; @SerializedName("correo") private String correo; @SerializedName("enrutador") private String enrutador; @SerializedName("radio") private String radio; @SerializedName("wifi") private String wifi; @SerializedName("gps") private String gps; @SerializedName("so") private String so; @SerializedName("web") private String web; @SerializedName("precio_referencia") private double precio_referencia; @SerializedName("precio_publico") private double precio_publico; @SerializedName("img") private String img; @SerializedName("list_imgs") private List<CategoriasEstandar> estandarList; @SerializedName("referencias") private List<Referencia_equipo> referenciaLis; @SerializedName("quiebre") private int quiebre; @SerializedName("estado_accion") private int estado_accion; public int getEstado_accion() { return estado_accion; } public void setEstado_accion(int estado_accion) { this.estado_accion = estado_accion; } public int getQuiebre() { return quiebre; } public void setQuiebre(int quiebre) { this.quiebre = quiebre; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public double getPrecioventa() { return precioventa; } public void setPrecioventa(double precioventa) { this.precioventa = precioventa; } public String getSpeech() { return speech; } public void setSpeech(String speech) { this.speech = speech; } public String getPantalla() { return pantalla; } public void setPantalla(String pantalla) { this.pantalla = pantalla; } public String getCam_frontal() { return cam_frontal; } public void setCam_frontal(String cam_frontal) { this.cam_frontal = cam_frontal; } public String getCam_tras() { return cam_tras; } public void setCam_tras(String cam_tras) { this.cam_tras = cam_tras; } public String getFlash() { return flash; } public void setFlash(String flash) { this.flash = flash; } public String getBanda() { return banda; } public void setBanda(String banda) { this.banda = banda; } public String getMemoria() { return memoria; } public void setMemoria(String memoria) { this.memoria = memoria; } public String getExpandible() { return expandible; } public void setExpandible(String expandible) { this.expandible = expandible; } public String getBateria() { return bateria; } public void setBateria(String bateria) { this.bateria = bateria; } public String getBluetooth() { return bluetooth; } public void setBluetooth(String bluetooth) { this.bluetooth = bluetooth; } public String getTactil() { return tactil; } public void setTactil(String tactil) { this.tactil = tactil; } public String getTec_fisico() { return tec_fisico; } public void setTec_fisico(String tec_fisico) { this.tec_fisico = tec_fisico; } public String getCarrito_compras() { return carrito_compras; } public void setCarrito_compras(String carrito_compras) { this.carrito_compras = carrito_compras; } public String getCorreo() { return correo; } public void setCorreo(String correo) { this.correo = correo; } public String getEnrutador() { return enrutador; } public void setEnrutador(String enrutador) { this.enrutador = enrutador; } public String getRadio() { return radio; } public void setRadio(String radio) { this.radio = radio; } public String getWifi() { return wifi; } public void setWifi(String wifi) { this.wifi = wifi; } public String getGps() { return gps; } public void setGps(String gps) { this.gps = gps; } public String getSo() { return so; } public void setSo(String so) { this.so = so; } public String getWeb() { return web; } public void setWeb(String web) { this.web = web; } public double getPrecio_referencia() { return precio_referencia; } public void setPrecio_referencia(double precio_referencia) { this.precio_referencia = precio_referencia; } public double getPrecio_publico() { return precio_publico; } public void setPrecio_publico(double precio_publico) { this.precio_publico = precio_publico; } public String getImg() { return img; } public void setImg(String img) { this.img = img; } public List<Referencia_equipo> getReferenciaLis() { return referenciaLis; } public void setReferenciaLis(List<Referencia_equipo> referenciaLis) { this.referenciaLis = referenciaLis; } public List<CategoriasEstandar> getEstandarList() { return estandarList; } public void setEstandarList(List<CategoriasEstandar> estandarList) { this.estandarList = estandarList; } }
6737cb4441cb491180ce14ce517ead6cf6220196
78d540ab94081574eaae208c522358341114f856
/pdfdocumentlibrary/src/main/java/com/titan/pdfdocumentlibrary/util/PdfUtil.java
04a9fe60fc8f82e32d4c0665347f8c84da9070cc
[]
no_license
ArtemisSoftware/Pdf-document
1fc321693e816a9dfce640c0064133b40b040a62
1030114d166d22f482f1c89c3cb2b879f2be0db4
refs/heads/master
2021-09-10T04:51:55.403653
2021-08-30T09:35:19
2021-08-30T09:35:19
223,045,838
0
0
null
2019-11-21T22:35:28
2019-11-20T23:20:10
Java
UTF-8
Java
false
false
6,186
java
package com.titan.pdfdocumentlibrary.util; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Environment; import com.itextpdf.text.BadElementException; import com.itextpdf.text.BaseColor; import com.itextpdf.text.Document; import com.itextpdf.text.Element; import com.itextpdf.text.Image; import com.titan.pdfdocumentlibrary.R; import com.titan.pdfdocumentlibrary.bundle.Template; import com.titan.pdfdocumentlibrary.elements.CellConfiguration; import com.titan.pdfdocumentlibrary.elements.Table; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class PdfUtil { /** * Method that generates a pdf file<br> * If a file already exists it will delete it first * @param template the class that is generating the file * @param directory the directory where the file will be created * @param name the name of the file * @return an empty file */ public static File getFile(Template template, File directory, String name) { name = template.getClass().getSimpleName() + "__" + name + PdfConstants.PDF_EXTENSION; deleteFile(directory, name); return new File(directory, name); } /** * Method that creates an error table with an exception * @param exception the exception to present on the table * @return an error table */ public static Table getErrorTable(Exception exception){ CellConfiguration cellConfigurationTitle = new CellConfiguration(); cellConfigurationTitle.horizontalAlign = Element.ALIGN_LEFT; cellConfigurationTitle.backgroundColor = BaseColor.RED; Table table = new Table(); table.addCell("ERROR", cellConfigurationTitle); table.addCell(exception.getMessage()); /* table.addCell(MetodosLog.formatarExcecao(excepcao)); */ table.setBorderColor(BaseColor.RED); return table; } /** * Method to add metadata to the document * @param context the app context * @param document the document * @param template the class that is generating the file */ public static void addMetaData(Context context, Document document, Template template) { Date currentTime = Calendar.getInstance().getTime(); SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); String formattedDate = df.format(currentTime); ApplicationInfo applicationInfo = context.getApplicationInfo(); int stringId = applicationInfo.labelRes; String appName = stringId == 0 ? applicationInfo.nonLocalizedLabel.toString() : context.getString(stringId); document.addTitle(template.getClass().getSimpleName()); document.addSubject("Date: "+ formattedDate); document.addCreator(appName); } /** * Method to delete all pdf files from a directory * @param directory the directory where the files are located */ public static void deleteAllFiles(File directory){ File[] Files = directory.listFiles(); if(Files != null) { int j; for(j = 0; j < Files.length; j++) { if(Files[j].getAbsolutePath().contains(PdfConstants.PDF_EXTENSION) == true){ Files[j].delete(); } } } } /** * Method to delete a specific pdf file from a directory * @param directory the directory where the file is located * @param fileName the name of the file */ public static void deleteFile(File directory, String fileName){ File[] Files = directory.listFiles(); if(Files != null) { int j; for(j = 0; j < Files.length; j++) { if(Files[j].getAbsolutePath().contains(PdfConstants.PDF_EXTENSION) == true && Files[j].getAbsolutePath().contains(fileName) == true){ Files[j].delete(); } } } } /** * Method to create a pdf image * @param resources the app resources * @param imageResource the image resource * @return a pdf image */ public static Image createPdfImage(Resources resources, int imageResource) { Image imagem = null; ByteArrayOutputStream stream = new ByteArrayOutputStream(); Bitmap bitmap = BitmapFactory.decodeResource(resources, imageResource); if(bitmap == null){ bitmap = BitmapFactory.decodeResource(resources, R.drawable.no_image_found); } try{ bitmap.compress(Bitmap.CompressFormat.PNG, 100 , stream); } catch(Exception e){ bitmap.compress(Bitmap.CompressFormat.JPEG, 100 , stream); } try { imagem = Image.getInstance(stream.toByteArray()); imagem.setAlignment(Image.MIDDLE); imagem.scaleToFit(250, 150); } catch (BadElementException | IOException e) { e.printStackTrace(); } return imagem; } /** * Method to create a pdf image * @param resources the app resources * @param bitmap the image resource * @return a pdf image */ public static Image createPdfImage(Resources resources, Bitmap bitmap) { Image imagem = null; ByteArrayOutputStream stream = new ByteArrayOutputStream(); if(bitmap == null){ bitmap = BitmapFactory.decodeResource(resources, R.drawable.no_image_found); } bitmap.compress(Bitmap.CompressFormat.JPEG, 100 , stream); try { imagem = Image.getInstance(stream.toByteArray()); imagem.setAlignment(Image.MIDDLE); imagem.scaleToFit(250, 150); } catch (BadElementException | IOException e) { e.printStackTrace(); } return imagem; } }
ff7294f387263fa0c46aebf2c1bac413e90f65ea
149d1fd671c10981d2e5369cd5d7dbedb946c53d
/Karnataka_Ahar/WEB-INF/src/india/ahar/controller/getDateDetails.java
b8f3c7a07d0d4f182ea493384c5638de26ef5c64
[]
no_license
suthanth/Major_Project
751fbbce0f0cd496301f06377a47e0b28f10d05f
db1726fa13efd245ea8a4aa5865ea7f680f88d90
refs/heads/master
2021-01-21T10:25:13.985477
2017-05-18T12:08:55
2017-05-18T12:08:55
91,687,747
0
0
null
null
null
null
UTF-8
Java
false
false
2,754
java
package india.ahar.controller; import india.ahar.model.DataProcess; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.struts2.interceptor.ServletRequestAware; import com.opensymphony.xwork2.ActionSupport; public class getDateDetails extends ActionSupport implements ServletRequestAware{ /** * */ private static final long serialVersionUID = 1L; HttpServletRequest request; private String id; private String bookingDate; private String wareHouseName; private String vehicleNumber; private String loadingPoint; private String material; private String quantity; private String quality; private String amount; private String rfid; private String status; public String getMydate() { return mydate; } public void setMydate(String mydate) { this.mydate = mydate; } private String mydate; public String getRfid() { return rfid; } public void setRfid(String rfid) { this.rfid = rfid; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } ArrayList<getDateDetails> list; public ArrayList<getDateDetails> getList() { return list; } public void setList(ArrayList<getDateDetails> list) { this.list = list; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getBookingDate() { return bookingDate; } public void setBookingDate(String bookingDate) { this.bookingDate = bookingDate; } public String getWareHouseName() { return wareHouseName; } public void setWareHouseName(String wareHouseName) { this.wareHouseName = wareHouseName; } public String getVehicleNumber() { return vehicleNumber; } public void setVehicleNumber(String vehicleNumber) { this.vehicleNumber = vehicleNumber; } public String getLoadingPoint() { return loadingPoint; } public void setLoadingPoint(String loadingPoint) { this.loadingPoint = loadingPoint; } public String getMaterial() { return material; } public void setMaterial(String material) { this.material = material; } public String getQuantity() { return quantity; } public void setQuantity(String quantity) { this.quantity = quantity; } public String getQuality() { return quality; } public void setQuality(String quality) { this.quality = quality; } public String getAmount() { return amount; } public void setAmount(String amount) { this.amount = amount; } public String execute(){ ArrayList<getDateDetails> al = new DataProcess().getProductDetails2(this); list = al; return "success"; } @Override public void setServletRequest(HttpServletRequest request) { this.request = request; } }
28b90636f6a62ac293c8820565135fa199116ddd
3285da87beea16ad49748af7b93e5f3388486c0e
/src/main/java/com/mobile/tool/inventory/dao/impl/InventoryItemDaoTPDBImpl.java
7c0ed5a169aea2fb100e0057a20b8645a60c4b83
[]
no_license
shashank180287/mobilepromopulgin
4a365a388d466944841bc2a9f51843bdb3c8640b
e10925a6cd2c0a9a23e588f9916bcf4954e33375
refs/heads/master
2021-01-01T16:55:04.763145
2014-07-15T15:26:01
2014-07-15T15:26:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,397
java
package com.mobile.tool.inventory.dao.impl; import java.util.List; import org.apache.commons.lang.NotImplementedException; import org.springframework.orm.hibernate3.HibernateTemplate; import com.mobile.tool.inventory.dao.InventoryItemDao; import com.mobile.tool.inventory.entity.ItemMeasure; public class InventoryItemDaoTPDBImpl implements InventoryItemDao { private HibernateTemplate tpDBHibernateTemplate; @SuppressWarnings("unchecked") @Override public List<ItemMeasure> searchItemsByServiceTypeAndSubCategory(String serviceTypeName, String subCategoryName){ return tpDBHibernateTemplate.findByNamedQueryAndNamedParam(ItemMeasure.SEARCH_ITEMS_FOR_CATEGORY, new String[]{"serviceTypeName","subCategoryName"}, new Object[]{serviceTypeName, subCategoryName}); } @Override public void addAll(List<ItemMeasure> itemMeasures) { throw new NotImplementedException("Method not suppoted for third party database"); } @Override public ItemMeasure fetchItemsByitemCode(String itemCode) { throw new NotImplementedException("Method not suppoted for third party database"); } @Override public void insertOrUpdate(ItemMeasure itemMeasure) { throw new NotImplementedException("Method not suppoted for third party database"); } @Override public void delete(ItemMeasure itemMeasure) { throw new NotImplementedException("Method not suppoted for third party database"); } }
3bc253c28f9f43b12f93f482cfbf74bfe35c87f3
354151ed9bbe284ce8f4370921240aa623d8b682
/src/main/java/ArrayStack.java
1eaf923226e57d1d195dfa6a665d9b8d5cc49684
[]
no_license
TabooNight/Algorithm_Java
f9009e158612141aad590fe3458d8160b6a6e0de
b919c1f93dbc9f342d82728f43937e74ba619caf
refs/heads/master
2022-11-28T00:24:47.889232
2020-07-28T08:11:31
2020-07-28T08:11:31
279,230,940
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
/** * 自定义栈实现 * * @author chy * @date 2020-06-09 10:37 */ public class ArrayStack<E> implements Stack<E> { Array<E> array; public ArrayStack(int capacity) { this.array = new Array<>(capacity); } public ArrayStack() { this.array = new Array<>(); } @Override public int getSize() { return this.array.getSize(); } @Override public boolean isEmpty() { return this.array.isEmpty(); } @Override public void push(E e) { this.array.addLast(e); } @Override public E pop() { return this.array.removeLast(); } @Override public E peek() { return this.array.getLast(); } private int getCapacity() { return this.array.getCapacity(); } @Override public String toString() { StringBuilder res = new StringBuilder(); res.append("Stack: "); res.append("["); for (int i = 0; i < this.array.getSize(); i++) { res.append(this.array.get(i)); if (i != this.array.getSize() - 1) { res.append(", "); } } res.append("] top"); return res.toString(); } }
16e99838ca34f617d15987109fef97c24d630498
560d91bea833528baf2f0b888e7c836b3fb5674e
/shiro.demo/src/main/java/org/levi/shiro/demo/base/MyDatabaseRealm.java
e24ca08bbd77334adedb3bcff2d4a68c4289c2a9
[]
no_license
Gh-Levi/shiro-demo
854737f428b5f9b6eff31b096a1a49c97807afcc
8e8e8819de453b40953e11f3d6b90107ed3cf597
refs/heads/master
2020-03-18T11:53:45.693812
2018-05-24T13:17:03
2018-05-24T13:17:03
134,696,682
0
0
null
null
null
null
GB18030
Java
false
false
1,651
java
package org.levi.shiro.demo.base; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.SimpleAuthenticationInfo; import org.apache.shiro.authz.AuthorizationInfo; import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.subject.PrincipalCollection; import org.levi.shiro.demo.bean.UserBean; import org.levi.shiro.demo.service.UserService; import org.springframework.beans.factory.annotation.Autowired; public class MyDatabaseRealm extends AuthorizingRealm { @Autowired private UserService userService; @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection arg0) { // TODO Auto-generated method stub return null; } @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { // TODO Auto-generated method stub if(token == null) { throw new AuthenticationException("用户名密码为空,登陆失败!"); } String username = (String)token.getPrincipal(); UserBean existUser = userService.getUserByName(username); char [] credentials = (char[]) token.getCredentials(); String currentUserPassword = String.valueOf(credentials); if(existUser != null && currentUserPassword.equals(existUser.getPassword())) { SimpleAuthenticationInfo currentAuthenInfo = new SimpleAuthenticationInfo(token.getPrincipal(), token.getCredentials(),"myRealm"); return currentAuthenInfo; }else { throw new AuthenticationException("用户名或密码错误,登陆失败!"); } } }
91ef95bfb6467b7915494c15a0691ce795455e5d
53e83d2bae4278ef5244808c615dd955f3f67577
/InternshipPortal/src/test/java/com/psl/jun21/grp3/company/CompanyRegistrationDtoTest.java
520341076e84f566fc100b9dbf337ab9b96fe93a
[]
no_license
the-invictus/PSL_Phase2_Project
b069e1fff75bbd6a1225ddd871fbef583a80561f
95bc8bac2a055644b6464dc1043ff14c4fee24e2
refs/heads/master
2023-07-31T09:04:52.911853
2021-09-30T12:39:32
2021-09-30T12:39:32
407,534,916
0
8
null
2021-09-28T04:46:06
2021-09-17T12:37:17
Java
UTF-8
Java
false
false
1,259
java
package com.psl.jun21.grp3.company; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; class CompanyRegistrationDtoTest { static CompanyRegistrationDto dto; @BeforeAll static void create() { dto = new CompanyRegistrationDto(); dto.setDomain("IT"); dto.setEmail("[email protected]"); } @Test void testGetEmail() { assertThat(dto.getEmail()).isEqualTo("[email protected]"); } @Test void testGetDomain() { assertThat(dto.getDomain()).isEqualTo("IT"); } @Test void testCompanyRegistrationDtoStringStringStringStringString() { CompanyRegistrationDto cDto = new CompanyRegistrationDto("[email protected]", "PSL", "pass", "", ""); assertThat(cDto.getCompanyName()).isEqualTo("PSL"); } @Test void testCompanyRegistrationDto() { CompanyRegistrationDto cDto = new CompanyRegistrationDto(); assertThat(cDto.getClass()).isEqualTo(CompanyRegistrationDto.class); } @Test void testToString() { assertThat(dto.toString()).isEqualTo( "CompanyRegistrationDto([email protected], companyName=null, password=null, contactNo=null, domain=IT)"); } }
5fd105479d2448a3c39d64a7d7e2f37683889875
e78dcdd6cde47d07790f81f2ed5b53430abf44f3
/SplashDemo/obj/Debug/android/src/md5ad94ae9f4e02cc60387cee1ed051db1f/LoginScreen.java
5e489b3994376febc3de72218850e8c04bfe475a
[]
no_license
MRodriguezz/ChikettoApp
a133c89f845b3c55a4cabeadb6f2c580a610a2fb
d44c9a6590f7f6cd26c1cbc953bef3fdf5103d9a
refs/heads/master
2016-08-12T17:50:04.912017
2016-03-11T21:49:58
2016-03-11T21:49:58
53,698,580
0
0
null
null
null
null
UTF-8
Java
false
false
1,150
java
package md5ad94ae9f4e02cc60387cee1ed051db1f; public class LoginScreen extends android.app.Activity implements mono.android.IGCUserPeer { static final String __md_methods; static { __md_methods = "n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler\n" + ""; mono.android.Runtime.register ("SplashAndroide.LoginScreen, SplashDemo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", LoginScreen.class, __md_methods); } public LoginScreen () throws java.lang.Throwable { super (); if (getClass () == LoginScreen.class) mono.android.TypeManager.Activate ("SplashAndroide.LoginScreen, SplashDemo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { }); } public void onCreate (android.os.Bundle p0) { n_onCreate (p0); } private native void n_onCreate (android.os.Bundle p0); java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
824312497ee71614ad87510a81c7739625db6fc6
b982d47ca8cba535fc41ce3ceec02318d1655f4d
/app/src/main/java/com/app/strkita/avoidobstacle/MainActivity.java
a7093debe4ff53d1696f90398a99eb36fa76c4e7
[]
no_license
kita83/AvoidObstacle
4ade5a54f2dff5b6d8937cc2caab1f5c37786a11
7946ff609a8cdd7a68f34ea4b02793ab9c8afb4c
refs/heads/master
2020-12-02T22:16:29.377109
2017-07-03T12:07:48
2017-07-03T12:07:48
96,106,709
0
0
null
null
null
null
UTF-8
Java
false
false
3,029
java
package com.app.strkita.avoidobstacle; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.WindowManager; public class MainActivity extends AppCompatActivity implements SensorEventListener { private AvoidObstacleView mSurfaceView; private SensorManager mSensorManager; private Sensor mMagField; private Sensor mAccelerometer; private static final int MATRIX_SIZE = 16; private float[] mgValues = new float[3]; private float[] acValues = new float[3]; public static int pitch = 0; public static int role = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); mSurfaceView = new AvoidObstacleView(this); setContentView(mSurfaceView); mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); mMagField = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); } @Override protected void onResume() { super.onResume(); mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME); mSensorManager.registerListener(this, mMagField, SensorManager.SENSOR_DELAY_GAME); } @Override protected void onPause() { super.onPause(); mSensorManager.unregisterListener(this, mAccelerometer); mSensorManager.unregisterListener(this, mMagField); } @Override public void onSensorChanged(SensorEvent event) { float[] inR = new float[MATRIX_SIZE]; float[] outR = new float[MATRIX_SIZE]; float[] I = new float[MATRIX_SIZE]; float[] orValues = new float[3]; switch (event.sensor.getType()) { case Sensor.TYPE_ACCELEROMETER: acValues = event.values.clone(); break; case Sensor.TYPE_MAGNETIC_FIELD: mgValues = event.values.clone(); break; } if (mgValues != null && acValues != null) { SensorManager.getRotationMatrix(inR, I, acValues, mgValues); // 携帯を寝かせている状態、Activityの表示が縦固定の場合 SensorManager.remapCoordinateSystem(inR, SensorManager.AXIS_X, SensorManager.AXIS_Y, outR); SensorManager.getOrientation(outR, orValues); // ラジアンを角度に pitch = rad2deg(orValues[1]); role = rad2deg(orValues[2]); } } private int rad2deg(float rad) { return (int) Math.floor(Math.toDegrees(rad)); } @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } }
c9ccb48369f699afef1aa289a5e517252a26ecc8
04ea4e556aa974c4353da06fa43fc5628a920c61
/cloud-provider-payment-8002/src/main/java/com/stewart/cloud/web/PaymentController.java
5f07cf25f654e95fba843312fde72ecaf382df75
[]
no_license
stewartTian/spring-cloud-study
be4a30fcceae3c5be34e14e02b9d1dff372e75e5
fa71694754304381b6e966056ce2bc9d68faa6b4
refs/heads/master
2022-12-24T04:24:57.155276
2020-09-21T11:17:20
2020-09-21T11:17:20
287,163,184
4
0
null
null
null
null
UTF-8
Java
false
false
1,511
java
package com.stewart.cloud.web; import com.stewart.cloud.services.PaymentService; import com.stewart.web.CommonResult; import com.stewart.web.entities.Payment; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; /** * @author stewart * @since 2020-08-11 */ @Slf4j @RestController @RequestMapping("/payment") public class PaymentController { @Value("${server.port}") private String serverPort; @Autowired private PaymentService paymentService; @PostMapping("/save") public CommonResult<Object> savePayment(@RequestBody Payment payment) { int save = paymentService.save(payment); if (save > 0) { return new CommonResult<>(200, "插入成功,端口:" + serverPort); } else { return new CommonResult<>(400, "插入失败"); } } @GetMapping("/get/{id}") public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id) { Payment payment = paymentService.getById(id); if (payment != null) { log.info("查询数据入参:id = {}", id); return new CommonResult<>(200, "查询成功,端口:" + serverPort, payment); } else { return new CommonResult<>(400, "查询失败"); } } @GetMapping(value = "/lb") public String getPaymentLB() { return serverPort; } }
9fda4631ee1c23ee00c008ec6ca61b51e41e2cf1
ec72a688101fb8fceb21edce98e8e96045ce525e
/src/main/java/com/baomidou/ant/sss/entity/OrgNatureCopy.java
efcbae13202f44c0ea255fc8c9a44228c5c16fee
[]
no_license
siyuan-sy/sy-practice
a3c00fd74de8e2f43f142614345252fb8116caf4
8c812d0654768afbf1b0af5bd608658f68063426
refs/heads/master
2022-07-05T19:10:33.100094
2020-09-30T02:33:41
2020-09-30T02:33:41
233,356,522
0
0
null
2022-06-21T04:06:09
2020-01-12T07:46:05
Java
UTF-8
Java
false
false
420
java
package com.baomidou.ant.sss.entity; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; /** * <p> * * </p> * * @author jobob * @since 2020-06-04 */ @Data @EqualsAndHashCode(callSuper = false) public class OrgNatureCopy implements Serializable { private static final long serialVersionUID = 1L; private String name; private Long pid; private Integer sort; }
3be2fa42b490e31fbdaaeaf08be78bc23a618c89
70e072629c2e7f44ff9c60165d260505f2e9af96
/news-project-parent/newsproject-admins-service/src/main/java/com/oracle/admins/service/impl/RoleServiceImpl.java
e20385e9d4a5ddb8c7793612eb9c2923f9ed5808
[]
no_license
chuan868-cel/ssp
5703978554dca18e8d77816bff3a7841991d26e3
46d3998e6248efcd17dc6849e54907e4959c9a02
refs/heads/master
2022-12-24T19:43:34.588761
2019-12-03T01:58:05
2019-12-03T02:05:39
225,306,021
1
1
null
2022-12-16T07:17:52
2019-12-02T06:54:24
JavaScript
UTF-8
Java
false
false
3,506
java
package com.oracle.admins.service.impl; import com.alibaba.dubbo.config.annotation.Service; import com.oracle.admins.service.spi.RoleService; import com.oracle.data.ServiceEntity; import com.oracle.pojo.Permission; import com.oracle.pojo.Roles; import com.oracle.mapper.RolesMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service @Transactional public class RoleServiceImpl implements RoleService { @Autowired private RolesMapper rolesMapper; @Override public ServiceEntity<Roles> list() { ServiceEntity<Roles> serviceEntity = new ServiceEntity<>(); List<Roles> list = this.rolesMapper.selectByExample(null); serviceEntity.setCode(0); serviceEntity.setListData(list); serviceEntity.setMsg("success"); return serviceEntity; } @Override public ServiceEntity<Roles> selectRolesById(Integer id) { ServiceEntity<Roles> serviceEntity = new ServiceEntity<>(); Roles roles = this.rolesMapper.selectByPrimaryKey(id); serviceEntity.setCode(0); serviceEntity.setEntity(roles); serviceEntity.setMsg("success"); return serviceEntity; } @Override public ServiceEntity<Permission> selectRoleInPer(Integer id) { ServiceEntity<Permission> serviceEntity = new ServiceEntity<>(); List<Permission> list = this.rolesMapper.selectRoleInPer(id); serviceEntity.setCode(0); serviceEntity.setListData(list); serviceEntity.setMsg("success"); return serviceEntity; } @Override public ServiceEntity UpdateRoleInPer(Roles role, Integer[] perIds) { ServiceEntity<Roles> serviceEntity = new ServiceEntity<>(); if(role==null||"".equals(role)||perIds.length==0){ serviceEntity.setCode(-1); serviceEntity.setMsg("error"); return serviceEntity; } this.rolesMapper.updateByPrimaryKeySelective(role); this.rolesMapper.deleteRoleInPer(role.getId()); for (int i = 0; i < perIds.length; i++) { this.rolesMapper.addPermissionByRoleId(role.getId(),perIds[i]); } serviceEntity.setCode(0); serviceEntity.setMsg("success"); return serviceEntity; } @Override public ServiceEntity add(Roles role, Integer[] perIds) { ServiceEntity<Roles> serviceEntity = new ServiceEntity<>(); if(role==null||"".equals(role)||perIds.length==0){ serviceEntity.setCode(-1); serviceEntity.setMsg("error"); return serviceEntity; } this.rolesMapper.insertSelective(role); for (int i=0; i<perIds.length; i++){ this.rolesMapper.addPermissionByRoleId(role.getId(),perIds[i]); } serviceEntity.setCode(0); serviceEntity.setMsg("success"); return serviceEntity; } @Override public ServiceEntity deleteRoleById(Integer id) { ServiceEntity<Roles> serviceEntity = new ServiceEntity<>(); if(id==null){ serviceEntity.setCode(-1); serviceEntity.setMsg("error"); return serviceEntity; } this.rolesMapper.deleteByPrimaryKey(id); // 删除 角色对应的权限 this.rolesMapper.deleteRoleInPer(id); serviceEntity.setCode(0); serviceEntity.setMsg("success"); return serviceEntity; } }
90f9ee292f38d6def12f343e7fc2add2a5b4d0fe
163f347d723a453e8a32c30ea0ff54f32c7698f4
/src/main/java/com/qa/pages/actions/HomePage.java
e11daf918d3ed5e0bd3bab64cc0cd53c261cb60e
[]
no_license
deepgupta6391/CucumberOld1
4cdf031b46e23fd14d362c5836c9f7b292adb6c4
965a1907c9074d041af97c07fcba2467028af446
refs/heads/master
2023-02-22T04:16:41.189483
2021-01-21T04:34:40
2021-01-21T04:34:40
331,338,259
0
0
null
2021-01-21T04:12:49
2021-01-20T14:52:52
Java
UTF-8
Java
false
false
749
java
package com.qa.pages.actions; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory; import com.qa.pages.locators.HomePageLocators; import com.qa.util.TestBase; public class HomePage extends TestBase{ public HomePageLocators homePage; public HomePage(){ this.homePage=new HomePageLocators(); AjaxElementLocatorFactory factory=new AjaxElementLocatorFactory(driver,10); PageFactory.initElements(factory, this.homePage); } public String validateHomePageTitle() { return driver.getTitle(); } public boolean verifyCorrectUserName() { return homePage.usernameLabel.isDisplayed(); } public void clickOnContactLink() { homePage.contactsLink.click(); } }
6b1ec64950b795d5d2b2edd2828d0f360f594fa6
97f198e161dc62b1e3b9a41fa58116fe9a398208
/Server/src/com/coursework/dao/ProductDAO.java
2db09a0f615f05f7f983170653780ba72f44c6f7
[]
no_license
X00na/oop_course_2.0
172ae6f658f6c31b2b09f072a72c82b16c82b890
4a5332f76d9a462cd8caa39d17c2043ca20dc3aa
refs/heads/master
2021-01-10T00:05:48.576867
2017-05-29T10:43:35
2017-05-29T10:43:35
92,730,606
0
0
null
null
null
null
UTF-8
Java
false
false
340
java
package com.coursework.dao; import com.coursework.dao.exception.DAOException; import java.util.List; public interface ProductDAO<T, K> extends ShopDAO<T, K> { List<T> searchByName(String name) throws DAOException; List<T> searchByPrice(int price) throws DAOException; List<T> searchByType(String type) throws DAOException; }
bf74a5085be1fa8c1013b311722d038749c8b341
4e9930fd6b83c17771b6bb4ffad67837105a3934
/src/java/com/vixcart/admin/validation/DeleteCategoryConstraints.java
74c36c0aca1678ebc53d1a10d3e0023ae06f6fe6
[]
no_license
smrcpmfyyn/admin.vixcart
c73d0f2ece3bf59069e2bc6b3214b9dcea11d533
fea199800c9f1361a561c81e086b1a8e2201dc15
refs/heads/master
2021-01-19T12:29:17.300095
2017-04-16T17:59:11
2017-04-16T17:59:11
88,032,781
0
0
null
2017-04-12T16:16:59
2017-04-12T09:13:51
Java
UTF-8
Java
false
false
2,931
java
package com.vixcart.admin.validation; // <editor-fold defaultstate="collapsed" desc="packages"> import com.vixcart.admin.db.DB; import com.vixcart.admin.db.DBConnect; import com.vixcart.admin.db.MongoConnect; import com.vixcart.admin.intfc.validation.DeleteCategoryValidator; import com.vixcart.admin.message.CorrectMsg; import com.vixcart.admin.message.ErrMsg; import com.vixcart.admin.mongo.mod.AdminID; import com.vixcart.admin.regx.RegX; import com.vixcart.admin.req.mod.DeleteCategory; import java.sql.SQLException; import java.util.HashSet; // </editor-fold> /** * * @author Vineeth K */ public class DeleteCategoryConstraints implements DeleteCategoryValidator{ private final DeleteCategory req; private final MongoConnect mdbc; private final DBConnect dbc; public DeleteCategoryConstraints(DeleteCategory req) throws Exception { this.req = req; this.mdbc = DB.getMongoConnection(); this.dbc = DB.getConnection(); } @Override public String validateUserType(String adminType) throws Exception { String valid = ErrMsg.ERR_ADMIN_TYPE; HashSet<String> types = dbc.getSubTypes(req.getType()); if (types.contains(adminType)) { valid = CorrectMsg.CORRECT_ADMIN_TYPE; } // System.out.println("validateUserType"); // System.out.println("valid = " + valid); // System.out.println("types = " + types); return valid; } @Override public String validateCategory() throws Exception { String valid = ErrMsg.ERR_NAME; String regX = RegX.REGX_DIGIT; // System.out.println("regX = " + regX); String name = req.getCategory(); // System.out.println("name = " + name); if (validate(name, regX)) { if (dbc.checkCategoryById(name)!=0) { valid = CorrectMsg.CORRECT_CATEGORY; } else { valid = ErrMsg.ERR_CATEGORY_NOT_EXISTS; } } return valid; } @Override public String validateAccessToken() throws Exception { String at = req.getAt(); String valid = ErrMsg.ERR_ACCESS_TOKEN; AdminID admin = mdbc.getAdminID(at); if (!admin.getProfile_id().startsWith(ErrMsg.ERR_MESSAGE)) { if (dbc.checkNBAdminID(admin.getProfile_id())) { valid = CorrectMsg.CORRECT_ACCESS_TOKEN; req.setAdmin_id(admin.getProfile_id()); req.setType(admin.getType()); } else { valid = ErrMsg.ERR_AT_BLOCKED; } } return valid; } @Override public boolean validate(String value, String regX) { boolean valid = false; if (value.matches(regX)) { valid = true; } return valid; } @Override public void closeConnection() throws SQLException { dbc.closeConnection(); } }
[ "vinu@Drey" ]
vinu@Drey
2662afb9b7defc6343baa1f214540f109f68004d
45e6233c83da4423a4f7105c42f7065970cb26e3
/Java14/1_INICIANTE/uri1828/Main2.java
40442b497fa6453145f4fd30da9fe17f9ebffe41
[]
no_license
BlackBloodLT/URI_Answers
b4e237c67ce7c4b9b01f0da3b6eb80f9c88c7bd0
bca93243e52012f1fe5a0ca5fcf462190777bffb
refs/heads/main
2023-05-16T19:33:38.912690
2021-06-08T02:24:06
2021-06-08T02:24:06
359,975,415
0
0
null
null
null
null
UTF-8
Java
false
false
5,391
java
/** * Bazinga! * No oitavo episodio da segunda temporada do seriado * The Big Bang Theory, The Lizard-Spock Expansion, * Sheldon e Raj discutem qual dos dois é o melhor: * o filme Saturn 3 ou a série Deep Space 9. A sugestão * de Raj para a resolução do impasse é uma disputa * de Pedra-Papel-Tesoura. Contudo, Sheldon argumenta * que, se as partes envolvidas se conhecem, entre * 75% e 80% das disputas de Pedra-Papel-Tesoura terminam * empatadas, e então sugere o Pedra-Papel-Tesoura-Lagarto-Spock. * As regras do jogo proposto são: * a tesoura corta o papel; * o papel embrulha a pedra; * a pedra esmaga o lagarto; * o lagarto envenena Spock; * Spock destrói a tesoura; * a tesoura decapita o lagarto; * o lagarto come o papel; * o papel contesta Spock; * Spock vaporiza a pedra; * a pedra quebra a tesoura. * Embora a situação não se resolva no episódio (ambos * escolhem Spock, resultando em um empate), não é difıcil * deduzir o que aconteceria se a disputa continuasse. * Caso Sheldon vencesse, ele se deleitaria com a vitória, * exclamando "Bazinga!"; caso Raj vencesse, ele concluiria * que "Raj trapaceou!"; caso o resultado fosse empate, * ele exigiria nova partida: "De novo!". Conhecidas as * personagens do jogo escolhido por ambos, faça um programa * que imprima a provável reação de Sheldon. * Entrada * A entrada consiste em uma série de casos de teste. * A primeira linha contém um inteiro positivo T (T ≤ 100), * que representa o número de casos de teste. Cada caso de * teste é representado por uma linha da entrada, contendo * as escolhas de Sheldon e Raj, respectivamente, separadas * por um espaço em branco. As escolha possíveis são as * personagens do jogo: pedra, papel, tesoura, lagarto e * Spock. * Saida * Para cada caso de teste deverá ser impressa a mensagem * "Caso #t: R", onde t é o número do caso de teste (cuja * contagem se inicia no número um) e R é uma das três * reações possíveis de Sheldon: "Bazinga!", "Raj trapaceou!", * ou "De novo!". */ package uri1828; import java.io.IOException; import java.util.Scanner; public class Main2 { public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(System.in); int quantidadeCasos = scanner.nextInt(); String primeiro; String segundo; for(int cont=1 ; cont<=quantidadeCasos ; cont++) { primeiro = scanner.next(); segundo = scanner.next(); switch(primeiro) { case "pedra": { if(segundo.equals("pedra")){ System.out.println("Caso #" + cont + ": De novo!"); } else if(segundo.equals("papel") || segundo.equals("Spock")) { System.out.println("Caso #" + cont + ": Raj trapaceou!"); } else if(segundo.equals("tesoura") || segundo.equals("lagarto")) { System.out.println("Caso #" + cont + ": Bazinga!"); } break; } case "papel": { if(segundo.equals("pedra") || segundo.equals("Spock")){ System.out.println("Caso #" + cont + ": Bazinga!"); } else if(segundo.equals("papel")) { System.out.println("Caso #" + cont + ": De novo!"); } else if(segundo.equals("tesoura") || segundo.equals("lagarto")) { System.out.println("Caso #" + cont + ": Raj trapaceou!"); } break; } case "tesoura": { if(segundo.equals("pedra") || segundo.equals("Spock")){ System.out.println("Caso #" + cont + ": Raj trapaceou!"); } else if(segundo.equals("papel") || segundo.equals("lagarto")) { System.out.println("Caso #" + cont + ": Bazinga!"); } else if(segundo.equals("tesoura")) { System.out.println("Caso #" + cont + ": De novo!"); } break; } case "lagarto": { if(segundo.equals("pedra") || segundo.equals("tesoura")){ System.out.println("Caso #" + cont + ": Raj trapaceou!"); } else if(segundo.equals("papel") || segundo.equals("Spock")) { System.out.println("Caso #" + cont + ": Bazinga!"); } else if(segundo.equals("lagarto")) { System.out.println("Caso #" + cont + ": De novo!"); } break; } case "Spock": { if(segundo.equals("pedra") || segundo.equals("tesoura")){ System.out.println("Caso #" + cont + ": Bazinga!"); } else if(segundo.equals("papel") || segundo.equals("lagarto")) { System.out.println("Caso #" + cont + ": Raj trapaceou!"); } else if(segundo.equals("Spock")) { System.out.println("Caso #" + cont + ": De novo!"); } break; } } } } }
d6ff9c4931654466156b748594aebc5615963be9
c1d304604f07c6ae933f43041f224fa6d563429b
/source/org/fonteditor/springs/SpringMaker.java
11c51d34090ff96443549a383ce1b19d51b1786d
[]
no_license
timtyler/fonteditor
9ff28e6e5b043a9197a29438647a741f69974cc0
83baed2f9fa33637b00274ed1a8ce92f69375e78
refs/heads/master
2022-09-12T16:48:27.562685
2020-05-31T22:02:55
2020-05-31T22:02:55
268,371,317
0
0
null
null
null
null
UTF-8
Java
false
false
7,971
java
package org.fonteditor.springs; import org.fonteditor.elements.curves.Curve; import org.fonteditor.elements.paths.FEPath; import org.fonteditor.elements.paths.FEPathList; import org.fonteditor.elements.points.FEPoint; import org.fonteditor.elements.points.FEPointList; import org.fonteditor.utilities.callback.CallBackWithReturn; import org.fonteditor.utilities.general.Forget; import org.fonteditor.utilities.random.JUR; /** * Utility methods to construct lists of Springs from outlines... */ public class SpringMaker implements SpringConstants { private static final int SPRING_THRESHOLD = 0x1800; private static final int SPRING_THRESHOLD_SQUARED = SPRING_THRESHOLD * SPRING_THRESHOLD; private JUR rnd = new JUR(); private SpringManager spring_manager; private FEPathList fepathlist; private FEPointList fepointlist; public SpringMaker(FEPathList fepathlist, FEPointList fepointlist) { Forget.about(fepathlist); Forget.about(fepointlist); if (USE_SPRINGS) { this.fepathlist = fepathlist; this.fepointlist = fepointlist; spring_manager = new SpringManager(); } } public SpringManager makeSprings() { if (USE_SPRINGS) { makeSpringFromPoints(); makeSpringFromPaths(); } return spring_manager; } public void makeSpringFromPoints() { if (fepointlist.getNumber() > 2) { for (int i = fepointlist.getNumber() << 2; --i >= 0;) { makeSpring(); } } } public void makeSpringFromPaths() { for (int i = 0; i < fepathlist.getNumber(); i++) { makeSpringFromPath(fepathlist.getPath(i)); } } public void makeSpringFromPath(FEPath p) { int length = p.getNumberOfCurves(); if (length > 2) { for (int i = 1; i < length - 1; i++) { makeSpringFromThreeCurves(p.getCurve(i - 1), p.getCurve(i), p.getCurve(i + 1)); } makeSpringFromThreeCurves(p.getCurve(length - 1), p.getCurve(0), p.getCurve(1)); makeSpringFromThreeCurves(p.getCurve(length - 2), p.getCurve(length - 1), p.getCurve(0)); } } private void makeSpringFromThreeCurves(Curve curve1, Curve curve2, Curve curve3) { if ((curve1.isStraight()) && (curve2.isStraight()) && (curve3.isStraight())) { FEPoint p1 = curve3.returnStartPoint(); FEPoint p2 = curve2.returnStartPoint(); // check distance... if (p1.quickDistanceFrom(p2) <= SPRING_THRESHOLD) { // check h or v... if ((p1.getX() == p2.getX()) || (p1.getY() == p2.getY())) { add(p1, p2); } } } } public void makeSpring() { if (fepointlist.getNumber() > 2) { int idx_p1 = rnd.nextInt(fepointlist.getNumber()); int idx_p2 = rnd.nextInt(fepointlist.getNumber()); idx_p2 = findNearestPoint(idx_p1, idx_p2); if (idx_p1 != idx_p2) { idx_p1 = findNearestPoint(idx_p2, idx_p1); if (idx_p1 != idx_p2) { idx_p2 = findNearestPoint(idx_p1, idx_p2); if (idx_p1 != idx_p2) { idx_p1 = findNearestPoint(idx_p2, idx_p1); if (idx_p1 != idx_p2) { FEPoint fep1 = fepointlist.getPoint(idx_p1); FEPoint fep2 = fepointlist.getPoint(idx_p2); if (fep1.squaredDistanceFrom(fep2) < SPRING_THRESHOLD_SQUARED) { // is it headed outwards from point 1? LocalPathAndIndex loc1 = findLocalPathAndIndex(fep1); FEPath path1 = loc1.getPath(); int index1 = loc1.getIndex(); FEPoint fep1_plus = path1.safelyGetPoint(index1 + 1); FEPoint fep1_minus = path1.safelyGetPoint(index1 - 1); if (isClockwise(fep1, fep2, fep1_plus, fep1_minus)) { // is it headed outwards from point 2? LocalPathAndIndex loc2 = findLocalPathAndIndex(fep2); FEPath path2 = loc2.getPath(); int index2 = loc2.getIndex(); FEPoint fep2_plus = path2.safelyGetPoint(index2 + 1); FEPoint fep2_minus = path2.safelyGetPoint(index2 - 1); if (isClockwise(fep2, fep1, fep2_plus, fep2_minus)) { add(fep1, fep2); } } } } } } } } } boolean isClockwise(FEPoint fep1, FEPoint fep2, FEPoint fep3, FEPoint fep4) { int x = fep1.getX(); int y = fep1.getY(); return isClockwise(fep2.getX() - x, fep2.getY() - y, fep3.getX() - x, fep3.getY() - y, fep4.getX() - x, fep4.getY() - y); } boolean isClockwise(int dx1, int dy1, int dx2, int dy2, int dx3, int dy3) { int theta1 = getAngle(dx1, dy1); int theta2 = getAngle(dx2, dy2); int theta3 = getAngle(dx3, dy3); if ((theta1 >= theta2) && (theta2 >= theta3)) { return true; } if ((theta2 >= theta3) && (theta3 >= theta1)) { return true; } if ((theta3 >= theta1) && (theta1 >= theta2)) { return true; } return false; } int getAngle(int dx, int dy) { if (dx == 0) { if (dy > 0) { return 0x80; } else { return 0x00; } } if (dy == 0) { if (dx > 0) { return 0x40; } else { return 0xC0; } } if (dx > 0) { if (dy > 0) { if (dx == dy) { return 0x60; } if (dx > dy) { return 0x50; } else { // dx < dy return 0x70; } } else { // dy < 0 if (dx == -dy) { return 0x20; } if (dx > -dy) { return 0x30; } else { // dx > -dy return 0x10; } } } else { // dx < 0 if (dy > 0) { if (-dx == dy) { return 0xA0; } if (-dx > dy) { return 0xB0; } else { return 0x90; } } else { if (-dx == -dy) { return 0xE0; } if (-dx > -dy) { return 0xD0; } else { return 0xF0; } } } } private void add(FEPoint fep1, FEPoint fep2) { Spring s = new Spring(fep1, fep2); spring_manager.add(s); } private int findNearestPoint(int idx_p1, int idx_p2) { //, GlyphDisplayOptions gdo) { int dir = rnd.nextBoolean() ? -1 : 1; boolean flipped = false; FEPoint p1 = fepointlist.getPoint(idx_p1); FEPoint p2 = fepointlist.getPoint(idx_p2); int max = p1.squaredDistanceFrom(p2); FEPath path = fepathlist.getPath(p2); FEPointList fepl = path.getFEPointList(); idx_p2 = fepl.getIndexOf(p2); for (; true;) { int new_idx_p2 = idx_p2 + dir; if (new_idx_p2 < 0) { new_idx_p2 = fepl.getNumber() - 1; } if (new_idx_p2 >= fepl.getNumber()) { new_idx_p2 = 0; } p2 = fepl.getPoint(new_idx_p2); int dist = p1.squaredDistanceFrom(p2); if (dist <= max) { max = dist; idx_p2 = new_idx_p2; } else { if (flipped) { return fepointlist.getIndexOf(fepl.getPoint(idx_p2)); } else { dir = -dir; flipped = true; } } } } LocalPathAndIndex findLocalPathAndIndex(final FEPoint fepoint) { return (LocalPathAndIndex) fepathlist.executeOnEachPath(new CallBackWithReturn() { public Object callback(Object o) { FEPath fepath = (FEPath) o; if (fepath.contains(fepoint)) { return new LocalPathAndIndex(fepath, fepath.indexOf(fepoint)); } return null; } }); } class LocalPathAndIndex { private FEPath path; private int index; public LocalPathAndIndex(FEPath path, int index) { this.path = path; this.index = index; } void setPath(FEPath path) { this.path = path; } FEPath getPath() { return path; } void setIndex(int index) { this.index = index; } int getIndex() { return index; } } }
39d0ba8630cf6da7103610c7bf5725aa7fa27b22
20d964082944333fbda82e6f692e2c795354f34d
/MovieCatalogServices/src/main/java/com/example/demo/MovieCatalogServicesApplication.java
15a74c002d96a5bde71ed005d228fc73c532ba83
[]
no_license
kaushikmrao/microservices
34460227f6c25fc08ab26421d0feab84fe34573e
441f23b305078afc12a380d948f6d2db17c84f26
refs/heads/master
2022-11-24T04:45:26.469407
2020-07-28T08:20:28
2020-07-28T08:20:28
283,133,117
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class MovieCatalogServicesApplication { public static void main(String[] args) { SpringApplication.run(MovieCatalogServicesApplication.class, args); } }
182b44c27c08f9037c762cbf81219408d1d0f61b
e6b25d582d80da79b8ce9e0581d7721535a854d6
/Exercicio01/src/main/java/br/com/fiap/entity/Genero.java
53c33e9fea4366b00bc0a49318c87bc9940e1f21
[]
no_license
millenaavanzo/Enterprise-Application-Development
da8d62b21e5cc084d0de6f8463278fb53d6405d3
f8e7b2dd352c11e2ab0460b389e9168f0f838c3a
refs/heads/master
2020-04-21T12:26:56.708325
2019-04-11T11:05:12
2019-04-11T11:05:12
169,562,408
0
0
null
null
null
null
UTF-8
Java
false
false
71
java
package br.com.fiap.entity; public enum Genero { FEMININO,MASCULINO }
a3532ad22e29a1b12bd5610fc43226783e6fc35b
252a4b62fcd100f32a06821597fcc1110b74dd0e
/app/src/main/java/com/sxzhwts/ticket/common/utils/okhttp/DownloadProgressHandler.java
e4291b20a0981108cd60e350d6764fe10df240a0
[]
no_license
fanchunyan123feiyu/ticket
1aeb51e8dc2e53bfae888a0a6db7804537e50231
e40c974d59260bed651f5a7d9068ffdaf30d3034
refs/heads/master
2020-03-14T05:57:22.383786
2018-06-11T08:41:38
2018-06-11T08:41:38
131,474,489
0
0
null
null
null
null
UTF-8
Java
false
false
855
java
package com.sxzhwts.ticket.common.utils.okhttp; import android.os.Looper; import android.os.Message; /** * Created by ljd on 4/12/16. */ public abstract class DownloadProgressHandler extends ProgressHandler{ private static final int DOWNLOAD_PROGRESS = 1; protected ResponseHandler mHandler = new ResponseHandler(this, Looper.getMainLooper()); @Override protected void sendMessage(ProgressBean progressBean) { mHandler.obtainMessage(DOWNLOAD_PROGRESS,progressBean).sendToTarget(); } @Override protected void handleMessage(Message message){ switch (message.what){ case DOWNLOAD_PROGRESS: ProgressBean progressBean = (ProgressBean)message.obj; onProgress(progressBean.getBytesRead(),progressBean.getContentLength(),progressBean.isDone()); } } }
a3304b7cf12561f137bd6115671836df6e37d48c
60fe24492b82b4368384d4f0934b7c48fdc3cef6
/matcher/src/main/java/com/swipejob/matcher/model/Name.java
75bfa9b5bcdf4f05aff74add0e359410af536710
[]
no_license
mjamilfarooq/javaexamples
53a33915a771848a452e4e17736efb9e07eb9684
e9593b0aff4bdea8929166802a5cde301ecffaef
refs/heads/master
2022-11-22T19:45:38.272987
2019-07-15T14:21:42
2019-07-15T14:21:42
197,011,543
0
0
null
2022-11-16T12:25:10
2019-07-15T14:09:05
Java
UTF-8
Java
false
false
167
java
package com.swipejob.matcher.model; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor class Name { String last; String first; }
41010f8b78398988b5f936c0b816ad698dbc40e2
121d51de8c80ca7bc4249e076a37d6fdcef61d24
/src/main/java/edesur/rdd/srv/model/ResponseBase.java
74a536aa154054363798d4fbb03717de1329691a
[]
no_license
ldvalle/RDD
9b6b2849d76832bd27b3684e13eb46acf2a48cb4
d4e47ace246745eac4026e22237172ae64ed65d8
refs/heads/main
2023-04-03T18:57:38.341263
2021-04-14T13:48:41
2021-04-14T13:48:41
337,501,108
0
0
null
null
null
null
UTF-8
Java
false
false
825
java
package edesur.rdd.srv.model; import com.fasterxml.jackson.annotation.JsonInclude; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @JsonInclude(JsonInclude.Include.NON_NULL) public class ResponseBase { @Size(max = 10) @NotNull private String codigo_retorno = "0"; @Size(max = 100) @NotNull private String descripcion_retorno = "Proceso Exitoso"; public String getCodigo_retorno() { return codigo_retorno; } public void setCodigo_retorno(String codigo_retorno) { this.codigo_retorno = codigo_retorno; } public String getDescripcion_retorno() { return descripcion_retorno; } public void setDescripcion_retorno(String descripcion_retorno) { this.descripcion_retorno = descripcion_retorno; } }
d23da5fe0c4e8da162413876d8ef5b99727c8d9c
3c69f25f8748425f9c8a08e25b27194ce65e17a6
/org.uis.lenguajegrafico/src-gen/org/uis/lenguajegrafico/lenguajegrafico/impl/URLImpl.java
3ebca1f48b191a897a3d752884b6196fd1639b2a
[]
no_license
Han253/Lenguajegrafico
20a25c0e05d8197ecccdaa76485d04755995f2ae
f1d2faab8d6e90b671e7095ecf9020237b479a74
refs/heads/master
2021-01-24T18:37:32.525326
2017-07-16T20:16:20
2017-07-16T20:16:20
84,456,200
0
0
null
null
null
null
UTF-8
Java
false
false
3,768
java
/** * generated by Xtext 2.13.0-SNAPSHOT */ package org.uis.lenguajegrafico.lenguajegrafico.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.uis.lenguajegrafico.lenguajegrafico.LenguajegraficoPackage; import org.uis.lenguajegrafico.lenguajegrafico.URL; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>URL</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.uis.lenguajegrafico.lenguajegrafico.impl.URLImpl#getValue <em>Value</em>}</li> * </ul> * * @generated */ public class URLImpl extends MinimalEObjectImpl.Container implements URL { /** * The default value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected static final String VALUE_EDEFAULT = null; /** * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected String value = VALUE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected URLImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return LenguajegraficoPackage.Literals.URL; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setValue(String newValue) { String oldValue = value; value = newValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LenguajegraficoPackage.URL__VALUE, oldValue, value)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case LenguajegraficoPackage.URL__VALUE: return getValue(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case LenguajegraficoPackage.URL__VALUE: setValue((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case LenguajegraficoPackage.URL__VALUE: setValue(VALUE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case LenguajegraficoPackage.URL__VALUE: return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (value: "); result.append(value); result.append(')'); return result.toString(); } } //URLImpl
1b7d7644587556978c1ca0b5308fe4424b05a9e4
62c3218ba78233d1d4800bb8b345701fc9ff9695
/RocketBubble/src/straightedge/geom/vision/Occluder.java
6b13e2aea2e07a2d4c05717d213d445ccdedddb0
[]
no_license
Redrazors/GameFrame
146878ad1e7a67a2a07a9fc7dfbc57c50804411c
29021211aba7e8e67281ac41d1df4e8c9d1f63fa
refs/heads/master
2021-01-20T06:59:21.980738
2014-07-15T19:36:41
2014-07-15T19:36:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,813
java
/* * Copyright (c) 2008, Keith Woodward * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. 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. * 3. Neither the name of Keith Woodward nor the names * of its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ package straightedge.geom.vision; import straightedge.geom.*; import java.util.*; /** * * @author Keith */ public interface Occluder extends PolygonHolder{ public KPolygon getPolygon(); }
85cd263c52fa22cc72057e68f8046ad1872ba5e1
1bc6b805068ea982d5229c3c1112e4af1e745577
/src/mou/gui/fleetscreen/shiptable/ShipStrukturTableCellRenderer.java
6a0cd126d305214c560c93b0885b9e1b14266839
[]
no_license
pburlov/galaxy-civilization
a5d6f97690837785dd8d7a0da17acd948dccdd7c
0fa6775a7a00637da2d1f96dbb09a5b1dcc220c0
refs/heads/master
2021-01-21T02:27:48.140142
2015-03-16T21:14:00
2015-03-16T21:14:00
32,353,168
0
0
null
null
null
null
UTF-8
Java
false
false
1,180
java
/* * $Id: ShipStrukturTableCellRenderer.java 12 2006-03-25 16:19:37Z root $ Created on Mar 25, 2006 * Copyright Paul Burlov 2001-2006 */ package mou.gui.fleetscreen.shiptable; import java.awt.Component; import javax.swing.JTable; import javax.swing.table.TableCellRenderer; import mou.core.ship.Ship; import mou.gui.StatusBalken; /** * @author pb */ public class ShipStrukturTableCellRenderer extends StatusBalken implements TableCellRenderer { // private StarmapDB starDB = Main.instance().getMOUDB().getStarmapDB(); /** * */ public ShipStrukturTableCellRenderer() { super(0, 1); this.setBorderColor(null); // setBorder(new BevelBorder(BevelBorder.LOWERED)); } /* * (non-Javadoc) * * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, * java.lang.Object, boolean, boolean, int, int) */ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Ship ship = (Ship) value; if(value == null) return this; setMax(ship.getStruktur().intValue()); setValue(ship.getCurrentStruktur().intValue()); return this; } }
[ "pburlov@194997ea-f0a3-1d76-5776-7b0eef44c3a6" ]
pburlov@194997ea-f0a3-1d76-5776-7b0eef44c3a6
5280cc756ddf56acbf21237426f1af9001485267
626ddab10b4fa256c7b53a088e1890b49cfee0f5
/객체지향프로그래밍 및 실습/workspace/7강/src/question8_question6_ArrayList/Tester.java
35971214afd78f9c6fe5e3da41f2f49430070a74
[]
no_license
hallauto/Grade-2_semester-1
eb8cafb0e0d8d8f9cf0e5e1b9b97be8d32ff5111
7af74bd7ae3221ee6d6152d7f9dedf9533e73077
refs/heads/master
2021-06-02T21:11:29.140302
2016-01-11T01:48:02
2016-01-11T01:48:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
194
java
package question8_question6_ArrayList; public class Tester { public static void main (String args[]) { Second_value data = new Second_value(); System.out.println(data.get_second()); } }
97251f1dfcff2849d434b37630de6ed4250b715e
5f45367b2544c0df71c6146d3c558f8efea149d5
/app/src/test/java/vn/poly/testgithub/ExampleUnitTest.java
a81552c0b9b9fcf3f5c6a5045c77c600a70d6d09
[]
no_license
nambui2000k/Testgithub1
82cda989b41ae73f003cc42496c0e5ab134eb254
8725496a535a3bdafdfce87620a49b36bdffce57
refs/heads/master
2020-09-06T09:07:10.681753
2019-11-08T03:56:20
2019-11-08T03:56:20
220,382,064
0
0
null
null
null
null
UTF-8
Java
false
false
379
java
package vn.poly.testgithub; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
ec3fab399c8c154aacacaf6c25509aa1c239ecc1
f3c35ce8ca93ad644f523ca19171478dd0ec95da
/ib-engine/src/main/java/com/dwidasa/engine/dao/mapper/ActivityCustomerMapper.java
c6e2a01866f1107c947df350c9a197d046133116
[]
no_license
depot-air/internet-banking
da049da2f6288a388bd9f2d33a9e8e57f5954269
25a5e0038c446536eca748e18f35b7a6a8224604
refs/heads/master
2022-12-21T03:54:50.227565
2020-01-16T11:15:31
2020-01-16T11:15:31
234,302,680
0
1
null
2022-12-09T22:33:28
2020-01-16T11:12:17
Java
UTF-8
Java
false
false
1,372
java
package com.dwidasa.engine.dao.mapper; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.jdbc.core.simple.ParameterizedRowMapper; import org.springframework.stereotype.Component; import com.dwidasa.engine.model.ActivityCustomer; @Component("activityCustomerMapper") public class ActivityCustomerMapper extends ChainedRowMapper<ActivityCustomer> implements ParameterizedRowMapper<ActivityCustomer> { public ActivityCustomerMapper() { } public ActivityCustomer chainRow(ResultSet rs, int index) throws SQLException { ActivityCustomer activityCustomer = new ActivityCustomer(); activityCustomer.setId(rs.getLong(++index)); activityCustomer.setCustomerId(rs.getLong(++index)); activityCustomer.setActivityType(rs.getString(++index)); activityCustomer.setActivityData(rs.getString(++index)); activityCustomer.setReferenceNumber(rs.getString(++index)); activityCustomer.setDeliveryChannel(rs.getString(++index)); activityCustomer.setDeliveryChannelId(rs.getString(++index)); activityCustomer.setCreated(rs.getTimestamp(++index)); activityCustomer.setCreatedby(rs.getLong(++index)); activityCustomer.setUpdated(rs.getTimestamp(++index)); activityCustomer.setUpdatedby(rs.getLong(++index)); return activityCustomer; } }
a2d322978496518dae8de15c75581717c5f8124d
a602b60995bc968384747c0a79b0cde380edf33e
/core/src/main/java/utils/antlr/laprLexer.java
ae6b52df01111b09e7e2686ed1fcda838efa9785
[ "MIT" ]
permissive
diogocapela/isep-lapr4
8347f23b3c5627a3976a10baba9fde69749b1d5b
c72cef5112e06b319e0176aca98fadeb85950aa6
refs/heads/master
2020-04-24T00:07:12.463040
2019-02-19T21:53:00
2019-07-05T01:02:48
171,555,980
0
0
null
null
null
null
UTF-8
Java
false
false
5,870
java
// Generated from C:/Users/rafa_/Desktop/lapr4-2018-2019-grupona-3/core/src/main/java/utils/antlr\lapr.g4 by ANTLR 4.7.2 package utils.antlr; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.atn.ATN; import org.antlr.v4.runtime.atn.ATNDeserializer; import org.antlr.v4.runtime.atn.LexerATNSimulator; import org.antlr.v4.runtime.atn.PredictionContextCache; import org.antlr.v4.runtime.dfa.DFA; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class laprLexer extends Lexer { public static final int T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, OUT = 5, LIM = 6, VAL = 7, OP = 8, NL = 9, WS = 10; public static final String[] ruleNames = makeRuleNames(); /** * @deprecated Use {@link #VOCABULARY} instead. */ @Deprecated public static final String[] tokenNames; public static final String _serializedATN = "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\fb\b\1\4\2\t\2\4" + "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t" + "\13\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3" + "\5\3\5\3\6\3\6\7\6,\n\6\f\6\16\6/\13\6\3\7\6\7\62\n\7\r\7\16\7\63\3\7" + "\3\7\3\7\3\7\3\b\6\b;\n\b\r\b\16\b<\3\b\3\b\6\bA\n\b\r\b\16\bB\5\bE\n" + "\b\3\b\3\b\3\b\5\bJ\n\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\5\tV\n" + "\t\3\n\5\nY\n\n\3\n\3\n\5\n]\n\n\3\13\3\13\3\13\3\13\2\2\f\3\3\5\4\7\5" + "\t\6\13\7\r\b\17\t\21\n\23\13\25\f\3\2\6\3\2\63;\3\2\62;\3\2\60\60\3\2" + "\"\"\2n\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2" + "\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\3\27\3" + "\2\2\2\5\32\3\2\2\2\7\34\3\2\2\2\t$\3\2\2\2\13)\3\2\2\2\r\61\3\2\2\2\17" + "I\3\2\2\2\21U\3\2\2\2\23\\\3\2\2\2\25^\3\2\2\2\27\30\7k\2\2\30\31\7h\2" + "\2\31\4\3\2\2\2\32\33\7*\2\2\33\6\3\2\2\2\34\35\7+\2\2\35\36\7\"\2\2\36" + "\37\7v\2\2\37 \7j\2\2 !\7g\2\2!\"\7p\2\2\"#\7\"\2\2#\b\3\2\2\2$%\7g\2" + "\2%&\7n\2\2&\'\7u\2\2\'(\7g\2\2(\n\3\2\2\2)-\t\2\2\2*,\t\3\2\2+*\3\2\2" + "\2,/\3\2\2\2-+\3\2\2\2-.\3\2\2\2.\f\3\2\2\2/-\3\2\2\2\60\62\t\3\2\2\61" + "\60\3\2\2\2\62\63\3\2\2\2\63\61\3\2\2\2\63\64\3\2\2\2\64\65\3\2\2\2\65" + "\66\t\4\2\2\66\67\t\3\2\2\678\t\3\2\28\16\3\2\2\29;\t\3\2\2:9\3\2\2\2" + ";<\3\2\2\2<:\3\2\2\2<=\3\2\2\2=D\3\2\2\2>@\t\4\2\2?A\t\3\2\2@?\3\2\2\2" + "AB\3\2\2\2B@\3\2\2\2BC\3\2\2\2CE\3\2\2\2D>\3\2\2\2DE\3\2\2\2EJ\3\2\2\2" + "FG\7x\2\2GH\7c\2\2HJ\7n\2\2I:\3\2\2\2IF\3\2\2\2J\20\3\2\2\2KV\7>\2\2L" + "M\7>\2\2MV\7?\2\2NV\7@\2\2OP\7@\2\2PV\7?\2\2QR\7?\2\2RV\7?\2\2ST\7#\2" + "\2TV\7?\2\2UK\3\2\2\2UL\3\2\2\2UN\3\2\2\2UO\3\2\2\2UQ\3\2\2\2US\3\2\2" + "\2V\22\3\2\2\2WY\7\17\2\2XW\3\2\2\2XY\3\2\2\2YZ\3\2\2\2Z]\7\f\2\2[]\7" + "\17\2\2\\X\3\2\2\2\\[\3\2\2\2]\24\3\2\2\2^_\t\5\2\2_`\3\2\2\2`a\b\13\2" + "\2a\26\3\2\2\2\f\2-\63<BDIUX\\\3\b\2\2"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); protected static final DFA[] _decisionToDFA; protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; public static String[] modeNames = { "DEFAULT_MODE" }; static { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); } static { tokenNames = new String[_SYMBOLIC_NAMES.length]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = VOCABULARY.getLiteralName(i); if (tokenNames[i] == null) { tokenNames[i] = VOCABULARY.getSymbolicName(i); } if (tokenNames[i] == null) { tokenNames[i] = "<INVALID>"; } } } static { _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); } } public laprLexer(CharStream input) { super(input); _interp = new LexerATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); } private static String[] makeRuleNames() { return new String[]{ "T__0", "T__1", "T__2", "T__3", "OUT", "LIM", "VAL", "OP", "NL", "WS" }; } private static String[] makeLiteralNames() { return new String[]{ null, "'if'", "'('", "') then '", "'else'" }; } private static String[] makeSymbolicNames() { return new String[]{ null, null, null, null, null, "OUT", "LIM", "VAL", "OP", "NL", "WS" }; } @Override @Deprecated public String[] getTokenNames() { return tokenNames; } @Override public Vocabulary getVocabulary() { return VOCABULARY; } @Override public String getGrammarFileName() { return "lapr.g4"; } @Override public String[] getRuleNames() { return ruleNames; } @Override public String getSerializedATN() { return _serializedATN; } @Override public String[] getChannelNames() { return channelNames; } @Override public String[] getModeNames() { return modeNames; } @Override public ATN getATN() { return _ATN; } }
a3e6612ad71751d39f7f7acd282b8277e3718a8b
cd6c9e2ab5990e8169d35694c4dbdf5e78f197e4
/service/service_edu/src/main/java/com/kerwin/eduService/entity/frontvo/CourseWebVo.java
c4bfefd72fbec8784fb021d198bd11083d458371
[]
no_license
kerwinYX/kerwin_parent
1daf672c23e9a13baebbf8a9b1b8aa6a05258585
73fe40173db0d98fbb6e31c8c7a8e9d84ecdc717
refs/heads/master
2023-06-05T14:44:17.944065
2021-06-28T02:18:52
2021-06-28T02:18:52
375,196,276
0
0
null
null
null
null
UTF-8
Java
false
false
1,465
java
package com.kerwin.eduService.entity.frontvo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; @Data public class CourseWebVo { private String id; @ApiModelProperty(value = "课程标题") private String title; @ApiModelProperty(value = "课程销售价格,设置为0则可免费观看") private BigDecimal price; @ApiModelProperty(value = "总课时") private Integer lessonNum; @ApiModelProperty(value = "课程封面图片路径") private String cover; @ApiModelProperty(value = "销售数量") private Long buyCount; @ApiModelProperty(value = "浏览数量") private Long viewCount; @ApiModelProperty(value = "课程简介") private String description; @ApiModelProperty(value = "讲师ID") private String teacherId; @ApiModelProperty(value = "讲师姓名") private String teacherName; @ApiModelProperty(value = "讲师资历,一句话说明讲师") private String intro; @ApiModelProperty(value = "讲师头像") private String avatar; @ApiModelProperty(value = "课程一级类别ID") private String subjectLevelOneId; @ApiModelProperty(value = "类别一级名称") private String subjectLevelOne; @ApiModelProperty(value = "课程二级类别ID") private String subjectLevelTwoId; @ApiModelProperty(value = "类别二级名称") private String subjectLevelTwo; }
[ "kerwin" ]
kerwin
c79e25874f4c85a3393be05bd771e334fd707f5f
06cd53d4e249d4ba06c830ea1427636d10428376
/src/main/java/com/hhwf/leetcode/LeetCode120_Solution_1.java
18f3c2e561d5ce8f03f9791e4de5fed8e5079246
[]
no_license
hhwf/algorithm
f69e8ad376c0dd51fafe3f65e62a61901da4b1cf
c088f10e8a4ff51a5e216b167de4caf6e1bc7c7d
refs/heads/master
2020-12-01T02:35:52.808916
2020-07-30T13:13:09
2020-07-30T13:13:09
230,542,810
0
0
null
null
null
null
UTF-8
Java
false
false
637
java
package com.hhwf.leetcode; import java.util.List; /** * *@description: *@author: hhwf *@time: 2020/7/26 11:17 *12 */ public class LeetCode120_Solution_1 { int[][] memo; public int minimumTotal(List<List<Integer>> triangle) { if (triangle.size() == 0) { return 0; } memo = new int[triangle.size()][triangle.size()]; int n = triangle.size(); for (int i = n - 1; i >= 0; i--) { for (int j = 0; j < i; j++) { memo[i][j] = triangle.get(i).get(j) + Math.min(memo[i][j],memo[i][j+1]); } } return memo[0][0]; } }
69cc27d7a5c171fe8e1e94ff01b869b5eba36803
2dfa1db17cf217b9a6a3eec94ef97cbcac25241b
/src/main/java/com/example/ServiceReminder/Web/controller/RemindController.java
56b2bb105f0edaa0702803f02e96293e9baec48b
[]
no_license
rfujinaga/ServiceReminder
6821f34314ca852c9bf0304973830d1545bf5cf0
634ecbf8e335f5205d798320e1eec8a47c1f5344
refs/heads/master
2023-03-05T06:14:34.773819
2021-02-08T11:06:51
2021-02-08T11:06:51
336,032,601
0
0
null
null
null
null
UTF-8
Java
false
false
3,291
java
package com.example.ServiceReminder.Web.controller; import com.example.ServiceReminder.Web.Form.ServiceForm; import com.example.ServiceReminder.domain.dao.ServiceDao; import com.example.ServiceReminder.domain.dao.entity.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.Mapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import java.util.Map; @Controller public class RemindController { @Autowired private ServiceDao serviceDao; //TOP画面 @GetMapping("/top") public String top() { return "top"; } //新規登録画面 @GetMapping("/new") public String registration() { return "new"; } //新規登録画面の登録ボタン押下で以下処理 //insert後は一覧表示画面へ @PostMapping("/post") public String Post(ServiceForm form, Model model) { Service service = new Service(); service.setServiceName(form.getServiceName()); service.setRegistrationDate(form.getRegistrationDate()); service.setPeriod(form.getPeriod()); service.setMailAddress(form.getMailAddress()); service.setCardBrand(form.getCardBrand()); service.setCardNum(form.getCardNum()); service.setPassword(form.getPassword()); service.setMemo(form.getMemo()); serviceDao.insert(service); return "redirect:/list"; } //一覧表示画面、viewAllメソッドでDB内全件表示 @GetMapping("/list") public String list(Model model) { model.addAttribute("data", serviceDao.viewAll()); return "list"; } //特定レコードの詳細情報表示画面 //IDをキーとして、list.htmlでは表示されてない詳細情報を表示 //RedirectAttributesを使用することでURLにパラメータを表示しない @GetMapping("/detail/{id}") public String detail(@PathVariable("id") Long id, RedirectAttributes attr) { Map<String,Object> serviceMap = serviceDao.viewDetail(id); Service service = new Service(); service.setMailAddress((String) serviceMap.get("mail_address")); service.setCardBrand((String) serviceMap.get("card_brand")); service.setCardNum((String) serviceMap.get("card_num")); service.setServiceId((String) serviceMap.get("service_id")); service.setPassword((String) serviceMap.get("password")); service.setMemo((String) serviceMap.get("memo")); attr.addFlashAttribute("service",service); return "redirect:/detail"; } //これいる? @GetMapping("/detail") public String detail2() { return "detail"; } //削除機能 //詳細表示と同じくIDをキーとして削除実行 //削除後はlist画面へリダイレクト @PostMapping("/delete/{id}") public String delete(@PathVariable("id") Long id) { serviceDao.delete(id); return "redirect:/list"; } }
d7f9e1c3f54d05d0809179f55492c5de7a3954fb
9324b5527a6fd29af0afb8aef88be9201a8f5db9
/project/src/main/java/xyz/hotchpotch/jutaime/serializable/experimental/package-info.java
95765607e2649e47a4a9c86862df74b00cb02f89
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
nmby/jUtaime
92ca580b127c5591eee8385f0c13ff71dad7d2a5
b1f60eba88648cdc82fce789423fe528c24a53a7
refs/heads/master
2020-04-16T13:53:06.428546
2016-01-10T14:41:09
2016-01-10T14:41:09
39,452,477
7
3
null
null
null
null
UTF-8
Java
false
false
728
java
/** * <b>注意:</b> * このパッケージの機能は {@link xyz.hotchpotch.jutaime.serializable} パッケージとして正式リリースされました。<br> * 今後は {@link xyz.hotchpotch.jutaime.serializable.experimental} パッケージではなく * {@link xyz.hotchpotch.jutaime.serializable} パッケージの各種クラスを利用してください。<br> * このパッケージは将来のリリースで削除される予定です。<br> * <br> * JUnit4でのシリアライズ/デシリアライズに関するテストを効率化するためのクラスを提供します。<br> * * @since 1.2.0 * @author nmby */ package xyz.hotchpotch.jutaime.serializable.experimental;
f2e3619ea3f38915b6638b39fec97767be14d502
580e0f965f508ae323b0f98581771d7cd8610d46
/app/src/main/java/com/bolooo/studyhomeparents/activty/home/NewCourseListActivity.java
20be460bc1eb6a11d739785c3b8aa1c41e6f15e7
[]
no_license
liliuhuan/yxj
ce20147ef9cda156de8c1ed77222a8f032d62e6c
8236a779b4d7fa3eed6d6f81d43dbfcd9d47d939
refs/heads/master
2020-03-07T10:34:56.997307
2018-04-01T02:30:51
2018-04-01T02:30:51
127,435,162
0
0
null
null
null
null
UTF-8
Java
false
false
25,798
java
package com.bolooo.studyhomeparents.activty.home; import android.content.Context; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.PopupWindow; import android.widget.RelativeLayout; import android.widget.TextView; import com.bolooo.studyhomeparents.R; import com.bolooo.studyhomeparents.adapter.FaceYearsAdapter; import com.bolooo.studyhomeparents.adapter.NewNearLessonAdapter; import com.bolooo.studyhomeparents.adapter.home.HomeLookCourseAdapter; import com.bolooo.studyhomeparents.base.BaseActivity; import com.bolooo.studyhomeparents.entity.newhome.DirectoryTypeEntity; import com.bolooo.studyhomeparents.entity.newhome.LookCourseEnity; import com.bolooo.studyhomeparents.request.util.NewHomeUtils; import com.bolooo.studyhomeparents.utils.Constants; import com.bolooo.studyhomeparents.utils.DensityUtil; import com.bolooo.studyhomeparents.utils.ToastUtils; import com.bolooo.studyhomeparents.views.WaitProgressBar; import com.example.xrecyclerview.XRecyclerView; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import butterknife.Bind; import butterknife.OnClick; public class NewCourseListActivity extends BaseActivity implements NewHomeUtils.OnDirectoryTypeListener, NewHomeUtils.OnLookCourseListLisenter{ @Bind(R.id.near_lesson) TextView nearLesson; @Bind(R.id.face_year) TextView faceYear; @Bind(R.id.course_type) TextView courseType; @Bind(R.id.bar_lay) RelativeLayout barLay; @Bind(R.id.pin_header) LinearLayout pinHeader; @Bind(R.id.progressBar) WaitProgressBar progressBar; @Bind(R.id.empty_image) ImageView emptyImage; private int page; private int count; @Bind(R.id.xrlistview) XRecyclerView xrlistview; private double latitude;//维度 private double longitude;//经度 private String typeId = ""; private String cityId = ""; private String cityName = ""; private String areaId = ""; private String areaName = ""; private String minAge = "0"; private String maxAge = "0"; private String keyword = ""; private List<LookCourseEnity.AreasEntity> areas; HomeLookCourseAdapter homeClassifyAdapter; private PopupWindow popWindow; private List<DirectoryTypeEntity> data; private int mLeftSelectedIndex = 0; private int mRightSelectedIndex = 0; private int mLeftSelectedIndexRecord = mLeftSelectedIndex; /** * 记录左侧条目背景位置 */ private View mLeftRecordView = null; /** * 记录右侧条目对勾位置 */ private ImageView mRightRecordImageView = null; //用于首次测量时赋值标志 private boolean mIsFirstMeasureLeft = true; private boolean mIsFirstMeasureRight = true; private LeftAdapter mLeftAdapter; private RightAdapter mRightAdapter; private PopupWindow nearLessonPopWindow; private NewNearLessonAdapter nearLessonAdapter; private PopupWindow faceYearsPopWindow; private FaceYearsAdapter faceYearsAdapter; private String typeLevel=""; private String tagName; private boolean isOne; @Override public int initLoadResId() { return R.layout.activity_new_course_list; } @Override protected void initView() { areas = new ArrayList<>(); data = new ArrayList<>(); initBar(); insureBar.setTitle(getString(R.string.look_course)); insureBar.getCheckBox().setVisibility(View.GONE); initFaceYearMenu(); initNearAreaMenu(); xrlistview.setLayoutManager(new LinearLayoutManager(this)); homeClassifyAdapter = new HomeLookCourseAdapter(this); xrlistview.setAdapter(homeClassifyAdapter); xrlistview.setLoadingListener(new XRecyclerView.LoadingListener() { @Override public void onRefresh() { page = 1; getNewHomeCourse(); } @Override public void onLoadMore() { page++; getNewHomeCourse(); } }); } private void getNewHomeCourse() { if (progressBar != null) progressBar.show(); NewHomeUtils.getInstance().getLookCourseList(page, count, getMapPramas(), this); } @Override protected void initDate() { Bundle extras = getIntent().getExtras(); if (extras != null){ longitude = extras.getDouble("MyLongitude"); latitude = extras.getDouble("MyLatitude"); typeId = extras.getString("tagId"); tagName = extras.getString("tagName"); cityName = extras.getString("cityName"); isOne = extras.getBoolean("isOne"); } if (isOne)typeLevel = "1" ;else typeLevel = "2"; if (!TextUtils.isEmpty(cityName))nearLesson.setText(cityName); if (!TextUtils.isEmpty(tagName)) courseType.setText("全部"+tagName); page = 1; count = 10; } @Override protected void prepareData() { NewHomeUtils.getInstance().getDirectoryType(this); getNewHomeCourse(); } private Map<String, String> getMapPramas() { Map<String, String> map = new HashMap<>(); map.put("CityId", cityId); map.put("CityName", cityName); map.put("AreaId", areaId); map.put("AreaName", areaName); map.put("MinAge", minAge); map.put("MaxAge", maxAge); map.put("TypeId", typeId); map.put("MyLongitude", String.valueOf(longitude)); map.put("MyLatitude", String.valueOf(latitude)); map.put("Keyword", keyword); map.put("TypeLevel", typeLevel);//1:一级目录;2:二级目录 map.put("OfficalTitle", "");//1:一级目录;2:二级目录 Log.d("params--",map.toString()); return map; } private void initNearAreaMenu() { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View contentView = inflater.inflate(R.layout.face_year_popup, null); nearLessonPopWindow = new PopupWindow(contentView, Constants.screenWidth, Constants.screenHeight / 2); ListView faceLv = (ListView) contentView.findViewById(R.id.lv_faceyear_pop); nearLessonAdapter = new NewNearLessonAdapter(this); faceLv.setAdapter(nearLessonAdapter); faceLv.setDividerHeight(0); nearLessonPopWindow.setFocusable(true); nearLessonPopWindow.setTouchable(true); nearLessonPopWindow.setBackgroundDrawable(new BitmapDrawable()); nearLessonPopWindow.setOutsideTouchable(true);// 设置允许在外点击消失 faceLv.setOnItemClickListener((AdapterView<?> adapterView, View view, int pos, long l) -> { if (areas == null || areas.size() == 0) return; nearLessonAdapter.setCheckItem(pos); LookCourseEnity.AreasEntity areasEntity = areas.get(pos); if (pos == 0) { areaName = ""; areaId = ""; cityId = ""; if (cityName.contains("县") || cityName.contains("区") || cityName.contains("州")) nearLesson.setText("全部"); else nearLesson.setText("全部"); } else { areaName = areasEntity.getAreaName(); areaId = areasEntity.getId(); // cityId = areasEntity.getCityId(); nearLesson.setText(areaName); } xrlistview.reset(); page = 1; getNewHomeCourse(); nearLessonPopWindow.dismiss(); }); nearLessonPopWindow.setOnDismissListener(() -> { nearLesson.setTextColor(getResources().getColor(R.color.text_color_66)); setReclyViewBackgroundAlpha(1.0f); }); } private void initFaceYearMenu() { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); List<String> mData = new ArrayList<>(); String data[] = {"全年龄", "1-3岁", "3-6岁", "6-12岁", "12岁以上"}; for (int i = 0; i < data.length; i++) { mData.add(data[i]); } View contentView = inflater.inflate(R.layout.face_year_popup, null); faceYearsPopWindow = new PopupWindow(contentView, Constants.screenWidth, ViewGroup.LayoutParams.WRAP_CONTENT); ListView faceLv = (ListView) contentView.findViewById(R.id.lv_faceyear_pop); faceYearsAdapter = new FaceYearsAdapter(this); faceLv.setAdapter(faceYearsAdapter); faceLv.setDividerHeight(0); runOnUiThread(() -> faceYearsAdapter.setItems(mData)); faceYearsPopWindow.setFocusable(true); faceYearsPopWindow.setTouchable(true); faceYearsPopWindow.setBackgroundDrawable(new BitmapDrawable()); faceYearsPopWindow.setOutsideTouchable(true);// 设置允许在外点击消失 faceLv.setOnItemClickListener((AdapterView<?> adapterView, View view, int pos, long l) -> { faceYearsAdapter.setCheckItem(pos); String yearString = mData.get(pos); faceYear.setText(yearString); if (pos == 0) { minAge = "0"; maxAge = "0"; } else if (pos == mData.size() - 1) { minAge = yearString.substring(0, 2); maxAge = "0"; } else { String[] split = yearString.substring(0, yearString.indexOf("岁")).split("-"); minAge = split[0]; maxAge = split[1]; } xrlistview.reset(); page = 1; getNewHomeCourse(); faceYearsPopWindow.dismiss(); }); faceYearsPopWindow.setOnDismissListener(() -> { faceYear.setTextColor(getResources().getColor(R.color.text_color_66)); setReclyViewBackgroundAlpha(1.0f); }); } private void initCourseTypeMenu() { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View contentView = inflater.inflate(R.layout.layout_holder_subject, null); popWindow = new PopupWindow(contentView, Constants.screenWidth, Constants.screenHeight*1/3); ListView mLeftListView = (ListView) contentView.findViewById(R.id.listView1); ListView mRightListView = (ListView) contentView.findViewById(R.id.listView2); mLeftAdapter = new LeftAdapter(data, mLeftSelectedIndex); DirectoryTypeEntity directoryTypeEntity = data.get(mLeftSelectedIndex); if (directoryTypeEntity!= null){ List<DirectoryTypeEntity.DirectoryTypeTagsEntity> directoryTypeTags = directoryTypeEntity.getDirectoryTypeTags(); if (directoryTypeTags == null ) directoryTypeTags = new ArrayList<>(); DirectoryTypeEntity.DirectoryTypeTagsEntity directoryTypeTagsEntity = new DirectoryTypeEntity.DirectoryTypeTagsEntity(); if (mLeftSelectedIndex == 0){ directoryTypeTagsEntity.setTagName("全部"); }else { directoryTypeTagsEntity.setTagName("全部"+directoryTypeEntity.getName()); } directoryTypeTagsEntity.setTagId("-1"); directoryTypeTags.add(0,directoryTypeTagsEntity); mRightAdapter = new RightAdapter(directoryTypeTags, mRightSelectedIndex); } mLeftListView.setAdapter(mLeftAdapter); mRightListView.setAdapter(mRightAdapter); mLeftListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mLeftSelectedIndex = position; mLeftSelectedIndexRecord = mLeftSelectedIndex; int childCount = mLeftListView.getChildCount(); for (int i = 0; i <childCount ; i++) { View childAt = mLeftListView.getChildAt(i); TextView leftChildText = (TextView)childAt.findViewById(R.id.group_textView); if (i == position){ leftChildText.setTextColor(getResources().getColor(R.color.bg_color)); }else leftChildText.setTextColor(getResources().getColor(R.color.text_color_77)); } // if (mLeftRecordView != null) { // mLeftRecordView.setBackgroundResource(R.color.bg); // } // view.setBackgroundResource(R.color.white); mLeftRecordView = view; DirectoryTypeEntity directoryTypeEntity = data.get(position); if (directoryTypeEntity != null){ List<DirectoryTypeEntity.DirectoryTypeTagsEntity> directoryTypeTags1 = directoryTypeEntity.getDirectoryTypeTags(); if (directoryTypeTags1 == null ) {//处理全部重复问题 directoryTypeTags1 = new ArrayList<>(); DirectoryTypeEntity.DirectoryTypeTagsEntity directoryTypeTagsEntity = new DirectoryTypeEntity.DirectoryTypeTagsEntity(); if (position == 0){ directoryTypeTagsEntity.setTagName("全部"); }else directoryTypeTagsEntity.setTagName("全部"+directoryTypeEntity.getName()); directoryTypeTagsEntity.setTagId("-1"); directoryTypeTags1.add(0,directoryTypeTagsEntity); } else { DirectoryTypeEntity.DirectoryTypeTagsEntity directoryTypeTagsEntity1 = directoryTypeTags1.get(0); String tagId = directoryTypeTagsEntity1.getTagId(); if (!"-1".equals(tagId)){ DirectoryTypeEntity.DirectoryTypeTagsEntity directoryTypeTagsEntity = new DirectoryTypeEntity.DirectoryTypeTagsEntity(); directoryTypeTagsEntity.setTagName("全部"+directoryTypeEntity.getName()); directoryTypeTagsEntity.setTagId("-1"); directoryTypeTags1.add(0,directoryTypeTagsEntity); } } mRightAdapter.setDataList(directoryTypeTags1, 0); } mRightAdapter.notifyDataSetChanged(); } }); mRightListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mRightSelectedIndex = position; mLeftSelectedIndexRecord = mLeftSelectedIndex; ImageView imageView = (ImageView) view.findViewById(R.id.list2_right); if (mRightRecordImageView != null) { mRightRecordImageView.setVisibility(View.INVISIBLE); } imageView.setVisibility(View.VISIBLE); mRightRecordImageView = imageView; DirectoryTypeEntity directoryTypeEntity = data.get(mLeftSelectedIndexRecord); List<DirectoryTypeEntity.DirectoryTypeTagsEntity> directoryTypeTags = directoryTypeEntity.getDirectoryTypeTags(); if (position == 0){ if (mLeftSelectedIndexRecord == 0){ courseType.setText("全部"); typeId = "" ; }else { courseType.setText(directoryTypeTags.get(position).getTagName()); typeId = directoryTypeEntity.getId(); } typeLevel = "1"; }else { DirectoryTypeEntity.DirectoryTypeTagsEntity directoryTypeTagsEntity = directoryTypeTags.get(mRightSelectedIndex); courseType.setText(directoryTypeTagsEntity.getTagName()); typeId = directoryTypeTagsEntity.getTagId(); typeLevel = "2"; } xrlistview.reset(); page = 1; getNewHomeCourse(); popWindow.dismiss(); } }); popWindow.setFocusable(true); popWindow.setTouchable(true); popWindow.setBackgroundDrawable(new BitmapDrawable()); popWindow.setOutsideTouchable(true);// 设置允许在外点击消失 popWindow.setOnDismissListener(() -> { courseType.setTextColor(getResources().getColor(R.color.text_color_66)); setReclyViewBackgroundAlpha(1.0f); }); } @Override public void getDirectoryTypeSuccess(List<DirectoryTypeEntity> messageEntityList) { DirectoryTypeEntity directoryTypeEntity = new DirectoryTypeEntity(); directoryTypeEntity.setName("全部"); messageEntityList.add(0,directoryTypeEntity); if (data != null) data.clear(); data.addAll(messageEntityList); if (!TextUtils.isEmpty(typeId)){ for (int i = 1; i <data.size() ; i++) { DirectoryTypeEntity directoryTypeEntity1 = data.get(i); if (typeId.equals(directoryTypeEntity1.getId())){ mLeftSelectedIndex = i; mLeftSelectedIndexRecord = mLeftSelectedIndex; } } } initCourseTypeMenu(); } @Override public void getDirectoryTypeFailure(String error) { ToastUtils.showToast(error); } @Override public void OnLookCourseListSucessful(LookCourseEnity homeCourseEntity) { if (progressBar != null) progressBar.hide(); xrlistview.refreshComplete(); List<LookCourseEnity.CourseShowResponsesEntity> courseShowResponses = homeCourseEntity.getCourseShowResponses(); if (page == 1) { if (areas != null) areas.clear(); List<LookCourseEnity.AreasEntity> areasDatas = homeCourseEntity.getAreas(); if (areasDatas != null) areas.addAll(homeCourseEntity.getAreas()); LookCourseEnity.AreasEntity allArea = new LookCourseEnity.AreasEntity(); allArea.setAreaName("全部"); allArea.setId("-1"); areas.add(0, allArea); nearLessonAdapter.setItems(areas); if (courseShowResponses == null || courseShowResponses.size() == 0) { showEmpty(); return; } else { hindEmpty(); homeClassifyAdapter.setList(courseShowResponses); } } else { if (courseShowResponses == null || courseShowResponses.size() == 0) { xrlistview.noMoreLoading(); } else { homeClassifyAdapter.addList(courseShowResponses); } } } private void hindEmpty() { emptyImage.setVisibility(View.GONE); xrlistview.setVisibility(View.VISIBLE); } private void showEmpty() { emptyImage.setVisibility(View.VISIBLE); xrlistview.setVisibility(View.GONE); } @Override public void OnLookCourseListFail(String error) { ToastUtils.showToast(error); xrlistview.refreshComplete(); if (progressBar != null) progressBar.hide(); } public void setReclyViewBackgroundAlpha(float bgAlpha) { if (xrlistview != null) xrlistview.setAlpha(bgAlpha); } @OnClick({R.id.near_lesson, R.id.face_year, R.id.course_type}) public void onClick(View view) { switch (view.getId()) { case R.id.near_lesson://身边好课 nearLesson.setTextColor(getResources().getColor(R.color.bg_color)); if (nearLessonPopWindow != null) { nearLessonPopWindow.showAtLocation(pinHeader, Gravity.TOP, 0, DensityUtil.dip2px(this, 106)); setReclyViewBackgroundAlpha(0.3f); } break; case R.id.face_year://全年龄 faceYear.setTextColor(getResources().getColor(R.color.bg_color)); if (faceYearsPopWindow != null) { faceYearsPopWindow.showAtLocation(pinHeader, Gravity.TOP, 0, DensityUtil.dip2px(this, 106)); setReclyViewBackgroundAlpha(0.3f); } break; case R.id.course_type://全部分类 courseType.setTextColor(getResources().getColor(R.color.bg_color)); if (popWindow != null) { popWindow.showAtLocation(pinHeader, Gravity.TOP, 0, DensityUtil.dip2px(this, 125)); setReclyViewBackgroundAlpha(0.3f); } break; } } private class LeftAdapter extends BaseAdapter { private List<DirectoryTypeEntity> mLeftDataList; public LeftAdapter(List<DirectoryTypeEntity> list, int leftIndex) { this.mLeftDataList = list; mLeftSelectedIndex = leftIndex; } @Override public int getCount() { return mLeftDataList.size(); } @Override public Object getItem(int position) { return mLeftDataList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { LeftViewHolder holder; if (convertView == null) { holder = new LeftViewHolder(); convertView = View.inflate(NewCourseListActivity.this, R.layout.layout_normal_menu_item, null); holder.leftText = (TextView) convertView.findViewById(R.id.group_textView); holder.backgroundView = convertView.findViewById(R.id.ll_main); convertView.setTag(holder); } else { holder = (LeftViewHolder) convertView.getTag(); } holder.leftText.setText(mLeftDataList.get(position).getName()); if (mLeftSelectedIndex == position) { // holder.backgroundView.setBackgroundResource(R.color.white); //选中项背景 holder.leftText.setTextColor(getResources().getColor(R.color.bg_color)); if (position == 0 && mIsFirstMeasureLeft) { mIsFirstMeasureLeft = false; mLeftRecordView = convertView; // groupLeftText = holder.leftText; } } else { holder.leftText.setTextColor(getResources().getColor(R.color.text_color_77)); // holder.backgroundView.setBackgroundResource(R.color.bg); //其他项背景 } return convertView; } } private class RightAdapter extends BaseAdapter { private List<DirectoryTypeEntity.DirectoryTypeTagsEntity> mRightDataList; public RightAdapter(List<DirectoryTypeEntity.DirectoryTypeTagsEntity> list, int rightSelectedIndex) { this.mRightDataList = list; mRightSelectedIndex = rightSelectedIndex; } public void setDataList(List<DirectoryTypeEntity.DirectoryTypeTagsEntity> list, int rightSelectedIndex) { this.mRightDataList = list; mRightSelectedIndex = rightSelectedIndex; } @Override public int getCount() { return mRightDataList == null ? 0:mRightDataList.size(); } @Override public Object getItem(int position) { return mRightDataList == null ? null:mRightDataList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { RightViewHolder holder; if (convertView == null) { holder = new RightViewHolder(); convertView = View.inflate(NewCourseListActivity.this, R.layout.layout_child_menu_item, null); holder.rightText = (TextView) convertView.findViewById(R.id.child_textView); holder.selectedImage = (ImageView) convertView.findViewById(R.id.list2_right); convertView.setTag(holder); } else { holder = (RightViewHolder) convertView.getTag(); } holder.rightText.setText(mRightDataList.get(position).getTagName()); if (mRightSelectedIndex == position && mLeftSelectedIndex == mLeftSelectedIndexRecord) { holder.rightText.setTextColor(getResources().getColor(R.color.bg_color)); holder.selectedImage.setVisibility(View.VISIBLE); mRightRecordImageView = holder.selectedImage; } else { holder.rightText.setTextColor(getResources().getColor(R.color.text_color_77)); holder.selectedImage.setVisibility(View.INVISIBLE); } return convertView; } } private static class LeftViewHolder { TextView leftText; View backgroundView; } private static class RightViewHolder { TextView rightText; ImageView selectedImage; } }
3d397c5395dfa5e53168a116df427ef3b5ce5db8
09679b4ee0c55f291b32bf19d11d10da11958919
/src/main/java/net/nguyen/journal/inspect/LargeMessageReader.java
0c8c86ce8d96af6f8f8c7b509e324b939d0cc7d1
[]
no_license
nguyenfilip/hornetq
ab2fd5c546e1f7faa6d7f6e100d5e68f28020ba2
fc129e3d3c276a2a5df02508256905a1e03381ea
refs/heads/master
2021-01-10T06:22:09.997645
2015-10-26T13:01:26
2015-10-26T13:01:26
43,941,723
0
0
null
null
null
null
UTF-8
Java
false
false
1,062
java
package net.nguyen.journal.inspect; import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.util.Arrays; import org.apache.commons.io.FileUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class LargeMessageReader { @Autowired private JournalInspectorConfiguration config; public String readJsonInsideFile(long id) { Path path = config.getLargeMessagesPath(); File largeMsgFile = path.resolve(id+".msg").toFile(); if (!largeMsgFile.exists()) { throw new IllegalArgumentException("File for message "+id+"doesn't exist"); } try { byte[] bytes = FileUtils.readFileToByteArray(largeMsgFile); bytes = Arrays.copyOfRange(bytes,8,bytes.length); String decoded = new String(bytes, "UTF-16LE"); return decoded; } catch (IOException e) { throw new RuntimeException(e); } } }
3681ee7ef33600a6921a472a684cd9189984a1a6
aa0cf2ffcbee2dd58c37152a2fa1bf6427ef5cf5
/PlayChannelBusiness/src/main/java/com/ninethree/palychannelbusiness/activity/OrderActivity.java
828863270ceb48365aa4396c9674c6faff42bdc7
[]
no_license
yisiwei/Project
8c3554c084bbcc9f185467a9a651f4177a567672
c4e7aab46ad718a3d11d1669267d154aab6f2733
refs/heads/master
2020-04-06T07:09:58.471832
2016-08-29T08:06:41
2016-08-29T08:06:41
64,294,909
0
0
null
null
null
null
UTF-8
Java
false
false
4,678
java
package com.ninethree.palychannelbusiness.activity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.TextView; import com.ninethree.palychannelbusiness.R; import com.ninethree.palychannelbusiness.fragment.OrderCardFragment; import com.ninethree.palychannelbusiness.fragment.OrderPduFragment; import com.ninethree.palychannelbusiness.fragment.OrderTotalFragment; import com.ninethree.palychannelbusiness.util.DateUtil; /** * 销售订单 */ public class OrderActivity extends BaseActivity { private TextView mTotalTv; private TextView mPduTv; private TextView mCardTv; private FragmentTransaction mTransaction; private FragmentManager mFragmentManager; private OrderTotalFragment mOrderTotalFragment; private OrderPduFragment mOrderPduFragment; private OrderCardFragment mOrderCardFragment; private String mOrgId; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mTitle.setText("销售订单"); initView(); mOrgId = getIntent().getStringExtra("orgId"); mFragmentManager = getSupportFragmentManager(); setTab(1); } private void initView() { mTotalTv = (TextView) findViewById(R.id.total); mPduTv = (TextView) findViewById(R.id.pdu); mCardTv = (TextView) findViewById(R.id.card); mTotalTv.setOnClickListener(this); mPduTv.setOnClickListener(this); mCardTv.setOnClickListener(this); } @Override public void setLayout() { setContentView(R.layout.ac_order); } @Override public void onClick(View view) { switch (view.getId()){ case R.id.total: setTab(1); break; case R.id.pdu: setTab(2); break; case R.id.card: setTab(3); break; } } public void setTab(int position){ mTransaction = mFragmentManager.beginTransaction(); hideFragments(mTransaction); mTotalTv.setTextColor(getResources().getColor(R.color.color_32)); mPduTv.setTextColor(getResources().getColor(R.color.color_32)); mCardTv.setTextColor(getResources().getColor(R.color.color_32)); switch (position){ case 1: mTotalTv.setTextColor(getResources().getColor(R.color.color_main)); if (mOrderTotalFragment == null){ mOrderTotalFragment = new OrderTotalFragment(); Bundle bundle = new Bundle(); bundle.putString("orgId",mOrgId); mOrderTotalFragment.setArguments(bundle); mTransaction.add(R.id.content,mOrderTotalFragment); }else{ mTransaction.show(mOrderTotalFragment); } break; case 2: mPduTv.setTextColor(getResources().getColor(R.color.color_main)); if (mOrderPduFragment == null){ mOrderPduFragment = new OrderPduFragment(); Bundle bundle = new Bundle(); bundle.putString("orgId",mOrgId); mOrderPduFragment.setArguments(bundle); mTransaction.add(R.id.content,mOrderPduFragment); }else{ mTransaction.show(mOrderPduFragment); } break; case 3: mCardTv.setTextColor(getResources().getColor(R.color.color_main)); if (mOrderCardFragment == null){ mOrderCardFragment = new OrderCardFragment(); Bundle bundle = new Bundle(); bundle.putString("orgId",mOrgId); mOrderCardFragment.setArguments(bundle); mTransaction.add(R.id.content,mOrderCardFragment); }else{ mTransaction.show(mOrderCardFragment); } break; } mTransaction.commit(); } //隐藏所有fragment private void hideFragments(FragmentTransaction transaction) { if (mOrderTotalFragment != null){ transaction.hide(mOrderTotalFragment); } if (mOrderPduFragment != null){ transaction.hide(mOrderPduFragment); } if (mOrderCardFragment != null){ transaction.hide(mOrderCardFragment); } } }
26c11d2527e7aa77d0663a4963265094f33b2f3c
049a88839a0b756e0941d49335cd718094be5cd2
/MathGame/src/com/at/math/TimeMode.java
d5c2382da4f04766d9b7a91c8e1745f5adf319aa
[ "MIT" ]
permissive
tdelev/android
441fb82c8f92ec8e438eb9fb2ef2512dccfe8335
408d411963db10b8bc48b7723da2c998b0cbe4b0
refs/heads/master
2020-04-05T23:03:47.279808
2013-04-02T15:58:50
2013-04-02T15:58:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,467
java
package com.at.math; public class TimeMode implements Synchronizer.Counter { private static final int GAME_TIME = 60; // 60 seconds private static final int POINTS = 100; private static final int BONUS_POINTS = 50; private static final int BONUS_TIME = 50; // 5 seconds private static final int POINTS_HITS = 5; private static final int TIME_HITS = 20; private static final int TIME = 30; private int mLevel; private int mTotalTime; private int mRemainingTime; private int mTimeGenerated; private int mPoints; private int mConsecutiveHits; private int mBonusPoints; private int mBonusTime; private MathExpression mExpression; private String mExpressionString; public TimeMode(int level) { mTotalTime = GAME_TIME; mLevel = level; mRemainingTime = mTotalTime; mPoints = 0; mConsecutiveHits = 0; mExpression = new MathExpression(); } public String nextExpression() { mTimeGenerated = mRemainingTime; mExpressionString = mExpression.generateRandom(mLevel); return mExpressionString; } public String getExpression() { return mExpressionString; } public int getLevel() { return mLevel; } public String getCorrect() { if(mLevel == 1) { return String.valueOf(mExpression.getResult()); } if(mLevel == 2) { return mExpression.getOperator(); } return null; } public void setCorrect() { mConsecutiveHits++; // As fast you solve the problem more points you get int points = POINTS - (mTimeGenerated - mRemainingTime); if (points <= POINTS / 4) { mPoints += POINTS / 4; } else { mPoints += points; } if (mConsecutiveHits > 0 && mConsecutiveHits % POINTS_HITS == 0) { int m = mConsecutiveHits / POINTS_HITS; mBonusPoints =m * m * BONUS_POINTS; mPoints += mBonusPoints; }else { mBonusPoints = 0; } if (mConsecutiveHits > 0 && mConsecutiveHits % TIME_HITS == 0) { int m = mConsecutiveHits / TIME_HITS; // To stop theoretically unlimited game time if (m <= 3) { mBonusTime = m * BONUS_TIME; mRemainingTime += mBonusTime; } }else { mBonusTime = 0; } } public void setWrong() { mConsecutiveHits = 0; } public int getPoints() { return mPoints; } public int getBonusPoints() { return mBonusPoints; } public int getBonusTime() { return mBonusTime / 10; } public float getTimeRatio() { return mRemainingTime * 1.0f / mTotalTime; } @Override public int tick() { mRemainingTime--; return mRemainingTime; } }
4a897cb2e5bd9914f6bb1d6da84ccb02a60338c2
1b19cd0645fff07e99ee4426a76cb2c3f4750c9d
/Java/Supersankari_relaatiotietokanta_Windowbuilder/trunk/src/supisGUI/PoistonVarmistus.java
46162379b319d177fb273ebdb7ff4c21fe6d04bb
[]
no_license
vihervirveli/portfolio
6d2f5309af26919db06496db55d6aaba6f7f2852
937a4e9d801173447ffc38b64c5c98b40b53a52d
refs/heads/master
2022-12-24T05:45:30.944791
2022-12-21T13:39:24
2022-12-21T13:39:24
210,660,128
0
1
null
null
null
null
ISO-8859-1
Java
false
false
2,862
java
package supisGUI; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.border.EmptyBorder; import rekisteri.Rekisteri; /** *Varmistaa käyttäjältä poiston, se ei meinaan kannata...ikinä * @author majosalo * @version 31.1.2013 * @version 15.3.2013 * */ public class PoistonVarmistus extends JDialog { private static final long serialVersionUID = 1L; private final JPanel contentPanel = new JPanel(); private final Rekisteri rekkari; private String poistoon = ""; /** * Launch the application. */ public static void main(String[] args) { } /** * Muodostetaan PoistonVarmistus * @param rekisteri rekisteri johon muutokset talletetaan * @param poistettava poistettavan supiksen nimi */ public PoistonVarmistus(final Rekisteri rekisteri, String poistettava) { this.rekkari = rekisteri; poistoon = poistettava; setBounds(100, 100, 450, 161); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); this.setModal(true); contentPanel.setLayout(new BorderLayout(0, 0)); { JPanel panelVarmistus = new JPanel(); contentPanel.add(panelVarmistus, BorderLayout.CENTER); panelVarmistus.setLayout(new BorderLayout(0, 0)); { JTextArea txtrOletkoAivanVarma = new JTextArea(); txtrOletkoAivanVarma.setWrapStyleWord(true); txtrOletkoAivanVarma.setLineWrap(true); txtrOletkoAivanVarma.setText("Oletko aivan varma? Poistoa ei voi perua.\r\nEik\u00E4 kukaan oikeasti kuole sarjakuvissa! Paitsi Uncle Ben."); txtrOletkoAivanVarma.setEditable(false); panelVarmistus.add(txtrOletkoAivanVarma, BorderLayout.CENTER); } { JLabel lblVarmistus = new JLabel("Vamistus"); panelVarmistus.add(lblVarmistus, BorderLayout.NORTH); } } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton okButton = new JButton("Olen varma"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { rekkari.poistaSupis(poistoon); dispose(); } }); okButton.setActionCommand("OK"); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton("Ei se kuitenkaan kuollut"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); } }); cancelButton.setActionCommand("Cancel"); buttonPane.add(cancelButton); } } } }
6bbb4a06554cf45469cef78c1ff6b80110088b85
2a257fd7d602d3c8d3e9f843aa33222b44fe3453
/SortingAlgos/InsertionSort.java
d5dc07ece19bfc42a40976d4032181961376da08
[]
no_license
himanshudhawale/Algorithms-DataStructure
b8b0bfc7f8fa0f15d62744135979d43f5fbb05f6
d23976913b0495dd45d293cc89acf26f4c2d9d63
refs/heads/master
2020-05-05T05:11:08.891957
2019-04-05T19:48:32
2019-04-05T19:48:32
179,742,139
0
1
null
null
null
null
UTF-8
Java
false
false
259
java
public class InsertionSort { public int[] sort(int[] A) { for (int i = 1; i < A.length; i++) { int key = A[i]; int j = i; while (j > 0 && A[j - 1] > key) { A[j] = A[j - 1]; j = j - 1; } A[j] = key; } return A; } }
25dab9a0b442772ad05013dc4cd61208f3c55dcc
1ec0790d4c43c61fa0f0d6169ac46b0c2bc26832
/src/com/tst/program2/TestSorting.java
af99a0c6f24bfa986f7e65ef7d0f3f661eb66fd1
[]
no_license
Rameswar-git/Core-Java
dce0527918c2ba68dca65bb767dccad4a72a1949
61c6ee50146aa49cd69ff6186b5375f7e2b01088
refs/heads/master
2023-04-27T04:43:17.601448
2022-12-14T20:37:52
2022-12-14T20:37:52
128,160,995
1
0
null
2023-04-17T19:41:56
2018-04-05T04:58:09
Java
UTF-8
Java
false
false
1,113
java
package com.tst.program2; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; public class TestSorting { public static void main(String[] args) { List<Developer> listDevs = getDevelopers(); System.out.println("Before Sort"); for (Developer developer : listDevs) { System.out.println(developer); } System.out.println("After Sort"); //lambda here! // listDevs.sort((Developer o1, Developer o2)->o1.getAge()-o2.getAge()); listDevs.sort((o1, o2)->o1.getSalary().compareTo(o2.getSalary())); //java 8 only, lambda also, to print the List listDevs.forEach((developer)->System.out.println(developer)); } private static List<Developer> getDevelopers() { List<Developer> result = new ArrayList<Developer>(); result.add(new Developer("alvin", new BigDecimal("80000"), 20)); result.add(new Developer("jason", new BigDecimal("100000"), 10)); result.add(new Developer("iris", new BigDecimal("170000"), 55)); result.add(new Developer("mkyong", new BigDecimal("70000"), 33)); return result; } }
[ "Administrator@Admin" ]
Administrator@Admin
65a71ad7e755618e83fee885ec51cd82c394d9fa
7af7afd53a3b20c7f4e3bc5c9afca635a24ae793
/system-event/src/main/java/jp/co/acom/riza/event/entity/TranExecCheckEntity.java
d59cecf61fbd7d715d0c6bc7d8ca168076ad61a2
[]
no_license
teragress/riza
acafbce30d70b689e1b909970ec00ce93bb7254c
db6b8ca0463de42c3cc6ea948525850dba3a22be
refs/heads/master
2021-02-15T01:18:29.165120
2020-08-04T12:48:31
2020-08-04T12:48:31
244,851,239
0
0
null
null
null
null
UTF-8
Java
false
false
730
java
package jp.co.acom.riza.event.entity; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.NamedQuery; import javax.persistence.Table; import lombok.Data; @NamedQuery(name = TranExecCheckEntity.FIND_BY_CLEAN, query = "select u from TranExecCheckEntity u " + "where u.datetime < :baseDatetime") /** * トランザクションイベントエンティティ * * @author teratani * */ @Data @Table(name = "TRANEXECCHECK") @Entity public class TranExecCheckEntity { public static final String FIND_BY_CLEAN = "tranExec.findByClean"; /** * イベントキークラス */ @Id private String eventKey; /** * イベント挿入日時(yyyyMMddHHmmss) */ private String datetime; }
[ "vagrant@localhost" ]
vagrant@localhost
32d118f0df1b3dd3f60ca0e5be3aa10410ebf757
f66ba36653be5f4975d7872e568d3d85d6138419
/src/main/java/com/algos/recurssion/ReverseAStackUsingRecursion.java
6904f252e6d1c26f71aff9e240f29288692422fc
[]
no_license
shweta-code/dsAlgo
dadd718b041e64c15610b0a97ea0faa05f95d654
f3040a2d6d0f719aef40a0258b716e12dc48408c
refs/heads/master
2023-07-20T04:32:18.656021
2023-05-25T11:14:06
2023-05-25T11:14:06
143,183,519
0
0
null
2023-09-11T07:54:22
2018-08-01T16:48:16
Java
UTF-8
Java
false
false
1,052
java
package com.algos.recurssion; import java.util.Stack; public class ReverseAStackUsingRecursion { public static void main(String[] args) { Stack<Integer> stack = new Stack<>(); stack.push(5); stack.push(4); stack.push(3); stack.push(2); stack.push(1); for (Integer integer : stack) { System.out.println(integer); } reverseStack(stack); System.out.println("reversed"); for (Integer integer : stack) { System.out.println(integer); } } private static void reverseStack(Stack<Integer> stack) { if (!stack.isEmpty()) { int no = stack.pop(); reverseStack(stack); putNoInEnd(no, stack); } } private static void putNoInEnd(int no, Stack<Integer> stack) { if (!stack.isEmpty()) { final Integer pop = stack.pop(); putNoInEnd(no, stack); stack.push(pop); } else { stack.push(no); } } }
80b3ecaa67728c20a8feda0f51fa71e5067c33a2
928bdfb9b0f4b6db0043526e095fe1aa822b8e64
/src/main/java/com/taobao/api/request/FenxiaoDealerRequisitionorderCreateRequest.java
503ef9be397228cce6d574d23bbd674c87bf7e5a
[]
no_license
yu199195/jsb
de4f4874fb516d3e51eb3badb48d89be822e00f7
591ad717121dd8da547348aeac551fc71da1b8bd
refs/heads/master
2021-09-07T22:25:09.457212
2018-03-02T04:54:18
2018-03-02T04:54:18
102,316,111
4
3
null
null
null
null
UTF-8
Java
false
false
4,103
java
package com.taobao.api.request; import com.taobao.api.ApiRuleException; import com.taobao.api.BaseTaobaoRequest; import com.taobao.api.internal.util.RequestCheckUtils; import com.taobao.api.internal.util.TaobaoHashMap; import com.taobao.api.response.FenxiaoDealerRequisitionorderCreateResponse; import java.util.Map; public class FenxiaoDealerRequisitionorderCreateRequest extends BaseTaobaoRequest<FenxiaoDealerRequisitionorderCreateResponse> { private String address; private String buyerName; private String city; private String district; private String idCardNumber; private String logisticsType; private String mobile; private String orderDetail; private String phone; private String postCode; private String province; public void setAddress(String address) { this.address = address; } public String getAddress() { return this.address; } public void setBuyerName(String buyerName) { this.buyerName = buyerName; } public String getBuyerName() { return this.buyerName; } public void setCity(String city) { this.city = city; } public String getCity() { return this.city; } public void setDistrict(String district) { this.district = district; } public String getDistrict() { return this.district; } public void setIdCardNumber(String idCardNumber) { this.idCardNumber = idCardNumber; } public String getIdCardNumber() { return this.idCardNumber; } public void setLogisticsType(String logisticsType) { this.logisticsType = logisticsType; } public String getLogisticsType() { return this.logisticsType; } public void setMobile(String mobile) { this.mobile = mobile; } public String getMobile() { return this.mobile; } public void setOrderDetail(String orderDetail) { this.orderDetail = orderDetail; } public String getOrderDetail() { return this.orderDetail; } public void setPhone(String phone) { this.phone = phone; } public String getPhone() { return this.phone; } public void setPostCode(String postCode) { this.postCode = postCode; } public String getPostCode() { return this.postCode; } public void setProvince(String province) { this.province = province; } public String getProvince() { return this.province; } public String getApiMethodName() { return "taobao.fenxiao.dealer.requisitionorder.create"; } public Map<String, String> getTextParams() { TaobaoHashMap txtParams = new TaobaoHashMap(); txtParams.put("address", this.address); txtParams.put("buyer_name", this.buyerName); txtParams.put("city", this.city); txtParams.put("district", this.district); txtParams.put("id_card_number", this.idCardNumber); txtParams.put("logistics_type", this.logisticsType); txtParams.put("mobile", this.mobile); txtParams.put("order_detail", this.orderDetail); txtParams.put("phone", this.phone); txtParams.put("post_code", this.postCode); txtParams.put("province", this.province); if (this.udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public Class<FenxiaoDealerRequisitionorderCreateResponse> getResponseClass() { return FenxiaoDealerRequisitionorderCreateResponse.class; } public void check() throws ApiRuleException { RequestCheckUtils.checkNotEmpty(this.address, "address"); RequestCheckUtils.checkNotEmpty(this.buyerName, "buyerName"); RequestCheckUtils.checkNotEmpty(this.logisticsType, "logisticsType"); RequestCheckUtils.checkNotEmpty(this.orderDetail, "orderDetail"); RequestCheckUtils.checkMaxListSize(this.orderDetail, 50, "orderDetail"); RequestCheckUtils.checkNotEmpty(this.province, "province"); } }
ed8af20203d679531be05af79d5615fd2022a9f5
cd3ccecae854006753b5d521833620457f176493
/src/provider/MapleDataProvider.java
56872663a3bb39a6e65fc463042f420039cf7a77
[ "MIT" ]
permissive
PhatHoang21/VoidMS
0dfd9d50f35c03960ccda0258cdceec777191dac
425bf0cc1430f40c090ad7b10346e33a0de9cef3
refs/heads/master
2021-06-12T03:03:03.058690
2017-01-26T00:45:10
2017-01-26T00:45:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
137
java
package provider; public interface MapleDataProvider { MapleData getData(String path); MapleDataDirectoryEntry getRoot(); }
332284e759a089beea7154049cd7c8d11ad5a47e
4f57aed823ff96ae43d95cf84cf439f6fa41cd7a
/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/ibm-igc-repository-connector/igc-rest-client-library/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/igc/clientlibrary/model/generated/v11710/BiCollection.java
b31e0999db453a252a8c7e27523c9905faea1063
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
ElshadV/egeria
2640607a332ca08dab9c3af0276ba509722a7a50
dd43bdff970e88c885a3002929b061c90a0796fe
refs/heads/master
2020-05-18T01:23:03.615663
2019-04-29T14:14:19
2019-04-29T14:14:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
29,603
java
/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.adapters.repositoryservices.igc.clientlibrary.model.generated.v11710; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.annotation.Generated; import org.odpi.openmetadata.adapters.repositoryservices.igc.clientlibrary.model.common.*; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.ArrayList; /** * POJO for the {@code bi_collection} asset type in IGC, displayed as '{@literal BI Collection}' in the IGC UI. * <br><br> * (this code has been generated based on out-of-the-box IGC metadata types; * if modifications are needed, eg. to handle custom attributes, * extending from this class in your own custom class is the best approach.) */ @Generated("org.odpi.openmetadata.adapters.repositoryservices.igc.clientlibrary.model.IGCRestModelGenerator") @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeName("bi_collection") public class BiCollection extends Reference { public static String getIgcTypeDisplayName() { return "BI Collection"; } /** * The {@code name} property, displayed as '{@literal Name}' in the IGC UI. */ protected String name; /** * The {@code short_description} property, displayed as '{@literal Short Description}' in the IGC UI. */ protected String short_description; /** * The {@code long_description} property, displayed as '{@literal Long Description}' in the IGC UI. */ protected String long_description; /** * The {@code type} property, displayed as '{@literal Type}' in the IGC UI. */ protected String type; /** * The {@code namespace} property, displayed as '{@literal Namespace}' in the IGC UI. */ protected String namespace; /** * The {@code bi_model_or_bi_collection} property, displayed as '{@literal BI Model or BI Collection}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link Olapobject} objects. */ protected ReferenceList bi_model_or_bi_collection; /** * The {@code bi_model} property, displayed as '{@literal BI Model}' in the IGC UI. * <br><br> * Will be a single {@link Reference} to a {@link BiModel} object. */ protected Reference bi_model; /** * The {@code bi_collection} property, displayed as '{@literal BI Collection}' in the IGC UI. * <br><br> * Will be a single {@link Reference} to a {@link BiCollection} object. */ protected Reference bi_collection; /** * The {@code labels} property, displayed as '{@literal Labels}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link Label} objects. */ protected ReferenceList labels; /** * The {@code stewards} property, displayed as '{@literal Stewards}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link AsclSteward} objects. */ protected ReferenceList stewards; /** * The {@code assigned_to_terms} property, displayed as '{@literal Assigned to Terms}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link Term} objects. */ protected ReferenceList assigned_to_terms; /** * The {@code implements_rules} property, displayed as '{@literal Implements Rules}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationGovernanceRule} objects. */ protected ReferenceList implements_rules; /** * The {@code governed_by_rules} property, displayed as '{@literal Governed by Rules}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationGovernanceRule} objects. */ protected ReferenceList governed_by_rules; /** * The {@code has_olap_collection} property, displayed as '{@literal Has OLAP Collection}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiCollection} objects. */ protected ReferenceList has_olap_collection; /** * The {@code bi_collection_members} property, displayed as '{@literal BI Collection Members}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiCollectionMember} objects. */ protected ReferenceList bi_collection_members; /** * The {@code alias_(business_name)} property, displayed as '{@literal Alias (Business Name)}' in the IGC UI. */ @JsonProperty("alias_(business_name)") protected String alias__business_name_; /** * The {@code type_definition} property, displayed as '{@literal Type Definition}' in the IGC UI. */ protected String type_definition; /** * The {@code filter_expression} property, displayed as '{@literal Filter Expression}' in the IGC UI. */ protected ArrayList<String> filter_expression; /** * The {@code join_condition} property, displayed as '{@literal Join Condition}' in the IGC UI. */ protected ArrayList<String> join_condition; /** * The {@code imported_from} property, displayed as '{@literal Imported From}' in the IGC UI. */ protected String imported_from; /** * The {@code referenced_by_bi_hierarchies} property, displayed as '{@literal Referenced by BI Hierarchies}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiHierarchy} objects. */ protected ReferenceList referenced_by_bi_hierarchies; /** * The {@code bi_hierarchies} property, displayed as '{@literal BI Hierarchies}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiHierarchy} objects. */ protected ReferenceList bi_hierarchies; /** * The {@code bi_levels} property, displayed as '{@literal BI Levels}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiLevel} objects. */ protected ReferenceList bi_levels; /** * The {@code bi_filters} property, displayed as '{@literal BI Filters}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiFilter} objects. */ protected ReferenceList bi_filters; /** * The {@code native_id} property, displayed as '{@literal Native ID}' in the IGC UI. */ protected String native_id; /** * The {@code references_bi_collections} property, displayed as '{@literal References BI Collections}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiCollection} objects. */ protected ReferenceList references_bi_collections; /** * The {@code referenced_by_bi_collection} property, displayed as '{@literal Referenced by BI Collection}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiCollection} objects. */ protected ReferenceList referenced_by_bi_collection; /** * The {@code used_by_bi_report_queries} property, displayed as '{@literal Used by BI Report Queries}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiReportQuery} objects. */ protected ReferenceList used_by_bi_report_queries; /** * The {@code used_by_bi_cubes} property, displayed as '{@literal Used by BI Cubes}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link BiCube} objects. */ protected ReferenceList used_by_bi_cubes; /** * The {@code uses_database_tables_or_views} property, displayed as '{@literal Uses Database Tables or Views}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link Datagroup} objects. */ protected ReferenceList uses_database_tables_or_views; /** * The {@code read_by_(static)} property, displayed as '{@literal Read by (Static)}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ @JsonProperty("read_by_(static)") protected ReferenceList read_by__static_; /** * The {@code written_by_(static)} property, displayed as '{@literal Written by (Static)}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ @JsonProperty("written_by_(static)") protected ReferenceList written_by__static_; /** * The {@code read_by_(design)} property, displayed as '{@literal Read by (Design)}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ @JsonProperty("read_by_(design)") protected ReferenceList read_by__design_; /** * The {@code written_by_(design)} property, displayed as '{@literal Written by (Design)}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ @JsonProperty("written_by_(design)") protected ReferenceList written_by__design_; /** * The {@code read_by_(operational)} property, displayed as '{@literal Read by (Operational)}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ @JsonProperty("read_by_(operational)") protected ReferenceList read_by__operational_; /** * The {@code written_by_(operational)} property, displayed as '{@literal Written by (Operational)}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ @JsonProperty("written_by_(operational)") protected ReferenceList written_by__operational_; /** * The {@code read_by_(user_defined)} property, displayed as '{@literal Read by (User-Defined)}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ @JsonProperty("read_by_(user_defined)") protected ReferenceList read_by__user_defined_; /** * The {@code written_by_(user_defined)} property, displayed as '{@literal Written by (User-Defined)}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ @JsonProperty("written_by_(user_defined)") protected ReferenceList written_by__user_defined_; /** * The {@code impacted_by} property, displayed as '{@literal Impacted by}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ protected ReferenceList impacted_by; /** * The {@code impacts_on} property, displayed as '{@literal Impacts on}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link InformationAsset} objects. */ protected ReferenceList impacts_on; /** * The {@code in_collections} property, displayed as '{@literal In Collections}' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link Collection} objects. */ protected ReferenceList in_collections; /** * The {@code created_by} property, displayed as '{@literal Created By}' in the IGC UI. */ protected String created_by; /** * The {@code created_on} property, displayed as '{@literal Created On}' in the IGC UI. */ protected Date created_on; /** * The {@code modified_by} property, displayed as '{@literal Modified By}' in the IGC UI. */ protected String modified_by; /** * The {@code modified_on} property, displayed as '{@literal Modified On}' in the IGC UI. */ protected Date modified_on; /** @see #name */ @JsonProperty("name") public String getTheName() { return this.name; } /** @see #name */ @JsonProperty("name") public void setTheName(String name) { this.name = name; } /** @see #short_description */ @JsonProperty("short_description") public String getShortDescription() { return this.short_description; } /** @see #short_description */ @JsonProperty("short_description") public void setShortDescription(String short_description) { this.short_description = short_description; } /** @see #long_description */ @JsonProperty("long_description") public String getLongDescription() { return this.long_description; } /** @see #long_description */ @JsonProperty("long_description") public void setLongDescription(String long_description) { this.long_description = long_description; } /** @see #type */ @JsonProperty("type") public String getTheType() { return this.type; } /** @see #type */ @JsonProperty("type") public void setTheType(String type) { this.type = type; } /** @see #namespace */ @JsonProperty("namespace") public String getNamespace() { return this.namespace; } /** @see #namespace */ @JsonProperty("namespace") public void setNamespace(String namespace) { this.namespace = namespace; } /** @see #bi_model_or_bi_collection */ @JsonProperty("bi_model_or_bi_collection") public ReferenceList getBiModelOrBiCollection() { return this.bi_model_or_bi_collection; } /** @see #bi_model_or_bi_collection */ @JsonProperty("bi_model_or_bi_collection") public void setBiModelOrBiCollection(ReferenceList bi_model_or_bi_collection) { this.bi_model_or_bi_collection = bi_model_or_bi_collection; } /** @see #bi_model */ @JsonProperty("bi_model") public Reference getBiModel() { return this.bi_model; } /** @see #bi_model */ @JsonProperty("bi_model") public void setBiModel(Reference bi_model) { this.bi_model = bi_model; } /** @see #bi_collection */ @JsonProperty("bi_collection") public Reference getBiCollection() { return this.bi_collection; } /** @see #bi_collection */ @JsonProperty("bi_collection") public void setBiCollection(Reference bi_collection) { this.bi_collection = bi_collection; } /** @see #labels */ @JsonProperty("labels") public ReferenceList getLabels() { return this.labels; } /** @see #labels */ @JsonProperty("labels") public void setLabels(ReferenceList labels) { this.labels = labels; } /** @see #stewards */ @JsonProperty("stewards") public ReferenceList getStewards() { return this.stewards; } /** @see #stewards */ @JsonProperty("stewards") public void setStewards(ReferenceList stewards) { this.stewards = stewards; } /** @see #assigned_to_terms */ @JsonProperty("assigned_to_terms") public ReferenceList getAssignedToTerms() { return this.assigned_to_terms; } /** @see #assigned_to_terms */ @JsonProperty("assigned_to_terms") public void setAssignedToTerms(ReferenceList assigned_to_terms) { this.assigned_to_terms = assigned_to_terms; } /** @see #implements_rules */ @JsonProperty("implements_rules") public ReferenceList getImplementsRules() { return this.implements_rules; } /** @see #implements_rules */ @JsonProperty("implements_rules") public void setImplementsRules(ReferenceList implements_rules) { this.implements_rules = implements_rules; } /** @see #governed_by_rules */ @JsonProperty("governed_by_rules") public ReferenceList getGovernedByRules() { return this.governed_by_rules; } /** @see #governed_by_rules */ @JsonProperty("governed_by_rules") public void setGovernedByRules(ReferenceList governed_by_rules) { this.governed_by_rules = governed_by_rules; } /** @see #has_olap_collection */ @JsonProperty("has_olap_collection") public ReferenceList getHasOlapCollection() { return this.has_olap_collection; } /** @see #has_olap_collection */ @JsonProperty("has_olap_collection") public void setHasOlapCollection(ReferenceList has_olap_collection) { this.has_olap_collection = has_olap_collection; } /** @see #bi_collection_members */ @JsonProperty("bi_collection_members") public ReferenceList getBiCollectionMembers() { return this.bi_collection_members; } /** @see #bi_collection_members */ @JsonProperty("bi_collection_members") public void setBiCollectionMembers(ReferenceList bi_collection_members) { this.bi_collection_members = bi_collection_members; } /** @see #alias__business_name_ */ @JsonProperty("alias_(business_name)") public String getAliasBusinessName() { return this.alias__business_name_; } /** @see #alias__business_name_ */ @JsonProperty("alias_(business_name)") public void setAliasBusinessName(String alias__business_name_) { this.alias__business_name_ = alias__business_name_; } /** @see #type_definition */ @JsonProperty("type_definition") public String getTypeDefinition() { return this.type_definition; } /** @see #type_definition */ @JsonProperty("type_definition") public void setTypeDefinition(String type_definition) { this.type_definition = type_definition; } /** @see #filter_expression */ @JsonProperty("filter_expression") public ArrayList<String> getFilterExpression() { return this.filter_expression; } /** @see #filter_expression */ @JsonProperty("filter_expression") public void setFilterExpression(ArrayList<String> filter_expression) { this.filter_expression = filter_expression; } /** @see #join_condition */ @JsonProperty("join_condition") public ArrayList<String> getJoinCondition() { return this.join_condition; } /** @see #join_condition */ @JsonProperty("join_condition") public void setJoinCondition(ArrayList<String> join_condition) { this.join_condition = join_condition; } /** @see #imported_from */ @JsonProperty("imported_from") public String getImportedFrom() { return this.imported_from; } /** @see #imported_from */ @JsonProperty("imported_from") public void setImportedFrom(String imported_from) { this.imported_from = imported_from; } /** @see #referenced_by_bi_hierarchies */ @JsonProperty("referenced_by_bi_hierarchies") public ReferenceList getReferencedByBiHierarchies() { return this.referenced_by_bi_hierarchies; } /** @see #referenced_by_bi_hierarchies */ @JsonProperty("referenced_by_bi_hierarchies") public void setReferencedByBiHierarchies(ReferenceList referenced_by_bi_hierarchies) { this.referenced_by_bi_hierarchies = referenced_by_bi_hierarchies; } /** @see #bi_hierarchies */ @JsonProperty("bi_hierarchies") public ReferenceList getBiHierarchies() { return this.bi_hierarchies; } /** @see #bi_hierarchies */ @JsonProperty("bi_hierarchies") public void setBiHierarchies(ReferenceList bi_hierarchies) { this.bi_hierarchies = bi_hierarchies; } /** @see #bi_levels */ @JsonProperty("bi_levels") public ReferenceList getBiLevels() { return this.bi_levels; } /** @see #bi_levels */ @JsonProperty("bi_levels") public void setBiLevels(ReferenceList bi_levels) { this.bi_levels = bi_levels; } /** @see #bi_filters */ @JsonProperty("bi_filters") public ReferenceList getBiFilters() { return this.bi_filters; } /** @see #bi_filters */ @JsonProperty("bi_filters") public void setBiFilters(ReferenceList bi_filters) { this.bi_filters = bi_filters; } /** @see #native_id */ @JsonProperty("native_id") public String getNativeId() { return this.native_id; } /** @see #native_id */ @JsonProperty("native_id") public void setNativeId(String native_id) { this.native_id = native_id; } /** @see #references_bi_collections */ @JsonProperty("references_bi_collections") public ReferenceList getReferencesBiCollections() { return this.references_bi_collections; } /** @see #references_bi_collections */ @JsonProperty("references_bi_collections") public void setReferencesBiCollections(ReferenceList references_bi_collections) { this.references_bi_collections = references_bi_collections; } /** @see #referenced_by_bi_collection */ @JsonProperty("referenced_by_bi_collection") public ReferenceList getReferencedByBiCollection() { return this.referenced_by_bi_collection; } /** @see #referenced_by_bi_collection */ @JsonProperty("referenced_by_bi_collection") public void setReferencedByBiCollection(ReferenceList referenced_by_bi_collection) { this.referenced_by_bi_collection = referenced_by_bi_collection; } /** @see #used_by_bi_report_queries */ @JsonProperty("used_by_bi_report_queries") public ReferenceList getUsedByBiReportQueries() { return this.used_by_bi_report_queries; } /** @see #used_by_bi_report_queries */ @JsonProperty("used_by_bi_report_queries") public void setUsedByBiReportQueries(ReferenceList used_by_bi_report_queries) { this.used_by_bi_report_queries = used_by_bi_report_queries; } /** @see #used_by_bi_cubes */ @JsonProperty("used_by_bi_cubes") public ReferenceList getUsedByBiCubes() { return this.used_by_bi_cubes; } /** @see #used_by_bi_cubes */ @JsonProperty("used_by_bi_cubes") public void setUsedByBiCubes(ReferenceList used_by_bi_cubes) { this.used_by_bi_cubes = used_by_bi_cubes; } /** @see #uses_database_tables_or_views */ @JsonProperty("uses_database_tables_or_views") public ReferenceList getUsesDatabaseTablesOrViews() { return this.uses_database_tables_or_views; } /** @see #uses_database_tables_or_views */ @JsonProperty("uses_database_tables_or_views") public void setUsesDatabaseTablesOrViews(ReferenceList uses_database_tables_or_views) { this.uses_database_tables_or_views = uses_database_tables_or_views; } /** @see #read_by__static_ */ @JsonProperty("read_by_(static)") public ReferenceList getReadByStatic() { return this.read_by__static_; } /** @see #read_by__static_ */ @JsonProperty("read_by_(static)") public void setReadByStatic(ReferenceList read_by__static_) { this.read_by__static_ = read_by__static_; } /** @see #written_by__static_ */ @JsonProperty("written_by_(static)") public ReferenceList getWrittenByStatic() { return this.written_by__static_; } /** @see #written_by__static_ */ @JsonProperty("written_by_(static)") public void setWrittenByStatic(ReferenceList written_by__static_) { this.written_by__static_ = written_by__static_; } /** @see #read_by__design_ */ @JsonProperty("read_by_(design)") public ReferenceList getReadByDesign() { return this.read_by__design_; } /** @see #read_by__design_ */ @JsonProperty("read_by_(design)") public void setReadByDesign(ReferenceList read_by__design_) { this.read_by__design_ = read_by__design_; } /** @see #written_by__design_ */ @JsonProperty("written_by_(design)") public ReferenceList getWrittenByDesign() { return this.written_by__design_; } /** @see #written_by__design_ */ @JsonProperty("written_by_(design)") public void setWrittenByDesign(ReferenceList written_by__design_) { this.written_by__design_ = written_by__design_; } /** @see #read_by__operational_ */ @JsonProperty("read_by_(operational)") public ReferenceList getReadByOperational() { return this.read_by__operational_; } /** @see #read_by__operational_ */ @JsonProperty("read_by_(operational)") public void setReadByOperational(ReferenceList read_by__operational_) { this.read_by__operational_ = read_by__operational_; } /** @see #written_by__operational_ */ @JsonProperty("written_by_(operational)") public ReferenceList getWrittenByOperational() { return this.written_by__operational_; } /** @see #written_by__operational_ */ @JsonProperty("written_by_(operational)") public void setWrittenByOperational(ReferenceList written_by__operational_) { this.written_by__operational_ = written_by__operational_; } /** @see #read_by__user_defined_ */ @JsonProperty("read_by_(user_defined)") public ReferenceList getReadByUserDefined() { return this.read_by__user_defined_; } /** @see #read_by__user_defined_ */ @JsonProperty("read_by_(user_defined)") public void setReadByUserDefined(ReferenceList read_by__user_defined_) { this.read_by__user_defined_ = read_by__user_defined_; } /** @see #written_by__user_defined_ */ @JsonProperty("written_by_(user_defined)") public ReferenceList getWrittenByUserDefined() { return this.written_by__user_defined_; } /** @see #written_by__user_defined_ */ @JsonProperty("written_by_(user_defined)") public void setWrittenByUserDefined(ReferenceList written_by__user_defined_) { this.written_by__user_defined_ = written_by__user_defined_; } /** @see #impacted_by */ @JsonProperty("impacted_by") public ReferenceList getImpactedBy() { return this.impacted_by; } /** @see #impacted_by */ @JsonProperty("impacted_by") public void setImpactedBy(ReferenceList impacted_by) { this.impacted_by = impacted_by; } /** @see #impacts_on */ @JsonProperty("impacts_on") public ReferenceList getImpactsOn() { return this.impacts_on; } /** @see #impacts_on */ @JsonProperty("impacts_on") public void setImpactsOn(ReferenceList impacts_on) { this.impacts_on = impacts_on; } /** @see #in_collections */ @JsonProperty("in_collections") public ReferenceList getInCollections() { return this.in_collections; } /** @see #in_collections */ @JsonProperty("in_collections") public void setInCollections(ReferenceList in_collections) { this.in_collections = in_collections; } /** @see #created_by */ @JsonProperty("created_by") public String getCreatedBy() { return this.created_by; } /** @see #created_by */ @JsonProperty("created_by") public void setCreatedBy(String created_by) { this.created_by = created_by; } /** @see #created_on */ @JsonProperty("created_on") public Date getCreatedOn() { return this.created_on; } /** @see #created_on */ @JsonProperty("created_on") public void setCreatedOn(Date created_on) { this.created_on = created_on; } /** @see #modified_by */ @JsonProperty("modified_by") public String getModifiedBy() { return this.modified_by; } /** @see #modified_by */ @JsonProperty("modified_by") public void setModifiedBy(String modified_by) { this.modified_by = modified_by; } /** @see #modified_on */ @JsonProperty("modified_on") public Date getModifiedOn() { return this.modified_on; } /** @see #modified_on */ @JsonProperty("modified_on") public void setModifiedOn(Date modified_on) { this.modified_on = modified_on; } public static Boolean canBeCreated() { return false; } public static Boolean includesModificationDetails() { return true; } private static final List<String> NON_RELATIONAL_PROPERTIES = Arrays.asList( "name", "short_description", "long_description", "type", "namespace", "alias_(business_name)", "type_definition", "filter_expression", "join_condition", "imported_from", "native_id", "created_by", "created_on", "modified_by", "modified_on" ); private static final List<String> STRING_PROPERTIES = Arrays.asList( "name", "short_description", "long_description", "type", "namespace", "alias_(business_name)", "type_definition", "filter_expression", "join_condition", "imported_from", "native_id", "created_by", "modified_by" ); private static final List<String> PAGED_RELATIONAL_PROPERTIES = Arrays.asList( "bi_model_or_bi_collection", "labels", "stewards", "assigned_to_terms", "implements_rules", "governed_by_rules", "has_olap_collection", "bi_collection_members", "referenced_by_bi_hierarchies", "bi_hierarchies", "bi_levels", "bi_filters", "references_bi_collections", "referenced_by_bi_collection", "used_by_bi_report_queries", "used_by_bi_cubes", "uses_database_tables_or_views", "read_by_(static)", "written_by_(static)", "read_by_(design)", "written_by_(design)", "read_by_(operational)", "written_by_(operational)", "read_by_(user_defined)", "written_by_(user_defined)", "impacted_by", "impacts_on", "in_collections" ); private static final List<String> ALL_PROPERTIES = Arrays.asList( "name", "short_description", "long_description", "type", "namespace", "bi_model_or_bi_collection", "bi_model", "bi_collection", "labels", "stewards", "assigned_to_terms", "implements_rules", "governed_by_rules", "has_olap_collection", "bi_collection_members", "alias_(business_name)", "type_definition", "filter_expression", "join_condition", "imported_from", "referenced_by_bi_hierarchies", "bi_hierarchies", "bi_levels", "bi_filters", "native_id", "references_bi_collections", "referenced_by_bi_collection", "used_by_bi_report_queries", "used_by_bi_cubes", "uses_database_tables_or_views", "read_by_(static)", "written_by_(static)", "read_by_(design)", "written_by_(design)", "read_by_(operational)", "written_by_(operational)", "read_by_(user_defined)", "written_by_(user_defined)", "impacted_by", "impacts_on", "in_collections", "created_by", "created_on", "modified_by", "modified_on" ); public static List<String> getNonRelationshipProperties() { return NON_RELATIONAL_PROPERTIES; } public static List<String> getStringProperties() { return STRING_PROPERTIES; } public static List<String> getPagedRelationshipProperties() { return PAGED_RELATIONAL_PROPERTIES; } public static List<String> getAllProperties() { return ALL_PROPERTIES; } public static Boolean isBiCollection(Object obj) { return (obj.getClass() == BiCollection.class); } }
aec986ef77d374782c4b73b58414e526989d7cf5
fa90987a261f7a0b17479b7540aa24a237a2210e
/Douzone/SpringPrac(douzone)/day58_SpringMVC2/src/main/java/org/hsk9210/config/WebConfig.java
94c72fc53949bb705354b9838c1f7f08a576b63e
[]
no_license
hsk9210/portfolio
0589fc4155d6bd976fbfd1141f93f5f8a2a0bf8b
1716d628a0c9752331f4d3d31503e2a58a0702fe
refs/heads/master
2022-12-26T06:20:50.095755
2021-07-02T06:40:53
2021-07-02T06:40:53
225,167,214
0
0
null
2022-12-16T00:46:45
2019-12-01T13:36:47
JavaScript
UTF-8
Java
false
false
562
java
package org.hsk9210.config; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; public class WebConfig extends AbstractAnnotationConfigDispatcherServletInitializer{ @Override protected Class<?>[] getRootConfigClasses() { // TODO Auto-generated method stub return null; } @Override protected Class<?>[] getServletConfigClasses() { // TODO Auto-generated method stub return null; } @Override protected String[] getServletMappings() { // TODO Auto-generated method stub return null; } }
0f9281e9deb31e24659c4cabc42e6e7ed1f0f673
ab08af99137a68c6d97f515fdc3338c65f8675c7
/tutorials/interphone/app/src/main/java/com/itaccess/interphone/utils/ThreadUtils.java
9a5eb554bad741f8cd4df3e1d114301ce4431b1f
[]
no_license
xuemingqin/projects
99bbf868f790f3a0a67beaa8eaae980289f836e1
6fccaeb321d28f71a32d485c4cdd4764767667f5
refs/heads/master
2022-02-20T23:37:49.425608
2019-09-03T12:05:41
2019-09-03T12:05:41
198,058,275
0
0
null
2019-08-18T06:28:41
2019-07-21T13:15:43
Java
UTF-8
Java
false
false
687
java
package com.itaccess.interphone.utils; import android.os.Handler; import android.os.Looper; import java.util.concurrent.Executor; import java.util.concurrent.Executors; /** * Created by linxi on 2019/01/17. */ public class ThreadUtils { public static final String TAG = "ThreadUtils"; private static Executor sExecutor = Executors.newSingleThreadExecutor(); private static Handler sHandler = new Handler(Looper.getMainLooper()); public static void runOnUiThread(Runnable runnable) { sHandler.post(runnable); } public static void runOnBackgroundThread(Runnable runnable) { sExecutor.execute(runnable); } }
7789b2a1afd86f08b959291c424129041fe49de2
b76d6e93bbcd2cd4290cbc710f0f5d48a3b7e6c0
/lab02/lab02_part1/src/ro/ase/cts/initial/Helper.java
bf7c76e4162bb526d0efe2de38302cf06ec63cf5
[]
no_license
ccartas/cts-labs
ce8681a890b9218ba8dd21983b845b4b72a213af
369d88fede59b355e5ee376440891d8d1b72f9ca
refs/heads/master
2021-07-23T18:42:23.087632
2020-05-29T06:11:33
2020-05-29T06:11:33
172,536,046
1
2
null
null
null
null
UTF-8
Java
false
false
548
java
package ro.ase.cts.initial; public class Helper { public static double compute(Account a, double r) throws Exception { double i = 0; if(r < 0) { throw new Exception(); } i = a.getTotal() * 12 * r; if(i > 2000) { i += 300; } else { i += 50; } return i; } public static void shift(Account a1, Account a2, double a) throws Exception { if(a < 0 || a > 5000) { throw new Exception(); } if(a1.getTotal() < a) { throw new Exception(); } a1.setTotal(a1.getTotal() - a); a2.setTotal(a2.getTotal() + a); } }
41ef43c26a52669ebac5e7ea795bf9be4645bffb
f100a39c12b80ce2c409bc5851f1476786c420b4
/Series IV/Main.java
4c44df7964df0cc03830b4412014efe255aff063
[]
no_license
pcmushthaq/Playground
cf19b70506ffaeb62d9886ac9a264d67dcef9dfc
0be5758f910f9767ef3e4aeec6996d01e8ee95bf
refs/heads/master
2021-05-26T03:29:50.164631
2020-05-29T05:16:12
2020-05-29T05:16:12
254,033,665
0
0
null
null
null
null
UTF-8
Java
false
false
185
java
#include<stdio.h> int main() { int n,i; scanf("%d",&n); for(i=1;i<=n;i++) { if(i%2!=0) printf("%d ",(i*i)-1); else printf("%d ",(i*i)-2); } }
ba06d9f4822ba9906061efa2c360313710d5717f
2862c41e44dd449376b1528e835c1ac654cd39ac
/Largestof3number.java
654fd34e77e02ccb18d2748461b77919a7845dd5
[]
no_license
patelyash9775/Java-work
68bb2324378842f64e754c0fa4c1ac4d7f85be10
5f78fe23def6be9d9e04aa5fba237ffbe5e6b60d
refs/heads/main
2023-03-04T09:41:30.942750
2021-02-14T12:55:46
2021-02-14T12:55:46
306,823,976
1
0
null
null
null
null
UTF-8
Java
false
false
388
java
import java.util.Scanner; public class Largestof3number { public static void main(String[] args) { Scanner scan=new Scanner(System.in); System.out.println("Enter a three number : "); int a=scan.nextInt(); int b=scan.nextInt(); int c=scan.nextInt(); scan.close(); int l; l=a>b? a>c?a:c : b>c?b:c; System.out.println("Largest number is a "+l); } }
ee88030f6f6227290a682ca0e914f2b345a21ba6
bb126ecafc2fff018030e5b57962b9c097398f3c
/SpringExample-annotations-002/src/com/tutorialspoint/MainApp.java
2400f4908974d96363a421e2b6734f9e94f7f2aa
[ "Apache-2.0" ]
permissive
xiaocao0702/SpringExample
72035bb654d402ad89f20be9c03d299dea2ea5f5
4014bba2793178a16c067e563cc6d1d453a6cf22
refs/heads/master
2021-01-21T10:19:37.332924
2017-02-28T08:32:09
2017-02-28T08:32:09
83,407,514
0
0
null
null
null
null
UTF-8
Java
false
false
2,248
java
package com.tutorialspoint; import org.springframework.context.annotation.AnnotationConfigApplicationContext; /** * Spring 基于 Java 的配置 * * 基于 Java 的配置选项,可以使你在不用配置 XML 的情况下编写大多数的 Spring * @Configuration 和 @Bean 注解: * 带有 @Configuration 的注解类表示这个类可以使用 Spring IoC 容器作为 bean 定义的来源。 * @Bean 注解告诉 Spring,一个带有 @Bean 的注解方法将返回一个对象,该对象应该被注册为在 Spring 应用程序上下文中的 bean。 * * 带有 @Bean 注解的方法名称作为 bean 的 ID,它创建并返回实际的 bean。你的配置类可以声明多个 @Bean。 * 一旦定义了配置类,你就可以使用 AnnotationConfigApplicationContext 来加载并把他们提供给 Spring 容器 * * @Import 注解: * @import 注解允许从另一个配置类中加载 @Bean 定义。 * 你可以在另一个 Bean 声明中导入上述 Bean 声明 * @Import(ConfigA.class) * 不需要同时引入两个class * * 生命周期回调 * @Bean 注解支持指定任意的初始化和销毁的回调方法,就像在 bean 元素中 Spring 的 XML 的初始化方法和销毁方法的属性 * @Bean(initMethod = "init", destroyMethod = "cleanup" ) * * 指定 Bean 的范围: * 默认范围是单实例,但是你可以重写带有 @Scope 注解的该方法 * @Bean * @Scope("prototype") * public Foo foo() { * return new Foo(); * } * * @author caopl * */ public class MainApp { public static void main(String[] args) { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfig.class); // 加载各种配置类 // context.register(AppConfig.class, OtherConfig.class); // context.register(AdditionalConfig.class); // context.refresh(); // MyService myService = context.getBean(MyService.class); // myService.doStuff(); HelloWorld obj = (HelloWorld) context.getBean(HelloWorld.class); obj.setMessage("hello shanghai!"); obj.getMessage(); // AnnotationConfigApplicationContext context2 = new AnnotationConfigApplicationContext(AppConfig.class); Foo foo = context.getBean(Foo.class); foo.print(); } }
ca588f665564748f7f9a6cea9de031c7b622768a
83a6e83e109aa857de0f020fa3bc616b5e755e3c
/Currencyconverter/app/src/test/java/com/harold/currencyconverter/ExampleUnitTest.java
d90614208f4bcb61ebc1ae6403a10b0a4c23d25a
[]
no_license
ysha18/android
07ffb3539948d81173dde8d1079c2df15da51b02
50c1b22c4dc60b109e382b1b24bd568cb807d496
refs/heads/master
2020-05-31T21:45:44.320644
2019-11-18T05:22:47
2019-11-18T05:22:47
190,505,493
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.harold.currencyconverter; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
a81ca645f443cfbfeefcfb1ebec147bf0eb96c05
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/15/15_8375a9cafaced30d7bd2e38eed77b06eb0dc020c/JpaDropDao/15_8375a9cafaced30d7bd2e38eed77b06eb0dc020c_JpaDropDao_t.java
b14c0b2a4872b641cd34fe54f56446e53cded4a4
[]
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,521
java
/** * This program 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/agpl.html> * * Copyright (C) Ushahidi Inc. All Rights Reserved. */ package com.ushahidi.swiftriver.core.api.dao.impl; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import javax.persistence.TypedQuery; import javax.sql.DataSource; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BatchPreparedStatementSetter; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.stereotype.Repository; import com.ushahidi.swiftriver.core.api.dao.DropDao; import com.ushahidi.swiftriver.core.api.dao.IdentityDao; import com.ushahidi.swiftriver.core.api.dao.LinkDao; import com.ushahidi.swiftriver.core.api.dao.MediaDao; import com.ushahidi.swiftriver.core.api.dao.PlaceDao; import com.ushahidi.swiftriver.core.api.dao.SequenceDao; import com.ushahidi.swiftriver.core.api.dao.TagDao; import com.ushahidi.swiftriver.core.model.BucketDrop; import com.ushahidi.swiftriver.core.model.Drop; import com.ushahidi.swiftriver.core.model.Sequence; import com.ushahidi.swiftriver.core.util.MD5Util; @Repository public class JpaDropDao extends AbstractJpaDao<Drop> implements DropDao { final Logger logger = LoggerFactory.getLogger(JpaDropDao.class); @Autowired private SequenceDao sequenceDao; @Autowired private IdentityDao identityDao; @Autowired private TagDao tagDao; @Autowired private LinkDao linkDao; @Autowired private PlaceDao placeDao; @Autowired private MediaDao mediaDao; private NamedParameterJdbcTemplate namedJdbcTemplate; private JdbcTemplate jdbcTemplate; @Autowired public void setDataSource(DataSource dataSource) { this.namedJdbcTemplate = new NamedParameterJdbcTemplate(dataSource); this.jdbcTemplate = new JdbcTemplate(dataSource); } /* * (non-Javadoc) * * @see * com.ushahidi.swiftriver.core.api.dao.DropDao#createDrops(java.util.List) */ public List<Drop> createDrops(List<Drop> drops) { // Get a lock on droplets Sequence seq = sequenceDao.findById("droplets"); // Get identity IDs populated identityDao.getIdentities(drops); // newDropIndex maps a drop hash to an list index in the drops list. Map<String, List<Integer>> newDropIndex = getNewDropIndex(drops); // Insert new drops if (newDropIndex.size() > 0) { // Find drops that already exist updateNewDropIndex(newDropIndex, drops); // Insert new drops into the db batchInsert(newDropIndex, drops, seq); } // Add drops to their respective rivers insertRiverDrops(drops); // Add drops to their respective buckets insertBucketDrops(drops); // TODO Mark as read // Populate metadata tagDao.getTags(drops); linkDao.getLinks(drops); placeDao.getPlaces(drops); mediaDao.getMedia(drops); return drops; } /** * Generates a mapping of drop hashes to list index for the given drops. * Also populates a drop hash into the given list of drops. * * @param drops * @return */ private Map<String, List<Integer>> getNewDropIndex(List<Drop> drops) { Map<String, List<Integer>> newDropIndex = new HashMap<String, List<Integer>>(); // Generate hashes for each new drops i.e. those without an id int i = 0; for (Drop drop : drops) { if (drop.getId() > 0) continue; String hash = MD5Util.md5Hex(drop.getIdentity().getOriginId() + drop.getChannel() + drop.getOriginalId()); drop.setHash(hash); // Keep a record of where this hash is in the drop list List<Integer> indexes; if (newDropIndex.containsKey(hash)) { indexes = newDropIndex.get(hash); } else { indexes = new ArrayList<Integer>(); newDropIndex.put(hash, indexes); } indexes.add(i++); } return newDropIndex; } /** * For the given list of new drops, find those that the hash already exist * and update the drop entry with the existing id and remove the hash from * the new drop index. * * @param newDropIndex * @param drops */ private void updateNewDropIndex(Map<String, List<Integer>> newDropIndex, List<Drop> drops) { // First find and update existing drops with their ids. String sql = "SELECT id, droplet_hash FROM droplets WHERE droplet_hash IN (:hashes)"; MapSqlParameterSource params = new MapSqlParameterSource(); params.addValue("hashes", newDropIndex.keySet()); List<Map<String, Object>> results = this.namedJdbcTemplate .queryForList(sql, params); // Update id for the drops that were found for (Map<String, Object> result : results) { String hash = (String) result.get("droplet_hash"); Long id = ((Number) result.get("id")).longValue(); List<Integer> indexes = newDropIndex.get(hash); for (Integer index : indexes) { drops.get(index).setId(id); } // Hash is not for a new drop so remove it newDropIndex.remove(hash); } } /** * Insert new drops in a single batch statement * * @param newDropIndex * @param drops */ private void batchInsert(final Map<String, List<Integer>> newDropIndex, final List<Drop> drops, Sequence seq) { final List<String> hashes = new ArrayList<String>(); hashes.addAll(newDropIndex.keySet()); final long startKey = sequenceDao.getIds(seq, hashes.size()); String sql = "INSERT INTO droplets (id, channel, droplet_hash, " + "droplet_orig_id, droplet_title, " + "droplet_content, droplet_date_pub, droplet_date_add, " + "identity_id) VALUES (?,?,?,?,?,?,?,?,?)"; jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { public void setValues(PreparedStatement ps, int i) throws SQLException { String hash = hashes.get(i); // Update drops with the newly generated id for (int index : newDropIndex.get(hash)) { drops.get(index).setId(startKey + i); } Drop drop = drops.get(newDropIndex.get(hash).get(0)); ps.setLong(1, drop.getId()); ps.setString(2, drop.getChannel()); ps.setString(3, drop.getHash()); ps.setString(4, drop.getOriginalId()); ps.setString(5, drop.getTitle()); ps.setString(6, drop.getContent()); ps.setTimestamp(7, new java.sql.Timestamp(drop .getDatePublished().getTime())); ps.setTimestamp(8, new java.sql.Timestamp((new Date()).getTime())); ps.setLong(9, drop.getIdentity().getId()); } public int getBatchSize() { return hashes.size(); } }); } /** * Populate the rivers_droplets table * * @param drops */ private void insertRiverDrops(final List<Drop> drops) { // Get a lock on rivers_droplets Sequence seq = sequenceDao.findById("rivers_droplets"); // Mapping of drop id to list index position final Map<Long, Integer> dropIndex = new HashMap<Long, Integer>(); // List of rivers in a drop Map<Long, Set<Long>> dropRiversMap = new HashMap<Long, Set<Long>>(); int i = 0; for (Drop drop : drops) { if (drop.getRiverIds() == null) continue; Set<Long> rivers = new HashSet<Long>(); rivers.addAll(drop.getRiverIds()); dropRiversMap.put(drop.getId(), rivers); dropIndex.put(drop.getId(), i++); } // No rivers found, exit if (dropIndex.size() == 0) return; // Find already existing rivers_droplets String sql = "SELECT droplet_id, river_id FROM rivers_droplets WHERE droplet_id in (:ids)"; MapSqlParameterSource params = new MapSqlParameterSource(); params.addValue("ids", dropIndex.keySet()); List<Map<String, Object>> results = this.namedJdbcTemplate .queryForList(sql, params); // Remove already existing rivers_droplets from our Set for (Map<String, Object> result : results) { long dropletId = ((Number) result.get("droplet_id")) .longValue(); long riverId = ((Number) result.get("river_id")).longValue(); Set<Long> riverSet = dropRiversMap.get(dropletId); if (riverSet != null) { riverSet.remove(riverId); } } // Insert the remaining items in the set into the db sql = "INSERT INTO rivers_droplets (id, droplet_id, river_id, droplet_date_pub, channel) VALUES (?,?,?,?,?)"; final List<long[]> dropRiverList = new ArrayList<long[]>(); for (Long dropletId : dropRiversMap.keySet()) { for (Long riverId : dropRiversMap.get(dropletId)) { long[] riverDrop = { dropletId, riverId }; dropRiverList.add(riverDrop); } } if (dropRiverList.size() == 0) return; // Insert the remaining items in the set into the db sql = "INSERT INTO `rivers_droplets` (`id`, `droplet_id`, `river_id`, `droplet_date_pub`, `channel`) VALUES (?,?,?,?,?)"; final long startKey = sequenceDao.getIds(seq, dropRiverList.size()); // A map to hold the new max_drop_id and drop_count per river final Map<Long, long[]> riverDropsMap = new HashMap<Long, long[]>(); jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { public void setValues(PreparedStatement ps, int i) throws SQLException { long[] riverDrop = dropRiverList.get(i); long id = startKey + i; Drop drop = drops.get(dropIndex.get(riverDrop[0])); ps.setLong(1, id); ps.setLong(2, riverDrop[0]); ps.setLong(3, riverDrop[1]); ps.setTimestamp(4, new java.sql.Timestamp(drop .getDatePublished().getTime())); ps.setString(5, drop.getChannel()); // Get updated max_drop_id and drop_count for the rivers table long[] update = riverDropsMap.get(riverDrop[1]); if (update == null) { long[] u = { id, 1 }; riverDropsMap.put(riverDrop[1], u); } else { update[0] = Math.max(update[0], id); update[1] = update[1] + 1; } } public int getBatchSize() { return dropRiverList.size(); } }); // Update river max_drop_id and drop_count sql = "UPDATE rivers SET max_drop_id = ?, drop_count = drop_count + ? WHERE id = ?"; final List<Entry<Long, long[]>> riverUpdate = new ArrayList<Entry<Long, long[]>>(); riverUpdate.addAll(riverDropsMap.entrySet()); this.jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { public void setValues(PreparedStatement ps, int i) throws SQLException { Entry<Long, long[]> entry = riverUpdate.get(i); ps.setLong(1, entry.getValue()[0]); ps.setLong(2, entry.getValue()[1]); ps.setLong(3, entry.getKey()); } public int getBatchSize() { return riverUpdate.size(); } } ); } /** * Populates the buckets_droplets table * * @param drops */ private void insertBucketDrops(final List<Drop> drops) { // Stores the drop id against the destination bucket ids Map<Long, Set<Long>> dropBucketsMap = new HashMap<Long, Set<Long>>(); // Stores the drop id against its index in the drops list final Map<Long, Integer> dropsIndex = new HashMap<Long, Integer>(); int i = 0; for (Drop drop: drops) { if (drop.getBucketIds() == null) continue; Set<Long> bucketSet = new HashSet<Long>(); bucketSet.addAll(drop.getBucketIds()); dropBucketsMap.put(drop.getId(), bucketSet); dropsIndex.put(drop.getId(), i); i++; } if (dropsIndex.isEmpty()) return; // Exclude existing drops String existsSQL = "SELECT `bucket_id`, `droplet_id` " + "FROM `buckets_droplets` WHERE `droplet_id` IN (:ids)"; MapSqlParameterSource params = new MapSqlParameterSource(); params.addValue("ids", dropsIndex.keySet()); for (Map<String, Object> row: namedJdbcTemplate.queryForList(existsSQL, params)) { Long dropId = ((Number) row.get("droplet_id")).longValue(); Long bucketId = ((Number) row.get("bucket_id")).longValue(); if (dropBucketsMap.containsKey(dropId)) { Set<Long> bucketIdSet = dropBucketsMap.get(dropId); bucketIdSet.remove(bucketId); } } // Stores each bucket id // List of arrays comprised of the drop id and bucket id final List<Long[]> bucketDropList = new ArrayList<Long[]>(); for (Map.Entry<Long, Set<Long>> entry: dropBucketsMap.entrySet()) { for (Long bucketId: entry.getValue()) { Long[] bucketDrop = {bucketId, entry.getKey()}; bucketDropList.add(bucketDrop); } } if (bucketDropList.isEmpty()) return; // Store for the no. of drops inserted for each bucket final Map<Long, Integer> bucketDropCount = new HashMap<Long, Integer>(); // Query for populating TABLE buckets_droplets String insertSQL = "INSERT INTO `buckets_droplets` (`bucket_id`, `droplet_id`, `droplet_date_added`) " + "VALUES (?, ?, ?)"; jdbcTemplate.batchUpdate(insertSQL, new BatchPreparedStatementSetter() { public void setValues(PreparedStatement statement, int index) throws SQLException { Long[] bucketDrop = bucketDropList.get(index); Long bucketId = bucketDrop[0]; Drop drop = drops.get(dropsIndex.get(bucketDrop[1])); statement.setLong(1, bucketId); statement.setLong(2, bucketDrop[1]); statement.setTimestamp(3, new java.sql.Timestamp(drop.getDateAdded().getTime())); Integer count = bucketDropCount.get(bucketId); count = (count == null) ? 0 : count + 1; bucketDropCount.put(bucketId, count); } @Override public int getBatchSize() { return bucketDropList.size(); } }); // Update the drop count for the populated buckets List<String> tempTableQuery = new ArrayList<String>(); for (Map.Entry<Long, Integer> entry: bucketDropCount.entrySet()) { String sql = String.format("SELECT %d AS `id`, %d AS `drop_count`", entry.getKey(), entry.getValue()); tempTableQuery.add(sql); } String joinQuery = StringUtils.join(tempTableQuery, " UNION ALL "); String updateSQL = "UPDATE `buckets` JOIN(" + joinQuery + ") AS t " + "USING (`id`) " + "SET `buckets`.`drop_count` = `buckets`.`drop_count` + `t`.`drop_count` "; this.jdbcTemplate.update(updateSQL); } /* * (non-Javadoc) * @see com.ushahidi.swiftriver.core.api.dao.DropDao#findAll(java.util.List) */ public List<Drop> findAll(List<Long> dropIds) { // JPQL query string String qlString = "FROM Drop WHERE id IN :dropIds"; TypedQuery<Drop> query = em.createQuery(qlString, Drop.class); query.setParameter("dropIds", dropIds); List<Drop> drops = query.getResultList(); // Store the ID of each drop against its index in the drops list Map<Long, Integer> dropsIndex = new HashMap<Long, Integer>(); int i = 0; for (Drop drop: drops) { dropsIndex.put(drop.getId(), i); i++; } // Fetch the bucket drops String qlBucketDrops = "FROM BucketDrop b WHERE b.drop.id IN :dropIds AND b.bucket.published = 1"; TypedQuery<BucketDrop> bucketDropQuery = em.createQuery(qlBucketDrops, BucketDrop.class); bucketDropQuery.setParameter("dropIds", dropIds); for (BucketDrop bucketDrop: bucketDropQuery.getResultList()) { int dropIndex = dropsIndex.get(bucketDrop.getDrop().getId()); Drop drop = drops.get(dropIndex); if (drop.getBucketDrops() == null) { drop.setBucketDrops(new ArrayList<BucketDrop>()); } drop.getBucketDrops().add(bucketDrop); } // Get the list of buckets return drops; } }
a0cb8a6b3e6e44a11f8277925eda972ae1102fc3
af1a7b59bb58797a92455d458c494c931e025eec
/src/main/java/ru/shitlin/springboot/service/AppConfig.java
115c0aa4a98a8f6e69a18a08b48df6494e95231d
[]
no_license
IvanShitlin/SpringCRUD
08bcaea87288d0c6912c81a37325919ae2e26937
3e6abc42de4325445aa8fae1a957dfba3b892785
refs/heads/master
2020-03-28T17:44:25.042795
2018-09-14T17:30:55
2018-09-14T17:30:55
148,817,840
0
0
null
null
null
null
UTF-8
Java
false
false
300
java
package ru.shitlin.springboot.service; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class AppConfig { @Bean(initMethod = "init") public TestInit testCreate() { return new TestInit(); } }
2cce084cd3d28e94da8c0e09517e872b3d9a346a
ecc6e72d909d9e59ee667620ba1a2a59072470f8
/backend/src/main/java/com/mapin/tropical/controllers/exceptions/FieldMessage.java
94ec144486c5910a865b83c2231bb71d17c76302
[]
no_license
nabucodonosor-java/Mapin-Tropical
601bf8ff717b3857539951c48707897958e06034
b84ca44bfb2c3e9783437618db5f9445ad54a175
refs/heads/main
2023-06-19T12:10:13.031088
2021-07-13T13:32:42
2021-07-13T13:32:42
381,497,050
0
0
null
null
null
null
UTF-8
Java
false
false
647
java
package com.mapin.tropical.controllers.exceptions; import java.io.Serializable; public class FieldMessage implements Serializable { private static final long serialVersionUID = 1L; private String fieldName; private String message; public FieldMessage() { } public FieldMessage(String fieldName, String message) { this.fieldName = fieldName; this.message = message; } public String getFieldName() { return fieldName; } public void setFieldName(String fieldName) { this.fieldName = fieldName; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
8dbfa61c5247fa60e30057172c6cf68613d283dd
16119ac8f8e6dd644446b2e1a526cb5b54711c65
/cms-web/src/test/java/com/xzjie/gypt/system/ResourceServiceTest.java
a24bb88c1b0e9066d865399024d6cf36503235e4
[]
no_license
fenglove/cms
74ee332b8f077f916a04ca0ddb54a6504409fa5a
09cab9521da9a325000079793fe22d28e9911870
refs/heads/master
2021-01-23T12:20:56.350671
2016-11-21T09:37:47
2016-11-21T09:37:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,210
java
/** * radp-cms * @Title: ResourceServiceTest.java * @Package com.xzjie.gypt.system * @Description: TODO(添加描述) * @Copyright: Copyright (c) 2016 * @Company: * @author 作者 E-mail: [email protected] * @date 2016年7月2日 */ package com.xzjie.gypt.system; import java.util.List; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import com.alibaba.fastjson.JSON; import com.xzjie.gypt.BaseTest; import com.xzjie.gypt.system.model.Resource; import com.xzjie.gypt.system.service.ResourceService; /** * @className ResourceServiceTest.java * @description TODO(添加描述) * @author xzjie * @create 2016年7月2日 下午12:25:27 * @version V0.0.1 */ public class ResourceServiceTest extends BaseTest{ @Autowired private ResourceService resourceService; @Test public void getResourceTree(){ List<Resource> list= resourceService.getResourceTree(0L); logger.info("==> resource tree:"+JSON.toJSONString(list)); } @Test public void getResourceUser(){ List<Resource> list= resourceService.getResourceUser(1L); logger.info("==> resource user:"+JSON.toJSONString(list)); } }
94892009a7dba0ce3f78ff417a7bdc5dddd19c98
e69ffb8dc3d51e8e3a3f1f55514d9565049fc737
/xmu/src/main/java/demo/bean/Shopcar.java
58394aa482f090a7eb9c10511a9ab09b7e0c9db8
[]
no_license
Keepkeep/SpringHibernate
d33221063d52f5e3ecf5ede36380dcbf99d82faf
0b087a7e9e896d7c14100938c2dd32ad1dc984b6
refs/heads/master
2021-07-23T01:02:17.463917
2017-11-02T02:00:19
2017-11-02T02:00:19
103,408,553
2
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,720
java
package demo.bean; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name="myshopcar") public class Shopcar { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Integer scarId; private Integer proId; //ÉÌÆ·id private Integer scount; @ManyToOne @JoinColumn(name="proId",updatable=false,insertable=false) private Product productbean; private Integer userId; @ManyToOne @JoinColumn(name="userId",insertable=false,updatable=false) private Users usersbean; public Integer getScarId() { return scarId; } public void setScarId(Integer scarId) { this.scarId = scarId; } public Integer getProId() { return proId; } public void setProId(Integer proId) { this.proId = proId; } public Product getProductbean() { return productbean; } public void setProductbean(Product productbean) { this.productbean = productbean; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public Users getUsersbean() { return usersbean; } public void setUsersbean(Users usersbean) { this.usersbean = usersbean; } public Integer getScount() { return scount; } public void setScount(Integer scount) { this.scount = scount; } @Override public String toString() { return "shopcar [scarId=" + scarId + ", proId=" + proId + ", userId=" + userId + "]"; } }
63b4fec9562d0459f57ee96fed0c0add4eee2c04
a2ec9344d328e8eb334dfd3b9a0745beb352dcfe
/src/main/java/demo/example/blogspring1/BlogSpring1Application.java
b80fb175a31a551cd0f7b50f6dab3ddb5616a64a
[]
no_license
MiMiAung/spring-blog-1
287233d3e4776dd728bf3e2263b0df73eb401195
ecb53f7c4d05e76dbc3ca670d2b5867c03134a41
refs/heads/master
2022-07-06T04:57:44.299748
2019-08-08T05:12:32
2019-08-08T05:12:32
198,483,402
0
0
null
2022-06-30T20:19:03
2019-07-23T18:03:06
JavaScript
UTF-8
Java
false
false
1,914
java
package demo.example.blogspring1; import demo.example.blogspring1.model.Author; import demo.example.blogspring1.model.Gender; import demo.example.blogspring1.model.Post; import demo.example.blogspring1.repository.AuthorRepository; import demo.example.blogspring1.repository.PostRepository; import org.ocpsoft.prettytime.PrettyTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Profile; import java.time.LocalDate; @SpringBootApplication public class BlogSpring1Application { private static Logger logger= LoggerFactory.getLogger(BlogSpring1Application.class); public static void main(String[] args) { SpringApplication.run(BlogSpring1Application.class, args); System.out.println("Welcome Gitts"); } @Bean public PrettyTime prettyTime(){ return new PrettyTime(); } @Bean @Profile("dev") public CommandLineRunner runner(AuthorRepository authorRepository, PostRepository postRepository) { return args -> { Author author1 = new Author("Thaw Thaw", LocalDate.of(2000, 3, 24), "Horror", Gender.MALE); Post p1 = new Post("afeaf", "deirjufew", LocalDate.now()); Post p2 = new Post("afeaf", "deirjufew", LocalDate.now()); Post p3 = new Post("afeaf", "deirjufew", LocalDate.now()); p1.setAuthor(author1); p2.setAuthor(author1); p3.setAuthor(author1); authorRepository.save(author1); postRepository.save(p1); postRepository.save(p2); postRepository.save(p3); logger.info("successfully create."); }; } }
7bf8aed84d9ccae55075ad83b7bc7a4612b4bd8b
390f748e7837db36ecf18d1fd8ec83cf1fca94fc
/src/main/java/com/sda/patientportal/controller/MessageController.java
97a7aaeaf861c09712f44ef6add294e6915cca6f
[]
no_license
ciprian-murarasu/PatientPortal
227e9d2654d1faa2262d34a5b5c82f7381846d92
280958b3297effb765d6cb151efc26a139051df5
refs/heads/master
2020-06-07T20:22:14.061894
2019-06-21T23:57:10
2019-06-21T23:57:10
193,087,111
0
0
null
null
null
null
UTF-8
Java
false
false
1,306
java
package com.sda.patientportal.controller; import com.sda.patientportal.model.Doctor; import com.sda.patientportal.model.Message; import com.sda.patientportal.model.Patient; import com.sda.patientportal.service.MessageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; import java.util.List; @RestController @RequestMapping(value = "/messages") public class MessageController { private MessageService messageService; @Autowired public MessageController(MessageService messageService) { this.messageService = messageService; } @PostMapping public Message create(@RequestBody Message message) { message.setId(null); return messageService.create(message); } @PutMapping(value = "/{id}") public Message update(@PathVariable Long id, @RequestBody Message message) { if (messageService.get(id) == null) { throw new RuntimeException("Message with id " + id + " doesn't exist"); } else if (!id.equals(message.getId())) { throw new RuntimeException("Ids from endpoint and request body do not match"); } else return messageService.update(message); } }
53376e438c2eaac42516d1e6d72e65791b30adcf
91b3e11ed08015d2cc508e4b4e6febb494861380
/s8/projet/bdovore2011/l3/BDovore/src/db/update/UpdateDoneException.java
b2508166768d6bcd93f40364d009f5a54a486218
[]
no_license
mbarberot/mandj
cc7230e7375c635a30952e94d7286bdfb247765a
6437f645e221c0c3e472ead8c351d3787a09999c
refs/heads/master
2016-09-06T16:18:35.602387
2015-04-01T15:32:22
2015-04-01T15:32:22
32,623,048
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package db.update; /** * "Exception" levée pour signaler la fin d'une mise à jour * Une MAJ est faite de la façon suivante : * - Ajouter des données par batch de X entrée * - Lorsque l'on arrive au bout (recu 0 entrées), une exception est levée * * @author Thorisoka */ public class UpdateDoneException extends Exception { public UpdateDoneException() { super(); } }
[ "[email protected]@bfb192df-59d5-e310-3f69-618d71160846" ]
[email protected]@bfb192df-59d5-e310-3f69-618d71160846
83c9d83dbadf0fe04ae1408a0a8c1e3d90926863
00f628929558d32c1fae385c374eab9a679d91a2
/tools/src/org/cougaar/test/sequencer/regression/RegressionSequencerPlugin.java
312d70155ef0478ac27360b348c80bdc9fcb2108
[]
no_license
codeaudit/cougaar-adaptive
ac93373a2c188aa1da945359d5b1c42d96e8860c
a9ba389f49aa89163ae5bf2f3e9d6c28e726fa63
refs/heads/master
2021-01-11T21:20:25.426617
2012-06-29T19:20:25
2012-06-29T19:20:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,330
java
/* ============================================================================= * * COPYRIGHT 2007 BBN Technologies Corp. * 10 Moulton St * Cambridge MA 02138 * (617) 873-8000 * * This program is the subject of intellectual property rights * licensed from BBN Technologies * * This legend must continue to appear in the source code * despite modifications or enhancements by any party. * * * ============================================================================= * * Created : Sep 13, 2007 * Workfile: RegressionSequencerPlugin.java * $Revision: 1.1 $ * $Date: 2008-02-26 18:23:40 $ * $Author: jzinky $ * * ============================================================================= */ package org.cougaar.test.sequencer.regression; import java.util.Collections; import java.util.Set; import org.cougaar.test.sequencer.Report; import org.cougaar.test.sequencer.ReportBase; public class RegressionSequencerPlugin extends AbstractRegressionSequencerPlugin<Report> { @Override protected Set<Report> makeNodeTimoutFailureReport(RegressionStep step, String reason) { Report report = new ReportBase(agentId.getAddress(), false, reason); return Collections.singleton(report); } }
0bf7ffacc70e92159a7adf106d04ed881b3e2577
68a68a37a51b81b4281c265d04e8bc9223d63fbc
/src/testClasses/Test6.java
ca3e499533e6abc1c45defe9977162c8d1e1cb2f
[]
no_license
okamayuresh/testngRepo
dbbebb5fd3f2231bf32838e64892c2a051447517
f788d3fefabbd03e09491333b4c199520a49e975
refs/heads/master
2021-01-09T06:32:52.572610
2017-02-05T16:44:05
2017-02-05T16:44:05
81,005,952
0
0
null
null
null
null
UTF-8
Java
false
false
276
java
package testClasses; import org.openqa.selenium.WebDriver; import org.testng.annotations.Test; import root.LocalDriverManager; public class Test6 { private static WebDriver driver = null; @Test public void f() { driver = LocalDriverManager.getWebDriver(); } }
0c35aae543a16fab518fd629096f8e6b1532adb5
63990ae44ac4932f17801d051b2e6cec4abb8ad8
/bus-image/src/main/java/org/aoju/bus/image/metric/internal/xdsi/ValueListType.java
5269d9468adb38b0ffea0bdf7ee3351f1011f605
[ "MIT" ]
permissive
xeon-ye/bus
2cca99406a540cf23153afee8c924433170b8ba5
6e927146074fe2d23f9c9f23433faad5f9e40347
refs/heads/master
2023-03-16T17:47:35.172996
2021-02-22T10:31:48
2021-02-22T10:31:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,778
java
/********************************************************************************* * * * The MIT License (MIT) * * * * Copyright (c) 2015-2021 aoju.org and other contributors. * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"), to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in * * all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * * THE SOFTWARE. * * * ********************************************************************************/ package org.aoju.bus.image.metric.internal.xdsi; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import java.util.ArrayList; import java.util.List; /** * @author Kimi Liu * @version 6.2.0 * @since JDK 1.8+ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ValueListType", propOrder = {"value"}) public class ValueListType { @XmlElement(name = "Value") protected List<String> value; public List<String> getValue() { if (this.value == null) { this.value = new ArrayList(); } return this.value; } }
8fa4d4d6545b3449ca1467d5a24c47b0355d09ed
fe9d395063da6ce21bb3b989c59118244e698634
/src/main/java/com/gl365/payment/enums/mq/SystemType.java
42ffbc80dfd3a8b2e7209e58a05434bf41814b13
[]
no_license
pengjianbo3478/payment
51f2e3b94fcf8c9943471c43686421ccf5b760bd
75b75fc7197610eb871cc30e063a29ec33ea1bf3
refs/heads/master
2020-03-07T20:41:00.939441
2018-04-02T04:50:03
2018-04-02T04:50:03
127,703,842
0
0
null
null
null
null
UTF-8
Java
false
false
632
java
package com.gl365.payment.enums.mq; /** * MQ 系统级类别 * @author duanxz *2017年5月13日 */ public enum SystemType { PAYMENT_SETTLE("payment_settle", "payment to settle"), PAYMENT_MERCHANT("payment_merchant", "payment to merchant"), PAYMENT_APP("payment_app", "payment to app"), PAYMENT_JPUSH("payment_app", "payment to jpush"); private final String code; private final String desc; private SystemType(String key, String value) { this.code = key; this.desc = value; } public String getCode() { return code; } public String getDesc() { return desc; } }
[ "DEKK@DESKTOP-D6KV7VG" ]
DEKK@DESKTOP-D6KV7VG
aca279217a00877f18d97f12da172e43e6359a7f
59c4077b97d90098eb0d19948982276ac8f87658
/day10/常用类2/src/cn/imcore/prac/Test.java
34753d2974ec56ff41122a0976a087392ecc4270
[]
no_license
sonyi/java
4b267e9cb554bb51f3770149f070ec812388cb8b
fbe2c2f7ae36bbbb4333bd567fb063daf507c8fc
refs/heads/master
2021-01-01T16:30:36.907998
2014-05-25T15:13:11
2014-05-25T15:13:11
19,110,091
2
0
null
null
null
null
GB18030
Java
false
false
666
java
package cn.imcore.prac; public class Test { public static void main(String[] args) { String s = "1,2;3,4,5;6,7,8"; String[] rows = s.split(";"); double[][] d = new double[rows.length][]; //打印每行内容 for(int m=0; m<rows.length; m++) { // System.out.println("====打印每行内容====" + m); // System.out.println("rows["+m+"]=" + rows[m]); //拆分列 String[] cols = rows[m].split(","); d[m] = new double[cols.length]; for(int n=0; n<cols.length; n++) { d[m][n] = Double.parseDouble(cols[n]); System.out.print(d[m][n] + " "); } // System.out.println("\n====进入下一行===="); System.out.println(); } } }
[ "wxy15105957760" ]
wxy15105957760
90dabc9691e0aab0443a1a2be9f81340c4785a2b
2290a1ce005a0b81f2f634cc39db1647f84d7b14
/test2/src/main/java/testClasses/ClassWithOneClassDependency.java
6a68e0b2523b2e197f6c8ca32eae6d9a59dce247
[]
no_license
sharkovadarya/java2017fall
8c0cad67e53f6bd68a041ae3eab16e5badbc6f2c
9d3871d8acfa00cd810d6bfc484d585235eb2c4a
refs/heads/master
2021-01-23T10:28:46.119553
2017-12-26T10:29:05
2017-12-26T10:29:05
102,614,720
0
0
null
2017-12-26T10:29:06
2017-09-06T13:52:56
Java
UTF-8
Java
false
false
246
java
package testClasses; public class ClassWithOneClassDependency { public final ClassWithoutDependencies dependency; public ClassWithOneClassDependency(ClassWithoutDependencies dependency) { this.dependency = dependency; } }
770c9f06a7718f4670d39c7f1ba59ec18ba88b33
93bd420afe014aaedd60cf4db6a8ff408e8cbe14
/Navigation/app/src/main/java/com/example/woga1/navigation/Search/MartFragment.java
94643c5837fcbb0fa8bad3931ae1eef280bc3cc2
[]
no_license
woga1999/SWContest
ca9d9d015886a53707d211aec782733adfd6e829
fba29c0e1cfea89e7ee7e3f655ac6776da7ca621
refs/heads/master
2021-01-01T19:37:03.052353
2017-12-31T18:20:41
2017-12-31T18:20:41
98,626,849
4
0
null
null
null
null
UTF-8
Java
false
false
3,275
java
package com.example.woga1.navigation.Search; import android.app.ListFragment; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v4.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import com.example.woga1.navigation.SaveData.ListViewAdapter; import com.example.woga1.navigation.SaveData.ListViewItem; import com.example.woga1.navigation.R; public class MartFragment extends ListFragment { View view; ListViewAdapter martAdapter ; public MartFragment() {} @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if(savedInstanceState == null) { view = inflater.inflate(R.layout.fragment_mart, container, false); } // Adapter 생성 및 Adapter 지정. martAdapter = new ListViewAdapter() ; setListAdapter(martAdapter) ; // 첫 번째 아이템 추가. martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "GS25 세종대광개토관점", "90m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "세븐일레븐 세종대기숙사점", "126m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "GS25 세종대율곡관점", "157m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "GS25 세종대우정당점", "220m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "GS25 군자원룸점", "246m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "GS25 광진군자로점", "337m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "팝스토어", "550m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "CU 세종대후문점", "706m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "세븐일레븐 세종대역점", "837m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "세븐일레븐 군자파라곤점", "950m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "세븐일레븐 광진군자원룸점", "962m") ; martAdapter.addItem(ContextCompat.getDrawable(getActivity(), R.drawable.martpoi), "GS25 화양중앙점", "1012m") ; return super.onCreateView(inflater, container, savedInstanceState); } //리스트뷰 클릭 이벤트 처리 @Override public void onListItemClick (ListView l, View v, int position, long id) { // get TextView's Text. ListViewItem item = (ListViewItem) l.getItemAtPosition(position) ; String titleStr = item.getTitle() ; String descStr = item.getDesc() ; Drawable iconDrawable = item.getIcon() ; // TODO : use item data. } //외부에서 아이템 추가를 위한 함수 public void addItem(Drawable icon, String title, String desc) { martAdapter.addItem(icon, title, desc) ; } }
8c15fef67f921b2cd1ae3cd154ef81ab13451823
4a373daec89df5175cac06b3f04edcb204faa9a8
/mclibrary/src/main/java/com/wsg/mclibrary/common/binder/IBinderInterface.java
88e4126b83f2c145ee8d35c5e60b970eb162677e
[]
no_license
WuSG2016/McLibrary
c5df6f618165f6f9dc78322bcd79cce7054520d7
dfd2964ffda4c5550d8291cf97accb2d850d4dc3
refs/heads/master
2020-05-22T23:18:08.212048
2019-09-29T08:55:45
2019-09-29T08:55:45
186,556,315
6
0
null
null
null
null
UTF-8
Java
false
false
289
java
package com.wsg.mclibrary.common.binder; import android.os.IBinder; /** 用于查询Binder的接口 * @author WuSG */ public interface IBinderInterface { /** * 返回IBinder * * @param binderCode 标识 * @return */ IBinder onBinder(int binderCode); }
31201a463ca2e6a31e624f9248b26aed6d6971f7
1583a7a692a6b1ba0c070f07aa7ea0c74e769203
/app/src/main/java/com/example/hp/logistics/AsyncTasks/AsyncResponse.java
58cc305df24f664e5de87428460be24189d89e27
[]
no_license
avnitalati/Login-Signup
8d11afa40d827dd67739a66a32ed8a2e67ddbd8d
67430f533bc1b9a0cac04700690bde08601565d9
refs/heads/master
2021-01-22T03:40:50.663256
2017-02-27T07:00:32
2017-02-27T07:00:32
81,451,794
0
0
null
null
null
null
UTF-8
Java
false
false
244
java
package com.example.hp.logistics.AsyncTasks; import org.json.JSONArray; /** * Created by Dell on 11-01-2017. */ public interface AsyncResponse { void onSuccess(String message, JSONArray jsonData); void onFailure(String message); }
d1d7303667099ba7adf60f68d6ba2b5341be063e
4552e65aa7a7cff9157a9e14b72a55959896c8c8
/src/algoritmos/estructuras/lista/ListaEMain.java
9c8e8f90db4aab8016eaf73eccdd68db7b439d1a
[]
no_license
gutee/prog2ayed
504c03d345eda8d870311cd8f0408b73f3b72387
264b3ed5f0bf5c736ced43a61735f97e9881d80d
refs/heads/master
2016-09-06T16:00:46.009613
2014-08-22T14:32:03
2014-08-22T14:32:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
632
java
package algoritmos.estructuras.lista; /** * Created by IntelliJ IDEA. * User: Martin * Date: 10/04/12 * Time: 12:36 * To change this template use File | Settings | File Templates. */ public class ListaEMain { public static void main(String[] args) { ListaE lista = new ListaE(); lista.insertarA("primero"); lista.insertarD("segundo"); lista.insertarA("medio"); lista.irPrimero(); System.out.println(lista.getActual()); lista.siguiente(); System.out.println(lista.getActual()); lista.irUltimo(); System.out.println(lista.getActual()); } }
4cd74bbe226db5e9dee12a40f396dc0b1e5a0656
8e3808e0570cce407027e4bb05a77ecf0c1d05e6
/cj.ultimate/src/cj/ultimate/net/sf/cglib/core/CollectionUtils.java
3421eb755c199901d79b7ffc432584b212f57547
[]
no_license
carocean/cj.studio.ecm
22bdfa9dc339f76ffc635dcd8d8d7fb49017f0c3
b1e4594b51e738cf70ed2e91195b76e070ddc719
refs/heads/master
2021-07-06T12:03:48.715469
2020-07-26T05:57:18
2020-07-26T05:57:18
151,696,042
5
1
null
null
null
null
UTF-8
Java
false
false
2,520
java
/* * Copyright 2003,2004 The Apache Software Foundation * * 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 cj.ultimate.net.sf.cglib.core; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; /** * @author Chris Nokleberg * @version $Id: CollectionUtils.java,v 1.7 2004/06/24 21:15:21 herbyderby Exp $ */ public class CollectionUtils { private CollectionUtils() { } public static Map bucket(Collection c, Transformer t) { Map buckets = new HashMap(); for (Iterator it = c.iterator(); it.hasNext();) { Object value = (Object)it.next(); Object key = t.transform(value); List bucket = (List)buckets.get(key); if (bucket == null) { buckets.put(key, bucket = new LinkedList()); } bucket.add(value); } return buckets; } public static void reverse(Map source, Map target) { for (Iterator it = source.keySet().iterator(); it.hasNext();) { Object key = it.next(); target.put(source.get(key), key); } } public static Collection filter(Collection c, Predicate p) { Iterator it = c.iterator(); while (it.hasNext()) { if (!p.evaluate(it.next())) { it.remove(); } } return c; } public static List transform(Collection c, Transformer t) { List result = new ArrayList(c.size()); for (Iterator it = c.iterator(); it.hasNext();) { result.add(t.transform(it.next())); } return result; } public static Map getIndexMap(List list) { Map indexes = new HashMap(); int index = 0; for (Iterator it = list.iterator(); it.hasNext();) { indexes.put(it.next(), new Integer(index++)); } return indexes; } }
c510c73dfc308036dfd7fd42003e977f60022a11
8c1150a6d77ccc5e4d0e1cdc1234ff019f424d3f
/src/main/java/com/example/stat/controller/PersonController.java
fcd66c67ae72a6dfba72494c5fa53948a4589535
[]
no_license
gaosaisai/stat
7329348cb214b8c2800d736365d5340435ed627c
58e1b56cf991930ddb0840d153a32db5723fd2c3
refs/heads/main
2023-07-05T19:31:13.488409
2021-08-22T14:13:57
2021-08-22T14:13:57
397,512,518
0
0
null
null
null
null
UTF-8
Java
false
false
1,548
java
package com.example.stat.controller; import com.example.stat.service.PersonService; import com.example.stat.vo.DataVO; import com.example.stat.vo.PieVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; @Controller public class PersonController { @Autowired private PersonService personService; @RequestMapping("/list") @ResponseBody public DataVO list( Integer page, Integer limit, Integer min_year, Integer max_year, Integer min_travelkm, Integer max_travelkm, Integer min_traveltime, Integer max_traveltime ){ return personService.findData( page, limit, min_year, max_year, min_travelkm, max_travelkm, min_traveltime, max_traveltime ); } @GetMapping("/{url}") public String redirect(@PathVariable("url") String url){ return url; } @RequestMapping("/pieVO") @ResponseBody public PieVO list( Integer min_year,Integer max_year ){ return personService.getPieVO(min_year,max_year); } }
d6724e6a9faaa027863844326f96e61a639ba1bc
6cfe0a67687d2cd344343a9b5fb29d4d7de5030a
/src/com/tlahuicode/stockManager/product/ProductEvent.java
f17e6ae6d327534999411eabe170e59514ae45e1
[]
no_license
R2D23/Stock-Manager
ce24c10a83c0f58c96547afa56d5204815f6cd2e
2715228795ec00e6aae290e7096957c7f6685262
refs/heads/master
2020-03-26T15:14:23.238105
2018-08-27T02:43:52
2018-08-27T03:00:34
145,030,314
0
0
null
2018-08-27T01:01:14
2018-08-16T19:25:03
Java
UTF-8
Java
false
false
812
java
package com.tlahuicode.stockManager.product; import com.tlahuicode.stockManager.Product; /** * * @author LuisArturo */ public class ProductEvent { public static final int ADDED_PRODUCT = 0; public static final int UPDATED_NAME = 1; public static final int UPDATED_TAGS = 2; public static final int UPDATED_BARCODE = 3; public static final int UPDATED_PRICE = 4; public static final int UPDATED_ALL = 5; public static final int UPDATED_ALL_PRODUCTS = 6; public static final int DELETED = 9; private Product reference; private int event; public ProductEvent(Product ref, int e){ reference = ref; event = e; } public Product getReference() { return reference; } public int getEvent() { return event; } }
0513f2122a433a99ce8c3b12760981dfea12fa32
dfd7e70936b123ee98e8a2d34ef41e4260ec3ade
/analysis/reverse-engineering/decompile-fitts-with-gradle-20191031-2200/src/main/java/com/google/android/gms/internal/firebase_remote_config/zzge.java
93ddcc77dce4af5cbb1804ee1969a64a43f6d15f
[ "Apache-2.0" ]
permissive
skkuse-adv/2019Fall_team2
2d4f75bc793368faac4ca8a2916b081ad49b7283
3ea84c6be39855f54634a7f9b1093e80893886eb
refs/heads/master
2020-08-07T03:41:11.447376
2019-12-21T04:06:34
2019-12-21T04:06:34
213,271,174
5
5
Apache-2.0
2019-12-12T09:15:32
2019-10-07T01:18:59
Java
UTF-8
Java
false
false
1,280
java
package com.google.android.gms.internal.firebase_remote_config; final class zzge extends zzgh { private final int zzoz; private final int zzpa; zzge(byte[] bArr, int i, int i2) { super(bArr); zzfx.zzb(i, i + i2, bArr.length); this.zzoz = i; this.zzpa = i2; } public final byte zzv(int i) { int size = size(); if (((size - (i + 1)) | i) >= 0) { return this.zzpc[this.zzoz + i]; } if (i < 0) { StringBuilder sb = new StringBuilder(22); sb.append("Index < 0: "); sb.append(i); throw new ArrayIndexOutOfBoundsException(sb.toString()); } StringBuilder sb2 = new StringBuilder(40); sb2.append("Index > length: "); sb2.append(i); sb2.append(", "); sb2.append(size); throw new ArrayIndexOutOfBoundsException(sb2.toString()); } /* access modifiers changed from: 0000 */ public final byte zzw(int i) { return this.zzpc[this.zzoz + i]; } public final int size() { return this.zzpa; } /* access modifiers changed from: protected */ public final int zzey() { return this.zzoz; } }
f69207650af6789a9e787b30821fddccb22ddd6f
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.socialplatform-base/sources/com/squareup/okhttp/HttpUrl.java
d2691efb936d3e9644d04409730c730486a1387d
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
52,450
java
package com.squareup.okhttp; import X.AnonymousClass006; import com.adobe.xmp.impl.Base64; import com.oculus.localmedia.LocalMediaManager; import java.net.IDN; import java.net.InetAddress; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Set; import okio.Buffer; public final class HttpUrl { public static final String FORM_ENCODE_SET = " \"':;<=>@[]^`{}|/\\?#&!$(),~"; public static final String FRAGMENT_ENCODE_SET = ""; public static final String FRAGMENT_ENCODE_SET_URI = " \"#<>\\^`{|}"; public static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; public static final String PASSWORD_ENCODE_SET = " \"':;<=>@[]^`{}|/\\?#"; public static final String PATH_SEGMENT_ENCODE_SET = " \"<>^`{}|/\\?#"; public static final String PATH_SEGMENT_ENCODE_SET_URI = "[]"; public static final String QUERY_COMPONENT_ENCODE_SET = " \"'<>#&="; public static final String QUERY_COMPONENT_ENCODE_SET_URI = "\\^`{|}"; public static final String QUERY_ENCODE_SET = " \"'<>#"; public static final String USERNAME_ENCODE_SET = " \"':;<=>@[]^`{}|/\\?#"; public final String fragment; public final String host; public final String password; public final List<String> pathSegments; public final int port; public final List<String> queryNamesAndValues; public final String scheme; public final String url; public final String username; public static final class Builder { public String encodedFragment; public String encodedPassword = ""; public final List<String> encodedPathSegments; public List<String> encodedQueryNamesAndValues; public String encodedUsername = ""; public String host; public int port = -1; public String scheme; public enum ParseResult { SUCCESS, MISSING_SCHEME, UNSUPPORTED_SCHEME, INVALID_PORT, INVALID_HOST } public static String canonicalizeHost(String str, int i, int i2) { String percentDecode = HttpUrl.percentDecode(str, i, i2, false); if (!percentDecode.startsWith("[") || !percentDecode.endsWith("]")) { return domainToAscii(percentDecode); } InetAddress decodeIpv6 = decodeIpv6(percentDecode, 1, percentDecode.length() - 1); if (decodeIpv6 == null) { return null; } byte[] address = decodeIpv6.getAddress(); if (address.length == 16) { return inet6AddressToAscii(address); } throw new AssertionError(); } public static boolean containsInvalidHostnameAsciiCodes(String str) { for (int i = 0; i < str.length(); i++) { char charAt = str.charAt(i); if (charAt <= 31 || charAt >= 127 || " #%/:?@[\\]".indexOf(charAt) != -1) { return true; } } return false; } /* JADX WARNING: Code restructure failed: missing block: B:22:0x0035, code lost: if ((r4 - r8) == 0) goto L_0x0027; */ /* Code decompiled incorrectly, please refer to instructions dump. */ public static boolean decodeIpv4Suffix(java.lang.String r7, int r8, int r9, byte[] r10, int r11) { /* r5 = r11 L_0x0001: r6 = 0 if (r8 >= r9) goto L_0x003f int r0 = r10.length if (r5 == r0) goto L_0x0027 if (r5 == r11) goto L_0x0013 char r1 = r7.charAt(r8) r0 = 46 if (r1 != r0) goto L_0x0027 int r8 = r8 + 1 L_0x0013: r4 = r8 r2 = 0 L_0x0015: if (r4 >= r9) goto L_0x0033 char r3 = r7.charAt(r4) r1 = 48 if (r3 < r1) goto L_0x0033 r0 = 57 if (r3 > r0) goto L_0x0033 if (r2 != 0) goto L_0x0028 if (r8 == r4) goto L_0x0028 L_0x0027: return r6 L_0x0028: int r2 = r2 * 10 int r2 = r2 + r3 int r2 = r2 - r1 r0 = 255(0xff, float:3.57E-43) if (r2 > r0) goto L_0x0027 int r4 = r4 + 1 goto L_0x0015 L_0x0033: int r0 = r4 - r8 if (r0 == 0) goto L_0x0027 int r1 = r5 + 1 byte r0 = (byte) r2 r10[r5] = r0 r5 = r1 r8 = r4 goto L_0x0001 L_0x003f: int r0 = r11 + 4 if (r5 != r0) goto L_0x0027 r0 = 1 return r0 */ throw new UnsupportedOperationException("Method not decompiled: com.squareup.okhttp.HttpUrl.Builder.decodeIpv4Suffix(java.lang.String, int, int, byte[], int):boolean"); } public static String domainToAscii(String str) { try { String lowerCase = IDN.toASCII(str).toLowerCase(Locale.US); if (lowerCase.isEmpty() || containsInvalidHostnameAsciiCodes(lowerCase)) { return null; } return lowerCase; } catch (IllegalArgumentException unused) { return null; } } public static String inet6AddressToAscii(byte[] bArr) { int length; int i = 0; int i2 = 0; int i3 = -1; int i4 = 0; while (true) { length = bArr.length; if (i2 >= length) { break; } int i5 = i2; while (i5 < 16 && bArr[i5] == 0 && bArr[i5 + 1] == 0) { i5 += 2; } int i6 = i5 - i2; if (i6 > i4) { i3 = i2; i4 = i6; } i2 = i5 + 2; } Buffer buffer = new Buffer(); while (i < length) { if (i == i3) { buffer.writeByte(58); i += i4; if (i == 16) { buffer.writeByte(58); } } else { if (i > 0) { buffer.writeByte(58); } buffer.writeHexadecimalUnsignedLong((long) (((bArr[i] & Base64.INVALID) << 8) | (bArr[i + 1] & Base64.INVALID))); i += 2; } } return buffer.readUtf8(); } public static int parsePort(String str, int i, int i2) { try { int parseInt = Integer.parseInt(HttpUrl.canonicalize(str, i, i2, "", false, false, true)); if (parseInt <= 0 || parseInt > 65535) { return -1; } return parseInt; } catch (NumberFormatException unused) { } } /* JADX ERROR: JadxOverflowException in pass: RegionMakerVisitor jadx.core.utils.exceptions.JadxOverflowException: Regions count limit reached at jadx.core.utils.ErrorsCounter.addError(ErrorsCounter.java:57) at jadx.core.utils.ErrorsCounter.error(ErrorsCounter.java:31) at jadx.core.dex.attributes.nodes.NotificationAttrNode.addError(NotificationAttrNode.java:15) */ /* JADX WARNING: Removed duplicated region for block: B:17:0x003e A[SYNTHETIC] */ /* JADX WARNING: Removed duplicated region for block: B:9:0x0021 */ private void resolvePath(java.lang.String r10, int r11, int r12) { /* r9 = this; r6 = r11 if (r11 == r12) goto L_0x003e r4 = r10 char r1 = r10.charAt(r11) r0 = 47 java.lang.String r2 = "" r8 = 1 r3 = r9 if (r1 == r0) goto L_0x0033 r0 = 92 if (r1 == r0) goto L_0x0033 java.util.List<java.lang.String> r1 = r9.encodedPathSegments int r0 = r1.size() int r0 = r0 - r8 r1.set(r0, r2) L_0x001e: r5 = r6 if (r6 >= r12) goto L_0x003e java.lang.String r0 = "/\\" int r6 = com.squareup.okhttp.HttpUrl.delimiterOffset(r10, r6, r12, r0) r7 = 0 if (r6 >= r12) goto L_0x002b r7 = 1 L_0x002b: r3.push(r4, r5, r6, r7, r8) if (r7 == 0) goto L_0x001e L_0x0030: int r6 = r6 + 1 goto L_0x001e L_0x0033: java.util.List<java.lang.String> r0 = r9.encodedPathSegments r0.clear() java.util.List<java.lang.String> r0 = r9.encodedPathSegments r0.add(r2) goto L_0x0030 L_0x003e: return */ throw new UnsupportedOperationException("Method not decompiled: com.squareup.okhttp.HttpUrl.Builder.resolvePath(java.lang.String, int, int):void"); } public static int slashCount(String str, int i, int i2) { int i3 = 0; while (i < i2) { char charAt = str.charAt(i); if (charAt != '\\' && charAt != '/') { break; } i3++; i++; } return i3; } public Builder addEncodedPathSegment(String str) { if (str != null) { push(str, 0, str.length(), false, true); return this; } throw new IllegalArgumentException("encodedPathSegment == null"); } public Builder addPathSegment(String str) { if (str != null) { push(str, 0, str.length(), false, false); return this; } throw new IllegalArgumentException("pathSegment == null"); } public Builder setEncodedPathSegment(int i, String str) { if (str != null) { String canonicalize = HttpUrl.canonicalize(str, 0, str.length(), " \"<>^`{}|/\\?#", true, false, true); this.encodedPathSegments.set(i, canonicalize); if (!isDot(canonicalize) && !isDotDot(canonicalize)) { return this; } throw new IllegalArgumentException(AnonymousClass006.A07("unexpected path segment: ", str)); } throw new IllegalArgumentException("encodedPathSegment == null"); } public Builder setPathSegment(int i, String str) { if (str != null) { String canonicalize = HttpUrl.canonicalize(str, 0, str.length(), " \"<>^`{}|/\\?#", false, false, true); if (isDot(canonicalize) || isDotDot(canonicalize)) { throw new IllegalArgumentException(AnonymousClass006.A07("unexpected path segment: ", str)); } this.encodedPathSegments.set(i, canonicalize); return this; } throw new IllegalArgumentException("pathSegment == null"); } /* JADX WARNING: Code restructure failed: missing block: B:32:0x0072, code lost: if (r3 == 16) goto L_0x0082; */ /* JADX WARNING: Code restructure failed: missing block: B:33:0x0074, code lost: if (r2 == -1) goto L_0x008d; */ /* JADX WARNING: Code restructure failed: missing block: B:34:0x0076, code lost: r1 = r3 - r2; java.lang.System.arraycopy(r5, r2, r5, 16 - r1, r1); java.util.Arrays.fill(r5, r2, (16 - r3) + r2, (byte) 0); */ /* JADX WARNING: Code restructure failed: missing block: B:37:0x0086, code lost: return java.net.InetAddress.getByAddress(r5); */ /* JADX WARNING: Code restructure failed: missing block: B:40:0x008c, code lost: throw new java.lang.AssertionError(); */ /* Code decompiled incorrectly, please refer to instructions dump. */ public static java.net.InetAddress decodeIpv6(java.lang.String r11, int r12, int r13) { /* // Method dump skipped, instructions count: 142 */ throw new UnsupportedOperationException("Method not decompiled: com.squareup.okhttp.HttpUrl.Builder.decodeIpv6(java.lang.String, int, int):java.net.InetAddress"); } private boolean isDot(String str) { if (str.equals(".") || str.equalsIgnoreCase("%2e")) { return true; } return false; } private boolean isDotDot(String str) { if (str.equals(LocalMediaManager.PARENT_FOLDER_NAME) || str.equalsIgnoreCase("%2e.") || str.equalsIgnoreCase(".%2e") || str.equalsIgnoreCase("%2e%2e")) { return true; } return false; } private void pop() { List<String> list = this.encodedPathSegments; if (!list.remove(list.size() - 1).isEmpty() || this.encodedPathSegments.isEmpty()) { this.encodedPathSegments.add(""); return; } List<String> list2 = this.encodedPathSegments; list2.set(list2.size() - 1, ""); } public static int portColonOffset(String str, int i, int i2) { while (i < i2) { char charAt = str.charAt(i); if (charAt == ':') { return i; } if (charAt == '[') { do { i++; if (i >= i2) { break; } } while (str.charAt(i) != ']'); } i++; } return i2; } private void push(String str, int i, int i2, boolean z, boolean z2) { String canonicalize = HttpUrl.canonicalize(str, i, i2, " \"<>^`{}|/\\?#", z2, false, true); if (isDot(canonicalize)) { return; } if (isDotDot(canonicalize)) { pop(); return; } List<String> list = this.encodedPathSegments; if (list.get(list.size() - 1).isEmpty()) { List<String> list2 = this.encodedPathSegments; list2.set(list2.size() - 1, canonicalize); } else { this.encodedPathSegments.add(canonicalize); } if (z) { this.encodedPathSegments.add(""); } } private void removeAllCanonicalQueryParameters(String str) { int size = this.encodedQueryNamesAndValues.size(); while (true) { size -= 2; if (size < 0) { return; } if (str.equals(this.encodedQueryNamesAndValues.get(size))) { this.encodedQueryNamesAndValues.remove(size + 1); this.encodedQueryNamesAndValues.remove(size); if (this.encodedQueryNamesAndValues.isEmpty()) { this.encodedQueryNamesAndValues = null; return; } } } } public static int schemeDelimiterOffset(String str, int i, int i2) { char charAt; if (i2 - i >= 2 && (((charAt = str.charAt(i)) >= 'a' && charAt <= 'z') || (charAt >= 'A' && charAt <= 'Z'))) { while (true) { i++; if (i >= i2) { break; } char charAt2 = str.charAt(i); if ((charAt2 < 'a' || charAt2 > 'z') && ((charAt2 < 'A' || charAt2 > 'Z') && !((charAt2 >= '0' && charAt2 <= '9') || charAt2 == '+' || charAt2 == '-' || charAt2 == '.'))) { if (charAt2 == ':') { return i; } } } } return -1; } private int skipLeadingAsciiWhitespace(String str, int i, int i2) { while (i < i2) { char charAt = str.charAt(i); if (charAt != '\t' && charAt != '\n' && charAt != '\f' && charAt != '\r' && charAt != ' ') { return i; } i++; } return i2; } private int skipTrailingAsciiWhitespace(String str, int i, int i2) { while (true) { i2--; if (i2 < i) { return i; } char charAt = str.charAt(i2); if (charAt != '\t' && charAt != '\n' && charAt != '\f' && charAt != '\r' && charAt != ' ') { return i2 + 1; } } } public Builder addEncodedQueryParameter(String str, String str2) { String str3; if (str != null) { List list = this.encodedQueryNamesAndValues; if (list == null) { list = new ArrayList(); this.encodedQueryNamesAndValues = list; } list.add(HttpUrl.canonicalize(str, " \"'<>#&=", true, true, true)); List<String> list2 = this.encodedQueryNamesAndValues; if (str2 != null) { str3 = HttpUrl.canonicalize(str2, " \"'<>#&=", true, true, true); } else { str3 = null; } list2.add(str3); return this; } throw new IllegalArgumentException("encodedName == null"); } public Builder addQueryParameter(String str, String str2) { String str3; if (str != null) { List list = this.encodedQueryNamesAndValues; if (list == null) { list = new ArrayList(); this.encodedQueryNamesAndValues = list; } list.add(HttpUrl.canonicalize(str, " \"'<>#&=", false, true, true)); List<String> list2 = this.encodedQueryNamesAndValues; if (str2 != null) { str3 = HttpUrl.canonicalize(str2, " \"'<>#&=", false, true, true); } else { str3 = null; } list2.add(str3); return this; } throw new IllegalArgumentException("name == null"); } public HttpUrl build() { if (this.scheme == null) { throw new IllegalStateException("scheme == null"); } else if (this.host != null) { return new HttpUrl(this); } else { throw new IllegalStateException("host == null"); } } public int effectivePort() { int i = this.port; if (i == -1) { return HttpUrl.defaultPort(this.scheme); } return i; } public Builder encodedFragment(String str) { String str2; if (str != null) { str2 = HttpUrl.canonicalize(str, "", true, false, false); } else { str2 = null; } this.encodedFragment = str2; return this; } public Builder encodedPassword(String str) { if (str != null) { this.encodedPassword = HttpUrl.canonicalize(str, " \"':;<=>@[]^`{}|/\\?#", true, false, true); return this; } throw new IllegalArgumentException("encodedPassword == null"); } public Builder encodedPath(String str) { if (str == null) { throw new IllegalArgumentException("encodedPath == null"); } else if (str.startsWith("/")) { resolvePath(str, 0, str.length()); return this; } else { throw new IllegalArgumentException(AnonymousClass006.A07("unexpected encodedPath: ", str)); } } public Builder encodedQuery(String str) { List<String> list; if (str != null) { list = HttpUrl.queryStringToNamesAndValues(HttpUrl.canonicalize(str, " \"'<>#", true, true, true)); } else { list = null; } this.encodedQueryNamesAndValues = list; return this; } public Builder encodedUsername(String str) { if (str != null) { this.encodedUsername = HttpUrl.canonicalize(str, " \"':;<=>@[]^`{}|/\\?#", true, false, true); return this; } throw new IllegalArgumentException("encodedUsername == null"); } public Builder fragment(String str) { String str2; if (str != null) { str2 = HttpUrl.canonicalize(str, "", false, false, false); } else { str2 = null; } this.encodedFragment = str2; return this; } public Builder host(String str) { if (str != null) { String canonicalizeHost = canonicalizeHost(str, 0, str.length()); if (canonicalizeHost != null) { this.host = canonicalizeHost; return this; } throw new IllegalArgumentException(AnonymousClass006.A07("unexpected host: ", str)); } throw new IllegalArgumentException("host == null"); } public ParseResult parse(HttpUrl httpUrl, String str) { int delimiterOffset; char charAt; int length = str.length(); int skipLeadingAsciiWhitespace = skipLeadingAsciiWhitespace(str, 0, length); int skipTrailingAsciiWhitespace = skipTrailingAsciiWhitespace(str, skipLeadingAsciiWhitespace, length); if (schemeDelimiterOffset(str, skipLeadingAsciiWhitespace, skipTrailingAsciiWhitespace) != -1) { if (str.regionMatches(true, skipLeadingAsciiWhitespace, "https:", 0, 6)) { this.scheme = "https"; skipLeadingAsciiWhitespace += 6; } else if (!str.regionMatches(true, skipLeadingAsciiWhitespace, "http:", 0, 5)) { return ParseResult.UNSUPPORTED_SCHEME; } else { this.scheme = "http"; skipLeadingAsciiWhitespace += 5; } } else if (httpUrl == null) { return ParseResult.MISSING_SCHEME; } else { this.scheme = httpUrl.scheme; } int slashCount = slashCount(str, skipLeadingAsciiWhitespace, skipTrailingAsciiWhitespace); if (slashCount >= 2 || httpUrl == null || !httpUrl.scheme.equals(this.scheme)) { int i = skipLeadingAsciiWhitespace + slashCount; boolean z = false; boolean z2 = false; while (true) { delimiterOffset = HttpUrl.delimiterOffset(str, i, skipTrailingAsciiWhitespace, "@/\\?#"); if (delimiterOffset == skipTrailingAsciiWhitespace || (charAt = str.charAt(delimiterOffset)) == 65535 || charAt == '#' || charAt == '/' || charAt == '\\' || charAt == '?') { int portColonOffset = portColonOffset(str, i, delimiterOffset); int i2 = portColonOffset + 1; this.host = canonicalizeHost(str, i, portColonOffset); } else if (charAt == '@') { if (!z) { int delimiterOffset2 = HttpUrl.delimiterOffset(str, i, delimiterOffset, ":"); String canonicalize = HttpUrl.canonicalize(str, i, delimiterOffset2, " \"':;<=>@[]^`{}|/\\?#", true, false, true); if (z2) { canonicalize = AnonymousClass006.A09(this.encodedUsername, "%40", canonicalize); } this.encodedUsername = canonicalize; if (delimiterOffset2 != delimiterOffset) { this.encodedPassword = HttpUrl.canonicalize(str, delimiterOffset2 + 1, delimiterOffset, " \"':;<=>@[]^`{}|/\\?#", true, false, true); z = true; } z2 = true; } else { this.encodedPassword = AnonymousClass006.A09(this.encodedPassword, "%40", HttpUrl.canonicalize(str, i, delimiterOffset, " \"':;<=>@[]^`{}|/\\?#", true, false, true)); } i = delimiterOffset + 1; } } int portColonOffset2 = portColonOffset(str, i, delimiterOffset); int i22 = portColonOffset2 + 1; this.host = canonicalizeHost(str, i, portColonOffset2); if (i22 < delimiterOffset) { int parsePort = parsePort(str, i22, delimiterOffset); this.port = parsePort; if (parsePort == -1) { return ParseResult.INVALID_PORT; } } else { this.port = HttpUrl.defaultPort(this.scheme); } if (this.host == null) { return ParseResult.INVALID_HOST; } skipLeadingAsciiWhitespace = delimiterOffset; } else { this.encodedUsername = httpUrl.encodedUsername(); this.encodedPassword = httpUrl.encodedPassword(); this.host = httpUrl.host; this.port = httpUrl.port; this.encodedPathSegments.clear(); this.encodedPathSegments.addAll(httpUrl.encodedPathSegments()); if (skipLeadingAsciiWhitespace == skipTrailingAsciiWhitespace || str.charAt(skipLeadingAsciiWhitespace) == '#') { encodedQuery(httpUrl.encodedQuery()); } } int delimiterOffset3 = HttpUrl.delimiterOffset(str, skipLeadingAsciiWhitespace, skipTrailingAsciiWhitespace, "?#"); resolvePath(str, skipLeadingAsciiWhitespace, delimiterOffset3); if (delimiterOffset3 < skipTrailingAsciiWhitespace && str.charAt(delimiterOffset3) == '?') { delimiterOffset3 = HttpUrl.delimiterOffset(str, delimiterOffset3, skipTrailingAsciiWhitespace, "#"); this.encodedQueryNamesAndValues = HttpUrl.queryStringToNamesAndValues(HttpUrl.canonicalize(str, delimiterOffset3 + 1, delimiterOffset3, " \"'<>#", true, true, true)); } if (delimiterOffset3 < skipTrailingAsciiWhitespace && str.charAt(delimiterOffset3) == '#') { this.encodedFragment = HttpUrl.canonicalize(str, 1 + delimiterOffset3, skipTrailingAsciiWhitespace, "", true, false, false); } return ParseResult.SUCCESS; } public Builder password(String str) { if (str != null) { this.encodedPassword = HttpUrl.canonicalize(str, " \"':;<=>@[]^`{}|/\\?#", false, false, true); return this; } throw new IllegalArgumentException("password == null"); } public Builder port(int i) { if (i <= 0 || i > 65535) { throw new IllegalArgumentException(AnonymousClass006.A03("unexpected port: ", i)); } this.port = i; return this; } public Builder query(String str) { List<String> list; if (str != null) { list = HttpUrl.queryStringToNamesAndValues(HttpUrl.canonicalize(str, " \"'<>#", false, true, true)); } else { list = null; } this.encodedQueryNamesAndValues = list; return this; } public Builder reencodeForUri() { int size = this.encodedPathSegments.size(); for (int i = 0; i < size; i++) { this.encodedPathSegments.set(i, HttpUrl.canonicalize(this.encodedPathSegments.get(i), "[]", true, false, true)); } List<String> list = this.encodedQueryNamesAndValues; if (list != null) { int size2 = list.size(); for (int i2 = 0; i2 < size2; i2++) { String str = this.encodedQueryNamesAndValues.get(i2); if (str != null) { this.encodedQueryNamesAndValues.set(i2, HttpUrl.canonicalize(str, "\\^`{|}", true, true, true)); } } } String str2 = this.encodedFragment; if (str2 != null) { this.encodedFragment = HttpUrl.canonicalize(str2, " \"#<>\\^`{|}", true, false, false); } return this; } public Builder removeAllEncodedQueryParameters(String str) { if (str != null) { if (this.encodedQueryNamesAndValues != null) { removeAllCanonicalQueryParameters(HttpUrl.canonicalize(str, " \"'<>#&=", true, true, true)); } return this; } throw new IllegalArgumentException("encodedName == null"); } public Builder removeAllQueryParameters(String str) { if (str != null) { if (this.encodedQueryNamesAndValues != null) { removeAllCanonicalQueryParameters(HttpUrl.canonicalize(str, " \"'<>#&=", false, true, true)); } return this; } throw new IllegalArgumentException("name == null"); } public Builder removePathSegment(int i) { this.encodedPathSegments.remove(i); if (this.encodedPathSegments.isEmpty()) { this.encodedPathSegments.add(""); } return this; } public Builder scheme(String str) { if (str != null) { String str2 = "http"; if (!str.equalsIgnoreCase(str2)) { str2 = "https"; if (!str.equalsIgnoreCase(str2)) { throw new IllegalArgumentException(AnonymousClass006.A07("unexpected scheme: ", str)); } } this.scheme = str2; return this; } throw new IllegalArgumentException("scheme == null"); } public String toString() { StringBuilder sb = new StringBuilder(); String str = this.scheme; sb.append(str); sb.append("://"); String str2 = this.encodedUsername; if (!str2.isEmpty() || !this.encodedPassword.isEmpty()) { sb.append(str2); String str3 = this.encodedPassword; if (!str3.isEmpty()) { sb.append(':'); sb.append(str3); } sb.append('@'); } String str4 = this.host; if (str4.indexOf(58) != -1) { sb.append('['); sb.append(str4); sb.append(']'); } else { sb.append(str4); } int effectivePort = effectivePort(); if (effectivePort != HttpUrl.defaultPort(str)) { sb.append(':'); sb.append(effectivePort); } HttpUrl.pathSegmentsToString(sb, this.encodedPathSegments); List<String> list = this.encodedQueryNamesAndValues; if (list != null) { sb.append('?'); HttpUrl.namesAndValuesToQueryString(sb, list); } String str5 = this.encodedFragment; if (str5 != null) { sb.append('#'); sb.append(str5); } return sb.toString(); } public Builder username(String str) { if (str != null) { this.encodedUsername = HttpUrl.canonicalize(str, " \"':;<=>@[]^`{}|/\\?#", false, false, true); return this; } throw new IllegalArgumentException("username == null"); } public Builder() { ArrayList arrayList = new ArrayList(); this.encodedPathSegments = arrayList; arrayList.add(""); } public Builder setEncodedQueryParameter(String str, String str2) { removeAllEncodedQueryParameters(str); addEncodedQueryParameter(str, str2); return this; } public Builder setQueryParameter(String str, String str2) { removeAllQueryParameters(str); addQueryParameter(str, str2); return this; } } public static int decodeHexDigit(char c) { if (c >= '0' && c <= '9') { return c - '0'; } char c2 = 'a'; if (c < 'a' || c > 'f') { c2 = 'A'; if (c < 'A' || c > 'F') { return -1; } } return (c - c2) + 10; } /* renamed from: com.squareup.okhttp.HttpUrl$1 reason: invalid class name */ public static /* synthetic */ class AnonymousClass1 { public static final /* synthetic */ int[] $SwitchMap$com$squareup$okhttp$HttpUrl$Builder$ParseResult; /* JADX WARNING: Can't wrap try/catch for region: R(12:0|1|2|3|4|5|6|7|8|9|10|12) */ /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Missing exception handler attribute for start block: B:3:0x0012 */ /* JADX WARNING: Missing exception handler attribute for start block: B:5:0x001b */ /* JADX WARNING: Missing exception handler attribute for start block: B:7:0x0024 */ /* JADX WARNING: Missing exception handler attribute for start block: B:9:0x002d */ static { /* com.squareup.okhttp.HttpUrl$Builder$ParseResult[] r0 = com.squareup.okhttp.HttpUrl.Builder.ParseResult.values() int r0 = r0.length int[] r2 = new int[r0] com.squareup.okhttp.HttpUrl.AnonymousClass1.$SwitchMap$com$squareup$okhttp$HttpUrl$Builder$ParseResult = r2 com.squareup.okhttp.HttpUrl$Builder$ParseResult r0 = com.squareup.okhttp.HttpUrl.Builder.ParseResult.SUCCESS // Catch:{ NoSuchFieldError -> 0x0012 } int r1 = r0.ordinal() // Catch:{ NoSuchFieldError -> 0x0012 } r0 = 1 r2[r1] = r0 // Catch:{ NoSuchFieldError -> 0x0012 } L_0x0012: com.squareup.okhttp.HttpUrl$Builder$ParseResult r0 = com.squareup.okhttp.HttpUrl.Builder.ParseResult.INVALID_HOST // Catch:{ NoSuchFieldError -> 0x001b } int r1 = r0.ordinal() // Catch:{ NoSuchFieldError -> 0x001b } r0 = 2 r2[r1] = r0 // Catch:{ NoSuchFieldError -> 0x001b } L_0x001b: com.squareup.okhttp.HttpUrl$Builder$ParseResult r0 = com.squareup.okhttp.HttpUrl.Builder.ParseResult.UNSUPPORTED_SCHEME // Catch:{ NoSuchFieldError -> 0x0024 } int r1 = r0.ordinal() // Catch:{ NoSuchFieldError -> 0x0024 } r0 = 3 r2[r1] = r0 // Catch:{ NoSuchFieldError -> 0x0024 } L_0x0024: com.squareup.okhttp.HttpUrl$Builder$ParseResult r0 = com.squareup.okhttp.HttpUrl.Builder.ParseResult.MISSING_SCHEME // Catch:{ NoSuchFieldError -> 0x002d } int r1 = r0.ordinal() // Catch:{ NoSuchFieldError -> 0x002d } r0 = 4 r2[r1] = r0 // Catch:{ NoSuchFieldError -> 0x002d } L_0x002d: com.squareup.okhttp.HttpUrl$Builder$ParseResult r0 = com.squareup.okhttp.HttpUrl.Builder.ParseResult.INVALID_PORT // Catch:{ NoSuchFieldError -> 0x0036 } int r1 = r0.ordinal() // Catch:{ NoSuchFieldError -> 0x0036 } r0 = 5 r2[r1] = r0 // Catch:{ NoSuchFieldError -> 0x0036 } L_0x0036: return */ throw new UnsupportedOperationException("Method not decompiled: com.squareup.okhttp.HttpUrl.AnonymousClass1.<clinit>():void"); } } public static int defaultPort(String str) { if (str.equals("http")) { return 80; } if (str.equals("https")) { return 443; } return -1; } public static int delimiterOffset(String str, int i, int i2, String str2) { while (i < i2) { if (str2.indexOf(str.charAt(i)) != -1) { return i; } i++; } return i2; } public static HttpUrl getChecked(String str) throws MalformedURLException, UnknownHostException { Builder builder = new Builder(); Builder.ParseResult parse = builder.parse(null, str); switch (parse.ordinal()) { case 0: return builder.build(); case 1: case 2: case 3: default: StringBuilder sb = new StringBuilder("Invalid URL: "); sb.append(parse); sb.append(" for "); sb.append(str); throw new MalformedURLException(sb.toString()); case 4: throw new UnknownHostException(AnonymousClass006.A07("Invalid host: ", str)); } } public static HttpUrl parse(String str) { Builder builder = new Builder(); if (builder.parse(null, str) == Builder.ParseResult.SUCCESS) { return builder.build(); } return null; } public static List<String> queryStringToNamesAndValues(String str) { String str2; ArrayList arrayList = new ArrayList(); int i = 0; while (true) { int length = str.length(); if (i > length) { return arrayList; } int indexOf = str.indexOf(38, i); if (indexOf == -1) { indexOf = length; } int indexOf2 = str.indexOf(61, i); if (indexOf2 == -1 || indexOf2 > indexOf) { arrayList.add(str.substring(i, indexOf)); str2 = null; } else { arrayList.add(str.substring(i, indexOf2)); str2 = str.substring(indexOf2 + 1, indexOf); } arrayList.add(str2); i = indexOf + 1; } } public String encodedFragment() { if (this.fragment == null) { return null; } String str = this.url; return str.substring(str.indexOf(35) + 1); } public String encodedPassword() { if (this.password.isEmpty()) { return ""; } String str = this.url; return str.substring(str.indexOf(58, this.scheme.length() + 3) + 1, str.indexOf(64)); } public String encodedPath() { String str = this.url; int indexOf = str.indexOf(47, this.scheme.length() + 3); return this.url.substring(indexOf, delimiterOffset(str, indexOf, str.length(), "?#")); } public List<String> encodedPathSegments() { String str = this.url; int indexOf = str.indexOf(47, this.scheme.length() + 3); int delimiterOffset = delimiterOffset(str, indexOf, str.length(), "?#"); ArrayList arrayList = new ArrayList(); while (indexOf < delimiterOffset) { int i = indexOf + 1; indexOf = delimiterOffset(this.url, i, delimiterOffset, "/"); arrayList.add(this.url.substring(i, indexOf)); } return arrayList; } public String encodedQuery() { if (this.queryNamesAndValues == null) { return null; } String str = this.url; int indexOf = str.indexOf(63) + 1; return this.url.substring(indexOf, delimiterOffset(str, indexOf + 1, str.length(), "#")); } public String encodedUsername() { if (this.username.isEmpty()) { return ""; } int length = this.scheme.length() + 3; String str = this.url; return this.url.substring(length, delimiterOffset(str, length, str.length(), ":@")); } public boolean equals(Object obj) { if (!(obj instanceof HttpUrl) || !((HttpUrl) obj).url.equals(this.url)) { return false; } return true; } public int hashCode() { return this.url.hashCode(); } public boolean isHttps() { return this.scheme.equals("https"); } public Builder newBuilder() { Builder builder = new Builder(); builder.scheme = this.scheme; builder.encodedUsername = encodedUsername(); builder.encodedPassword = encodedPassword(); builder.host = this.host; int i = this.port; if (i == defaultPort(this.scheme)) { i = -1; } builder.port = i; builder.encodedPathSegments.clear(); builder.encodedPathSegments.addAll(encodedPathSegments()); builder.encodedQuery(encodedQuery()); builder.encodedFragment = encodedFragment(); return builder; } public int pathSize() { return this.pathSegments.size(); } public String query() { List<String> list = this.queryNamesAndValues; if (list == null) { return null; } StringBuilder sb = new StringBuilder(); namesAndValuesToQueryString(sb, list); return sb.toString(); } public String queryParameter(String str) { List<String> list = this.queryNamesAndValues; if (list != null) { int size = list.size(); for (int i = 0; i < size; i += 2) { if (str.equals(this.queryNamesAndValues.get(i))) { return this.queryNamesAndValues.get(i + 1); } } } return null; } public String queryParameterName(int i) { return this.queryNamesAndValues.get(i << 1); } public Set<String> queryParameterNames() { if (this.queryNamesAndValues == null) { return Collections.emptySet(); } LinkedHashSet linkedHashSet = new LinkedHashSet(); int size = this.queryNamesAndValues.size(); for (int i = 0; i < size; i += 2) { linkedHashSet.add(this.queryNamesAndValues.get(i)); } return Collections.unmodifiableSet(linkedHashSet); } public String queryParameterValue(int i) { return this.queryNamesAndValues.get((i << 1) + 1); } public List<String> queryParameterValues(String str) { List<String> list = this.queryNamesAndValues; if (list == null) { return Collections.emptyList(); } ArrayList arrayList = new ArrayList(); int size = list.size(); for (int i = 0; i < size; i += 2) { if (str.equals(this.queryNamesAndValues.get(i))) { arrayList.add(this.queryNamesAndValues.get(i + 1)); } } return Collections.unmodifiableList(arrayList); } public int querySize() { List<String> list = this.queryNamesAndValues; if (list != null) { return list.size() >> 1; } return 0; } public HttpUrl resolve(String str) { Builder builder = new Builder(); if (builder.parse(this, str) == Builder.ParseResult.SUCCESS) { return builder.build(); } return null; } public URL url() { try { return new URL(this.url); } catch (MalformedURLException e) { throw new RuntimeException(e); } } public static void namesAndValuesToQueryString(StringBuilder sb, List<String> list) { int size = list.size(); for (int i = 0; i < size; i += 2) { String str = list.get(i); String str2 = list.get(i + 1); if (i > 0) { sb.append('&'); } sb.append(str); if (str2 != null) { sb.append('='); sb.append(str2); } } } public static void pathSegmentsToString(StringBuilder sb, List<String> list) { int size = list.size(); for (int i = 0; i < size; i++) { sb.append('/'); sb.append(list.get(i)); } } public String fragment() { return this.fragment; } public String host() { return this.host; } public String password() { return this.password; } public List<String> pathSegments() { return this.pathSegments; } public int port() { return this.port; } public String scheme() { return this.scheme; } public String toString() { return this.url; } public URI uri() { try { Builder newBuilder = newBuilder(); newBuilder.reencodeForUri(); return new URI(newBuilder.toString()); } catch (URISyntaxException unused) { throw new IllegalStateException(AnonymousClass006.A07("not valid as a java.net.URI: ", this.url)); } } public String username() { return this.username; } public HttpUrl(Builder builder) { List<String> list; this.scheme = builder.scheme; this.username = percentDecode(builder.encodedUsername, false); this.password = percentDecode(builder.encodedPassword, false); this.host = builder.host; this.port = builder.effectivePort(); this.pathSegments = percentDecode(builder.encodedPathSegments, false); List<String> list2 = builder.encodedQueryNamesAndValues; String str = null; if (list2 != null) { list = percentDecode(list2, true); } else { list = null; } this.queryNamesAndValues = list; String str2 = builder.encodedFragment; this.fragment = str2 != null ? percentDecode(str2, false) : str; this.url = builder.toString(); } public /* synthetic */ HttpUrl(Builder builder, AnonymousClass1 r2) { this(builder); } public static String canonicalize(String str, int i, int i2, String str2, boolean z, boolean z2, boolean z3) { int i3 = i; while (i3 < i2) { int codePointAt = str.codePointAt(i3); if (codePointAt >= 32 && codePointAt != 127 && ((codePointAt < 128 || !z3) && str2.indexOf(codePointAt) == -1)) { if (codePointAt == 37) { if (z) { } } else if (codePointAt == 43 && z2) { } i3 += Character.charCount(codePointAt); } Buffer buffer = new Buffer(); buffer.writeUtf8(str, i, i3); canonicalize(buffer, str, i3, i2, str2, z, z2, z3); return buffer.readUtf8(); } return str.substring(i, i2); } public static String canonicalize(String str, String str2, boolean z, boolean z2, boolean z3) { return canonicalize(str, 0, str.length(), str2, z, z2, z3); } public static void canonicalize(Buffer buffer, String str, int i, int i2, String str2, boolean z, boolean z2, boolean z3) { String str3; Buffer buffer2 = null; while (i < i2) { int codePointAt = str.codePointAt(i); if (!z || !(codePointAt == 9 || codePointAt == 10 || codePointAt == 12 || codePointAt == 13)) { if (codePointAt == 43 && z2) { if (z) { str3 = "+"; } else { str3 = "%2B"; } buffer.writeUtf8(str3); } else if (codePointAt < 32 || codePointAt == 127 || ((codePointAt >= 128 && z3) || str2.indexOf(codePointAt) != -1 || (codePointAt == 37 && !z))) { if (buffer2 == null) { buffer2 = new Buffer(); } buffer2.writeUtf8CodePoint(codePointAt); while (!buffer2.exhausted()) { int readByte = buffer2.readByte() & Base64.INVALID; buffer.writeByte(37); char[] cArr = HEX_DIGITS; buffer.writeByte((int) cArr[(readByte >> 4) & 15]); buffer.writeByte((int) cArr[readByte & 15]); } } else { buffer.writeUtf8CodePoint(codePointAt); } } i += Character.charCount(codePointAt); } } public static HttpUrl get(URI uri) { return parse(uri.toString()); } public static HttpUrl get(URL url2) { return parse(url2.toString()); } public static String percentDecode(String str, int i, int i2, boolean z) { for (int i3 = i; i3 < i2; i3++) { char charAt = str.charAt(i3); if (charAt == '%' || (charAt == '+' && z)) { Buffer buffer = new Buffer(); buffer.writeUtf8(str, i, i3); percentDecode(buffer, str, i3, i2, z); return buffer.readUtf8(); } } return str.substring(i, i2); } public static String percentDecode(String str, boolean z) { return percentDecode(str, 0, str.length(), z); } private List<String> percentDecode(List<String> list, boolean z) { ArrayList arrayList = new ArrayList(list.size()); Iterator<String> it = list.iterator(); while (it.hasNext()) { String next = it.next(); arrayList.add(next != null ? percentDecode(next, z) : null); } return Collections.unmodifiableList(arrayList); } public static void percentDecode(Buffer buffer, String str, int i, int i2, boolean z) { while (i < i2) { int codePointAt = str.codePointAt(i); if (codePointAt == 37) { int i3 = i + 2; if (i3 < i2) { int decodeHexDigit = decodeHexDigit(str.charAt(i + 1)); int decodeHexDigit2 = decodeHexDigit(str.charAt(i3)); if (!(decodeHexDigit == -1 || decodeHexDigit2 == -1)) { buffer.writeByte((decodeHexDigit << 4) + decodeHexDigit2); i = i3; } } buffer.writeUtf8CodePoint(codePointAt); } else { if (codePointAt == 43 && z) { buffer.writeByte(32); } buffer.writeUtf8CodePoint(codePointAt); } i += Character.charCount(codePointAt); } } }
fe5f90b7100c056f7de9d148c6184281b6bdbc80
74b47b895b2f739612371f871c7f940502e7165b
/aws-java-sdk-iotwireless/src/main/java/com/amazonaws/services/iotwireless/model/UpdateLogLevelsByResourceTypesResult.java
5ddf643754c27e3ba200dbff1dcbb3bbd2061698
[ "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,457
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.iotwireless.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateLogLevelsByResourceTypes" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateLogLevelsByResourceTypesResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateLogLevelsByResourceTypesResult == false) return false; UpdateLogLevelsByResourceTypesResult other = (UpdateLogLevelsByResourceTypesResult) obj; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; return hashCode; } @Override public UpdateLogLevelsByResourceTypesResult clone() { try { return (UpdateLogLevelsByResourceTypesResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
[ "" ]
be069c1694229b362f5307c639aa17570836b183
253b575758d0a6079a4a9fd393b1ece1deaf7195
/catmovies/src/main/java/com/example/catmovies/webservices/CatMovieEndpoint.java
da21a5eef328cdf37c3643f99b55da362a9facff
[]
no_license
gaoxiang15125/IntergrateHomework
533d688d0a266fdac3f98d63e7996288a6a8a51f
3133b205e5a5ebe5afd924d5842fdcec15a42093
refs/heads/master
2020-03-19T02:17:54.503836
2018-06-12T03:52:28
2018-06-12T03:52:28
135,616,223
0
0
null
null
null
null
UTF-8
Java
false
false
5,632
java
package com.example.catmovies.webservices; import com.example.catmovies.dao.CatMovieGetter; import com.example.catmovies.generatedPos.com.catmovies.webservices.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ws.server.endpoint.annotation.*; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.*; @Endpoint public class CatMovieEndpoint { private static final String NAMESPACE_URL = "http://catmovies.com/webservices/service"; @Autowired private CatMovieGetter getter; private ObjectFactory factory = new ObjectFactory(); @PayloadRoot(namespace = NAMESPACE_URL, localPart = "getAllMoviesRequest") @ResponsePayload public GetAllMoviesResponse getMovies(@RequestPayload GetAllMoviesRequest request) { GetAllMoviesResponse response = factory.createGetAllMoviesResponse(); Vector<com.example.catmovies.catpo.CatEyePo> pos = getter.getAllMovie(); List<CatEyePo> result = new ArrayList<>(); transform(result, pos); response.setPos(result); return response; } @PayloadRoot(namespace = NAMESPACE_URL, localPart = "getAllTheatresRequest") // @PayloadRoots() @ResponsePayload public GetAllTheatresResponse getTheatres(@RequestPayload GetAllTheatresRequest request) { GetAllTheatresResponse response = new GetAllTheatresResponse(); Vector<com.example.catmovies.catpo.CatTheatrePo> pos = getter.getAllTheatre(); System.out.println("Begin to transform!"); List<CatTheatrePo> result = new ArrayList<>(); transformTheatre(result, pos); response.setPos(result); return response; } private void transformTheatre(List<CatTheatrePo> result, Vector<com.example.catmovies.catpo.CatTheatrePo> pos) { for (com.example.catmovies.catpo.CatTheatrePo po : pos) { CatTheatrePo newPo = new CatTheatrePo(); newPo.setSeaverUsable(po.getSeaverUsable()); newPo.setTheatre(po.getTheatre()); newPo.setTheatreAddress(po.getTheatre_Address()); newPo.setTheatrePhone(po.getTheatre_Phone()); newPo.setTheatreName(po.getTheatre_Name()); HashMap<String, Vector<com.example.catmovies.catpo.CatTicketPo>> map = po.getTickets(); List<CatTheatrePo.Tickets.Entry> entries = new ArrayList<>(map.size()); for (Map.Entry<String, Vector<com.example.catmovies.catpo.CatTicketPo>> entry : map.entrySet()) { CatTheatrePo.Tickets.Entry aEntry = new CatTheatrePo.Tickets.Entry(); aEntry.setKey(entry.getKey()); List<CatTicketPo> catTicketPos = new ArrayList<>(entry.getValue().size()); transformCatTicket(catTicketPos, entry.getValue()); aEntry.setValue(catTicketPos); entries.add(aEntry); } CatTheatrePo.Tickets tickets = new CatTheatrePo.Tickets(); tickets.setEntry(entries); newPo.setTickets(tickets); result.add(newPo); } } private void transformCatTicket(List<CatTicketPo> catTicketPos, Vector<com.example.catmovies.catpo.CatTicketPo> value) { for (com.example.catmovies.catpo.CatTicketPo ticketPo : value) { CatTicketPo newPo = new CatTicketPo(); newPo.setBeginTime(ticketPo.getBegin_Time()); newPo.setEndTime(ticketPo.getEnd_Time()); newPo.setMoney(ticketPo.getMoney()); newPo.setMovieLangage(ticketPo.getMovie_Langage()); newPo.setVideoHall(ticketPo.getMovie_Langage()); newPo.setVideoHall(ticketPo.getVideo_Hall()); catTicketPos.add(newPo); } } private void transform(List<CatEyePo> result, Vector<com.example.catmovies.catpo.CatEyePo> pos) { for (com.example.catmovies.catpo.CatEyePo po : pos) { CatEyePo newPo = new CatEyePo(); newPo.setBookingOffice(po.getBooking_Office()); newPo.setIntroduction(po.getIntroduction()); newPo.setLastingTime(po.getLasting_Time()); newPo.setMovieEnglishName(po.getMovie_English_Name()); newPo.setMovieName(po.getMovie_Name()); newPo.setMoviePic(po.getMovie_Pic()); newPo.setShootPlace(po.getShoot_Place()); newPo.setShowPlace(po.getShow_Place()); newPo.setUserNUM(po.getUser_NUM()); newPo.setUserScore(po.getUser_Score()); newPo.setTypes(po.getTypes()); Date date = po.getShow_Time(); ZoneId zoneId = ZoneId.systemDefault(); LocalDateTime dateTime = LocalDateTime.ofInstant(date.toInstant(), zoneId); newPo.setShowTime(dateTime.format(DateTimeFormatter.ISO_DATE)); List<CatReviewPo> reviewPos = new ArrayList<>(); for (com.example.catmovies.catpo.CatReviewPo reviewPo : po.getCatReviewPoVector()) { CatReviewPo catReviewPo = new CatReviewPo(); catReviewPo.setReviews(reviewPo.getReviews()); catReviewPo.setReviewScore(reviewPo.getReview_score()); catReviewPo.setReviewTime(reviewPo.getReview_Time()); catReviewPo.setThumbUP(reviewPo.getThumb_UP()); catReviewPo.setUserImage(reviewPo.getUser_Image()); catReviewPo.setUserName(reviewPo.getUser_Name()); reviewPos.add(catReviewPo); } newPo.setCatReviewPoVector(reviewPos); result.add(newPo); } } }
459e0e129fa7e13b66d5980f802890363bfc98dd
b7f3d54303f06ecadb3e34531947b2601df7c3b2
/app/src/main/java/com/example/bloodbankapp/RecyclerAdapter.java
39908ba84784c9444349fefc7db436f277551f04
[]
no_license
Abassade/BloodBankApp
e3f5da3e3b70c9d4bff70c60f96e23f9e2fbb7f5
9cc657fb4d32c94db9c617ff13aa98ff1e0f9a55
refs/heads/master
2020-05-23T15:33:11.844008
2019-05-15T13:05:49
2019-05-15T13:05:49
186,828,116
0
0
null
null
null
null
UTF-8
Java
false
false
3,998
java
//package com.example.bloodbankapp; // //import android.content.Context; // //import android.support.v7.widget.RecyclerView; //import android.text.TextUtils; //import android.util.Log; //import android.view.LayoutInflater; //import android.view.View; //import android.view.ViewGroup; //import android.widget.ImageView; //import android.widget.LinearLayout; //import android.widget.TextView; //import android.widget.Toast; // //import com.squareup.picasso.MemoryPolicy; //import com.squareup.picasso.NetworkPolicy; //import com.squareup.picasso.Picasso; // //public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> { // // private List<Article> articleArrayList; // // private Context context; // // private OnRecyclerViewItemClickListener onRecyclerViewItemClickListener; // // public RecyclerAdapter(List<Article> articleArrayList, Context context) { // // this.articleArrayList = articleArrayList; // this.context = context; // // } // // @Override // // public RecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { // // View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_card, viewGroup, false); // // return new RecyclerAdapter.ViewHolder(view); // // } // // @Override // public void onBindViewHolder(RecyclerAdapter.ViewHolder viewHolder, int position) { // // final Article articleModel = articleArrayList.get(position); // // if(!TextUtils.isEmpty(articleModel.getTitle())) { // // viewHolder.titleText.setText(articleModel.getTitle()); // // } // // if(!TextUtils.isEmpty(articleModel.getDescription())) { // // viewHolder.descriptionText.setText(articleModel.getDescription()); // // } // // if(articleModel.getUrlToImage() != null){ // // Picasso.get() // .load(articleModel.getUrlToImage()) // .noFade() // .placeholder(R.drawable.imagenotfoun) // .error(R.drawable.imagenotfoun) // //we want to see changes immediately when the imageview is changed // .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE) // .networkPolicy(NetworkPolicy.NO_CACHE) // .into(viewHolder.imageView); // } // else { // viewHolder.imageView.setImageResource(R.drawable.imagenotfoun); // } // // viewHolder.artilceAdapterParentLinear.setTag(articleModel); // // } // // @Override // // public int getItemCount() { // // return articleArrayList.size(); // // } // // class ViewHolder extends RecyclerView.ViewHolder{ // // private TextView titleText; // // private TextView descriptionText; // // private ImageView imageView; // // private LinearLayout artilceAdapterParentLinear; // // ViewHolder(View view) { // // super(view); // // titleText = view.findViewById(R.id.article_adapter_tv_title); // // descriptionText = view.findViewById(R.id.article_adapter_tv_description); // // imageView = view.findViewById(R.id.imageview); // // artilceAdapterParentLinear = view.findViewById(R.id.article_adapter_ll_parent); // // artilceAdapterParentLinear.setOnClickListener(new View.OnClickListener() { // // @Override // // public void onClick(View view) { // // if (onRecyclerViewItemClickListener != null) { // // onRecyclerViewItemClickListener.onItemClick(getAdapterPosition(), view); // // } // // } // // }); // // } // // } // // public void setOnRecyclerViewItemClickListener(OnRecyclerViewItemClickListener onRecyclerViewItemClickListener) { // // this.onRecyclerViewItemClickListener = onRecyclerViewItemClickListener; // // } //}
6cbd547f659231b339b1ba796b64e0ace70af4c2
b7657edbaf7d67c988446d16bb93c3a195762791
/client/src/uk/ac/glasgow/scclippy/uicomponents/settings/PostColourChangerJTextField.java
20ebdb213d20f99ba66c33695715ee5774aa7d3a
[]
no_license
nikolovb1/SourceCodeClippy
6baf1de797b8a1ce506ddec45bfa6a8a422ca5a5
27f3cca12652a91d128382dce96f3fef97b645f5
refs/heads/master
2021-05-31T03:15:36.597956
2016-04-06T16:56:46
2016-04-06T16:56:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,783
java
package uk.ac.glasgow.scclippy.uicomponents.settings; import uk.ac.glasgow.scclippy.plugin.editor.Notification; import uk.ac.glasgow.scclippy.plugin.settings.Settings; import uk.ac.glasgow.scclippy.uicomponents.search.Posts; import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.BadLocationException; import java.io.FileNotFoundException; /** * Changes colour of the text in all posts */ class PostColourChangerJTextField extends JTextField { public PostColourChangerJTextField(Posts posts) { super(Posts.textColour); posts.applyTextColour(Posts.textColour); getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { applyColour(e); } @Override public void removeUpdate(DocumentEvent e) { applyColour(e); } @Override public void changedUpdate(DocumentEvent e) { applyColour(e); } private void applyColour(DocumentEvent e) { try { String newColour = e.getDocument().getText(0, e.getDocument().getLength()); Posts.textColour = newColour; Settings.saveSettings(); if (newColour.equals("")) { posts.removeTextColour(); } else { posts.applyTextColour(newColour); } } catch (BadLocationException | FileNotFoundException e1) { Notification.createErrorNotification(e1.getMessage()); } } }); } }
f34e328e5b98646eab531674a3d57e7878951ed9
27e7b8b18f240e13c5eeceda2e11c6254b5995d1
/src/com/devBootCamp/heranca1/RelatorioSalario.java
1d5d0177404dd5d75deb1cf12596cdd6d0b5e599
[]
no_license
eltonmmoreira/exercicios-resolvidos-dev-bootcamp
4f19e2fde67e94b415f4e0a20163e0790a419534
10b2da0af7f8724febf9afd35e191a7d006981ce
refs/heads/master
2022-03-24T21:36:17.800037
2019-10-29T03:00:13
2019-10-29T03:00:13
217,632,634
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package com.devBootCamp.heranca1; import java.util.List; public class RelatorioSalario { public void resumoSalario(Funcionario funcionario) { System.out.println("Funcionário: " + funcionario.getNome()); System.out.println("Salário: " + funcionario.calcularSalario()); } public void resumoSalario(List<Funcionario> funcionarios) { for (Funcionario funcionario : funcionarios) { resumoSalario(funcionario); } } }
[ "Elton23351335" ]
Elton23351335
d691d5aba7096405bc5620f4605362e29753c2d3
bf4e75f8167a5e9ddf814b90fdadde623d9c684d
/src/controllers/reports/ReportsIndexServlet.java
af96341a27378bf0d0dbcd8c3e85a47af84bd550
[]
no_license
kmegumi756/daily-report-system
4c726e916b01afde8026de91abfdaf5b7246b103
5192d38973ab904cc28d9b9b400ec2a6dd739b6f
refs/heads/main
2023-04-11T13:54:04.492558
2021-04-16T00:41:43
2021-04-16T00:41:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,920
java
package controllers.reports; import java.io.IOException; import java.util.List; import javax.persistence.EntityManager; import javax.servlet.RequestDispatcher; 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 models.Report; import utils.DBUtil; /** * Servlet implementation class ReportsIndexServlet */ @WebServlet("/reports/index") public class ReportsIndexServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public ReportsIndexServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { EntityManager em = DBUtil.createEntityManager(); int page; try{ page = Integer.parseInt(request.getParameter("page")); } catch(Exception e) { page = 1; } List<Report> reports = em.createNamedQuery("getAllReports", Report.class) .setFirstResult(15 * (page - 1)) .setMaxResults(15) .getResultList(); long reports_count = (long)em.createNamedQuery("getReportsCount", Long.class) .getSingleResult(); em.close(); request.setAttribute("reports", reports); request.setAttribute("reports_count", reports_count); request.setAttribute("page", page); if(request.getSession().getAttribute("flush") != null) { request.setAttribute("flush", request.getSession().getAttribute("flush")); request.getSession().removeAttribute("flush"); } RequestDispatcher rd = request.getRequestDispatcher("/WEB-INF/views/reports/index.jsp"); rd.forward(request, response); } }
0a0fe50d50536c378152df7489e78b513db573c2
63d713fff12c62876824f11f27bb81be857ca4c9
/src/main/java/com/cubie/openapi/sdk/internal/intent/AccessToken.java
95cf8db6d1edfdaa44f524634f9bd20a7b793f0b
[]
no_license
cubie-api/cubie-sdk-android
867c5ef8cbc8704ce59549a14bb28c9271d3e70c
0bc997eb200947b6c0082cf7ec09bdae7f47e67e
refs/heads/master
2020-12-24T17:08:26.306211
2014-08-29T08:58:53
2014-08-29T08:58:53
22,589,377
2
0
null
null
null
null
UTF-8
Java
false
false
2,850
java
package com.cubie.openapi.sdk.internal.intent; import org.json.JSONException; import org.json.JSONObject; import android.os.Bundle; import com.cubie.openapi.sdk.internal.util.Strings; public class AccessToken { public static AccessToken fromBundle(final Bundle bundle) { return new AccessToken(bundle.getString(KEY_UID), bundle.getString(KEY_OPEN_API_APP_ID), bundle.getString(KEY_ACCESS_TOKEN), bundle.getLong(KEY_EXPIRE_TIME)); } public static AccessToken fromJsonString(final String json) throws JSONException { final JSONObject obj = new JSONObject(json); return new AccessToken(obj.getString(KEY_UID), obj.getString(KEY_OPEN_API_APP_ID), obj.getString(KEY_ACCESS_TOKEN), obj.getLong(KEY_EXPIRE_TIME)); } private static final String KEY_UID = "com.cubie.openapi.sdk.model.AccessToken.uid"; private static final String KEY_OPEN_API_APP_ID = "com.cubie.openapi.sdk.model.AccessToken.openApiAppId"; private static final String KEY_ACCESS_TOKEN = "com.cubie.openapi.sdk.model.AccessToken.accessToken"; private static final String KEY_EXPIRE_TIME = "com.cubie.openapi.sdk.model.AccessToken.expireTime"; private final String uid; private final String openApiAppId; private final String accessToken; private final long expireTime; public AccessToken(String uid, String openApiAppId, String accessToken, long expireTime) { this.uid = uid; this.openApiAppId = openApiAppId; this.accessToken = accessToken; this.expireTime = expireTime; } public String getAccessToken() { return accessToken; } public long getExpireTime() { return expireTime; } public String getOpenApiAppId() { return openApiAppId; } public String getUid() { return uid; } public boolean isValid() { return !Strings.isBlank(accessToken) && expireTime > System.currentTimeMillis(); } public Bundle toBundle() { final Bundle bundle = new Bundle(); bundle.putString(KEY_UID, uid); bundle.putString(KEY_OPEN_API_APP_ID, openApiAppId); bundle.putString(KEY_ACCESS_TOKEN, accessToken); bundle.putLong(KEY_EXPIRE_TIME, expireTime); return bundle; } public String toJsonString() { try { final JSONObject obj = new JSONObject(); obj.put(KEY_UID, uid); obj.put(KEY_OPEN_API_APP_ID, openApiAppId); obj.put(KEY_ACCESS_TOKEN, accessToken); obj.put(KEY_EXPIRE_TIME, expireTime); return obj.toString(); } catch (final JSONException e) { throw new RuntimeException("fail to encode AccessToken to JSON", e); } } @Override public String toString() { return "AccessToken [uid=" + uid + ", openApiAppId=" + openApiAppId + ", accessToken=" + accessToken + ", expireTime=" + expireTime + "]"; } }
05d6932e2269bce16061d85b0afd3d3223dfc683
8aea95c114e07d043d217f51a30807b4642d49a7
/editor/editor-api/source/jetbrains/mps/openapi/editor/cells/CellAction.java
9424f3e9efc239bbebf5262e7fb3ab221c14c605
[ "LicenseRef-scancode-free-unknown", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
JetBrains/MPS
ec03a005e0eda3055c4e4856a28234b563af92c6
0d2aeaf642e57a86b23268fc87740214daa28a67
refs/heads/master
2023-09-03T15:14:10.508189
2023-09-01T13:25:35
2023-09-01T13:30:22
2,209,077
1,242
309
Apache-2.0
2023-07-25T18:10:10
2011-08-15T09:48:06
JetBrains MPS
UTF-8
Java
false
false
921
java
/* * Copyright 2003-2013 JetBrains s.r.o. * * 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 jetbrains.mps.openapi.editor.cells; import jetbrains.mps.openapi.editor.EditorContext; /** * User: shatalin * Date: 2/11/13 */ public interface CellAction { String getDescriptionText(); boolean executeInCommand(); boolean canExecute(EditorContext context); void execute(EditorContext context); }
d4692bc1897a023f1ec926b1bab21fb357500a6d
b4ea73fe143f2a4274146435cdb7c426a060569b
/src/Main.java
7e51e860b358ca031f7c4d5424d9ededfc804130
[]
no_license
yuliamashyrova/untitled5
57cb2c22b3a1fd926ebb92cd470cfdae31760de0
098e34752ef391ce70fc661548a70672f62fd112
refs/heads/master
2020-03-29T13:21:30.763409
2018-09-23T06:34:39
2018-09-23T06:34:39
149,954,444
0
0
null
null
null
null
UTF-8
Java
false
false
109
java
public class Main { public static void main () { System.out.println("Hello World"); } }
a84c28b4e7b593188849fed14999733deee5c3a1
f25f4440136fed7953575082889a6b974469c0be
/HW09/src/tr/com/ckama/Q02.java
d349f0f335b31d40be33ff4cc584eb0186863be7
[]
no_license
cihatkama/JavaTraining
e636f5a7180f6fbc561713c4d0a7f2aa819ed29e
00e745ce36ad54361cc4023eecab019e14df9b7e
refs/heads/master
2022-11-05T16:20:45.973223
2020-06-22T21:01:50
2020-06-22T21:01:50
254,942,928
1
0
null
2020-05-27T12:44:42
2020-04-11T19:45:45
Java
UTF-8
Java
false
false
202
java
package tr.com.ckama; public class Q02 { public static void main(String[] args) { String str = "test"; str = "other"; String s = new String(); s = "finally"; System.out.println(s); } }
[ "ckama@DESKTOP-PSVFIIG" ]
ckama@DESKTOP-PSVFIIG
6e1f89d8320d55930b053a1b8fcfb791e64fca8e
18ef21649264523c2c5182a618da94e5eb9b0b1d
/Nutripocket/src/model/Item.java
8f70b22c6741795f1d3a7da1a5597bff7d57478c
[]
no_license
rubensantibanezacosta/Java_Student_Projects
b77b3504f97cd5c604993122966c2105873a279a
efe1d4a60966c19ae22bc9de788af4c7e9bedf46
refs/heads/main
2023-04-15T11:00:06.445046
2021-04-28T06:17:46
2021-04-28T06:17:46
362,358,429
0
0
null
null
null
null
UTF-8
Java
false
false
854
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 model; /** * * @author ruben */ public class Item { private Alimento alimento; double racion=0; public Item(Alimento alimento, double racion) { this.alimento = alimento; this.racion = racion; } public Item(Alimento alimento) { this.alimento = alimento; racion=racion; } public Alimento getAlimento() { return alimento; } public void setAlimento(Alimento alimento) { this.alimento = alimento; } public double getRacion() { return racion; } public void setRacion(double racion) { this.racion = racion; } }
4ac2554ca0706e8a1c25db339de0e31d4da14cbc
aadb557ee12f0ca537ce8ef8f545c99b0bdcc3ce
/src/main/java/pl/sages/kodolamacz/Employee.java
8e7ae1ee5428cb3005552cdd712ae144d42102e7
[]
no_license
ArkadiuszJagura/git-hello-idea
ebebf22796fff3e7f4220cfe5c750e4b0ba928a4
b0e70b90c8ccf9a874c8cba31e0339c209de0b12
refs/heads/master
2021-01-21T21:05:58.691105
2017-06-19T14:07:33
2017-06-19T14:07:33
94,775,655
0
0
null
null
null
null
UTF-8
Java
false
false
4,098
java
package pl.sages.kodolamacz; import java.util.Date; public class Employee { static final int MINMUM_WAGE = 2000; static int count = 0; // pracownik ma imie i juz go nie moze zmienić final MojString name; final String position; EmployeeType employeeType; int age; double salary; Double salaryBox; // nazwy zmiennych powinny pasowac do konwencji camelCase // początek z małej, a każde kolejne słowo z Wielkiej litery Date dateOfBirth; public Employee(String name) { this(name, "HR", 18, EmployeeType.HR); } public Employee(String name, String position, int age, EmployeeType employeeType) { this.name = new MojString(name); this.position = position; this.age = age; this.employeeType = employeeType; } void printEmployeeType(){ if(employeeType == EmployeeType.DEV){ System.out.println("programista"); }else if(employeeType == EmployeeType.HR){ System.out.println("Zasoby ludzkie"); }else{ System.out.println("Zwykły pracownik"); } } void printEmployeeTypeSwitch(){ switch (employeeType){ case DEV: System.out.println("programista"); break; case HR: System.out.println("Zasoby ludzkie"); break; default: System.out.println("Zwykły pracownik"); break; } } // void chooseRole(){ // switch (type){ // case ADMIN: // admineRole(); // case MODEARTOR: // modRole(); // case USER: // // } // } // ta metoda zwraca liczbę rzeczywistą void printSalary(){ System.out.println(getSalary()); } double getSalary(){ return calculateSalaryWithBonus(employeeType.bonus); } double calculateSalaryWithBonus(int bonus){ return salary * (100 + bonus)/100; } // a ta nie zwraca nic public static void main(String[] args) { System.out.println(); int iluPracownikow = 0; String zmienna = "lokalna"; final String name = "Bartek"; // pusty, nieistniejacy obiekt // wywolanie name na nim da błąd // nie został tutaj stworzony żaden pracownik Employee pusty = null; Employee mietek = new Employee("Mieczysław", "HR", 18, EmployeeType.HR); System.out.println(mietek); Employee ania = new Employee("Ania"); MojString poleInstancjiKlasy = ania.name; int poleKlasy = Employee.MINMUM_WAGE; int count = Employee.count; Employee bartek = new Employee(name, "DEV", 25, EmployeeType.DEV); Employee bartek2 = new Employee("Bartek", "DEV", 26, EmployeeType.DEV); if(bartek.equals(bartek2)){ System.out.println("Bartki są równe"); } double salary = bartek.getSalary(); // tego nie możemy nigdzie przypisać bo nic nie zwraca bartek.printSalary(); bartek.printEmployeeTypeSwitch(); bartek.age = 26; bartek.name.wypisz(); Employee stefan = new Employee("Stefan", "Boss", 40, EmployeeType.CEO); System.out.println(Employee.count); int c = stefan.count; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Employee employee = (Employee) o; return name != null ? name.equals(employee.name) : employee.name == null; } } enum EmployeeType { HR(0), DEV(10), CEO(50), MANAGER(15); int bonus; EmployeeType(int bonus) { this.bonus = bonus; } } class MojString{ String text; public MojString(String text) { this.text = text; } public void wypisz(){ System.out.println("Imię tego pracownika to " + text); } } // nazwa klasy też w stylu camelCase, ale pierwsza litera Wielka! class EmployeeOfTheMonth { }
0743bba7a8d7f1ef942ddf8127eb02adbc2de6c3
e2a2e220cbd8cd7330058ee5a4f99c34c089bc1b
/mll_product/src/main/java/com/xmcc/mll_product/mapper/MllMessageMapper.java
11b5786d0edce3fbb28b71908ea234a99abceaee
[]
no_license
gameskyer/mll_parent
5c150f7654146604a1a10ac5c6acaa0cec520cac
a4d6fa66f140af6dfaae752f98788e5eaa430214
refs/heads/master
2020-06-03T19:50:28.373025
2019-06-13T07:15:50
2019-06-13T07:15:50
191,709,595
0
0
null
null
null
null
UTF-8
Java
false
false
489
java
package com.xmcc.mll_product.mapper; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @Mapper public interface MllMessageMapper { int updateConsumerAndStatus(@Param("messageId") String messageId, @Param("status") int status); void updateConsumerAndStatusSuccess(@Param("messageId") String messageId,@Param("status") int status); int updateStatusByConsumerStatus(@Param("messageId") String messageId,@Param("status") int status); }
3f518e69b874a7a304e2f872a825bd3db752ba23
3fc9ee87a40ac9a6f60909617180aec5863b86d1
/src/com/blogspot/yakisobayuki/birth2cal2/TabBirthday.java
8451e8e2575538e37f1f0feff8672c91e201496d
[]
no_license
yakisoba/Contenttest
c1251945cb0ebf2344285472fe47e50a992f27c6
f99f15e2bf7221b712c0d065f99d73c10f844c10
refs/heads/master
2018-12-29T17:07:00.206920
2011-05-19T15:28:00
2011-05-19T15:28:00
945,995
0
0
null
null
null
null
UTF-8
Java
false
false
11,510
java
package com.blogspot.yakisobayuki.birth2cal2; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.Comparator; import java.util.List; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; import android.content.SharedPreferences; import android.database.Cursor; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.provider.ContactsContract.CommonDataKinds.Event; import android.provider.ContactsContract.Data; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.GridView; import android.widget.ImageView; import android.widget.TextView; public class TabBirthday extends Activity implements OnClickListener { /** Called when the activity is first created. */ final Boolean logstatus = false; // List表示用 private List<ContactsStatus> mList = null; private ContactAdapter mAdapter = null; GridView gridView; // 今日の日付取得 final Calendar mCalendar = Calendar.getInstance(); final int mYear = mCalendar.get(Calendar.YEAR); final int mMonth = mCalendar.get(Calendar.MONTH); final int mDay = mCalendar.get(Calendar.DAY_OF_MONTH); // 表示のアイテム private CheckBox check_full; private Button button_import; public class SortObj { private String displayName; private String daykind; private String birthday; private String age; private int month_day; public SortObj(String name, String type, String day, String age, int month_day) { this.displayName = name; this.daykind = type; this.birthday = day; this.age = age; this.month_day = month_day; } public String getName() { return displayName; } public String getType() { return daykind; } public String getDay() { return birthday; } public String getAge() { return age; } public int getMD() { return month_day; } } @Override public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.list); gridView = (GridView) findViewById(R.id.list); ReadDialog rd = new ReadDialog(); rd.execute(); check_full = (CheckBox) findViewById(R.id.CheckBox_full); check_full.setOnClickListener(this); button_import = (Button) findViewById(R.id.button_import); button_import.setOnClickListener(this); } private class ReadDialog extends AsyncTask<Object, Void, List<ContactsStatus>> { private ProgressDialog progressDialog = null; @Override protected void onPreExecute() { // バックグラウンドの処理前にUIスレッドでダイアログ表示 progressDialog = new ProgressDialog(TabBirthday.this); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setMessage(getString(R.string.read)); progressDialog.setCancelable(false); progressDialog.show(); } @Override protected List<ContactsStatus> doInBackground(Object... params) { // 表示用にデータを収集 fillData(); return null; } @Override protected void onPostExecute(List<ContactsStatus> result) { // 処理中ダイアログをクローズ progressDialog.dismiss(); // 取得したデータをviewにセット mAdapter = new ContactAdapter(TabBirthday.this, R.layout.listview, mList); gridView.setAdapter(mAdapter); } } public class ContactAdapter extends ArrayAdapter<ContactsStatus> { private LayoutInflater inflater; public ContactAdapter(Context context, int textViewResourceId, List<ContactsStatus> items) { super(context, textViewResourceId, items); this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public View getView(int position, View convertView, ViewGroup parent) { // ビューを受け取る View view = inflater.inflate(R.layout.listview, null); // 表示すべきデータの取得 final ContactsStatus item = getItem(position); if (item != null) { TextView displayName, daykind, birthday, age, selkind; final CheckBox checkbox; ImageView image; displayName = (TextView) view.findViewById(R.id.ContactsName1); daykind = (TextView) view.findViewById(R.id.DayKind1); birthday = (TextView) view.findViewById(R.id.Birthday1); age = (TextView) view.findViewById(R.id.Age1); selkind = (TextView) view.findViewById(R.id.Age2); checkbox = (CheckBox) view.findViewById(R.id.CheckBox1); image = (ImageView) view.findViewById(R.id.Image1); displayName.setText(item.getDisplayName()); daykind.setText(item.getDayKind()); birthday.setText(item.getBirth()); age.setText(item.getAge()); checkbox.setChecked(item.getCheckFlag()); if (item.getDayKind().equals(getString(R.string.birthday))) { image.setImageResource(R.drawable.heart); selkind.setText(getString(R.string.age)); } else if (item.getDayKind().equals( getString(R.string.anniversary))) { image.setImageResource(R.drawable.star); selkind.setText(getString(R.string.ani)); } // CheckBoxをチェックしたときの動作 checkbox.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (checkbox.isChecked() == true) { item.setCheckFlag(true); } else { item.setCheckFlag(false); } } }); } return view; } } // コンタクトデータを取得して表示 private void fillData() { this.mList = new ArrayList<ContactsStatus>(); Uri uri = Data.CONTENT_URI; String[] projection = new String[] { Event.CONTACT_ID, Event.DISPLAY_NAME, Event.DATA, Event.TYPE }; String selection = Data.MIMETYPE + "=? AND (" + Event.TYPE + "=? OR " + Event.TYPE + "=?) "; String[] selectionArgs = new String[] { Event.CONTENT_ITEM_TYPE, String.valueOf(Event.TYPE_ANNIVERSARY), String.valueOf(Event.TYPE_BIRTHDAY) }; Cursor c1 = getContentResolver().query(uri, projection, selection, selectionArgs, null); // 一旦ソート用のリストに格納。(あとでContact用のリストに格納) List<SortObj> sortList = new ArrayList<SortObj>(); if (c1 != null) { try { while (c1.moveToNext()) { // コンタクトユーザのリストを作成 String displayName = c1.getString(c1 .getColumnIndex(Event.DISPLAY_NAME)); String date = c1.getString(c1.getColumnIndex(Event.DATA)); // 誕生日情報をフォーマット変換 String date_tmp = new BirthdayFormat().DateCheck(date); if (date_tmp != null) { String daykind = c1.getString(c1 .getColumnIndex(Event.TYPE)); if (Integer.parseInt(daykind) == 1) { daykind = getString(R.string.anniversary); } else if (Integer.parseInt(daykind) == 3) { daykind = getString(R.string.birthday); } // 今年の誕生日が過ぎたかどうか判定 String age = null; int yyyy, mm, dd; // 年、月、日に分けint型へキャスト yyyy = Integer.parseInt(date_tmp.substring(0, 4)); mm = Integer.parseInt(date_tmp.substring(5, 7)); dd = Integer.parseInt(date_tmp.substring(8, 10)); int month_day = 0; if ((mMonth + 1 < mm) || ((mMonth + 1 == mm) && (mDay < dd))) { // 過ぎてない age = Integer.toString(mYear - yyyy - 1); month_day = mm * 100 + dd; } else if ((mMonth + 1 == mm) && (mDay == dd)) { // 今日 age = Integer.toString(mYear - yyyy); month_day = mm * 100 + dd; } else if ((mMonth + 1 > mm) || ((mMonth + 1 == mm) && (mDay > dd))) { // 過ぎてる age = Integer.toString(mYear - yyyy); month_day = mm * 100 + dd + 10000; } sortList.add(new SortObj(displayName, daykind, date_tmp, age, month_day)); Collections.sort(sortList, new Comparator<SortObj>() { public int compare(SortObj t1, SortObj t2) { return t1.getMD() - t2.getMD(); } }); } } } finally { c1.close(); } for (SortObj obj : sortList) { ContactsStatus item = new ContactsStatus(); item.setParam(obj.getName(), obj.getType(), obj.getDay(), obj.getAge()); if (!mList.contains(item)) { mList.add(item); } } } } @Override public void onClick(View v) { // 全てチェックのCheckBoxを叩いた処理 if (v == check_full) { if (check_full.isChecked() == true) { // リストの分だけCheckBoxをONに for (ContactsStatus status : mList) { status.setCheckFlag(true); } // CheckBoxのテキストを変更 CheckBox b = (CheckBox) v; b.setText(getString(R.string.check_off)); } else if (check_full.isChecked() == false) { // リストの分だけCheckBoxをOFFに for (ContactsStatus status : mList) { status.setCheckFlag(false); } // CheckBoxのテキストを変更 CheckBox b = (CheckBox) v; b.setText(getString(R.string.check_on)); } mAdapter.notifyDataSetChanged(); // カレンダーに登録のボタンを押した処理 } else if (v == button_import) { // プリファレンスから登録するカレンダーを取得する SharedPreferences pref = getSharedPreferences("cal_list", 0); int calId = Integer.parseInt(pref .getString("calendar_list_id", "0")); if (logstatus == true) { Log.d("birth2cal", Integer.toString(calId)); } if (calId == 0) { // カレンダー選択を行っていなかったときアラームダイアログを表示する ViewGroup alert = (ViewGroup) findViewById(R.id.dialog); View layout = getLayoutInflater().inflate(R.layout.dialog, alert); TextView tv1 = (TextView) layout.findViewById(R.id.dlg_text1); TextView tv2 = (TextView) layout.findViewById(R.id.dlg_text2); tv1.setText(getString(R.string.no_calendar1)); tv2.setText(getString(R.string.no_calendar2)); // layoutで記載したviewをダイアログに設定する AlertDialog.Builder dlg; dlg = new AlertDialog.Builder(TabBirthday.this); dlg.setTitle("error!!"); dlg.setView(layout); dlg.setPositiveButton("OK", null); dlg.show(); } else { // カレンダーが選択されていたので、カレンダーに登録を開始する int Chk_count = 0; // CheckBoxがONのカウント for (ContactsStatus status : mList) { if (status.getCheckFlag() == true) { Chk_count++; } } if (Chk_count == 0) { // チェックボックスのチェックが0個だったらエラー ViewGroup alert = (ViewGroup) findViewById(R.id.dialog); View layout = getLayoutInflater().inflate(R.layout.dialog, alert); TextView tv1 = (TextView) layout .findViewById(R.id.dlg_text1); tv1.setText(getString(R.string.no_check)); AlertDialog.Builder dlg; dlg = new AlertDialog.Builder(TabBirthday.this); dlg.setPositiveButton("OK", null); dlg.setTitle("error!!"); dlg.setView(layout); dlg.show(); } else { // 問題がなければプログレスダイアログを表示し、別スレッドで処理 CreateCalendar createCalendar = new CreateCalendar(this, Chk_count, getApplicationContext()); createCalendar.CreateStart(mList); } } } } }
2e31623c8909e2e316a0cfa9ff414537670ed851
eec42772b347207c654d4cd61438528dca181cd7
/app/src/test/java/com/hqs/alx/tmdbcinemamovies/ExampleUnitTest.java
226bf1400da858b7a581c3111ede6dc88e93624b
[]
no_license
alesha712/TMDBCinemaMovies
9961e9c28a8b45a83328b1fbe2f50e28c7e65db1
9c45e0cc3efdcee75ddd13f7fbf6087b27982061
refs/heads/master
2020-03-17T08:13:01.089911
2018-05-14T22:28:46
2018-05-14T22:28:46
133,429,280
0
1
null
null
null
null
UTF-8
Java
false
false
406
java
package com.hqs.alx.tmdbcinemamovies; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
2d3f415e7c3599479d53164a30336b8dc710834d
20ac23b0f310f7a9427c89a2b9f7c36bbe1240d1
/RpcItemParent/netty-demo/src/main/java/cn/itcast/message/ChatRequestMessage.java
1bfe03af5ae4ce54ba0e3451250bdc36674f6348
[]
no_license
zyz610650/NettyPractice
ca8808f57f535c43398f7525601df7cf7076530c
20d7df86889f0f117eeddc6a6842e7401a9599bf
refs/heads/master
2023-08-24T09:44:54.332597
2021-09-19T11:37:31
2021-09-19T11:37:31
404,937,466
2
0
null
null
null
null
UTF-8
Java
false
false
525
java
package cn.itcast.message; import lombok.Data; import lombok.ToString; @Data @ToString(callSuper = true) public class ChatRequestMessage extends Message { private String content; private String to; private String from; public ChatRequestMessage() { } public ChatRequestMessage(String from, String to, String content) { this.from = from; this.to = to; this.content = content; } @Override public int getMessageType() { return ChatRequestMessage; } }
f832b65baf9c6ddd101e9a709131041c866aeaad
70938375bbfdf56f6374a51f2b48251a75a2d093
/Quests/src/com/quests/config/Config.java
6c25cfb2174f3e2b57c753d87fbe4051a394f557
[]
no_license
F12-Syntex/Quests
e0ce9d7be8a9cca785efa801dad243a22987c683
4227b476601f501ed6643b64bfc88a7b6f262b1e
refs/heads/master
2023-09-02T09:45:50.160151
2021-11-06T09:35:24
2021-11-06T09:35:24
402,665,792
0
0
null
null
null
null
UTF-8
Java
false
false
2,993
java
package com.quests.config; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import com.quests.main.Quests; public abstract class Config { protected String name; protected double verison; protected FileConfiguration configuration; protected File config; protected Quests base; public List<ConfigItem> items; public abstract Configuration configuration(); public Config(String name, double version) { this.name = name; this.verison = version; this.base = Quests.getInstance(); this.items = new ArrayList<ConfigItem>(); } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getVerison() { return verison; } public void setVerison(double verison) { this.verison = verison; } public FileConfiguration getConfiguration() { return configuration; } public void setConfiguration(FileConfiguration configuration) { this.configuration = configuration; } public void setup() { config = new File(this.base.getDataFolder().getAbsolutePath(), this.name + ".yml"); this.configuration = YamlConfiguration.loadConfiguration(config); if(!config.exists()) { this.configuration.set("identity.version", this.verison); for(ConfigItem i : this.items) { this.configuration.set(i.getPath(), i.getData()); } } this.save(); } public void setDefault() { this.configuration.set("identity.version", this.verison); for(ConfigItem i : this.items) { this.configuration.set(i.getPath(), i.getData()); } } public void save() { try { this.configuration.save(this.config); } catch (IOException e) { e.printStackTrace(); } } public File getConfig() { return config; } public void setConfig(File config) { this.config = config; } public abstract void initialize(); public File backup() { File depreciated = new File(this.base.getDataFolder(), "depreciated"); File backups = new File(depreciated, this.name); Quests.Log("Backing up..."); if(backups.mkdirs() || backups.exists()) { Quests.Log("created"); if(!this.getConfig().exists()) return null; int files = backups.listFiles().length + 1; File backup = new File(backups, this.name + "(" + files + ")" + ".yml"); final File tempConfig = this.getConfig(); boolean success = this.getConfig().renameTo(backup); if(success) { Quests.Log("&a" + this.name + ".yml has been backed up!"); }else { Quests.Log("&cCouldnt backup!"); } return tempConfig; }else if(!backups.exists()) { Quests.Log("&cCouldnt create backup folder!"); } return null; } }