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
a420536bb522e11410e4f6ea86e947f6448d56ac
6b3d06991e6328bced068b79141f89f5d9817bb1
/app/src/main/java/com/project/collaborativeauthenticationapplication/service/crypto/BigNumber.java
bd2a3139d3de2be5646f18163399de4538579596
[]
no_license
yoshiV3/CollaborativeAuthenticationApplication
18f50a7c4a79e91660066d3b33ce674f06f409b6
04e92f6a914714ff6da27b6ff557474156baa5dc
refs/heads/master
2023-06-03T18:25:46.445271
2021-06-24T09:24:12
2021-06-24T09:24:12
341,026,649
0
0
null
null
null
null
UTF-8
Java
false
false
3,879
java
package com.project.collaborativeauthenticationapplication.service.crypto; import androidx.annotation.NonNull; public class BigNumber implements Comparable<BigNumber>{ private final byte[] representation = new byte[RandomnessGenerator.NUMBER_INTEGER_SIZE* RandomnessGenerator.INTEGER_BYTE_SIZE]; public BigNumber(byte[] partOne, byte[] partTwo, byte[] partThree, byte[] partFour, byte[] partFive, byte[] partSix, byte[] partSeven, byte[] partEight) { System.arraycopy(partOne, 0, representation, 0, 4); System.arraycopy(partTwo, 0, representation, 4, 4); System.arraycopy(partThree, 0, representation, 8, 4); System.arraycopy(partFour, 0, representation, 12,4); System.arraycopy(partFive, 0, representation, 16,4); System.arraycopy(partSix, 0, representation, 20,4); System.arraycopy(partSeven, 0, representation, 24,4); System.arraycopy(partEight, 0, representation, 28,4); } public BigNumber(byte[] fullNumber) { int length = RandomnessGenerator.NUMBER_INTEGER_SIZE* RandomnessGenerator.INTEGER_BYTE_SIZE; if (fullNumber.length != length ) { throw new IllegalArgumentException("number is not the correct size of 8 4 byte integers"); } System.arraycopy(fullNumber, 0, representation, 0, length); } public byte[] getBigNumberAsByteArray(){ return representation.clone(); } public byte[] getPart(int index) { byte result[] = new byte[4]; System.arraycopy(representation, index*4, result, 0, 4); return result; } private String getStringFromPart(int part) { String result = " "; byte[] byteArrPart = getPart(part); for (byte element: byteArrPart) { result = result + String.valueOf(element) + " "; } return result + "."; } @NonNull @Override public String toString() { String result = ""; for (int part = 0; part <8; part++) { result = result + getStringFromPart(part); } return result; } public static BigNumber getZero() { byte[] zero = {0,0,0,0}; return new BigNumber(zero.clone(),zero.clone(),zero.clone(),zero.clone(),zero.clone(),zero.clone(),zero.clone(),zero.clone()); } public static BigNumber getN(){ return new BigNumber(new byte[]{5, 65, 54, -48, -116, 94, -46, -65, 59, -96, 72, -81, -26, -36, -82, -70, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}); } @Override public int compareTo(BigNumber o) { byte[] thisByteArr = this.getBigNumberAsByteArray(); byte[] oByteArr = o.getBigNumberAsByteArray(); boolean hasMadeDecision = false; int result =0; for (int i = 31; i > -1; i--) { if (thisByteArr[i] > -1 && oByteArr[i] < 0) { //this positive, other negative: other is larger if (!hasMadeDecision) { result = -1; hasMadeDecision = true; } } else if (thisByteArr[i] < 0 && oByteArr[i] > -1) { //this negative, other positive; this is larger if (!hasMadeDecision) { result = 1; hasMadeDecision = true; } } else { // both same size so take biggest if (thisByteArr[i] != oByteArr[i] && !hasMadeDecision) { if (thisByteArr[i] > oByteArr[i]) { result = 1; hasMadeDecision = true; } else { result = -1; hasMadeDecision = true; } } } } return result; } }
05eea3a46faf0cd26236915db8fa2d80d3c396fd
47f832300dd7c5f1f8da4028905656faf85bd4da
/app/src/main/java/com/zjyang/mvpframe/module/mapmark/presenter/MapMarkPresenter.java
fef37fc48e71bdc2d27ddcaa87b772742fc28176
[]
no_license
GitHubZJY/MVPFrame
524dd692cdbcc28f63039f55f4bda216af42d98d
d2ed27d9158fa1e4844c69e065f1d12e66a15e34
refs/heads/master
2021-07-10T15:11:55.287161
2018-10-28T15:10:24
2018-10-28T15:10:24
130,890,920
0
0
null
null
null
null
UTF-8
Java
false
false
1,539
java
package com.zjyang.mvpframe.module.mapmark.presenter; import android.text.TextUtils; import com.zjyang.base.base.BasePresenter; import com.zjyang.mvpframe.event.GetMapMarkEvent; import com.zjyang.mvpframe.module.UserDataManager; import com.zjyang.mvpframe.module.login.model.bean.User; import com.zjyang.mvpframe.module.mapmark.MapMarkTasksContract; import com.zjyang.mvpframe.module.mapmark.model.MapMarkModel; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; /** * Created by zhengjiayang on 2018/9/3. */ public class MapMarkPresenter extends BasePresenter<MapMarkTasksContract.View, MapMarkTasksContract.Model> implements MapMarkTasksContract.Presenter{ public MapMarkPresenter() { if(!EventBus.getDefault().isRegistered(this)){ EventBus.getDefault().register(this); } } @Override public MapMarkModel createModel() { return new MapMarkModel(); } @Override public void fillMarkData() { User user = UserDataManager.getInstance().getCurUser(); if(user != null && !TextUtils.isEmpty(user.getObjectId())){ mModel.getMarkDataByUserId(user.getObjectId()); } } @Subscribe(threadMode = ThreadMode.MAIN) public void onGetMapMarkEvent(GetMapMarkEvent event){ if(event.isSuccess()){ mView.setMarkDataInMap(event.getMarkList()); } } public void destroy(){ EventBus.getDefault().unregister(this); } }
581b0ff39fac2208ac7e9f025cf2af2c1ac5f6cf
70f3de8b3190bee992d868f1fe74c46d2efe2e13
/applications/postagging/trunk/src/edlin/sequence/CRF.java
adcdb9570f1f9b22e61015b8283d4914d9f1b3c2
[]
no_license
shatu/pr-toolkit
3799233c15cbeb79b49dca78b63af0574eefbaab
b756496ab815e4a259c33a25b91cb5f9c6f50ca9
refs/heads/master
2020-12-03T05:15:43.991079
2011-05-25T10:03:05
2011-05-25T10:03:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,022
java
package edlin.sequence; import java.util.ArrayList; import edlin.algo.ConjugateGradient; import edlin.algo.GradientAscent; import edlin.types.Alphabet; import edlin.types.DifferentiableObjective; import edlin.types.StaticUtils; public class CRF { double gaussianPriorVariance; double numObservations; Alphabet xAlphabet; Alphabet yAlphabet; SequenceFeatureFunction fxy; public CRF(double gaussianPriorVariance, Alphabet xAlphabet, Alphabet yAlphabet, SequenceFeatureFunction fxy) { this.gaussianPriorVariance = gaussianPriorVariance; this.xAlphabet = xAlphabet; this.yAlphabet = yAlphabet; this.fxy = fxy; } public LinearTagger batchTrain(ArrayList<SequenceInstance> trainingData) { Objective obj = new Objective(trainingData); // perform gradient descent @SuppressWarnings("unused") GradientAscent gaoptimizer = new GradientAscent(); @SuppressWarnings("unused") ConjugateGradient optimizer = new ConjugateGradient(obj .getNumParameters()); @SuppressWarnings("unused") boolean success = optimizer.maximize(obj); System.out.println("valCalls = " + obj.numValueCalls + " gradientCalls=" + obj.numGradientCalls); return obj.tagger; } /** * An objective for our max-ent model. That is: max_\lambda sum_i log * Pr(y_i|x_i) - 1/var * ||\lambda||^2 where var is the Gaussian prior * variance, and p(y|x) = exp(f(x,y)*lambda)/Z(x). * * @author kuzman * */ class Objective implements DifferentiableObjective { double[] empiricalExpectations; LinearTagger tagger; ArrayList<SequenceInstance> trainingData; int numValueCalls = 0; int numGradientCalls = 0; Objective(ArrayList<SequenceInstance> trainingData) { this.trainingData = trainingData; // compute empirical expectations... empiricalExpectations = new double[fxy.wSize()]; for (SequenceInstance inst : trainingData) { StaticUtils.plusEquals(empiricalExpectations, fxy.apply(inst.x, inst.y)); } tagger = new LinearTagger(xAlphabet, yAlphabet, fxy); } private double[][] forward(double[][][] expS) { double[][] res = new double[expS.length][yAlphabet.size()]; for (int y = 0; y < yAlphabet.size(); y++) { res[0][y] = expS[0][0][y]; } for (int t = 1; t < expS.length; t++) { for (int yt = 0; yt < yAlphabet.size(); yt++) { for (int ytm1 = 0; ytm1 < yAlphabet.size(); ytm1++) { res[t][yt] += res[t - 1][ytm1] * expS[t][ytm1][yt]; } } } return res; } private double[][] backward(double[][][] expS) { double[][] res = new double[expS.length][yAlphabet.size()]; for (int y = 0; y < yAlphabet.size(); y++) { res[expS.length - 1][y] = 1; } for (int t = expS.length - 1; t > 0; t--) { for (int yt = 0; yt < yAlphabet.size(); yt++) { for (int ytm1 = 0; ytm1 < yAlphabet.size(); ytm1++) { res[t - 1][ytm1] += res[t][yt] * expS[t][ytm1][yt]; } } } return res; } private void normalizeScores(double[][][] scores) { for (int t = 0; t < scores.length; t++) { double max = 0; for (int ytm1 = 0; ytm1 < yAlphabet.size(); ytm1++) { for (int yt = 0; yt < yAlphabet.size(); yt++) { max = Math.max(max, scores[t][ytm1][yt]); } } // max = max/yAlphabet.size(); for (int ytm1 = 0; ytm1 < yAlphabet.size(); ytm1++) { for (int yt = 0; yt < yAlphabet.size(); yt++) { scores[t][ytm1][yt] -= max; } } } } public double getValue() { numValueCalls++; // value = log(prob(data)) - 1/gaussianPriorVariance * ||lambda||^2 double val = 0; int numUnnormalizedInstances = 0; for (SequenceInstance inst : trainingData) { double[][][] scores = tagger.scores(inst.x); normalizeScores(scores); double[][][] expScores = StaticUtils.exp(scores); double[][] alpha = forward(expScores); // just need likelihood.. so no beta // double[][] beta = backward(expScores); double Z = StaticUtils.sum(alpha[inst.x.length - 1]); if (Z == 0 || Double.isNaN(Z) || Double.isInfinite(Z)) { // throw new RuntimeException("can't normalize instance. // Z="+Z); if (numUnnormalizedInstances < 3) { System.err.println("Could not normalize instance (" + Z + "), skipping"); } else if (numUnnormalizedInstances == 3) { System.err.println(" ..."); } numUnnormalizedInstances++; continue; } val += Math.log(expScores[0][0][inst.y[0]]); for (int t = 1; t < inst.y.length; t++) { val += Math.log(expScores[t][inst.y[t - 1]][inst.y[t]]); } val -= Math.log(Z); } if (numUnnormalizedInstances != 0) System.err.println("Could not normalize " + numUnnormalizedInstances + " instances"); val -= 1 / (2 * gaussianPriorVariance) * StaticUtils.twoNormSquared(tagger.w); return val; } public void getGradient(double[] gradient) { numGradientCalls++; // gradient = empiricalExpectations - modelExpectations // -2/gaussianPriorVariance * params double[] modelExpectations = new double[gradient.length]; for (int i = 0; i < gradient.length; i++) { gradient[i] = empiricalExpectations[i]; modelExpectations[i] = 0; } int numUnnormalizedInstances = 0; for (SequenceInstance inst : trainingData) { double[][][] scores = tagger.scores(inst.x); normalizeScores(scores); double[][][] expScores = StaticUtils.exp(scores); double[][] alpha = forward(expScores); // just need likelihood.. so no beta double[][] beta = backward(expScores); double Z = StaticUtils.sum(alpha[inst.x.length - 1]); if (Z == 0 || Double.isNaN(Z) || Double.isInfinite(Z)) { if (numUnnormalizedInstances < 3) { System.err.println("Could not normalize instance (" + Z + "), skipping"); } else if (numUnnormalizedInstances == 3) { System.err.println(" ..."); } numUnnormalizedInstances++; continue; // throw new RuntimeException("can't normalize instance. // Z="+Z); } for (int yt = 0; yt < yAlphabet.size(); yt++) { StaticUtils.plusEquals(modelExpectations, fxy.apply(inst.x, 0, yt, 0), alpha[0][yt] * beta[0][yt] * expScores[0][0][yt] / Z); } for (int t = 1; t < inst.x.length; t++) { for (int ytm1 = 0; ytm1 < yAlphabet.size(); ytm1++) { for (int yt = 0; yt < yAlphabet.size(); yt++) { StaticUtils.plusEquals(modelExpectations, fxy .apply(inst.x, ytm1, yt, t), alpha[t - 1][ytm1] * beta[t][yt] * expScores[t][ytm1][yt] / Z); } } } } for (int i = 0; i < gradient.length; i++) { gradient[i] -= modelExpectations[i]; gradient[i] -= 1 / gaussianPriorVariance * tagger.w[i]; } } public void setParameters(double[] newParameters) { System.arraycopy(newParameters, 0, tagger.w, 0, newParameters.length); } public void getParameters(double[] params) { System.arraycopy(tagger.w, 0, params, 0, params.length); } public int getNumParameters() { return tagger.w.length; } } }
[ "kuzman.ganchev@4abeb2da-2315-11df-909e-81cb1df1a2bf" ]
kuzman.ganchev@4abeb2da-2315-11df-909e-81cb1df1a2bf
fbacc939c6007ae8b3ef24e1344282570f6ede2e
4f35bbec64e19d981356e91a2b13a34a63572bf5
/clippyrotimage/src/test/java/com/anwesome/ui/clippyrotimage/ExampleUnitTest.java
31aa6b7a2494c6de3eeb924ad9de1a172e19c7e1
[]
no_license
Anwesh43/ClippyRotImage
d2a8fc740a7eb5d2dc262a3d1ccd0499f8f24496
cea36aad3d070d5aa67e7dce9557f43f97fed5c5
refs/heads/master
2021-01-23T04:40:45.310513
2017-01-29T20:34:08
2017-01-29T20:34:08
80,370,317
0
0
null
null
null
null
UTF-8
Java
false
false
323
java
package com.anwesome.ui.clippyrotimage; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
ec0f9086b0b223e416e52d0e539a645ace63cdd9
47eb6589828461e109675e8257238b49da89a0b4
/OA/target/classes/com/OuSoft/system/service/Telegant/TelegantService.java
682cba842e61985e17ffab7399a87cb592ea5aff
[]
no_license
wgc199509231270/repo5
f5e6e9749273717dddda6ea0bb2e4852e2d656a5
f673b1f687452a4797522bd29932724e86dc659f
refs/heads/master
2020-05-16T14:58:20.128881
2019-04-23T14:57:14
2019-04-23T14:57:14
183,116,843
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
package com.OuSoft.system.service.Telegant; import com.OuSoft.system.entity.ResponseModel; import com.OuSoft.system.entity.Tactivity; import com.OuSoft.system.entity.Telegant; import java.util.List; public interface TelegantService { //查询岗位信息 List<Telegant> queryElegantService(Telegant telegant); //新增岗位信息 ResponseModel insertElegantService(Telegant telegant); //删除用户岗位信息 ResponseModel deleteElegantByidService(Telegant telegant); //修改用户岗位信息 ResponseModel updateElegantByidService(Telegant telegant); List<Telegant> queryDzTelegantuserRequestService(Telegant telegant); }
2827b202c3716dcdbca0cf8ef294854ee58d748e
0b19a93c295a9ca2a8f85cfdd7eb3e62a7d00bc7
/ROVKP_DZ4/RovkpTask1.java
7aca2d7ac69ec03d93246ba610fe28e62c47cfb7
[]
no_license
teotoplak/rovkp
4f43cd88ac3e9d338c5503002893357bbbeef376
ef0f69d17e0d82de937ce12658bab1ac09f35047
refs/heads/master
2020-03-11T18:45:54.708501
2018-06-15T15:49:24
2018-06-15T15:49:24
130,187,366
0
0
null
null
null
null
UTF-8
Java
false
false
1,572
java
import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Comparator; import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; public class RovkpTask1 { private static final String OUTPUT_FILE = "senesorscope-monitor-all.csv"; public static void main(String[] args) throws IOException { PrintWriter pw = new PrintWriter(Files.newOutputStream(Paths.get(OUTPUT_FILE))); System.out.println("This could take some time, please wait ..."); Files.list(Paths.get("data")) .flatMap(ThrowingFunction.wrap(Files::lines)) .filter(SensorScopeFullRecord::isParsable) .map(line -> new SensorScopeReading(Long.parseLong(line.split("\\s+")[7]),line)) .sorted(Comparator.comparing(SensorScopeReading::getTimestamp)) .map(SensorScopeReading::getFullRecordInCSVFormat) .forEach(pw::println); System.out.println("Finished!"); } @FunctionalInterface public interface ThrowingFunction<T,R> extends Function<T,R> { @Override public default R apply(T t) { try { return throwingApply(t); } catch (Exception e) { throw new RuntimeException(e); } } public static<T,R> Function<T,R> wrap(ThrowingFunction<T,R> f) { return f; } R throwingApply(T t) throws Exception; } }
51024cc23d648777dc46fdc44d2636cb0d190a3c
dc2cd532798e8b3f1477ae17fd363a04a680a710
/docx4j-openxml-objects/src/main/java/org/docx4j/com/microsoft/schemas/office/drawing/x2014/chartex/CTPageSetup.java
9ae905749ee6014b07737ffc619221c5965c9de1
[ "Apache-2.0" ]
permissive
aammar79/docx4j
4715a6924f742e6e921b08c009cb556e1c42e284
0eec2587ab38db5265ce66c12423849c1bea2c60
refs/heads/master
2022-09-15T07:27:19.545649
2022-02-24T22:18:53
2022-02-24T22:18:53
175,789,215
0
0
null
2019-03-15T09:27:09
2019-03-15T09:27:07
null
UTF-8
Java
false
false
7,894
java
package org.docx4j.com.microsoft.schemas.office.drawing.x2014.chartex; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CT_PageSetup complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CT_PageSetup"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;attribute name="paperSize" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" default="1" /&gt; * &lt;attribute name="firstPageNumber" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" default="1" /&gt; * &lt;attribute name="orientation" type="{http://schemas.microsoft.com/office/drawing/2014/chartex}ST_PageOrientation" default="default" /&gt; * &lt;attribute name="blackAndWhite" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt; * &lt;attribute name="draft" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt; * &lt;attribute name="useFirstPageNumber" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt; * &lt;attribute name="horizontalDpi" type="{http://www.w3.org/2001/XMLSchema}int" default="600" /&gt; * &lt;attribute name="verticalDpi" type="{http://www.w3.org/2001/XMLSchema}int" default="600" /&gt; * &lt;attribute name="copies" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" default="1" /&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CT_PageSetup") public class CTPageSetup { @XmlAttribute(name = "paperSize") @XmlSchemaType(name = "unsignedInt") protected Long paperSize; @XmlAttribute(name = "firstPageNumber") @XmlSchemaType(name = "unsignedInt") protected Long firstPageNumber; @XmlAttribute(name = "orientation") protected STPageOrientation orientation; @XmlAttribute(name = "blackAndWhite") protected Boolean blackAndWhite; @XmlAttribute(name = "draft") protected Boolean draft; @XmlAttribute(name = "useFirstPageNumber") protected Boolean useFirstPageNumber; @XmlAttribute(name = "horizontalDpi") protected Integer horizontalDpi; @XmlAttribute(name = "verticalDpi") protected Integer verticalDpi; @XmlAttribute(name = "copies") @XmlSchemaType(name = "unsignedInt") protected Long copies; /** * Gets the value of the paperSize property. * * @return * possible object is * {@link Long } * */ public long getPaperSize() { if (paperSize == null) { return 1L; } else { return paperSize; } } /** * Sets the value of the paperSize property. * * @param value * allowed object is * {@link Long } * */ public void setPaperSize(Long value) { this.paperSize = value; } /** * Gets the value of the firstPageNumber property. * * @return * possible object is * {@link Long } * */ public long getFirstPageNumber() { if (firstPageNumber == null) { return 1L; } else { return firstPageNumber; } } /** * Sets the value of the firstPageNumber property. * * @param value * allowed object is * {@link Long } * */ public void setFirstPageNumber(Long value) { this.firstPageNumber = value; } /** * Gets the value of the orientation property. * * @return * possible object is * {@link STPageOrientation } * */ public STPageOrientation getOrientation() { if (orientation == null) { return STPageOrientation.DEFAULT; } else { return orientation; } } /** * Sets the value of the orientation property. * * @param value * allowed object is * {@link STPageOrientation } * */ public void setOrientation(STPageOrientation value) { this.orientation = value; } /** * Gets the value of the blackAndWhite property. * * @return * possible object is * {@link Boolean } * */ public boolean isBlackAndWhite() { if (blackAndWhite == null) { return false; } else { return blackAndWhite; } } /** * Sets the value of the blackAndWhite property. * * @param value * allowed object is * {@link Boolean } * */ public void setBlackAndWhite(Boolean value) { this.blackAndWhite = value; } /** * Gets the value of the draft property. * * @return * possible object is * {@link Boolean } * */ public boolean isDraft() { if (draft == null) { return false; } else { return draft; } } /** * Sets the value of the draft property. * * @param value * allowed object is * {@link Boolean } * */ public void setDraft(Boolean value) { this.draft = value; } /** * Gets the value of the useFirstPageNumber property. * * @return * possible object is * {@link Boolean } * */ public boolean isUseFirstPageNumber() { if (useFirstPageNumber == null) { return false; } else { return useFirstPageNumber; } } /** * Sets the value of the useFirstPageNumber property. * * @param value * allowed object is * {@link Boolean } * */ public void setUseFirstPageNumber(Boolean value) { this.useFirstPageNumber = value; } /** * Gets the value of the horizontalDpi property. * * @return * possible object is * {@link Integer } * */ public int getHorizontalDpi() { if (horizontalDpi == null) { return 600; } else { return horizontalDpi; } } /** * Sets the value of the horizontalDpi property. * * @param value * allowed object is * {@link Integer } * */ public void setHorizontalDpi(Integer value) { this.horizontalDpi = value; } /** * Gets the value of the verticalDpi property. * * @return * possible object is * {@link Integer } * */ public int getVerticalDpi() { if (verticalDpi == null) { return 600; } else { return verticalDpi; } } /** * Sets the value of the verticalDpi property. * * @param value * allowed object is * {@link Integer } * */ public void setVerticalDpi(Integer value) { this.verticalDpi = value; } /** * Gets the value of the copies property. * * @return * possible object is * {@link Long } * */ public long getCopies() { if (copies == null) { return 1L; } else { return copies; } } /** * Sets the value of the copies property. * * @param value * allowed object is * {@link Long } * */ public void setCopies(Long value) { this.copies = value; } }
8d4614fd292bba583aaca07b7918a3a3c0778689
f3e579ec493bf4384e62af23c1cf9a7898138f43
/gmall-manage-service/src/main/java/com/atguigu/gmall/manage/mapper/AttrBaseInfoMapper.java
f36576c2c6f684ea414c33ed51ff64ab59b8e69f
[]
no_license
liuzhuzhu/gmall-lhd
2d00a535c6db09657b4fae7b3bb9583c66060aaa
a9135802af07c296d5f32561a816e5ff671e960e
refs/heads/master
2022-09-24T07:56:07.717564
2020-11-25T12:18:50
2020-11-25T12:18:50
154,825,700
0
0
null
2022-09-01T22:58:13
2018-10-26T11:43:07
JavaScript
UTF-8
Java
false
false
196
java
package com.atguigu.gmall.manage.mapper; import com.atguigu.gmall.bean.BaseAttrInfo; import tk.mybatis.mapper.common.Mapper; public interface AttrBaseInfoMapper extends Mapper<BaseAttrInfo> { }
8e7bbc8c9884ca19b6fd63fc91f535178bbf4653
1366ab5143a2ea2e4d34dadefe9a67a7b22aa0f0
/app/src/androidTest/java/com/hci/eea/dtp/ExampleInstrumentedTest.java
b7fb15a80e2242cfd642227d7c61a239fb92808a
[]
no_license
anbarisker/Dare-To-Push
52a78e0149aaaee788f5a9f9b63815665a9855ec
76dc19f7a833d1af717dd146cf507ffb7c163b0f
refs/heads/master
2021-08-22T22:17:00.324957
2017-12-01T12:44:46
2017-12-01T12:44:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
734
java
package com.hci.eea.dtp; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.hci.eea.dtp", appContext.getPackageName()); } }
2f505931d798cf0a92a64bf38779df3da47e0ec8
1e0c92c158f288b7f0a354d4ca9468e39e719373
/src/main/java/task_03/mod/Directions.java
8cbb659b75c32ffe4a798a70c22ce0ffd464143b
[]
no_license
MrToady/EJC
3081301f6f92992135bbef579535aa23da448dac
9023da9b49dcdf166f283a9c65a40fed26d65f2a
refs/heads/master
2020-04-05T13:41:23.115331
2017-08-17T08:04:33
2017-08-17T08:04:33
94,976,773
1
0
null
null
null
null
UTF-8
Java
false
false
189
java
package task_03.mod; /** * Contains directions names for creating a new ship {@link task_03.battlefield.Ship} */ public enum Directions { FORWARD, BACKWARD, RIGHT, LEFT, DOWN, UP }
709d563e6ec14e07971c8976e36866a07b820899
f9ffee2b0b06285e6474f0d9974c8428cea04267
/coding-interviews/src/test/java/com/diguage/algorithm/AppTest.java
4a4300325756baffedcc8aaf239a0e14040e4998
[ "Apache-2.0" ]
permissive
diguage/algorithm-books
59e03bc7878470546457e8dc349dcf0863b5f6ad
a8d17e0ded4830d2ca0e0f5adbc67d0939f3e10b
refs/heads/master
2020-03-15T20:53:58.653746
2018-08-22T01:42:00
2018-08-22T01:42:00
132,343,345
2
0
null
null
null
null
UTF-8
Java
false
false
293
java
package com.diguage.algorithm; import static org.junit.Assert.assertTrue; import org.junit.Test; /** * Unit test for simple App. */ public class AppTest { /** * Rigorous Test :-) */ @Test public void shouldAnswerWithTrue() { assertTrue( true ); } }
3562501730bfd62cc86d8fe118e8583c8d9effeb
618f17547f194b0f3a9351edb27c94b1028b45ad
/streams/src/main/java/org/apache/kafka/streams/kstream/KeyValue.java
f633f6e3375325d0c66df2c156dcd91e0d231629
[ "Apache-2.0" ]
permissive
cl9200/kafka
9cb339b6ad232630efe282a7dd9abba2db29ef8a
fa4244745fc363410fd5bc21e0b045f8124a8f9c
refs/heads/trunk
2021-01-22T14:06:07.251675
2015-11-19T01:19:47
2015-11-19T01:19:47
46,484,201
0
0
Apache-2.0
2020-10-25T01:48:08
2015-11-19T10:10:01
Java
UTF-8
Java
false
false
1,140
java
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kafka.streams.kstream; public class KeyValue<K, V> { public final K key; public final V value; public KeyValue(K key, V value) { this.key = key; this.value = value; } public static <K, V> KeyValue<K, V> pair(K key, V value) { return new KeyValue<>(key, value); } }
bb3c308304308bae66792d450ebf1382e76425b6
e3ca535d7e611d66727407bb0332efbb3f439384
/src/com/hightech/manager/DatabaseConnectionChecker.java
3758ace24831d19d0bc91eb1a1a6a7a25ac74b54
[]
no_license
haythamdahri/jsf-employee-tracker
4b875bc21120ae871ec113594963e268c7d30b00
f5c590ac3fe9dc995c2bdf34730dc05dd5b6ba14
refs/heads/master
2020-08-09T19:38:34.013351
2019-10-10T14:14:49
2019-10-10T14:14:49
214,157,024
1
0
null
null
null
null
UTF-8
Java
false
false
1,140
java
package com.hightech.manager; import java.io.PrintWriter; import java.sql.Connection; import javax.annotation.Resource; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; @WebServlet("/dbconnect") public class DatabaseConnectionChecker extends HttpServlet { // Inject DataSource instance @Resource(name = "jdbc/employe_tracker") private DataSource dataSource; @Override public void service(HttpServletRequest request, HttpServletResponse response) { Connection connection = null; PrintWriter writer = null; try { writer = response.getWriter(); response.setContentType("text/plain"); connection = this.dataSource.getConnection(); if( connection != null ) { writer.println("Database connection has been established successfully!"); } else { throw new Exception("An error occurred, error establishing database connection!"); } connection.close(); writer.close(); } catch(Exception ex) { writer.println(ex.getMessage()); } } }
df6df9aa01cd548e90fd7593696bc699c4b54caa
749746b2cfc20b2b71ee44fe869ad4367c754e0b
/HRServer/src/main/java/com/example/demo/controller/HRLoginController.java
6f3c7d9610096dd0afc9c94cce96985c6883b3fc
[]
no_license
kavya-amin/Project
90153909f6430498627fa05d4b2b068d1890a5eb
29e5fddac0507ad155bd60c3b8f503fbc7b21b8e
refs/heads/master
2020-09-06T23:46:24.324045
2019-12-16T05:40:31
2019-12-16T05:40:31
220,592,234
0
0
null
null
null
null
UTF-8
Java
false
false
3,071
java
package com.example.demo.controller; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.MailException; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.example.demo.component.User; import com.example.demo.entity.HR; import com.example.demo.service.HRLoginService; import com.example.demo.service.MailService; @CrossOrigin(origins = "http://localhost:4200") @RestController @RequestMapping(value= "/api/**", method=RequestMethod.OPTIONS) public class HRLoginController { @Autowired HRLoginService service; @Autowired private MailService notificationService; public void corsHeaders(HttpServletResponse response) { response.addHeader("Access-Control-Allow-Origin", "*"); response.addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"); response.addHeader("Access-Control-Allow-Headers", "origin, content-type, accept, x-requested-with"); response.addHeader("Access-Control-Max-Age", "3600"); } @PostMapping("/create-hr") public HR createHr(@RequestBody HR hr) { return service.createHR(hr); } @RequestMapping("/send-mail") public String send(@RequestBody HR hr) { System.out.println("controller called"); //user.setEmailAddress(hr.getUseremail()); //Receiver's email address try { notificationService.sendEmail(hr); } catch (MailException mailException) { System.out.println(mailException); } return "Congratulations! Mail has been send to the given mail id to reset password."; } @RequestMapping("/send-mail-user") public String sendToUser(@RequestBody User user) { try { notificationService.sendEmailTo(user.getEmailAddress()); }catch (MailException mailException) { System.out.println(mailException); } return "Congratulations! Your mail has been send to the user."; } @RequestMapping(method = RequestMethod.POST, value = "/login") HR verifyUser(@RequestBody HR hr ) { System.out.println("entered controller"); return service.verifyUser(hr.getUserEmail(),hr.getUserPassword()); } @GetMapping(path="/hrDetails/all") public @ResponseBody Iterable<HR> getAllHR() { System.out.println("url hit for all"); return service.getAllHR(); } @RequestMapping(method = RequestMethod.PUT, value = "/updateHR") void updateHR(@RequestBody HR hr) { System.out.println(hr); service.updateHR(hr); } }
adb7eac6ba2d01d1ed31679b4b8e0c33f56c8415
1a773a3603988e533c150b6e85d6ed1b55c89e5d
/JavaExercises/sujin/datastructure_book/Ch5_p194_prac9_EightQueen.java
cbdea61de0f7827183ea6c800b8b77cb26d896ce
[]
no_license
sujinlee0616/Algorithm
dedbc75fedc63b114a42dd2f5964c9ca25935e5b
71bc1b46344300c75d25ae2b8e507ef78a1695dc
refs/heads/master
2023-02-15T07:48:29.486325
2021-01-11T22:05:21
2021-01-11T22:05:21
225,889,288
0
3
null
2020-09-03T12:30:02
2019-12-04T14:43:14
Java
UTF-8
Java
false
false
1,075
java
package datastructure_book; public class Ch5_p194_prac9_EightQueen { static boolean[] flag_a=new boolean[8]; // 각 행에 퀸을 배치했는지 체크 static boolean[] flag_b=new boolean[15]; // '/' 대각선 방향으로 퀸을 배치했는지 체크 static boolean[] flag_c=new boolean[15]; // '\' 대각선 방향으로 퀸을 배치했는지 체크 static int[] pos=new int[8]; // 각 열의 퀸의 위치를 출력 static void print() { for(int i=0;i<8;i++) System.out.printf("%2d",pos[i]); System.out.println(); } // i열의 알맞은 위치에 퀸을 배치 static void set(int i) { for(int j=0;j<8;j++) { if(flag_a[j]==false && // 가로(j행)에 아직 배치 X flag_b[i+j]==false && // 대각선 '/'에 아직 배치 X flag_c[i-j+7]==false) { // 대각선 '\'에 아직 배치 X pos[i]=j; if(i==7) print(); else { flag_a[j]=flag_b[i+j]=flag_c[i-j+7]=true; set(i+1); flag_a[j]=flag_b[i+j]=flag_c[i-j+7]=false; } } } } public static void main(String[] args) { set(0); } }
b654760050b3c44f6a077633aabd6d129e06232c
6083c8f96827771d013e4c2a590c6cbfd1b52dab
/src/home_xml/dom_xml.java
f14d790d4289a2c7a2b6817efcd32f252e7f40f8
[]
no_license
lxy7/XML
9662b97ab916bbb9823529bd23b54aef10859100
fa7e4c88b3a7f821e9a536ac7fc746a6a15ce8a5
refs/heads/master
2021-08-19T19:59:55.578433
2017-11-27T09:30:03
2017-11-27T09:30:03
112,174,953
0
0
null
null
null
null
GB18030
Java
false
false
2,312
java
/** * */ package home_xml; import java.io.IOException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; /** * @author Lxy E-mail:[email protected] * @version 创建时间:2017年10月13日下午5:57:27 * 类说明 */ public class dom_xml { /** * @param args */ public static void main(String[] args) { try { DocumentBuilderFactory bdf = DocumentBuilderFactory.newInstance();//首先创建一个DocementBu DocumentBuilder db = bdf.newDocumentBuilder();//获得一个 DocumentBuilder对象 Document document = db.parse("book.xml");//DocumentBuilder的parse方法获取路径文件 NodeList bl = document.getElementsByTagName("book");//获得xml文件内容 System.out.println("一共有:"+bl.getLength()+"本书"); for(int i = 0; i < bl.getLength(); i++){ System.out.println("*****开始对"+(i+1)+"本书进行遍历,获取他们的基本属性"); Node b = (Node) bl.item(i);//通过item()方法对NodeList集合获取内容 Element b_da = (Element)bl.item(i); String atrrid =b_da.getAttribute("id"); System.out.println("id的属性的值是:"+atrrid); String atrr_ty =b_da.getAttribute("type"); System.out.println("type的属性的值是:"+atrr_ty); NodeList b_daList = b.getChildNodes(); //System.out.println("子节点的值是:"+b_daList.getLength()); for (int k = 0; k < b_daList.getLength(); k++) { if(b_daList.item(k).getNodeType() == Node.ELEMENT_NODE) { System.out.println("节点名为:" + b_daList.item(k).getNodeName()); System.out.println("节点值为:" + b_daList.item(k).getFirstChild().getNodeValue()); } } System.out.println("结束遍历"+(i+1)+"本书的信息"); } } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
9ebdc675b920377c21fbecdd37d0f019e6ae8348
cf456fe3605e7aa02d111f23463bf637991acad2
/app/src/main/java/exploringpsyche/com/helloworld/ImageAdapter.java
a27450826ad6708231848ff10a5299d9cf9d806e
[]
no_license
fahadtahir/BoostThyself
67c1c4b27de8443c03daea506629c5905ff48c39
30d794709949b95b979934054d038bfbbcd07f5b
refs/heads/master
2021-01-01T06:15:17.021306
2017-07-16T16:05:48
2017-07-16T16:05:48
97,394,134
0
0
null
null
null
null
UTF-8
Java
false
false
1,595
java
package exploringpsyche.com.helloworld; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { mContext = c; } public int getCount() { return mThumbIds.length; } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { // if it's not recycled, initialize some attributes imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(400, 400)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(25, 25, 25, 25); } else { imageView = (ImageView) convertView; } imageView.setImageResource(mThumbIds[position]); return imageView; } // references to our images private Integer[] mThumbIds = { R.drawable.smiley3, R.drawable.smiley1, R.drawable.smiley2, R.drawable.horrified, R.drawable.smiley2, R.drawable.horrified, R.drawable.smiley2, R.drawable.horrified, R.drawable.smiley2, R.drawable.horrified, R.drawable.smiley2, R.drawable.horrified, }; }
2cff4e307bf0ccf6d6fb80c608766deb39d5745a
feb41122d53384291403203c2904e571637e8713
/src/main/java/com/cncg/service/UserService.java
e93c1faf465ca1bfb518b2de9bff3b48858894f2
[]
no_license
chencong1993/cncg
b801c0a813557244e163aef42be1b07645fd7c58
163207e145290b4d2657deb6c02e849b8b79e7db
refs/heads/master
2020-03-22T13:45:08.618404
2019-01-10T10:04:33
2019-01-10T10:04:49
140,129,438
0
0
null
null
null
null
UTF-8
Java
false
false
454
java
package com.cncg.service; import java.util.List; import java.util.Map; import com.cncg.entity.User; /** * 用户Service接口 * @author Administrator * */ public interface UserService extends BaseService<User>{ /** * 用户登录 * @param user * @return */ public User login(User user); /** * 判断用户名重复 * @param user * @return */ public List<User> findRepeatUserName(User user); }
1398eb559a464e91dd6890e43fd99e961b64ab7b
8bbc6e7e6bca1d04ca22eb3161fec668182f83eb
/racing_manager/src/racingmanager/NickJaExisteException.java
522783ae395d15bd4d3ec36727a1b38021a42644
[]
no_license
tiagoalexandresilva/Racing-Manager-Project
1c1d30d62ae30377457bfb08a01a2761989edc87
69f6c7f24fe8a13be30ed3b78d15cd3085b44226
refs/heads/master
2021-01-01T17:27:36.901330
2014-05-11T19:12:33
2014-05-11T19:12:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package racingmanager; public class NickJaExisteException extends Exception { public NickJaExisteException(){super();} public NickJaExisteException(String palavra){super(palavra);} }
92fd00ce5fceec53906979e346d392197bd1dc68
53c9ad7597e0a32d993b72a93323ed318b67096b
/app/src/main/java/study/sang/androidbasestudy/bean/ClickItem.java
3a163bc27ab517258ac4e055b669d2fa6cfb638c
[]
no_license
sangxiaonian/AndroidBaseStudy
7a49956ce2469cfaeab05a3916751b097a0e4708
0badf62195ceccd948723bc0da8bc030071893e0
refs/heads/master
2021-01-17T15:56:39.055755
2016-11-04T01:26:40
2016-11-04T01:26:40
56,057,516
0
0
null
null
null
null
UTF-8
Java
false
false
202
java
package study.sang.androidbasestudy.bean; /** * Description: * * @Author:桑小年 * @Data:2016/6/14 16:44 */ public class ClickItem { public String title; public boolean isClick; }
02a77229f1c8cd9da32ab20ab475be8e12c0094e
be568882c7ffa242b8a65e977cc2a501314c9796
/goodsOwner/src/main/java/com/gpw/app/view/BaseRefreshHeader.java
8a29d3c7830749a37f60027878ec086777662360
[]
no_license
LFengYe/WorkProject
9a112b14e3039e78eea2e408e9981dd5bb3d499d
0bbc2b99211643368d2c661c1cd96ff1b707f043
refs/heads/master
2020-11-29T12:09:58.069527
2017-04-07T02:45:01
2017-04-07T02:45:01
87,494,404
0
0
null
null
null
null
UTF-8
Java
false
false
281
java
package com.gpw.app.view; interface BaseRefreshHeader { int STATE_NORMAL = 0; int STATE_RELEASE_TO_REFRESH = 1; int STATE_REFRESHING = 2; int STATE_DONE = 3; void onMove(float delta); boolean releaseAction(); void refreshComplete(String state); }
0dd9ae1f2c5d9cb5f934885ef5d4c9528b78a681
30079b79a27c9cd9decd2014f655387e012bfd1c
/src/main/java/com/yxy/nova/mwh/kafka/consumer/IConsumer.java
8ead180df9b37b6e352db7fc825a8d00a27677e1
[ "MIT" ]
permissive
githubyxy/nova
e13b0ef80d65d1e1b2380d62971a1f7ae707e89e
493494d6a3e2741259430334a421c79a6b18a095
refs/heads/master
2023-08-22T03:38:24.252701
2023-08-19T02:20:35
2023-08-19T02:20:35
193,431,203
0
0
MIT
2023-04-14T18:04:02
2019-06-24T04:02:38
Java
UTF-8
Java
false
false
756
java
package com.yxy.nova.mwh.kafka.consumer; import org.apache.kafka.clients.consumer.ConsumerRecord; import java.util.List; /** * 具备at-least-once语义特征的消费者 * * 可能会有重复消息,业务需要自行保证幂等 * */ public interface IConsumer { /** * 业务消费 * * 注意!!该方法可能会被多个线程调用,业务需要自行保证线程安全 * * 该方法不得抛异常!!!请在方法内部自行处理所有异常!!! * * 一旦方法返回,系统将认定这一批消息已经处理完毕 * * @param messages 系统保证本次调用data数据均属于同一个partition下 * */ void doConsume(final List<ConsumerRecord<String, byte[]>> messages); }
fb9971fe44446f18a21c208d65d68eb288e77088
65bbb9fd74d1b9be0c35888571c7c5551b68963e
/src/sample/classes/Département.java
a32fe822736e8bec7baea315f4c3684d280b0693
[]
no_license
djamel2288/mapping_univ
c1fb59494440b857beba7d79f39dd3f2d76343ec
b5b62f7dde7b37cb7a757fda7d1e186a70c1e4a6
refs/heads/master
2020-09-11T16:25:32.007969
2019-11-16T16:09:11
2019-11-16T16:09:11
222,124,906
0
0
null
null
null
null
UTF-8
Java
false
false
367
java
package sample.classes; import java.util.List; public class Département { private String dep; private Enseignant ens; private List<Enseignant> enseignant; public Département(String dep) { this.dep = dep; } public String getDep() { return dep; } public void setDep(String dep) { this.dep = dep; } }
e68c47deebae2eb151a84125c85ac4f7bcd8f625
f19d19d8bb68c0f34beef8b84e78a8af66c355a6
/app/src/main/java/com/pagatodoholdings/posandroid/secciones/acquiring/pairing/DevicePairingFragment.java
cc2ba107696ff5888959fdeab4e92609b1bb470f
[]
no_license
Samm070919/test-integration-cb
b1b8e44deab1fa1d2d4664c71972efd901a6a648
819eab367b77827c37487b52695bae895dbc301b
refs/heads/master
2023-02-04T07:14:17.131759
2020-12-17T23:38:03
2020-12-17T23:38:03
322,400,160
0
0
null
null
null
null
UTF-8
Java
false
false
1,670
java
package com.pagatodoholdings.posandroid.secciones.acquiring.pairing; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.databinding.DataBindingUtil; import com.pagatodoholdings.posandroid.R; import com.pagatodoholdings.posandroid.databinding.FragmentConfigMenuConfiguracionSubVincularBinding; import com.pagatodoholdings.posandroid.secciones.acquiring.support.TemplateFragment; import com.pagatodoholdings.posandroid.secciones.home.HomeActivity; public class DevicePairingFragment extends TemplateFragment<FragmentConfigMenuConfiguracionSubVincularBinding> { public static DevicePairingFragment newInstance(){ return new DevicePairingFragment(); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { binding = DataBindingUtil.inflate(inflater, R.layout.fragment_config_menu_configuracion_sub_vincular,container,false); init(); return binding.getRoot(); } @Override public void init() { homeActivity.setTitle(""); homeActivity.setSubtitle(""); // homeActivity.hideToolbar(); homeActivity.hideBackButton(); } @Override public void setListener(HomeActivity homeActivity) { this.homeActivity = homeActivity; } @Override protected boolean isTomandoBack() { return false; } @Override public void onFailure(Throwable throwable) { //No implementation } }
fea61b104988b8fb848dbdfd50317d5799c325d2
06ecc5765bd9631ba23da95bc529ecdcba265205
/src/main/java/stepDefinition/DealStepWithMapDefinition.java
c566933b2605d3449f34a0c57bc8482d5d9dc83e
[]
no_license
suhag7799/BDDCucumber
7af45f2a285378d58c49d9dd95d0b4ead020b775
5296eb5fc72e7ceb7c3ce06f7a3ba327a33c0b2e
refs/heads/main
2023-02-05T17:41:57.280569
2020-12-25T21:39:34
2020-12-25T21:39:34
324,430,404
0
0
null
null
null
null
UTF-8
Java
false
false
3,429
java
package stepDefinition; import java.util.List; import java.util.Map; import org.junit.Assert; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; import cucumber.api.DataTable; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; // Data table with maps: for parameterization of test cases public class DealStepWithMapDefinition { WebDriver driver; @Given("^user is already on login page$") public void user_already_on_login_page() { System.setProperty("webdriver.chrome.driver", "C:\\SeleniumJars\\chromedriver.exe"); driver = new ChromeDriver(); driver.get("https://classic.crmpro.com/"); } @When ("^title for login page is Free CRM$") public void title_for_login_page_is_Free_CRM() { String title = driver.getTitle(); System.out.println(title); Assert.assertEquals("CRMPRO - CRM software for customer relationship management, sales, and support.", title); } @Then("^user enters username and password$") public void user_enters_username_and_password(DataTable credentials) { for (Map<String, String> data : credentials.asMaps(String.class, String.class)) { driver.findElement(By.name("username")).sendKeys(data.get("username")); driver.findElement(By.name("password")).sendKeys(data.get("password")); } } @Then("^user click on login button$") public void user_click_on_login_button() { driver.findElement(By.xpath("//input[@value='Login']")).click(); } @Then("^user is on home page$") public void user_is_on_home_page() { String title = driver.getTitle(); System.out.println("home page title------"+title); Assert.assertEquals("CRMPRO", title); // driver.quit(); } @Then("^user move to new deal page$") public void user_move_to_new_deal_page() { driver.switchTo().frame("mainpanel"); Actions action = new Actions(driver); action.moveToElement(driver.findElement(By.xpath("//a[contains(text(),'Deals')]"))).build().perform(); System.out.println("move over finished"); driver.findElement(By.xpath("//a[contains(text(),'New Deal')]")).click(); } @Then("^user enters deal details title and amount$") public void user_enters_firstname_lastname_position(DataTable dealData) { for (Map<String, String> data : dealData.asMaps(String.class, String.class)) { driver.findElement(By.id("title")).sendKeys(data.get("title")); driver.findElement(By.id("amount")).sendKeys(data.get("amount")); driver.findElement(By.id("probability")).sendKeys(data.get("probability")); driver.findElement(By.id("commission")).sendKeys(data.get("comission")); System.out.println("NAme entered"); driver.findElement(By.xpath("//input[@type='submit' and @value='Save']")).click(); // ---- move back to new deal page Actions action = new Actions(driver); action.moveToElement(driver.findElement(By.xpath("//a[contains(text(),'Deals')]"))).build().perform(); System.out.println("move over finished"); driver.findElement(By.xpath("//a[contains(text(),'New Deal')]")).click(); } } @Then("^Close the browser$") public void close_the_browser() throws InterruptedException { Thread.sleep(10000); driver.quit(); } }
152c7315c8486a0aaf1f7c34a0c09fdd71e880c3
9c88629748ef807198a5ade2cbb4cae3c94ce08c
/app/src/main/java/com/amplitude/tron/volksradio30/fraggenre/StreamGenreInformation.java
15958251bc174739a4cf0e0677ff9be9ec988ca8
[]
no_license
Quantron7t/Volksradio3.0
d93efc1f617198e2e2a4286a4e2be6f90cefc903
7b1dd09bf3c8b607aec2c78441d2f0533c6be546
refs/heads/master
2020-12-31T00:00:29.967951
2017-10-09T15:19:50
2017-10-09T15:19:50
86,581,729
1
0
null
null
null
null
UTF-8
Java
false
false
2,241
java
package com.amplitude.tron.volksradio30.fraggenre; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import com.amplitude.tron.volksradio30.R; import com.amplitude.tron.volksradio30.VolksActivity; import com.amplitude.tron.volksradio30.datapopular.RadioDataHessischenRundfunks; /** * Created by Tron on 1/30/2017. */ public class StreamGenreInformation extends Fragment { View rootView; ImageView backOutButton; LinearLayout LStreamOne,LStreamTwo; public StreamGenreInformation(){} @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.stream_genre_information, container, false); ((VolksActivity)getActivity()).disableLayoutButton(); backOutButton = (ImageView) rootView.findViewById(R.id.btn_back_out); backOutButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ((VolksActivity)getActivity()).enableLayoutButton(); getActivity().getSupportFragmentManager().popBackStack(); } }); LStreamOne=(LinearLayout) rootView.findViewById(R.id.streamOneLayout); LStreamOne.setOnClickListener(pushRadioData); LStreamTwo=(LinearLayout) rootView.findViewById(R.id.streamTwoLayout); LStreamTwo.setOnClickListener(pushRadioData); return rootView; } private View.OnClickListener pushRadioData = new View.OnClickListener() { public void onClick(View v) { switch (v.getId()) { case R.id.streamOneLayout: new RadioDataHessischenRundfunks().pushStreamOne(getActivity().getApplicationContext()); break; case R.id.streamTwoLayout: new RadioDataHessischenRundfunks().pushStreamTwo(getActivity().getApplicationContext()); break; } } }; }
8c6cd8ddd7d8de34fde3f5a2099180cad1a4dc15
e8de61a85407c594cc34e9bee0893ee1306e015e
/Genetic Algorithm CEC2013/src/fitness/ChangeFitness.java
21cccc395e320b53c8fea7fc0c3ce1f4077626c3
[ "Apache-2.0" ]
permissive
hernan940730/EvolutionaryComputation
080740b9af20d6815ffe8296f32fced260eb931c
59b959b37e27849260e4745c491a7d8cca137a63
refs/heads/master
2021-01-10T10:43:23.990652
2016-01-20T23:53:10
2016-01-20T23:53:10
50,064,452
0
0
null
null
null
null
UTF-8
Java
false
false
2,228
java
package fitness; import util.StdRandom; import individual.DoubleIndividual; import individual.Individual; public class ChangeFitness implements FitnessFunction { private int numVariables = 1; private double constraintMin = -100; private double constraintMax = 100; private int calls = 0; private int fun = 0; @Override public double fitness(Individual variables) { double []x = (double[])variables.getValues(); if( calls % 100 == 0 ){ fun = ( fun + 1 ) % 3; } double ret = 0; switch( fun ){ case 0: ret = (x[0]*x[0]) +x[0] + 3; break; case 1: ret = (x[0]*x[0]*x[0]) - (2 * x[0] * x[0]) + 3; break; default: ret = (x[0] * x[0]) - (3 * x[0]) + 2; break; } return ret; } @Override public void constraintSuccess(Individual variables) { double[] var = ( double[] )variables.getValues(); boolean isChanged = false; for ( int i = 0; i < var.length; i++ ) { if( Double.isNaN(var[i]) ){ isChanged = true; var[i] = 0; } else if( Double.isInfinite( var[i] ) ){ isChanged = true; if( var[i] > 0 ){ var[i] = constraintMax; } else{ var[i] = constraintMin; } } else if( var[i] > constraintMax ){ isChanged = true; var[i] = constraintMax; } else if( var[i] < constraintMin ){ isChanged = true; var[i] = constraintMin; } } if( isChanged ){ variables.setValues( var ); } } private DoubleIndividual rndValues(){ DoubleIndividual ind; double[] values = new double[numVariables]; for (int i = 0; i < values.length; i++) { values[i] = StdRandom.uniform( constraintMin, constraintMax ); } ind = new DoubleIndividual( values ); return ind; } @Override public Individual[] initialize(int lambda) { Individual individuals[] = new DoubleIndividual[lambda]; for( int i = 0; i < individuals.length; i++ ){ individuals[i] = rndValues(); double par[] = individuals[i].getParameters(); par[Individual.DELTA] = constraintMax/100.0; individuals[i].setParameters(par); } return individuals; } @Override public int callsNumber() { calls++; return calls; } @Override public double getConstraintMax() { return constraintMax; } }
22ecff8949ff17c3129c9a46c00c3832be6c917a
1078c29205fd520514131545271dd95e881f01c1
/src/main/java/com/prostate/assessmen/mapper/pra/read/PatientAssessmentReadMapper.java
f95a66538fc0667280801330c6959971f944be13
[]
no_license
ProstateRehabilitationAlliance/AssessmenServer
43ed94e4494d8532f80e14627dbf1004fd77d12e
d81998c343a02d4d11718e86d2335b9cceed37c5
refs/heads/master
2020-03-11T13:45:05.669729
2018-08-14T09:55:59
2018-08-14T09:55:59
130,033,838
0
0
null
null
null
null
UTF-8
Java
false
false
513
java
package com.prostate.assessmen.mapper.pra.read; import com.prostate.assessmen.entity.PatientAssessment; import com.prostate.assessmen.mapper.BaseReadMapper; import java.util.List; public interface PatientAssessmentReadMapper extends BaseReadMapper<PatientAssessment> { PatientAssessment selectById(PatientAssessment patientAssessment); List<PatientAssessment> selectByPatientId(PatientAssessment patientAssessment); PatientAssessment selectLastByPatientId(PatientAssessment patientAssessment); }
3492ce447bda79911ba1343d6fa286ce12be2d1f
84a8930f0fe7cf8e8829ea8dfcd2384581a0f1c9
/app/src/main/java/com/codepath/apps/restclienttemplate/TweetsAdapter.java
82e2ef1fc000fdfca9607d42f380a5513d02a976
[ "Apache-2.0", "MIT" ]
permissive
sdeppe/SimpleTweet
6e2e0938f368e1fd7c3efb74b693457943bc578b
ffe0eba84bad932549ee71250c6556e3215cc265
refs/heads/master
2022-12-29T17:26:34.903714
2020-10-17T23:51:26
2020-10-17T23:51:26
302,509,910
0
0
null
null
null
null
UTF-8
Java
false
false
2,425
java
package com.codepath.apps.restclienttemplate; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.codepath.apps.restclienttemplate.models.Tweet; import java.util.List; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; public class TweetsAdapter extends RecyclerView.Adapter<TweetsAdapter.ViewHolder> { Context context; List<Tweet> tweets; // Pass in the context and list of tweets public TweetsAdapter(Context context, List<Tweet> tweets) { this.context = context; this.tweets = tweets; } // For each row, inflate the layout @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(context).inflate(R.layout.item_tweet, parent, false); return new ViewHolder(view); } // Bind values based on the position of the element @Override public void onBindViewHolder(@NonNull ViewHolder holder, int position) { // Get the data at position Tweet tweet = tweets.get(position); // Bind the tweet with the view holder holder.bind(tweet); } @Override public int getItemCount() { return tweets.size(); } // Clean all elements of the recycler public void clear() { tweets.clear(); notifyDataSetChanged(); } // Add a list of items public void addAll(List<Tweet> tweetList) { tweets.addAll(tweetList); notifyDataSetChanged(); } // Define a viewholder public class ViewHolder extends RecyclerView.ViewHolder { ImageView ivProfileImage; TextView tvBody; TextView tvScreenName; public ViewHolder(@NonNull View itemView) { super(itemView); ivProfileImage = itemView.findViewById(R.id.ivProfileImage); tvBody = itemView.findViewById(R.id.tvBody); tvScreenName = itemView.findViewById(R.id.tvScreenName); } public void bind(Tweet tweet) { tvBody.setText(tweet.body); tvScreenName.setText(tweet.user.screenName); Glide.with(context).load(tweet.user.profileImageUrl).into(ivProfileImage); } } }
279f5c68748c57b79bed0a3265843e1df3129432
3d61b2db312ef9ec33de3b8a661847dcd5cfb222
/gen/com/google/android/gms/R.java
60356d7127b80a8be9a4f9849935abb46904d677
[]
no_license
abhpan91/mapme
fce3f6875223958ad770c549b916615fc156e62a
5148023b65d55a87f6609c184acd4f1c54903ff8
refs/heads/master
2021-01-18T14:02:13.605943
2013-03-16T10:14:34
2013-03-16T10:14:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
22,185
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.google.android.gms; public final class R { public static final class array { public static final int list=0x7f070000; public static final int lvalues=0x7f070001; public static final int tosearch=0x7f070002; public static final int tosearchvalues=0x7f070003; } public static final class attr { /** <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int cameraBearing=0x7f010001; /** <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int cameraTargetLat=0x7f010002; /** <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int cameraTargetLng=0x7f010003; /** <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int cameraTilt=0x7f010004; /** <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int cameraZoom=0x7f010005; /** <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>none</code></td><td>0</td><td></td></tr> <tr><td><code>normal</code></td><td>1</td><td></td></tr> <tr><td><code>satellite</code></td><td>2</td><td></td></tr> <tr><td><code>terrain</code></td><td>3</td><td></td></tr> </table> */ public static final int mapType=0x7f010000; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int uiCompass=0x7f010006; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int uiRotateGestures=0x7f010007; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int uiScrollGestures=0x7f010008; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int uiTiltGestures=0x7f010009; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int uiZoomControls=0x7f01000a; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int uiZoomGestures=0x7f01000b; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int useViewLifecycle=0x7f01000c; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int zOrderOnTop=0x7f01000d; } public static final class drawable { public static final int ic_action_search=0x7f020000; public static final int ic_launcher=0x7f020001; } public static final class id { public static final int MAPme=0x7f050005; public static final int aboutus=0x7f050006; public static final int map=0x7f050004; public static final int none=0x7f050000; public static final int normal=0x7f050001; public static final int prefrences=0x7f050007; public static final int satellite=0x7f050002; public static final int terrain=0x7f050003; } public static final class layout { public static final int aboutus=0x7f030000; public static final int activity_mapme=0x7f030001; public static final int dialog=0x7f030002; } public static final class menu { public static final int activity_mapme=0x7f090000; } public static final class string { public static final int app_name=0x7f06000b; /** Button in confirmation dialog to enable Google Play services. Clicking it will direct user to application settings of Google Play services where they can enable it [CHAR LIMIT=30] */ public static final int common_google_play_services_enable_button=0x7f060006; /** Message in confirmation dialog informing user they need to enable Google Play services in application settings [CHAR LIMIT=NONE] */ public static final int common_google_play_services_enable_text=0x7f060005; /** Title of confirmation dialog informing user they need to enable Google Play services in application settings [CHAR LIMIT=40] */ public static final int common_google_play_services_enable_title=0x7f060004; /** Button in confirmation dialog for installing Google Play services [CHAR LIMIT=30] */ public static final int common_google_play_services_install_button=0x7f060003; /** (For phones) Message in confirmation dialog informing user that they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] */ public static final int common_google_play_services_install_text_phone=0x7f060001; /** (For tablets) Message in confirmation dialog informing user that they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] */ public static final int common_google_play_services_install_text_tablet=0x7f060002; /** Title of confirmation dialog informing user that they need to install Google Play services (from Play Store) [CHAR LIMIT=40] */ public static final int common_google_play_services_install_title=0x7f060000; /** Message in confirmation dialog informing user there is an unknow issue in Google Player services [CHAR LIMIT=NONE] */ public static final int common_google_play_services_unknown_issue=0x7f060009; /** Button in confirmation dialog for updating Google Play services [CHAR LIMIT=20] */ public static final int common_google_play_services_update_button=0x7f06000a; /** Message in confirmation dialog informing user that they need to update Google Play services (from Play Store) [CHAR LIMIT=NONE] */ public static final int common_google_play_services_update_text=0x7f060008; /** Title of confirmation dialog informing user that they need to update Google Play services (from Play Store) [CHAR LIMIT=40] */ public static final int common_google_play_services_update_title=0x7f060007; public static final int hello_world=0x7f06000c; public static final int menu_settings=0x7f06000d; public static final int title_activity_mapme=0x7f06000e; } public static final class style { public static final int AppTheme=0x7f080000; } public static final class xml { public static final int viewprefrence=0x7f040000; } public static final class styleable { /** Attributes that can be used with a MapAttrs. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #MapAttrs_cameraBearing com.abhishekbietcs.locomap:cameraBearing}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_cameraTargetLat com.abhishekbietcs.locomap:cameraTargetLat}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_cameraTargetLng com.abhishekbietcs.locomap:cameraTargetLng}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_cameraTilt com.abhishekbietcs.locomap:cameraTilt}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_cameraZoom com.abhishekbietcs.locomap:cameraZoom}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_mapType com.abhishekbietcs.locomap:mapType}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_uiCompass com.abhishekbietcs.locomap:uiCompass}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_uiRotateGestures com.abhishekbietcs.locomap:uiRotateGestures}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_uiScrollGestures com.abhishekbietcs.locomap:uiScrollGestures}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_uiTiltGestures com.abhishekbietcs.locomap:uiTiltGestures}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_uiZoomControls com.abhishekbietcs.locomap:uiZoomControls}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_uiZoomGestures com.abhishekbietcs.locomap:uiZoomGestures}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_useViewLifecycle com.abhishekbietcs.locomap:useViewLifecycle}</code></td><td></td></tr> <tr><td><code>{@link #MapAttrs_zOrderOnTop com.abhishekbietcs.locomap:zOrderOnTop}</code></td><td></td></tr> </table> @see #MapAttrs_cameraBearing @see #MapAttrs_cameraTargetLat @see #MapAttrs_cameraTargetLng @see #MapAttrs_cameraTilt @see #MapAttrs_cameraZoom @see #MapAttrs_mapType @see #MapAttrs_uiCompass @see #MapAttrs_uiRotateGestures @see #MapAttrs_uiScrollGestures @see #MapAttrs_uiTiltGestures @see #MapAttrs_uiZoomControls @see #MapAttrs_uiZoomGestures @see #MapAttrs_useViewLifecycle @see #MapAttrs_zOrderOnTop */ public static final int[] MapAttrs = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d }; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#cameraBearing} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:cameraBearing */ public static final int MapAttrs_cameraBearing = 1; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#cameraTargetLat} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:cameraTargetLat */ public static final int MapAttrs_cameraTargetLat = 2; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#cameraTargetLng} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:cameraTargetLng */ public static final int MapAttrs_cameraTargetLng = 3; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#cameraTilt} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:cameraTilt */ public static final int MapAttrs_cameraTilt = 4; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#cameraZoom} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a floating point value, such as "<code>1.2</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:cameraZoom */ public static final int MapAttrs_cameraZoom = 5; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#mapType} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>none</code></td><td>0</td><td></td></tr> <tr><td><code>normal</code></td><td>1</td><td></td></tr> <tr><td><code>satellite</code></td><td>2</td><td></td></tr> <tr><td><code>terrain</code></td><td>3</td><td></td></tr> </table> @attr name android:mapType */ public static final int MapAttrs_mapType = 0; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#uiCompass} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:uiCompass */ public static final int MapAttrs_uiCompass = 6; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#uiRotateGestures} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:uiRotateGestures */ public static final int MapAttrs_uiRotateGestures = 7; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#uiScrollGestures} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:uiScrollGestures */ public static final int MapAttrs_uiScrollGestures = 8; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#uiTiltGestures} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:uiTiltGestures */ public static final int MapAttrs_uiTiltGestures = 9; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#uiZoomControls} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:uiZoomControls */ public static final int MapAttrs_uiZoomControls = 10; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#uiZoomGestures} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:uiZoomGestures */ public static final int MapAttrs_uiZoomGestures = 11; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#useViewLifecycle} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:useViewLifecycle */ public static final int MapAttrs_useViewLifecycle = 12; /** <p>This symbol is the offset where the {@link com.abhishekbietcs.locomap.R.attr#zOrderOnTop} attribute's value can be found in the {@link #MapAttrs} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:zOrderOnTop */ public static final int MapAttrs_zOrderOnTop = 13; }; }
8ae9391ba28fa69475a19eaa6735e66d929818ad
3c14b7f9c6647c5706220c24463bca9aa8f3b283
/app/src/main/java/com/example/pokemon/Pokemon.java
6e84412415e026afbf22f3a0be7bf921a430b8f9
[]
no_license
princyvahora/Pokemon
51d1f110184502ea6653acd562faa0e8d17a8016
f52dec36e95dd89757e4a632dbd0c2d61fbc56f1
refs/heads/master
2021-01-07T18:05:57.921245
2020-02-20T02:46:29
2020-02-20T02:46:29
241,777,556
0
0
null
null
null
null
UTF-8
Java
false
false
2,445
java
package com.example.pokemon; import android.os.Parcel; import android.os.Parcelable; public class Pokemon implements Parcelable { String name,image,type,ability,height,weight,desc; public Pokemon(String name, String image, String type, String ability, String height, String weight, String desc) { this.name = name; this.image = image; this.type = type; this.ability = ability; this.height = height; this.weight = weight; this.desc = desc; } protected Pokemon(Parcel in) { name = in.readString(); image = in.readString(); type = in.readString(); ability = in.readString(); height = in.readString(); weight = in.readString(); desc = in.readString(); } public static final Creator<Pokemon> CREATOR = new Creator<Pokemon>() { @Override public Pokemon createFromParcel(Parcel in) { return new Pokemon(in); } @Override public Pokemon[] newArray(int size) { return new Pokemon[size]; } }; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getAbility() { return ability; } public void setAbility(String ability) { this.ability = ability; } public String getHeight() { return height; } public void setHeight(String height) { this.height = height; } public String getWeight() { return weight; } public void setWeight(String weight) { this.weight = weight; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(name); dest.writeString(image); dest.writeString(type); dest.writeString(ability); dest.writeString(height); dest.writeString(weight); dest.writeString(desc); } }
2799b0215a724bff319aa41025ab88bf2a17e968
4b2b15358472606d4e310d7e776addb8bb00942a
/section02methods/KataAndVariations/PyramidsOfGizaRemoveEvenMoreDuplication04.java
44329bb23072fbf899645bd043e51e10ba627a13
[]
no_license
91073657/teachingkidsprogramming
b6c10869b49263fd91302b74df2620840ca86da6
95fabd1472bc3243ea3c06fce483c16c7ace694d
refs/heads/master
2021-01-12T13:12:24.505985
2017-06-01T20:59:38
2017-06-01T20:59:38
72,149,082
0
1
null
null
null
null
UTF-8
Java
false
false
1,498
java
package org.teachingkidsprogramming.section02methods.KataAndVariations; import org.teachingextensions.logo.Tortoise; import org.teachingextensions.logo.utils.ColorUtils.PenColors; //-------------------Kata Question---------------------// //Be aware: this is an example of too much refactoring public class PyramidsOfGizaRemoveEvenMoreDuplication04 { public static void main(String[] args) throws Exception { setUpPyramidLand(); //bad refactoring int[][] degreesAndLength = {{-90, 220}, {135, 100}, {90, 100}, {-90, 100}, {90, 100}, {-90, 100}, {90, 100}, {135, 210}}; for (int[] i : degreesAndLength) { Tortoise.turn(i[0]); Tortoise.move(i[1]); } // turnAndMove(-90, 220); // turnAndMove(135, 100); // moveDown(); // moveUp(); // -90 and 100 // moveDown(); // 90 and 100 // moveUp(); // moveDown(); // turnAndMove(135, 210); } private static void setUpPyramidLand() { // move the tortoise down // extract a method and nam Tortoise.show(); Tortoise.setSpeed(10); Tortoise.getBackgroundWindow().setBackground(PenColors.Blues.AliceBlue); Tortoise.setPenColor(PenColors.Yellows.DarkGoldenrod); Tortoise.setPenWidth(2); Tortoise.hide(); } }
5040a2ceaa98613e2057e9fa7f3adb9b875e89cd
5b55305194be294611d44af04d143424c60c2cc6
/src/main/java/org/swrlapi/core/xsd/XSDDuration.java
e81b0d661014f3db5ec0756b00533038f5e7c1b8
[]
no_license
JoaoOrlando/swrlapi
9cd7535229d4bfca40b2eb94a3250b2db450c196
bce8e1fa05ff40ddb9ea6ab623b6ae3effb0435a
refs/heads/master
2021-01-18T19:09:36.559923
2014-11-08T23:11:36
2014-11-08T23:11:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,284
java
package org.swrlapi.core.xsd; import org.semanticweb.owlapi.vocab.XSDVocabulary; public class XSDDuration extends XSDType<XSDDuration> { private final org.apache.axis.types.Duration duration; public XSDDuration(String content) { super(content); this.duration = XSDTimeUtil.xsdDurationString2AxisDuration(getContent()); setURI(XSDVocabulary.DURATION.getIRI()); } @Override protected void validate() { if (getContent() == null) throw new IllegalArgumentException("null content for XSD:duration literal"); if (!XSDTimeUtil.isValidXSDDuration(getContent())) throw new IllegalArgumentException("invalid xsd:Duration: " + getContent()); } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof XSDDuration)) return false; XSDDuration otherDuration = (XSDDuration)o; return this.duration != null && otherDuration.duration != null && this.duration.equals(otherDuration.duration); } @Override public int hashCode() { int code = 34; code += this.duration.hashCode(); return code; } @Override public int compareTo(XSDDuration o) { if (this == o) return 0; return XSDTimeUtil.compareDurations(this.duration, o.duration); } }
d5672d9882a0078dde8cc17592e2ae6da826c57c
90beadf6c048552279f3729e911b197654c2b23d
/src/stevejobs/Test75.java
5a335f73f3efee294de6f0a24860aa69e5d98fc7
[]
no_license
sudhakar0025/sclass
9cbc770385d9784b7549bc57f2dd48af87a4a1ce
493165da0384e01c9e907c706b0f2728ec8bf13e
refs/heads/master
2020-03-22T20:00:22.524807
2018-07-16T09:40:46
2018-07-16T09:40:46
140,567,294
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
package stevejobs; import java.io.File; import net.sourceforge.tess4j.ITesseract; import net.sourceforge.tess4j.Tesseract; import net.sourceforge.tess4j.util.LoadLibs; public class Test75 { public static void main(String[] args) throws Exception { //Take any image file, which have text in content File f=new File("E:\\untitled.png"); //Load "tessdata" file File fo=LoadLibs.extractTessResources("tessdata"); Tesseract obj=new Tesseract(); obj.setDatapath(fo.getAbsolutePath()); //Convert image content as text String result=obj.doOCR(f); Thread.sleep(20000); System.out.println(result); } }
[ "SUDHAKAR@DESKTOP-4CVI6QL" ]
SUDHAKAR@DESKTOP-4CVI6QL
19fe306ee34e94e577f5c39605609594ff967504
76c3de18525389924f180eb54caad6ebd7dbb742
/stepik/src/stream_API/WordCounter.java
63c485d2159772b41854e930e92994bbfb732403
[]
no_license
vaikusssttark/Java
957f69a2e45777520f4182ca86fe856252c7a2c7
cf991ad09a4bd743c09d8918fa63969526741f42
refs/heads/master
2022-06-01T21:46:11.255891
2019-10-12T15:02:07
2019-10-12T15:02:07
191,765,774
0
0
null
2022-05-20T21:10:35
2019-06-13T13:12:31
Java
UTF-8
Java
false
false
1,397
java
package stream_API; import java.io.BufferedReader; import java.io.FileReader; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.util.Arrays; import java.util.Map; import java.util.TreeMap; import java.util.stream.Stream; public class WordCounter { public static void main(String[] args) { try (BufferedReader bufferedReader = new BufferedReader(new FileReader("./stepik/src/stream_API/a.txt",StandardCharsets.UTF_8))) { Map<String, Integer> map = new TreeMap<>(); StringBuilder sb = new StringBuilder(); Stream<String> bufferStream = bufferedReader.lines(); bufferStream.map(String::toLowerCase) .forEach(sb::append); String[] words = sb.toString().toLowerCase().split("[^a-zа-я0-9]+"); Stream<String> textStream = Arrays.stream(words); textStream.forEach(n ->{ if (map.containsKey(n)) map.replace(n, map.get(n), map.get(n) + 1); else map.put(n, 1); }); map.entrySet().stream() .sorted(Map.Entry.<String, Integer>comparingByValue().reversed()) .limit(10) .forEach(n -> System.out.println(n.getKey())); } catch (Exception e) { e.printStackTrace(); } } }
d23111adb28e742aa104c1d5886587158fa55424
9a7fd17465a24cc2813828b8d9d5092393218230
/app/src/main/java/com/linzd/app/core/pub/service/impl/SysParamServiceImpl.java
b35a9f319e18c2d4df6c95c2d910601e5b7d5181
[]
no_license
linzheda/demospringcloud
d3cc5f1c4c0719a9d211b66ea725bbbfec522354
48b09e4e9e6fdb8fb28a3435c88d220f25563e1c
refs/heads/master
2021-07-15T18:42:15.486903
2021-01-19T07:08:38
2021-01-19T07:08:38
227,801,492
0
0
null
null
null
null
UTF-8
Java
false
false
533
java
package com.linzd.app.core.pub.service.impl; import com.linzd.app.core.pub.entity.SysParam; import com.linzd.app.core.pub.mapper.SysParamMapper; import com.linzd.app.core.pub.service.SysParamService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 系统参数 服务实现类 * </p> * * @author linzd * @since 2020-09-25 */ @Service public class SysParamServiceImpl extends ServiceImpl<SysParamMapper, SysParam> implements SysParamService { }
7aec3df8d4c09dbab854796096c8b9becc8ab3f1
a1292371917ac0fce827f5b015b695ad4646fc81
/BoQi/src/main/java/com/yc/boqi/entity/orderPicture.java
749b09228835911c410c6afee134eb1b0960221f
[]
no_license
smartsky97/BoQi
4c0fc40b0cc7bbad7b4ea394e4312045d0263470
c5e82d73f8c72025c2d21d44cbeee1b14914d48d
refs/heads/master
2021-01-17T10:24:11.577667
2016-07-11T05:31:30
2016-07-11T05:31:30
59,114,807
0
0
null
null
null
null
UTF-8
Java
false
false
974
java
package com.yc.boqi.entity; import java.io.Serializable; public class orderPicture implements Serializable { private static final long serialVersionUID = -2197041833106690464L; private int orderid; private int proid; private String pictrue; public int getOrderid() { return orderid; } public void setOrderid(int orderid) { this.orderid = orderid; } public int getProid() { return proid; } public void setProid(int proid) { this.proid = proid; } public String getPictrue() { return pictrue; } public void setPictrue(String pictrue) { this.pictrue = pictrue; } @Override public String toString() { return "orderPicture [orderid=" + orderid + ", proid=" + proid + ", pictrue=" + pictrue + "]"; } public orderPicture(int orderid, int proid, String pictrue) { super(); this.orderid = orderid; this.proid = proid; this.pictrue = pictrue; } public orderPicture() { super(); } }
acd495d604896a333b999167654a4ff1ff95f00f
996b1a142b5e22072c94a6bbe867e4faffec5ffd
/src/main/java/bcsx/generics/Performs.java
5ff8e1a32a192d8c77b011aa51146784db97ddd5
[]
no_license
longhuoshi/lhsbcsx
f0333dcc375b4dd90bb65f40d838545df6772afb
f8c7d39f38d6f374f7ab987f9bb86cfa08ae0fcc
refs/heads/master
2023-06-09T20:51:13.334399
2023-05-29T02:44:47
2023-05-29T02:44:47
143,263,758
0
0
null
null
null
null
UTF-8
Java
false
false
150
java
package bcsx.generics; /** * @author l * @date 2020/7/29 10:24 * @description */ public interface Performs { void speak(); void sit(); }
3417b420c2edf5eb108b43a271ac870ac46b7169
5d6c374a2518d469d674a1327d21d8e0cf2b54f7
/modules/ogc/net.opengis.wcs/src/net/opengis/gml/validation/GridTypeValidator.java
95a16dc409f272cebbe5dad275bbcce49572951e
[]
no_license
HGitMaster/geotools-osgi
648ebd9343db99a1e2688d9aefad857f6521898d
09f6e327fb797c7e0451e3629794a3db2c55c32b
refs/heads/osgi
2021-01-19T08:33:56.014532
2014-03-19T18:04:03
2014-03-19T18:04:03
4,750,321
3
0
null
2014-03-19T13:50:54
2012-06-22T11:21:01
Java
UTF-8
Java
false
false
808
java
/** * <copyright> * </copyright> * * $Id$ */ package net.opengis.gml.validation; import java.math.BigInteger; import net.opengis.gml.GridLimitsType; import org.eclipse.emf.common.util.EList; /** * A sample validator interface for {@link net.opengis.gml.GridType}. * This doesn't really do anything, and it's not a real EMF artifact. * It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended. * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. */ public interface GridTypeValidator { boolean validate(); boolean validateLimits(GridLimitsType value); boolean validateAxisName(EList value); boolean validateDimension(BigInteger value); }
[ "devnull@localhost" ]
devnull@localhost
2e56afd0f704fde0173bbee272434f2d1fed0645
919c56c729aeb9e69e447ce3a3e13097f902d6be
/src/main/java/com/microfocus/sv/svconfigurator/cli/ICLICommandProcessor.java
3a505414ab8296db6bac0f5729e69d6cb5f473d7
[ "MIT" ]
permissive
flidr/sv-configurator
302a90350e0a15dda3276be13c470b194e8d6566
3f0a7d97aba0041848fdd951f00cb860b00c7ba9
refs/heads/master
2020-05-18T17:20:24.195041
2020-05-06T09:11:14
2020-05-06T14:19:59
184,551,828
0
0
MIT
2019-05-02T09:08:31
2019-05-02T09:08:31
null
UTF-8
Java
false
false
2,760
java
/* * Certain versions of software and/or documents ("Material") accessible here may contain branding from * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE * marks are the property of their respective owners. * __________________________________________________________________ * MIT License * * Copyright (c) 2012-2018 Micro Focus or one of its affiliates. * * The only warranties for products and services of Micro Focus and its affiliates * and licensors ("Micro Focus") are set forth in the express warranty statements * accompanying such products and services. Nothing herein should be construed as * constituting an additional warranty. Micro Focus shall not be liable for technical * or editorial errors or omissions contained herein. * The information contained herein is subject to change without notice. * __________________________________________________________________ * */ package com.microfocus.sv.svconfigurator.cli; /** * <p/> * Interface for Command Line Processor designed for some concrete command. There several commands that defines the main * goal to be done. These commands should be disjoint (with their functionality) and thus there is separate serverclient * for any of them. */ public interface ICLICommandProcessor { public static final int EXIT_CODE_OK = 0; public static final int EXIT_CODE_PARSE = 1000; public static final int EXIT_CODE_PROJECT_BUILD = 1100; public static final int EXIT_CODE_COMMUNICATION = 1200; public static final int EXIT_CODE_CONDITIONS = 1300; public static final int EXIT_CODE_ABSTRACT_SV = 1500; //============================= STATIC METHODS =========================================== //============================= PRIVATE METHODS =========================================== //============================= ABSTRACT METHODS =========================================== /** * Process the command * * @param args any other argument (first argument should not be the command itself) * @return an exit code (0 = PRESENT; 1000 = Command line argument parse error; 1100 = Error during project file parsing; * 1200 = Error during communication with the server; 1300 = Some condition does not let the operation to be * accomplished) */ public abstract int process(String[] args); //========================================= INNER CLASSES =========================================== }
49c0e76eeda51f4438af3241161b8a19d55db84b
4d2652561093f51ff99d5d48eae91f79af4ab8f6
/DIPRES/Escenario4/resources/Callscripts/SIGFE2_118_1_E4CPHelper.java
87653ef93bb0b98c1cf2ab04deebe5d88f83cdbb
[]
no_license
CLMConsultores/Automatizacion
e74a96c6455fb1741b7582daa1d813bf4e3f698a
bc78d304eca480bb44f096596fdf80bc98ac4f11
refs/heads/master
2016-09-05T17:19:17.353683
2014-09-02T14:53:48
2014-09-02T14:53:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,427
java
// DO NOT EDIT: This file is automatically generated. // // Only the associated template file should be edited directly. // Helper class files are automatically regenerated from the template // files at various times, including record actions and test object // insertion actions. Any changes made directly to a helper class // file will be lost when automatically updated. package resources.Callscripts; import LIB.Libreria; import com.rational.test.ft.object.interfaces.*; import com.rational.test.ft.object.interfaces.SAP.*; import com.rational.test.ft.object.interfaces.WPF.*; import com.rational.test.ft.object.interfaces.siebel.*; import com.rational.test.ft.object.interfaces.flex.*; import com.rational.test.ft.object.interfaces.dojo.*; import com.rational.test.ft.object.interfaces.generichtmlsubdomain.*; import com.rational.test.ft.script.*; import com.rational.test.ft.vp.IFtVerificationPoint; import com.ibm.rational.test.ft.object.interfaces.sapwebportal.*; /** * Script Name : <b>SIGFE2_118_1_E4CP</b><br> * Generated : <b>2014/03/20 16:46:43</b><br> * Description : Helper class for script<br> * Original Host : Windows XP x86 5.1 <br> * * @since marzo 20, 2014 * @author cpena */ public abstract class SIGFE2_118_1_E4CPHelper extends LIB.Libreria { protected SIGFE2_118_1_E4CPHelper() { setScriptName("Callscripts.SIGFE2_118_1_E4CP"); } }
19da89bbf3a4fe87d1180390ba775e31144a10b3
584a4f8196dd81ddb365a17ee6395c545c2caa32
/arvores/src/tree/generic/TestaArvore.java
5f50694fcdd3ceacc8fbb1cdf4d8eda1cf545d46
[]
no_license
roldaojr/ifrn-tads-ednl
afefff24f3f7457951888da31fdb8fd40490f1f0
ec8e610d7edb61ef5e4318eb0180e005a1f0f478
refs/heads/master
2020-05-19T08:53:59.316449
2015-03-15T15:06:25
2015-03-15T15:06:25
27,725,446
0
0
null
null
null
null
UTF-8
Java
false
false
374
java
package tree.generic; public class TestaArvore { public static void main(String[] args) { Node arvore = new Node(1); arvore.getChildren().add(new Node(2)); arvore.getChildren().add(new Node(3)); Node subArvore1 = new Node(4); subArvore1.getChildren().add(new Node(5)); subArvore1.getChildren().add(new Node(6)); arvore.getChildren().add(subArvore1); } }
0f8a450e091f6cc21fb77cbd83d1e2917004bc4c
79470a074982d05f4fc8270ed6ad4b96d2ece24e
/src/edu/bridgew/cis/comp152/inheritance/project2/ability/FireArrow.java
617a0609d8ac7bfdcec548e44022fc62f2cd48aa
[]
no_license
c1pham/student.bridgew.comp152.text_adventure
5fbc36ca752a44aa37da81953cb5341dc880cbce
a4cfe452e8bcde300defd4b9fa8e1e3e2686144a
refs/heads/master
2020-08-15T16:22:41.260168
2019-10-15T18:37:20
2019-10-15T18:37:20
215,370,440
0
1
null
null
null
null
UTF-8
Java
false
false
3,193
java
package edu.bridgew.cis.comp152.inheritance.project2.ability; import java.util.ArrayList; import java.util.Random; import edu.bridgew.cis.comp152.inheritance.project2.Database; import edu.bridgew.cis.comp152.inheritance.project2.Entity; import edu.bridgew.cis.comp152.inheritance.project2.entity.enemies.Enemy; public class FireArrow extends Ability { public FireArrow() { super("Fire Arrow", Database.abilityStatD[ Database.ability.FIRE_ARROW.ordinal()][Database.abilityStat.REQUIRE_STAMINA.ordinal()], Database.abilityStatD[ Database.ability.FIRE_ARROW.ordinal()][Database.abilityStat.ABILITY_STAT.ordinal()]); } @Override public boolean useAbility(Entity user,Entity target) { user.setStaminaBar(user.getStaminaBar() - this.reqStamina); boolean isDead = false; String battleString; // specs array for take dmg String damageType = "Melee"; String element = "Fire"; //above two variables will be store in this array String[] dmgSpecs = new String[2]; dmgSpecs[0] = damageType; dmgSpecs[1] = element; double dmgCount = 0; boolean didCrit = false; float critChance; Random chance = new Random(); // random number use to generate chance of hitting or criting critChance = chance.nextFloat(); // determine if entity crit or not if (user.getCurrentCritRate() >= critChance) { didCrit = true; } else if (user.getCurrentCritRate() < critChance) { didCrit = false; } float hitChance; boolean didHit = false; // random number use to generate chance of hitting or criting hitChance = chance.nextFloat(); // determines if you hit and set didhit if (user.getCurrentAccuracy() >= hitChance) { didHit = true; } else if (user.getCurrentAccuracy() < hitChance) { didHit = false; } // this happens if you crit if (didHit == true) { // determines dmg if (didCrit == true) { dmgCount = (user.getCurrentAtk() * this.abilityStat) + target.getCurrentDef() + user.getWeapon().getDamage() + user.getCurrentCritDmg(); } else if (didCrit == false) { dmgCount = (user.getCurrentAtk() * this.abilityStat) + target.getCurrentDef() + user.getWeapon().getDamage(); } battleString = user.getName() + " shoots a fire arrow and it hits."; // if crit this will print if (didCrit == true) { battleString += " It's a critical hit!"; } System.out.println(battleString); // will change dmg to make sure it is atleast 1 isDead = target.takeDmg(dmgSpecs, dmgCount); return isDead; } else { // this happens if you miss System.out.println(user.getName() + " used Fire Arrow and missed."); return false; } } // checks if entity can use the skill @Override public boolean checkStamina(Entity entity) { if (entity.getStaminaBar() >= this.reqStamina) { return true; } else { return false; } } @Override public String toString() { return new String("Ability Name: " + this.abilityName + "\tStamina Cost: " + this.reqStamina + "\tDescription: " + "Shoots a fire arrow and ignores defense."); } // this is not coded because it's not needed to be coded @Override public boolean useAbility(Entity self, ArrayList<Enemy> enemies) { return false; } }
d4cdd3ce9af0f073db0dfbae3898036618e218c1
6fac20f9449e4c0717ab30ec297044742c3d2512
/FinaSpring2015/src/Tree.java
638018839fabc565c670c5ed7c06d09c93306bb0
[]
no_license
iniang/BinaryTree
b90885568579c01e527d7643e5304d7245161b39
4c9a57d5cbe84808143ac27997b4e59c4fec9257
refs/heads/master
2020-03-26T02:45:53.141989
2015-05-13T20:56:35
2015-05-13T20:56:35
35,573,878
0
0
null
null
null
null
UTF-8
Java
false
false
8,304
java
import java.util.*; public class Tree { private Node root; // first node of tree public Tree() // constructor { root = null; } // no nodes in tree yet public Node find(int key) // find node with given key { // (assumes non-empty tree) Node current = root; // start at root while(current.iData != key) // while no match, { if(key < current.iData) // go left? current = current.leftChild; else // or go right? current = current.rightChild; if(current == null) // if no child, return null; // didn't find it } return current; // found it } // end find method public void insert(int id, double dd) { Node newNode = new Node(); // make new node newNode.iData = id; // insert data newNode.dData = dd; if(root==null) // no node in root root = newNode; else // root occupied { Node current = root; // start at root Node parent; while(true) // (exits internally) { parent = current; if(id < current.iData) // go left? { current = current.leftChild; if(current == null) // if end of the line, { // insert on left parent.leftChild = newNode; return; } } // end if go left else // or go right? { current = current.rightChild; if(current == null) // if end of the line { // insert on right parent.rightChild = newNode; return; } } } } } // end insert method //------------------------------------------------------------- public boolean delete(int key) // delete node with given key { // (assumes non-empty list) Node current = root; Node parent = root; boolean isLeftChild = true; while(current.iData != key) // search for node { parent = current; if(key < current.iData) // go left? { isLeftChild = true; current = current.leftChild; } else // or go right? { isLeftChild = false; current = current.rightChild; } if(current == null) // end of the line, return false; // didn't find it } // end while // found node to delete // if no children, simply delete it if(current.leftChild==null && current.rightChild==null) { if(current == root) // if root, root = null; // tree is empty else if(isLeftChild) parent.leftChild = null; // disconnect else // from parent parent.rightChild = null; } // if no right child, replace with left subtree else if(current.rightChild==null) if(current == root) root = current.leftChild; else if(isLeftChild) parent.leftChild = current.leftChild; else parent.rightChild = current.leftChild; // if no left child, replace with right subtree else if(current.leftChild==null) if(current == root) root = current.rightChild; else if(isLeftChild) parent.leftChild = current.rightChild; else parent.rightChild = current.rightChild; else // two children, so replace with inorder successor { // get successor of node to delete (current) Node successor = getSuccessor(current); // connect parent of current to successor instead if(current == root) root = successor; else if(isLeftChild) parent.leftChild = successor; else parent.rightChild = successor; // connect successor to current's left child successor.leftChild = current.leftChild; } // end else two children // (successor cannot have a left child) return true; // success } // end delete() //------------------------------------------------------------- // returns node with next-highest value after delNode // goes to right child, then right child's left descendents private Node getSuccessor(Node delNode) { Node successorParent = delNode; Node successor = delNode; Node current = delNode.rightChild; // go to right child while(current != null) // until no more { // left children, successorParent = successor; successor = current; current = current.leftChild; // go to left child } // if successor not if(successor != delNode.rightChild) // right child, { // make connections successorParent.leftChild = successor.rightChild; successor.rightChild = delNode.rightChild; } return successor; } //------------------------------------------------------------- public void traverse(int traverseType) { switch(traverseType) { case 1: System.out.print("\nPreorder traversal: "); preOrder(root); break; case 2: System.out.print("\nInorder traversal: "); inOrder(root); break; case 3: System.out.print("\nPostorder traversal: "); postOrder(root); break; } System.out.println(); } //------------------------------------------------------------- private void preOrder(Node localRoot) { if(localRoot != null) { System.out.print(localRoot.iData + " "); preOrder(localRoot.leftChild); preOrder(localRoot.rightChild); } } //------------------------------------------------------------- private void inOrder(Node localRoot) { if(localRoot != null) { inOrder(localRoot.leftChild); System.out.print(localRoot.iData + " "); inOrder(localRoot.rightChild); } } //------------------------------------------------------------- private void postOrder(Node localRoot) { if(localRoot != null) { postOrder(localRoot.leftChild); postOrder(localRoot.rightChild); System.out.print(localRoot.iData + " "); } } //------------------------------------------------------------- public void displayTree() { Stack globalStack = new Stack(); globalStack.push(root); int nBlanks = 32; boolean isRowEmpty = false; System.out.println( "......................................................"); while(isRowEmpty==false) { Stack localStack = new Stack(); isRowEmpty = true; for(int j=0; j<nBlanks; j++) System.out.print(' '); while(globalStack.isEmpty()==false) { Node temp = (Node)globalStack.pop(); if(temp != null) { System.out.print(temp.iData); localStack.push(temp.leftChild); localStack.push(temp.rightChild); if(temp.leftChild != null || temp.rightChild != null) isRowEmpty = false; } else { System.out.print("--"); localStack.push(null); localStack.push(null); } for(int j=0; j<nBlanks*2-2; j++) System.out.print(' '); } // end while globalStack not empty System.out.println(); nBlanks /= 2; while(localStack.isEmpty()==false) globalStack.push( localStack.pop() ); } // end while isRowEmpty is false System.out.println( "......................................................"); } }
8bc0cd364a6a1ab7b65deca8543222e179325f78
6d5fde21b8a41837ee542d403b46a521b3045619
/webchat/src/main/java/com/example/configuration/CORSFilter.java
cc1f5ceec4754de148dc99e34c858e9295c6f7b7
[]
no_license
truongquangkhai99/Java-Web
5fd9963488de4c0fd74c1ebd28f1ecff5aea9cb2
9723bda959d9de361c7a0091111c376500dcaa74
refs/heads/master
2023-03-16T21:15:08.575496
2018-09-05T06:15:01
2018-09-05T06:15:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,277
java
package com.example.configuration; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Arrays; /** * Servlet Filter implementation class CORSFilter */ @WebFilter("*") public class CORSFilter implements Filter { // This is to be replaced with a list of domains allowed to access the server //You can include more than one origin here private final List<String> allowedOrigins = Arrays.asList("http://**"); public void destroy() { } public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { // Lets make sure that we are working with HTTP (that is, against HttpServletRequest and HttpServletResponse objects) if (req instanceof HttpServletRequest && res instanceof HttpServletResponse) { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; // Access-Control-Allow-Origin String origin = request.getHeader("Origin"); response.setHeader("Access-Control-Allow-Origin", allowedOrigins.contains(origin) ? origin : ""); response.setHeader("Vary", "Origin"); // Access-Control-Max-Age response.setHeader("Access-Control-Max-Age", "3600"); // Access-Control-Allow-Credentials response.setHeader("Access-Control-Allow-Credentials", "true"); // Access-Control-Allow-Methods response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); // Access-Control-Allow-Headers response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, " + "X-CSRF-TOKEN"); } chain.doFilter(req, res); } public void init(FilterConfig filterConfig) { } }
d3c395ce9417f8c43b26b38dc43b8c8754023f89
50ac2601bf2bd18089b250dbe085f3029bc016c8
/Weather_Monitoring_Application_With_IOT-master/app/src/main/java/com/weather/mini/c15/c15weathermonitoring/Kelembaban.java
5017b52ae1b4cb1a1dc69e2bef513f4fb34a56e8
[]
no_license
Harysetyopermadi/Simkron-2020-Php2d
b0e1a8fcbfb816ae8c75c6b088461ebc8c51e6db
1ee01997f706d183e807de5fc38868357df8a5a8
refs/heads/master
2023-08-23T20:23:48.729291
2021-10-22T16:07:10
2021-10-22T16:07:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,918
java
package com.weather.mini.c15.c15weathermonitoring; import android.content.ActivityNotFoundException; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.speech.RecognizerIntent; import android.util.Log; import android.view.View; import android.webkit.WebView; import android.widget.Button; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import com.google.android.material.snackbar.Snackbar; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.Locale; import java.util.Timer; import java.util.TimerTask; public class Kelembaban extends AppCompatActivity { static ProgressBar freezeBar; static ProgressBar heatBar; static String lembabGraphURL; static WebView lembabGraph; static TextView lembab; static int lembabValue=0; static String lembabJSON; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_kelembaban); freezeBar = (ProgressBar) findViewById(R.id.progressBarlembab); freezeBar.setProgress(0); lembab = (TextView)findViewById(R.id.temperaturelembab); String urllembab = "https://api.thingspeak.com/channels/1122589/feeds/last.json?api_key="; String apikeylembab = "MAJUEEJH880F0OFX"; final Kelembaban.UriApi uriapi02 = new UriApi(); uriapi02.setUri(urllembab,apikeylembab); Timer timer = new Timer(); TimerTask tasknew = new TimerTask(){ public void run() { LoadJSONlembab task= new LoadJSONlembab(); task.execute(uriapi02.getUri()); } }; timer.scheduleAtFixedRate(tasknew,1*2000,1*2000); lembabGraphURL = "<iframe width=\"450\" height=\"250\" style=\"border: 1px solid #cccccc;\" src=\"http://thingspeak.com/channels/1122589/charts/2?api_key=MAJUEEJH880F0OFX&dynamic=true\"></iframe>"; lembabGraph = (WebView) findViewById(R.id.Graphlembab); lembabGraph.getSettings().setJavaScriptEnabled(true); lembabGraph.setInitialScale(210); lembabGraph.loadData(lembabGraphURL, "text/html", null); } static class UriApi { private String uri,urllembab,apikeylembab; protected void setUri(String url, String apikey){ this.urllembab = url; this.apikeylembab = apikey; this.uri = url + apikey; } protected String getUri(){ return uri; } } private class LoadJSONlembab extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... urls) { return (String) getText(urls[0]); } @Override protected void onPostExecute(String result) { try { JSONObject json = new JSONObject(result); lembabJSON = String.format("%s", json.getString("field2")); } catch (JSONException e) { e.printStackTrace(); } lembab.setText(""+lembabJSON+" %"); Log.d("VarX", ""+lembabJSON); try { if(lembabJSON!=null) { lembabValue = Integer.parseInt(lembabJSON); } } catch(NumberFormatException nfe){} //Temperature Progress Bar Code -------------------------------------------------------- } } private static String getText(String strUrl) { String strResult = ""; try { URL url = new URL(strUrl); HttpURLConnection con = (HttpURLConnection) url.openConnection(); strResult = readStream(con.getInputStream()); } catch (Exception e) { e.printStackTrace(); } return strResult; } private static String readStream(InputStream in) { BufferedReader reader = null; StringBuilder sb = new StringBuilder(); try { reader = new BufferedReader(new InputStreamReader(in)); String line; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } } catch (IOException e) { e.printStackTrace(); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } } return sb.toString(); }}
2476e35c50a9f1c8bc5deaa7b060e43c6b839d86
05562c0acecbc7e24cb141a6511ce7ee2247144e
/app/src/main/java/com/pda/inventario/PrincipalActivity.java
ce69343ffa1eb2e0c66e4f163f74b922776958a1
[]
no_license
viniciusnovais/PDA-InventarioEUA
67facfe53c1ac175f2ee831cb5c993be54a9b061
1934e6ef4ae570d8cbd2fd24cbea80c00a28693c
refs/heads/master
2021-01-20T05:19:59.957699
2017-08-25T18:48:41
2017-08-25T18:48:41
101,428,986
0
0
null
null
null
null
UTF-8
Java
false
false
25,813
java
package com.pda.inventario; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.MarshalDate; import org.ksoap2.serialization.PropertyInfo; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import com.example.pda_inventario.R; import com.pda.inventario.businessComponent.ColetaBC; import com.pda.inventario.businessComponent.DepartamentoBC; import com.pda.inventario.businessComponent.EnderecoBC; import com.pda.inventario.businessComponent.SetorBC; import com.pda.inventario.businessComponent.UsuarioColetorBC; import com.pda.inventario.entityObject.ColetaEO; import com.pda.inventario.entityObject.ContagemColetorEO; import com.pda.inventario.entityObject.DepartamentoColetorEO; import com.pda.inventario.entityObject.EnderecoColetorEO; import com.pda.inventario.entityObject.InventarioColetorEO; import com.pda.inventario.entityObject.InventarioEO; import com.pda.inventario.entityObject.SetorColetorEO; import com.pda.inventario.entityObject.UsuarioColetorEO; import com.pda.inventario.entityObject.UsuarioEO; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.Color; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; public class PrincipalActivity extends Activity { final int ATIVIDADE_CONTAGEM = 2; final int ATIVIDADE_AUDITORIA = 3; final int ATIVIDADE_DIVERGENCIA = 5; final int ATIVIDADE_FINAL = 4; private long lastBackPressTime = 0; UsuarioEO objUsuarioLogado = new UsuarioEO(); InventarioEO objInventario = new InventarioEO(); Button btnContagem, btnExportacao, btnImportacao, btnAuditoria, btnDivergencia, btnFinal; TextView tvPendentes, tvVersao; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.principal_novo); Intent intent = getIntent(); objUsuarioLogado = (UsuarioEO) intent.getSerializableExtra("UsuarioEO"); objInventario = (InventarioEO) intent.getSerializableExtra("InventarioEO"); tvPendentes = (TextView) findViewById(R.id.tvPendentes); btnContagem = (Button) findViewById(R.id.btnContagem); btnAuditoria = (Button) findViewById(R.id.btnAuditoria); btnDivergencia = (Button) findViewById(R.id.btnDivergencia); btnFinal = (Button) findViewById(R.id.btnContFinal); btnExportacao = (Button) findViewById(R.id.btnExportacao); btnImportacao = (Button) findViewById(R.id.btnImportacao); //tvVersao = (TextView) findViewById(R.id.version); // PackageInfo pInfo = null; // try { // pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); // } catch (PackageManager.NameNotFoundException e) { // e.printStackTrace(); // } // String version = pInfo.versionName; // tvVersao.setText("Versão: 1.5"); btnContagem.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { Intent intent = new Intent(PrincipalActivity.this, ContagemActivity.class); intent.putExtra("UsuarioEO", objUsuarioLogado); getIntent().getSerializableExtra("UsuarioEO"); intent.putExtra("InventarioEO", objInventario); getIntent().getSerializableExtra("InventarioEO"); intent.putExtra("TIPO_ATIVIDADE", ATIVIDADE_CONTAGEM); getIntent().getSerializableExtra("TIPO_ATIVIDADE"); startActivity(intent); } catch (Exception e) { e.printStackTrace(); } } }); btnExportacao.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { AsyncCallWS task = new AsyncCallWS(); task.execute(); } catch (Exception e) { e.printStackTrace(); } } }); btnImportacao.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Toast.makeText(PrincipalActivity.this,"Function currently inactive",Toast.LENGTH_SHORT).show(); // try { // AsyncCallWSImport task = new AsyncCallWSImport(); // task.execute(); // // } catch (Exception e) { // e.printStackTrace(); // } } }); btnFinal.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // try { // // Intent intent = new Intent(PrincipalActivity.this, ContagemActivity.class); // intent.putExtra("UsuarioEO", objUsuarioLogado); // getIntent().getSerializableExtra("UsuarioEO"); // // intent.putExtra("InventarioEO", objInventario); // getIntent().getSerializableExtra("InventarioEO"); // // intent.putExtra("TIPO_ATIVIDADE", ATIVIDADE_FINAL); // getIntent().getSerializableExtra("TIPO_ATIVIDADE"); // // startActivity(intent); // // } catch (Exception e) { // e.printStackTrace(); // } Toast.makeText(PrincipalActivity.this,"Function currently inactive",Toast.LENGTH_SHORT).show(); } }); btnAuditoria.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { Intent intent = new Intent(PrincipalActivity.this, ContagemActivity.class); intent.putExtra("UsuarioEO", objUsuarioLogado); getIntent().getSerializableExtra("UsuarioEO"); intent.putExtra("InventarioEO", objInventario); getIntent().getSerializableExtra("InventarioEO"); intent.putExtra("TIPO_ATIVIDADE", ATIVIDADE_AUDITORIA); getIntent().getSerializableExtra("TIPO_ATIVIDADE"); startActivity(intent); } catch (Exception e) { e.printStackTrace(); } } }); btnDivergencia.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { Intent intent = new Intent(PrincipalActivity.this, ContagemActivity.class); intent.putExtra("UsuarioEO", objUsuarioLogado); getIntent().getSerializableExtra("UsuarioEO"); intent.putExtra("InventarioEO", objInventario); getIntent().getSerializableExtra("InventarioEO"); intent.putExtra("TIPO_ATIVIDADE", ATIVIDADE_DIVERGENCIA); getIntent().getSerializableExtra("TIPO_ATIVIDADE"); startActivity(intent); } catch (Exception e) { e.printStackTrace(); } } }); this.verificaPendentes(); } @Override public void onBackPressed() { if (this.lastBackPressTime < System.currentTimeMillis() - 4000) { Toast.makeText(this, "Press the back button again to close the application.", Toast.LENGTH_SHORT).show(); this.lastBackPressTime = System.currentTimeMillis(); } else { super.onBackPressed(); } } @Override public void onResume() { super.onResume(); this.verificaPendentes(); } private class AsyncCallWS extends AsyncTask<Void, Integer, Void> { private final ProgressDialog dialog = new ProgressDialog(PrincipalActivity.this); @Override protected void onPreExecute() { Log.i("Response", "onPreExecute"); this.dialog.setMessage(StringUtils.EXPORT); this.dialog.show(); } @Override protected Void doInBackground(Void... params) { Log.i("Response", "doInBackground"); setContagem(); return null; } @Override protected void onPostExecute(Void result) { Log.i("Response", "onPostExecute"); Toast.makeText(getApplicationContext(), StringUtils.EXPORT_OK, Toast.LENGTH_LONG).show(); verificaPendentes(); this.dialog.dismiss(); } } public void setContagem() { String SOAP_ACTION = "http://tempuri.org/SetColeta"; String METHOD_NAME = "SetColeta"; String NAMESPACE = "http://tempuri.org/"; //String URL = "http://179.184.159.52/wsandroid/wsinventario.asmx"; String URL = "http://" + StringUtils.SERVIDOR + "/" + StringUtils.DIRETORIO_VIRTUAL + "/inventario.asmx"; try { ColetaBC repository = new ColetaBC(this); SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME); List<ContagemColetorEO> obj = new ArrayList<ContagemColetorEO>(); obj = repository.GetContagemColetorPendente(String.valueOf(objInventario.getIdInventario())); SoapObject soapEntity = new SoapObject(NAMESPACE, "entity"); for (ContagemColetorEO i : obj) { soapEntity.addProperty("ContagemColetorEO", i); } Request.addSoapObject(soapEntity); SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.implicitTypes = true; soapEnvelope.dotNet = true; soapEnvelope.setOutputSoapObject(Request); MarshalDate md = new MarshalDate(); md.register(soapEnvelope); soapEnvelope.addMapping(NAMESPACE, "ContagemColetorEO", new ContagemColetorEO().getClass()); HttpTransportSE transport = new HttpTransportSE(URL); transport.call(SOAP_ACTION, soapEnvelope); SoapObject objSoapList = (SoapObject) soapEnvelope.getResponse(); repository.UpdateColetaExportInventario(String.valueOf(objInventario.getIdInventario())); } catch (Exception e) { e.printStackTrace(); } } private void verificaPendentes() { try { ColetaBC repository = new ColetaBC(this); List<ColetaEO> objColetaList = new ArrayList<ColetaEO>(); objColetaList = repository.GetColetaPendente(String.valueOf(objInventario.getIdInventario())); if (!objColetaList.isEmpty()) { tvPendentes.setText(StringUtils.COLETA_PENDENTES + String.valueOf(objColetaList.size())); tvPendentes.setTextColor(Color.parseColor("#FF0000")); } else { tvPendentes.setText(StringUtils.COLETA_PENDENTES); tvPendentes.setTextColor(Color.parseColor("#FFFFFF")); } } catch (Exception e) { e.printStackTrace(); } } private class AsyncCallWSImport extends AsyncTask<Void, Integer, Void> { private final ProgressDialog dialog = new ProgressDialog(PrincipalActivity.this); @Override protected void onPreExecute() { Log.i("Response", "onPreExecute"); this.dialog.setMessage(StringUtils.IMPORT); this.dialog.show(); } @Override protected Void doInBackground(Void... params) { Log.i("Response", "doInBackground"); getImport(); return null; } @Override protected void onPostExecute(Void result) { Log.i("Response", "onPostExecute"); Toast.makeText(getApplicationContext(), StringUtils.IMPORT_OK, Toast.LENGTH_LONG).show(); this.dialog.dismiss(); } } private void getImport() { try { getUsers(); getDepto(); getSetor(); getEndereco(); } catch (Exception e) { e.printStackTrace(); } } public void getUsers() { String SOAP_ACTION = "http://tempuri.org/GetUsuarioColetor"; String METHOD_NAME = "GetUsuarioColetor"; String NAMESPACE = "http://tempuri.org/"; //String URL = "http://179.184.159.52/wsandroid/autenticacao.asmx"; String URL = "http://" + StringUtils.SERVIDOR + "/" + StringUtils.DIRETORIO_VIRTUAL + "/autenticacao.asmx"; try { SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME); InventarioColetorEO obj = new InventarioColetorEO(); PropertyInfo pi = new PropertyInfo(); pi.setName("obj"); pi.setValue(obj); pi.setType(obj.getClass()); Request.addProperty(pi); SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.implicitTypes = true; soapEnvelope.dotNet = true; soapEnvelope.setOutputSoapObject(Request); MarshalDate md = new MarshalDate(); md.register(soapEnvelope); soapEnvelope.addMapping(NAMESPACE, "InventarioColetorEO", new InventarioColetorEO().getClass()); HttpTransportSE transport = new HttpTransportSE(URL); transport.call(SOAP_ACTION, soapEnvelope); SoapObject objSoapList = (SoapObject) soapEnvelope.getResponse(); if (objSoapList != null) { List<UsuarioColetorEO> objUsuarioList = new ArrayList<UsuarioColetorEO>(); for (int i = 0; i < objSoapList.getPropertyCount(); i++) { SoapObject objSoap = (SoapObject) objSoapList.getProperty(i); UsuarioColetorEO objUsuario = new UsuarioColetorEO(); objUsuario.setCodigo(Integer.parseInt(objSoap.getPropertyAsString("Codigo"))); objUsuario.setLogin(objSoap.getPropertyAsString("Login")); objUsuario.setLider(Integer.parseInt(objSoap.getPropertyAsString("Lider"))); objUsuario.setSenha(objSoap.getPropertyAsString("Senha").getBytes()); objUsuarioList.add(objUsuario); } if (!objUsuarioList.isEmpty()) { UsuarioColetorBC repository = new UsuarioColetorBC(this); repository.CreateUsuarioList(objUsuarioList); } } else Log.i("WS Call", "Return null"); } catch (Exception e) { e.printStackTrace(); } } public void getDepto() { String SOAP_ACTION = "http://tempuri.org/GetDepartamento"; String METHOD_NAME = "GetDepartamento"; String NAMESPACE = "http://tempuri.org/"; //String URL = "http://179.184.159.52/wsandroid/wsinventario.asmx"; String URL = "http://" + StringUtils.SERVIDOR + "/" + StringUtils.DIRETORIO_VIRTUAL + "/wsinventario.asmx"; try { SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME); DepartamentoColetorEO obj = new DepartamentoColetorEO(); obj.IdInventario = objInventario.getIdInventario(); PropertyInfo pi = new PropertyInfo(); pi.setName("entity"); pi.setValue(obj); pi.setType(obj.getClass()); Request.addProperty(pi); SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.implicitTypes = true; soapEnvelope.dotNet = true; soapEnvelope.setOutputSoapObject(Request); MarshalDate md = new MarshalDate(); md.register(soapEnvelope); soapEnvelope.addMapping(NAMESPACE, "DepartamentoColetorEO", new DepartamentoColetorEO().getClass()); HttpTransportSE transport = new HttpTransportSE(URL); transport.call(SOAP_ACTION, soapEnvelope); SoapObject objSoapList = (SoapObject) soapEnvelope.getResponse(); if (objSoapList != null) { List<DepartamentoColetorEO> objDepartamentoList = new ArrayList<DepartamentoColetorEO>(); for (int i = 0; i < objSoapList.getPropertyCount(); i++) { SoapObject objSoap = (SoapObject) objSoapList.getProperty(i); DepartamentoColetorEO objDepartamento = new DepartamentoColetorEO(); objDepartamento.setProperty(0, Integer.parseInt(objSoap.getPropertyAsString("IdInventario"))); objDepartamento.setProperty(1, Integer.parseInt(objSoap.getPropertyAsString("IdDepartamento"))); objDepartamento.setProperty(2, Integer.parseInt(objSoap.getPropertyAsString("IdMetodoContagem"))); objDepartamento.setProperty(3, Integer.parseInt(objSoap.getPropertyAsString("IdMetodoAuditoria"))); objDepartamento.setProperty(4, Integer.parseInt(objSoap.getPropertyAsString("IdMetodoLeitura"))); objDepartamento.setProperty(5, objSoap.getPropertyAsString("Departamento")); objDepartamento.setProperty(6, objSoap.getPropertyAsString("MetodoContagem")); objDepartamento.setProperty(7, objSoap.getPropertyAsString("MetodoAuditoria")); objDepartamento.setProperty(8, Integer.parseInt(objSoap.getPropertyAsString("Quantidade"))); objDepartamentoList.add(objDepartamento); } if (!objDepartamentoList.isEmpty()) { DepartamentoBC repository = new DepartamentoBC(this); repository.CreateDepartamentoColetorList(objDepartamentoList); } } else Log.i("WS Call", "Return null"); } catch (Exception e) { e.printStackTrace(); } } public void getSetor() { String SOAP_ACTION = "http://tempuri.org/GetSetor"; String METHOD_NAME = "GetSetor"; String NAMESPACE = "http://tempuri.org/"; //String URL = "http://179.184.159.52/wsandroid/wsinventario.asmx"; String URL = "http://" + StringUtils.SERVIDOR + "/" + StringUtils.DIRETORIO_VIRTUAL + "/wsinventario.asmx"; try { SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME); SetorColetorEO obj = new SetorColetorEO(); obj.IdInventario = objInventario.getIdInventario(); PropertyInfo pi = new PropertyInfo(); pi.setName("entity"); pi.setValue(obj); pi.setType(obj.getClass()); Request.addProperty(pi); SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.implicitTypes = true; soapEnvelope.dotNet = true; soapEnvelope.setOutputSoapObject(Request); MarshalDate md = new MarshalDate(); md.register(soapEnvelope); soapEnvelope.addMapping(NAMESPACE, "SetorColetorEO", new SetorColetorEO().getClass()); HttpTransportSE transport = new HttpTransportSE(URL); transport.call(SOAP_ACTION, soapEnvelope); SoapObject objSoapList = (SoapObject) soapEnvelope.getResponse(); if (objSoapList != null) { List<SetorColetorEO> objSetorList = new ArrayList<SetorColetorEO>(); for (int i = 0; i < objSoapList.getPropertyCount(); i++) { SoapObject objSoap = (SoapObject) objSoapList.getProperty(i); SetorColetorEO objSetor = new SetorColetorEO(); objSetor.IdInventario = Integer.parseInt(objSoap.getPropertyAsString("IdInventario").toString()); objSetor.IdDepartamento = Integer.parseInt(objSoap.getPropertyAsString("IdDepartamento").toString()); objSetor.IdSetor = Integer.parseInt(objSoap.getPropertyAsString("IdSetor").toString()); objSetor.IdMetodoContagem = Integer.parseInt(objSoap.getPropertyAsString("IdMetodoContagem").toString()); objSetor.IdMetodoAuditoria = Integer.parseInt(objSoap.getPropertyAsString("IdMetodoAuditoria").toString()); objSetor.IdMetodoLeitura = Integer.parseInt(objSoap.getPropertyAsString("IdMetodoLeitura").toString()); objSetor.Setor = objSoap.getPropertyAsString("Setor").toString(); objSetor.MetodoContagem = objSoap.getPropertyAsString("MetodoContagem").toString(); objSetor.MetodoAuditoria = objSoap.getPropertyAsString("MetodoAuditoria").toString(); objSetor.Quantidade = Integer.parseInt(objSoap.getPropertyAsString("Quantidade").toString()); objSetorList.add(objSetor); } if (!objSetorList.isEmpty()) { SetorBC repository = new SetorBC(this); repository.CreateSetorColetorList(objSetorList); } } else Log.i("WS Call", "Return null"); } catch (Exception e) { e.printStackTrace(); } } public void getEndereco() { String SOAP_ACTION = "http://tempuri.org/GetEndereco"; String METHOD_NAME = "GetEndereco"; String NAMESPACE = "http://tempuri.org/"; //String URL = "http://179.184.159.52/wsandroid/wsinventario.asmx"; String URL = "http://" + StringUtils.SERVIDOR + "/" + StringUtils.DIRETORIO_VIRTUAL + "/wsinventario.asmx"; try { SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME); EnderecoColetorEO obj = new EnderecoColetorEO(); obj.IdInventario = objInventario.getIdInventario(); PropertyInfo pi = new PropertyInfo(); pi.setName("entity"); pi.setValue(obj); pi.setType(obj.getClass()); Request.addProperty(pi); SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.implicitTypes = true; soapEnvelope.dotNet = true; soapEnvelope.setOutputSoapObject(Request); MarshalDate md = new MarshalDate(); md.register(soapEnvelope); soapEnvelope.addMapping(NAMESPACE, "EnderecoColetorEO", new EnderecoColetorEO().getClass()); HttpTransportSE transport = new HttpTransportSE(URL); transport.call(SOAP_ACTION, soapEnvelope); SoapObject objSoapList = (SoapObject) soapEnvelope.getResponse(); if (objSoapList != null) { List<EnderecoColetorEO> objEnderecoList = new ArrayList<EnderecoColetorEO>(); for (int i = 0; i < objSoapList.getPropertyCount(); i++) { SoapObject objSoap = (SoapObject) objSoapList.getProperty(i); EnderecoColetorEO objEndereco = new EnderecoColetorEO(); objEndereco.IdInventario = Integer.parseInt(objSoap.getPropertyAsString("IdInventario").toString()); objEndereco.IdEndereco = Integer.parseInt(objSoap.getPropertyAsString("IdEndereco").toString()); objEndereco.IdDepartamento = Integer.parseInt(objSoap.getPropertyAsString("IdDepartamento").toString()); objEndereco.IdSetor = Integer.parseInt(objSoap.getPropertyAsString("IdSetor").toString()); objEndereco.IdMetodoContagem = Integer.parseInt(objSoap.getPropertyAsString("IdMetodoContagem").toString()); objEndereco.IdMetodoAuditoria = Integer.parseInt(objSoap.getPropertyAsString("IdMetodoAuditoria").toString()); objEndereco.IdMetodoLeitura = Integer.parseInt(objSoap.getPropertyAsString("IdMetodoLeitura").toString()); objEndereco.Endereco = objSoap.getPropertyAsString("Endereco").toString(); objEndereco.Departamento = objSoap.getPropertyAsString("Departamento").toString(); objEndereco.Setor = objSoap.getPropertyAsString("Setor").toString(); objEndereco.MetodoContagem = objSoap.getPropertyAsString("MetodoContagem").toString(); objEndereco.MetodoAuditoria = objSoap.getPropertyAsString("MetodoAuditoria").toString(); objEndereco.Quantidade = Integer.parseInt(objSoap.getPropertyAsString("Quantidade").toString()); SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy"); try { objEndereco.DataHora = format.parse(objSoap.getPropertyAsString("DataHora").toString()); } catch (ParseException e) { e.printStackTrace(); } objEnderecoList.add(objEndereco); } if (!objEnderecoList.isEmpty()) { EnderecoBC repository = new EnderecoBC(this); repository.CreateEnderecoList(objEnderecoList); } } else Log.i("WS Call", "Return null"); } catch (Exception e) { e.printStackTrace(); } } }
eadf10fcc8238fa6f11fcc7b858cbc9ce8eba6c8
43e4b0cdbd20e2dd22b5fede042df49b92f57406
/google-api-grpc/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponse.java
288b4d80ce6a9680a7570628b649430d05093373
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
rock619/google-cloud-java
e0b7a5136117710b292015ab81e92433371b53dc
877f9c9bc1f8f04713396b8585cef3f3751a0439
refs/heads/master
2020-05-01T03:13:14.508463
2019-03-22T19:39:54
2019-03-22T19:39:54
177,239,827
0
0
Apache-2.0
2019-03-23T03:33:46
2019-03-23T03:33:46
null
UTF-8
Java
false
true
17,528
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto package com.google.bigtable.v2; /** * * * <pre> * Response message for Bigtable.CheckAndMutateRow. * </pre> * * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowResponse} */ public final class CheckAndMutateRowResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.bigtable.v2.CheckAndMutateRowResponse) CheckAndMutateRowResponseOrBuilder { private static final long serialVersionUID = 0L; // Use CheckAndMutateRowResponse.newBuilder() to construct. private CheckAndMutateRowResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private CheckAndMutateRowResponse() { predicateMatched_ = false; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private CheckAndMutateRowResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { predicateMatched_ = input.readBool(); break; } default: { if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.bigtable.v2.CheckAndMutateRowResponse.class, com.google.bigtable.v2.CheckAndMutateRowResponse.Builder.class); } public static final int PREDICATE_MATCHED_FIELD_NUMBER = 1; private boolean predicateMatched_; /** * * * <pre> * Whether or not the request's `predicate_filter` yielded any results for * the specified row. * </pre> * * <code>bool predicate_matched = 1;</code> */ public boolean getPredicateMatched() { return predicateMatched_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (predicateMatched_ != false) { output.writeBool(1, predicateMatched_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (predicateMatched_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, predicateMatched_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.v2.CheckAndMutateRowResponse)) { return super.equals(obj); } com.google.bigtable.v2.CheckAndMutateRowResponse other = (com.google.bigtable.v2.CheckAndMutateRowResponse) obj; boolean result = true; result = result && (getPredicateMatched() == other.getPredicateMatched()); result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PREDICATE_MATCHED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPredicateMatched()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.bigtable.v2.CheckAndMutateRowResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * * <pre> * Response message for Bigtable.CheckAndMutateRow. * </pre> * * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.bigtable.v2.CheckAndMutateRowResponse) com.google.bigtable.v2.CheckAndMutateRowResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.bigtable.v2.CheckAndMutateRowResponse.class, com.google.bigtable.v2.CheckAndMutateRowResponse.Builder.class); } // Construct using com.google.bigtable.v2.CheckAndMutateRowResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); predicateMatched_ = false; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; } @java.lang.Override public com.google.bigtable.v2.CheckAndMutateRowResponse getDefaultInstanceForType() { return com.google.bigtable.v2.CheckAndMutateRowResponse.getDefaultInstance(); } @java.lang.Override public com.google.bigtable.v2.CheckAndMutateRowResponse build() { com.google.bigtable.v2.CheckAndMutateRowResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.bigtable.v2.CheckAndMutateRowResponse buildPartial() { com.google.bigtable.v2.CheckAndMutateRowResponse result = new com.google.bigtable.v2.CheckAndMutateRowResponse(this); result.predicateMatched_ = predicateMatched_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.bigtable.v2.CheckAndMutateRowResponse) { return mergeFrom((com.google.bigtable.v2.CheckAndMutateRowResponse) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowResponse other) { if (other == com.google.bigtable.v2.CheckAndMutateRowResponse.getDefaultInstance()) return this; if (other.getPredicateMatched() != false) { setPredicateMatched(other.getPredicateMatched()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.bigtable.v2.CheckAndMutateRowResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.bigtable.v2.CheckAndMutateRowResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private boolean predicateMatched_; /** * * * <pre> * Whether or not the request's `predicate_filter` yielded any results for * the specified row. * </pre> * * <code>bool predicate_matched = 1;</code> */ public boolean getPredicateMatched() { return predicateMatched_; } /** * * * <pre> * Whether or not the request's `predicate_filter` yielded any results for * the specified row. * </pre> * * <code>bool predicate_matched = 1;</code> */ public Builder setPredicateMatched(boolean value) { predicateMatched_ = value; onChanged(); return this; } /** * * * <pre> * Whether or not the request's `predicate_filter` yielded any results for * the specified row. * </pre> * * <code>bool predicate_matched = 1;</code> */ public Builder clearPredicateMatched() { predicateMatched_ = false; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.bigtable.v2.CheckAndMutateRowResponse) } // @@protoc_insertion_point(class_scope:google.bigtable.v2.CheckAndMutateRowResponse) private static final com.google.bigtable.v2.CheckAndMutateRowResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.bigtable.v2.CheckAndMutateRowResponse(); } public static com.google.bigtable.v2.CheckAndMutateRowResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<CheckAndMutateRowResponse> PARSER = new com.google.protobuf.AbstractParser<CheckAndMutateRowResponse>() { @java.lang.Override public CheckAndMutateRowResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new CheckAndMutateRowResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<CheckAndMutateRowResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<CheckAndMutateRowResponse> getParserForType() { return PARSER; } @java.lang.Override public com.google.bigtable.v2.CheckAndMutateRowResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
27858c3c72a34a1be44a9e121af18686a52859eb
c603787a736afc48ac76c0272012a5c5193659db
/src/main/java/com/leetcode/snippets/a993cousinsinbinarytree/Solution.java
2e6887c099ccdad73db2c633dcf3752be55dfc98
[]
permissive
huajianmao/leetcode
b2a518ed68bbd637f6d6a0d9a0001d34d34606cf
cbde65aa275d6586af7e160a7e36c3fe19664d74
refs/heads/master
2021-01-11T20:54:40.123297
2019-11-04T08:55:40
2019-11-04T08:55:40
202,490,718
0
1
Apache-2.0
2019-08-24T09:06:27
2019-08-15T06:59:22
null
UTF-8
Java
false
false
1,181
java
package com.leetcode.snippets.a993cousinsinbinarytree; import cn.hjmao.utils.tree.TreeNode; /** * Created by hjmao. * * URL: * ===== * https://leetcode.com/problems/cousins-in-binary-tree/ * * Desc: * ===== * In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. * * Two nodes of a binary tree are cousins if they have the same depth, but have different parents. * * We are given the root of a binary tree with unique values, * and the values x and y of two different nodes in the tree. * * Return true if and only if the nodes corresponding to the values x and y are cousins. * * * * Example 1: * Input: root = [1,2,3,4], x = 4, y = 3 * Output: false * * Example 2: * Input: root = [1,2,3,null,4,null,5], x = 5, y = 4 * Output: true * * Example 3: * Input: root = [1,2,3,null,4], x = 2, y = 3 * Output: false * * * Note: * The number of nodes in the tree will be between 2 and 100. * Each node has a unique integer value from 1 to 100.} */ class Solution { protected static final boolean SOLUTION_DONE = false; public boolean isCousins(TreeNode root, int x, int y) { return false; } }
f51ee1d25507db5b3c5bf044aa9055dd4ab2dc68
4e660ecd8dfea06ba2f530eb4589bf6bed669c0c
/src/org/tempuri/Gf_updateEpsmJyjlInsertRegistResponse.java
5ca7b8c70a9129b573ec49108197c641386487e2
[]
no_license
zhangity/SANMEN
58820279f6ae2316d972c1c463ede671b1b2b468
3f5f7f48709ae8e53d66b30f9123aed3bcc598de
refs/heads/master
2020-03-07T14:16:23.069709
2018-03-31T15:17:50
2018-03-31T15:17:50
127,522,589
1
0
null
null
null
null
UTF-8
Java
false
false
4,548
java
/** * Gf_updateEpsmJyjlInsertRegistResponse.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.tempuri; public class Gf_updateEpsmJyjlInsertRegistResponse implements java.io.Serializable { private org.tempuri.ReturnExComm gf_updateEpsmJyjlInsertRegistResult; public Gf_updateEpsmJyjlInsertRegistResponse() { } public Gf_updateEpsmJyjlInsertRegistResponse( org.tempuri.ReturnExComm gf_updateEpsmJyjlInsertRegistResult) { this.gf_updateEpsmJyjlInsertRegistResult = gf_updateEpsmJyjlInsertRegistResult; } /** * Gets the gf_updateEpsmJyjlInsertRegistResult value for this Gf_updateEpsmJyjlInsertRegistResponse. * * @return gf_updateEpsmJyjlInsertRegistResult */ public org.tempuri.ReturnExComm getGf_updateEpsmJyjlInsertRegistResult() { return gf_updateEpsmJyjlInsertRegistResult; } /** * Sets the gf_updateEpsmJyjlInsertRegistResult value for this Gf_updateEpsmJyjlInsertRegistResponse. * * @param gf_updateEpsmJyjlInsertRegistResult */ public void setGf_updateEpsmJyjlInsertRegistResult(org.tempuri.ReturnExComm gf_updateEpsmJyjlInsertRegistResult) { this.gf_updateEpsmJyjlInsertRegistResult = gf_updateEpsmJyjlInsertRegistResult; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof Gf_updateEpsmJyjlInsertRegistResponse)) return false; Gf_updateEpsmJyjlInsertRegistResponse other = (Gf_updateEpsmJyjlInsertRegistResponse) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.gf_updateEpsmJyjlInsertRegistResult==null && other.getGf_updateEpsmJyjlInsertRegistResult()==null) || (this.gf_updateEpsmJyjlInsertRegistResult!=null && this.gf_updateEpsmJyjlInsertRegistResult.equals(other.getGf_updateEpsmJyjlInsertRegistResult()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getGf_updateEpsmJyjlInsertRegistResult() != null) { _hashCode += getGf_updateEpsmJyjlInsertRegistResult().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(Gf_updateEpsmJyjlInsertRegistResponse.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", ">gf_updateEpsmJyjlInsertRegistResponse")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("gf_updateEpsmJyjlInsertRegistResult"); elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "gf_updateEpsmJyjlInsertRegistResult")); elemField.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", "ReturnExComm")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
1d9713e6849236a8276dd4bf3ca220821dd2b54b
e07d5e3f6fac167229693d1779339499c8cf8b5f
/platform-web-mybatis/src/main/java/com/season/platform/web/api/controller/SysRoleController.java
189cd3d5143de93ca1f960423848c647183182b0
[]
no_license
sijifeng/spring-boot-scaffold
2386e9c4fcbd4d8665ad88798630e6e12fa6ce96
ffebfdc4ba2b9d1c0f47aec3b4635d2bf1004d03
refs/heads/master
2020-04-05T08:53:04.774829
2018-05-14T10:32:08
2018-05-14T10:32:08
81,720,502
1
0
null
null
null
null
UTF-8
Java
false
false
3,342
java
package com.season.platform.web.api.controller; import com.alibaba.fastjson.JSONArray; import com.season.platform.web.api.model.SysMenu; import com.season.platform.web.api.model.SysRole; import com.season.platform.web.api.service.SysMenuService; import com.season.platform.web.api.service.SysRoleService; import com.season.platform.web.common.entity.JsonResponseEntity; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by jiyc on 2017/3/4. */ public class SysRoleController extends BaseController { private static final Logger logger = LoggerFactory.getLogger(SysRoleController.class); @Autowired SysRoleService sysRoleService; @Autowired SysMenuService sysMenuService; @RequestMapping("/init") public String index(Model model) { return "system/role/list"; } @RequestMapping("/pageList") @ResponseBody public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start, @RequestParam(required = false, defaultValue = "10") int length, String system, String roleHandler) { //return sysRoleService.pageList(start, length, system, roleHandler); return null; } @RequestMapping("/role") @ResponseBody public JsonResponseEntity role(String roleId) { JsonResponseEntity jsonResponseEntity = new JsonResponseEntity(); Map<String, Object> attr = new HashMap<String, Object>(); try { SysRole sysRole = null; List<Integer> menuIds = null; if (StringUtils.isNotEmpty(roleId)) { sysRole = sysRoleService.selectById(roleId); attr.put("sysRole", sysRole); //menuIds = sysRoleService.findMenuByRoleId(roleId); } // 菜单信息 JSONArray json = new JSONArray(); List<SysMenu> menuList = sysMenuService.selectList(null); if (menuList != null && menuList.size() > 0) { for (SysMenu menu : menuList) { Map<String, Object> map = new HashMap<String, Object>(); /*map.put("id", menu.getMenuId()); map.put("name", menu.getMenuName()); map.put("pId", menu.getParentId()); // 选中角色拥有的菜单权限 if (menuIds != null && menuIds.contains(menu.getMenuId())) { map.put("checked", true); } else { map.put("checked", false); }*/ json.add(map); } } attr.put("menuList", json.toString()); getSuccessResponse(jsonResponseEntity, attr); } catch (Throwable e) { getErrorResponse(jsonResponseEntity, ERROR_CODE, null, e.getMessage()); } return jsonResponseEntity; } }
45f2a2d6a9befb0d8eba90ea26f73a204ba3f193
2650a4536187a55f0bbd2280629a8188d98900ca
/Surveys/src/main/java/com/oracle/surveys/exception/SurveyException.java
8fdcf6e01956768b591ef5db34fcf255aa1efec2
[]
no_license
AnitaRegi/myRepo
1a9c142bba04d9adc5e156ba24f59db52b726c7a
70d38003ad230a073e78a71f4b29637219eb75a4
refs/heads/main
2023-04-19T12:38:12.464735
2021-05-08T10:41:41
2021-05-08T10:41:41
355,653,708
1
0
null
null
null
null
UTF-8
Java
false
false
633
java
package com.oracle.surveys.exception; import org.springframework.http.HttpStatus; import lombok.Getter; import lombok.Setter; @Getter @Setter public class SurveyException extends RuntimeException { private static final long serialVersionUID = 8363315749392512290L; private final String errorCode; private final String errorMessage; private final HttpStatus httpStatusCode; private String field; public SurveyException(String errorCode, String errorMessage, HttpStatus httpStatusCode) { super(errorMessage); this.errorCode = errorCode; this.errorMessage = errorMessage; this.httpStatusCode = httpStatusCode; } }
[ "Anitta@DESKTOP-9B3R5JU" ]
Anitta@DESKTOP-9B3R5JU
c76304c3a6bbc5c4c6af8bb287fa2a2d1c4f655d
785891aa4e0f584e3be465930e35958b85f5b1fc
/day10/src/CourseLearn/xqx_1/Student.java
d36d324675db5476f0d75ffc09f02130b42b650c
[]
no_license
xqx1998/JavaSE
2157e19bd71f3f10866442007cfff2594d793b5c
cd3ae888ca6c7c660c8d2e9932655059a11eb9e0
refs/heads/master
2020-06-20T11:19:46.006800
2019-08-27T13:23:59
2019-08-27T13:23:59
197,106,265
0
0
null
null
null
null
UTF-8
Java
false
false
855
java
package CourseLearn.xqx_1; public class Student { //1、private修饰的成员变量 private String name; private int age; //2、空参构造和有参构造 public Student() { } public Student(String name, int age) { this.name = name; this.age = age; } //3、get和set方法 public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { if(age<0){ System.out.println("年龄不合法!"); }else{ this.age = age; } } @Override public String toString() { return "Student{" + "name='" + name + '\'' + ", age=" + age + '}'; } }
cf4a5eeef7d9ef2f2917bd67210f561da715d765
6d0315f200e41e1c3c1970313531e5184267344d
/aJavaProgrammingMasterclassForJavaDevelopers/src/main/java/iPackagesStaticAndFinalKeywords/fScopeContinued/ScopeCheck.java
331a45d79385399a96c754fe6fa74be807d98788
[ "MIT" ]
permissive
Andrei-Alexandru07/JavaCourses
6a724ff8ea35c9c64ef07d39871ce0ac2d0046fe
d5eb12a5743ca131ef0b0bc64cccb3ea563e21ac
refs/heads/master
2023-05-16T17:34:29.403505
2021-04-12T16:18:40
2021-04-12T16:18:40
278,724,118
0
0
MIT
2021-06-04T03:12:39
2020-07-10T20:09:05
Java
UTF-8
Java
false
false
1,145
java
package iPackagesStaticAndFinalKeywords.fScopeContinued; public class ScopeCheck { public int publicVar = 0; private int varOne = 1; public ScopeCheck(){ System.out.println("ScopeCheck created, publicVar = " + publicVar + ": varOne = " + varOne); } public int getVarOne() { return varOne; } public void timesTwo(){ int varTwo = 2; for (int i = 0; i < 10; i++){ System.out.println(i + " times two is " + i * varTwo); } } public void useInner() { InnerClass innerClass = new InnerClass(); System.out.println("varThree from outer class: " + innerClass.varThree); } public class InnerClass{ private int varThree = 3; public InnerClass(){ System.out.println("InnerClass created, varOne is " + varOne + " and varThree is " + varThree); } public void timesTwo(){ System.out.println("varOne is still available here " + varOne); for (int i = 0; i < 10; i++){ System.out.println(i + " times two is " + i * varThree); } } } }
365f2f022db54142793598e313e31eb37b1ec24c
b6339eaecb41f2aae5feccc18f3e1158b0005d0b
/engine/src/main/java/dev/game/spacechaos/engine/entity/priority/EntityUpdateOrderChangedListener.java
cdef78c7737521070202f28e5a40286bfafda71b
[ "Apache-2.0" ]
permissive
opensourcegamedev/SpaceChaos
93ff2e733c334e10adda7913f842f782125f5cf3
af36875cfee5af6d2debb7eaeb6b91c2df757001
refs/heads/master
2021-01-23T06:26:18.417624
2018-03-25T21:23:51
2018-03-25T21:23:51
86,369,859
15
1
null
null
null
null
UTF-8
Java
false
false
199
java
package dev.game.spacechaos.engine.entity.priority; /** * Created by Justin on 10.02.2017. */ public interface EntityUpdateOrderChangedListener { public void onEntityUpdateOrderChanged(); }
65f31a73b97beb6cdf6112ee247134b2d64cd5dc
52c9755341c62de45467f241b6026aa45f43cab4
/app/src/main/java/com/yhkj/yhsx/forestpolicemobileterminal/adapter/ShowAccessoryAdapter.java
74175276799c92f7ebda76a1baaaff9e3577843a
[ "Apache-2.0" ]
permissive
liweidev/ForestPoliceMobileTerminal
6443e7779491659db43386ff83cdce8ea569141a
6160743112f850a7b3458280b7a97d7a5f5d1db2
refs/heads/master
2020-03-29T08:11:02.655194
2017-06-18T06:33:47
2017-06-18T06:33:47
94,665,652
0
0
null
null
null
null
UTF-8
Java
false
false
3,290
java
package com.yhkj.yhsx.forestpolicemobileterminal.adapter; import android.app.Activity; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ImageView.ScaleType; import com.yhkj.yhsx.forestpolicemobileterminal.R; import com.yhkj.yhsx.forestpolicemobileterminal.utils.ImageManager2; import com.yhkj.yhsx.forestpolicemobileterminal.utils.NetworkConnections; import java.util.ArrayList; /** * 查询结果附件--适配器 * * @author xingyimin * */ public class ShowAccessoryAdapter extends BaseAdapter { private ArrayList<String> bitmapList; private Activity activity; public ShowAccessoryAdapter(Activity acitvity, ArrayList<String> bitmapList) { super(); // TODO Auto-generated constructor stub this.bitmapList = bitmapList; this.activity = acitvity; } @Override public int getCount() { // TODO Auto-generated method stub return bitmapList.size(); } @Override public Object getItem(int arg0) { // TODO Auto-generated method stub return bitmapList.get(arg0); } @Override public long getItemId(int arg0) { // TODO Auto-generated method stub return arg0; } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub Log.i("liupeng", "accessory position : " + position); if (null == convertView) { convertView = LayoutInflater.from(activity).inflate( R.layout.gridview_item_layout, parent, false); } ImageView iv = (ImageView) convertView.findViewById(R.id.nciv_pug); AbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams( 200, 200); iv.setLayoutParams(layoutParams); iv.setBackgroundResource(R.drawable.image_add_bg); String type = bitmapList.get(position).substring( bitmapList.get(position).lastIndexOf(".") + 1); iv.setTag(bitmapList.get(position)); if (type.equals("jpg") || type.equals("png")) { iv.setAdjustViewBounds(true); iv.setScaleType(ScaleType.FIT_XY); iv.setPadding(10, 10, 10, 10); iv.setTag(position); if (bitmapList.get(position).indexOf("http://") != -1) { NetworkConnections.init(activity).setImageUrl(iv, bitmapList.get(position), 60, 60, R.drawable.upload, android.R.drawable.ic_menu_report_image); } else { ImageManager2.from(activity).displayImage(iv, bitmapList.get(position), -1); } } else if (type.equals("mp4") || type.equals("3gp") || type.equals("avi") || type.equals("rmvb") || type.equals("wmv")) { iv.setAdjustViewBounds(true); iv.setTag(position); iv.setScaleType(ScaleType.FIT_XY); iv.setPadding(24, 26, 24, 26); ImageManager2.from(activity).displayImage(iv, bitmapList.get(position), R.drawable.presence_video_online); } else if (type.equals("3gpp") || type.equals("amr") || type.equals("ogg") || type.equals("pcm") || type.equals("mp3")) { iv.setAdjustViewBounds(true); iv.setTag(position); iv.setScaleType(ScaleType.FIT_XY); iv.setPadding(24, 22, 24, 22); ImageManager2.from(activity).displayImage(iv, bitmapList.get(position), R.drawable.presence_audio_online); } return iv; } }
b7c700520fef313537d282497d4f7475c4b32b6f
4d3aec46f0317936b7928e68e17d1f1d4efab662
/src/com/hanains/composite/ComponentTest.java
af30f14b96fae719e5a30b17a701ae2f1c664f73
[]
no_license
kinamJung/designpattern
57a1bdc07b209b79fa6871b65c7c98a31114695e
73ac850cc63d4733fe17178c09e9706db1b175a3
refs/heads/master
2021-01-10T08:22:12.020314
2016-01-29T01:36:55
2016-01-29T01:36:55
49,390,884
0
0
null
null
null
null
UTF-8
Java
false
false
1,483
java
package com.hanains.composite; /* Composite Pattern - 추상적인 상위 클래스 하나를 만들고 그 클래스를 상속받는 다양한 자식들을 만들어 결국, 다양한 자식 객체들을 같은 종류의 객체를 다루듯이 동일 시 해서 사용하겠다는 패턴이다. ex) 폴더 안의 파일 출력.(폴더는 출력이 안된다.) 구조. root ---- folder1 ---- SubFolder1 ---- SubFile1 SubFolder1 ---- SubFile2 SubFolder1 ---- SubFile3 SubFolder2 File1 folder2 ---- file1 file2 folder3 */ public class ComponentTest { public static void main(String[] args) throws Exception { Folder rootFolder = new Folder("root"); Folder folder1 = new Folder("folder1"); Folder folder2 = new Folder("folder2"); Folder folder3 = new Folder("folder3"); rootFolder.add(folder1); rootFolder.add(folder2); rootFolder.add(folder3); folder1.add(new File("file1", 100)); folder2.add(new File("file2", 100)); folder2.add(new File("file3", 300)); Folder subFolder1 = new Folder("subFolder1"); Folder subFolder2 = new Folder("subFolder2"); folder1.add(subFolder1); folder1.add(subFolder2); subFolder1.add(new File("subFile1", 100)); subFolder1.add(new File("subFile2",100)); subFolder1.add(new File("subFile3",200)); rootFolder.printList(); System.out.println( "Total Size : "+ rootFolder.getSize() ); } }
c0cd02a41efb940c759412f6b1b65ac16cb2b768
fdcf5d56f87684db740971bb0b0fe04f9e119cfa
/设计模式/18、策略模式/strategy/src/main/java/com/company/section1/ZhaoYun.java
5a2cdbe22cd33e294c9af0b26982d14cc9920a8c
[]
no_license
glacier0315/design-pattern
76428a128491e015379e01e6170d1da91ff29a07
55ad2b044ae1dc6ebfd3a002b292792e003715b0
refs/heads/main
2021-07-10T13:55:00.705336
2017-04-11T09:28:51
2017-04-11T09:28:51
87,915,297
1
1
null
2021-04-30T08:50:15
2017-04-11T09:25:27
Java
UTF-8
Java
false
false
1,549
java
/** * */ package com.company.section1; /** * @author cbf4Life [email protected] * I'm glad to share my knowledge with you all. */ public class ZhaoYun { //赵云出场了,他根据诸葛亮给他的交代,依次拆开妙计 public static void main(String[] args) { Context context; //刚刚到吴国的时候拆第一个 System.out.println("---刚刚到吴国的时候拆第一个---"); context = new Context(new BackDoor()); //拿到妙计 context.operate(); //拆开执行 System.out.println("\n\n\n\n\n\n\n\n"); //刘备乐不思蜀了,拆第二个了 System.out.println("---刘备乐不思蜀了,拆第二个了---"); context = new Context(new GivenGreenLight()); context.operate(); //执行了第二个锦囊了 System.out.println("\n\n\n\n\n\n\n\n"); //孙权的小兵追了,咋办?拆第三个 System.out.println("---孙权的小兵追了,咋办?拆第三个---"); context = new Context(new BlockEnemy()); context.operate(); //孙夫人退兵 System.out.println("\n\n\n\n\n\n\n\n"); /* *问题来了:赵云实际不知道是那个策略呀,他只知道拆第一个锦囊, *而不知道是BackDoor这个妙计,咋办? 似乎这个策略模式已经把计谋名称写出来了 * * 错!BackDoor、GivenGreenLight、BlockEnemy只是一个代码,你写成first、second、third,没人会说你错! * * 策略模式的好处就是:体现了高内聚低耦合的特性呀,缺点嘛,这个那个,我回去再查查 */ } }
e64925408f151a0e0f72a477e1bb802aa16c11c2
4b1a6744a7483d9ba23996e89e8cb1679651e260
/server/src/model/RestaurantTest.java
236a84294f1f846a028e0a1cbc28ad11bdb5dc07
[]
no_license
YiLingPredator/restaurant
d3e3d4b1e5c74af9df331ee5a7645f6a7d810c6f
ab748e09b52483cf35173411059dd774b2dc4209
refs/heads/master
2021-01-12T07:46:51.661616
2016-12-21T03:51:50
2016-12-21T03:51:50
77,012,938
1
0
null
2016-12-21T03:35:55
2016-12-21T03:35:55
null
UTF-8
Java
false
false
5,467
java
package model; import static org.junit.Assert.*; import java.util.HashSet; import java.util.Set; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; public class RestaurantTest { Restaurant restaurant; boolean jsonArrayStringEquals(JSONArray arr1, JSONArray arr2) { Set<String> set1 = new HashSet<String>(); Set<String> set2 = new HashSet<String>(); try { for (int i = 0; i < arr1.length(); i++) { set1.add(arr1.getString(i)); } for (int i = 0; i < arr2.length(); i++) { set2.add(arr2.getString(i)); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } return set1.equals(set2); } @Test public void testStringToJSONArray() { JSONArray jsonArray = new JSONArray(); assertTrue(jsonArrayStringEquals(jsonArray, Restaurant.stringToJSONArray(","))); jsonArray.put(""); assertTrue(jsonArrayStringEquals(jsonArray, Restaurant.stringToJSONArray(""))); jsonArray.put("Chinese"); assertTrue(jsonArrayStringEquals(jsonArray, Restaurant.stringToJSONArray(",Chinese"))); jsonArray.put(""); assertTrue(jsonArrayStringEquals(jsonArray, Restaurant.stringToJSONArray(",Chinese,"))); jsonArray.put("Italian"); assertTrue(jsonArrayStringEquals(jsonArray, Restaurant.stringToJSONArray("Italian,,Chinese,"))); } @Test public void testJsonArrayToString() { JSONArray jsonArray = new JSONArray(); jsonArray.put("Chinese"); jsonArray.put("Japanese"); jsonArray.put("Italian"); assertEquals("Chinese,Japanese,Italian", Restaurant.jsonArrayToString(jsonArray)); } @Test public void testJsonArrayToStringCornerCases() { JSONArray jsonArray = new JSONArray(); assertEquals("", Restaurant.jsonArrayToString(jsonArray)); jsonArray.put("Chinese"); assertEquals("Chinese", Restaurant.jsonArrayToString(jsonArray)); jsonArray.put("Japanese"); jsonArray.put(""); String str = Restaurant.jsonArrayToString(jsonArray); assertEquals("Chinese,Japanese,", str); } @Rule public TestName name = new TestName(); @Before public void setUp() { restaurant = new Restaurant("yam-leaf-bistro-mountain-view", "Yam Leaf Bistro", "Vegetarian,vegetarian,Vegan,vegan,Gluten-Free,gluten_free", "Mountain View", "CA", 4.5, "699 Calderon Ave,Mountain View, CA 94041", 37.3851249, -122.075775, "http://s3-media1.fl.yelpcdn.com/bphoto/6NchHRhvHpVj4DXs2WQATw/ms.jpg", "http://www.yelp.com/biz/yam-leaf-bistro-mountain-view"); } @Test public void testRestaurantConstructor() { String jsonString = "{\"is_claimed\": true, \"rating\": 4.5, \"mobile_url\": \"http://m.yelp.com/biz/yam-leaf-bistro-mountain-view\", \"rating_img_url\": \"http://s3-media2.fl.yelpcdn.com/assets/2/www/img/99493c12711e/ico/stars/v1/stars_4_half.png\", \"review_count\": 204, \"name\": \"Yam Leaf Bistro\", \"snippet_image_url\": \"http://s3-media4.fl.yelpcdn.com/photo/JYmqUtFxgYe-dbbcTqqzkw/ms.jpg\", \"rating_img_url_small\": \"http://s3-media2.fl.yelpcdn.com/assets/2/www/img/a5221e66bc70/ico/stars/v1/stars_small_4_half.png\", \"url\": \"http://www.yelp.com/biz/yam-leaf-bistro-mountain-view\", \"categories\": [[\"Vegetarian\", \"vegetarian\"], [\"Vegan\", \"vegan\"], [\"Gluten-Free\", \"gluten_free\"]], \"phone\": \"6509409533\", \"snippet_text\": \"Phenomenal Pan-Latin vegetarian, vegan (any dish can be made vegan), and gluten-free dishes. There selection of organic wines and beers is incredible--I go...\", \"image_url\": \"http://s3-media1.fl.yelpcdn.com/bphoto/6NchHRhvHpVj4DXs2WQATw/ms.jpg\", \"location\": {\"city\": \"Mountain View\", \"display_address\": [\"699 Calderon Ave\", \"Mountain View, CA 94041\"], \"geo_accuracy\": 9.5, \"postal_code\": \"94041\", \"country_code\": \"US\", \"address\": [\"699 Calderon Ave\"], \"coordinate\": {\"latitude\": 37.3851249, \"longitude\": -122.075775}, \"state_code\": \"CA\"}, \"display_phone\": \"+1-650-940-9533\", \"rating_img_url_large\": \"http://s3-media4.fl.yelpcdn.com/assets/2/www/img/9f83790ff7f6/ico/stars/v1/stars_large_4_half.png\", \"id\": \"yam-leaf-bistro-mountain-view\", \"is_closed\": false, \"distance\": 681.2472686205965}"; Restaurant new_restaurant = null; try { new_restaurant = new Restaurant(new JSONObject(jsonString)); } catch (JSONException e) { e.printStackTrace(); fail(); } assertEquals(restaurant.getBusinessId(), new_restaurant.getBusinessId()); assertEquals(restaurant.getName(), new_restaurant.getName()); assertEquals(restaurant.getCategories(), new_restaurant.getCategories()); assertEquals(restaurant.getCity(), new_restaurant.getCity()); assertEquals(restaurant.getState(), new_restaurant.getState()); assertEquals(restaurant.getFullAddress(), new_restaurant.getFullAddress()); assertEquals(restaurant.getStars(), new_restaurant.getStars(), 0); assertEquals(restaurant.getLatitude(), new_restaurant.getLatitude(), 0); assertEquals(restaurant.getLongitude(), new_restaurant.getLongitude(), 0); assertEquals(restaurant.getImageUrl(), new_restaurant.getImageUrl()); assertEquals(restaurant.getUrl(), new_restaurant.getUrl()); } @After public void tearDown() { //System.out.println("Test finished: " + name.getMethodName()); } }
f66ec4c65c9d39b6ae58a2f042b7a2d3e4b97a2c
fd40ad51bdc902a4fbb5e28068a91ed379e63699
/src/com/mohit/greeksofgreeks/linklist/SwapNodesWithExchangeData.java
478a2eefe661ca70a5f723b7ba6c814ad64bc9f0
[]
no_license
mohitgargt103/java_problems_practice
1fab10b1e3f600a1905d6325e43e6bfc712e3519
17386443f620a2b7bed4d0df7109996a1f40ed4e
refs/heads/master
2021-07-20T04:11:42.722430
2020-07-02T10:36:33
2020-07-02T10:36:33
155,153,713
0
0
null
null
null
null
UTF-8
Java
false
false
2,428
java
package com.mohit.greeksofgreeks.linklist; import com.mohit.leetcode.linklist.ListNode; public class SwapNodesWithExchangeData { public static void main(String[] args) { SwapNodesWithExchangeData sol = new SwapNodesWithExchangeData(); ListNode head = new ListNode(1); head.next = new ListNode(2); head.next.next = new ListNode(3); head.next.next.next = new ListNode(4); head.next.next.next.next = new ListNode(5); head.next.next.next.next.next = new ListNode(6); head.next.next.next.next.next.next = new ListNode(7); sol.swapNodes(head, 3, 5); } public ListNode swapNodes(ListNode head, int x, int y) { if (head == null || x == y) return head; ListNode prevX = null; ListNode prevY = null; ListNode currX = head; while (currX != null && currX.val != x) { prevX = currX; currX = currX.next; } ListNode currY = head; while (currY != null && currY.val != y) { prevY = currY; currY = currY.next; } // there is no element to swap if (prevX == null && prevY == null) { return head; } // check if x not head if (prevX != null) { prevX.next = currY; } else { head = currY; } // check if y not head if (prevY != null) { prevY.next = currX; } else { head = currX; } // Swap next pointers ListNode temp = currX.next; currX.next = currY.next; currY.next = temp; return head; } public ListNode swapNodes_(ListNode head, int x, int y) { if (head == null || x == y) return head; ListNode prevX = null; ListNode prevY = null; ListNode curr = head; while (curr != null && curr.next != null) { if (curr.next.val == x) { prevX = curr; } if (curr.next.val == y) { prevY = curr; } } if (prevX != null && prevY != null) { ListNode temp = prevX.next; prevX.next = prevY.next; prevY.next = temp; temp = prevX.next.next; prevX.next.next = prevY.next.next; prevY.next.next = temp; } return head; } }
79a0003e3e373181bbe10f5c94be54b2ae30cd99
8f0273bc3b57809b0dbc932fa60d3259886b9323
/src/main/java/schema/registry/servlet/EncodeServlet.java
71e540990a022401f341564f646d65067ad6e602
[]
no_license
Dieken/SchemaRegistry
db2aa6a68f4cd95b4937751f131a1f6a7636fb23
85dcc59a480d697745a34f38ad1229f2c732a167
refs/heads/master
2020-06-13T04:50:42.835690
2014-02-27T10:17:52
2014-02-27T10:17:52
17,244,887
7
0
null
null
null
null
UTF-8
Java
false
false
3,053
java
package schema.registry.servlet; import java.io.IOException; import java.io.OutputStream; import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.ServletOutputStream; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import schema.registry.AttachmentUtil; import schema.registry.FilterStreamUtil; import schema.registry.SchemaInfo; import schema.registry.SchemaRegistry; @WebServlet(name = "EncodeServlet", urlPatterns = {"/e/*"}) public class EncodeServlet extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { SchemaRegistry registry = (SchemaRegistry) request.getServletContext() .getAttribute(SchemaRegistryServletContextListener.SCHEMA_REGISTRY); response.setContentType("text/plain; charset=utf-8"); try (ServletInputStream in = request.getInputStream(); ServletOutputStream out = response.getOutputStream()) { String id = request.getPathInfo(); if (id == null || id.equals("/")) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); out.println("schema ID isn't specified in URI path"); return; } id = id.substring(1); SchemaInfo schema = registry.getSchemas().get(id); if (schema == null) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); out.println("schema ID isn't found"); return; } OutputStream filterOut = null; try { response.setContentType("application/octet-stream"); filterOut = FilterStreamUtil.filter(out, request.getParameter("f")); AttachmentUtil.attach(request, response, id + "-" + System.currentTimeMillis() + ".dat"); registry.serialize(id, request.getParameter("m"), in, filterOut, request.getParameterMap()); } catch (Exception ex) { response.setContentType("text/plain; charset=utf-8"); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); out.println(ex.getMessage()); request.getServletContext().log("fail to decode", ex); } finally { if (out != filterOut && filterOut != null) { filterOut.close(); } } } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } @Override protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } }
d19599071acefd960de1aef8a2eac4c702e791c9
7adc32323bd5407774c8f78a4d635dc07984f566
/gen/com/example/anf/BuildConfig.java
2553b8b610763d24d7c08e8811b7e4b19f3155d8
[]
no_license
malditotm/ANF
558e494140faa19ae32e0c4656cc9bb1f8f51f1f
308f58fb21841c7e64e4f2070d1d037797b49c76
refs/heads/master
2020-07-03T22:09:53.046336
2015-10-26T05:33:00
2015-10-26T05:33:00
44,947,979
0
0
null
null
null
null
UTF-8
Java
false
false
157
java
/** Automatically generated file. DO NOT MODIFY */ package com.example.anf; public final class BuildConfig { public final static boolean DEBUG = true; }
65e427487967dc1d5406c2a6064f016c9ca43661
daf6ce03035f0e6f96a9fdf6edbf83287bcecc54
/Spring5Test - ch04 - security/src/main/java/com/example/demo/controller/OrderController.java
797778389d8e1c051c1e54b63bc5c1b1eabfc7cf
[]
no_license
NorJing/JavaSpring5Learning
106099c68b19c97a287207699bf639ce30a75bdd
77e79c0de48af77b77a251470e4c3f73b8c4bdae
refs/heads/master
2021-01-06T13:27:29.270754
2020-02-18T12:44:44
2020-02-18T12:44:44
241,342,959
0
0
null
null
null
null
UTF-8
Java
false
false
3,470
java
package com.example.demo.controller; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.Errors; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.bind.support.SessionStatus; import com.example.demo.domain.DeliveryBox; import com.example.demo.domain.Ingredient; import com.example.demo.domain.Order; import com.example.demo.domain.Taco; import com.example.demo.domain.User; import com.example.demo.domain.DeliveryBox.DType; import com.example.demo.repository.DeliveryBoxRepository; import com.example.demo.repository.OrderRepository; import lombok.extern.slf4j.Slf4j; @Slf4j @Controller @RequestMapping("/orders") @SessionAttributes("order") public class OrderController { private OrderRepository orderRepo; private DeliveryBoxRepository deliveryBoxRepo; @Autowired public OrderController(OrderRepository orderRepo, DeliveryBoxRepository deliveryBoxRepo) { this.orderRepo = orderRepo; this.deliveryBoxRepo = deliveryBoxRepo; } @GetMapping("/current") public String orderForm(Model model, @AuthenticationPrincipal User user, @ModelAttribute Order order) { List<DeliveryBox> deliveryBox = new ArrayList<>(); deliveryBoxRepo.findAll().forEach(i -> deliveryBox.add(i)); DType[] types = DeliveryBox.DType.values(); for (DType type : types) { log.info("type=" + type.toString().toLowerCase() + " filterByType=" + filterByType(deliveryBox, type)); model.addAttribute(type.toString().toLowerCase(), filterByType(deliveryBox, type)); } if (order.getDeliveryName() == null) { order.setDeliveryName(user.getFullname()); } if (order.getDeliveryStreet() == null) { order.setDeliveryStreet(user.getStreet()); } if (order.getDeliveryCity() == null) { order.setDeliveryCity(user.getCity()); } if (order.getDeliveryState() == null) { order.setDeliveryState(user.getState()); } if (order.getDeliveryZip() == null) { order.setDeliveryZip(user.getZip()); } return "orderForm"; } private List<DeliveryBox> filterByType(List<DeliveryBox> boxes, DType type) { return boxes.stream().filter(x -> x.getSize().equals(type)).collect(Collectors.toList()); } @PostMapping public String processOrder(@Valid Order order, Errors errors, SessionStatus sessionStatus) { if (errors.hasErrors()) { return "orderForm"; } log.info("controller fastDelivery=" + order.getFastDelivery()); log.info("controller deliveryBox=" + order.getDeliveryBox()); Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); User user = (User) authentication.getPrincipal(); order.setUser(user); orderRepo.save(order); sessionStatus.setComplete(); log.info("Order submitted: " + order); return "redirect:/"; } }
90324629fe3842d7437ae09931756c1390256839
de16c78c8b8a62884973b5cd278b3b0747e3f164
/B/Other/src/XyesTest.java
582a3d2c5868f0a78026f68d3a5d414c0884925e
[]
no_license
Tianqi-Li-Blanks/CS4500
ee648401f878fda5ccb9599527e5a1ee497545ec
f27206fc1cd5289e56ea39f3f1c4f672ee3db49b
refs/heads/master
2023-02-26T07:56:20.535301
2021-02-04T06:41:23
2021-02-04T06:41:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,793
java
import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import static org.junit.Assert.*; /** * Test Class for Xyes. */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class XyesTest { private final Xyes xyes = new Xyes(); /** * a helper to repeat a string. * @param s the string to repeat * @param n the number of times to repeat * @return a string */ private String repeatStr(String s, int n){ // this line is copied from: // https://stackoverflow.com/questions/1235179/simple-way-to-repeat-a-string-in-java // user102008's answer, edited by Jin Kwon. return new String(new char[n]).replace("\0", s); } @Test public void A_testLimited1() { String[] arguments = {"-limit", "Hi", "Prof"}; ByteArrayOutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); xyes.main(arguments); assertEquals(outContent.toString(), repeatStr("Hi Prof\n",20)); } @Test public void A_testLimited2() { String[] arguments = {"-limit"}; ByteArrayOutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); xyes.main(arguments); assertEquals(outContent.toString(), repeatStr("\n",20)); } @Test public void B_testInfinite1() throws InterruptedException { String testString = "testString"; String[] arguments = {testString}; ByteArrayOutputStream outContent1 = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent1)); Thread thread = new Thread(() -> xyes.main(arguments)); thread.start(); Thread.sleep(10); String output1 = outContent1.toString(); Thread.sleep(10); String output2 = outContent1.toString(); thread.stop(); assertTrue( output2.length() >= output1.length()); assertTrue(output1.startsWith("testString")); } @Test public void B_testInfinite2() throws InterruptedException{ String[] arguments = {}; ByteArrayOutputStream outContent2 = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent2)); Thread thread = new Thread(() -> xyes.main(arguments)); thread.start(); Thread.sleep(10); String output1 = outContent2.toString().replace("testString\n",""); Thread.sleep(10); String output2 = outContent2.toString().replace("testString\n",""); thread.stop(); assertTrue( output2.length() >= output1.length()); assertTrue(output1.startsWith("Hello World")); } }
1b5a109c3de49930fcfa6073fd91762f1d7bf1bf
9e0a246deb2922aba7f0240eb36aa283e538b6da
/PPL/src/model/m_farmCalculator.java
b4b2464615050d82ab1d6582af21cd8b0f7fad52
[]
no_license
ulfathoniahmad/ppl
a7739e0f4e2c3a76d9770174bc95a3cc594c2c05
b6728a0a2151b6348db9a5c9e99b7b00c6c36faf
refs/heads/master
2021-08-23T05:18:43.294452
2017-12-03T15:46:11
2017-12-03T15:46:11
111,688,248
0
0
null
null
null
null
UTF-8
Java
false
false
591
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 JEE */ public class m_farmCalculator { public double Urea(double nitrogen) { double n = (100 * nitrogen) / 46; return n; } public double SSP(double posfor) { double p = (100 * posfor) / 18; return p; } public double MOP(double kalium) { double k = (100 * kalium) / 64; return k; } }
c0fe8cdadc347bbe7ffb455f406e1aa1003f5f03
eff3d82a6bf4e83aa70ec9509c443874fc0af382
/src/main/java/br/ueg/biblio/view/managedbean/IdiomaBean.java
7b9323157f30fe00e28f7ef603e1092fa7aef409
[]
no_license
nadinael/biblioteca
0c0fcc7dd4ff40c6ee529d53087f60480c9f464c
b7021bc24ab556cbe71f8fe969f239313382a67e
refs/heads/master
2021-01-24T10:28:25.753942
2016-10-06T03:26:51
2016-10-06T03:26:51
69,998,414
0
0
null
null
null
null
UTF-8
Java
false
false
2,522
java
package br.ueg.biblio.view.managedbean; import br.ueg.biblio.core.PersistenceCore; import br.ueg.biblio.core.RepositoryCore; import br.ueg.biblio.model.Autor; import br.ueg.biblio.model.Idioma; import br.ueg.biblio.model.interfaces.Injetavel; import br.ueg.biblio.util.ManagedBeanUtil; import java.io.Serializable; import java.util.List; import javax.faces.view.ViewScoped; import javax.inject.Named; import javax.inject.Inject; @Named(value = "idiomaBean") @ViewScoped public class IdiomaBean implements Injetavel { @Inject private PersistenceCore persistence; @Inject private RepositoryCore repository; private Idioma idioma; private Idioma editandoIdioma; private List<Idioma> listaIdiomas; private boolean tabelaPronta; /*METODOS DE CONFIGURAÇÕES*/ public void configurarForm() { if (ManagedBeanUtil.isNotPostback()) { System.out.println("não é postback".toUpperCase()); prepararFormulário(); } else { System.out.println("é postback".toUpperCase()); } } private void prepararFormulário() { this.setIdioma(new Idioma()); } public void configurarTabela() { if (ManagedBeanUtil.isNotPostback()) { this.editandoIdioma = new Idioma(); this.tabelaPronta = false; } else { System.out.println("é postback".toUpperCase()); } } public void carregarDados() { this.listaIdiomas = repository.listaDeIdiomas(); this.tabelaPronta = true; } /* METODOS DE ACAO */ public void salvar() { if (persistence.persistir(getIdioma())) { prepararFormulário(); ManagedBeanUtil.addInfoMessage("Idioma armazenado com sucesso."); } else { ManagedBeanUtil.addErrorMessage("Não foi ppossível armazenar informaçõe."); } } /* GETTERS E SETTERS */ public Idioma getIdioma() { return idioma; } public void setIdioma(Idioma idioma) { this.idioma = idioma; } public List<Idioma> getListaIdiomas() { return listaIdiomas; } public boolean isTabelaPronta() { return tabelaPronta; } public Idioma getEditandoIdioma() { return editandoIdioma; } public void setEditandoIdioma(Idioma editandoIdioma) { this.editandoIdioma = editandoIdioma; } }
206778800573456b1c58524c4159859b383ea6bd
f7bdfeef3697c5166ecfcec944a1df65d81a8e47
/app/src/main/java/com/example/altice/tictactoe/ScoreActivity.java
df54e62c0a82d4454f23f18936cbf63422429ef5
[]
no_license
JhonITT/tic-tac-toe
920eee6da68770849b451915b96fabc38f8362d3
b013c4f510a0e52bf10585b9d674f2744e249405
refs/heads/master
2020-04-10T21:11:19.654422
2018-03-10T05:29:50
2018-03-10T05:29:50
124,168,490
0
0
null
null
null
null
UTF-8
Java
false
false
1,280
java
package com.example.altice.tictactoe; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import com.example.altice.tictactoe.controllers.Repository; public class ScoreActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_score); TextView tvScore = findViewById(R.id.tvScore); TextView tvWin = findViewById(R.id.tvWin); TextView tvDraw = findViewById(R.id.tvDraw); TextView tvLose = findViewById(R.id.tvLose); ListView lsHistory = findViewById(R.id.lvHistory); ArrayAdapter<String> itemsAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, Repository.instance.histories()); lsHistory.setAdapter(itemsAdapter); tvScore.setText(Integer.toString(Repository.instance.getScore())); tvWin.setText(Integer.toString(Repository.instance.getWins())); tvDraw.setText(Integer.toString(Repository.instance.getDraws())); tvLose.setText(Integer.toString(Repository.instance.getLoses())); } }
342ebd5f754dafd4a0a489e5ed4ac7aa2c4c9b95
0ed9effaeea94f2789873878754bbc0a6905a3f0
/Game/src/de/tEngine/shaders/GuiShader.java
700ea3d3ad46817d362277d53ec25c08d1129c87
[]
no_license
TimPhillip/tEngine
c556fa5446d28d54123ab9504f67425d9c36424d
50a09e1ca7f286eaca03f64a31fae744362356e1
refs/heads/master
2021-01-18T14:09:49.712792
2015-03-05T14:34:37
2015-03-05T14:34:37
28,607,334
0
0
null
null
null
null
UTF-8
Java
false
false
798
java
package de.tEngine.shaders; import de.tEngine.math.Matrix4f; public class GuiShader extends Shader { private static final String VERTEX_FILE = "src/de/tEngine/shaders/gui.vs.glsl"; private static final String FRAGMENT_FILE = "src/de/tEngine/shaders/gui.fs.glsl"; private int transformationMatrix_Location; public GuiShader(){ super(VERTEX_FILE,FRAGMENT_FILE); } @Override protected void bindAttributes() { super.bindAttribute(0, "Position"); super.bindAttribute(1, "TexCoord"); } @Override protected void GetAllUniformLocations() { transformationMatrix_Location = super.GetUniformLocation("Transformation"); } public void SetTransformation(Matrix4f transform){ super.SetUniformMatrix4f(transformationMatrix_Location, transform); } }
83b767d2d3bfd2906a6f8c8510e3143a47103cd0
2548d35c32b63d1b1c813702a8a739c7f0ef657e
/src/main/java/org/intellij/xquery/settings/XQueryConfigurable.java
5a186c171f6cc332aa5bb2ce12d785c9024956a0
[ "Apache-2.0" ]
permissive
overstory/marklogic-intellij-plugin
5a0da9e0e2f3771fa2444e56af4e24991fd3e077
82a07f36b7ac79fa0b701d3caaa67846d9dce896
refs/heads/master
2022-05-11T07:55:04.498910
2020-02-20T09:37:01
2020-02-20T09:37:01
84,892,241
12
2
Apache-2.0
2022-05-04T12:11:09
2017-03-14T01:38:44
Java
UTF-8
Java
false
false
2,836
java
/* * Copyright 2013-2015 Grzegorz Ligas <[email protected]> and other contributors * (see the CONTRIBUTORS file). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.intellij.xquery.settings; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.Nullable; import javax.swing.*; public class XQueryConfigurable implements Configurable { public static final String CONFIGURABLE_NAME = "XQuery"; private final XQuerySettingsFormFactory settingsFormFactory = getSettingsFormFactory(); private final Project project; private XQuerySettingsForm settingsForm; public XQueryConfigurable(Project project) { this.project = project; } @Nls @Override public String getDisplayName() { return CONFIGURABLE_NAME; } @Nullable @Override public String getHelpTopic() { return null; } @Nullable @Override public JComponent createComponent() { if (settingsForm == null) { settingsForm = settingsFormFactory.getSettingsForm(); } return settingsForm.getFormComponent(); } @Override public boolean isModified() { if (settingsForm != null) { return settingsForm.isModified(); } return false; } @Override public void apply() throws ConfigurationException { if (settingsForm != null) { boolean restartAnnotations = false; if (isModified()) { restartAnnotations = true; } getSettings().loadState(settingsForm.getSettings()); if (restartAnnotations) { UIUtils.restartDaemons(); } } } @Override public void reset() { if (settingsForm != null) { settingsForm.setSettings(getSettings()); } } @Override public void disposeUIResources() { settingsForm = null; } protected XQuerySettings getSettings() { return XQuerySettings.getInstance(project); } protected XQuerySettingsFormFactory getSettingsFormFactory() { return new XQuerySettingsFormFactory(); } }
c7c41ef4f3176f4a43321546823daac34173ce44
4f0a7404d3f92fc0c9dd43b35f498642578ad800
/IPS_l33_Sprint1/src/pgh/business/antecedentesClinicos/ListaAntecedentes.java
acbacb54367e54d4a333d7287ae91bb3af6cfb35
[]
no_license
nicomencia/IPS21_L33
f7892ac8137e2855a41ca0d9839fb96b4a124638
63aa16209a5501d996a916a797833170ad8d8de1
refs/heads/master
2023-02-11T17:01:26.122507
2020-12-15T07:56:46
2020-12-15T07:56:46
301,148,334
1
0
null
2020-11-30T16:40:15
2020-10-04T14:24:54
Java
UTF-8
Java
false
false
1,444
java
package pgh.business.antecedentesClinicos; import java.util.ArrayList; import java.util.List; import pgh.business.prescripcion.FindAllPrescripciones; import pgh.business.prescripcion.Prescripcion; import pgh.business.prescripcion.PrescripcionDTO; public class ListaAntecedentes { List<AntecedentesDTO> result ; List<AntecedentesDTO> result1 ; List<Antecedentes> antecedentes = new ArrayList<Antecedentes>(); List<Antecedentes> antecedentes1 = new ArrayList<Antecedentes>(); public ListaAntecedentes(int idPaciente) { result = new FindAllAntecedentes().execute(); result1 = new FindAllAntecedentes().FindIdPaciente(idPaciente); } public List<Antecedentes> getAntecedentes(){ return antecedentes; } public List<Antecedentes> getAntecedentesFiltrados(){ return antecedentes1; } public void creaListaAntecedentes() { for(AntecedentesDTO p : result) { Antecedentes antecedente = new Antecedentes(p); antecedentes.add(antecedente); } } public void creaListaAntecedentesFiltrados() { for(AntecedentesDTO p : result1) { Antecedentes antecedente = new Antecedentes(p); antecedentes1.add(antecedente); } } public void listarAntecedentes() { for (AntecedentesDTO p : result) { System.out.println(p.idAntecedenteClinico); System.out.println(p.descripcion); System.out.println(p.horaAsignacion); System.out.println(p.diaAsignacion); } } }
be157964e34fda4c104111071dc8bc09cde37ae4
7a4bb2e33080624227dc308e5aebf7a943d45796
/clusterdemo/src/main/java/com/anand/test/clustertest/redisson/clusterdemo/aop/RCacheGet.java
0b1cb3a34721c8faef1a0676330e3c1edd6cd6ab
[]
no_license
anandbose79/RedissonSample
6db9b7730a97cec23c3c08589ff4f6ff004ab00e
fcc39d3e5cec729dbc4f0e30cba55296dd485a01
refs/heads/master
2021-08-17T07:32:45.245141
2017-11-20T23:13:32
2017-11-20T23:13:32
109,770,442
0
0
null
null
null
null
UTF-8
Java
false
false
408
java
package com.anand.test.clustertest.redisson.clusterdemo.aop; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface RCacheGet { String cacheName() default "default"; String key() default ""; }
5adf38f8d0519ee430207a4f29a4207f087af0f8
47bd57b36eb777dead94f0925f7922fb76f5b94f
/taotao-sso/taotao-sso-interface/src/main/java/com/taotao/sso/service/UserService.java
324591dd78723cdcd6d17578f654c7dcc9f6ff8b
[]
no_license
duchaochen/taotao
b76f4dcf45a3c86ebda241fb61a6cc4e5ba82575
d9a66449c4e7d7cd45964b298c46a1cf9ca43cbe
refs/heads/master
2020-03-24T13:15:25.904861
2018-09-12T13:36:15
2018-09-12T13:36:15
142,739,910
1
0
null
null
null
null
UTF-8
Java
false
false
339
java
package com.taotao.sso.service; import com.taotao.common.pojo.TaotaoResult; import com.taotao.pojo.TbUser; public interface UserService { TaotaoResult checkData(String data, int type); TaotaoResult register(TbUser user); TaotaoResult login(String username, String password); TaotaoResult getUserByToken(String token); }
3cfe6a424394c711dda6fe7862ebd1f50f89b0ca
88abd24908c9d01792daa4de02d68eadf9b56652
/SentimentAnalysis_new/src/com/senti/SentimentAnalysis/core/Sentence.java
85ab9c6e9d461b719b31bb95b93e93f898196ef9
[]
no_license
GirishGore/SentiEngine
f647410fa75841444175ca9ad6b2b8792340691c
59d11f4c3c2cd7131d62899edb068b200cf5e9d4
refs/heads/master
2020-05-19T11:47:01.461659
2015-01-01T10:25:40
2015-01-01T10:25:40
26,477,685
0
0
null
null
null
null
UTF-8
Java
false
false
1,933
java
package com.senti.SentimentAnalysis.core; public class Sentence { private static final int MAX_NOUN_ADJ_LIMIT_IN_SENTENCE = 300; private int sentenceId; private String sentence; private String[] nouns = null; private String[] adjectives = null; private Integer[] nounDistance = null; private Integer[] adjectivesDistance = null; private int currentNounCount = 0 ; private int currentAdjectiveCount = 0 ; public Sentence() { nouns = new String[MAX_NOUN_ADJ_LIMIT_IN_SENTENCE] ; adjectives = new String[MAX_NOUN_ADJ_LIMIT_IN_SENTENCE] ; nounDistance = new Integer[MAX_NOUN_ADJ_LIMIT_IN_SENTENCE]; adjectivesDistance = new Integer[MAX_NOUN_ADJ_LIMIT_IN_SENTENCE]; } public int getSentenceId() { return sentenceId; } public void setSentenceId(int sentenceId) { this.sentenceId = sentenceId; } public Integer[] getNounDistance() { return nounDistance; } public void setNounDistance(int nounDistance) { this.nounDistance[currentNounCount] = nounDistance; currentNounCount++; } public Integer[] getAdjectivesDistance() { return adjectivesDistance; } public void setAdjectivesDistance(int adjectivesDistance) { this.adjectivesDistance[currentAdjectiveCount] = adjectivesDistance; currentAdjectiveCount++; } public void setNoun(String noun) { nouns[currentNounCount] = noun; } public void setAdjective(String adjective) { adjectives[currentAdjectiveCount] = adjective; } public String getSentence() { return sentence; } public void setSentence(String sentence) { this.sentence = sentence; } public String[] getNouns() { return nouns; } public String[] getAdjectives() { return adjectives; } }
3b45b43e6f53b69c7f3a90befc5dd4a548460fb2
8f5f96c0c3381b675ee921713ad6f1c85fe82b72
/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPaySandboxSignKeyResult.java
6326f694d38d0e390a970f7b2df42d7a70f99175
[ "Apache-2.0" ]
permissive
IdoFree/java-wx-tools
eb900d4b095570ea1a646c4a726e0b4eb1fa4c2b
c6f7656e3aaf7f07d234a38ab1eb315fd24207dc
refs/heads/master
2020-12-02T06:27:57.343824
2017-07-11T01:52:33
2017-07-11T01:52:33
96,837,900
2
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.github.binarywang.wxpay.bean.result; import com.thoughtworks.xstream.annotations.XStreamAlias; /** * <pre> * Created by BinaryWang on 2017/6/18. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @XStreamAlias("xml") public class WxPaySandboxSignKeyResult extends WxPayBaseResult { /** * <pre> * 沙箱密钥 * sandbox_signkey * 否 * 013467007045764 * String(32) * 返回的沙箱密钥 * </pre> */ @XStreamAlias("sandbox_signkey") private String sandboxSignKey; public String getSandboxSignKey() { return sandboxSignKey; } public void setSandboxSignKey(String sandboxSignKey) { this.sandboxSignKey = sandboxSignKey; } }
76c2c2519b6b3f6468b9ffead2611d97a8614025
64714905bd5375e6fbf3399762918ecb4963564f
/src/classwork07/java/TestFinal.java
4374ee52a29ced8b8158cc14fb8d7779035b305a
[]
no_license
ErnVint/M-JC1-23-19
862786268a02f76c1d7808507d1cf39f5fbd7ab9
af6aa2ccdfd7b2721544a415dd760717d3368706
refs/heads/master
2020-08-06T04:44:46.907899
2019-11-15T14:42:22
2019-11-15T14:42:22
212,839,221
0
0
null
null
null
null
UTF-8
Java
false
false
350
java
import java.util.ArrayList; import java.util.List; public class TestFinal { public static void main(String[] args) { final TestMap testObj = new TestMap(); System.out.println(testObj); testObj.getList().add("fds"); testObj.setIn(10); testObj.setStr("fasdvb"); System.out.println(testObj); } }
acb049ceb2abd8bc7a0df80f784e4b8d353c0349
5b7bd094100eefa70c6986a156e76a8b562fe23f
/src/main/java/nl/bos/gtd/client/MemberForm.java
54a4791548bcb23a0efe3e4f40cea6955d76ca58
[]
no_license
HetBenkt/gtd_client
3fcf286e8e2fcb4dfd7f329a34e821fceb181f42
e6c272e435254c6a811261c1766aeeb88ed0901c
refs/heads/master
2021-09-07T13:59:46.295157
2018-02-23T22:43:47
2018-02-23T22:43:47
115,195,339
0
0
null
null
null
null
UTF-8
Java
false
false
2,238
java
package nl.bos.gtd.client; import com.vaadin.data.Binder; import com.vaadin.event.ShortcutAction; import com.vaadin.ui.*; import com.vaadin.ui.themes.ValoTheme; import nl.bos.gtd.server.entities.Member; class MemberForm extends FormLayout { private final VaadinUI vaadinUI; private final TextField firstName; private final Button btnDelete; private Member member; private final Binder<Member> binder = new Binder<>(Member.class); public MemberForm(VaadinUI vaadinUI) { this.vaadinUI = vaadinUI; this.setSizeUndefined(); firstName = new TextField(); firstName.setPlaceholder("First name"); TextField lastName = new TextField(); lastName.setPlaceholder("Last name"); TextField email = new TextField(); email.setPlaceholder("E-mail"); TextField nickName = new TextField(); nickName.setPlaceholder("Nickname"); PasswordField password = new PasswordField(); password.setPlaceholder("Password"); Button btnSave = new Button("Save"); btnSave.setStyleName(ValoTheme.BUTTON_PRIMARY); btnSave.setClickShortcut(ShortcutAction.KeyCode.ENTER); btnSave.addClickListener(clickEvent -> save()); btnDelete = new Button("Delete"); btnDelete.setStyleName(ValoTheme.BUTTON_DANGER); btnDelete.addClickListener(clickEvent -> delete()); HorizontalLayout buttons = new HorizontalLayout(btnSave, btnDelete); this.addComponents(firstName, lastName, email, nickName, password, buttons); binder.bindInstanceFields(this); } public void setMember(Member member) { this.member = member; binder.setBean(member); if(member.getId() == null) btnDelete.setVisible(false); else btnDelete.setVisible(true); this.setVisible(true); firstName.selectAll(); vaadinUI.getFilterText().clear(); } private void delete() { vaadinUI.getMemberRepo().delete(member); vaadinUI.updateGrid(); setVisible(false); } private void save() { vaadinUI.getMemberRepo().save(member); vaadinUI.updateGrid(); setVisible(false); } }
2c41147a99b291ec29f5de21f227ad57e87926a7
35fb98a8ea4f3f7ccc2cc06808636b73337c244b
/Proyecto/src/Dominio/Ranking.java
5a6245c8fb1f69bf79c5e3706de9d430284ac40d
[]
no_license
metabit1000/ChessApplication-PROP
89e7f85a1348297b8ed7f0585af2de80c084347d
c90c945a398a6bed770af84dfe5b4ecab81991e3
refs/heads/master
2022-07-17T20:39:32.140280
2020-05-08T10:48:44
2020-05-08T10:48:44
177,303,343
0
1
null
null
null
null
UTF-8
Java
false
false
2,831
java
package Dominio; import java.util.*; /** * * @author Jordi */ public class Ranking { private Map<String,Double> rank = new HashMap<>(); public Ranking() {} /** * pre:- * post:Ordena el ranking segun los valores de las keys */ public void ordenar(){ List<Map.Entry<String, Double>> list = new LinkedList<>(rank.entrySet()); Collections.sort(list, (Map.Entry<String, Double> m1, Map.Entry<String, Double> m2) -> (m1.getValue()).compareTo(m2.getValue())); Map<String, Double> result = new LinkedHashMap<>(); list.forEach((entry) -> { result.put(entry.getKey(), entry.getValue()); }); rank = result; } /** * pre:Dado un string nom diferente a null * post:Devolvera true si esta esta key dentro de nuestro map sino false * @param nom * @return */ public Boolean existeix(String nom ){ if(rank.containsKey(nom))return true ; else return false ; } /** * pre:Dado un nombre y un tiempo no null * post:Insertaremos la key que sera la variable nombre y tiempo como su value * @param nombre * @param tiempo */ public void setElemento(String nombre,Double tiempo){ if (tiempo >= 0) rank.put(nombre,tiempo); ordenar(); } /** * pre:Dado una variable string nombre diferente a null y existente en el rank * post:Eliminaremos la key que representa el string nom y su valor asociado * @param nombre */ public void eliminarUsuario(String nombre){ rank.remove(nombre); } /** * pre: Dado un tiempo no negativo y un nombre existente en el ranking * post: Actualizaremos el tiempo en resolver el problema de la key que representa nombre si este tiempo es menor que el anterior * @param nombre * @param tiempo */ public void setActualizar(String nombre,double tiempo){ //comprobar que esté dentro de Rank double n = rank.get(nombre); if (tiempo < n && tiempo >= 0){ eliminarUsuario(nombre); setElemento(nombre,tiempo); } } /** * pre:- * post: Devuelve el map de la variable rank * @return */ public Map<String,Double> getmap( ){ return rank; } /** * pre:- * post:Devolvera una arraylist con el ranking * @return */ public ArrayList<String> toArrayDeStrings() { //necesaria de cara a pasarlo al fichero de Problemas ArrayList<String> res = new ArrayList(); Iterator iterator=rank.keySet().iterator(); int i = 0; while(iterator.hasNext()){ Object key = iterator.next(); res.add(key + " "+ rank.get(key)); } return res; } }
4091bf3ba393870222c5029db773643cbaa3da34
c3e72ccf9671c47b349cbb022df3fb8805c20572
/Algorithms/Sorting/SelectionSort.java
9f61b6460442e983e99116a3a5e19b8308d3f01a
[]
no_license
Sanat0412/My_DataStructure_Algorithm
954672ed9140dac30a2d8f4e3741dee69eaa31b5
f3a2d04255b19869adb7624d808c912815784dbf
refs/heads/master
2023-09-02T10:43:37.292875
2021-10-22T16:04:32
2021-10-22T16:04:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
815
java
package Algorithms.Sorting; import java.util.Arrays; public class SelectionSort { public int[] sort(int[] array) { int n = array.length; for (int i = 0; i < n - 1; i++) { int min = i; for (int j = i + 1; j < n; j++) { if (array[j] < array[min]) min = j; } if (min != i) { int temp = array[i]; array[i] = array[min]; array[min] = temp; } } return array; } } class Main { public static void main(String[] args) { SelectionSort selectionSort = new SelectionSort(); int[] arr = {1, 6, 8, 2, 8, 96, 5, 89}; System.out.println(Arrays.toString(selectionSort.sort(arr))); } }
916d829b1d2a6b11bb0bcc7dccbbf5ce250c9bbd
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Time/13/org/joda/time/LocalDateTime_getValue_563.java
32c1f7d6367bb73cf3e17dc63bb66c1c7dc2e7b6
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
3,703
java
org joda time local date time localdatetim unmodifi datetim repres datetim time zone local date time localdatetim link readabl partial readableparti method focu kei field year month year monthofyear dai year dayofyear milli dai millisofdai field fact queri intern local date time localdatetim singl millisecond base repres local datetim intern expos applic calcul local date time localdatetim perform link chronolog chronolog set intern utc time zone calcul individu field queri wai code hour dai gethourofdai code code hour dai hourofdai code techniqu access method field numer text text maximum minimum valu add subtract set round local date time localdatetim thread safe immut provid chronolog standard chronolog class suppli thread safe immut author stephen colebourn local date time localdatetim field specif index method requir support code readabl partial readableparti code support field year month dai monthofdai dai month dayofmonth milli dai millisofdai param index index index bound except indexoutofboundsexcept index invalid getvalu index index year chronolog getchronolog year local milli getlocalmilli month year chronolog getchronolog month year monthofyear local milli getlocalmilli dai month chronolog getchronolog dai month dayofmonth local milli getlocalmilli milli dai chronolog getchronolog milli dai millisofdai local milli getlocalmilli index bound except indexoutofboundsexcept invalid index index
19c6e94075ff3f0c07c805ef1ddf8ce98bd1e9b3
9667e0b7ab10e18f9d615c2c06f831f9b45b3413
/it/denzosoft/mobile/common/util/ArrayList.java
384b3cd1b77c24f6540968ec0af86166df5517ad
[]
no_license
2011FallUConnCSE2102/CSE2102musicIcelandExplosions
08cac0bf1cbba8cc8c28fac13cf15659968d08ca
2e9ff2a315616cff86809970e0fd2809b61f85db
refs/heads/master
2021-01-19T16:58:55.558084
2011-06-14T16:06:54
2011-06-14T16:06:54
1,895,319
0
0
null
null
null
null
UTF-8
Java
false
false
9,122
java
/* * QuickList.java * * Created on 10 novembre 2006, 15.50 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package it.denzosoft.mobile.common.util; public class ArrayList { private Object[] storedObjects; private int growthFactor; private int size; /** * Creates an ArrayList with the initial capacity of 10 and a growth factor * of 75% */ public ArrayList() { this(10, 75); } /** * creates an ArrayList with the given initial capacity and a growth factor * of 75% * * * @param initialCapacity * the capacity of this array list. */ public ArrayList(int initialCapacity) { this(initialCapacity, 75); } /** * Creates a new ArrayList * * * @param initialCapacity * the capacity of this array list. * @param growthFactor * the factor in % for increasing the capacity when there's not * enough room in this list anymore */ public ArrayList(int initialCapacity, int growthFactor) { this.storedObjects = new Object[initialCapacity]; this.growthFactor = growthFactor; } /** * Retrieves the current size of this array list. * * @return the number of stored elements in this list. */ public int size() { return this.size; } /** * Determines whether the given element is stored in this list. * * @param element * the element which might be stored in this list * @return true when the given element is stored in this list * @throws IllegalArgumentException * when the given element is null * @see #remove(Object) */ public boolean contains(Object element) { if (element == null) { throw new IllegalArgumentException( "ArrayList cannot contain a null element."); } for (int i = 0; i < this.size; i++) { Object object = this.storedObjects[i]; if (object.equals(element)) { return true; } } return false; } /** * Retrieves the index of the given object. * * @param element * the object which is part of this list. * @return the index of the object or -1 when the object is not part of this * list. * @throws IllegalArgumentException * when the given element is null */ public int indexOf(Object element) { if (element == null) { throw new IllegalArgumentException( "ArrayList cannot contain a null element."); } for (int i = 0; i < this.size; i++) { Object object = this.storedObjects[i]; if (object.equals(element)) { return i; } } return -1; } /** * Returns the element at the specified position in this list. * * @param index * the position of the desired element. * @return the element stored at the given position * @throws IndexOutOfBoundsException * when the index < 0 || index >= size() */ public Object get(int index) { if (index < 0 || index >= this.size) { throw new IndexOutOfBoundsException("the index [" + index + "] is not valid for this list with the size [" + this.size + "]."); } return this.storedObjects[index]; } /** * Removes the element at the specified position in this list. * * @param index * the position of the desired element. * @return the element stored at the given position * @throws IndexOutOfBoundsException * when the index < 0 || index >= size() */ public Object remove(int index) { if (index < 0 || index >= this.size) { throw new IndexOutOfBoundsException("the index [" + index + "] is not valid for this list with the size [" + this.size + "]."); } Object removed = this.storedObjects[index]; for (int i = index + 1; i < this.size; i++) { this.storedObjects[i - 1] = this.storedObjects[i]; } this.size--; return removed; } /** * Removes the given element. * * @param element * the element which should be removed. * @return true when the element was found in this list. * @throws IllegalArgumentException * when the given element is null * @see #contains(Object) */ public boolean remove(Object element) { if (element == null) { throw new IllegalArgumentException("ArrayList cannot contain null."); } int index = -1; for (int i = 0; i < this.size; i++) { Object object = this.storedObjects[i]; if (object.equals(element)) { index = i; break; } } if (index == -1) { return false; } for (int i = index + 1; i < this.size; i++) { this.storedObjects[i - 1] = this.storedObjects[i]; } this.size--; return true; } /** * Removes all of the elements from this list. The list will be empty after * this call returns. */ public void clear() { for (int i = 0; i < this.size; i++) { this.storedObjects[i] = null; } this.size = 0; } /** * Stores the given element in this list. * * @param element * the element which should be appended to this list. * @throws IllegalArgumentException * when the given element is null * @see #add( int, Object ) */ public void add(Object element) { if (element == null) { throw new IllegalArgumentException("ArrayList cannot contain null."); } if (this.size >= this.storedObjects.length) { increaseCapacity(); } this.storedObjects[this.size] = element; this.size++; } /** * Inserts the given element at the defined position. Any following elements * are shifted one position to the back. * * @param index * the position at which the element should be inserted, use 0 * when the element should be inserted in the front of this list. * @param element * the element which should be inserted * @throws IllegalArgumentException * when the given element is null * @throws IndexOutOfBoundsException * when the index < 0 || index >= size() */ public void add(int index, Object element) { if (element == null) { throw new IllegalArgumentException("ArrayList cannot contain null."); } if (index < 0 || index >= this.size) { throw new IndexOutOfBoundsException("the index [" + index + "] is not valid for this list with the size [" + this.size + "]."); } if (this.size >= this.storedObjects.length) { increaseCapacity(); } // shift all following elements one position to the back: for (int i = this.size; i > index; i--) { this.storedObjects[i] = this.storedObjects[i - 1]; } // insert the given element: this.storedObjects[index] = element; this.size++; } /** * Replaces the element at the specified position in this list with the * specified element. * * @param index * the position of the element, the first element has the index * 0. * @param element * the element which should be set * @return the replaced element * @throws IndexOutOfBoundsException * when the index < 0 || index >= size() */ public Object set(int index, Object element) { if (index < 0 || index >= this.size) { throw new IndexOutOfBoundsException("the index [" + index + "] is not valid for this list with the size [" + this.size + "]."); } Object replaced = this.storedObjects[index]; this.storedObjects[index] = element; return replaced; } /** * Returns all stored elements as an array. * * @return the stored elements as an array. */ public Object[] toArray() { Object[] copy = new Object[this.size]; System.arraycopy(this.storedObjects, 0, copy, 0, this.size); return copy; } /** * Returns all stored elements in the given array. * * @param target * the array in which the stored elements should be copied. * @return the stored elements of this list */ public Object[] toArray(Object[] target) { System.arraycopy(this.storedObjects, 0, target, 0, this.size); return target; } /** * Trims the capacity of this ArrayList instance to be the list's current * size. An application can use this operation to minimize the storage of an * ArrayList instance. */ public void trimToSize() { if (this.storedObjects.length != this.size) { Object[] newStore = new Object[this.size]; System.arraycopy(this.storedObjects, 0, newStore, 0, this.size); this.storedObjects = newStore; } } /** * increases the capacity of this list. */ private void increaseCapacity() { int currentCapacity = this.storedObjects.length; int newCapacity = currentCapacity + ((currentCapacity * this.growthFactor) / 100); if (newCapacity == currentCapacity) { newCapacity++; } Object[] newStore = new Object[newCapacity]; System.arraycopy(this.storedObjects, 0, newStore, 0, this.size); this.storedObjects = newStore; } }
50800e995fa071c59655614c508dc05b817985ad
afff52b30c0f0003de3a312c67246c421e45ef3d
/fts-fore/fts-api/src/main/java/com/lnsf/rpc/domain/SysSession.java
69d0c1cc9fd2b1056ddae2796d1405885df49e3a
[ "Apache-2.0" ]
permissive
squirrelmoney/rpc_ticketing_system
a032f1eabc540ce74af9ef1bcbbbf3e768883690
d55f770fbe1c8628bd2ba9bbcd3ee526f7636445
refs/heads/main
2023-04-30T16:07:50.417732
2021-05-12T07:39:49
2021-05-12T07:39:49
366,624,298
1
0
null
null
null
null
UTF-8
Java
false
false
2,035
java
package com.lnsf.rpc.domain; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; import java.time.LocalDate; /** * 场次实体类 * @Author: money */ @Data @AllArgsConstructor @NoArgsConstructor @ToString public class SysSession implements Serializable { private static final Long serialVersionUID = 1L; //场次id private Long sessionId; //影院id @NotNull(message = "场次所属影院不能为空") private Long cinemaId; //影厅id @NotNull(message = "场次所在影厅不能为空") private Long hallId; //该场次语言版本 @NotBlank(message = "场次电影语言版本不能为空") private String languageVersion; //电影id @NotNull(message = "场次安排电影不能为空") private Long movieId; //电影播放时段id @NotNull(message = "场次播放时段不能为空") private Long movieRuntimeId; //场次日期 @NotNull(message = "场次日期不能为空") @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd") private LocalDate sessionDate; //场次状态, true表示上映中, false表示已下架 @NotNull(message = "场次状态不能为空") private Boolean sessionState; //场次票价 @NotNull(message = "场次票价不能为空") @Size(min = 0, message = "场次票价不能为负数") private Double sessionPrice; //场次提示 private String sessionTips; //场次座位信息 @NotBlank(message = "场次座位信息不能为空") private String sessionSeats; private Integer seatNums; //多表连接 private SysCinema sysCinema; private SysHall sysHall; private SysMovie sysMovie; private SysMovieRuntime sysMovieRuntime; }
5010edf34a9a4589c8f6e2d5cfb1780aaa819092
057dcc4badb026e87851459f70b68d8007600560
/backend/src/main/java/com/devsuperior/dspesquisa/entities/Record.java
be190878b079b36097daa2cf96aab241393b0a67
[]
no_license
LeandroHamorim/dspesquisa
3bc33f4b4327a92b0d5a588ce5614660666e9e8b
51480178b5590c57bb55341291b8f1e156f612d2
refs/heads/master
2022-12-12T01:09:52.851167
2020-09-17T03:06:55
2020-09-17T03:06:55
295,597,137
0
0
null
null
null
null
UTF-8
Java
false
false
1,947
java
package com.devsuperior.dspesquisa.entities; import java.io.Serializable; import java.time.Instant; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name = "tb_record") public class Record implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private Integer age; private Instant moment; @ManyToOne @JoinColumn(name = "game_id") private Game game; public Record () { } public Record(Long id, String name, Integer age, Instant moment, Game game) { super(); this.id = id; this.name = name; this.age = age; this.moment = moment; this.game = game; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Instant getMoment() { return moment; } public void setMoment(Instant moment) { this.moment = moment; } public Game getGame() { return game; } public void setGame(Game game) { this.game = game; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Record other = (Record) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
a951c83d818675462337f3ca1509cb0372b5a3ab
4ea5099e48e2a9724842ccc638f7f7f7deafd5e5
/src/main/java/Program.java
835083b4e2bb2c62a0df5c4a756a4cf981d8b59a
[]
no_license
eryktr/StudentManager
1166b03051a8904ff793439804a94603fe4548c8
17a85685fa76aafd842395b89563bdef8b5c62ce
refs/heads/master
2020-04-01T04:33:12.926108
2018-10-15T16:59:20
2018-10-15T16:59:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
277
java
import java.sql.Connection; public class Program { public static void main(String[] args) { ConnectionBuilder cb = new ConnectionBuilder(); DBManager db = new DBManager(cb); UserInterface ui = new UserInterface(db); ui.start(); } }
f9d5950196ee595fbb5a104c83fd022c30e71b47
a33f198b68caaae9193eb51dd79a2857361f9a01
/app/src/main/java/com/therealbatman/estacionamentointeligente/activity/FuncionarioActivity.java
06fd005de47be56154a9170b59fb4e16977c93e2
[]
no_license
anefernandes/SmartParking
6013b63308a2f06bfbcfbac33404bbf88e468974
83aa8cceb5bc1e5defa165f05c2b9cd8bfc5731b
refs/heads/master
2022-11-04T01:04:17.192091
2020-06-11T20:38:19
2020-06-11T20:38:19
263,466,632
0
0
null
null
null
null
UTF-8
Java
false
false
2,738
java
package com.therealbatman.estacionamentointeligente.activity; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.ImageView; import android.widget.TextView; import com.therealbatman.estacionamentointeligente.R; import com.therealbatman.estacionamentointeligente.remote.APIUtils; import com.therealbatman.estacionamentointeligente.remote.VagasService; import java.util.List; //Classe para mostrar a quantidade de vagas disponível public class FuncionarioActivity extends AppCompatActivity { private TextView vagas; public List<Integer> quantidade_vagas; private VagasService vagasService; private Retrofit retrofit; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_funcionario); vagas = findViewById(R.id.tvVagas); //retrofit retrofit = new APIUtils().getAdapter(); vagasService = retrofit.create(VagasService.class); exibeVagas(); } //botão atualizar dentro da activity @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.funcionario_menu, menu); return true; } @RequiresApi(api = Build.VERSION_CODES.O) @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (id) { case R.id.action_atualizar: exibeVagas(); break; } return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { this.moveTaskToBack(true); } public void exibeVagas(){ final Call<List<Integer>> vagasDisponiveis = vagasService.getTotal(); vagasDisponiveis.enqueue(new Callback<List<Integer>>() { @Override public void onResponse(Call<List<Integer>> call, Response<List<Integer>> response) { if(response.isSuccessful()) { quantidade_vagas = response.body(); vagas.setText(quantidade_vagas.toString().replace('[', ' ').replace(']', ' ').trim()); System.out.println(quantidade_vagas); } } @Override public void onFailure(Call<List<Integer>> call, Throwable t) { Log.e("ERROR: ", t.getMessage()); } }); } }
91a72791f3be4dbd5a515c11a29854e21554810b
fbe04500281dd9d85f3919b04bebfa9440372b95
/core/src/main/java/howard/cinema/core/manage/tools/SecurityUtil.java
7d906a7b871cc97a4c73eb8aa8b6a2aa69e9fd45
[]
no_license
huojiajin/cinema
a568606fe8a9fa555d9394b466d75276fa1de022
ddb7cc18eddf1e84ad6737896bcd8c3b4249a4db
refs/heads/master
2023-06-03T10:37:37.777337
2021-06-22T10:15:42
2021-06-22T10:15:42
368,632,098
0
0
null
null
null
null
UTF-8
Java
false
false
5,693
java
package howard.cinema.core.manage.tools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.Assert; import org.springframework.util.StringUtils; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import java.io.*; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; /** *@name: SecurityUtil *@description: 加解密工具类 *@author: huojiajin *@time: 2020/5/26 10:38 **/ public abstract class SecurityUtil { protected static Logger logger = LoggerFactory.getLogger(SecurityUtil.class); private static char[] digit = { 'C', 'h', 'e', 'n', 'P', 'e', 'i', 'A', 'n', '8', '1', '0', '2', '1', '6', 'C' }; private static char[] commonDigit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; private static String DEFAULT_KEY = "hxservicemanage2020"; /** * 使用aes加密数据 * * @param data * 加密前数据 * @param key * 加密口令 * @return */ public static byte[] aesEncrypt(byte[] data, String key) { return aesOperation(data, Cipher.ENCRYPT_MODE, key); } public static byte[] aesEncrypt(byte[] data) { return aesEncrypt(data, DEFAULT_KEY); } /** * 使用aes解密数据 * * @param data * 解密前数据 * @param key * 加密口令 * @return */ public static byte[] aesDecrypt(byte[] data, String key) { return aesOperation(data, Cipher.DECRYPT_MODE, key); } public static byte[] aesDecrypt(byte[] data) { return aesDecrypt(data, DEFAULT_KEY); } private static byte[] aesOperation(byte[] data, int encryptMode, String key) { try { Assert.notNull(data, "data can not be null."); Cipher cipher = getAESCiper(encryptMode, key.getBytes()); return cipher.doFinal(data); } catch (Exception e) { logger.error("", e); throw new RuntimeException("AES encrypt/decrypt failed"); } } private static Cipher getAESCiper(int encryptMode, byte[] seed) { try { KeyGenerator kgen = KeyGenerator.getInstance("AES"); SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); random.setSeed(seed); kgen.init(128, random); SecretKey secretKey = kgen.generateKey(); byte[] enCodeFormat = secretKey.getEncoded(); SecretKeySpec keySpec = new SecretKeySpec(enCodeFormat, "AES"); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");// 创建密码器 cipher.init(encryptMode, keySpec);// 初始化 return cipher; } catch (Exception e) { logger.error("", e); throw new RuntimeException("Create Cipher instance failed."); } } /** * 字符串摘要方法。传入一个字符串,返回经过SHA-1摘要后的一个字符串 * * @param str * @return */ public static String encryptBySHA(String str) { return encryptStr(str, HashType.SHA_1, false); } /** * 字符串摘要方法。传入一个字符串,返回经过MD5摘要后的一个字符串 * * @param str * @return */ public static String encryptByMD5(String str) { return encryptStr(str, HashType.MD5, false); } public static String hash(File file, HashType type, boolean useCommonDigit) { Assert.notNull(file, "file can not be null."); try { InputStream in = new FileInputStream(file); return hash(in, type, useCommonDigit); } catch (FileNotFoundException e) { logger.error("", e); return ""; } } public static String hash(InputStream in, HashType type, boolean useCommonDigit) { Assert.notNull(in, "inputstream can not be null."); try { byte[] buffer = new byte[1024]; MessageDigest md5 = type.getDigest(); int numRead = 0; while ((numRead = in.read(buffer)) > 0) { md5.update(buffer, 0, numRead); } in.close(); return toHexString(md5.digest(), useCommonDigit); } catch (Exception e) { logger.error("", e); return ""; } } public static String encryptStr(String str, HashType type, boolean useCommonDigit) { return encryptStr(str, type, "UTF-8", useCommonDigit); } public static String encryptStr(String str, HashType type, String encoding, boolean useCommonDigit) { String enc = StringUtils.hasText(encoding) ? encoding : "UTF-8"; try { byte b[] = hash(str.getBytes(enc), type); return toHexString(b, useCommonDigit); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException(e); } } /** * 对二进制数据进行hash计算 * * @param data * @param type * @return */ public static byte[] hash(byte[] data, HashType type) { MessageDigest md = type.getDigest(); md.update(data); return md.digest(); } public static String toHexString(byte[] b, boolean useCommonDigit) { StringBuilder sb = new StringBuilder(b.length * 2); for (int i = 0; i < b.length; i++) { if (useCommonDigit) { sb.append(commonDigit[(b[i] & 0xf0) >>> 4]); sb.append(commonDigit[b[i] & 0x0f]); } else { sb.append(digit[(b[i] & 0xf0) >>> 4]); sb.append(digit[b[i] & 0x0f]); } } return sb.toString(); } public enum HashType { MD5("MD5") {}, SHA_1("SHA-1") {}, SHA_256("SHA-256") {}, SHA_384("SHA-384") {}, SHA_512("SHA-512") {},; private String value; private HashType(String value) { this.value = value; } public MessageDigest getDigest() { try { return MessageDigest.getInstance(getValue()); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("没有这种算法:" + value); } } public String getValue() { return value; } } }
[ "lianyingshi123" ]
lianyingshi123
ca4767ceb4c795ded0ba2bb45c60af87de7a9fa7
8f801d643b505db53ef3d79d34e098e27431a0aa
/src/main/java/del/ac/id/demo/controller/StoreController.java
b63f96b9707b8520d70cc90c565be39565a0beea
[]
no_license
richyemanik/TopedKelompok7
dfdecc42e0e619366c269252f88697e6353ad48c
c2bc719b747375229a32f056e5c9e9f72226a9cb
refs/heads/master
2022-12-29T19:58:38.775122
2020-10-18T17:28:57
2020-10-18T17:28:57
305,107,319
0
0
null
null
null
null
UTF-8
Java
false
false
926
java
package del.ac.id.demo.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import del.ac.id.demo.jpa.Item; import del.ac.id.demo.jpa.Store; import del.ac.id.demo.jpa.StoreRepository; @RestController public class StoreController { @Autowired StoreRepository storeRepository; @Autowired MongoTemplate mongoTemp; @RequestMapping("/store") public ModelAndView store() { List<Store> stores = storeRepository.findAll(); List<Item> items = mongoTemp.findAll(Item.class); ModelAndView s = new ModelAndView("store"); s.addObject("stores", stores); s.addObject("items", items); s.setViewName("store"); return s; } }
564e4d7df20167bf032d0cbeb5102c0bd582999f
d4bb48bc587de68479240882fdd29ae3ba20fbe2
/src/main/java/riot/riotctl/discovery/HostInfo.java
f83be496efa34bf9fb185068b36be7da167e6e76
[ "Apache-2.0" ]
permissive
riot-framework/riotctl
258062573183a1d537394dd82e4501c7b59d092f
90a87b531fdf3495b4affa5546944f60f857e617
refs/heads/master
2020-07-10T04:31:31.035193
2019-10-01T09:37:58
2019-10-01T09:37:58
204,167,929
0
0
null
null
null
null
UTF-8
Java
false
false
584
java
package riot.riotctl.discovery; import java.net.InetAddress; public class HostInfo { private final InetAddress host; private final String username; private final String password; public HostInfo(final InetAddress host, final String username, final String password) { this.host = host; this.username = username; this.password = password; } public InetAddress getHost() { return host; } public String getUsername() { return username; } public String getPassword() { return password; } }
24bba30151c5aa59481e7337d6f9b95d2245a7e0
208ba847cec642cdf7b77cff26bdc4f30a97e795
/l/src/androidTest/java/org.wp.l/FactoryUtils.java
afa8296ae6e3cbc0378e25139f357d500ef3fef5
[]
no_license
kageiit/perf-android-large
ec7c291de9cde2f813ed6573f706a8593be7ac88
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
refs/heads/master
2021-01-12T14:00:19.468063
2016-09-27T13:10:42
2016-09-27T13:10:42
69,685,305
0
0
null
2016-09-30T16:59:49
2016-09-30T16:59:48
null
UTF-8
Java
false
false
1,802
java
package org.wp.l; import org.wp.l.mocks.OAuthAuthenticatorFactoryTest; import org.wp.l.mocks.RestClientFactoryTest; import org.wp.l.mocks.SystemServiceFactoryTest; import org.wp.l.mocks.XMLRPCFactoryTest; import org.wp.l.networking.OAuthAuthenticatorFactory; import org.wp.l.networking.RestClientFactory; import org.wp.l.util.AppLog; import org.wp.l.util.AppLog.T; import org.wp.l.util.SystemServiceFactory; import org.xmlrpc.l.XMLRPCFactory; import java.lang.reflect.Field; public class FactoryUtils { public static void clearFactories() { // clear factories forceFactoryInjection(XMLRPCFactory.class, null); forceFactoryInjection(RestClientFactory.class, null); forceFactoryInjection(OAuthAuthenticatorFactory.class, null); forceFactoryInjection(SystemServiceFactory.class, null); AppLog.v(T.TESTS, "Null factories set"); } public static void initWithTestFactories() { // create test factories forceFactoryInjection(XMLRPCFactory.class, new XMLRPCFactoryTest()); forceFactoryInjection(RestClientFactory.class, new RestClientFactoryTest()); forceFactoryInjection(OAuthAuthenticatorFactory.class, new OAuthAuthenticatorFactoryTest()); forceFactoryInjection(SystemServiceFactory.class, new SystemServiceFactoryTest()); AppLog.v(T.TESTS, "Mocks factories instantiated"); } private static void forceFactoryInjection(Class klass, Object factory) { try { Field field = klass.getDeclaredField("sFactory"); field.setAccessible(true); field.set(null, factory); AppLog.v(T.TESTS, "Factory " + klass + " injected"); } catch (Exception e) { AppLog.e(T.TESTS, "Can't inject test factory " + klass); } } }
a1f56e7fcec1b3cce7165047855ee541f23e996e
d02163568871dfd3b5beb775c2de8864f200256f
/src/main/java/com/cavalier/questionnaire/back/exception/NotImplementedException.java
6aaad6abe95833bb67cdbe6cb8ec531d9a6b0f86
[]
no_license
CCavalier/Questionnaire-WS
bc2aae73426ecb0c2ca7e386f64fb370f5ee8105
9cc1b8d790bbc4887d3150c91a277722ed8f2033
refs/heads/master
2021-01-21T05:03:30.485444
2016-04-08T16:49:04
2016-04-08T16:49:04
42,478,921
0
0
null
null
null
null
UTF-8
Java
false
false
375
java
package com.cavalier.questionnaire.back.exception; public class NotImplementedException extends Exception { /** * */ private static final long serialVersionUID = 7466202671298436761L; public NotImplementedException(String message) { super(message); } public NotImplementedException(String message, NotImplementedException cause) { super(message, cause); } }
6cb87adb838b348afaadcc604e627b81f6a5c866
da7718fc73ec8b68d25261c6c9a4091dffb16c1d
/src/main/java/com/ws/hessian/io/BasicDeserializer.java
6c028afe1822f13cf2ae9bdd6dd723dc1f26d2a1
[]
no_license
kevan123456/Utils
8681bf8ad40c0a6be255c1fa46f655545d582d81
01bd7503d8ebf249a7a6124b8c21d944e11bd0cd
refs/heads/master
2021-05-15T18:22:55.691252
2017-11-29T07:34:03
2017-11-29T07:34:03
107,623,757
0
0
null
null
null
null
UTF-8
Java
false
false
16,673
java
package com.ws.hessian.io; import java.io.IOException; import java.util.ArrayList; import java.util.Date; public class BasicDeserializer extends AbstractDeserializer { public static final int NULL = 0; public static final int BOOLEAN = 1; public static final int BYTE = 2; public static final int SHORT = 3; public static final int INTEGER = 4; public static final int LONG = 5; public static final int FLOAT = 6; public static final int DOUBLE = 7; public static final int CHARACTER = 8; public static final int CHARACTER_OBJECT = 9; public static final int STRING = 10; public static final int DATE = 12; public static final int NUMBER = 13; public static final int OBJECT = 14; public static final int BOOLEAN_ARRAY = 15; public static final int BYTE_ARRAY = 16; public static final int SHORT_ARRAY = 17; public static final int INTEGER_ARRAY = 18; public static final int LONG_ARRAY = 19; public static final int FLOAT_ARRAY = 20; public static final int DOUBLE_ARRAY = 21; public static final int CHARACTER_ARRAY = 22; public static final int STRING_ARRAY = 23; public static final int OBJECT_ARRAY = 24; private int _code; public BasicDeserializer(int code) { this._code = code; } public Class getType() { switch(this._code) { case 0: return Void.TYPE; case 1: return Boolean.class; case 2: return Byte.class; case 3: return Short.class; case 4: return Integer.class; case 5: return Long.class; case 6: return Float.class; case 7: return Double.class; case 8: return Character.class; case 9: return Character.class; case 10: return String.class; case 11: default: throw new UnsupportedOperationException(); case 12: return Date.class; case 13: return Number.class; case 14: return Object.class; case 15: return boolean[].class; case 16: return byte[].class; case 17: return short[].class; case 18: return int[].class; case 19: return long[].class; case 20: return float[].class; case 21: return double[].class; case 22: return char[].class; case 23: return String[].class; case 24: return Object[].class; } } public Object readObject(AbstractHessianInput in) throws IOException { String code; int length; switch(this._code) { case 0: in.readObject(); return null; case 1: return Boolean.valueOf(in.readBoolean()); case 2: return Byte.valueOf((byte)in.readInt()); case 3: return Short.valueOf((short)in.readInt()); case 4: return Integer.valueOf(in.readInt()); case 5: return Long.valueOf(in.readLong()); case 6: return Float.valueOf((float)in.readDouble()); case 7: return Double.valueOf(in.readDouble()); case 8: code = in.readString(); if(code != null && !code.equals("")) { return Character.valueOf(code.charAt(0)); } return Character.valueOf('\u0000'); case 9: code = in.readString(); if(code != null && !code.equals("")) { return Character.valueOf(code.charAt(0)); } return null; case 10: return in.readString(); case 11: default: throw new UnsupportedOperationException(); case 12: return new Date(in.readUTCDate()); case 13: return in.readObject(); case 14: return in.readObject(); case 15: case 17: case 18: case 19: case 20: case 21: case 23: int code1 = in.readListStart(); switch(code1) { case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: length = code1 - 16; in.readInt(); return this.readLengthList(in, length); case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: case 58: case 59: case 60: case 61: case 62: case 63: case 64: case 65: case 66: case 67: case 68: case 69: case 70: case 71: case 72: case 73: case 74: case 75: case 76: case 77: default: String type1 = in.readType(); length = in.readLength(); return this.readList(in, length); case 78: return null; } case 16: return in.readBytes(); case 22: code = in.readString(); if(code == null) { return null; } else { length = code.length(); char[] type = new char[length]; code.getChars(0, length, type, 0); return type; } } } public Object readList(AbstractHessianInput in, int length) throws IOException { ArrayList list; int i; int var8; switch(this._code) { case 15: if(length >= 0) { boolean[] var17 = new boolean[length]; in.addRef(var17); for(var8 = 0; var8 < var17.length; ++var8) { var17[var8] = in.readBoolean(); } in.readEnd(); return var17; } else { list = new ArrayList(); while(!in.isEnd()) { list.add(Boolean.valueOf(in.readBoolean())); } in.readEnd(); boolean[] var21 = new boolean[list.size()]; in.addRef(var21); for(i = 0; i < var21.length; ++i) { var21[i] = ((Boolean)list.get(i)).booleanValue(); } return var21; } case 16: case 22: default: throw new UnsupportedOperationException(String.valueOf(this)); case 17: if(length >= 0) { short[] var16 = new short[length]; in.addRef(var16); for(var8 = 0; var8 < var16.length; ++var8) { var16[var8] = (short)in.readInt(); } in.readEnd(); return var16; } list = new ArrayList(); while(!in.isEnd()) { list.add(Short.valueOf((short)in.readInt())); } in.readEnd(); short[] var20 = new short[list.size()]; for(i = 0; i < var20.length; ++i) { var20[i] = ((Short)list.get(i)).shortValue(); } in.addRef(var20); return var20; case 18: if(length >= 0) { int[] var14 = new int[length]; in.addRef(var14); for(var8 = 0; var8 < var14.length; ++var8) { var14[var8] = in.readInt(); } in.readEnd(); return var14; } list = new ArrayList(); while(!in.isEnd()) { list.add(Integer.valueOf(in.readInt())); } in.readEnd(); int[] var19 = new int[list.size()]; for(i = 0; i < var19.length; ++i) { var19[i] = ((Integer)list.get(i)).intValue(); } in.addRef(var19); return var19; case 19: if(length >= 0) { long[] var12 = new long[length]; in.addRef(var12); for(var8 = 0; var8 < var12.length; ++var8) { var12[var8] = in.readLong(); } in.readEnd(); return var12; } list = new ArrayList(); while(!in.isEnd()) { list.add(Long.valueOf(in.readLong())); } in.readEnd(); long[] var18 = new long[list.size()]; for(i = 0; i < var18.length; ++i) { var18[i] = ((Long)list.get(i)).longValue(); } in.addRef(var18); return var18; case 20: if(length >= 0) { float[] var11 = new float[length]; in.addRef(var11); for(var8 = 0; var8 < var11.length; ++var8) { var11[var8] = (float)in.readDouble(); } in.readEnd(); return var11; } list = new ArrayList(); while(!in.isEnd()) { list.add(new Float(in.readDouble())); } in.readEnd(); float[] var15 = new float[list.size()]; for(i = 0; i < var15.length; ++i) { var15[i] = ((Float)list.get(i)).floatValue(); } in.addRef(var15); return var15; case 21: if(length >= 0) { double[] var9 = new double[length]; in.addRef(var9); for(var8 = 0; var8 < var9.length; ++var8) { var9[var8] = in.readDouble(); } in.readEnd(); return var9; } list = new ArrayList(); while(!in.isEnd()) { list.add(new Double(in.readDouble())); } in.readEnd(); double[] var13 = new double[list.size()]; in.addRef(var13); for(i = 0; i < var13.length; ++i) { var13[i] = ((Double)list.get(i)).doubleValue(); } return var13; case 23: if(length >= 0) { String[] var7 = new String[length]; in.addRef(var7); for(var8 = 0; var8 < var7.length; ++var8) { var7[var8] = in.readString(); } in.readEnd(); return var7; } list = new ArrayList(); while(!in.isEnd()) { list.add(in.readString()); } in.readEnd(); String[] var10 = new String[list.size()]; in.addRef(var10); for(i = 0; i < var10.length; ++i) { var10[i] = (String)list.get(i); } return var10; case 24: if(length >= 0) { Object[] var6 = new Object[length]; in.addRef(var6); for(var8 = 0; var8 < var6.length; ++var8) { var6[var8] = in.readObject(); } in.readEnd(); return var6; } else { list = new ArrayList(); in.addRef(list); while(!in.isEnd()) { list.add(in.readObject()); } in.readEnd(); Object[] data = new Object[list.size()]; for(i = 0; i < data.length; ++i) { data[i] = list.get(i); } return data; } } } public Object readLengthList(AbstractHessianInput in, int length) throws IOException { int i; switch(this._code) { case 15: boolean[] var11 = new boolean[length]; in.addRef(var11); for(i = 0; i < var11.length; ++i) { var11[i] = in.readBoolean(); } return var11; case 16: case 22: default: throw new UnsupportedOperationException(String.valueOf(this)); case 17: short[] var10 = new short[length]; in.addRef(var10); for(i = 0; i < var10.length; ++i) { var10[i] = (short)in.readInt(); } return var10; case 18: int[] var9 = new int[length]; in.addRef(var9); for(i = 0; i < var9.length; ++i) { var9[i] = in.readInt(); } return var9; case 19: long[] var8 = new long[length]; in.addRef(var8); for(i = 0; i < var8.length; ++i) { var8[i] = in.readLong(); } return var8; case 20: float[] var7 = new float[length]; in.addRef(var7); for(i = 0; i < var7.length; ++i) { var7[i] = (float)in.readDouble(); } return var7; case 21: double[] var6 = new double[length]; in.addRef(var6); for(i = 0; i < var6.length; ++i) { var6[i] = in.readDouble(); } return var6; case 23: String[] var5 = new String[length]; in.addRef(var5); for(i = 0; i < var5.length; ++i) { var5[i] = in.readString(); } return var5; case 24: Object[] data = new Object[length]; in.addRef(data); for(i = 0; i < data.length; ++i) { data[i] = in.readObject(); } return data; } } }
5778a4430e2bd8ed4032078428acde522254a7ee
56c3f14b558c7cd33de57ea5c9d9e49f3fbafcc7
/src/main/java/com/wxsoft/xyd/system/service/impl/.svn/text-base/SysCouponsConfServiceImpl.java.svn-base
3daa6e5c02ce7e4be08ae6ad9ddaee5a37d8e26e
[]
no_license
qifaqiang/bbmall
76cda2a7823e22679d520b2f121e91f8c81e50fd
12e89fd80c6983c0cc4f466a76758cf5145bdaec
refs/heads/master
2021-01-24T17:43:45.131477
2017-03-30T12:16:33
2017-03-30T12:16:33
81,913,311
0
0
null
null
null
null
UTF-8
Java
false
false
1,933
/** * @文件名称: sysCouponsConfService.java * @类路径: com.wxsoft.xyd.system.service.impl * @描述: TODO * @作者:kyz * @时间:2015-8-10 下午05:50:09 */ package com.wxsoft.xyd.system.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import com.wxsoft.xyd.system.model.SysCouponsConf; import com.wxsoft.xyd.system.model.SysLog; import com.wxsoft.xyd.system.mapper.SysCouponsConfMapper; import com.wxsoft.xyd.system.mapper.SysLogMapper; import com.wxsoft.xyd.system.service.SysCouponsConfService; @Service("sysCouponsConfService") public class SysCouponsConfServiceImpl implements SysCouponsConfService { @Autowired private SysCouponsConfMapper sysCouponsConfMapper; @Autowired private SysLogMapper sysLogMapper; @Override public int deleteByPrimaryKey(Integer id) { return sysCouponsConfMapper.deleteByPrimaryKey(id); } @Override public int insertSelective(SysCouponsConf record, SysLog syslog) { sysLogMapper.insertSelective(syslog); return sysCouponsConfMapper.insertSelective(record); } @Override public int updateByPrimaryKeySelective(SysCouponsConf record, SysLog syslog) { sysLogMapper.insertSelective(syslog); return sysCouponsConfMapper.updateByPrimaryKeySelective(record); } @Override public SysCouponsConf selectByPrimaryKey(Integer id) { return sysCouponsConfMapper.selectByPrimaryKey(id); } @Override public SysCouponsConf selectBySysCouponsConf(SysCouponsConf record) { return sysCouponsConfMapper.selectBySysCouponsConf(record); } @Override public List<SysCouponsConf> listPageBySysCouponsConf(SysCouponsConf clssname) { return sysCouponsConfMapper.listPageBySysCouponsConf(clssname); } @Override public List<SysCouponsConf> getAllBySysCouponsConf(SysCouponsConf clssname) { return sysCouponsConfMapper.getAllBySysCouponsConf(clssname); } }
8d5efa0ae3d5191a62b10a6a3ba16f6e7081b1d0
2aca2c25ef63596a3f2c3703841c7ece7266d0d1
/Stage 3/CriteriAPIDemo/src/main/java/com/cts/Product.java
a2d32fb1e509c88a65d7894b0a3dc6cf84927584
[]
no_license
RishabhGupta15/Cognizant-Internship
a0d4e74bfc2798de6d3519330236a5844978531b
f1ad491fdf51d3c731295e8e5e806ca5061e4e91
refs/heads/main
2023-09-03T18:40:53.492566
2021-10-12T11:51:11
2021-10-12T11:51:11
381,082,087
0
0
null
null
null
null
UTF-8
Java
false
false
2,524
java
package com.cts; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "product") public class Product { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "product_id") private int id; private String name; private String customerReview; private String hardDiskSize; private String ramSize; private String cpuSpeed; private String operatingSystem; private double weight; private String cpu; public Product(String name, String customerReview, String hardDiskSize, String ramSize, String cpuSpeed, String operatingSystem, double weight, String cpu) { super(); this.name = name; this.customerReview = customerReview; this.hardDiskSize = hardDiskSize; this.ramSize = ramSize; this.cpuSpeed = cpuSpeed; this.operatingSystem = operatingSystem; this.weight = weight; this.cpu = cpu; } public Product() { super(); } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getCustomerReview() { return customerReview; } public void setCustomerReview(String customerReview) { this.customerReview = customerReview; } public String getHardDiskSize() { return hardDiskSize; } public void setHardDiskSize(String hardDiskSize) { this.hardDiskSize = hardDiskSize; } public String getRamSize() { return ramSize; } public void setRamSize(String ramSize) { this.ramSize = ramSize; } public String getCpuSpeed() { return cpuSpeed; } public void setCpuSpeed(String cpuSpeed) { this.cpuSpeed = cpuSpeed; } public String getOperatingSystem() { return operatingSystem; } public void setOperatingSystem(String operatingSystem) { this.operatingSystem = operatingSystem; } public String getCpu() { return cpu; } public void setCpu(String cpu) { this.cpu = cpu; } public void setWeight(double weight) { this.weight = weight; } public double getWeight() { return weight; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return "Product [id=" + id + ", name=" + name + ", customerReview=" + customerReview + ", hardDiskSize=" + hardDiskSize + ", ramSize=" + ramSize + ", cpuSpeed=" + cpuSpeed + ", operatingSystem=" + operatingSystem + ", weight=" + weight + ", cpu=" + cpu + "]"; } }
6fe04322b69517195cacf778ac40720468fc4d3c
b025e05d89fdcfad8fe91fba1e41f8a05f2ec447
/resourcemanagement/src/main/java/com/resource/app/model/RoleDetails.java
53afcb392025c635565f795bbf53a87c37033c8d
[]
no_license
ashakrishnan1997/resourcemanagement
6a04ba2ea82aa8182beaf3260e9f8c1dcee470d6
63355c48cc39b3e135d566a52d47b2aca411818a
refs/heads/master
2022-11-13T00:04:38.666730
2020-06-25T13:12:23
2020-06-25T13:12:23
274,915,271
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
package com.resource.app.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class RoleDetails { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer roleId; @Column(nullable = false) private String roleName; public Integer getRoleId() { return roleId; } public void setRoleId(Integer roleId) { this.roleId = roleId; } public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } }
7638593ac6460b7bd8c9fbc560793d12f70bd53d
69fd7f28a8a4a3b95b97e448626d979241b74d58
/onion/src/main/java/com/example/onion/OnionApplication.java
f7bedf2599302d8c7260301e2f1254f1d80a484c
[]
no_license
huleTW/layer-demo
0cb99e480486161844d769f6f9b239deef1e80b5
644eb9f3a4ff51ea1a14595ec2c21eadfa8a7ff7
refs/heads/master
2020-12-13T00:19:30.091055
2020-01-17T07:29:46
2020-01-17T07:29:46
234,265,919
0
0
null
null
null
null
UTF-8
Java
false
false
308
java
package com.example.onion; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class OnionApplication { public static void main(String[] args) { SpringApplication.run(OnionApplication.class, args); } }
b6ec3fffe443a9d0229b06da8626db7c0d7916e8
5f19b8870d1a19a56ce32217945cfec14fff5e37
/src/com/jiuli/library/adapter/LibraryAdater.java
922f7f5fc42f053399357517e90d1a926d88b79f
[]
no_license
siberiawolf126/AndroidLibrary
cd84c461f4c5198de54a645c91a14d9144aa4944
c95e9f1061b5794e66068d86f0248392e069766c
refs/heads/master
2021-04-09T17:27:26.076211
2015-07-17T09:27:36
2015-07-17T09:27:36
38,485,806
0
0
null
null
null
null
UTF-8
Java
false
false
1,776
java
package com.jiuli.library.adapter; import java.util.List; import android.content.Context; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; public abstract class LibraryAdater extends BaseAdapter { private Context context; public List<Object> mList; public LibraryAdater(Context context,List<Object> mList){ this.context = context; this.mList = mList; } @Override public int getCount() { // TODO Auto-generated method stub return mList.size(); } @Override public Object getItem(int position) { // TODO Auto-generated method stub return mList.get(position); } @Override public long getItemId(int id) { // TODO Auto-generated method stub return id; } public abstract int getViewLayout(); @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub if(convertView == null){ convertView = LayoutInflater.from(context).inflate(getViewLayout(), parent,false); } return convertView; } class ViewHolder { // I added a generic return type to reduce the casting noise in client code @SuppressWarnings("unchecked") public <T extends View> T get(View view, int id) { SparseArray<View> viewHolder = (SparseArray<View>) view.getTag(); if (viewHolder == null) { viewHolder = new SparseArray<View>(); view.setTag(viewHolder); } View childView = viewHolder.get(id); if (childView == null) { childView = view.findViewById(id); viewHolder.put(id, childView); } return (T) childView; } }; }
d3a368d65453cac8e4ac05f1d7bebed11171b652
d8fe9a2fd9a3b400d6c57e78df54db17c670687d
/app/src/main/java/mrzhang/com/wanandroid/study/core/http/exception/ServerException.java
abf579a9f2a9c729d616cbae03c69b792a8bd791
[]
no_license
jmzhangyiming/WanAndroidStudy
854cdde92639e2a8de531e83c3da97669b6fe2f2
32b776a5cdfaca256e5c5284582af91323bf91f5
refs/heads/master
2020-04-15T17:20:19.383001
2019-03-20T12:56:20
2019-03-20T12:56:20
164,870,847
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package mrzhang.com.wanandroid.study.core.http.exception; /** * @author quchao * @date 2017/11/27 */ public class ServerException extends Exception { private int code; public ServerException(String message) { super(message); } public ServerException(String message, int code) { super(message); this.code = code; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } }
bb06ae9aa733acb1b9aa77602618e415a4624b51
4010da7d972290c2451a4cdd97496d6227b577c8
/src/main/java/com/tw/item/Elixir.java
984cb36b629791929f9db49bb10688f24ea515ae
[]
no_license
twojcicki/rpg
547d1fa09dd6d0881e831b0ca258a47bb68ebc4e
b9a31cae20e50a35d072f6960fcce6b7293ce47c
refs/heads/master
2020-05-06T20:14:49.150278
2019-04-10T19:43:02
2019-04-10T19:43:02
180,229,248
0
0
null
null
null
null
UTF-8
Java
false
false
826
java
package com.tw.item; import com.tw.context.GameContext; public class Elixir implements Behavior { @Override public String getInfo() { return "You find a bottle with ELIXIR!"; } @Override public void fight(GameContext gameContext) { gameContext.showMessage("You fight with elixir and break it."); } @Override public void run(GameContext gameContext) { gameContext.showMessage("Run, Forrest, run!"); } @Override public void take(GameContext gameContext) { gameContext.showMessage("You drink elixir, which recover you 50 health point."); gameContext.getHero().setHealth(gameContext.getHero().getHealth()+50); } @Override public void giveUp(GameContext gameContext) { gameContext.showMessage("You go further."); } }
95d4ae3ba5bf9d7b08ec135ee034b94240abab12
26cd5f670258e331e7daf2b84b37da60ff74a03b
/MyThread.java
85b9cab3572f0927e2957992c4c7634992cc8abc
[]
no_license
ShingoSugahara/1225
59fd7602f6c0bbc3d7dc52593e7b3fbf4ac33729
1a244cb98eb0a8405cb959cf7abeb57a5cda7400
refs/heads/main
2023-02-03T15:54:53.117978
2020-12-25T06:58:22
2020-12-25T06:58:22
324,306,787
0
0
null
null
null
null
UTF-8
Java
false
false
200
java
package pory.kansai.sample; public class MyThread implements Runnable { public void run() { for(int i=0; i<100;i++) { System.out.println("MyThreadのrunメソッド("+i+")"); } } }
805bdf37d3279b63d4dd3964a50ddd80d57e0419
a888607cf6dc8a3a1119496f5c275bce57ee5310
/Board/src/article/service/DeleteRequest.java
550c8f54beacfc880c7cadbaec50a2167d901fbf
[]
no_license
sohyunL/koitt
61152bbe73cc336faaa43d98e3a567853fea2bd1
f57b55dd3538c8fd23bdf569c79b646e544bfab1
refs/heads/master
2020-03-30T04:17:55.795467
2018-09-29T05:21:38
2018-09-29T05:21:38
150,735,388
0
0
null
null
null
null
UTF-8
Java
false
false
356
java
package article.service; import java.util.Map; public class DeleteRequest { private int userId; private int articleId; public DeleteRequest(int userId, int articleId) { this.userId = userId; this.articleId = articleId; } public int getUserId() { return userId; } public int getArticleId() { return articleId; } }
[ "KOITT-02-A@KOITT-02-A-PC" ]
KOITT-02-A@KOITT-02-A-PC
d60e317814aa5427cb3c5a902f6e3763a2fc5617
9bda2bd2abc16a3b02804cd486e6156ee819fe83
/SummonAndroid/app/src/main/java/com/vishalkuo/summon/RetroService.java
51c905280a4f4306ee04b692cfacc8d212f4d429
[]
no_license
vishalkuo/summon
eab60f1e4f61fdca24df08bc4d6ef3b3b351dfe4
1b009cf3c40c903c6880b5e52af32d9110e307cf
refs/heads/master
2021-01-18T14:06:26.421169
2015-09-06T15:20:10
2015-09-06T15:20:10
38,364,976
0
1
null
null
null
null
UTF-8
Java
false
false
312
java
package com.vishalkuo.summon; import retrofit.Callback; import retrofit.http.Body; import retrofit.http.POST; /** * Created by vishalkuo on 15-07-01. */ public interface RetroService { @POST("/api/v1/tableRequest") void newPostTask(@Body TableRequest tableRequest, Callback<String> taskCallback); }