blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
sequencelengths
1
1
author_id
stringlengths
0
313
2ab3daf35a2e82715607f211ceaf2982a01c6112
6098d4390c57596a3b2583381c0892d0d6c8b17d
/src/main/java/Vessel.java
a8149b355fa3df7781ba4e92d2d5258b59898146
[]
no_license
MatthewTan96/OOP
f3e311467c2c9c8913c500c654624439e88b54ff
5e4358bb186ffdd643d509de179b4e0d767a5534
refs/heads/master
2023-01-12T08:39:01.518023
2020-11-18T16:22:26
2020-11-18T16:22:26
292,770,761
0
0
null
null
null
null
UTF-8
Java
false
false
2,000
java
package main.java; // import main.java; public class Vessel { String vesselShortName; String incomingVoyageNumber; String outgoingVoyageNumber; String berthTimeRequired; String expectedDateTimeDeparture; String berthNumber; String status; public Vessel(String vesselShortName, String incomingVoyageNumber, String outgoingVoyageNumber, String berthTimeRequired, String expectedDateTimeDeparture, String berthNumber, String status) { this.vesselShortName = vesselShortName; this.incomingVoyageNumber = incomingVoyageNumber; this.outgoingVoyageNumber = outgoingVoyageNumber; this.berthTimeRequired = berthTimeRequired; this.expectedDateTimeDeparture = expectedDateTimeDeparture; this.berthNumber = berthNumber; this.status = status; } public String getVesselShortName() { return this.vesselShortName; } public String getIncomingVoyageNumber() { return this.incomingVoyageNumber; } public String outgoingVoyageNumber() { return this.outgoingVoyageNumber; } public String getBerthTimeRequired() { return this.berthTimeRequired; } public String getExpectedDateTimeDeparture() { return this.getExpectedDateTimeDeparture(); } public String getBerthNumber() { return this.berthNumber; } public String status() { return this.status; } public String toString() { return "{" + "vesselShortName: " + this.vesselShortName + ',' + "incomingVoyageNumber" + this.incomingVoyageNumber + ',' + "outgoingVoyageNumber" + this.outgoingVoyageNumber + ',' + "berthTimeRequired" + this.berthTimeRequired + ',' + "expectedDateTimeDeparture" + this.expectedDateTimeDeparture + ',' + "berthNumber" + this.berthNumber + ',' + "status" + this.status + "}"; } }
bb1c2e7ea7b031ad27c10ed1a7dd265a9c0ccf7a
9c7cf7937edd496ddd0f6087ab9f24570afb17a2
/src/main/java/com/phyous/sodoku/Client.java
22220eeaab4f53d77c77f4290bfc3809d68fc7b1
[]
no_license
phyous/thrift-sodoku
4d53fd6c36ff53f5e080f8b546c74434b21ed524
58ec50e80257ebd803e632bfdc2d12be92080d0d
refs/heads/master
2021-01-22T08:19:40.525215
2013-01-07T01:43:44
2013-01-07T01:43:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,966
java
package com.phyous.sodoku; import com.phyous.sodoku.thrift.BadArgumentException; import com.phyous.sodoku.thrift.Sodoku; import org.apache.thrift.TException; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.protocol.TProtocol; import org.apache.thrift.transport.TSocket; import org.apache.thrift.transport.TTransport; import org.apache.thrift.transport.TTransportException; /** * Created with IntelliJ IDEA. * User: pyoussef * Date: 10/18/12 * Time: 5:20 PM * To change this template use File | Settings | File Templates. */ public class Client { public static void main(String[] args) { Client c = new Client(); String input = "862300000500908040039000180108090037000207000920010604013000490080409001000005863"; c.start(input); } private void start(String input) { TTransport transport; //Print input System.out.println("Attempting to solve:"); printSodokuString(input); try { transport = new TSocket("localhost", 9888); TProtocol protocol = new TBinaryProtocol(transport); Sodoku.Client client = new Sodoku.Client(protocol); transport.open(); String solved = client.solve(input); // Print result System.out.println("Solution from server:"); printSodokuString(solved); transport.close(); } catch (TTransportException e) { e.printStackTrace(); } catch (TException e) { e.printStackTrace(); } catch (BadArgumentException e) { e.printStackTrace(); } } private void printSodokuString(String input){ StringBuilder sb = new StringBuilder(); sb.append(" ---+---+---\n"); for(int i = 0; i< 81; i++){ if(i%9 == 0) sb.append("|"); sb.append(input.charAt(i)); if((i+1) % 3 == 0) sb.append("|"); if((i+1) % 9 == 0) sb.append("\n"); if ((i+1) % 27 == 0) sb.append(" ---+---+---\n"); } System.out.println(sb.toString()); } }
79b9a81e47b1f265f6a9428045d000f3d4fbf0b6
3169cd3e7af40ac61c8d48e61d10e53e2c5874a4
/app/src/test/java/com/yifanliang219/calculator/ExampleUnitTest.java
6a14984a9ea9f9c9ff8fd310e7efd5ad7bc99267
[]
no_license
yifanliang219/Android_Calculator
167f01ef83b3092140b82d5e3d4ff6057fb01fc3
d1c17d4573bb6d1cc36b66630a7129b14d03faa4
refs/heads/master
2023-07-31T14:39:17.490487
2021-09-22T21:09:10
2021-09-22T21:09:10
409,349,059
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.yifanliang219.calculator; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
5b4da139a0a9fb42254ca446a88cdcd688c9885b
473b76b1043df2f09214f8c335d4359d3a8151e0
/benchmark/bigclonebenchdata_completed/6374427.java
73207d11b1ba74c37d69b4694bbe8d89d7e23b81
[]
no_license
whatafree/JCoffee
08dc47f79f8369af32e755de01c52d9a8479d44c
fa7194635a5bd48259d325e5b0a190780a53c55f
refs/heads/master
2022-11-16T01:58:04.254688
2020-07-13T20:11:17
2020-07-13T20:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,709
java
import java.io.UncheckedIOException; import java.io.UncheckedIOException; class c6374427 { public MyHelperClass URLEncoder; public String getTags(URL url) { StringBuffer xml = new StringBuffer(); OutputStreamWriter osw = null; BufferedReader br = null; try { MyHelperClass paramName = new MyHelperClass(); String reqData = URLEncoder.encode(paramName, "UTF-8") + "=" + URLEncoder.encode(url.toString(), "UTF-8"); MyHelperClass cmdUrl = new MyHelperClass(); URL service = new URL(cmdUrl); URLConnection urlConn =(URLConnection)(Object) service.openConnection(); urlConn.setDoOutput(true); urlConn.connect(); osw = new OutputStreamWriter(urlConn.getOutputStream()); osw.write(reqData); osw.flush(); br = new BufferedReader(new InputStreamReader(urlConn.getInputStream())); String line = null; while ((line =(String)(Object) br.readLine()) != null) { xml.append(line); } } catch (UncheckedIOException e) { e.printStackTrace(); } finally { try { if (osw != null) { osw.close(); } if (br != null) { br.close(); } } catch (UncheckedIOException e) { e.printStackTrace(); } } return xml.toString(); } } // Code below this line has been added to remove errors class MyHelperClass { public MyHelperClass encode(MyHelperClass o0, String o1){ return null; } public MyHelperClass encode(String o0, String o1){ return null; }} class URL { URL(MyHelperClass o0){} URL(){} public MyHelperClass openConnection(){ return null; }} class OutputStreamWriter { OutputStreamWriter(){} OutputStreamWriter(MyHelperClass o0){} public MyHelperClass close(){ return null; } public MyHelperClass flush(){ return null; } public MyHelperClass write(String o0){ return null; }} class BufferedReader { BufferedReader(){} BufferedReader(InputStreamReader o0){} public MyHelperClass readLine(){ return null; } public MyHelperClass close(){ return null; }} class URLConnection { public MyHelperClass getOutputStream(){ return null; } public MyHelperClass setDoOutput(boolean o0){ return null; } public MyHelperClass getInputStream(){ return null; } public MyHelperClass connect(){ return null; }} class InputStreamReader { InputStreamReader(MyHelperClass o0){} InputStreamReader(){}} class IOException extends Exception{ public IOException(String errorMessage) { super(errorMessage); } }
eba04f0470c36e1c72101de3e32b481e95efd29e
beca9a796ce296c1662fa3d34e3b3b6a10bcb891
/app/src/main/java/com/example/millionaire/RecyclerViews/RecyclerViewAdapter.java
89babb863dd4540a349f9f650ea187b672efbf5f
[]
no_license
diogosequeira94/MillionaireGame
60678b33e22e6f7962c50f4206a5a87bde42c8c9
fd4dc4a460e69b597a720e445705fcd754186948
refs/heads/master
2021-07-01T09:48:16.213621
2020-11-30T13:41:40
2020-11-30T13:41:40
199,327,591
0
0
null
null
null
null
UTF-8
Java
false
false
1,656
java
package com.example.millionaire.RecyclerViews; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.example.millionaire.R; import java.util.ArrayList; public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.RecyclerViewHolder> { private ArrayList<TopicItem> peopleList; public static class RecyclerViewHolder extends RecyclerView.ViewHolder { public ImageView icon; public TextView mTextView1; public RecyclerViewHolder(View itemView) { super(itemView); icon = itemView.findViewById(R.id.imageView); mTextView1 = itemView.findViewById(R.id.textView); } } public RecyclerViewAdapter(ArrayList<TopicItem> itemList){ peopleList = itemList; } @NonNull @Override public RecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.topic_item, parent, false ); RecyclerViewHolder evh = new RecyclerViewHolder(v); return evh; } @Override public void onBindViewHolder(@NonNull RecyclerViewHolder holder, int position) { TopicItem currentItem = peopleList.get(position); holder.icon.setImageResource(currentItem.getIcon()); holder.mTextView1.setText(currentItem.getName()); } @Override public int getItemCount() { return peopleList.size(); } }
17001aac31fe617af0508baed2d10c43b67a0608
7565725272da0b194a7a6b1a06a7037e6e6929a0
/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/convert/CassandraJsr310Converters.java
05fafa848846defc45aa8cc06f275658871b05eb
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-generic-cla" ]
permissive
paulokinho/spring-data-cassandra
460abd2b3f6160b67464f3a86b1c7171a8e94e35
44671e4854e8395ac33efcc144c1de3bd3d3f270
refs/heads/master
2020-02-26T16:12:25.391964
2017-03-05T22:17:01
2017-03-05T22:17:01
68,550,589
0
3
null
2017-03-05T22:17:02
2016-09-18T22:25:43
Java
UTF-8
Java
false
false
2,909
java
/* * Copyright 2016 the original author or authors. * * 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.springframework.data.cassandra.convert; import java.time.LocalDate; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import org.springframework.core.convert.converter.Converter; import org.springframework.data.convert.Jsr310Converters; import org.springframework.util.ClassUtils; /** * Helper class to register JodaTime specific {@link Converter} implementations in case the library is present on the * classpath. * * @author Mark Paluch * @since 1.5 */ @SuppressWarnings("Since15") public abstract class CassandraJsr310Converters { private static final boolean JAVA_8_IS_PRESENT = ClassUtils.isPresent("java.time.LocalDateTime", Jsr310Converters.class.getClassLoader()); private CassandraJsr310Converters() {} /** * Returns the converters to be registered. Will only return converters in case we're running on Java 8. * * @return */ public static Collection<Converter<?, ?>> getConvertersToRegister() { if (!JAVA_8_IS_PRESENT) { return Collections.emptySet(); } List<Converter<?, ?>> converters = new ArrayList<Converter<?, ?>>(); converters.add(CassandraLocalDateToLocalDateConverter.INSTANCE); converters.add(LocalDateToCassandraLocalDateConverter.INSTANCE); return converters; } /** * Simple singleton to convert {@link com.datastax.driver.core.LocalDate}s to their {@link LocalDate} representation. * * @author Mark Paluch */ public enum CassandraLocalDateToLocalDateConverter implements Converter<com.datastax.driver.core.LocalDate, LocalDate> { INSTANCE; @Override public LocalDate convert(com.datastax.driver.core.LocalDate source) { return LocalDate.of(source.getYear(), source.getMonth(), source.getDay()); } } /** * Simple singleton to convert {@link LocalDate}s to their {@link com.datastax.driver.core.LocalDate} representation. * * @author Mark Paluch */ public enum LocalDateToCassandraLocalDateConverter implements Converter<LocalDate, com.datastax.driver.core.LocalDate> { INSTANCE; @Override public com.datastax.driver.core.LocalDate convert(LocalDate source) { return com.datastax.driver.core.LocalDate.fromYearMonthDay(source.getYear(), source.getMonthValue(), source.getDayOfMonth()); } } }
d75856ee3ca4ae6bc8baa61384d72a753e5cb585
ede0174ff9bf6e2a39836e0ce1bba3ac5d962888
/PosAndEle.java
30694f14a0077521fe5bdd2ecebff66d5a563afc
[]
no_license
saran05/number1
8d86617432c31a8fc18096cc3fe8591a45d1f9d4
e95d02680a059b51347d68baece74c682abb80ae
refs/heads/master
2020-04-06T06:55:49.394644
2016-08-31T06:46:27
2016-08-31T06:46:27
63,464,505
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
public class aa { public static void main(String[] args) { arr a2=new arr(); int n,i,j; Scanner sc=new Scanner(System.in); System.out.println("enter the size of an array"); n=sc.nextInt(); int[] a=new int[n]; System.out.println("enter the first element of an array"); a[0]=sc.nextInt(); System.out.println("enter the diff between the element"); j=sc.nextInt(); for(i=1;i<n;i++) { a[i]=a[i-1]+j; System.out.println(""+a[i]); } for(i=0;i<n;i++) { a2.a1(a[i], i); } } } class arr { void a1(int a,int i) { if(a==i){ System.out.println("the element"+a+"is in the position"+i); } } }
2055225ee2f78d40d1d7c1fae8f347ea25614a2f
efd522e2283ce49c4b09060f478ebc1e86df085b
/src/wuit/common/crawler/composite/.svn/text-base/RunJob.java.svn-base
198f6eb887f4be71741fac2c6084b9135a0af900
[]
no_license
winnie6713/crawler_system
ac518ca5bdc1dade834056603e29cbb1d63ce7d2
50dda80ccf7403d806acd67e49eb603a84f6591d
refs/heads/master
2020-12-29T18:46:30.831899
2016-05-11T09:53:35
2016-05-11T09:53:35
58,533,380
0
0
null
null
null
null
UTF-8
Java
false
false
615
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wuit.common.crawler.composite; import wuit.application.DataParam; /** * * @author lxl */ public class RunJob extends Thread{ DataParam param; int status = 1; CompositeConvert convert = new CompositeConvert(); public synchronized void setStatus(int status){ this.status = status; } public synchronized int getStatus(){ return status; } public void setParam(DataParam param){ this.param = param; } }
47c97697c9388cc9c803f1b6f6824099cf1b4147
cb8206caf428eddaf0ad3bbb6e32acc0b5f31590
/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/red/nattable/configs/VariablesInElementsLabelAccumulator.java
9e1ee1bb4eaab788c6ff739f005ed7c9f9adf54a
[ "Apache-2.0" ]
permissive
puraner/RED
75420b81b639c47476981065fc53ab15b783ec2d
d41b7c244ff2e449c541fd0691213fcf5a3b30c1
refs/heads/master
2020-07-04T04:08:09.203533
2019-08-13T13:27:23
2019-08-13T13:27:23
202,150,040
0
0
NOASSERTION
2019-08-13T13:24:49
2019-08-13T13:24:48
null
UTF-8
Java
false
false
1,307
java
/* * Copyright 2018 Nokia Solutions and Networks * Licensed under the Apache License, Version 2.0, * see license.txt file for details. */ package org.robotframework.red.nattable.configs; import org.eclipse.nebula.widgets.nattable.layer.LabelStack; import org.eclipse.nebula.widgets.nattable.layer.cell.IConfigLabelAccumulator; import org.robotframework.ide.eclipse.main.plugin.tableeditor.cases.CasesElementsLabelAccumulator; import org.robotframework.ide.eclipse.main.plugin.tableeditor.keywords.KeywordsElementsLabelAccumulator; /** * @author lwlodarc * */ public class VariablesInElementsLabelAccumulator implements IConfigLabelAccumulator { public static final String POSSIBLE_VARIABLES_IN_ELEMENTS_CONFIG_LABEL = "POSSIBLE_VARIABLES_IN_ELEMENTS_INSIDE"; @Override public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) { if (!(configLabels.hasLabel(ActionNamesLabelAccumulator.ACTION_NAME_CONFIG_LABEL) || configLabels.hasLabel(KeywordsElementsLabelAccumulator.KEYWORD_DEFINITION_CONFIG_LABEL) || configLabels.hasLabel(CasesElementsLabelAccumulator.CASE_CONFIG_LABEL))) { configLabels.addLabel(POSSIBLE_VARIABLES_IN_ELEMENTS_CONFIG_LABEL); } } }
e634192e7f7e5ae21cd53e8afb6b02c5e1b29eff
4160da090d8dc6eba384c4ccccbd0ea9e016f73f
/src/main/java/io/github/prepayments/internal/batch/prepaymentData/package-info.java
a05ddfc5aee1e3f49a55e43ede2dd81c3e6e2bdf
[]
no_license
prepayments/prepayments-server
03caffecaabcb357981947e652436fe1f314e941
34f9770076c4068322f20ac41ed9f948f970825a
refs/heads/master
2023-02-27T06:57:52.906173
2021-01-29T16:29:19
2021-01-29T16:29:19
329,243,391
0
0
null
null
null
null
UTF-8
Java
false
false
168
java
/** * This package contains configurations for prepayment-data file data file upload batch processing */ package io.github.prepayments.internal.batch.prepaymentData;
3753c882bc12fa5870ef19fe1de795fcf34d4d9c
38a9418eb677d671e3f7e88231689398de0d232f
/baekjoon/src/main/java/p11003/Main.java
74b255d2a53bf0caa4661869ab458e44dbb74907
[]
no_license
csj4032/enjoy-algorithm
66c4774deba531a75058357699bc29918fc3a7b6
a57f3c1af3ac977af4d127de20fbee101ad2c33c
refs/heads/master
2022-08-25T03:06:36.891511
2022-07-09T03:35:21
2022-07-09T03:35:21
99,533,493
0
1
null
null
null
null
UTF-8
Java
false
false
604
java
package p11003; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args) { var sc = new Scanner(System.in); var n = sc.nextInt(); var l = sc.nextInt(); var queue = new LinkedList<Integer>(); var sb = new StringBuilder(); var min = Integer.MAX_VALUE; for (int i = 0; i < l - 1; i++) queue.add(Integer.MAX_VALUE); for (int i = 0; i < n; i++) { var k = sc.nextInt(); min = Math.min(k, queue.peek()); queue.add(min); sb.append(min + " "); if(queue.peek() == min) { } } System.out.println(sb.toString()); } }
844bcbb48fec73a2cbf09ecde6d2a6f607007284
1da41bd52eaa6716c2da664f5af3f8e8f3c2007a
/src/de/timherbst/wau/view/lookup/SelectAuswertungDialog.java
d785f815dad2240f60fb83d1ce4c8982c2a5d174
[ "MIT" ]
permissive
rellit/wekaflott
519699d3a7133cfbc1cb7eadd67b9c2d7a4e9aa4
0efa6d39771a1519b31f99cbe03ae6533e0c3f8b
refs/heads/master
2023-01-21T09:31:16.053646
2023-01-16T07:56:53
2023-01-16T07:56:53
12,952,276
0
0
null
null
null
null
UTF-8
Java
false
false
3,231
java
package de.timherbst.wau.view.lookup; import java.awt.Component; import java.awt.Point; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; import java.io.Writer; import java.util.Arrays; import java.util.ResourceBundle; import java.util.Vector; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; import javax.swing.JDialog; import org.javabuilders.swing.SwingJavaBuilder; import de.axtres.logging.main.AxtresLogger; import de.timherbst.wau.application.Application; import de.timherbst.wau.domain.Mannschaft; import de.timherbst.wau.domain.WettkampfTag; @SuppressWarnings("serial") public class SelectAuswertungDialog extends JDialog { private JComboBox<String> typ; private JComboBox<?> auswahl; public SelectAuswertungDialog() { SwingJavaBuilder.build(this, loadYaml(), new ResourceBundle[0]); setTitle("Bitte auswählen"); setModal(true); typ.setModel(new DefaultComboBoxModel<String>(new Vector<String>(Arrays.asList("Riegen", "Wettkämpfe", "Mannschaften")))); fillAuswahl(); typ.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (ItemEvent.SELECTED == e.getStateChange()) { fillAuswahl(); pack(); } } }); pack(); setLocationRelativeTo(Application.getMainFrame()); } private String loadYaml() { try { InputStream is = getClass().getResourceAsStream("/de/timherbst/wau/view/lookup/SelectAuswertungDialog.yml"); if (is != null) { Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); int n; while ((n = reader.read(buffer)) != -1) { writer.write(buffer, 0, n); } } finally { is.close(); } return writer.toString(); } else { return ""; } } catch (Exception e) { AxtresLogger.error("SelectAuswertungDialog", e); return ""; } } private void fillAuswahl() { if (typ.getSelectedItem() != null) { if ("Mannschaften".equals(typ.getSelectedItem())) auswahl.setModel(new DefaultComboBoxModel(WettkampfTag.get().getMannschaften())); if ("Wettkämpfe".equals(typ.getSelectedItem())) auswahl.setModel(new DefaultComboBoxModel(WettkampfTag.get().getWettkaempfe())); if ("Riegen".equals(typ.getSelectedItem())) auswahl.setModel(new DefaultComboBoxModel(WettkampfTag.get().getRiegen())); } else { auswahl.setModel(new DefaultComboBoxModel()); } } public void show(Component relativeTo) { setLocationRelativeTo(relativeTo); setVisible(true); } public void show(Point at) { setLocation(at); setVisible(true); } public void show(int x, int y) { setLocation(x, y); setVisible(true); } public void onSelect(Object o) { } public void onCancel() { } public void cancel() { onCancel(); setVisible(false); } public void ok() { onSelect(auswahl.getSelectedItem()); setVisible(false); } }
d7ee601b356fd5a96128e5f95c04c3d272ea0dec
59b62899bacc0aed8ffd7c74160f091d795a1760
/CT25-DataPack/build/CT25-DataPack1/game/data/scripts/handlers/bypasshandlers/BuyShadowItem.java
13c28f0f9785b0bdf611b5e53d80e9d0fdfd27ba
[]
no_license
l2jmaximun/RenerFreya
2f8d303942a80cb3d9c7381e54af049a0792061b
c0c13f48003b96b38012d20539b35aba09e25ac7
refs/heads/master
2021-08-31T19:39:30.116727
2017-12-22T15:20:03
2017-12-22T15:20:03
114,801,613
0
0
null
null
null
null
UTF-8
Java
false
false
2,211
java
/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package handlers.bypasshandlers; import ct25.xtreme.gameserver.handler.IBypassHandler; import ct25.xtreme.gameserver.model.actor.L2Character; import ct25.xtreme.gameserver.model.actor.L2Npc; import ct25.xtreme.gameserver.model.actor.instance.L2MerchantInstance; import ct25.xtreme.gameserver.model.actor.instance.L2PcInstance; import ct25.xtreme.gameserver.network.serverpackets.NpcHtmlMessage; public class BuyShadowItem implements IBypassHandler { private static final String[] COMMANDS = { "BuyShadowItem" }; public boolean useBypass(String command, L2PcInstance activeChar, L2Character target) { if (!(target instanceof L2MerchantInstance)) return false; NpcHtmlMessage html = new NpcHtmlMessage(((L2Npc)target).getObjectId()); if (activeChar.getLevel() < 40) html.setFile(activeChar.getHtmlPrefix(), "data/html/common/shadow_item-lowlevel.htm"); else if ((activeChar.getLevel() >= 40) && (activeChar.getLevel() < 46)) html.setFile(activeChar.getHtmlPrefix(), "data/html/common/shadow_item_d.htm"); else if ((activeChar.getLevel() >= 46) && (activeChar.getLevel() < 52)) html.setFile(activeChar.getHtmlPrefix(), "data/html/common/shadow_item_c.htm"); else if (activeChar.getLevel() >= 52) html.setFile(activeChar.getHtmlPrefix(), "data/html/common/shadow_item_b.htm"); html.replace("%objectId%", String.valueOf(((L2Npc)target).getObjectId())); activeChar.sendPacket(html); return true; } public String[] getBypassList() { return COMMANDS; } }
[ "Rener@Rener-PC" ]
Rener@Rener-PC
eb6f79669e89b0e9632cde4809c22eaaa1b85502
f182580ff9615070929c1883f280e3bd005d1b02
/Driver/src/cn/boweikeji/wuliu/driver/manager/LoginManager.java
b49feb0ca77f6543123f7c21f3d572de20a1c4a5
[]
no_license
wuqingnan/wuliu
bae621c30604cf4af2946f102ce8bac26b13dd03
231f7fde8fd9c05dcda16d738ff9d65e252a4ef3
refs/heads/master
2021-01-10T18:26:41.953576
2015-01-12T10:29:49
2015-01-12T10:29:49
20,869,658
0
0
null
null
null
null
UTF-8
Java
false
false
5,030
java
package cn.boweikeji.wuliu.driver.manager; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.http.Header; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.util.Log; import cn.boweikeji.wuliu.driver.Const; import cn.boweikeji.wuliu.driver.api.BaseParams; import cn.boweikeji.wuliu.driver.bean.UserInfo; import cn.boweikeji.wuliu.driver.event.LoginEvent; import cn.boweikeji.wuliu.driver.event.LogoutEvent; import cn.boweikeji.wuliu.http.AsyncHttp; import cn.boweikeji.wuliu.utils.FileUtils; import com.loopj.android.http.AsyncHttpResponseHandler; import com.loopj.android.http.JsonHttpResponseHandler; import com.loopj.android.http.ResponseHandlerInterface; import de.greenrobot.event.EventBus; public class LoginManager { private static final String TAG = LoginManager.class.getSimpleName(); private static final String FILE_NAME = "/user.info"; private JsonHttpResponseHandler mResponseHandler = new JsonHttpResponseHandler() { public void onSuccess(int statusCode, Header[] headers, JSONObject response) { if (response != null && response.length() > 0) { Log.d(TAG, "shizy---response: " + response.toString()); try { int res = response.getInt("res"); if (res == 2) { setLogin(true); mUserInfo.update(response.optJSONObject("infos")); setUserInfo(mUserInfo); EventBus.getDefault().post(new LoginEvent()); } } catch (JSONException e) { e.printStackTrace(); } } }; }; private boolean mHasLogin; private UserInfo mUserInfo; private static LoginManager mInstance; private LoginManager () { mHasLogin = false; } public static LoginManager getInstance() { if (mInstance == null) { mInstance = new LoginManager(); } return mInstance; } public boolean hasLogin() { return mHasLogin; } public void setLogin(boolean hasLogin) { mHasLogin = hasLogin; } public void login(String driver_cd, String passwd, AsyncHttpResponseHandler handler) { BaseParams params = new BaseParams(); params.add("method", "driverLoginCheck"); params.add("driver_cd", driver_cd); params.add("passwd", passwd); AsyncHttp.get(Const.URL_LOGIN, params, handler); } public void autoLogin() { if (mUserInfo == null) { read(); } if (mUserInfo != null && !hasLogin()) { login(mUserInfo.getDriver_cd(), mUserInfo.getPasswd(), mResponseHandler); } } public void logout() { logout(mUserInfo.getDriver_cd(), mUserInfo.getPasswd()); mHasLogin = false; mUserInfo = null; EventBus.getDefault().post(new LogoutEvent()); clear(); } private void logout(String driver_cd, String passwd) { BaseParams params = new BaseParams(); params.add("method", "driverLogOut"); params.add("driver_cd", driver_cd); params.add("passwd", passwd); AsyncHttp.get(Const.URL_LOGOUT, params, new JsonHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { super.onSuccess(statusCode, headers, response); } }); } public void setUserInfo(UserInfo info) { mUserInfo = info; save(); } public UserInfo getUserInfo() { return mUserInfo; } private void save() { if (mUserInfo == null) { return; } File file = new File(Const.getFilePath() + FILE_NAME); if (FileUtils.fileExist(file)) { FileUtils.deleteFile(file); } FileOutputStream fos = null; try { file.createNewFile(); fos = new FileOutputStream(file); String string = mUserInfo.toString(); fos.write(string.getBytes()); fos.flush(); } catch (IOException e) { e.printStackTrace(); } finally { if (fos != null) { try { fos.close(); } catch (IOException e) { e.printStackTrace(); } } } } private void read() { File file = new File(Const.getFilePath() + FILE_NAME); if (FileUtils.fileExist(file)) { FileInputStream fis = null; ByteArrayOutputStream baos = null; try { fis = new FileInputStream(file); baos = new ByteArrayOutputStream(); byte[] buf = new byte[256]; int len = -1; while ((len = fis.read(buf)) > 0) { baos.write(buf, 0, len); } String string = new String(baos.toByteArray()); mUserInfo = new UserInfo(new JSONObject(string)); } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } finally { try { if (fis != null) { fis.close(); } if (baos != null) { baos.close(); } } catch (IOException e) { e.printStackTrace(); } } } } private void clear() { File file = new File(Const.getFilePath() + FILE_NAME); if (FileUtils.fileExist(file)) { FileUtils.deleteFile(file); } } }
4f773f4de4c5030e8c961e0952c1e96f39a7d040
e9c64a66abf589b9acab3023888e1e1d7b42b9fa
/app/src/androidTest/java/app/gh/obbang/ExampleInstrumentedTest.java
d80ea99d4b9796347fbc76e1af8a3a4c67cd4135
[]
no_license
ByeonWoojeong/OBbang
e958b880b8becd17049eac42a2a2111df993c442
b3605ec6ae37f7bc5eae8979e8658b4aaf4d6bc0
refs/heads/master
2020-08-30T17:19:52.737726
2019-10-30T04:34:45
2019-10-30T04:34:45
218,442,448
0
0
null
null
null
null
UTF-8
Java
false
false
736
java
package app.gh.obbang; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("app.gh.obbang", appContext.getPackageName()); } }
8243f87533583951378c97d3b521e381f7a2f248
52d44d9f7d9f85e2e5ffdc392e696a6e2bf311a1
/web/src/main/java/pl/ap/web/controller/IndexController.java
461bbf3b7ed146d6601667db87979daeda8f36c1
[]
no_license
p4welo/active-portal
8723c4e7c788439ddb920f3251267691d703367e
1301f8477043dd7cf0721990752fd49931b7fc08
refs/heads/master
2021-01-17T07:51:16.202489
2018-03-05T23:28:22
2018-03-05T23:28:22
19,733,389
1
0
null
null
null
null
UTF-8
Java
false
false
517
java
package pl.ap.web.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** * Created by PARADOMS on 15-07-22. */ @Controller public class IndexController { @RequestMapping(value = "/") public String index() { return "index"; } @RequestMapping(value = "/login") public String login() { return "login"; } @RequestMapping(value = "/home") public String home() { return "home"; } }
33b1343f8a62f83284d2154c3012252ff179624b
588b390ee31d8ebc33283b00f812ec5c8c35badd
/guns-core/src/main/java/com/stylefeng/guns/core/node/tree/TreeService.java
dbc1950a99eb5abb7adc20142b53741844f711c5
[ "Apache-2.0" ]
permissive
YangZhenFu/SpringBootTest
a60eb28982f69c36c5c18c2bb82844e46a117757
059513c214629dc2e125c129bbce22dd93f8ba63
refs/heads/master
2020-03-09T04:31:13.797220
2018-05-25T01:55:33
2018-05-25T01:55:40
128,589,815
2
0
null
null
null
null
UTF-8
Java
false
false
2,483
java
package com.stylefeng.guns.core.node.tree; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * * 描述:获得树形的服务实现 作者: xfz * * 时间:2016年7月2日 * * 版本号:1.0 */ public abstract class TreeService<T extends BaseTreeObj<T, ID>, ID extends Serializable> implements TreeInterface<T, ID> { public List<T> getChildTreeObjects(List<T> list, ID parentId) { List<T> returnList = new ArrayList<T>(); for (Iterator<T> iterator = list.iterator(); iterator.hasNext();) { T res = (T) iterator.next(); /** * 判断第一个对象是否为第一个节点 * */ if (res.getParentId() == parentId) { /** * 相等--说明第一个节点为父节点--递归下面的子节点 */ recursionFn(list, res); returnList.add(res); } } return returnList; } /** * 递归列表 * * @param list * @param t * @author xfz * * 上午1:11:57 */ public void recursionFn(List<T> list, T t) { List<T> childsList = getChildList(list, t); /** * 设置他的子集对象集 */ t.setChildsList(childsList); /** * 迭代--这些子集的对象--时候还有下一级的子级对象 */ for (T nextChild : childsList) { /** * 下一个对象,与所有的资源集进行判断 */ if (hasChild(list, nextChild)) { /** * 有下一个子节点,递归 */ Iterator<T> it = childsList.iterator(); while (it.hasNext()) { T node = it.next(); /** * 所有的对象--跟当前这个childsList 的对象子节点 */ recursionFn(list, node); } } } } /** * 获得指定节点下的所有子节点 * * @param list * @param t * @return * @author xfz * * 上午1:12:55 */ public List<T> getChildList(List<T> list, T t) { List<T> childsList = new ArrayList<T>(); Iterator<T> it = list.iterator(); while (it.hasNext()) { T child = it.next(); /** * 判断集合的父ID是否等于上一级的id */ if (((BaseTreeObj<T, ID>) child).getParentId() == ((BaseTreeObj<T, ID>) t).getId()) { childsList.add(child); } } return childsList; } /** * 判断是否还有下一个子节点 * * @param list * @param t * @return * @author xfz * * 上午1:13:43 * */ public boolean hasChild(List<T> list, T t) { return getChildList(list, t).size() > 0 ? true : false; } }
e2b4a5e18cd6eb3d3172727e3502baba10556d28
11ba08b55c2f57337bb4bea427e9b73965177ac8
/wwweqwe/src/application/Main.java
741cb96948a0f7d581a009d0b36120a86fbe1f81
[]
no_license
quadzero4/soundMagic
845b18971c1580123d111070338b43e12f7f907c
76e9d83307199d11d4f144d5e6d79ee5fa44580a
refs/heads/master
2022-03-31T20:22:07.168591
2020-01-21T00:04:41
2020-01-21T00:04:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
711
java
package application; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage primaryStage) { try { Parent root = (Parent)FXMLLoader.load(getClass().getResource("TVM.fxml")); Scene scene = new Scene(root); primaryStage.setTitle("The Voice"); primaryStage.setScene(scene); primaryStage.setWidth(1000); primaryStage.setHeight(1000); primaryStage.setResizable(false); primaryStage.show(); } catch(Exception e) { e.printStackTrace(); } } public static void main(String[] args) { launch(args); } }
5cf7a4249985d6c6654db58302e6a6251671e3e3
6576917a4b29207d7b0778ba8bf45d1081a45a66
/order/src/main/java/com/yami/order/dto/Order.java
fe01914e37b09d21e76786a8a776415734778eb1
[]
no_license
yami007/distributedTx
e86a6873e64f6acd865f331f3506752f2321be50
526743c9b61706f7f3a9cd61c0ae772ff333d4ce
refs/heads/master
2022-06-23T02:14:23.240147
2019-07-06T16:06:29
2019-07-06T16:06:29
195,547,351
0
0
null
2022-06-17T02:16:05
2019-07-06T14:17:39
Java
UTF-8
Java
false
false
1,634
java
package com.yami.order.dto; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import java.io.Serializable; import java.time.ZonedDateTime; /** * 实体类 * @author Administrator * */ @Entity(name="tb_order") public class Order implements Serializable{ @Id @GeneratedValue private Long id;//ID private String uuid; private Long customerId; private String title; private Long ticketNum; private int amount; private String status; private String reason; private ZonedDateTime creatDate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public Long getCustomerId() { return customerId; } public void setCustomerId(Long customerId) { this.customerId = customerId; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public Long getTicketNum() { return ticketNum; } public void setTicketNum(Long ticketNum) { this.ticketNum = ticketNum; } public int getAmount() { return amount; } public void setAmount(int amount) { this.amount = amount; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } public ZonedDateTime getCreatDate() { return creatDate; } public void setCreatDate(ZonedDateTime creatDate) { this.creatDate = creatDate; } }
66f14558c2a04e7ba01ba609a90d4dfe10089c38
7f21482fdcab9c425fc1ef396c2aa60beb65eed3
/src/main/java/com/privaterestaurant/domain/Module.java
faab9aa9f748a611928dd1eecb625a7e423140d0
[]
no_license
StoBrothers/privaterestaurant
a42586bff5c7e77f8bbd91e47ddfc64db1b0d536
bf7c5bfa8543f1e385c3b21f0bf2afd219cde3af
refs/heads/master
2021-01-18T21:30:49.942180
2016-05-24T07:58:56
2016-05-24T07:58:56
55,802,774
0
1
null
null
null
null
UTF-8
Java
false
false
656
java
package com.privaterestaurant.domain; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; /** * Module entity. * * @author Sergey Stotskiy * */ @SuppressWarnings("serial") @Entity public class Module implements Serializable { @Id @GeneratedValue private Long id; @Column(nullable = false, length = 255) private String name; public Long getId() { return this.id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
39fa5284248589f44c8db60457caa7151b225d84
7a36046b9d2a91c14cf440f48a4498ef86d80d4d
/src/picoyplacapredictor/dto/DayRestrictionsDto.java
fb9f11fa6e8c7d65764b5978fd1cc69bda91498f
[]
no_license
ibarrae/Pico-y-Placa-Validator
67a6593d6fcabe2888b7a92cc9ddc48f27d0230a
ee1e874985ac164c1d1e1326450aeabdcc8406c2
refs/heads/master
2020-03-18T12:18:53.869537
2018-05-24T16:46:08
2018-05-24T16:46:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
989
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 picoyplacapredictor.dto; import java.util.List; /** * * @author Esteban Ibarra */ public class DayRestrictionsDto { private final Integer dayOftheWeek; private final List<Integer> digits; private final List<HourRestrictionDto> hourRestrictions; public DayRestrictionsDto(Integer dayOftheWeek, List<Integer> digits, List<HourRestrictionDto> hourRestrictions) { this.dayOftheWeek = dayOftheWeek; this.digits = digits; this.hourRestrictions = hourRestrictions; } public Integer getDayOftheWeek() { return dayOftheWeek; } public List<Integer> getDigits() { return digits; } public List<HourRestrictionDto> getHourRestrictions() { return hourRestrictions; } }
[ "" ]
932e97c13726071c0d38cb1db80df7307eb1bf98
c5449294fa92889345067292b03c3b59e1a07ce6
/src/ga/operators/ParentSelection.java
d230ba87119522ec418d2db4b6378f913e3c584b
[ "Apache-2.0" ]
permissive
ailabtelkom/AiLibrary
a96e687f2f49288a39501db9b025bee5ecd69acd
25cc917db7156ae612bd6e01e4dbfe7751c6611e
refs/heads/master
2021-10-28T12:03:13.172452
2019-04-23T18:21:33
2019-04-23T18:21:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,487
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 ga.operators; import ga.chromosome.Chromosome; import ga.Population; import java.util.Random; import java.util.stream.DoubleStream; /** * * @author dee */ public class ParentSelection { public static Chromosome[] selectParent(int selectionType, Population population, double fitness[]) { switch (selectionType) { case 0: return rouletteWheel(population, fitness); case 1: return linearScaling(population, fitness); case 2: return sigmaScaling(population, fitness); case 3: return linearRanking(population, fitness); case 4: return nonLinearRanking(population, fitness); case 5: return tournamentSelection(population, fitness); } return null; } public static Chromosome[] rouletteWheel(Population population, double fitness[]) { double sum = DoubleStream.of(fitness).sum(); Random r = new Random(); double pbR = r.nextFloat() * sum; double fn = 0; int i = 0; int x = 0; Chromosome parent[] = new Chromosome[2]; while (i < population.getUkPop()) { fn += fitness[i]; if (fn > pbR) { parent[x] = population.getChromosome(i); x++; if (x == 2) { return parent; } } i++; } if (x == 2) { return parent; } else { return rouletteWheel(population, fitness); } } public static Chromosome[] linearScaling(Population population, double fitness[]) { return null; } public static Chromosome[] sigmaScaling(Population population, double fitness[]) { return null; } public static Chromosome[] linearRanking(Population population, double fitness[]) { return null; } public static Chromosome[] nonLinearRanking(Population population, double fitness[]) { return null; } public static Chromosome[] tournamentSelection(Population population, double fitness[]) { return null; } }
07078aedbe530f9764698416fa253a1fdaa11438
dc7550511a160c50db981981751830d752f342ac
/src/main/java/com/xingying/shopping/master/service/Impl/MessageServiceImpl.java
07a532fd10308360f66a377d1083998a9754703e
[]
no_license
SilentFlower/xingYing-master
392636597e9a42c1f1ba5e3685d6a541557b4c1a
3997207468e0eb9c60e3bc4a8929692c3622b1e0
refs/heads/main
2023-06-03T00:57:03.816104
2021-06-16T10:53:05
2021-06-16T10:53:05
351,686,291
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
package com.xingying.shopping.master.service.Impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.xingying.shopping.master.common.entitys.page.PageQueryEntity; import com.xingying.shopping.master.entity.Message; import com.xingying.shopping.master.dao.MessageMapper; import com.xingying.shopping.master.service.MessageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * <p> * 服务实现类 * </p> * * @author zhaoweihao * @since 2021-05-18 */ @Service public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements MessageService { @Autowired private MessageMapper messageMapper; @Override public PageInfo<Message> getListByPage(PageQueryEntity<Message> pageQueryEntity) { PageHelper.startPage(pageQueryEntity.getPageNumber(), pageQueryEntity.getPageSize()); List<Message> list = messageMapper.getListByPage(pageQueryEntity.getData()); return new PageInfo<>(list); } }
37011281d4cd2886e584fef47111048ad0131dc0
e48985fdf73f191445798e79ae2813e987cb150c
/src/ch14/_04_Outter2.java
713fff100c32c409e93ba4abc4b28d0dca426b1a
[]
no_license
behappyleee/JavaTutorial
755212831fb2a79f614dbac3449118ab0b326633
83519e877fd8f236165ae0d672a0d5cbcce99366
refs/heads/master
2023-03-06T08:00:41.856955
2021-02-17T13:28:47
2021-02-17T13:28:47
339,708,368
0
0
null
null
null
null
UTF-8
Java
false
false
97
java
package ch14; //익명 내부 클래스 - 458page public class _04_Outter2 { }
506f8067e1afc8fe87d10a111dc18e596673228a
465852337e5875dd1034e0078bb843ddebade3c2
/src/model/Truck.java
77008d1e94d3a016cad5a446b96df8722727fe45
[]
no_license
suchithrakuttiyat/java_project
ce4349b846b6d7b3a25934cb42ed151d6e249394
7a586d6603ee4bba2cdd2ecbab51868d8c157873
refs/heads/master
2023-01-18T23:29:54.788925
2020-12-05T23:07:19
2020-12-05T23:07:19
317,508,381
0
0
null
null
null
null
UTF-8
Java
false
false
4,498
java
package model; import java.awt.Point; /** * Implements a Truck that can move around * */ public class Truck extends Car { /** * constructs a Truck having initial position and initial direction * @param position initial position of the Truck * @param direction initial direction of the Truck((East,North,West,South)) */ public Truck(Point position, String direction) { super(position, direction); } /** * stores drivers current position's coordinate(front-left point ), * back-left, front-right ,back-right of the truck * and returns all the points * @return the current four points of the car according to the angle */ @Override public Point[] getCoordinates() { Point[] coordinateArray = new Point[4]; int alpha = getAlpha() % 360; switch (alpha) { case 0: { coordinateArray[0] = getPosition(); coordinateArray[1] = new Point(getPosition().x, getPosition().y-1); coordinateArray[2] = new Point(getPosition().x+1, getPosition().y); coordinateArray[3] = new Point(getPosition().x+1, getPosition().y-1); break; } case 90: { coordinateArray[0] = getPosition(); coordinateArray[1] = new Point(getPosition().x+1, getPosition().y); coordinateArray[2] = new Point(getPosition().x, getPosition().y+1); coordinateArray[3] = new Point(getPosition().x+1, getPosition().y+1); break; } case 180: { coordinateArray[0] = getPosition(); coordinateArray[1] = new Point(getPosition().x, getPosition().y+1); coordinateArray[2] = new Point(getPosition().x-1, getPosition().y); coordinateArray[3] = new Point(getPosition().x-1, getPosition().y+1); break; } case 270: { coordinateArray[0] = getPosition(); coordinateArray[1] = new Point(getPosition().x-1, getPosition().y); coordinateArray[2] = new Point(getPosition().x, getPosition().y-1); coordinateArray[3] = new Point(getPosition().x-1, getPosition().y-1); break; } default: System.out.println("The angle is not 0, 90, 180 or 270."); break; } return coordinateArray; } /** * turns the truck to 90 degree left * and sets the driver's position according the angle */ @Override public void turnLeft() { int alpha = getAlpha() % 360; switch (alpha) { case 0: { setPosition(new Point(getPosition().x , getPosition().y-1)); break; } case 90: { setPosition(new Point(getPosition().x+1 , getPosition().y)); break; } case 180: { setPosition(new Point(getPosition().x , getPosition().y+1)); break; } case 270: { setPosition(new Point(getPosition().x-1 , getPosition().y)); break; } default: System.out.println("The angle is not 0, 90, 180 or 270."); break; } setAlpha(alpha+90); } /** * turns the truck to the 90 degree right * and sets the driver's position according the angle */ @Override public void turnRight() { int alpha = getAlpha() % 360; switch (alpha) { case 0: { setPosition(new Point(getPosition().x+1 , getPosition().y)); break; } case 90: { setPosition(new Point(getPosition().x , getPosition().y+1)); break; } case 180: { setPosition(new Point(getPosition().x-1 , getPosition().y)); break; } case 270: { setPosition(new Point(getPosition().x , getPosition().y-1)); break; } } int newAlpha = alpha-90; if (newAlpha < 0) { newAlpha = 270; } setAlpha(newAlpha); } /** * Check if all parts of the the Truck is inside the room. * @param room_width is the width of the room. * @param room_length is the length of the room. */ @Override public boolean carInside(int room_width,int room_length) { Point[] coordinates = getCoordinates(); return !(crashed(coordinates[0], room_width, room_length) || crashed(coordinates[1], room_width, room_length) || crashed(coordinates[2], room_width, room_length) || crashed(coordinates[3], room_width, room_length)); } /** * checks if all the parts(front-left,back-left,front-right,back-right) * of the Truck are inside the room * @param position the position of each part of the truck * @param room_width is the width of the room. * @param room_length is the length of the room. */ private boolean crashed(Point position, int room_width,int room_length) { return (position.getX() <0) || (position.getX() >= room_length) ||(position.getY() < 0) || (position.getY() >= room_width ); } }
0860ceb24c9816f8d7efd918954eedf7592b48cd
3abd77888f87b9a874ee9964593e60e01a9e20fb
/sim/EJS/OSP_core/src/org/opensourcephysics/media/gif/GifVideoRecorder.java
e4620ba46c3511ccda4f7f40419806170d341a2e
[ "MIT" ]
permissive
joakimbits/Quflow-and-Perfeco-tools
7149dec3226c939cff10e8dbb6603fd4e936add0
70af4320ead955d22183cd78616c129a730a9d9c
refs/heads/master
2021-01-17T14:02:08.396445
2019-07-12T10:08:07
2019-07-12T10:08:07
1,663,824
2
1
null
null
null
null
UTF-8
Java
false
false
4,823
java
/* * Open Source Physics software is free software as described near the bottom of this code file. * * For additional information and documentation on Open Source Physics please see: * <http://www.opensourcephysics.org/> */ /* * The org.opensourcephysics.media.gif package provides GIF services * including implementations of the Video and VideoRecorder interfaces. * * Copyright (c) 2004 Douglas Brown and Wolfgang Christian. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA * or view the license online at http://www.gnu.org/copyleft/gpl.html * * For additional information and documentation on Open Source Physics, * please see <http://www.opensourcephysics.org/>. */ package org.opensourcephysics.media.gif; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Image; import java.awt.image.BufferedImage; import org.opensourcephysics.media.core.ScratchVideoRecorder; /** * This is a gif video recorder that uses scratch files. * * @author Douglas Brown * @version 1.0 */ public class GifVideoRecorder extends ScratchVideoRecorder { // instance fields private AnimatedGifEncoder encoder = new AnimatedGifEncoder(); /** * Constructs a GifVideoRecorder object. */ public GifVideoRecorder() { super(new GifVideoType()); } /** * Sets the time duration per frame. * * @param millis the duration per frame in milliseconds */ public void setFrameDuration(double millis) { super.setFrameDuration(millis); encoder.setDelay((int) frameDuration); } /** * Gets the encoder used by this recorder. The encoder has methods for * setting a transparent color, setting a repeat count (0 for continuous play), * and setting a quality factor. * * @return the gif encoder */ public AnimatedGifEncoder getGifEncoder() { return encoder; } //________________________________ protected methods _________________________________ /** * Saves the video to the current scratchFile. */ protected void saveScratch() { encoder.finish(); } /** * Starts the video recording process. * * @return true if video recording successfully started */ protected boolean startRecording() { if((dim==null)&&(frameImage!=null)) { dim = new Dimension(frameImage.getWidth(null), frameImage.getHeight(null)); } if(dim!=null) { encoder.setSize(dim.width, dim.height); } encoder.setRepeat(0); return encoder.start(scratchFile.getAbsolutePath()); } /** * Appends a frame to the current video. * * @param image the image to append * @return true if image successfully appended */ protected boolean append(Image image) { BufferedImage bi; if(image instanceof BufferedImage) { bi = (BufferedImage) image; } else { if(dim==null) { return false; } bi = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_RGB); Graphics2D g = bi.createGraphics(); g.drawImage(image, 0, 0, null); } encoder.addFrame(bi); return true; } } /* * Open Source Physics software is free software; you can redistribute * it and/or modify it under the terms of the GNU General Public License (GPL) as * published by the Free Software Foundation; either version 2 of the License, * or(at your option) any later version. * Code that uses any portion of the code in the org.opensourcephysics package * or any subpackage (subdirectory) of this package must must also be be released * under the GNU GPL license. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA * or view the license online at http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2007 The Open Source Physics project * http://www.opensourcephysics.org */
88e71de02e6f7e7a94771543e012c2dc1b5876e1
610e5ee6a422b37408ef27ba3e23aa12ee4c46b4
/MbusClient/src/main/java/me/aegorov/smarthome/mbusclient/app/ConfigureDB.java
f5b57098192a62f0076965c4b5ffcd75a77286cc
[]
no_license
egorovantony/smartHome
a7edf18e618825341c8d7a53145ff2cb3b1c8d5f
48c5a8181e4b858f26af23016ad6d81c6a8517a9
refs/heads/master
2021-01-23T14:47:30.787131
2017-06-03T17:15:52
2017-06-03T17:15:52
93,260,720
0
0
null
null
null
null
UTF-8
Java
false
false
4,511
java
package me.aegorov.smarthome.mbusclient.app; import java.io.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.*; /** * Created by anton on 2/14/17. */ public class ConfigureDB { private static final String DB_DRIVER = "com.mysql.jdbc.Driver"; private String workDir = ""; private String dbUrl = ""; private String dbUser = ""; private String dbPass = ""; private String ddlCreate = ""; private List<String> sqlFiles = new ArrayList<>(); public ConfigureDB(String workDir, String Url, String User, String Pass){ this.dbUrl = Url; this.dbUser = User; this.dbPass = Pass; this.workDir = workDir; this.ddlCreate = this.workDir + "/" + ConfigureEnvironment.DIR_SQL + "/" + ConfigureEnvironment.FILE_DDL_CREATE; } public void exec() throws MBClientException{ typeConnParams(); List<String> stmts = new ArrayList<>(); List<String> stmtsTmp = new ArrayList<>(); for (String sqlFile : sqlFiles) { stmtsTmp.clear(); stmtsTmp = parseToStatements(readFile(sqlFile)); if (!stmtsTmp.isEmpty()){ stmts.addAll(stmtsTmp); } } execQueries(stmts); } private void typeConnParams() throws MBClientException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Scanner scanner = new Scanner(System.in); String pathDdlFile = ""; System.out.print("SQL instruction files (or type Enter for default setting):"); try{ pathDdlFile = br.readLine(); }catch (IOException ex){ throw new MBClientException(ex); } if (pathDdlFile.equals("")){ this.sqlFiles.add(this.ddlCreate); }else{ String[] split = pathDdlFile.split(","); this.sqlFiles = Arrays.asList(split); } } private void execQueries(List<String> strStmts) throws MBClientException{ Connection conn = null; Statement stmt = null; try { Class.forName(DB_DRIVER); System.out.println("Connection to database..."); conn = DriverManager.getConnection(dbUrl, dbUser, dbPass); System.out.println("OK"); stmt = conn.createStatement(); for (String strStmt : strStmts) { System.out.println("Call: " + strStmt); stmt.execute(strStmt); System.out.println("OK"); } System.out.println("All queries was execute OK"); }catch (Exception ex){ throw new MBClientException(ex); } finally { try{ if (stmt != null) { stmt.close(); } }catch(SQLException ex){ // nothing } try{ if (conn != null){ conn.close(); } }catch (SQLException ex){ // nothing } } } private String readFile(String fileName) throws MBClientException{ File file = new File(fileName); StringBuilder sb = new StringBuilder(); try(FileInputStream fInput = new FileInputStream(file)){ int i = 0; do{ i = fInput.read(); if (i != -1) { sb.append((char) i); } }while(i != -1); }catch (IOException ex){ throw new MBClientException(ex); } return sb.toString(); } private List<String> parseToStatements(String resource){ List<String> sts = new ArrayList<>(); List<String> rows = Arrays.asList(resource.split("\\n")); String st = ""; Iterator<String> resIter = rows.iterator(); while (resIter.hasNext()) { String currRow = resIter.next(); if (currRow.length() < 3){ continue; } if (currRow.substring(0,2).equals("<<")){ if (st != null){ sts.addAll(Arrays.asList(st.split(";"))); } st = ""; }else if (currRow.substring(0,2).equals(">>")){ }else{ st += currRow; } } return sts; } }
a6da2ff5607f3715ffb8c91fc861def53381ad51
65cae66d5f4ce96b3fef4104eaacf41ba9fc7303
/app/src/main/java/com/example/cs492final/data/ChampionsRepository.java
7e3fa7a3d1788c8abdd070551c2599732ff51a43
[]
no_license
xuq2/final-project-lol-final
a0ea2b67e80e883cd6e62a2b336d640c30289894
182f8af823b89a499ca016ce1ea731687742b075
refs/heads/main
2023-03-18T17:14:07.947885
2021-03-17T20:06:40
2021-03-17T20:06:40
472,247,567
2
0
null
2022-03-21T08:28:06
2022-03-21T08:28:06
null
UTF-8
Java
false
false
2,355
java
package com.example.cs492final.data; import android.util.Log; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class ChampionsRepository { private static final String TAG = ChampionsRepository.class.getSimpleName(); private static final String BASE_URL = "https://ddragon.leagueoflegends.com/"; private LeagueService leagueService; private MutableLiveData<ChampionsData> championsData; public ChampionsRepository() { championsData = new MutableLiveData<>(); championsData.setValue(null); Gson gson = new GsonBuilder() .registerTypeAdapter(Champions.class, new Champions.JsonDeserializer()) .create(); Retrofit retrofit = new Retrofit.Builder() .baseUrl(BASE_URL) .addConverterFactory(GsonConverterFactory.create(gson)) .build(); this.leagueService = retrofit.create(LeagueService.class); } public LiveData<ChampionsData> getChampionsData() { return this.championsData; } public void loadChampions(String version) { Call<ChampionsData> req = this.leagueService.fetchChampions(version); req.enqueue(new Callback<ChampionsData>() { @Override public void onResponse(Call<ChampionsData> call, Response<ChampionsData> response) { if(response.code() == 200) { championsData.setValue(response.body()); Log.d(TAG, "Success " + response.body().getData().getChampions().get(153).getName()); } else { Log.d(TAG, "unsuccessful API request: " + call.request().url()); Log.d(TAG, " -- response status code: " + response.code()); Log.d(TAG, " -- response: " + response.toString()); } } @Override public void onFailure(Call<ChampionsData> call, Throwable t) { Log.d(TAG, "unsuccessful API request: " + call.request().url()); t.printStackTrace(); } }); } }
49be0daf577eb3e393e449295d4312efc6ce1aca
2117d2b52810a640f801113d5d1d1119ea9a684c
/src/com/yufan/operation/Sub.java
d1e8a64c226e45303bf4212114601f9cd52294c6
[]
no_license
yufanq/SSMDome
bc7da2569a9f57432f4b20d983c9d48521ff3193
ff25aa02a0ccf7e9bcc08451c79171a95693d124
refs/heads/master
2020-03-17T22:52:35.750487
2018-05-19T02:10:18
2018-05-19T02:10:18
134,021,554
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
package com.yufan.operation; /** * * @ClassName: Sub * @Description: * @author 雨ゆこ * @date 2018年3月7日 * * */ public class Sub extends Operator{ @Override public double getResult(double n1, double n2) { // TODO Auto-generated method stub return n1 + n2; } }
[ "yufan" ]
yufan
a263ec1f5fa7d7117a5385b079a9b79c36d0c054
880aea3d7667a20e2b41c2bf3e130125a40c01f0
/app/jobs/EPSGAdder.java
2c568c1387f99f56e7e5f73be157071c02cfc49e
[]
no_license
dunaway87/automated-shapefile-importer
8ec6bef7ae5d5480c0eb05beb4f934bd6612a9e5
d5e6023ada52b9522109e706e9c086410c9b464e
refs/heads/master
2021-01-01T18:34:11.862723
2014-04-29T07:02:26
2014-04-29T07:02:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,282
java
package jobs; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.util.List; import javax.persistence.Query; import play.Logger; import play.Play; import play.db.jpa.JPA; import play.jobs.Job; import play.vfs.VirtualFile; public class EPSGAdder extends Job{ public void doJob(){ try { addEPSGs(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void addEPSGs() throws IOException{ JPA.em().createNativeQuery("Delete from epsg_lookup").executeUpdate(); File file = VirtualFile.fromRelativePath("conf/epsgs").getRealFile(); FileReader reader; reader = new FileReader(file); BufferedReader br = new BufferedReader(reader); String line; while((line = br.readLine()) != null){ if(line.contains("INSERT")){ JPA.em().createNativeQuery(line).executeUpdate(); } } br.close(); List<Object[]> list = JPA.em().createNativeQuery("Select * from epsg_lookup").getResultList(); int count = 0; Logger.info("number of rows in looup table ? %s", list.size()); String URL = "jdbc:postgresql://"+Play.configuration.getProperty("ipaddress")+"/"+Play.configuration.getProperty("database")+"?user="+Play.configuration.getProperty("username")+"&password="+Play.configuration.getProperty("password"); Connection conn = null; try { conn = DriverManager.getConnection(URL); } catch (Exception e){ } JPA.em().flush(); JPA.em().getTransaction().commit(); JPA.em().getTransaction().begin(); for(int i = 0; i< list.size(); i++){ try{ String authName = (String)list.get(i)[1]; if(authName.contains("RI")){ String qur = "insert into spatial_ref_sys values ("+list.get(i)[0]+",'"+list.get(i)[1]+"',"+list.get(i)[2]+",'"+list.get(i)[3]+"','"+list.get(i)[4]+"')"; Logger.info(qur); PreparedStatement pstmt = conn.prepareStatement(qur); Logger.info("worked? %s",pstmt.executeUpdate()); } } catch(Exception e){ Logger.error("%s", e); count++; } } Logger.info("worked %s didn't work %s", list.size()-count, count); } }
ae5a09c947e53e2e95427cc911d665eb5bc3174c
c96c44955a44881e97e8ac43170b65a31ade7736
/src/main/java/com/daychen/entity/ResultStatus.java
bcf61114ffdea82d2fbc42efdf496bcea8a5b559
[]
no_license
dayjazz/continueup
6140aa54b8bef4d87f0cf231b5e4289f1b2dcbeb
e7900de7926233f1364c60eb770b13dbf9c82ebd
refs/heads/master
2020-04-26T01:45:28.887167
2019-03-01T01:26:36
2019-03-01T01:26:36
173,213,813
0
0
null
null
null
null
UTF-8
Java
false
false
775
java
package com.daychen.entity; import com.fasterxml.jackson.annotation.JsonFormat; /** * 结果类型枚举 * Created by 超文 on 2017/5/2. * version 1.0 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum ResultStatus { /** * 1 开头为判断文件在系统的状态 */ IS_HAVE(100, "文件已存在!"), NO_HAVE(101, "该文件没有上传过。"), ING_HAVE(102, "该文件上传了一部分。"); private final int value; private final String reasonPhrase; ResultStatus(int value, String reasonPhrase) { this.value = value; this.reasonPhrase = reasonPhrase; } public int getValue() { return value; } public String getReasonPhrase() { return reasonPhrase; } }
ba12c2faad7898a655e164f20b40cfd271a9e7ed
197cbc562d79bbf4b1e624587d5891ac374c7458
/course4/src/main/java/com/tora/benchmarks/states/RepoState.java
a158890b5b8a77306fc9718ed3895ba59e5fd578
[ "Apache-2.0" ]
permissive
yohlulz/MLE5109-Course-samples
5b1c3e607112b2a05d43586d4e8d47173cd27201
dc61be510bcb5d9f2bf12575027ae03030fdd333
refs/heads/master
2021-08-30T16:48:03.576238
2017-12-18T18:36:05
2017-12-18T18:36:05
106,093,784
2
3
null
null
null
null
UTF-8
Java
false
false
1,010
java
package com.tora.benchmarks.states; import com.tora.benchmarks.repository.InMemoryRepository; import com.tora.benchmarks.repository.Order; import org.openjdk.jmh.annotations.*; import java.util.stream.IntStream; /** * @author Ovidiu Maja<[email protected]> * @version Oct 18, 2017 */ @State(Scope.Benchmark) public class RepoState { @Param private RepositorySupplier repositorySupplier; public InMemoryRepository<Order> orders; /* run before each benchmark */ @Setup public void setUp(SizeState sizeState) { System.out.println(getClass().getSimpleName() + " > setup > populate"); orders = repositorySupplier.get(); IntStream.rangeClosed(1, sizeState.size) .mapToObj(Order::new) .forEach(orders::add); } /* run after each benchmark */ @TearDown public void tearDown() { System.out.println(getClass().getSimpleName() + " > teardown > clear"); orders.clear(); System.gc(); } }
bc59a91d55efd68cbd2028b34cfef41c7a0345e8
a8a52fe8b9f3b09fbf0d070c44a000fbb307be95
/tree/src/pers/UnivalTree.java
e2fd7dfcaddf695f2b2fb9053f790c0eb75aa77b
[]
no_license
luolanmeet/algorithm
bc9573cd929f07afabd3b5a5370cb5b65222694f
051b25544c07e48837919c2919c7efa44eb9d76b
refs/heads/master
2023-09-01T11:40:42.979878
2023-08-31T02:53:48
2023-08-31T02:53:48
169,018,777
1
0
null
null
null
null
UTF-8
Java
false
false
1,376
java
package pers; /** * 965. 单值二叉树 * https://leetcode-cn.com/problems/univalued-binary-tree/ * @author cck */ public class UnivalTree { // 就是一个二叉树的遍历 public boolean isUnivalTree(TreeNode root) { if (root == null) { return true; } int val = root.val; return jundge(root, val); } private boolean jundge(TreeNode root, int val) { if (root == null) { return true; } if (root.val != val) { return false; } if (!jundge(root.left, val)) { return false; } return jundge(root.right, val); } public static void main(String[] args) { TreeNode t1 = new TreeNode(1); TreeNode t2 = new TreeNode(1); TreeNode t3 = new TreeNode(1); TreeNode t4 = new TreeNode(1); TreeNode t5 = new TreeNode(1); TreeNode t6 = new TreeNode(1); t1.left = t2; t1.right = t3; t2.left = t4; t3.right = t5; t5.left = t6; UnivalTree obj = new UnivalTree(); System.out.println(obj.isUnivalTree(t1)); t6.val = 2; System.out.println(obj.isUnivalTree(t1)); } }
cee3aa90ebf775a1c0bf172dc11c68b883435c6a
0b998348fa1edabb38a7de1d78a60f03e56604bf
/PLProject7/mathy.java
927824a1f897e60e0e9ce72cbd3a4c727a11acbf
[]
no_license
kdk745/PLFinalProject
475c0e0255b0cb3fba3edc7b6eafe30462c6dbba
9b73ce72eea7f9a5ff8f48c6f89f1c7b51ed9af3
refs/heads/master
2020-02-26T14:17:58.525380
2016-05-12T19:00:53
2016-05-12T19:00:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
528
java
public class mathy { public static int add(int i, int j) { return i + j; } public static double add_doub(double i, double j ){return i+j;} public static int sub(int i, int j) { return i - j; } public static double sub_doub(double i, double j ){return i-j;} public static int mult(int i, int j) { return i * j; } public static double mult_doub(double i, double j ){return i*j;} public static int div(int i, int j) { return i / j; } public static double div_doub(double i, double j ){return i/j;} }
c9b52319190368bcd64f1905a0973ba225323e31
76db0645c38ef0f5470ac91d6f1c4f20aab4663e
/src/main/java/sensimet/dataTypes/Sentence.java
3eeec77e22e7dbdfc6bc74de7085546e4aa178ca
[]
no_license
Yagouus/SenSiMet_Backend
31e82d329b1fe24e7758dc5dcd4d822e611db904
f115f6b1742d17a85a6f9a3f15a7a6480903a18c
refs/heads/master
2021-01-20T10:32:50.456768
2017-07-19T07:58:09
2017-07-19T07:58:09
82,395,429
0
0
null
null
null
null
UTF-8
Java
false
false
8,027
java
package sensimet.dataTypes; import it.uniroma1.lcl.jlt.util.Language; import sensimet.RESTController; import it.uniroma1.lcl.babelfy.commons.BabelfyParameters; import it.uniroma1.lcl.babelfy.core.Babelfy; import it.uniroma1.lcl.babelfy.commons.annotation.SemanticAnnotation; import it.uniroma1.lcl.babelnet.*; import it.uniroma1.lcl.babelnet.data.BabelPointer; import java.io.IOException; import java.util.*; import static it.uniroma1.lcl.jlt.util.Language.*; /** * Author: Yago Fontenla Seco **/ public class Sentence { //Attributes private String string; //Plain text string of sentence private HashMap<String, Term> terms = new HashMap<>(); //Terms composing the sentence //Constructors public Sentence(String string) { setString(string); System.out.println("SENTENCE SETTED: " + string); } //Setters public void setString(String string) { this.string = string; } //Getters public String getString() { return string; } public ArrayList<Term> getTerms() { //Result Array ArrayList<Term> result = new ArrayList<>(); Iterator it = terms.entrySet().iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); result.add((Term) pair.getValue()); } return result; } //Custom methods public void Disambiguate() throws InvalidBabelSynsetIDException, IOException { String sentence = this.getString(); //Babelfy settings BabelfyParameters bp = new BabelfyParameters(); //bp.setMCS(BabelfyParameters.MCS.OFF); bp.setScoredCandidates(BabelfyParameters.ScoredCandidates.TOP); bp.setMatchingType(BabelfyParameters.MatchingType.EXACT_MATCHING); bp.setAnnotationType(BabelfyParameters.SemanticAnnotationType.NAMED_ENTITIES); //Babelfy instance Babelfy bfy = new Babelfy(bp); ArrayList<String> w = new ArrayList<>(); ArrayList<String> ids = new ArrayList<>(); //Call bfy API ArrayList<SemanticAnnotation> bfyEntities = (ArrayList<SemanticAnnotation>) bfy.babelfy(string, EN); //SOUT System.out.println("\nDISAMBIGUATE SENTENCE: " + string); System.out.println("ANNOTATIONS OBTAINED: "); //Iterate over list //bfyAnnotations is the result of Babelfy.babelfy() call for (SemanticAnnotation annotation : bfyEntities) { //splitting the input text using the CharOffsetFragment start and end anchors String frag = sentence.substring(annotation.getCharOffsetFragment().getStart(), annotation.getCharOffsetFragment().getEnd() + 1); w.add(frag); if (!ids.contains(annotation.getBabelSynsetID())) { //Set Term and BFY info this.terms.put(frag, new Term(frag)); terms.get(frag).setBfy(annotation); ids.add(annotation.getBabelSynsetID()); System.out.print(frag + "\t" + annotation.getBabelSynsetID()); System.out.print("\t" + annotation.getBabelNetURL() + "\n"); BabelSynset synset = RESTController.bn.getSynset(new BabelSynsetID(annotation.getBabelSynsetID())); System.out.println("MAIN SENSE: " + synset.getMainSense(EN)); terms.get(frag).setSense(synset.getMainSense(EN).toString()); terms.get(frag).setGloss(synset.getMainGloss(EN).toString()); terms.get(frag).setBnt(synset); terms.get(frag).setPOS(synset.getPOS().toString()); System.out.println("POS: " + terms.get(frag).getPOS()); getEdges(terms.get(frag)); } } //Remove concepts from the string for (String word : w) { sentence = sentence.replace(word, ""); } bp.setAnnotationType(BabelfyParameters.SemanticAnnotationType.CONCEPTS); bp.setMultiTokenExpression(false); ArrayList<SemanticAnnotation> bfyConcepts = (ArrayList<SemanticAnnotation>) bfy.babelfy(sentence, EN); for (SemanticAnnotation annotation : bfyConcepts) { //splitting the input text using the CharOffsetFragment start and end anchors String frag = sentence.substring(annotation.getCharOffsetFragment().getStart(), annotation.getCharOffsetFragment().getEnd() + 1); w.add(frag); if (!ids.contains(annotation.getBabelSynsetID())) { //Set Term and BFY info this.terms.put(frag, new Term(frag)); terms.get(frag).setBfy(annotation); ids.add(annotation.getBabelSynsetID()); System.out.print(frag + "\t" + annotation.getBabelSynsetID()); System.out.print("\t" + annotation.getBabelNetURL() + "\n"); BabelSynset synset = RESTController.bn.getSynset(new BabelSynsetID(annotation.getBabelSynsetID())); System.out.println("MAIN SENSE: " + synset.getMainSense(EN)); terms.get(frag).setSense(synset.getMainSense(EN).toString()); terms.get(frag).setGloss(synset.getMainGloss(EN).toString()); terms.get(frag).setBnt(synset); terms.get(frag).setPOS(synset.getPOS().toString()); System.out.println("POS: " + terms.get(frag).getPOS()); getEdges(terms.get(frag)); } } for (String word : w) { sentence = sentence.replace(word, ""); } //Tokenize the rest of the sentence String[] rest = sentence.split(" "); for (String word : rest) { if (!word.isEmpty()) terms.put(word, new Term(word)); } //Create term } private void getEdges(Term t) throws InvalidBabelSynsetIDException, IOException { BabelSynset synset = null; synset = RESTController.bn.getSynset(new BabelSynsetID(t.getBfy().getBabelSynsetID())); ArrayList<BabelSynsetIDRelation> added = new ArrayList<>(); //Set first level relations //t.setBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.REGION_MEMBER)); //t.addBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.HYPERNYM)); //t.addBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.HYPONYM)); //t.addBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.REGION_MEMBER)); //t.addBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.HOLONYM_MEMBER)); ArrayList<BabelSynsetIDRelation> edges = (ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.HYPERNYM); ArrayList<BabelSynsetIDRelation> cedges = new ArrayList<>(); BabelSynsetIDRelation cH = null; if (edges.size() > 0) { cH = edges.get(0); } String entity = "bn:00031027n"; Integer i = 0; //Add hypernyms if (cH != null) { do { i++; System.out.println(cH.getBabelSynsetIDTarget().toString()); cedges = (ArrayList<BabelSynsetIDRelation>) RESTController.bn.getSynset(cH.getBabelSynsetIDTarget()).getEdges(BabelPointer.HYPERNYM); if (cedges.size() > 0) { cH = cedges.get(0); } else { break; } t.returnHypers().add(cH); } while (!cH.getBabelSynsetIDTarget().toString().equals(entity)); } //Add everything to bow edges = (ArrayList<BabelSynsetIDRelation>) synset.getEdges(); for (BabelSynsetIDRelation r : edges) { if (r.getLanguage().equals(Language.EN) && r.getWeight() > 0) { t.returnBow().add(r); } } //t.setBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges()); } }
e8db9af530608f9887c2cdb8bb975c18b5012d54
a0e1fd7e951fc7df1f8d51698a7c23ec33824a24
/src-gen/org/openbravo/model/project/ProjectPhase.java
db79cc5678024f2c259f8417207742fc600883ea
[]
no_license
HAWAIHAWAI/openz
b7b4bdfb289c52a24edcae6be8c2212220fe0dec
49d51f3c1303f7c3f51ce9042a91a713bc59d4c4
refs/heads/master
2016-09-05T12:23:48.718671
2014-10-27T10:14:36
2014-10-27T10:14:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,674
java
/* ************************************************************************* * The contents of this file are subject to the Openbravo Public License * Version 1.0 (the "License"), being the Mozilla Public License * Version 1.1 with a permitted attribution clause; you may not use this * file except in compliance with the License. You may obtain a copy of * the License at http://www.openbravo.com/legal/license.html * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SL * All portions are Copyright (C) 2008-2009 Openbravo SL * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ */ package org.openbravo.model.project; import org.openbravo.base.structure.BaseOBObject; import org.openbravo.base.structure.ClientEnabled; import org.openbravo.model.ad.access.User; import org.openbravo.model.ad.system.Client; import org.openbravo.model.common.enterprise.Organization; import org.openbravo.model.common.order.Order; import org.openbravo.model.common.plm.Product; import org.openbravo.zsoft.projects.Zspm_projectphasedep; import java.lang.Boolean; import java.lang.Long; import java.lang.String; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * Entity class for entity ProjectPhase (stored in table C_ProjectPhase). * * NOTE: This class should not be instantiated directly. To instantiate this * class the {@link org.openbravo.base.provider.OBProvider} should be used. */ public class ProjectPhase extends BaseOBObject implements ClientEnabled { private static final long serialVersionUID = 1L; public static final String TABLE_NAME = "C_ProjectPhase"; public static final String ENTITY_NAME = "ProjectPhase"; public static final String PROPERTY_PROJECT = "project"; public static final String PROPERTY_CLIENT = "client"; public static final String PROPERTY_ORG = "org"; public static final String PROPERTY_ISACTIVE = "isActive"; public static final String PROPERTY_CREATED = "created"; public static final String PROPERTY_CREATEDBY = "createdBy"; public static final String PROPERTY_UPDATED = "updated"; public static final String PROPERTY_UPDATEDBY = "updatedBy"; public static final String PROPERTY_DESCRIPTION = "description"; public static final String PROPERTY_STARTDATE = "startDate"; public static final String PROPERTY_ENDDATE = "endDate"; public static final String PROPERTY_ISCOMPLETE = "isComplete"; public static final String PROPERTY_PRODUCT = "product"; public static final String PROPERTY_PRICEACTUAL = "priceActual"; public static final String PROPERTY_GENERATEORDER = "generateOrder"; public static final String PROPERTY_ORDER = "order"; public static final String PROPERTY_PHASE = "phase"; public static final String PROPERTY_ID = "id"; public static final String PROPERTY_HELP = "help"; public static final String PROPERTY_NAME = "name"; public static final String PROPERTY_QTY = "qty"; public static final String PROPERTY_SEQNO = "seqNo"; public static final String PROPERTY_COMMITTEDAMT = "committedAmt"; public static final String PROPERTY_ISCOMMITCEILING = "isCommitCeiling"; public static final String PROPERTY_DATECONTRACT = "datecontract"; public static final String PROPERTY_SCHEDULESTATUS = "schedulestatus"; public static final String PROPERTY_ACTUALCOST = "actualcost"; public static final String PROPERTY_PLANNEDCOST = "plannedcost"; public static final String PROPERTY_PERCENTDONE = "percentdone"; public static final String PROPERTY_OUTSOURCING = "outsourcing"; public static final String PROPERTY_PHASEBEGUN = "phasebegun"; public static final String PROPERTY_BEGINPHASE = "beginphase"; public static final String PROPERTY_ENDPHASE = "endphase"; public static final String PROPERTY_MATERIALCOST = "materialcost"; public static final String PROPERTY_MACHINECOST = "machinecost"; public static final String PROPERTY_INVOICEDAMT = "invoicedamt"; public static final String PROPERTY_EXPENSES = "expenses"; public static final String PROPERTY_SERVCOST = "servcost"; public static final String PROPERTY_INDIRECTCOST = "indirectcost"; public static final String PROPERTY_ZSPMPROJECTPHASEDEPLIST = "zspmProjectphasedepList"; public ProjectPhase() { setDefaultValue(PROPERTY_ISACTIVE, true); setDefaultValue(PROPERTY_ISCOMPLETE, false); setDefaultValue(PROPERTY_GENERATEORDER, false); setDefaultValue(PROPERTY_ISCOMMITCEILING, false); setDefaultValue(PROPERTY_OUTSOURCING, false); setDefaultValue(PROPERTY_PHASEBEGUN, false); setDefaultValue(PROPERTY_BEGINPHASE, false); setDefaultValue(PROPERTY_ENDPHASE, false); setDefaultValue(PROPERTY_ZSPMPROJECTPHASEDEPLIST, new ArrayList<Object>()); } @Override public String getEntityName() { return ENTITY_NAME; } public Project getProject() { return (Project) get(PROPERTY_PROJECT); } public void setProject(Project project) { set(PROPERTY_PROJECT, project); } public Client getClient() { return (Client) get(PROPERTY_CLIENT); } public void setClient(Client client) { set(PROPERTY_CLIENT, client); } public Organization getOrg() { return (Organization) get(PROPERTY_ORG); } public void setOrg(Organization org) { set(PROPERTY_ORG, org); } public Boolean isActive() { return (Boolean) get(PROPERTY_ISACTIVE); } public void setActive(Boolean isActive) { set(PROPERTY_ISACTIVE, isActive); } public Date getCreated() { return (Date) get(PROPERTY_CREATED); } public void setCreated(Date created) { set(PROPERTY_CREATED, created); } public User getCreatedBy() { return (User) get(PROPERTY_CREATEDBY); } public void setCreatedBy(User createdBy) { set(PROPERTY_CREATEDBY, createdBy); } public Date getUpdated() { return (Date) get(PROPERTY_UPDATED); } public void setUpdated(Date updated) { set(PROPERTY_UPDATED, updated); } public User getUpdatedBy() { return (User) get(PROPERTY_UPDATEDBY); } public void setUpdatedBy(User updatedBy) { set(PROPERTY_UPDATEDBY, updatedBy); } public String getDescription() { return (String) get(PROPERTY_DESCRIPTION); } public void setDescription(String description) { set(PROPERTY_DESCRIPTION, description); } public Date getStartDate() { return (Date) get(PROPERTY_STARTDATE); } public void setStartDate(Date startDate) { set(PROPERTY_STARTDATE, startDate); } public Date getEndDate() { return (Date) get(PROPERTY_ENDDATE); } public void setEndDate(Date endDate) { set(PROPERTY_ENDDATE, endDate); } public Boolean isComplete() { return (Boolean) get(PROPERTY_ISCOMPLETE); } public void setComplete(Boolean isComplete) { set(PROPERTY_ISCOMPLETE, isComplete); } public Product getProduct() { return (Product) get(PROPERTY_PRODUCT); } public void setProduct(Product product) { set(PROPERTY_PRODUCT, product); } public BigDecimal getPriceActual() { return (BigDecimal) get(PROPERTY_PRICEACTUAL); } public void setPriceActual(BigDecimal priceActual) { set(PROPERTY_PRICEACTUAL, priceActual); } public Boolean isGenerateOrder() { return (Boolean) get(PROPERTY_GENERATEORDER); } public void setGenerateOrder(Boolean generateOrder) { set(PROPERTY_GENERATEORDER, generateOrder); } public Order getOrder() { return (Order) get(PROPERTY_ORDER); } public void setOrder(Order order) { set(PROPERTY_ORDER, order); } public StandardPhase getPhase() { return (StandardPhase) get(PROPERTY_PHASE); } public void setPhase(StandardPhase phase) { set(PROPERTY_PHASE, phase); } public String getId() { return (String) get(PROPERTY_ID); } public void setId(String id) { set(PROPERTY_ID, id); } public String getHelp() { return (String) get(PROPERTY_HELP); } public void setHelp(String help) { set(PROPERTY_HELP, help); } public String getName() { return (String) get(PROPERTY_NAME); } public void setName(String name) { set(PROPERTY_NAME, name); } public BigDecimal getQty() { return (BigDecimal) get(PROPERTY_QTY); } public void setQty(BigDecimal qty) { set(PROPERTY_QTY, qty); } public Long getSeqNo() { return (Long) get(PROPERTY_SEQNO); } public void setSeqNo(Long seqNo) { set(PROPERTY_SEQNO, seqNo); } public BigDecimal getCommittedAmt() { return (BigDecimal) get(PROPERTY_COMMITTEDAMT); } public void setCommittedAmt(BigDecimal committedAmt) { set(PROPERTY_COMMITTEDAMT, committedAmt); } public Boolean isCommitCeiling() { return (Boolean) get(PROPERTY_ISCOMMITCEILING); } public void setCommitCeiling(Boolean isCommitCeiling) { set(PROPERTY_ISCOMMITCEILING, isCommitCeiling); } public Date getDatecontract() { return (Date) get(PROPERTY_DATECONTRACT); } public void setDatecontract(Date datecontract) { set(PROPERTY_DATECONTRACT, datecontract); } public String getSchedulestatus() { return (String) get(PROPERTY_SCHEDULESTATUS); } public void setSchedulestatus(String schedulestatus) { set(PROPERTY_SCHEDULESTATUS, schedulestatus); } public BigDecimal getActualcost() { return (BigDecimal) get(PROPERTY_ACTUALCOST); } public void setActualcost(BigDecimal actualcost) { set(PROPERTY_ACTUALCOST, actualcost); } public BigDecimal getPlannedcost() { return (BigDecimal) get(PROPERTY_PLANNEDCOST); } public void setPlannedcost(BigDecimal plannedcost) { set(PROPERTY_PLANNEDCOST, plannedcost); } public Long getPercentdone() { return (Long) get(PROPERTY_PERCENTDONE); } public void setPercentdone(Long percentdone) { set(PROPERTY_PERCENTDONE, percentdone); } public Boolean isOutsourcing() { return (Boolean) get(PROPERTY_OUTSOURCING); } public void setOutsourcing(Boolean outsourcing) { set(PROPERTY_OUTSOURCING, outsourcing); } public Boolean isPhasebegun() { return (Boolean) get(PROPERTY_PHASEBEGUN); } public void setPhasebegun(Boolean phasebegun) { set(PROPERTY_PHASEBEGUN, phasebegun); } public Boolean isBeginphase() { return (Boolean) get(PROPERTY_BEGINPHASE); } public void setBeginphase(Boolean beginphase) { set(PROPERTY_BEGINPHASE, beginphase); } public Boolean isEndphase() { return (Boolean) get(PROPERTY_ENDPHASE); } public void setEndphase(Boolean endphase) { set(PROPERTY_ENDPHASE, endphase); } public BigDecimal getMaterialcost() { return (BigDecimal) get(PROPERTY_MATERIALCOST); } public void setMaterialcost(BigDecimal materialcost) { set(PROPERTY_MATERIALCOST, materialcost); } public BigDecimal getMachinecost() { return (BigDecimal) get(PROPERTY_MACHINECOST); } public void setMachinecost(BigDecimal machinecost) { set(PROPERTY_MACHINECOST, machinecost); } public BigDecimal getInvoicedamt() { return (BigDecimal) get(PROPERTY_INVOICEDAMT); } public void setInvoicedamt(BigDecimal invoicedamt) { set(PROPERTY_INVOICEDAMT, invoicedamt); } public BigDecimal getExpenses() { return (BigDecimal) get(PROPERTY_EXPENSES); } public void setExpenses(BigDecimal expenses) { set(PROPERTY_EXPENSES, expenses); } public BigDecimal getServcost() { return (BigDecimal) get(PROPERTY_SERVCOST); } public void setServcost(BigDecimal servcost) { set(PROPERTY_SERVCOST, servcost); } public BigDecimal getIndirectcost() { return (BigDecimal) get(PROPERTY_INDIRECTCOST); } public void setIndirectcost(BigDecimal indirectcost) { set(PROPERTY_INDIRECTCOST, indirectcost); } @SuppressWarnings("unchecked") public List<Zspm_projectphasedep> getZspmProjectphasedepList() { return (List<Zspm_projectphasedep>) get(PROPERTY_ZSPMPROJECTPHASEDEPLIST); } public void setZspmProjectphasedepList( List<Zspm_projectphasedep> zspmProjectphasedepList) { set(PROPERTY_ZSPMPROJECTPHASEDEPLIST, zspmProjectphasedepList); } }
fde81ff3207ca9268ec99e94ab148ef9082a8c36
ba103fd368ec59c0c07428f2b39607e4eb5ef5ed
/src/main/java/br/hotelEveris/app/request/ClienteRequest.java
7116efad3c5cc42c25fe4148632d41d950d733b5
[]
no_license
gbuglian/becajava.hoteleveris
de46e1c5821db9fc2409ec7171c337a48a91779a
93ebb48aca50d00a8077c26ca2d1a0f6425fa22b
refs/heads/master
2023-01-13T06:26:32.046333
2020-11-20T04:23:38
2020-11-20T04:23:38
312,364,270
0
0
null
null
null
null
UTF-8
Java
false
false
622
java
package br.hotelEveris.app.request; public class ClienteRequest { private String nome; private String cpf; private String hash; public ClienteRequest(String nome, String cpf, String hash) { super(); this.nome = nome; this.cpf = cpf; this.hash = hash; } public ClienteRequest() { super(); } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getCpf() { return cpf; } public void setCpf(String cpf) { this.cpf = cpf; } public String getHash() { return hash; } public void setHash(String hash) { this.hash = hash; } }
24d7e9903fdec8f32745fa87eb1febdfe10b5d55
f21345d46c46c8bb39fda37ca37c3bf0d3989c09
/src/main/java/com/example/vertx/starter/worker/WorkerExample.java
e377a72a711e0db85b67be17935304511954b4db
[]
no_license
senaevciguler/vertx-core-examples
8cd3ebb7ce9bd17aa4215e42942a2ad353d4433c
d77b0d43966cf440e532b7ac4238bb02861ddf21
refs/heads/master
2023-06-27T09:08:12.595748
2021-07-29T20:08:40
2021-07-29T20:08:40
390,838,853
0
0
null
null
null
null
UTF-8
Java
false
false
1,268
java
package com.example.vertx.starter.worker; import io.vertx.core.AbstractVerticle; import io.vertx.core.DeploymentOptions; import io.vertx.core.Promise; import io.vertx.core.Vertx; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class WorkerExample extends AbstractVerticle { private static final Logger log = LoggerFactory.getLogger(WorkerExample.class); public static void main(String[] args) { var vertx= Vertx.vertx(); vertx.deployVerticle(new WorkerExample()); } @Override public void start(Promise<Void> startPromise) throws Exception { vertx.deployVerticle(new WorkerVerticle(), new DeploymentOptions() .setWorker(true) .setWorkerPoolSize(1) .setWorkerPoolName("my-worker-verticle")); startPromise.complete(); executed(); } private void executed() { vertx.executeBlocking(event -> { log.debug("executing blocking code"); try{ Thread.sleep(5000); event.complete(); }catch (InterruptedException e){ log.error("failed:",e); event.fail(e); } }, result ->{ if(result.succeeded()){ log.debug("blocking call done"); }else{ log.debug("blocking call failed due to:", result.cause()); } }); } }
b8eec32e106d2b6f30ffca60a399238a330e3113
f431e39eb2c1ce4eaa9732a3c88470fcc20b8ded
/carroll-monitor-application/src/main/java/com/carroll/monitor/analyzer/config/WebSocketConfig.java
dcf851e83ba848110fe706f1556c81c9ee50393e
[]
no_license
carroll0911/carroll-monitor
138a50fd70fb0746d22ad57fb676668cf89bd4fa
8584d2927bf03b6095003dd090676a55dc0d3eba
refs/heads/master
2023-07-28T09:18:52.880665
2020-03-27T05:34:35
2020-03-27T05:34:35
246,769,649
1
0
null
2023-07-07T21:15:41
2020-03-12T07:26:02
Java
UTF-8
Java
false
false
1,021
java
package com.carroll.monitor.analyzer.config; import org.springframework.context.annotation.Configuration; import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; import org.springframework.web.socket.config.annotation.StompEndpointRegistry; /** * WebSocket 配置 * @author: carroll * @date 2019/9/9 */ @Configuration @EnableWebSocketMessageBroker @EnableWebSocket public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer { @Override public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint("/endpointWisely").withSockJS(); } @Override public void configureMessageBroker(MessageBrokerRegistry registry) { registry.enableSimpleBroker("/topic"); } }
da0892c0be82f32aa8efd8c4c32312061bed0a38
96c0bc11740e0d574513f9941d5fe0f4fe29c70d
/ssm-crud/src/main/java/com/bingo/crud/dao/DepartmentMapper.java
e94a03c49c6e3a5c7b41e2bb48d5f4adac3af455
[]
no_license
10bingo/SSM_CURD
53a79f0cbae0157b5c944e111cd56d9bbcb3a6e0
c62d4552234e4bdec2b7f76ddf72a8d1f9970b65
refs/heads/master
2020-04-14T23:07:41.845608
2019-01-05T07:12:25
2019-01-05T07:12:25
164,190,875
0
0
null
null
null
null
UTF-8
Java
false
false
896
java
package com.bingo.crud.dao; import com.bingo.crud.bean.Department; import com.bingo.crud.bean.DepartmentExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface DepartmentMapper { long countByExample(DepartmentExample example); int deleteByExample(DepartmentExample example); int deleteByPrimaryKey(Integer deptId); int insert(Department record); int insertSelective(Department record); List<Department> selectByExample(DepartmentExample example); Department selectByPrimaryKey(Integer deptId); int updateByExampleSelective(@Param("record") Department record, @Param("example") DepartmentExample example); int updateByExample(@Param("record") Department record, @Param("example") DepartmentExample example); int updateByPrimaryKeySelective(Department record); int updateByPrimaryKey(Department record); }
ad5b1a218183b3e7b0edf8333cab54ad6823247f
2a3dcc4be05fdc83813b6a152b80974cfda49867
/src/main/java/com/github/coolcooldee/sloth/generate/Generator.java
09b8847a73f8bd671cd846a4a033cca3ae265aca
[ "Apache-2.0" ]
permissive
seixion/sloth
8ebb5bc19c2c719ae6d0821c1bf2b1e900869b65
2dc5195cfdb7baceb11543d34518dfad2fb9d9ab
refs/heads/master
2021-01-22T15:10:53.219686
2017-08-31T10:53:06
2017-08-31T10:53:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,330
java
package com.github.coolcooldee.sloth.generate; import com.github.coolcooldee.sloth.parameter.*; import com.github.coolcooldee.sloth.utils.DirectoryUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Generator { static Logger logger = LoggerFactory.getLogger(Generator.class); public static void execute(String[] args) throws Exception{ // Step 1 UserInputParamters.init(args); // Step 1.1 DBSourceParameters.inti(); // Step 1.2 TargetProjectParameters.init(); // Step 1.3 TemplateParameters.init(); // Step 1.4 GeneratorSteategyParameters.init(); // Step 2 GeneratorSteategyParameters.getGeneratorStrategy().execute(); // Step 3 printlnResult(); } private static void printlnResult(){ logger.info("\nTarget project directory is : " + TargetProjectParameters.getTargetProjectStorePath()); DirectoryUtil.readFile(TargetProjectParameters.getTargetProjectStorePath()); logger.info("\n\n"); logger.info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); logger.info("@ Genarate Successfully ! @"); logger.info("@ Thank you for using Sloth 1.1 @"); logger.info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); } }
dc9b9f17c8e56736385f6d7dad57150381e7ad10
2db4b0e3dcac84ae7d804ce9d7e02caaf192889a
/app/src/main/java/com/example/student/campingimerir/SplachScreen.java
11aca5087fb048f674a3632740740bf46cbf9654
[]
no_license
Spurz/AuCamping-Android
0b0b0e924c1893023521ef42d8afba677e4fbffc
b0199b06a515cbd6ed1dc0f5e57d984e24db53cd
refs/heads/master
2020-03-08T20:03:29.873924
2018-05-29T09:45:31
2018-05-29T09:45:31
128,371,561
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package com.example.student.campingimerir; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class SplachScreen extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splach_screen); } }
428e18046cefeac546f8a4f6ec6baf76c9b84785
5b7b57c14b91d3d578855abebae59549048b1fd9
/AppCommon/src/main/java/com/trade/eight/mpush/util/ByteBuf.java
06f9bc17e0ca465a5aa079df1edce6c4920a645c
[]
no_license
xanhf/8yuan
8c4f50fa7c95ae5f0dfb282f67a7b1c39b0b4711
a8b7f351066f479b3bc8a6037036458008e1624c
refs/heads/master
2021-05-14T19:58:44.462393
2017-11-16T10:31:29
2017-11-16T10:31:55
114,601,135
0
0
null
null
null
null
UTF-8
Java
false
false
3,570
java
/* * (C) Copyright 2015-2016 the original author or authors. * * 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. * * Contributors: * [email protected] (夜色) */ package com.trade.eight.mpush.util; import java.nio.*; /** * Created by ohun on 2016/1/21. * * @author [email protected] (夜色) */ public final class ByteBuf { private ByteBuffer tmpNioBuf; public static ByteBuf allocate(int capacity) { ByteBuf buffer = new ByteBuf(); buffer.tmpNioBuf = ByteBuffer.allocate(capacity); return buffer; } public static ByteBuf allocateDirect(int capacity) { ByteBuf buffer = new ByteBuf(); buffer.tmpNioBuf = ByteBuffer.allocateDirect(capacity); return buffer; } public static ByteBuf wrap(byte[] array) { ByteBuf buffer = new ByteBuf(); buffer.tmpNioBuf = ByteBuffer.wrap(array); return buffer; } public byte[] getArray() { tmpNioBuf.flip(); byte[] array = new byte[tmpNioBuf.remaining()]; tmpNioBuf.get(array); tmpNioBuf.compact(); return array; } public ByteBuf get(byte[] array) { tmpNioBuf.get(array); return this; } public byte get() { return tmpNioBuf.get(); } public ByteBuf put(byte b) { checkCapacity(1); tmpNioBuf.put(b); return this; } public short getShort() { return tmpNioBuf.getShort(); } public ByteBuf putShort(int value) { checkCapacity(2); tmpNioBuf.putShort((short) value); return this; } public int getInt() { return tmpNioBuf.getInt(); } public ByteBuf putInt(int value) { checkCapacity(4); tmpNioBuf.putInt(value); return this; } public long getLong() { return tmpNioBuf.getLong(); } public ByteBuf putLong(long value) { checkCapacity(8); tmpNioBuf.putLong(value); return this; } public ByteBuf put(byte[] value) { checkCapacity(value.length); tmpNioBuf.put(value); return this; } public ByteBuf checkCapacity(int minWritableBytes) { int remaining = tmpNioBuf.remaining(); if (remaining < minWritableBytes) { int newCapacity = newCapacity(tmpNioBuf.capacity() + minWritableBytes); ByteBuffer newBuffer = tmpNioBuf.isDirect() ? ByteBuffer.allocateDirect(newCapacity) : ByteBuffer.allocate(newCapacity); tmpNioBuf.flip(); newBuffer.put(tmpNioBuf); tmpNioBuf = newBuffer; } return this; } private int newCapacity(int minNewCapacity) { int newCapacity = 64; while (newCapacity < minNewCapacity) { newCapacity <<= 1; } return newCapacity; } public ByteBuffer nioBuffer() { return tmpNioBuf; } public ByteBuf clear() { tmpNioBuf.clear(); return this; } public ByteBuf flip() { tmpNioBuf.flip(); return this; } }
8b3c694fbd0d37b1c3dc6a60293d0230915aa64d
a873978aa8093b1c0197e52176d768bb8360bac4
/src/main/java/com/kode/ts/service/dto/EstatusAcademicoCriteria.java
88c87a34e5dae7f1ddcccccf497427e4aa3a41e1
[]
no_license
BenjaminCarrera/4TS
ef01f98ecb559c437397d599b87c9fed0c1d0883
b4cd5979cedee3c2a2590951f3a27f95ad8eeae6
refs/heads/master
2022-12-22T11:49:18.472812
2019-09-10T19:27:48
2019-09-10T19:27:48
207,645,936
0
0
null
2022-12-16T05:03:59
2019-09-10T19:28:18
Java
UTF-8
Java
false
false
3,140
java
package com.kode.ts.service.dto; import java.io.Serializable; import java.util.Objects; import io.github.jhipster.service.Criteria; import io.github.jhipster.service.filter.BooleanFilter; import io.github.jhipster.service.filter.DoubleFilter; import io.github.jhipster.service.filter.Filter; import io.github.jhipster.service.filter.FloatFilter; import io.github.jhipster.service.filter.IntegerFilter; import io.github.jhipster.service.filter.LongFilter; import io.github.jhipster.service.filter.StringFilter; /** * Criteria class for the {@link com.kode.ts.domain.EstatusAcademico} entity. This class is used * in {@link com.kode.ts.web.rest.EstatusAcademicoResource} to receive all the possible filtering options from * the Http GET request parameters. * For example the following could be a valid request: * {@code /estatus-academicos?id.greaterThan=5&attr1.contains=something&attr2.specified=false} * As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use * fix type specific filters. */ public class EstatusAcademicoCriteria implements Serializable, Criteria { private static final long serialVersionUID = 1L; private LongFilter id; private StringFilter estatus; private LongFilter candidatoId; public EstatusAcademicoCriteria(){ } public EstatusAcademicoCriteria(EstatusAcademicoCriteria other){ this.id = other.id == null ? null : other.id.copy(); this.estatus = other.estatus == null ? null : other.estatus.copy(); this.candidatoId = other.candidatoId == null ? null : other.candidatoId.copy(); } @Override public EstatusAcademicoCriteria copy() { return new EstatusAcademicoCriteria(this); } public LongFilter getId() { return id; } public void setId(LongFilter id) { this.id = id; } public StringFilter getEstatus() { return estatus; } public void setEstatus(StringFilter estatus) { this.estatus = estatus; } public LongFilter getCandidatoId() { return candidatoId; } public void setCandidatoId(LongFilter candidatoId) { this.candidatoId = candidatoId; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final EstatusAcademicoCriteria that = (EstatusAcademicoCriteria) o; return Objects.equals(id, that.id) && Objects.equals(estatus, that.estatus) && Objects.equals(candidatoId, that.candidatoId); } @Override public int hashCode() { return Objects.hash( id, estatus, candidatoId ); } @Override public String toString() { return "EstatusAcademicoCriteria{" + (id != null ? "id=" + id + ", " : "") + (estatus != null ? "estatus=" + estatus + ", " : "") + (candidatoId != null ? "candidatoId=" + candidatoId + ", " : "") + "}"; } }
c5ba379de0172a57fb13def3fb2297d31bd85050
5f0125557316e2293e5c79e3518d6772b25d200e
/CatController/src/tests/TestCommandCreator.java
072f9a54013aa7fe11874a3e916638fdb4875e0e
[ "MIT" ]
permissive
Sytten/Cat
a7c61c7e788ebe9399a35c0ee3185e9dd710008f
610841b44bb5c3bf02b1d4fa0b432f88f122c217
refs/heads/master
2021-01-17T15:10:32.522845
2017-12-11T16:24:28
2017-12-11T16:24:28
69,309,491
0
0
null
null
null
null
UTF-8
Java
false
false
3,549
java
package tests; import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import communication.JSONMessage; import execution.Command; import main.CommandCreator; public class TestCommandCreator { @Rule public ExpectedException thrown = ExpectedException.none(); @Test public void testCommandWrong() { String type = "ACK"; Map<String, String> params = new HashMap<String, String>(); params.put("MOTOR", "FOOD"); JSONMessage json = new JSONMessage(type, params); Command testCommand; CommandCreator testCreator = new CommandCreator(); testCommand = testCreator.createCommand(json); assertEquals(testCommand, null); } @Test public void testCommand() { String type = "COMMAND"; Map<String, String> params = new HashMap<String, String>(); params.put("MOTOR", "FOOD"); params.put("QTY", "2"); JSONMessage json = new JSONMessage(type, params); Command testCommand = null; CommandCreator testCreator = new CommandCreator(); testCommand = testCreator.createCommand(json); assertNotNull(testCommand); } @Test public void testMotorWrong() { String type = "COMMAND"; Map<String, String> params = new HashMap<String, String>(); params.put("MOTOR", "ACK"); params.put("QTY", "5"); JSONMessage json = new JSONMessage(type, params); Command testCommand; CommandCreator testCreator = new CommandCreator(); testCommand = testCreator.createCommand(json); assertEquals(testCommand,null); } @Test public void testMotorNull() { String type = "COMMAND"; Map<String, String> params = new HashMap<String, String>(); params.put("MOTOR", null); JSONMessage json = new JSONMessage(type, params); Command testCommand; CommandCreator testCreator = new CommandCreator(); testCommand = testCreator.createCommand(json); assertEquals(testCommand, null); } @Test public void testAudioCommand() { String audioData = ""; Path currentRelativePath = Paths.get(""); String path = currentRelativePath.toAbsolutePath().toString(); File audioFile = new File(path + File.separator + "ExternalFiles" + File.separator + "AudioBase64.txt"); try (BufferedReader br = new BufferedReader(new FileReader(audioFile))) { String line; while ((line = br.readLine()) != null) { audioData += line; } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } String type = "COMMAND"; Map<String, String> params = new HashMap<String, String>(); params.put("AUDIO", "audio"); params.put("DATA", audioData); JSONMessage json = new JSONMessage(type, params); Command testCommand; CommandCreator testCreator = new CommandCreator(); testCommand = testCreator.createCommand(json); assertNotNull(testCommand); try { File file = new File(System.getProperty("user.home") + File.separator + "VoiceData.ogg"); if (file.delete()) { System.out.println(file.getName() + " is deleted!"); } else { System.out.println("Delete operation is failed."); } } catch (Exception e) { e.printStackTrace(); } } }
6d5d717ace5feea068b6cd535d055770ed893071
251e4c5aaafe1a6b8c9dd43b26ff9c8a3cd42f06
/Source Code/TestSomething/src/Nam_Test/MainControlInterface.java
dc1546f546e3d5528a8dd01a230848d86fc6d14e
[]
no_license
lety20391/ePrj-Sem2
e433b57e4dd834fcc1c19c58446df71646c76007
29c2de35097f399e46ad3f9dd1c7ad2f10a26712
refs/heads/master
2020-03-15T21:29:48.779698
2018-06-20T08:32:42
2018-06-20T08:32:42
132,356,048
0
0
null
null
null
null
UTF-8
Java
false
false
21,408
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 Nam_Test; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JOptionPane; /** * * @author Namcham */ public class MainControlInterface extends javax.swing.JFrame implements ActionListener { /** * Creates new form MainControlInterface */ public MainControlInterface() { initComponents(); setLocationRelativeTo(null); } public MainControlInterface(String account) { initComponents(); setLocationRelativeTo(null); } public String gettxtAccount() { return txtAccount.getText(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); lbRegister = new javax.swing.JLabel(); lbMin = new javax.swing.JLabel(); lbClose = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); btnAnounce = new javax.swing.JButton(); txtAccount = new javax.swing.JTextField(); btnBooking = new javax.swing.JButton(); btnSearch = new javax.swing.JButton(); btnDiscount = new javax.swing.JButton(); btnCreateNewAccount = new javax.swing.JButton(); btnStaff = new javax.swing.JButton(); btnCustomer = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(255, 153, 51)); jPanel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jPanel1MouseClicked(evt); } }); lbRegister.setBackground(new java.awt.Color(255, 153, 0)); lbRegister.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N lbRegister.setForeground(new java.awt.Color(255, 255, 255)); lbRegister.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); lbRegister.setText("Main Control System"); lbMin.setBackground(new java.awt.Color(255, 153, 0)); lbMin.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N lbMin.setForeground(new java.awt.Color(255, 51, 51)); lbMin.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); lbMin.setText("_"); lbMin.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); lbMin.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { lbMinMouseClicked(evt); } }); lbClose.setBackground(new java.awt.Color(255, 153, 0)); lbClose.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N lbClose.setForeground(new java.awt.Color(255, 51, 51)); lbClose.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); lbClose.setText("x"); lbClose.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); lbClose.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { lbCloseMouseClicked(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(lbRegister, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE) .addGap(46, 46, 46) .addComponent(lbMin, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lbClose, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbRegister, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbMin, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbClose, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2.setBackground(new java.awt.Color(102, 102, 102)); jPanel2.setForeground(new java.awt.Color(255, 255, 255)); jPanel2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jPanel2MouseClicked(evt); } }); btnAnounce.setBackground(new java.awt.Color(255, 0, 255)); btnAnounce.setFont(new java.awt.Font("Tahoma", 1, 40)); // NOI18N btnAnounce.setForeground(new java.awt.Color(255, 255, 255)); btnAnounce.setText("Anounce"); btnAnounce.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnAnounce.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btnAnounceMouseClicked(evt); } }); txtAccount.setEditable(false); txtAccount.setBackground(new java.awt.Color(102, 102, 102)); txtAccount.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N txtAccount.setForeground(new java.awt.Color(255, 255, 255)); txtAccount.setSelectionColor(new java.awt.Color(102, 102, 102)); txtAccount.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { txtAccountMouseClicked(evt); } }); btnBooking.setBackground(new java.awt.Color(255, 0, 51)); btnBooking.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N btnBooking.setForeground(new java.awt.Color(255, 255, 255)); btnBooking.setText("Booking"); btnBooking.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnBooking.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btnBookingMouseClicked(evt); } }); btnSearch.setBackground(new java.awt.Color(0, 153, 153)); btnSearch.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N btnSearch.setForeground(new java.awt.Color(255, 255, 255)); btnSearch.setText("Search"); btnSearch.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnSearch.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btnSearchMouseClicked(evt); } }); btnDiscount.setBackground(new java.awt.Color(255, 255, 0)); btnDiscount.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N btnDiscount.setForeground(new java.awt.Color(255, 255, 255)); btnDiscount.setText("Discount"); btnDiscount.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnDiscount.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btnDiscountMouseClicked(evt); } }); btnCreateNewAccount.setBackground(new java.awt.Color(102, 0, 102)); btnCreateNewAccount.setFont(new java.awt.Font("Tahoma", 1, 45)); // NOI18N btnCreateNewAccount.setForeground(new java.awt.Color(255, 255, 255)); btnCreateNewAccount.setText("Create new account"); btnCreateNewAccount.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnCreateNewAccount.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btnCreateNewAccountMouseClicked(evt); } }); btnCreateNewAccount.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCreateNewAccountActionPerformed(evt); } }); btnStaff.setBackground(new java.awt.Color(51, 255, 51)); btnStaff.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N btnStaff.setForeground(new java.awt.Color(255, 255, 255)); btnStaff.setText("Staff "); btnStaff.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnStaff.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btnStaffMouseClicked(evt); } }); btnCustomer.setBackground(new java.awt.Color(255, 51, 0)); btnCustomer.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N btnCustomer.setForeground(new java.awt.Color(255, 255, 255)); btnCustomer.setText("Customer"); btnCustomer.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnCustomer.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btnCustomerMouseClicked(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnCreateNewAccount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addComponent(btnAnounce, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btnBooking, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addComponent(btnDiscount, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btnStaff, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnSearch, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnCustomer, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtAccount, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(txtAccount, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(9, 9, 9) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnAnounce, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnBooking, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(7, 7, 7) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnStaff, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnDiscount, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnCustomer, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnCreateNewAccount, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(9, 9, 9)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void lbMinMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbMinMouseClicked this.setState(JFrame.ICONIFIED); }//GEN-LAST:event_lbMinMouseClicked private void lbCloseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCloseMouseClicked if (JOptionPane.showConfirmDialog(new JFrame(), "Do you want to quit this application ?", "", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { System.exit(0); } }//GEN-LAST:event_lbCloseMouseClicked private void jPanel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseClicked }//GEN-LAST:event_jPanel1MouseClicked private void btnAnounceMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnAnounceMouseClicked }//GEN-LAST:event_btnAnounceMouseClicked private void txtAccountMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtAccountMouseClicked }//GEN-LAST:event_txtAccountMouseClicked private void btnBookingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnBookingMouseClicked }//GEN-LAST:event_btnBookingMouseClicked private void btnSearchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSearchMouseClicked }//GEN-LAST:event_btnSearchMouseClicked private void btnDiscountMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnDiscountMouseClicked }//GEN-LAST:event_btnDiscountMouseClicked private void btnCreateNewAccountMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCreateNewAccountMouseClicked }//GEN-LAST:event_btnCreateNewAccountMouseClicked private void btnStaffMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnStaffMouseClicked // TODO add your handling code here: }//GEN-LAST:event_btnStaffMouseClicked private void btnCustomerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCustomerMouseClicked // TODO add your handling code here: }//GEN-LAST:event_btnCustomerMouseClicked private void jPanel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel2MouseClicked }//GEN-LAST:event_jPanel2MouseClicked private void btnCreateNewAccountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCreateNewAccountActionPerformed setVisible(false); RegisterForm rgf = new RegisterForm(); rgf.setVisible(true); rgf.setLocationRelativeTo(null); }//GEN-LAST:event_btnCreateNewAccountActionPerformed /** * @param args the command line arguments */ // public static void main(String args[]) { // /* Set the Nimbus look and feel */ // //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. // * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html // */ // try { // for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { // if ("Nimbus".equals(info.getName())) { // javax.swing.UIManager.setLookAndFeel(info.getClassName()); // break; // } // } // } catch (ClassNotFoundException ex) { // java.util.logging.Logger.getLogger(MainControlInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // } catch (InstantiationException ex) { // java.util.logging.Logger.getLogger(MainControlInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // } catch (IllegalAccessException ex) { // java.util.logging.Logger.getLogger(MainControlInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // } catch (javax.swing.UnsupportedLookAndFeelException ex) { // java.util.logging.Logger.getLogger(MainControlInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // } // //</editor-fold> // // /* Create and display the form */ // java.awt.EventQueue.invokeLater(new Runnable() { // public void run() { // new MainControlInterface().setVisible(true); // } // }); // } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnAnounce; private javax.swing.JButton btnBooking; private javax.swing.JButton btnCreateNewAccount; private javax.swing.JButton btnCustomer; private javax.swing.JButton btnDiscount; private javax.swing.JButton btnSearch; private javax.swing.JButton btnStaff; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JLabel lbClose; private javax.swing.JLabel lbMin; private javax.swing.JLabel lbRegister; private javax.swing.JTextField txtAccount; // End of variables declaration//GEN-END:variables void setTxtAccount(String text) { txtAccount.setText(text); } @Override public void actionPerformed(ActionEvent ae) { if (this.isVisible()) { setVisible(false); } else { setVisible(true); } } }
4ee3fd672b056d308a2286d63c48611bf6ad678a
dd721f5a2230221f0a6a3e858fcd2ec7a04ad2c7
/leetcode/30-Day_LeetCoding_Challenge/2020/0518/Solution.java
fa248c533e2eae29e44fdac2859b12e9dc310c0c
[]
no_license
glorypulse/quiz
ef95d780b6c074193ee461e73f227f3d47300c37
b50b5b656f71d99cf845ff4bbb1741ad53bfeaa2
refs/heads/master
2021-11-27T02:21:01.003192
2021-08-14T14:38:47
2021-08-14T14:38:47
57,134,244
0
0
null
2019-06-08T13:40:13
2016-04-26T14:18:46
Scala
UTF-8
Java
false
false
968
java
class Solution { public boolean checkInclusion(String s1, String s2) { int s1Len = s1.length(); int s2Len = s2.length(); if (s1Len > s2Len) return false; int[] s1Count = new int[26]; for (char c1: s1.toCharArray()) { s1Count[c1 - 'a'] ++; } int falseCount = 0; for (int i = 0; i < s2Len; i ++) { if (i >= s1Len) { char oldC2 = s2.charAt(i - s1Len); int oldIndex = oldC2 - 'a'; s1Count[oldIndex] ++; if (s1Count[oldIndex] <= 0) { falseCount --; } } char c2 = s2.charAt(i); int index = c2 - 'a'; s1Count[index] --; if (s1Count[index] < 0) { falseCount ++; } if (i < s1Len - 1) continue; if (falseCount == 0) return true; } return false; } }
3ef1eaf25d03fae280e2de9e4aafd505fbcc0ad6
907e384b4c931345a2f9ad4219142b98a69990cc
/src/zx/leetcode/dog/feb/Minimum_Path_Sum_64.java
96ae9857f2598847d198bf721e452c615f518c35
[]
no_license
zxiang179/LeetCode
602dc7569608a6a3b3b03a8888bbf176d5cdfa8f
c399f44cfae963bab5e0ae4c3b0523e7888c3784
refs/heads/master
2021-01-19T04:24:58.384604
2018-07-27T02:49:16
2018-07-27T02:49:16
87,368,683
0
0
null
null
null
null
UTF-8
Java
false
false
918
java
package zx.leetcode.dog.feb; public class Minimum_Path_Sum_64 { /** * dp[i][j]表示走到该位置最短的路径之和 * 状态转移方程 * dp[i][j]=min(dp[i-1][j],dp[i][j-1])+grid[i-1][j-1] * 边界 * dp[0][i]=sum(grid[0][j]) for(j=0;j<grid[0].length;j++) * dp[i][0]=sum(grid[i][0]) for(i=0;i<grid.length;i++) * @param grid * @return */ public int minPathSum(int[][] grid) { int m = grid.length; int n = grid[0].length; int[][] dp = new int[m][n]; dp[0][0] = grid[0][0]; for(int i=1;i<m;i++){ dp[i][0] = dp[i-1][0]+grid[i][0]; } for(int j=1;j<n;j++){ dp[0][j] = dp[0][j-1]+grid[0][j]; } for(int i=1;i<m;i++){ for(int j=1;j<n;j++){ dp[i][j] = Math.min(dp[i-1][j], dp[i][j-1])+grid[i][j]; } } return dp[m-1][n-1]; } public static void main(String[] args) { new Minimum_Path_Sum_64().minPathSum(new int[][]{{1,3,1},{1,5,1},{4,2,1}}); } }
0ed80cfc2febfd3119e2522dca592aad06fdb32c
4581669c5f8959f07eec03351a0d8f9aace0890b
/rdpay-mgr/src/main/java/com/rdpay/mgr/modules/sys/service/impl/SysDataDictServiceImpl.java
5c58d610a0316dc382641ee03139d3b3a1050363
[]
no_license
wtiehu/rdpay
5e3db5580bf1947cdd9ae54b6528d4bde0b79699
5de7432a2225e97a222bd4dcf094d786d305a50b
refs/heads/master
2021-10-07T21:36:31.013367
2018-12-05T14:36:07
2018-12-05T14:36:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package com.rdpay.mgr.modules.sys.service.impl; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.rdpay.mgr.common.utils.PageUtils; import com.rdpay.mgr.common.utils.Query; import com.rdpay.mgr.modules.sys.dao.SysDataDictDao; import com.rdpay.mgr.modules.sys.entity.SysDataDictEntity; import com.rdpay.mgr.modules.sys.service.SysDataDictService; import org.springframework.stereotype.Service; import java.util.Map; @Service("sysDataDictService") public class SysDataDictServiceImpl extends ServiceImpl<SysDataDictDao, SysDataDictEntity> implements SysDataDictService { @Override public PageUtils queryPage(Map<String, Object> params) { Page<SysDataDictEntity> page = this.selectPage( new Query<SysDataDictEntity>(params).getPage(), new EntityWrapper<SysDataDictEntity>() ); return new PageUtils(page); } }
[ "tiehu" ]
tiehu
be474f5f72bc195ff90a7395353d0d7cb05d5507
988c4d65c384ae6956562f3601f841fd94283346
/src/test/java/com/dotty/dottyapp/security/jwt/JWTFilterTest.java
33bbfb8c1051b2f397bd8a53833f4ebb06aca7a1
[]
no_license
dalalsunil1986/dotty
506d9c1c7fb6238566ba74a6a05de4273f5414f8
8b026575216e67d6111ad4cee8bde5331c3f7a33
refs/heads/master
2021-08-22T23:37:12.769713
2017-12-01T17:51:59
2017-12-01T17:51:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,924
java
package com.dotty.dottyapp.security.jwt; import com.dotty.dottyapp.security.AuthoritiesConstants; import io.github.jhipster.config.JHipsterProperties; import org.junit.Before; import org.junit.Test; import org.springframework.http.HttpStatus; import org.springframework.mock.web.MockFilterChain; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.test.util.ReflectionTestUtils; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; public class JWTFilterTest { private TokenProvider tokenProvider; private JWTFilter jwtFilter; @Before public void setup() { JHipsterProperties jHipsterProperties = new JHipsterProperties(); tokenProvider = new TokenProvider(jHipsterProperties); ReflectionTestUtils.setField(tokenProvider, "secretKey", "test secret"); ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", 60000); jwtFilter = new JWTFilter(tokenProvider); SecurityContextHolder.getContext().setAuthentication(null); } @Test public void testJWTFilter() throws Exception { UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( "test-user", "test-password", Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER)) ); String jwt = tokenProvider.createToken(authentication, false); MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer " + jwt); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication().getName()).isEqualTo("test-user"); assertThat(SecurityContextHolder.getContext().getAuthentication().getCredentials().toString()).isEqualTo(jwt); } @Test public void testJWTFilterInvalidToken() throws Exception { String jwt = "wrong_jwt"; MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer " + jwt); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull(); } @Test public void testJWTFilterMissingAuthorization() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull(); } @Test public void testJWTFilterMissingToken() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer "); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull(); } @Test public void testJWTFilterWrongScheme() throws Exception { UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( "test-user", "test-password", Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER)) ); String jwt = tokenProvider.createToken(authentication, false); MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Basic " + jwt); request.setRequestURI("/api/test"); } }
59d27fdda39d054043621027583c5d148659c220
3b36c61372ac08a16148839664ac8395e94cfea5
/app/src/main/java/core/GemsterApp.java
ff85b33c6d6d2715aa7aa47197928b903166667e
[]
no_license
Pollination699498/Gemster
9bdcd1ad4eb51dc5f5a6fd9263febff1a7624429
bdfd0e4ea9413f77e019dc92e66492fcf4bd482d
refs/heads/master
2021-01-13T13:40:11.611029
2016-12-20T13:49:03
2016-12-20T13:49:03
76,367,817
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
package core; import android.app.Application; /** * Created by WONSEOK OH on 2016-12-17. */ public class GemsterApp extends Application { private GoogleApiHelper mGoogleApiHelper; private static GemsterApp mInstance; @Override public void onCreate() { super.onCreate(); mInstance = this; } public static synchronized GemsterApp getInstance() { return mInstance; } public void setClient(GoogleApiHelper client) { mGoogleApiHelper = client; } public GoogleApiHelper getClient() { return mGoogleApiHelper; } }
3a86246dbbf77928390deba87af3c07fe99efd66
8c63b60613c0fa64c2b044d1d9c06353b3d2d354
/src/main/java/com/eumji/zblog/mapper/UserMapper.java
9648fe762dee5838877b6250a1793882ad16f6f8
[ "Apache-2.0" ]
permissive
CrazyZhao/zblog
cf61319c83f9c3648542ce01a4feb95a64b4649a
68d9b55586993415a441ff8a508347c93c4ac808
refs/heads/master
2020-05-16T09:44:50.053034
2019-05-09T01:21:56
2019-05-09T01:21:56
182,958,545
9
1
null
null
null
null
UTF-8
Java
false
false
853
java
package com.eumji.zblog.mapper; import com.eumji.zblog.vo.User; import com.eumji.zblog.vo.UserInfo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; /** * FILE: com.eumji.zblog.mapper.UserMapper.java * MOTTO: 不积跬步无以至千里,不积小流无以至千里 * AUTHOR: EumJi * DATE: 2017/4/9 * TIME: 10:20 */ @Mapper public interface UserMapper { /** * 获取用户凭证 * @param username 账号 * @return */ User getUser(@Param("username") String username); /** * 获取所有的用户 * @return */ List<User> allUser(); UserInfo getUserInfo(); void updateAvatar(@Param("url") String url, @Param("username") String username); void updatePassword(User user); void updateUserInfo(UserInfo userInfo); }
e1dd207eea93692ba75847049e18ce29a48a4077
756525baa58ddafab9fe92003f8a17a489bd7538
/app/src/main/java/com/uae/emiratescar/ui/activities/ForgotPassActivity.java
3c4faf25bc5327d42dad86f9d981e8d404dcdf28
[]
no_license
AdrianaMusic/EmiratesCar
76c15969d442582d74ae584f29d00ec74d081bd8
5d33e638365b6a2f7b36232f1fb865e52b666d8f
refs/heads/master
2023-03-17T12:03:28.832439
2020-08-25T18:48:53
2020-08-25T18:48:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.uae.emiratescar.ui.activities; import android.os.Bundle; import com.uae.emiratescar.R; public class ForgotPassActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_forgot_pass); } }
a39e5a70142f5f9fa4da4815f085bfc3afd2bdb0
296cdd8a3ef1d7436c1957e403b47f6a62ba5efb
/src/main/java/com/sds/acube/luxor/webservice/jaxws/GetContentList.java
9c500b923a3ace50b854a502b01d7b34062039ab
[]
no_license
seoyoungrag/byucksan_luxor
6611276e871c13cbb5ea013d49ac79be678f03e5
7ecb824ec8e78e95bd2a962ce4d6c54e3c51b6b3
refs/heads/master
2021-03-16T05:17:42.571476
2017-07-24T08:28:47
2017-07-24T08:28:47
83,280,413
0
0
null
null
null
null
UTF-8
Java
false
false
1,013
java
package com.sds.acube.luxor.webservice.jaxws; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * This class was generated by Apache CXF 2.3.0 * Thu Jul 04 09:36:34 KST 2013 * Generated source version: 2.3.0 */ @XmlRootElement(name = "getContentList", namespace = "http://webservice.luxor.acube.sds.com/") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "getContentList", namespace = "http://webservice.luxor.acube.sds.com/") public class GetContentList { @XmlElement(name = "arg0") private com.sds.acube.luxor.portal.vo.PortalContentVO arg0; public com.sds.acube.luxor.portal.vo.PortalContentVO getArg0() { return this.arg0; } public void setArg0(com.sds.acube.luxor.portal.vo.PortalContentVO newArg0) { this.arg0 = newArg0; } }
a329ef082fbedb11794dae8264630f7b19d33182
418e3600ebe5e2b2ec2cca790408ecca0882fbe5
/src/main/java/com/beimi/config/web/GameServerConfiguration.java
deec1e52bf27f2ffb7dd7dbae9038ca472d284e1
[ "Apache-2.0" ]
permissive
beijixiongzzj/shouerGame
c756fb2c24dd18f57c7515b0f32afcf0deea9ce7
b35c3e36d26722eb93e0ab14b721042187ebe985
refs/heads/master
2020-03-13T10:54:46.955667
2018-04-26T03:13:33
2018-04-26T03:13:33
131,092,233
1
0
null
null
null
null
UTF-8
Java
false
false
1,176
java
package com.beimi.config.web; import java.io.IOException; import java.security.NoSuchAlgorithmException; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import com.beimi.core.BMDataContext; import com.beimi.util.server.handler.GameEventHandler; /** * 加载game server的相关配置,初始化进程。 */ @org.springframework.context.annotation.Configuration public class GameServerConfiguration { @Value("${uk.im.server.host}") private String host; @Value("${uk.im.server.port}") private Integer port; @Value("${web.upload-path}") private String path; @Value("${uk.im.server.threads}") private String threads; private GameEventHandler handler = new GameEventHandler(); @Bean(name="webimport") public Integer getWebIMPort() { BMDataContext.setWebIMPort(port); return port; } @Bean public GameServer socketIOServer() throws NoSuchAlgorithmException, IOException{ GameServer server = new GameServer(port , handler) ; handler.setServer(server); return server; } }
85690e2fb2183954a8b26e4a3ad0910f30d8a930
2da82703b3fd5bfad2f4b451fc80e61a41e09996
/src/_07_fortune_cookie/FortuneCookie.java
40eea2d35dcd6f9d4b874e2038e80b2c4bd52f92
[]
no_license
League-Level1-Student/level1-module0-AkselAannestad
42e7bcddfc0b8472767b7eb423d466d2956d3eb0
a9f9db442f913f9b69d7039382d96bb0149391e9
refs/heads/master
2022-11-23T22:15:31.565992
2020-07-30T03:17:26
2020-07-30T03:17:26
276,523,952
0
0
null
null
null
null
UTF-8
Java
false
false
1,175
java
package _07_fortune_cookie; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Random; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; public class FortuneCookie implements ActionListener { public void showButton() { JFrame frame =new JFrame(); frame.setVisible(true); JButton button = new JButton("Open your fortune"); frame.add(button); frame.pack(); button.addActionListener(this); } @Override public void actionPerformed(ActionEvent e) { int rand = new Random().nextInt(5); if(rand==0) { JOptionPane.showMessageDialog(null, "You will live a long and properous life as a uber driver"); } else if(rand==1) { JOptionPane.showMessageDialog(null, "You will spend too much time gaming"); } else if(rand==2) { JOptionPane.showMessageDialog(null, "Something is coming"); } else if(rand==3) { JOptionPane.showMessageDialog(null, "You will have a big surprise"); } else if(rand==4) { JOptionPane.showMessageDialog(null, "If you don't change your path, you will end up where you're headed"); } } }
bb50b509ae0fd0eff8651f5aa7afedad748189e7
b5a82a83c4d2b3db2982713252682dd07524ba7f
/src/java112/project3/MLJServlet.java
6c1ca50c92f6bcdd466a4203015737657dd5a21f
[]
no_license
MadJavaAdvFall2017/mvc-team-challenge-m-l-j
5d5184e19d1299865c1d02dac6b103fc8fe4535b
95090766c88bf68603f5189551c9454d7cc96121
refs/heads/master
2021-05-07T20:04:38.742639
2017-11-07T01:04:49
2017-11-07T01:04:49
108,920,138
0
0
null
null
null
null
UTF-8
Java
false
false
1,244
java
package java112.project3; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.annotation.*; /** * @author Eric Knapp * class MvcDemo * */ @WebServlet( name = "MLJServlet", urlPatterns = { "/mlj-servlet" } ) public class MLJServlet extends HttpServlet { /** * Handles HTTP GET requests. * *@param request the HttpServletRequest object *@param response the HttpServletResponse object *@exception ServletException if there is a Servlet failure *@exception IOException if there is an IO failure */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String answer1 = request.getParameter("answer1"); String answer2 = request.getParameter("answer2"); BeanMLJ myBean = new BeanMLJ(); myBean.setAnswer1(answer1); myBean.setAnswer2(answer2); request.setAttribute("myCoolBean", myBean); String url = "/mlj.jsp"; RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); dispatcher.forward(request, response); } }
1db400fb0486751881cd0f123951dc111599c156
750c646b36514cc5310c63ac8043c90526355b48
/Práctica II. Interfaz gráfico de usuario de Soplando Bolas/ventanaPrincipal.java
fbb58021a990a3b5aeacd8d30d282ea56c2ae2f1
[]
no_license
eherng03/programming2
b4b0f7838c7a35eb553be96119078a18554b0ae7
97cc9691834bc9a392d28cc087eed4d990f7e7ac
refs/heads/master
2021-07-04T09:58:54.147366
2017-09-25T21:16:16
2017-09-25T21:16:16
104,801,998
0
0
null
null
null
null
UTF-8
Java
false
false
13,447
java
import java.awt.BorderLayout; import java.awt.Color; import java.awt.EventQueue; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Timer; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.SwingConstants; //cada vez que modifica algo visual hacer revalidate() public class ventanaPrincipal{ public JFrame frame; public Tablero panelTablero; public JButton[][] mCasillas; public int nfilas; public int ncolumnas; //private final JTextField textField = new JTextField(); public JLabel lblNewLabel; public File archivo; public int contadorJuegos; public static ventanaPrincipal window; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { window = new ventanaPrincipal(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public ventanaPrincipal() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { //para que al principio por defecto salga un tablero de 3x3 //----------------- //frame = this; frame = new JFrame(); frame.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); frame.setBounds(100, 100, 422, 422); //frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); panelTablero = null; lblNewLabel = new JLabel(); lblNewLabel.setForeground(new Color(128, 0, 0)); lblNewLabel.setFont(new Font("Trebuchet MS", Font.BOLD, 13)); lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); lblNewLabel.setBackground(new Color(255, 248, 220)); frame.getContentPane().add(lblNewLabel, BorderLayout.SOUTH); frame.revalidate(); //menu JMenuBar menuBar = new JMenuBar(); frame.setJMenuBar(menuBar); JMenu mnArchivo = new JMenu("Archivo"); mnArchivo.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); menuBar.add(mnArchivo); final JMenuItem mntmNuevo = new JMenuItem("Nuevo"); mntmNuevo.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mntmNuevo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(panelTablero != null){ int x = JOptionPane.showConfirmDialog(mntmNuevo, "¿Está seguro que abrir un nuevo tablero sin guardar el anterior?\n"); if(x == JOptionPane.YES_OPTION){ crearNuevo(); panelTablero = null; EditionWindow panelEdicion = new EditionWindow(window); //panelEdicion.principalWindow = frame; panelEdicion.setVisible(true); frame.revalidate(); } }else{ EditionWindow panelEdicion = new EditionWindow(window); panelEdicion.setVisible(true); frame.revalidate(); } } }); mnArchivo.add(mntmNuevo); final JMenuItem mntmCargar = new JMenuItem("Cargar"); mntmCargar.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mntmCargar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { //primero pregunta si desea cargar uno sin guardar if(panelTablero != null){ int x = JOptionPane.showConfirmDialog(mntmCargar, "¿Está seguro que desea cargar un nuevo tablero sin guardar el anterior?\n"); if(x == JOptionPane.YES_OPTION){ frame.getContentPane().remove(panelTablero); panelTablero = null; cargar(); }else if(x == JOptionPane.NO_OPTION){ panelTablero.guardarComo(); } }else{ cargar(); } } }); mnArchivo.add(mntmCargar); JMenuItem mntmSalvar = new JMenuItem("Salvar"); mntmSalvar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(panelTablero != null){ panelTablero.guardar(); } } }); mntmSalvar.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mnArchivo.add(mntmSalvar); JMenuItem mntmSalvarComo = new JMenuItem("Salvar como..."); mntmSalvarComo.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mntmSalvarComo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(panelTablero != null){ panelTablero.guardarComo(); } } }); mnArchivo.add(mntmSalvarComo); JMenuItem mntmSalir = new JMenuItem("Salir"); mntmSalir.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mntmSalir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //primero pregunta si desea cargar uno sin guardar int k = JOptionPane.showConfirmDialog(mntmCargar, "¿Está seguro que desea salir sin guardar?\n"); if(k == JOptionPane.YES_OPTION){ frame.dispose(); }else if(k == JOptionPane.NO_OPTION){ panelTablero.guardarComo(); } } }); mnArchivo.add(mntmSalir); JMenu mnEditar = new JMenu("Editar"); mnEditar.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); menuBar.add(mnEditar); final JMenuItem mntmDeshacer = new JMenuItem("Deshacer"); mntmDeshacer.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(panelTablero != null){ if(panelTablero.indiceDeshacer == 0){ mntmDeshacer.setEnabled(false); }else if(panelTablero.indiceDeshacer > 0){ mntmDeshacer.setEnabled(true); frame.getContentPane().remove(panelTablero); panelTablero.indiceDeshacer--; panelTablero = new Tablero(panelTablero.tablerosMovidos.get(panelTablero.indiceDeshacer)); panelTablero.pintarTablero(); frame.getContentPane().add(panelTablero); frame.revalidate(); } } } }); mntmDeshacer.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mnEditar.add(mntmDeshacer); final JMenuItem mntmRehacer = new JMenuItem("Rehacer"); mntmRehacer.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(panelTablero != null){ if(panelTablero.indiceDeshacer == panelTablero.tablerosMovidos.size()){ //si el indice esta al final del array de tableros movidos no se puede rehacer mntmRehacer.setEnabled(false); } if(panelTablero.indiceDeshacer < panelTablero.tablerosMovidos.size()){ mntmRehacer.setEnabled(true); frame.getContentPane().remove(panelTablero); panelTablero.indiceDeshacer++; panelTablero = new Tablero(panelTablero.tablerosMovidos.get(panelTablero.indiceDeshacer)); panelTablero.pintarTablero(); frame.getContentPane().add(panelTablero); frame.revalidate(); } } } }); mntmRehacer.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mnEditar.add(mntmRehacer); final JMenuItem mntmEditar = new JMenuItem("Editar"); mntmEditar.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); //si no hay tablero no se puede editar if(panelTablero == null){ mntmEditar.setEnabled(false); }else{ mntmEditar.setEnabled(true); mntmEditar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { EditionWindow panelEdicion = new EditionWindow(window); panelEdicion.setVisible(true); } }); } mnEditar.add(mntmEditar); JMenu mnResolver = new JMenu("Resolver"); mnResolver.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); menuBar.add(mnResolver); //esta desactivado en esta ventana JMenuItem mntmResolver = new JMenuItem("Resolver"); mntmResolver.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mntmResolver.setEnabled(false); mnResolver.add(mntmResolver); final JMenuItem mntmResolverAutomticamente = new JMenuItem("Resolver automáticamente"); mntmResolverAutomticamente.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(window.panelTablero == null){ mntmResolverAutomticamente.setEnabled(false); }else{ mntmResolverAutomticamente.setEnabled(true); autoSolveDialog auto = new autoSolveDialog(panelTablero, window); auto.setVisible(true); } } }); mntmResolverAutomticamente.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); mnResolver.add(mntmResolverAutomticamente); JMenu mnAyuda = new JMenu("Ayuda"); mnAyuda.setFont(new Font("Tw Cen MT", Font.PLAIN, 15)); menuBar.add(mnAyuda); JMenuItem mntmAbrirAyuda = new JMenuItem("Abrir ayuda"); mntmAbrirAyuda.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { helpWindow ayudaPrincipal = new helpWindow("principal"); ayudaPrincipal.setVisible(true); } }); mnAyuda.add(mntmAbrirAyuda); } protected void crearNuevo() { // TODO Auto-generated method stub } protected void deshacer() { } protected void cargar() { JFileChooser seleccionarArchivo = new JFileChooser(); int eleccion = seleccionarArchivo.showOpenDialog(frame); if(eleccion == JFileChooser.APPROVE_OPTION){ FileReader fichero = null; try { fichero = new FileReader(seleccionarArchivo.getSelectedFile()); } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(frame, "Archivo no encontrado.", "Error", JOptionPane.WARNING_MESSAGE); } BufferedReader bufferReader = new BufferedReader(fichero); try { setParametros(bufferReader); } catch (IOException e) { JOptionPane.showMessageDialog(frame, "Formato incorrecto de entrada en el archivo", "Error", JOptionPane.WARNING_MESSAGE); } } } protected void setParametros(BufferedReader bufferReader) throws IOException { String[] dimension = bufferReader.readLine().split(" "); if(dimension.length == 2){ int filasAux = Integer.parseInt(dimension[0]); int columnasAux = Integer.parseInt(dimension[1]); //System.out.println(filasAux + " " + columnasAux); panelTablero = new Tablero(filasAux, columnasAux); String nObjetivos = bufferReader.readLine(); //System.out.println(nObjetivos); panelTablero.numeroBolas = Integer.parseInt(nObjetivos); panelTablero.objetivosCadena = bufferReader.readLine(); panelTablero.bolasCadena = bufferReader.readLine(); //System.out.println(panelTablero.objetivosCadena); //System.out.println(panelTablero.bolasCadena); String[] objetivos = panelTablero.objetivosCadena.split(" "); String[] bolas = panelTablero.bolasCadena.split(" "); if(panelTablero.numeroBolas <= filasAux*columnasAux){ if(objetivos.length == bolas.length){ if(objetivos.length/2 == panelTablero.numeroBolas){ int[][] objPos = new int[panelTablero.numeroBolas][2]; int i = 0; for(int fila = 0; fila < panelTablero.numeroBolas*2; fila = fila+2){ objPos[i][0] = Integer.parseInt(objetivos[fila])-1; objPos[i][1] = Integer.parseInt(objetivos[fila+1])-1; panelTablero.mCasillas[objPos[i][0]][objPos[i][1]].esObjetivo = true; i++; } panelTablero.setObjetivos(objPos); int j = 1; //numero de bola for(int bol = 0; bol < panelTablero.numeroBolas*2; bol = bol +2){ panelTablero.addBola(new Bola(j, Integer.parseInt(bolas[bol])-1, Integer.parseInt(bolas[bol+1])-1)); j++; } panelTablero.isEditarBolas = false; panelTablero.isEditarObjetivos = false; panelTablero.isResolver = true; panelTablero.pintarTablero(); frame.getContentPane().add(panelTablero); frame.revalidate(); }else{ JOptionPane.showMessageDialog(panelTablero, "Faltan o sobran cordenadas"); } }else{ JOptionPane.showMessageDialog(panelTablero, "No hay el mismo numero de bolas que de objetivos"); } }else{ JOptionPane.showMessageDialog(panelTablero, "Ha introducido un numero mayor de objetivos que espacios hay e el tablero."); } }else{ JOptionPane.showMessageDialog(panelTablero, "Error de dimension del tablero en la primera linea del fichero"); } } public void resolveAuto(final ArrayList<Integer> arrayList) { int tiempoEjecucion = 500; for(int i = 0; i < arrayList.size(); i++){ final int aux = 1; javax.swing.Timer temporizador = new javax.swing.Timer(tiempoEjecucion, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //borro el que hay window.frame.getContentPane().remove(panelTablero); //soplo las lineas window.panelTablero.soplarLineas(arrayList.get(aux)); //lo pinto window.panelTablero.pintarTablero(); //lo vuelvo a añadir window.frame.getContentPane().add(window.panelTablero); window.frame.revalidate(); } }); temporizador.setRepeats(false); temporizador.start(); tiempoEjecucion = tiempoEjecucion + 500; } } }
8fc49c3ad1ba6e3c69f4ba0c0c8ba819e76e8d5e
7ae82f1727f44df4dad3028e5ac3732f8af579f5
/milestone1prblms/src/com/wipro/numberprblms/LoopBasedEx3.java
aaaffdf3b1eb9da504444817bf0c971ff8c22444
[]
no_license
170040791/milestoneprblems
0718d7d6983cfbf2f5ffecc3e46d12c826b60af2
adedacf051923c167df1e533c40437f025677c6e
refs/heads/master
2022-11-14T20:58:26.949431
2020-07-06T08:19:20
2020-07-06T08:19:20
273,382,474
0
0
null
null
null
null
UTF-8
Java
false
false
681
java
package com.wipro.numberprblms; public class LoopBasedEx3 { int Divisors(int n) { int i,c=1; if(n==0) { System.out.println("every integer"); }else { for(i=1;i<=n/2;i++) { if(n%i==0) { c++; } } }return c; } public static void main(String args[]) { int n=Integer.parseInt(args[0]); LoopBasedEx3 l=new LoopBasedEx3(); int c=l.Divisors(n); if(c==2) { System.out.println("prime");} else { System.out.println("not prime"); } } }
[ "Pandu@DESKTOP-U24VG2S" ]
Pandu@DESKTOP-U24VG2S
fb2fcf259ab3fc5fdf57ae39487d1f1c130527b2
8eeeb4535cdf7c32c47880e05412cec513ed8ce8
/core/src/com/pukekogames/airportdesigner/Helper/ScreenState.java
35ff761fa5eef5d59cbecc18fefbc2104f87f3ec
[]
no_license
imperiobadgo/AirportDesigner
850c3d87a3fb3db4aca83468dc98d5a54f105fb0
48da49b9d80238b9f4bc5a934c154d6cecda857f
refs/heads/master
2021-01-18T16:16:31.641734
2017-10-06T15:12:09
2017-10-06T15:12:09
86,731,797
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package com.pukekogames.airportdesigner.Helper; /** * Created by Marko Rapka on 05.12.2015. */ public enum ScreenState { Game(), TimeWindow(), Airline() }
80d0ea018c43dbadb8375a73a0d22df867ed31ca
2e46539de5923a90e4217b4bc1331f6dd198ca72
/SpringBootWebApp/src/main/java/com/demo/ServletInitializer.java
d57b37b1af4beac3a1ec438a54fbda570b9a8b6b
[]
no_license
SusantJava/ExcpetionHanlding
df2054e9c15fa88482bb81a8838cb5a1e2540843
ab38ca308893212aca096c894f0e2e9b59175c3c
refs/heads/master
2020-09-07T11:58:57.294192
2019-11-10T10:23:08
2019-11-10T10:23:08
220,773,186
0
0
null
null
null
null
UTF-8
Java
false
false
408
java
package com.demo; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpringBootWebAppApplication.class); } }
b95817042a5afb81ee6f33232ac64e48dd797bba
2bc551f9c2ecb57ec0cb93ad18d3ce0bafbddb34
/Spring/Source/springmvc5/src/main/java/example/WebConfig.java
19609668f37ed062d33e9dade1cf844852cc3994
[]
no_license
YiboXu/JavaLearning
c42091d6ca115826c00aad2565d9d0f29b1f5f68
97b4769ebbe096e0ab07acb6889fb177e2ca5abe
refs/heads/master
2022-10-27T23:47:54.637565
2020-06-16T09:12:09
2020-06-16T09:12:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,132
java
package example; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.view.InternalResourceViewResolver; @Configuration @EnableWebMvc @ComponentScan("example.web") //all controller will be put in package example.web public class WebConfig extends WebMvcConfigurerAdapter{ @Bean public ViewResolver viewResolver() { InternalResourceViewResolver resolver =new InternalResourceViewResolver(); resolver.setPrefix("/WEB-INF/views/"); resolver.setSuffix(".jsp"); resolver.setExposeContextBeansAsAttributes(true); return resolver; } @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { configurer.enable(); } }
6c806569316298ffbc7ffe5002ed28c03bd99b11
7db0db28538330106923ff3290dc309f42a80c8e
/West2MilkteaShop/src/Main.java
05dd044dea1cfe3f2568aa4c9af103afcb026b55
[]
no_license
smsbQAQ/West2work-vol.2
8015e1110e53958d58de172710b40c5ec586028b
8930b44920bb3ad380a11bbd349af6055a971130
refs/heads/master
2020-09-26T20:29:54.363369
2019-12-06T14:40:38
2019-12-06T14:40:38
226,337,631
0
0
null
null
null
null
UTF-8
Java
false
false
804
java
import java.util.Scanner; public class Main { public static void main(String[] args) { TeaShop ts=new TeaShop(); System.out.println("欢迎光临西二奶茶店"); while(true){ System.out.println("输入"); System.out.println("1->珍珠奶茶"); System.out.println("2->椰果奶茶"); System.out.println("3->溜了"); Scanner sc =new Scanner(System.in); int n=sc.nextInt(); if(n==3) break; if(n==1){ MilkTea mt=new MilkTea("珍珠奶茶!",new Bubble()); ts.sell(mt); } else{ MilkTea mt=new MilkTea("椰果奶茶!",new Coconut()); ts.sell(mt); } } } }
27e0870ea0de41f987687a9d1ccf3ab1efb4f380
60d47cd1795ec1030d2bc829a5857ee8486579c2
/src/main/java/com/rest/webservices/restfulwebservices/versioning/Name.java
abfc95e970067bcfbc78bc92d8fca7271ea577a3
[]
no_license
ananjarusarunchai/restful-springboot
96b346bb97dbfdaaab77af7395ef39e13dc196cf
24cb075fa43c41168adaab3ec98ecd6490605f86
refs/heads/master
2020-05-01T04:12:44.506524
2019-03-23T09:14:25
2019-03-23T09:14:25
177,267,495
1
0
null
null
null
null
UTF-8
Java
false
false
560
java
package com.rest.webservices.restfulwebservices.versioning; public class Name { private String name; private String lastName; public Name(){} public Name(String name, String lastName) { this.name = name; this.lastName = lastName; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } }
150788add3d35ce040d89aec44b340bcaf6027f3
f556655da952ff6e11b1023851b1c6149a1ac54d
/LocalFileHandling/app/src/main/java/com/junjunguo/localfilehandling/model/LocationReport.java
eb2f7f0cc70df4c29a66d87e4c62754e4f817545
[]
no_license
salahpepsi/android
1becf74e36d344dc755a8139d29b88796579da55
0834a990b3ef7e8354df1c36a1c2c9b10ef28310
refs/heads/master
2020-04-27T21:59:06.002794
2019-03-30T15:47:59
2019-03-30T15:47:59
174,719,009
0
0
null
2019-03-09T16:36:28
2019-03-09T16:36:28
null
UTF-8
Java
false
false
2,604
java
package com.junjunguo.localfilehandling.model; import java.text.SimpleDateFormat; import java.util.Calendar; /** * This file is part of LocalFileHandling * <p/> * Created by GuoJunjun <junjunguo.com> on 08/03/15. * <p/> * Responsible for this file: GuoJunjun */ public class LocationReport { private String userid; private boolean isreported; private Calendar datetime; private double latitude, longitude; private SimpleDateFormat df = new SimpleDateFormat("EEEE, MMMM d, yyyy 'at' h:mm a"); /** * Sets new longitude. * * @param longitude New value of longitude. */ public void setLongitude(double longitude) { this.longitude = longitude; } /** * Gets latitude. * * @return Value of latitude. */ public double getLatitude() { return latitude; } /** * Gets isreported. * * @return Value of isreported. */ public boolean isIsreported() { return isreported; } /** * Gets longitude. * * @return Value of longitude. */ public double getLongitude() { return longitude; } /** * Sets new datetime. * * @param datetime New value of datetime. */ public void setDatetime(Calendar datetime) { this.datetime = datetime; } /** * Sets new datetime. * * @param datetime New value of datetime. */ public void setDatetime(long datetime) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(datetime); this.datetime = cal; } /** * Sets new latitude. * * @param latitude New value of latitude. */ public void setLatitude(double latitude) { this.latitude = latitude; } /** * Sets new userid. * * @param userid New value of userid. */ public void setUserid(String userid) { this.userid = userid; } /** * Gets datetime. * * @return Value of datetime. */ public Calendar getDatetime() { return datetime; } /** * Gets userid. * * @return Value of userid. */ public String getUserid() { return userid; } /** * Sets new isreported. * * @param isreported New value of isreported. */ public void setIsreported(boolean isreported) { this.isreported = isreported; } @Override public String toString() { return "userid='" + userid + ", isreported=" + isreported + "\ndatetime=" + df.format(datetime.getTime()) + "\nlatitude=" + latitude + ", longitude=" + longitude; } }
a804d58f8c0be08135b87198e2cfb4e9396e19cf
c01ce54fdfef3950fe30760116d8017dafcf5374
/app/src/main/java/course/leedev/cn/pubgassistant/ui/fragment/home/child/tabs/RegisterFragment.java
721620de36696c3341b35aa7f093734c28fafe2b
[]
no_license
ThomasLeedev/PUBGAssistant
1921fdf2cf714a2daf0f25ad45d073004fd7ac2c
818f4d2222ffa824f774d661a2c29d410e83b555
refs/heads/master
2021-09-05T14:13:36.158101
2018-01-28T17:19:08
2018-01-28T17:19:08
119,280,301
0
1
null
null
null
null
UTF-8
Java
false
false
3,655
java
package course.leedev.cn.pubgassistant.ui.fragment.home.child.tabs; import android.os.Bundle; import android.os.Handler; import android.support.v4.widget.SwipeRefreshLayout; import android.view.View; import android.widget.Button; import com.jakewharton.rxbinding2.view.RxView; import com.tencent.smtt.sdk.WebChromeClient; import com.tencent.smtt.sdk.WebSettings; import com.tencent.smtt.sdk.WebView; import com.tencent.smtt.sdk.WebViewClient; import java.util.concurrent.TimeUnit; import butterknife.BindView; import course.leedev.cn.pubgassistant.R; import course.leedev.cn.pubgassistant.base.fragment.BaseCompatFragment; import io.reactivex.Scheduler; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; /** * Created by lt on 2018/1/8. */ public class RegisterFragment extends BaseCompatFragment { @BindView(R.id.wv_register) WebView wvRegister; @BindView(R.id.btn_back_register) Button btnRegister; // @BindView(R.id.btn_back_login) // Button btnLogin; // @BindView(R.id.btn_back_bind) // Button btnBind; private WebSettings webSettings; private Handler handler = new Handler(); public static RegisterFragment newInstance() { return new RegisterFragment(); } @Override protected void initUI(View view, Bundle savedInstanceState) { wvRegister.loadUrl("http://www.jixunjsq.com/user/index/register.html"); webSettings = wvRegister.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setSupportZoom(true); webSettings.setBuiltInZoomControls(true); webSettings.setUseWideViewPort(true); webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); webSettings.setDisplayZoomControls(false); // wvRegister.setWebViewClient(new WebViewClient() { // @Override // public boolean shouldOverrideUrlLoading(WebView webView, String s) { // webView.loadUrl(s); // return super.shouldOverrideUrlLoading(webView, s); // } // }); btnClick(); } private void btnClick() { RxView.clicks(btnRegister).debounce(300, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer<Object>() { @Override public void accept(Object o) throws Exception { reloadUrl("http://www.jixunjsq.com/user/index/register.html"); } }); // // RxView.clicks(btnLogin).debounce(300, TimeUnit.MILLISECONDS) // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(new Consumer<Object>() { // @Override // public void accept(Object o) throws Exception { // reloadUrl("http://www.jixunjsq.com/user/index/login.html"); // } // }); // // RxView.clicks(btnBind).debounce(300, TimeUnit.MILLISECONDS) // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(new Consumer<Object>() { // @Override // public void accept(Object o) throws Exception { // reloadUrl("http://www.jixunjsq.com/user/manage/phone.html"); // } // }); } @Override public int getLayoutId() { return R.layout.fragment_home_register; } public void reloadUrl(String url) { wvRegister.loadUrl(url); } }
d3919128a683ee86189cc1d66a27af39f0808ba5
35369ef2fb3ee636e1ac332993554015a24d2169
/ActivosFijos/src/main/java/asd/prueba/dao/AuthUserDaoJdbc.java
08ca25380a6f1da885db8e65813b3068bf43e9ef
[]
no_license
jacadenac/ActivosFijos
97ac3e5f5d8853e2c7d1b5805f754177c7992c13
d2cd2b34c2514b334cc2cded69dcbbc991fbdf15
refs/heads/master
2020-03-19T21:45:48.486016
2018-06-13T10:30:52
2018-06-13T10:30:52
136,949,246
0
0
null
null
null
null
UTF-8
Java
false
false
6,516
java
package asd.prueba.dao; import asd.prueba.model.AuthUser; import asd.prueba.utils.Page; import asd.prueba.utils.PaginationHelper; import java.sql.SQLException; import java.util.Date; import java.util.List; import javax.sql.DataSource; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.stereotype.Repository; /** * AuthUser Dao Class * * @author Alejandro Cadena * @version 1.0 */ @Repository("authUserDao") public class AuthUserDaoJdbc implements AuthUserDao { /** * Template para consultas jdbc */ protected NamedParameterJdbcTemplate npJdbcTemplate; private static final String SQL_COUNT_ALL = "SELECT count(*) FROM auth_user"; private static final String SQL_FIND_ALL = "SELECT * FROM auth_user"; private static final String SQL_FIND_BY_PK = "SELECT * FROM auth_user WHERE username = :username"; private static final String SQL_INSERT = "INSERT INTO auth_user " + "(username, password, fullname, email, enabled) " + "VALUES (:username, :password, :fullname, :email, :enabled)"; private static final String SQL_UPDATE = "UPDATE auth_user SET " + "fullname = :fullname, email = :email, enabled = :enabled, " + "updated_date = :updated_date WHERE username = :username"; private static final String SQL_DELETE = "DELETE FROM auth_user " + "WHERE username = :username"; private static final Logger LOGGER = LogManager.getLogger(AuthUserDaoJdbc.class); /** * Se inyecta dataSource configurado en applicationContext.xml * @param dataSource fuente de datos */ @Autowired public void setDataSource(DataSource dataSource) { this.npJdbcTemplate = new NamedParameterJdbcTemplate(dataSource); } /** * Busca elemento por llave primaria * @param pk llave primaria * @return elemento encontrado, nulo si no se encontró el elemento */ @Override public AuthUser findById(Object pk) { MapSqlParameterSource mapParams = new MapSqlParameterSource(); mapParams.addValue("username", pk); try{ return (AuthUser)this.npJdbcTemplate.queryForObject( SQL_FIND_BY_PK, mapParams, new BeanPropertyRowMapper(AuthUser.class) ); } catch (EmptyResultDataAccessException e) { return null; } } /** * Busca todos los elementos registrados * @return lista con todos los elementos encontrados */ @Override public List<AuthUser> findAll() { return this.npJdbcTemplate.query(SQL_FIND_ALL, new BeanPropertyRowMapper(AuthUser.class)); } /** * Busca todos los elementos registrados y los retorna paginados * @param pageNo Número de página a ser consultada * @param pageSize Máximo número de elementos por página * @return Lista de elementos paginados * @throws SQLException en caso de error durante la consulta */ @Override public Page<AuthUser> findAllWithPagination(int pageNo, int pageSize) throws SQLException { PaginationHelper<AuthUser> ph = new PaginationHelper(); return ph.fetchPage( npJdbcTemplate, SQL_COUNT_ALL, SQL_FIND_ALL, pageNo, pageSize, new BeanPropertyRowMapper(AuthUser.class) ); } /** * Inserta un elemento nuevo en la base de datos * @param modelObject elemento que será insertado * @throws SQLException en caso de error durante la inserción */ @Override public void insert(AuthUser modelObject) throws SQLException { MapSqlParameterSource mapParams = new MapSqlParameterSource(); mapParams.addValue("username", modelObject.getUsername()); mapParams.addValue("password", modelObject.getPassword()); mapParams.addValue("fullname", modelObject.getFullname()); mapParams.addValue("email", modelObject.getEmail()); mapParams.addValue("enabled", modelObject.isEnabled()); mapParams.addValue("updated_date", new Date()); this.npJdbcTemplate.update(SQL_INSERT, mapParams); } /** * Actualiza el elemento en la base de datos * @param modelObject elemento que será actualizado * @throws SQLException en caso de error durante la actualización */ @Override public void update(AuthUser modelObject) throws SQLException { MapSqlParameterSource mapParams = new MapSqlParameterSource(); mapParams.addValue("fullname", modelObject.getFullname()); mapParams.addValue("email", modelObject.getEmail()); mapParams.addValue("enabled", modelObject.isEnabled()); mapParams.addValue("username", modelObject.getUsername()); mapParams.addValue("updated_date", new Date()); int numRowsAffected = this.npJdbcTemplate.update(SQL_UPDATE, mapParams); if(numRowsAffected == 0){ this.throwNotFoundByPK(modelObject.getUsername()); } } /** * Elimina el elemento de la base de datos * @param modelObject elemento que será eliminado * @throws SQLException en caso de error durante la eliminación */ @Override public void delete(AuthUser modelObject) throws SQLException { MapSqlParameterSource mapParams = new MapSqlParameterSource(); mapParams.addValue("username", modelObject.getUsername()); String sentenceSQL = SQL_DELETE; int numRowsAffected = this.npJdbcTemplate.update(sentenceSQL, mapParams); if(numRowsAffected == 0){ this.throwNotFoundByPK(modelObject.getUsername()); } } /** * Arroja error indicando que el elemento no fue encontrado * @param pk llave primaria */ private void throwNotFoundByPK(Object pk){ String message = "No "+AuthUser.class.getSimpleName()+" found with PK " + pk; EmptyResultDataAccessException erdae = new EmptyResultDataAccessException(message, 1); LOGGER.error(message); throw erdae; } }
[ "" ]
9f806657a74c3febb5cbab44546a3548a10b1c83
529ffd6d52afbb459e0e5ad248257d58412c40e6
/src/com/aut/BaseCryptography.java
238afe96e69f609b56efbc76467fc22588890ea2
[]
no_license
KimiyaZargari/APMidProject
4ca3c8f92eab3a41174c12405c939e3e4145b768
04eaa4e4c8fd6e114b055c731d4407c558af00a4
refs/heads/master
2021-01-05T21:49:07.229558
2020-02-17T15:55:28
2020-02-17T15:55:28
241,147,047
0
0
null
null
null
null
UTF-8
Java
false
false
234
java
package com.aut; /** * this class is an abstract class for cryptography. */ public abstract class BaseCryptography { public abstract String encrypt(String plainText); public abstract String decrypt(String cipherText); }
6ed4565aa0daf9dffa26d0a6455c0d5f871b232f
7f20b1bddf9f48108a43a9922433b141fac66a6d
/csplugins/trunk/toronto/jm/cy3-stateless-taskfactory-alt1/impl/core-task-impl/src/main/java/org/cytoscape/task/internal/export/network/ExportNetworkViewTaskFactory.java
5ceb5735aaeeeb7496581a35513c6d004727aa7d
[]
no_license
ahdahddl/cytoscape
bf783d44cddda313a5b3563ea746b07f38173022
a3df8f63dba4ec49942027c91ecac6efa920c195
refs/heads/master
2020-06-26T16:48:19.791722
2013-08-28T04:08:31
2013-08-28T04:08:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package org.cytoscape.task.internal.export.network; import org.cytoscape.io.write.CyNetworkViewWriterManager; import org.cytoscape.task.AbstractNetworkViewTaskFactory; import org.cytoscape.view.model.CyNetworkView; import org.cytoscape.work.TaskIterator; public class ExportNetworkViewTaskFactory extends AbstractNetworkViewTaskFactory { private CyNetworkViewWriterManager writerManager; public ExportNetworkViewTaskFactory(CyNetworkViewWriterManager writerManager) { this.writerManager = writerManager; } @Override public TaskIterator createTaskIterator(CyNetworkView view) { return new TaskIterator(2,new CyNetworkViewWriter(writerManager, view)); } }
[ "jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5" ]
jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5
a303eede61ee15cf976b8bb0df3358ce592b598f
af626ade966544b91fbfe0ea81fc887f1b8a2821
/src/secp256k1/src/java/org/bitcoinrtx/NativeSecp256k1.java
b2b0bede0ec7faee28f3ba119c6aa26ee386169f
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
kunalbarchha/bitcoinrtx-old
91f2b36a50e009151c61d36e77a563d0c17ab632
42c61d652288f183c4607462e2921bb33ba9ec1f
refs/heads/master
2023-03-13T22:46:36.993580
2021-03-04T13:01:00
2021-03-04T13:01:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,103
java
package org.bitcoinrtx; import java.nio.ByteBuffer; import java.nio.ByteOrder; import com.google.common.base.Preconditions; /** * This class holds native methods to handle ECDSA verification. * You can find an example library that can be used for this at * https://github.com/sipa/secp256k1 */ public class NativeSecp256k1 { public static final boolean enabled; static { boolean isEnabled = true; try { System.loadLibrary("javasecp256k1"); } catch (UnsatisfiedLinkError e) { isEnabled = false; } enabled = isEnabled; } private static ThreadLocal<ByteBuffer> nativeECDSABuffer = new ThreadLocal<ByteBuffer>(); /** * Verifies the given secp256k1 signature in native code. * Calling when enabled == false is undefined (probably library not loaded) * * @param data The data which was signed, must be exactly 32 bytes * @param signature The signature * @param pub The public key which did the signing */ public static boolean verify(byte[] data, byte[] signature, byte[] pub) { Preconditions.checkArgument(data.length == 32 && signature.length <= 520 && pub.length <= 520); ByteBuffer byteBuff = nativeECDSABuffer.get(); if (byteBuff == null) { byteBuff = ByteBuffer.allocateDirect(32 + 8 + 520 + 520); byteBuff.order(ByteOrder.nativeOrder()); nativeECDSABuffer.set(byteBuff); } byteBuff.rewind(); byteBuff.put(data); byteBuff.putInt(signature.length); byteBuff.putInt(pub.length); byteBuff.put(signature); byteBuff.put(pub); return secp256k1_ecdsa_verify(byteBuff) == 1; } /** * @param byteBuff signature format is byte[32] data, * native-endian int signatureLength, native-endian int pubkeyLength, * byte[signatureLength] signature, byte[pubkeyLength] pub * @returns 1 for valid signature, anything else for invalid */ private static native int secp256k1_ecdsa_verify(ByteBuffer byteBuff); }
132dfc075e6ebc3082f0c5260e559ada6f8a0a97
eefef840c23558ed067c9bcd57b46b2ce6f63819
/android/src/com/ygk/gcodecamera/MainActivity.java
700a02eda3af0936c1bd4e5cc33d2c47d982c5c5
[]
no_license
scsonic/GCodeCamera
8d30460467344c8a1b753692c16ca945e375ebbd
08d659c35912451c7f55aa5e2e22e54e1d4735de
refs/heads/master
2021-01-20T17:54:20.875257
2016-08-05T01:43:09
2016-08-05T01:43:09
64,931,366
0
0
null
null
null
null
UTF-8
Java
false
false
2,249
java
package com.ygk.gcodecamera; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends Activity { static public String TAG = "MainActivity" ; public CameraFragment cameraFragment ; @Override protected void onCreate(Bundle savedInstanceState) { Common.init(this) ; super.onCreate(savedInstanceState); cameraFragment = new CameraFragment(); Common.cameraFragment = cameraFragment; setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction().add(R.id.container, cameraFragment).commit(); } String raw = Common.readSharePerf(Common.SETTING) ; Common.set = Setting.fromJSON(raw) ; if (Common.set == null) { Common.set = Setting.getDefaultSetting() ; } // init color Setting.colorMap.put("White" , "#FFFFFF"); Setting.colorMap.put("Silver" , "#C0C0C0"); Setting.colorMap.put("Gray" , "#808080"); Setting.colorMap.put("Black" , "#000000"); Setting.colorMap.put("Red" , "#FF0000"); Setting.colorMap.put("Maroon" , "#800000"); Setting.colorMap.put("Yellow" , "#FFFF00"); Setting.colorMap.put("Olive" , "#808000"); Setting.colorMap.put("Lime" , "#00FF00" ); Setting.colorMap.put("Green" , "#008000"); Setting.colorMap.put("Aqua" , "#00FFFF" ); Setting.colorMap.put("Teal" , "#008080" ); Setting.colorMap.put("Blue" , "#0000FF" ); Setting.colorMap.put("Navy" , "#000080" ); Setting.colorMap.put("Fuchsia" , "#FF00FF" ); Setting.colorMap.put("Purple" , "#800080"); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); return super.onOptionsItemSelected(item); } @Override protected void onStop() { Common.writeSharePerf(Common.SETTING, Common.set.toJSON()); super.onStop(); } }
6e7eb169b5b8c3d6321a7364f4b5d1f7b7067389
992f46b5e47be95428ff673cfe63e23e2d895006
/core-java/src/main/java/oop/composition/Book.java
ce84fe28d0be02745011658b9ba97fed4363fd44
[]
no_license
berksoyyilmaz/tutorials
5d237cb2342738a961a6e60516e15f1ed83b4796
ab6e31d7a0663adbc36185760e5bd935cc1994c9
refs/heads/main
2023-03-16T13:19:02.725972
2023-02-05T15:50:22
2023-02-05T15:50:22
524,767,563
4
0
null
null
null
null
UTF-8
Java
false
false
291
java
package oop.composition; class Book { // Attributes of book public String title; public String author; // Constructor of Book class Book(String title, String author) { // This keyword refers to current instance itself this.title = title; this.author = author; } }
afb11781d9204c1f6a74f95e22614ed988afcd77
4301558203f98a3c0c64b24cce1324a602acc770
/src/model/DirectorDTO.java
b5a5bfaa3809b764d542cc6a5f95d0b960c7a596
[]
no_license
pooya98/knuMovieDB
a9bb6e87010b206d3cb6cc038793f47f479d1a57
8fbee34f515985d45785aa5e86b2928d016057cd
refs/heads/master
2023-02-01T03:57:40.426447
2020-12-14T13:58:47
2020-12-14T13:58:47
320,591,570
0
0
null
null
null
null
UTF-8
Java
false
false
530
java
package model; public class DirectorDTO { private int id; private String name; private String birth; private String sex; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getBirth() { return birth; } public void setBirth(String birth) { this.birth = birth; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } }
8bbeed11585e22a418db821f2f59633364988a3b
02e3ae050bf69373effa262a8a8230dea20c484c
/src/main/java/com/company/test/interceptor/DSKey.java
760c81a7193f9d5ad30f807d274d0e37719d4e45
[]
no_license
FayeGitHub/test
5dc3c752956c4fa3ae0bdd61f39f0e47df96deaa
ec1b3220bc9fadcaaa5d96e9a98cde8dee03ceb1
refs/heads/master
2022-12-21T20:45:05.185005
2021-11-14T15:06:07
2021-11-14T15:06:07
193,888,819
0
0
null
2022-12-16T05:06:12
2019-06-26T11:10:03
HTML
UTF-8
Java
false
false
453
java
package com.company.test.interceptor; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * * 数据源选择 注解 * 用在参数上,表示使用对应字段的hashcode来选择数据库 */ @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface DSKey { String value() default ""; }
[ "flyfo@DESKTOP-4PO01IH" ]
flyfo@DESKTOP-4PO01IH
b1e80e5c53b5955fa6c5e47c6d85048b75292e1f
975945cf2c76b20d5d4448b89f7057e33d1a9ebc
/zxing/src/main/java/com/baozi/baoziszxing/MainActivity.java
569e5f177bb5392d0898dbed6fe0911e6bf23353
[]
no_license
gy121681/Share
aa64f67746f88d55e884e5ae48b3789422175f8f
031286dc1d2ce4ebe7fe2665ebd525d1946ad163
refs/heads/master
2021-01-15T12:02:34.908825
2017-08-08T03:01:07
2017-08-08T03:01:07
99,643,530
3
0
null
null
null
null
UTF-8
Java
false
false
2,428
java
//package com.baozi.baoziszxing; // //import android.app.Activity; //import android.content.Intent; //import android.os.Bundle; //import android.support.v4.app.Fragment; //import android.view.LayoutInflater; //import android.view.View; //import android.view.View.OnClickListener; //import android.view.ViewGroup; //import android.widget.TextView; // //import com.baozi.Zxing.CaptureActivity; //import com.example.baoziszxing.R; // ///** // * // * @author Baozi // * @联系方式: [email protected] // * // * @描述: 1 project能扫描二维码和普通一维码 ; // * // * 2 能从相册拿到二维码照片然后进行解析 --->注意 照片中的二维码 在拍摄的时候需要正对齐 否则会解析不出 // * // * 3 针对大部分中文解决乱码问题 , 但依旧会有部分编码格式会出现中文乱码 如解决请联系我 QQ:2221673069 // * // * 4 Zxing在使用过程中发现了新问题 :如果扫描的时候手机与二维码的角度超过30度左右的时候就解析不了 如解决请联系我 // * QQ:2221673069 // * // * 谢谢大家 希望对大家有用 // */ //public class MainActivity extends Activity { // // @Override // protected void onCreate(Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setContentView(R.layout.activity_main); // // findViewById(R.id.button1).setOnClickListener(new OnClickListener() { // // @Override // public void onClick(View v) { // // TODO Auto-generated method stub // Intent intent = new Intent(MainActivity.this, // CaptureActivity.class); // // startActivityForResult(intent, 100); // // } // }); // } // // @Override // protected void onActivityResult(int arg0, int arg1, Intent data) { // super.onActivityResult(arg0, arg1, data); // // /** // * 拿到解析完成的字符串 // */ // if (data != null) { // TextView text = (TextView) findViewById(R.id.textView1); // text.setText(data.getStringExtra("result")); // } // } // // /** // * A placeholder fragment containing a simple view. // */ // public static class PlaceholderFragment extends Fragment { // // public PlaceholderFragment() { // } // // @Override // public View onCreateView(LayoutInflater inflater, ViewGroup container, // Bundle savedInstanceState) { // View rootView = inflater.inflate(R.layout.fragment_main, container, // false); // return rootView; // } // } // //}
0e7c43c4bdf2eeb1c1a3ff72a80fdeb6e52409a5
c60c4eab8026801155183d39e56dbf6d72589185
/src/main/java/com/library/domain/Admin.java
907f806312febccf1690aff14a5ce089e6bf22c1
[]
no_license
Panda0129/BookManagementSystem
92927cba498247b3b65ce2a5dce0f0d5365f1da1
39f06114ebb9c45bc2adb6980906eec8c1e6c85a
refs/heads/master
2021-09-01T02:03:32.407613
2017-12-24T09:34:33
2017-12-24T09:34:33
113,749,210
0
0
null
null
null
null
UTF-8
Java
false
false
426
java
package com.library.domain; public class Admin { private String admin_id; private String admin_pwd; public String getAdmin_id() { return admin_id; } public void setAdmin_id(String admin_id) { this.admin_id = admin_id; } public String getAdmin_pwd() { return admin_pwd; } public void setAdmin_pwd(String admin_pwd) { this.admin_pwd = admin_pwd; } }
2ae459d39eac191dceba9d016f38623bd9b7ed22
96ca02a85d3702729076cb59ff15d069dfa8232b
/advert/src/com/avit/dtmb/type/PloyType.java
5070f1fca3b29204f971835ea164e86e8d5e4754
[]
no_license
Hurson/mysql
4a1600d9f580ac086ff9472095ed6fa58fb11830
3db53442376485a310c76ad09d6cf71143f38274
refs/heads/master
2021-01-10T17:55:50.003989
2016-03-11T11:36:15
2016-03-11T11:36:15
54,877,514
0
1
null
null
null
null
UTF-8
Java
false
false
673
java
package com.avit.dtmb.type; public enum PloyType { Area("1","区域"), Time("2","时段"), ChanGroup("3","频道组"), AudGronp("4","广播频道组"), UserIndustry("5","行业"), UserLevel("6","级别"), UserTVNNO("7","TVN号"); private String key; private String value; private PloyType(String key, String value){ this.key = key; this.value = value; } public static String getValue(String key){ for(PloyType type : PloyType.values()){ if(type.key.equals(key)){ return type.value; } } return null; } public String getKey() { return key; } public String getValue() { return value; } }
[ "fushangsheng@d881c268-5c81-4d69-b6ac-ed4e9099e0f2" ]
fushangsheng@d881c268-5c81-4d69-b6ac-ed4e9099e0f2
5ba4b1fec95d17681a3aff4d5b7d5a9b44ebb249
e8d44fe32e1b36ef4c396684b147344095500bbb
/app/src/main/java/com/example/androidtask/ViewReportApi.java
6a19c4d488a1344673c5f57ddfa021d519cc78c9
[]
no_license
gowri2071996/shlok
5b9f56a538bd4d16370f22eb89c22f57b5743977
de63e692633b0a7b6acc8c5e2b52f8be04a125fe
refs/heads/master
2022-12-17T08:39:05.278025
2020-08-01T08:23:47
2020-08-01T08:23:47
284,218,649
0
0
null
null
null
null
UTF-8
Java
false
false
1,096
java
package com.example.androidtask; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; import retrofit2.Call; import retrofit2.http.GET; public interface ViewReportApi { @GET("get/cqRrpIGVVe?indent=2") Call<viewReport> viewReport(); public class viewReport { private String recordCount; private String GetInspectionsResult; public String getRecordCount () { return recordCount; } public void setRecordCount (String recordCount) { this.recordCount = recordCount; } public String getGetInspectionsResult () { return GetInspectionsResult; } public void setGetInspectionsResult (String GetInspectionsResult) { this.GetInspectionsResult = GetInspectionsResult; } @Override public String toString() { return "ClassPojo [recordCount = "+recordCount+", GetInspectionsResult = "+GetInspectionsResult+"]"; } } }
a575bd4ff615f6aed2e2d9956e44c879daa3b488
449cc92656d1f55bd7e58692657cd24792847353
/st-service/src/main/java/com/lj/business/st/dto/wxPmFollow/FindWxPmFollowReportGmPage.java
7f238f7bc387064d189977480a018075e727bc28
[]
no_license
cansou/HLM
f80ae1c71d0ce8ead95c00044a318796820a8c1e
69d859700bfc074b5948b6f2c11734ea2e030327
refs/heads/master
2022-08-27T16:40:17.206566
2019-12-18T06:48:10
2019-12-18T06:48:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,346
java
package com.lj.business.st.dto.wxPmFollow; import java.util.Date; import com.lj.base.core.pagination.PageParamEntity; public class FindWxPmFollowReportGmPage extends PageParamEntity { /** * */ private static final long serialVersionUID = -5906336118089412730L; /** * 商户编号 */ private String merchantNo; /** * 日报日期 */ private Date reportDate; /** * 经销商代码 */ private String dealerCode; /** * 经销商名称 */ private String companyName; /** * 门店代码 */ private String shopCode; /** * 门店名称 */ private String shopName; public String getMerchantNo() { return merchantNo; } public void setMerchantNo(String merchantNo) { this.merchantNo = merchantNo; } public Date getReportDate() { return reportDate; } public void setReportDate(Date reportDate) { this.reportDate = reportDate; } public String getDealerCode() { return dealerCode; } public void setDealerCode(String dealerCode) { this.dealerCode = dealerCode; } public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } public String getShopCode() { return shopCode; } public void setShopCode(String shopCode) { this.shopCode = shopCode; } public String getShopName() { return shopName; } public void setShopName(String shopName) { this.shopName = shopName; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("FindWxPmFollowReportGmPage [merchantNo="); builder.append(merchantNo); builder.append(", reportDate="); builder.append(reportDate); builder.append(", dealerCode="); builder.append(dealerCode); builder.append(", companyName="); builder.append(companyName); builder.append(", shopCode="); builder.append(shopCode); builder.append(", shopName="); builder.append(shopName); builder.append("]"); return builder.toString(); } }
8ed4add15c2bcee2a45d8c6a6e4e6d28df7deb46
59871dbcb53e6366a4290e16fbe474e66513c21a
/src/main/java/algs/StdStats.java
57ff63e3c0162feff142def3fefccefa1a5bdd88
[]
no_license
windwail/demo
585e6fe469dab5aa02cf74937d01646f6988bfc1
0f3a5be45f9abee5a658ca6a83154934d7480633
refs/heads/master
2021-07-11T14:16:29.967822
2019-09-17T12:14:40
2019-09-17T12:14:40
209,031,260
0
0
null
2020-10-13T16:06:28
2019-09-17T11:04:07
Java
UTF-8
Java
false
false
18,426
java
/****************************************************************************** * Compilation: javac StdStats.java * Execution: java StdStats < input.txt * Dependencies: StdOut.java * * Library of statistical functions. * * The test client reads an array of real numbers from standard * input, and computes the minimum, mean, maximum, and * standard deviation. * * The functions all throw a java.lang.IllegalArgumentException * if the array passed in as an argument is null. * * The floating-point functions all return NaN if any input is NaN. * * Unlike Math.min() and Math.max(), the min() and max() functions * do not differentiate between -0.0 and 0.0. * * % more tiny.txt * 5 * 3.0 1.0 2.0 5.0 4.0 * * % java StdStats < tiny.txt * min 1.000 * mean 3.000 * max 5.000 * std dev 1.581 * * Should these funtions use varargs instead of array arguments? * ******************************************************************************/ package algs; /** * The {@code StdStats} class provides static methods for computing * statistics such as min, max, mean, sample standard deviation, and * sample variance. * <p> * For additional documentation, see * <a href="https://introcs.cs.princeton.edu/22library">Section 2.2</a> of * <i>Computer Science: An Interdisciplinary Approach</i> * by Robert Sedgewick and Kevin Wayne. * * @author Robert Sedgewick * @author Kevin Wayne */ public final class StdStats { private StdStats() { } /** * Returns the maximum value in the specified array. * * @param a the array * @return the maximum value in the array {@code a[]}; * {@code Double.NEGATIVE_INFINITY} if no such value */ public static double max(double[] a) { validateNotNull(a); double max = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { if (Double.isNaN(a[i])) return Double.NaN; if (a[i] > max) max = a[i]; } return max; } /** * Returns the maximum value in the specified subarray. * * @param a the array * @param lo the left endpoint of the subarray (inclusive) * @param hi the right endpoint of the subarray (exclusive) * @return the maximum value in the subarray {@code a[lo..hi)}; * {@code Double.NEGATIVE_INFINITY} if no such value * @throws IllegalArgumentException if {@code a} is {@code null} * @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)} */ public static double max(double[] a, int lo, int hi) { validateNotNull(a); validateSubarrayIndices(lo, hi, a.length); double max = Double.NEGATIVE_INFINITY; for (int i = lo; i < hi; i++) { if (Double.isNaN(a[i])) return Double.NaN; if (a[i] > max) max = a[i]; } return max; } /** * Returns the maximum value in the specified array. * * @param a the array * @return the maximum value in the array {@code a[]}; * {@code Integer.MIN_VALUE} if no such value */ public static int max(int[] a) { validateNotNull(a); int max = Integer.MIN_VALUE; for (int i = 0; i < a.length; i++) { if (a[i] > max) max = a[i]; } return max; } /** * Returns the minimum value in the specified array. * * @param a the array * @return the minimum value in the array {@code a[]}; * {@code Double.POSITIVE_INFINITY} if no such value */ public static double min(double[] a) { validateNotNull(a); double min = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { if (Double.isNaN(a[i])) return Double.NaN; if (a[i] < min) min = a[i]; } return min; } /** * Returns the minimum value in the specified subarray. * * @param a the array * @param lo the left endpoint of the subarray (inclusive) * @param hi the right endpoint of the subarray (exclusive) * @return the maximum value in the subarray {@code a[lo..hi)}; * {@code Double.POSITIVE_INFINITY} if no such value * @throws IllegalArgumentException if {@code a} is {@code null} * @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)} */ public static double min(double[] a, int lo, int hi) { validateNotNull(a); validateSubarrayIndices(lo, hi, a.length); double min = Double.POSITIVE_INFINITY; for (int i = lo; i < hi; i++) { if (Double.isNaN(a[i])) return Double.NaN; if (a[i] < min) min = a[i]; } return min; } /** * Returns the minimum value in the specified array. * * @param a the array * @return the minimum value in the array {@code a[]}; * {@code Integer.MAX_VALUE} if no such value */ public static int min(int[] a) { validateNotNull(a); int min = Integer.MAX_VALUE; for (int i = 0; i < a.length; i++) { if (a[i] < min) min = a[i]; } return min; } /** * Returns the average value in the specified array. * * @param a the array * @return the average value in the array {@code a[]}; * {@code Double.NaN} if no such value */ public static double mean(double[] a) { validateNotNull(a); if (a.length == 0) return Double.NaN; double sum = sum(a); return sum / a.length; } /** * Returns the average value in the specified subarray. * * @param a the array * @param lo the left endpoint of the subarray (inclusive) * @param hi the right endpoint of the subarray (exclusive) * @return the average value in the subarray {@code a[lo..hi)}; * {@code Double.NaN} if no such value * @throws IllegalArgumentException if {@code a} is {@code null} * @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)} */ public static double mean(double[] a, int lo, int hi) { validateNotNull(a); validateSubarrayIndices(lo, hi, a.length); int length = hi - lo; if (length == 0) return Double.NaN; double sum = sum(a, lo, hi); return sum / length; } /** * Returns the average value in the specified array. * * @param a the array * @return the average value in the array {@code a[]}; * {@code Double.NaN} if no such value */ public static double mean(int[] a) { validateNotNull(a); if (a.length == 0) return Double.NaN; int sum = sum(a); return 1.0 * sum / a.length; } /** * Returns the sample variance in the specified array. * * @param a the array * @return the sample variance in the array {@code a[]}; * {@code Double.NaN} if no such value */ public static double var(double[] a) { validateNotNull(a); if (a.length == 0) return Double.NaN; double avg = mean(a); double sum = 0.0; for (int i = 0; i < a.length; i++) { sum += (a[i] - avg) * (a[i] - avg); } return sum / (a.length - 1); } /** * Returns the sample variance in the specified subarray. * * @param a the array * @param lo the left endpoint of the subarray (inclusive) * @param hi the right endpoint of the subarray (exclusive) * @return the sample variance in the subarray {@code a[lo..hi)}; * {@code Double.NaN} if no such value * @throws IllegalArgumentException if {@code a} is {@code null} * @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)} */ public static double var(double[] a, int lo, int hi) { validateNotNull(a); validateSubarrayIndices(lo, hi, a.length); int length = hi - lo; if (length == 0) return Double.NaN; double avg = mean(a, lo, hi); double sum = 0.0; for (int i = lo; i < hi; i++) { sum += (a[i] - avg) * (a[i] - avg); } return sum / (length - 1); } /** * Returns the sample variance in the specified array. * * @param a the array * @return the sample variance in the array {@code a[]}; * {@code Double.NaN} if no such value */ public static double var(int[] a) { validateNotNull(a); if (a.length == 0) return Double.NaN; double avg = mean(a); double sum = 0.0; for (int i = 0; i < a.length; i++) { sum += (a[i] - avg) * (a[i] - avg); } return sum / (a.length - 1); } /** * Returns the population variance in the specified array. * * @param a the array * @return the population variance in the array {@code a[]}; * {@code Double.NaN} if no such value */ public static double varp(double[] a) { validateNotNull(a); if (a.length == 0) return Double.NaN; double avg = mean(a); double sum = 0.0; for (int i = 0; i < a.length; i++) { sum += (a[i] - avg) * (a[i] - avg); } return sum / a.length; } /** * Returns the population variance in the specified subarray. * * @param a the array * @param lo the left endpoint of the subarray (inclusive) * @param hi the right endpoint of the subarray (exclusive) * @return the population variance in the subarray {@code a[lo..hi)}; * {@code Double.NaN} if no such value * @throws IllegalArgumentException if {@code a} is {@code null} * @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)} */ public static double varp(double[] a, int lo, int hi) { validateNotNull(a); validateSubarrayIndices(lo, hi, a.length); int length = hi - lo; if (length == 0) return Double.NaN; double avg = mean(a, lo, hi); double sum = 0.0; for (int i = lo; i < hi; i++) { sum += (a[i] - avg) * (a[i] - avg); } return sum / length; } /** * Returns the sample standard deviation in the specified array. * * @param a the array * @return the sample standard deviation in the array {@code a[]}; * {@code Double.NaN} if no such value */ public static double stddev(double[] a) { validateNotNull(a); return Math.sqrt(var(a)); } /** * Returns the sample standard deviation in the specified array. * * @param a the array * @return the sample standard deviation in the array {@code a[]}; * {@code Double.NaN} if no such value */ public static double stddev(int[] a) { validateNotNull(a); return Math.sqrt(var(a)); } /** * Returns the sample standard deviation in the specified subarray. * * @param a the array * @param lo the left endpoint of the subarray (inclusive) * @param hi the right endpoint of the subarray (exclusive) * @return the sample standard deviation in the subarray {@code a[lo..hi)}; * {@code Double.NaN} if no such value * @throws IllegalArgumentException if {@code a} is {@code null} * @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)} */ public static double stddev(double[] a, int lo, int hi) { validateNotNull(a); validateSubarrayIndices(lo, hi, a.length); return Math.sqrt(var(a, lo, hi)); } /** * Returns the population standard deviation in the specified array. * * @param a the array * @return the population standard deviation in the array; * {@code Double.NaN} if no such value */ public static double stddevp(double[] a) { validateNotNull(a); return Math.sqrt(varp(a)); } /** * Returns the population standard deviation in the specified subarray. * * @param a the array * @param lo the left endpoint of the subarray (inclusive) * @param hi the right endpoint of the subarray (exclusive) * @return the population standard deviation in the subarray {@code a[lo..hi)}; * {@code Double.NaN} if no such value * @throws IllegalArgumentException if {@code a} is {@code null} * @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)} */ public static double stddevp(double[] a, int lo, int hi) { validateNotNull(a); validateSubarrayIndices(lo, hi, a.length); return Math.sqrt(varp(a, lo, hi)); } /** * Returns the sum of all values in the specified array. * * @param a the array * @return the sum of all values in the array {@code a[]}; * {@code 0.0} if no such value */ private static double sum(double[] a) { validateNotNull(a); double sum = 0.0; for (int i = 0; i < a.length; i++) { sum += a[i]; } return sum; } /** * Returns the sum of all values in the specified subarray. * * @param a the array * @param lo the left endpoint of the subarray (inclusive) * @param hi the right endpoint of the subarray (exclusive) * @return the sum of all values in the subarray {@code a[lo..hi)}; * {@code 0.0} if no such value * @throws IllegalArgumentException if {@code a} is {@code null} * @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)} */ private static double sum(double[] a, int lo, int hi) { validateNotNull(a); validateSubarrayIndices(lo, hi, a.length); double sum = 0.0; for (int i = lo; i < hi; i++) { sum += a[i]; } return sum; } /** * Returns the sum of all values in the specified array. * * @param a the array * @return the sum of all values in the array {@code a[]}; * {@code 0.0} if no such value */ private static int sum(int[] a) { validateNotNull(a); int sum = 0; for (int i = 0; i < a.length; i++) { sum += a[i]; } return sum; } /** * Plots the points (0, <em>a</em><sub>0</sub>), (1, <em>a</em><sub>1</sub>), ..., * (<em>n</em>-1, <em>a</em><sub><em>n</em>-1</sub>) to standard draw. * * @param a the array of values */ public static void plotPoints(double[] a) { validateNotNull(a); int n = a.length; StdDraw.setXscale(-1, n); StdDraw.setPenRadius(1.0 / (3.0 * n)); for (int i = 0; i < n; i++) { StdDraw.point(i, a[i]); } } /** * Plots the line segments connecting * (<em>i</em>, <em>a</em><sub><em>i</em></sub>) to * (<em>i</em>+1, <em>a</em><sub><em>i</em>+1</sub>) for * each <em>i</em> to standard draw. * * @param a the array of values */ public static void plotLines(double[] a) { validateNotNull(a); int n = a.length; StdDraw.setXscale(-1, n); StdDraw.setPenRadius(); for (int i = 1; i < n; i++) { StdDraw.line(i-1, a[i-1], i, a[i]); } } /** * Plots bars from (0, <em>a</em><sub><em>i</em></sub>) to * (<em>a</em><sub><em>i</em></sub>) for each <em>i</em> * to standard draw. * * @param a the array of values */ public static void plotBars(double[] a) { validateNotNull(a); int n = a.length; StdDraw.setXscale(-1, n); for (int i = 0; i < n; i++) { StdDraw.filledRectangle(i, a[i]/2, 0.25, a[i]/2); } } // throw an IllegalArgumentException if x is null // (x is either of type double[] or int[]) private static void validateNotNull(Object x) { if (x == null) throw new IllegalArgumentException("argument is null"); } // throw an exception unless 0 <= lo <= hi <= length private static void validateSubarrayIndices(int lo, int hi, int length) { if (lo < 0 || hi > length || lo > hi) throw new IllegalArgumentException("subarray indices out of bounds: [" + lo + ", " + hi + ")"); } /** * Unit tests {@code StdStats}. * Convert command-line arguments to array of doubles and call various methods. * * @param args the command-line arguments */ public static void main(String[] args) { double[] a = StdArrayIO.readDouble1D(); StdOut.printf(" min %10.3f\n", min(a)); StdOut.printf(" mean %10.3f\n", mean(a)); StdOut.printf(" max %10.3f\n", max(a)); StdOut.printf(" stddev %10.3f\n", stddev(a)); StdOut.printf(" var %10.3f\n", var(a)); StdOut.printf(" stddevp %10.3f\n", stddevp(a)); StdOut.printf(" varp %10.3f\n", varp(a)); } } /****************************************************************************** * Copyright 2002-2018, Robert Sedgewick and Kevin Wayne. * * This file is part of algs4.jar, which accompanies the textbook * * Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, * Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. * http://algs4.cs.princeton.edu * * * algs4.jar is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * algs4.jar is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with algs4.jar. If not, see http://www.gnu.org/licenses. ******************************************************************************/
822d1c712c85024b81fbce3bd6e416401e76f8c6
b57e2c7d2a586581ae2e87ed7b69f80200e1cfa8
/tuikit/src/main/java/com/tencent/qcloud/uikit/common/component/datepicker/configure/PickerOptions.java
24934b8cf139288b9a424233077aaa0d0c62d46a
[]
no_license
q57690633/SCommunication
7e90c244434666345067b8bf154d5f8289fdced9
345163e39fb85dcb5e99099a99c60d354fc923a3
refs/heads/master
2020-04-23T15:52:54.559082
2019-03-18T18:46:58
2019-03-18T18:46:58
171,279,419
1
0
null
null
null
null
UTF-8
Java
false
false
4,536
java
package com.tencent.qcloud.uikit.common.component.datepicker.configure; import android.content.Context; import android.graphics.Typeface; import android.view.Gravity; import android.view.ViewGroup; import com.tencent.qcloud.uikit.R; import com.tencent.qcloud.uikit.common.component.datepicker.listener.CustomListener; import com.tencent.qcloud.uikit.common.component.datepicker.listener.OnOptionsSelectChangeListener; import com.tencent.qcloud.uikit.common.component.datepicker.listener.OnOptionsSelectListener; import com.tencent.qcloud.uikit.common.component.datepicker.listener.OnTimeSelectChangeListener; import com.tencent.qcloud.uikit.common.component.datepicker.listener.OnTimeSelectListener; import com.tencent.qcloud.uikit.common.component.datepicker.view.WheelView; import java.util.Calendar; public class PickerOptions { //常量 private static final int PICKER_VIEW_BTN_COLOR_NORMAL = 0xFF057dff; private static final int PICKER_VIEW_BG_COLOR_TITLE = 0xFFf5f5f5; private static final int PICKER_VIEW_COLOR_TITLE = 0xFF000000; private static final int PICKER_VIEW_BG_COLOR_DEFAULT = 0xFFFFFFFF; public static final int TYPE_PICKER_OPTIONS = 1; public static final int TYPE_PICKER_TIME = 2; public OnOptionsSelectListener optionsSelectListener; public OnTimeSelectListener timeSelectListener; public OnTimeSelectChangeListener timeSelectChangeListener; public OnOptionsSelectChangeListener optionsSelectChangeListener; public CustomListener customListener; //options picker public String label1, label2, label3;//单位字符 public int option1, option2, option3;//默认选中项 public int x_offset_one, x_offset_two, x_offset_three;//x轴偏移量 public boolean cyclic1 = false;//是否循环,默认否 public boolean cyclic2 = false; public boolean cyclic3 = false; public boolean isRestoreItem = false; //切换时,还原第一项 //time picker public boolean[] type = new boolean[]{true, true, true, false, false, false};//显示类型,默认显示: 年月日 public Calendar date;//当前选中时间 public Calendar startDate;//开始时间 public Calendar endDate;//终止时间 public int startYear;//开始年份 public int endYear;//结尾年份 public boolean cyclic = false;//是否循环 public boolean isLunarCalendar = false;//是否显示农历 public String label_year, label_month, label_day, label_hours, label_minutes, label_seconds;//单位 public int x_offset_year, x_offset_month, x_offset_day, x_offset_hours, x_offset_minutes, x_offset_seconds;//单位 public PickerOptions(int buildType) { if (buildType == TYPE_PICKER_OPTIONS) { layoutRes = R.layout.pickerview_options; } else { layoutRes = R.layout.pickerview_time; } } //******* 公有字段 ******// public int layoutRes; public ViewGroup decorView; public int textGravity = Gravity.CENTER; public Context context; public String textContentConfirm;//确定按钮文字 public String textContentCancel;//取消按钮文字 public String textContentTitle;//标题文字 public int textColorConfirm = PICKER_VIEW_BTN_COLOR_NORMAL;//确定按钮颜色 public int textColorCancel = PICKER_VIEW_BTN_COLOR_NORMAL;//取消按钮颜色 public int textColorTitle = PICKER_VIEW_COLOR_TITLE;//标题颜色 public int bgColorWheel = PICKER_VIEW_BG_COLOR_DEFAULT;//滚轮背景颜色 public int bgColorTitle = PICKER_VIEW_BG_COLOR_TITLE;//标题背景颜色 public int textSizeSubmitCancel = 17;//确定取消按钮大小 public int textSizeTitle = 18;//标题文字大小 public int textSizeContent = 18;//内容文字大小 public int textColorOut = 0xFFa8a8a8; //分割线以外的文字颜色 public int textColorCenter = 0xFF2a2a2a; //分割线之间的文字颜色 public int dividerColor = 0xFFd5d5d5; //分割线的颜色 public int backgroundId = -1; //显示时的外部背景色颜色,默认是灰色 public float lineSpacingMultiplier = 1.6f; // 条目间距倍数 默认1.6 public boolean isDialog;//是否是对话框模式 public boolean cancelable = true;//是否能取消 public boolean isCenterLabel = false;//是否只显示中间的label,默认每个item都显示 public Typeface font = Typeface.MONOSPACE;//字体样式 public WheelView.DividerType dividerType = WheelView.DividerType.FILL;//分隔线类型 }
9f05011c0dd482e7aa09e1ccd0b83815d6d46a69
5ef0fe9a11b5e943ea9cf3e57b660b6f4c89c521
/src/library/assistant/ui/login/LoginController.java
c759c56e755a86cd858afa24b896261dcd23cd1e
[]
no_license
RouaBoussetta/Library
f54ce9bbf269cb9e3002fea017619aea986fbf81
6e98101fc0be0b7cdb658aacf874e6585c49b05b
refs/heads/main
2023-01-11T19:06:26.403120
2020-11-12T22:13:46
2020-11-12T22:13:46
312,218,039
2
0
null
null
null
null
UTF-8
Java
false
false
6,264
java
package library.assistant.ui.login; import Utils.DataBase; import com.jfoenix.controls.JFXPasswordField; import com.jfoenix.controls.JFXTextField; import java.io.IOException; import java.net.URL; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ResourceBundle; import java.util.regex.Matcher; import java.util.regex.Pattern; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.input.MouseEvent; import javafx.stage.Stage; import javafx.stage.StageStyle; import javax.swing.JOptionPane; import library.assistant.data.model.User; import library.assistant.util.LibraryAssistantUtil; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class LoginController implements Initializable { private final static Logger LOGGER = LogManager.getLogger(LoginController.class.getName()); private static LoginController instance; Connection connection = null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; private User loggedUser; @FXML private javafx.scene.control.Label error; @FXML private JFXTextField userMail; @FXML private JFXPasswordField userPassword; @FXML private javafx.scene.control.Label register; public LoginController() throws IOException { connection = DataBase.getInstance().getConnection(); } public static LoginController getInstance() { return instance; } public User getLoggedUser() { return loggedUser; } @Override public void initialize(URL url, ResourceBundle rb) { } public boolean mailandpasswordValidate() { String regex = "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(userMail.getText()); if (userPassword.getText().length() < 8) { error.setText("*password length < 8 "); } if (matcher.matches()) { error.setText(""); return true; } else { error.setText("*mail not valid"); return false; } } @FXML private void handleLoginButtonAction(ActionEvent event) { String email = userMail.getText(); String password = userPassword.getText(); mailandpasswordValidate(); if (mailandpasswordValidate()) { String sql = "SELECT * FROM admin WHERE usermail = ? and userpassword = ?;"; try { preparedStatement = connection.prepareStatement(sql); preparedStatement.setString(1, email); preparedStatement.setString(2, password); resultSet = preparedStatement.executeQuery(); if (!resultSet.next()) { error.setText("failed please verifiy your email or password"); } else { User user = new User(); user.setId(resultSet.getInt("id")); error.setText(""); closeStage(); loadMain(); LOGGER.log(Level.INFO, "admin successfully logged in {}", email); } } catch (Exception e) { e.printStackTrace(); } } else { userMail.getStyleClass().add("wrong-credentials"); userPassword.getStyleClass().add("wrong-credentials"); } } @FXML private void handleCancelButtonAction(ActionEvent event) { System.exit(0); } private void closeStage() { ((Stage) userMail.getScene().getWindow()).close(); } /* public void changeScenex(ActionEvent actionEvent) throws IOException { Node node = (Node) actionEvent.getSource(); Stage dialogStage = (Stage) node.getScene().getWindow(); Scene scene = new Scene(FXMLLoader.load(getClass().getResource("/GUI/REGISTER.fxml"))); dialogStage.setScene(scene); dialogStage.show(); } public void resetPage(MouseEvent actionEvent) throws IOException { Parent root = FXMLLoader.load(getClass().getResource("/GUI/resetMail.fxml")); Scene scene = loginButton.getScene(); root.translateXProperty().set(scene.getWidth()); Pane parentContainer = (Pane) scene.getRoot(); parentContainer.getChildren().add(root); Timeline timeline = new Timeline(); KeyValue kv = new KeyValue(root.translateXProperty(), 0, Interpolator.EASE_IN); KeyFrame kf = new KeyFrame(Duration.seconds(1), kv); timeline.getKeyFrames().add(kf); timeline.setOnFinished(event1 -> { parentContainer.getChildren().remove(container); }); timeline.play(); } */ private void infoBox(String infoMessage, String titleBar) { JOptionPane.showMessageDialog(null, infoMessage, "InfoBox: " + titleBar, JOptionPane.INFORMATION_MESSAGE); } void loadMain() { try { Parent parent = FXMLLoader.load(getClass().getResource("/library/assistant/ui/main/main.fxml")); Stage stage = new Stage(StageStyle.DECORATED); stage.setTitle("Library Assistant"); stage.setScene(new Scene(parent)); stage.show(); LibraryAssistantUtil.setStageIcon(stage); } catch (IOException ex) { LOGGER.log(Level.ERROR, "{}", ex); } } void loadRegister() { try { Parent parent = FXMLLoader.load(getClass().getResource("/library/assistant/ui/register/register.fxml")); Stage stage = new Stage(StageStyle.DECORATED); stage.setTitle("Register"); stage.setScene(new Scene(parent)); stage.show(); LibraryAssistantUtil.setStageIcon(stage); } catch (IOException ex) { LOGGER.log(Level.ERROR, "{}", ex); } } @FXML private void createAccountAction(MouseEvent event) { closeStage(); loadRegister(); } }
10531d7764af9653d43c01cbdfc09b94eba01760
f6d0787b6794373ae8bbf0f8b5e5765717170309
/Unidad_5/5.2/app/src/main/java/mx/edu/ittepic/u5_acelerometro/MainActivity.java
57c1aafa6eb67963509832b38c6bc207bf6bf643
[]
no_license
nathanaepalomera/moviles_repositorio
e98d0e27c4f52936495659e1dd6439874f68efed
680fe594747d28191fb58c2c35e886c15e1f5b61
refs/heads/master
2020-05-31T13:39:09.565855
2019-06-05T03:07:50
2019-06-05T03:07:50
190,310,746
0
0
null
null
null
null
UTF-8
Java
false
false
1,547
java
package mx.edu.ittepic.u5_acelerometro; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends AppCompatActivity implements SensorEventListener { TextView ejex; private Sensor mysensor; private SensorManager senman; public MainActivity() { super(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); senman = (SensorManager) getSystemService(SENSOR_SERVICE); mysensor=senman.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); ejex = findViewById(R.id.ejex); } @Override public void onSensorChanged(SensorEvent event) { float x,y,z; x = event.values[0]; y= event.values[1]; z = event.values[2]; ejex.setText(" "); ejex.append("\n"+"VALOR DE x: "+ x +"\n"+ "VALOR DE Y: "+ y +"\n"+"VALOR DE Z: "+ z); } @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } @Override protected void onResume (){ super.onResume(); senman.registerListener(this,mysensor, SensorManager.SENSOR_DELAY_NORMAL ); } @Override protected void onPause (){ super.onPause(); senman.unregisterListener(this); } }
e49f79de236cd5ad518052e12f33b96d2edb2fca
cc57a45b57ec4ee55c240b9e4ff64765718d75f4
/Swea/src/P9999광고/Solution.java
43f66a716b1b131c4817bda6e423dea7ecfc77d4
[]
no_license
saintbeller96/Algorithm-Practice
d30bc35086561d5676c72c99ec557d9ab95de762
ad7e6cb5e3c8d9840f55ab927cb13dde6ed706dc
refs/heads/master
2023-07-09T14:30:54.909082
2021-08-16T14:52:35
2021-08-16T14:52:35
350,347,032
0
0
null
null
null
null
UTF-8
Java
false
false
785
java
package P9999광고; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Solution { private static int T, N; private static long L; private static int[] ad; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer stk = null; T = Integer.parseInt(br.readLine()); for (int t = 1; t <= T; t++) { stk = new StringTokenizer(br.readLine()); L = Long.parseLong(stk.nextToken()); N = Integer.parseInt(stk.nextToken()); for(int i = 0; i<N; i++) { stk = new StringTokenizer(br.readLine()); int s = Integer.parseInt(stk.nextToken()); int e = Integer.parseInt(stk.nextToken()); } } } }
8c06109bf57de293d3e41615ba09f8ecc30cd0b3
c2ba646cb476ae4c177bed4642eebb2c7a29c0f3
/src/IBit/DuplicatesInArray.java
76c36cd72ba496cfa097b608d8a709cd8ce5d330
[]
no_license
khowal2502/PractCodes
7cbdd588303b7ed1283f090e7b56a9d0991c6f2c
eda40650dd42cc734b86e5263b6bc88552111355
refs/heads/master
2021-01-20T07:32:04.951638
2017-05-02T09:21:01
2017-05-02T09:21:01
90,010,409
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package IBit; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class DuplicatesInArray { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); ArrayList<Integer> ret = new ArrayList<Integer>(); for(int j=0;j<n;j++){ ret.add(scan.nextInt()); } System.out.println(repeatedNumber(ret)); scan.close(); } public static int repeatedNumber(final List<Integer> a) { int rep = -1; int n = a.size(); boolean arr[] = new boolean[n]; Arrays.fill(arr, false); for(int i=0;i<n;++i){ if(!arr[a.get(i)-1]){ arr[a.get(i)-1] = true; }else{ rep = a.get(i); break; } } return rep; } }
590e51f9377bc8391d0c99d0f759fd75583a96e8
3334bee9484db954c4508ad507f6de0d154a939f
/d3n/java-src/tombola-service-api/src/main/java/de/ascendro/f4m/service/tombola/TombolaMessageTypes.java
251ab54cf4bbc26e4399ffd5eac47de1eac74b9e
[]
no_license
VUAN86/d3n
c2fc46fc1f188d08fa6862e33cac56762e006f71
e5d6ac654821f89b7f4f653e2aaef3de7c621f8b
refs/heads/master
2020-05-07T19:25:43.926090
2019-04-12T07:25:55
2019-04-12T07:25:55
180,806,736
0
1
null
null
null
null
UTF-8
Java
false
false
1,073
java
package de.ascendro.f4m.service.tombola; import de.ascendro.f4m.service.json.model.type.MessageType; public enum TombolaMessageTypes implements MessageType { TOMBOLA_GET, TOMBOLA_GET_RESPONSE, TOMBOLA_LIST, TOMBOLA_LIST_RESPONSE, TOMBOLA_BUY, TOMBOLA_BUY_RESPONSE, TOMBOLA_DRAWING_GET, TOMBOLA_DRAWING_GET_RESPONSE, TOMBOLA_DRAWING_LIST, TOMBOLA_DRAWING_LIST_RESPONSE, USER_TOMBOLA_LIST, USER_TOMBOLA_LIST_RESPONSE, USER_TOMBOLA_GET, USER_TOMBOLA_GET_RESPONSE, TOMBOLA_WINNER_LIST, TOMBOLA_WINNER_LIST_RESPONSE, MOVE_TOMBOLAS, MOVE_TOMBOLAS_RESPONSE, TOMBOLA_BUYER_LIST, TOMBOLA_BUYER_LIST_RESPONSE, TOMBOLA_OPEN_CHECKOUT, TOMBOLA_OPEN_CHECKOUT_RESPONSE, TOMBOLA_CLOSE_CHECKOUT, TOMBOLA_CLOSE_CHECKOUT_RESPONSE, TOMBOLA_DRAW, TOMBOLA_DRAW_RESPONSE; public static final String SERVICE_NAME = "tombola"; @Override public String getShortName() { return convertEnumNameToMessageShortName(name()); } @Override public String getNamespace() { return SERVICE_NAME; } }
608e643e1166b0638011de496efe8f00e637900a
f8fab0f1b02f02541799327b009466cb167bd4d7
/app/src/androidTest/java/com/teicm/fiveandone/MapsActivityTest.java
0a3b6c873c2dae20e46ef7ede49da8b02bee92f0
[]
no_license
Touloumis/FiveAndOne
a6836046b0283f1c6ca91dbbb4430566b5dca492
1399a49fca444b6966c9fcb73f165a80c63e50e8
refs/heads/master
2021-01-12T10:56:29.552742
2016-12-21T17:12:24
2016-12-21T17:12:24
72,762,624
0
18
null
2017-01-05T21:33:01
2016-11-03T16:04:36
Java
UTF-8
Java
false
false
1,733
java
package com.teicm.fiveandone; import android.test.ActivityInstrumentationTestCase2; import android.widget.Button; import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.Marker; public class MapsActivityTest extends ActivityInstrumentationTestCase2 <MapsActivity> { MapsActivity cMain; GoogleMap tmMap; TextView tWelcome; TextView tInfo; Button tNext; Button tBonus; Marker tmSerres; Marker tmThessaloniki; Marker tmEdessa; Marker tmLarissa; Marker tmVolos; Marker tmAthens; public MapsActivityTest (Class <MapsActivity> activityClass){ super(activityClass); } public MapsActivityTest(String name) { super(MapsActivity.class); setName(name); } protected void setUp() throws Exception { super.setUp(); cMain=getActivity(); tInfo = (TextView) cMain.findViewById(R.id.info); tWelcome = (TextView) cMain.findViewById(R.id.welcome); tNext = (Button) cMain.findViewById(R.id.next); //tBonus = (Button) cMain.findViewById(R.id.Bonus); setActivityInitialTouchMode(true); } //Check if activity was created public final void testPreconditions(){ assertNotNull("Test If the Activity was Created",cMain); } //Check if edit text was created public final void testTextView(){ assertNotNull(tInfo); assertNotNull(tWelcome); } //Check if button was created public final void testButton(){ assertNotNull(tNext); } }
9d81377d6e41c1295f768755e2f694302ebe1a66
a0cf8ed1e6f806bc9c6d969f3ab2947a0ddbdfce
/MSG/.svn/pristine/2f/2fa39e51104f132f544f8f51a1c33be70e2ec1b4.svn-base
742cba6a3f6afd908b17326302d2406915c7a47c
[]
no_license
misunyu/Mujava-Clustering
35aa8480de81e6c2351ba860fc59c090b007d096
026192effef89f428dc279d76e2d8188bee86a96
refs/heads/master
2020-03-11T12:15:49.074291
2018-05-08T00:12:53
2018-05-08T00:12:53
129,992,561
0
0
null
null
null
null
UTF-8
Java
false
false
3,856
package MSG.traditional; import MSG.MSGConstraints; import MSG.MutantMonitor; public class AOISMetaMutant { public static double AOIS(double originalAfter) { int op = MutantMonitor.subID; double mutantValue = 0; if (op == MSGConstraints.U_PRE_INCREMENT) mutantValue = originalAfter; else if (op == MSGConstraints.U_PRE_DECREMENT) mutantValue = originalAfter; else if (op == MSGConstraints.U_POST_INCREMENT) mutantValue = originalAfter - 1; else if (op == MSGConstraints.U_POST_DECREMENT) mutantValue = originalAfter + 1; return mutantValue; } public static float AOIS(float originalAfter) { int op = MutantMonitor.subID; float mutantValue = 0; if (op == MSGConstraints.U_PRE_INCREMENT) mutantValue = originalAfter; else if (op == MSGConstraints.U_PRE_DECREMENT) mutantValue = originalAfter; else if (op == MSGConstraints.U_POST_INCREMENT) mutantValue = originalAfter - 1; else if (op == MSGConstraints.U_POST_DECREMENT) mutantValue = originalAfter + 1; return mutantValue; } public static int AOIS(int originalAfter) { int op = MutantMonitor.subID; int mutantValue = 0; if (op == MSGConstraints.U_PRE_INCREMENT) mutantValue = originalAfter; else if (op == MSGConstraints.U_PRE_DECREMENT) mutantValue = originalAfter; else if (op == MSGConstraints.U_POST_INCREMENT) mutantValue = originalAfter - 1; else if (op == MSGConstraints.U_POST_DECREMENT) mutantValue = originalAfter + 1; return mutantValue; } public static long AOIS(long originalAfter) { int op = MutantMonitor.subID; long mutantValue = 0; if (op == MSGConstraints.U_PRE_INCREMENT) mutantValue = originalAfter; else if (op == MSGConstraints.U_PRE_DECREMENT) mutantValue = originalAfter; else if (op == MSGConstraints.U_POST_INCREMENT) mutantValue = originalAfter - 1; else if (op == MSGConstraints.U_POST_DECREMENT) mutantValue = originalAfter + 1; return mutantValue; } public static double AOISValue(double original) { int op = MutantMonitor.subID; double returnValue = original; if (MSGConstraints.U_PRE_INCREMENT == op) { returnValue = original + 1; } else if (MSGConstraints.U_PRE_DECREMENT == op) { returnValue = original - 1; } else if (MSGConstraints.U_POST_INCREMENT == op) { returnValue = original + 1; } else if (MSGConstraints.U_POST_DECREMENT == op) { returnValue = original - 1; } return returnValue; } public static float AOISValue(float original) { int op = MutantMonitor.subID; float returnValue = original; if (MSGConstraints.U_PRE_INCREMENT == op) { returnValue = original + 1; } else if (MSGConstraints.U_PRE_DECREMENT == op) { returnValue = original - 1; } else if (MSGConstraints.U_POST_INCREMENT == op) { returnValue = original + 1; } else if (MSGConstraints.U_POST_DECREMENT == op) { returnValue = original - 1; } return returnValue; } public static int AOISValue(int original) { int op = MutantMonitor.subID; int returnValue = original; if (MSGConstraints.U_PRE_INCREMENT == op) { returnValue = original + 1; } else if (MSGConstraints.U_PRE_DECREMENT == op) { returnValue = original - 1; } else if (MSGConstraints.U_POST_INCREMENT == op) { returnValue = original + 1; } else if (MSGConstraints.U_POST_DECREMENT == op) { returnValue = original - 1; } return returnValue; } public static long AOISValue(long original) { int op = MutantMonitor.subID; long returnValue = original; if (MSGConstraints.U_PRE_INCREMENT == op) { returnValue = original + 1; } else if (MSGConstraints.U_PRE_DECREMENT == op) { returnValue = original - 1; } else if (MSGConstraints.U_POST_INCREMENT == op) { returnValue = original + 1; } else if (MSGConstraints.U_POST_DECREMENT == op) { returnValue = original - 1; } return returnValue; } }
6c2be12b9c3efb23d210d2d521d0c0ee792cbcdf
8b49a2a046fa59952290913407e100b2548312b0
/src/prueba/Grupo.java
df18493b2b8f846fa7c1fe5e342edff7ddc6deba
[]
no_license
sbritocorral/dbMigration
2a01c2a055e737d3b6695cd25f98c2dfffc44a9a
8e42aa57833e134ded4b57c665b6b5cc91543125
refs/heads/master
2021-06-12T14:35:42.658114
2017-03-20T15:21:11
2017-03-20T15:21:11
85,494,124
0
0
null
null
null
null
UTF-8
Java
false
false
1,495
java
package prueba; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; public class Grupo implements Queryable{ private String tabla = "grupos"; private String codigo; private String descripcion; public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public String getTabla() { return tabla; } public void setTabla(String tabla) { this.tabla = tabla; } @Override public String toString() { return "Grupo [codigo=" + codigo + ", descripcion=" + descripcion + "]"; } @Override public Object toQuery(String dbType, Connection con) { String query = null; query = "INSERT INTO grupos (codigo, descripcion) values (?,?)"; try { PreparedStatement statement = con.prepareStatement(query); statement.setString(1, this.codigo); statement.setString(2, this.descripcion); return statement; } catch (SQLException e) { e.printStackTrace(); } return query; } @Override public Object beforeInsert(String dbType, Connection con) { PreparedStatement stmt = null; try { String sql = "DELETE from grupos ;"; stmt = con.prepareStatement(sql); } catch (SQLException e1) { e1.printStackTrace(); } return stmt; } }
97e03902bc98b0532e411709117c4ae6af5dbd2c
75552b1008626911a8aae3a6bc66851620334cfe
/bookstore-angular/src/main/java/com/bookstore/utility/SecurityUtility.java
222098cc76f25baec4fa95d5f2e09b53f0212587
[]
no_license
sanjayakoju/BookStore
6e61ab98b9bf2144aa2bb579c1be1c9b047207f2
d15e08bf5a8b6f74069350433264a92e391c65da
refs/heads/master
2023-01-23T23:28:16.438014
2020-11-19T04:11:13
2020-11-19T04:11:13
269,624,893
0
0
null
null
null
null
UTF-8
Java
false
false
916
java
package com.bookstore.utility; import java.security.SecureRandom; import java.util.Random; import org.springframework.context.annotation.Bean; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Component; @Component public class SecurityUtility { private static final String SALT="salt"; //Salt should be protected carefully @Bean public static BCryptPasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(12, new SecureRandom(SALT.getBytes())); } @Bean public static String randomPasswor() { String SALTCHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; StringBuilder salt=new StringBuilder(); Random random=new Random(); while(salt.length()<18) { int index=(int) (random.nextFloat() * SALTCHARS.length()); salt.append(SALTCHARS.charAt(index)); } String saltStr=salt.toString(); return saltStr; } }
ed6ff4cd2e472803405443e0a1f3c0c5445cc7f2
108fc241b848c37f23fcf4ad6da4ff353ec93da9
/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/mh/org/apache/jsp/WEB_002dINF/views/user/customercenter/customercenter_jsp.java
4e42cad69b5c831923be6c147c46a125e910c39d
[]
no_license
ks008j/markethurryserver
f649a51aa0997cc2f3c5fbe20a8a0af284977346
d68b895ea249d1232375c5f36b7009de89977af8
refs/heads/master
2022-12-16T02:20:37.743878
2020-09-04T06:12:59
2020-09-04T06:12:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
41,691
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/8.5.56 * Generated at: 2020-08-28 05:06:55 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp.WEB_002dINF.views.user.customercenter; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class customercenter_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent, org.apache.jasper.runtime.JspSourceImports { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; static { _jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(6); _jspx_dependants.put("/WEB-INF/views/inc/asset.jsp", Long.valueOf(1598578656569L)); _jspx_dependants.put("jar:file:/C:/Users/user/Documents/GitHub/markethurryserver/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/mhserver/WEB-INF/lib/jstl-1.2.jar!/META-INF/c.tld", Long.valueOf(1153352682000L)); _jspx_dependants.put("/WEB-INF/views/inc/header.jsp", Long.valueOf(1598584311639L)); _jspx_dependants.put("/WEB-INF/views/inc/footer.jsp", Long.valueOf(1598584618104L)); _jspx_dependants.put("/WEB-INF/lib/jstl-1.2.jar", Long.valueOf(1598578656497L)); _jspx_dependants.put("/WEB-INF/views/inc/cs_menu.jsp", Long.valueOf(1598578656569L)); } private static final java.util.Set<java.lang.String> _jspx_imports_packages; private static final java.util.Set<java.lang.String> _jspx_imports_classes; static { _jspx_imports_packages = new java.util.HashSet<>(); _jspx_imports_packages.add("javax.servlet"); _jspx_imports_packages.add("javax.servlet.http"); _jspx_imports_packages.add("javax.servlet.jsp"); _jspx_imports_classes = null; } private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest; private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems; private volatile javax.el.ExpressionFactory _el_expressionfactory; private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public java.util.Set<java.lang.String> getPackageImports() { return _jspx_imports_packages; } public java.util.Set<java.lang.String> getClassImports() { return _jspx_imports_classes; } public javax.el.ExpressionFactory _jsp_getExpressionFactory() { if (_el_expressionfactory == null) { synchronized (this) { if (_el_expressionfactory == null) { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); } } } return _el_expressionfactory; } public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() { if (_jsp_instancemanager == null) { synchronized (this) { if (_jsp_instancemanager == null) { _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } } } return _jsp_instancemanager; } public void _jspInit() { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); } public void _jspDestroy() { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release(); _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.release(); } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final java.lang.String _jspx_method = request.getMethod(); if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) { response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSP들은 오직 GET, POST 또는 HEAD 메소드만을 허용합니다. Jasper는 OPTIONS 메소드 또한 허용합니다."); return; } final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\r\n"); out.write("<!DOCTYPE html>\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write("<meta charset=\"UTF-8\">\r\n"); out.write("<title>Insert title here</title>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\t\r\n"); out.write("<!-- Bootstrap -->\r\n"); out.write("<link rel=\"stylesheet\" href=\"/mh/css/bootstrap.css\">\r\n"); out.write("<link rel=\"stylesheet\" href=\"/mh/css/markethurry.css\">\r\n"); out.write("<script src=\"/mh/js/jquery-1.12.4.js\"></script>\r\n"); out.write("<script src=\"/mh/js/bootstrap.js\"></script>\r\n"); out.write("<script src=\"/mh/js/Backstretch.js\"></script>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<!-- hiding menu -->\r\n"); out.write("<div id=\"menubartp\">\r\n"); out.write("\r\n"); out.write("\t<a href=\"#!\">전체 카테고리</a> \r\n"); out.write("\t<a href=\"/mh/user/product/hotproduct.do\" class=\"hyperlink\">HOT 상품</a> \r\n"); out.write("\t<a href=\"/mh/user/product/cheapproduct.do\" class=\"hyperlink\">알뜰 상품</a>\r\n"); out.write("\t<a href=\"/mh/user/myrecipe/myrecipelist.do\" class=\"hyperlink\">나만의 레시피</a> \r\n"); out.write("\t<a href=\"/mh/user/event/event.do\" class=\"hyperlink\">이달의 이벤트</a> \r\n"); out.write("\t<input type=\"text\" id=\"searchbox\" value=\"검색내용을 입력해주세요.\" autocomplete=\"off\"> \r\n"); out.write("\t<span class=\"glyphicon glyphicon-search\" id=\"searchimg\"></span> \r\n"); out.write("\t<a href=\"/mh/user/product/shoppingbasket.do\" id=\"shoppingbox\"></a>\r\n"); out.write("\t<div id=\"detailmenutp\">\r\n"); out.write("\t\t<ul style=\"list-style: none;\" id=\"detailul\" style=\"z-index:-1;\">\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=0';\">채소</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=1';\">과일</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=2';\">육류</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=3';\">수산</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=4';\">가공식품</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=5';\">양념, 소스</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=6';\">유제품</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=7';\">건강 식품</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=8';\">음료</li>\r\n"); out.write("\t\t</ul>\r\n"); out.write("\t</div>\r\n"); out.write("</div>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<!-- user menu (register, login , as) -->\r\n"); out.write("<div id=\"noticebar\">\r\n"); out.write("\t<div id=\"noticeMent\">\r\n"); out.write("\t\t<span class=\"eachNotice\">[마켓허리] \"허리라이프-어디든 간다! 마켓멀리! 신선하지 않은 신선MD의 신선한 장미를 찾아서\" 댓글이벤트 당첨 결과</span> \r\n"); out.write("\t\t<span class=\"eachNotice\">[마켓허리] 유튜브 ‘컬리라이프-일할 때도 쉴 때도 먹어야 한다, 극한직업 컬리 MD편’ 댓글 이벤트 당첨 공지</span> \r\n"); out.write("\t\t<span class=\"eachNotice\">[마켓허리] 코로나19 확진자 관련 현황 및 대응조치 안내</span> \r\n"); out.write("\t\t<span class=\"eachNotice\">[가격인상공지] [모어댄프레쉬] 맥돈 삼겹살 구이용 300g 외 23건 (2020 5. 20 ~)</span> \r\n"); out.write("\t\t<span class=\"eachNotice\">[마켓허리] 개인정보처리방침 개정 내용 사전안내</span>\r\n"); out.write("\t</div>\r\n"); out.write("</div>\r\n"); out.write("<header>\r\n"); out.write("\t<div id=\"usermenu\">\r\n"); out.write("\t\t"); if (_jspx_meth_c_005fif_005f0(_jspx_page_context)) return; out.write("\r\n"); out.write("\r\n"); out.write("\t\t"); if (_jspx_meth_c_005fif_005f1(_jspx_page_context)) return; out.write("\r\n"); out.write("\r\n"); out.write("\t</div>\r\n"); out.write("\t<!-- 마켓허리 로고 -->\r\n"); out.write("\t<img src=\"/mh/images/brandlogo.png\" alt=\"brandlogo\" id=\"brandlogo\" style=\"cursor:pointer\"\r\n"); out.write("\t\tonclick=\"location.href='/mh/user/main/main.do';\">\r\n"); out.write("</header>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<div id=\"menubar\">\r\n"); out.write("\t<a href=\"#!\">전체 카테고리</a> \r\n"); out.write("\t<a href=\"/mh/user/product/hotproduct.do\" class=\"hyperlink\">HOT 상품</a> \r\n"); out.write("\t<a href=\"/mh/user/product/cheapproduct.do\" class=\"hyperlink\">알뜰 상품</a> \r\n"); out.write("\t<a href=\"/mh/user/myrecipe/myrecipelist.do\" class=\"hyperlink\">나만의 레시피</a> \r\n"); out.write("\t<a href=\"/mh/user/event/event.do\" class=\"hyperlink\">이달의 이벤트</a> \r\n"); out.write("\t<input type=\"text\" id=\"searchbox\" value=\"검색내용을 입력해주세요.\" autocomplete=\"off\"> \r\n"); out.write("\t<span class=\"glyphicon glyphicon-search\" id=\"searchimg\"></span> \r\n"); out.write("\t<a href=\"/mh/user/product/shoppingbasket.do\" id=\"shoppingbox\"></a>\r\n"); out.write("\t<div id=\"detailmenu\">\r\n"); out.write("\t\t<ul style=\"list-style:none;\" id=\"detailul\">\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=0';\">채소</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=1';\">과일</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=2';\">육류</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=3';\">수산</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=4';\">가공식품</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=5';\">양념, 소스</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=6';\">유제품</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=7';\">건강 식품</li>\r\n"); out.write("\t\t\t<li onclick=\"location.href='/mh/user/product/productlist.do?category=8';\">음료</li>\r\n"); out.write("\t\t</ul>\r\n"); out.write("\t</div>\r\n"); out.write("</div>\r\n"); out.write("\r\n"); out.write("<link rel=\"stylesheet\" href=\"/mh/css/customerCenter.css\">\r\n"); out.write("\r\n"); out.write(" <style>\r\n"); out.write(" /* 공지사항 */\r\n"); out.write(" #tblNotice th,td {\r\n"); out.write(" text-align: center;\r\n"); out.write(" }\r\n"); out.write(" .noticeTitle {\r\n"); out.write(" text-align: left;\r\n"); out.write(" }\r\n"); out.write("\r\n"); out.write(" #tblNotice tbody tr:last-child td{\r\n"); out.write(" border-bottom: 1px solid #08718E;\r\n"); out.write(" }\r\n"); out.write(" </style>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("</head>\r\n"); out.write("\r\n"); out.write("<body>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\t<!-- 마이페이지 컨텐츠 부분 -->\r\n"); out.write(" <div style=\"width: 1100px; min-height: 550px; margin: 60px auto;\">\r\n"); out.write(" \r\n"); out.write(" <!-- ※ 왼쪽 영역 시작 ※ -->\r\n"); out.write("\t\t"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<link rel=\"stylesheet\" href=\"/mh/css/customerCenter.css\">\r\n"); out.write(" \r\n"); out.write(" <!-- 고객센터 메뉴바 -->\r\n"); out.write(" <div id=\"MyMenu\" style=\" width: 200px; height: auto; float: left;\">\r\n"); out.write(" <div>고객 센터</div>\r\n"); out.write(" <div id=\"goNotice\" class=\"menulist nowPage\" onclick=\"location.href='/mh/user/customercenter/customercenter.do';\"><div>공지사항</div><div class=\"arrow\">></div></div>\r\n"); out.write(" <div id=\"goQnA\" class=\"menulist\" onclick=\"location.href='/mh/user/customercenter/onebyone.do';\"><div>1:1 문의</div><div class=\"arrow\">></div></div>\r\n"); out.write(" <div id=\"go1to1Q\" class=\"qlist\">\r\n"); out.write(" <div>\r\n"); out.write(" <div style=\"height: 0px; font-size: 0.95em; position: relative; top: -7px; font-weight: bold;\">도움이 필요하신가요?</div>\r\n"); out.write(" <div style=\"height: 0px; font-size: 0.7em; position: relative; top: 8px;\">1:1 문의하기</div>\r\n"); out.write(" </div>\r\n"); out.write(" <div style=\" color: #08718E;\">></div>\r\n"); out.write(" </div>\r\n"); out.write(" </div>\r\n"); out.write(" "); out.write("\r\n"); out.write(" <!-- ※ 왼쪽 영역 끝 ※ -->\r\n"); out.write("\r\n"); out.write(" <!-- ---------------------------------------------------------------------------- -->\r\n"); out.write("\r\n"); out.write(" <!-- ※ 오른쪽 영역 시작 ※ -->\r\n"); out.write("\r\n"); out.write("\r\n"); out.write(" <div style=\"width: 870px; height: auto; float: left; margin-left: 30px; vertical-align: middle;\">\r\n"); out.write("\r\n"); out.write(" <!-- 마이페이지 메뉴 헤더 들어가는 부분 -->\r\n"); out.write(" <div style=\"height: 82px; border-bottom: 2px solid #08718E;\">\r\n"); out.write(" <div style=\"float: left;\">\r\n"); out.write(" <h2 id=\"title\">공지사항<span id=\"subtitle\">새로운 소식들과 유용한 정보들을 한 곳에서 확인하세요.</span></h2>\r\n"); out.write(" </div>\r\n"); out.write(" \r\n"); out.write(" </div>\r\n"); out.write(" \r\n"); out.write(" <!-- ---------------------------------------------------------------------------- -->\r\n"); out.write("\r\n"); out.write(" <!-- 콘텐츠 영역 -->\r\n"); out.write(" \r\n"); out.write(" \r\n"); out.write(" \r\n"); out.write("\r\n"); out.write(" <!-- 공지사항 테이블 -->\r\n"); out.write(" <table id=\"tblNotice\" class=\"table table-bordered\"\">\r\n"); out.write(" <tr>\r\n"); out.write(" <th>번호</th>\r\n"); out.write(" <th>제목</th>\r\n"); out.write(" <th>작성일</th>\r\n"); out.write(" <th>조회수</th>\r\n"); out.write(" </tr>\r\n"); out.write(" \r\n"); out.write(" "); if (_jspx_meth_c_005fif_005f2(_jspx_page_context)) return; out.write("\r\n"); out.write(" \t\r\n"); out.write(" \t"); if (_jspx_meth_c_005fif_005f3(_jspx_page_context)) return; out.write("\r\n"); out.write(" \r\n"); out.write(" \r\n"); out.write(" \r\n"); out.write(" \r\n"); out.write(" \r\n"); out.write(" \r\n"); out.write(" "); if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context)) return; out.write("\r\n"); out.write(" \r\n"); out.write(" \r\n"); out.write(" </table>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\t\t\t\r\n"); out.write("\r\n"); out.write("\r\n"); out.write(" \r\n"); out.write(" <div id=\"search\" style=\"margin-top: 15px; float:right; display:inline-block;\">\r\n"); out.write(" \r\n"); out.write(" <input type=\"text\" id=\"searchbox\" value=\"제목 또는 내용을 입력하세요.\" required value=\""); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${search}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("\">\r\n"); out.write(" <span class=\"glyphicon glyphicon-search\" id=\"searchimg\"></span>\r\n"); out.write(" </div>\r\n"); out.write("\r\n"); out.write(" <!-- ※ 오른쪽 영역 끝 ※ -->\r\n"); out.write(" \r\n"); out.write("\t\t"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pagebar}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write(" </div>\r\n"); out.write(" \r\n"); out.write(" </div>\r\n"); out.write(" \r\n"); out.write("<div style=\"clear: both;\"></div>\r\n"); out.write("\r\n"); out.write("<!-- footer -->\r\n"); out.write("\r\n"); out.write(" <!-- top button -->\r\n"); out.write(" <a href=\"#\" id=\"topbtn\" style=\"border: 0px; outline: none;\"></a>\r\n"); out.write("\r\n"); out.write(" <!-- footer -->\r\n"); out.write(" <div id=\"footer\">\r\n"); out.write(" <div id=\"innerfooter\">\r\n"); out.write(" <div class=\"footerctnt\">\r\n"); out.write(" <table id=\"ft1\" style=\"outline: none;\">\r\n"); out.write(" <tbody>\r\n"); out.write(" <tr>\r\n"); out.write(" <td>\r\n"); out.write(" <span style=\"display:block; font-size:24px;\">고객센터</span>\r\n"); out.write(" </td>\r\n"); out.write(" </tr>\r\n"); out.write(" <tr>\r\n"); out.write(" <td><span id=\"asknum\">1600-4000</span></td>\r\n"); out.write(" <td><span>365 고객센터</span><br><span class=\"cpmdesc\">오전 7시 - 오후 7시</span></td>\r\n"); out.write(" \r\n"); out.write(" </tr>\r\n"); out.write(" <tr>\r\n"); out.write(" <td><a href=\"/mh/user/customercenter/onebyone.do\" class=\"ask\">1:1 문의</a></td>\r\n"); out.write(" <td><span>24시간 접수 가능</span><br><span class=\"cpmdesc\">고객센터 운영중 순차적으로 답변해드리겠습니다.</span></td>\r\n"); out.write(" </tr>\r\n"); out.write(" <tr>\r\n"); out.write(" <td><a href=\"/mh/admin/main/adminlogin.do\" class=\"ask\">관리자</a></td>\r\n"); out.write(" <td><span style=\"font-weight: bold; font-size:15px\"></span></td>\r\n"); out.write(" </tr>\r\n"); out.write(" </tbody>\r\n"); out.write(" </table>\r\n"); out.write(" </div>\r\n"); out.write(" <div class=\"footerctnt\">\r\n"); out.write(" <table id=\"ft2\" style=\"outline: none;\">\r\n"); out.write(" <tbody>\r\n"); out.write(" <tr>\r\n"); out.write(" <td>\r\n"); out.write(" <a href=\"\">회사소개</a>\r\n"); out.write(" <a href=\"\">인재채용</a>\r\n"); out.write(" <a href=\"\">이용약관</a>\r\n"); out.write(" <a href=\"\">개인정보처리방침</a>\r\n"); out.write(" <a href=\"\">이용안내</a>\r\n"); out.write(" </td>\r\n"); out.write(" </tr>\r\n"); out.write(" <tr>\r\n"); out.write(" <td><span class=\"cpmdesc\">법인명 (상호): 주식회사 MarketHurry &nbsp;|&nbsp; \r\n"); out.write(" 사업자등록번호: 123-45-7891011</span><br>\r\n"); out.write(" <span class=\"cpmdesc\">통신판매업: 제 2018-서울역삼-0123425호 &nbsp;|&nbsp; 개인정보보호책임자: (주)마켓허리</span><br>\r\n"); out.write(" <span class=\"cpmdesc\">주소: 서울 강남구 테헤란로 132 (역삼동)한독약품 빌딩 8층 &nbsp;|&nbsp; 대표이사: 이은수</span><br>\r\n"); out.write(" <span class=\"cpmdesc\" >제휴문의 : <span style=\"color:#08718E;\">[email protected]</span></span><br>\r\n"); out.write(" <span class=\"cpmdesc\">채용문의 : <span style=\"color:#08718E;\">[email protected]</span></span><br>\r\n"); out.write("\r\n"); out.write(" <span class=\"cpmdesc\">팩스: 070-1234-5678 &nbsp;|&nbsp; 이메일: <span style=\"color:#08718E;\">[email protected]</span></span><br><br>\r\n"); out.write(" <span class=\"cpmdesc\">© HURRY CORP. ALL RIGHTS RESERVED</span>\r\n"); out.write(" </td>\r\n"); out.write(" </tr>\r\n"); out.write(" <tr>\r\n"); out.write(" <td>\r\n"); out.write(" <a id=\"insta\" class=\"snslogo\"></a>\r\n"); out.write(" <a id=\"fb\" class=\"snslogo\"></a>\r\n"); out.write(" <a id=\"post\" class=\"snslogo\"></a>\r\n"); out.write(" <a id=\"blog\" class=\"snslogo\"></a>\r\n"); out.write(" </td>\r\n"); out.write(" </tr>\r\n"); out.write(" </tbody>\r\n"); out.write(" </table>\r\n"); out.write(" </div>\r\n"); out.write(" </div>\r\n"); out.write(" </div>"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<script>\r\n"); out.write("\r\n"); out.write("function movePage() {\r\n"); out.write("\t//alert(event.srcElement.value);\r\n"); out.write("\tlocation.href = \"/mh/user/customercenter/customercenter.do?page=\" + event.srcElement.value;\r\n"); out.write("}\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("$(\"#search > #searchbox\").focus(function() {\r\n"); out.write("\t$(this).attr(\"value\", \"\");\r\n"); out.write("})\r\n"); out.write("\r\n"); out.write("$(\"#search > #searchbox\").keyup(function() {\r\n"); out.write("\r\n"); out.write("if(event.keyCode == 13){\r\n"); out.write("\tvar search = $(\"#search > #searchbox\").val();\r\n"); out.write("\tlocation.href=\"/mh/user/customercenter/customercenter.do?search=\"+search;\r\n"); out.write("}\r\n"); out.write("});\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("$(\"#search > #searchimg\").click(function(){\r\n"); out.write("\tvar search = $(\"#search > #searchbox\").val();\r\n"); out.write("\tlocation.href=\"/mh/user/customercenter/customercenter.do?search=\" +search;\r\n"); out.write("})\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("$(\"#pagebar\").val("); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${page}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write(");\r\n"); out.write("\r\n"); out.write("</script>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<script src=\"/mh/js/main.js\"></script>\r\n"); out.write("\r\n"); out.write("</body>\r\n"); out.write("</html>\r\n"); out.write("\r\n"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); boolean _jspx_th_c_005fif_005f0_reused = false; try { _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f0.setParent(null); // /WEB-INF/views/inc/header.jsp(45,2) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${empty sessionScope.seq }", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag(); if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write("\t\t\t<a href=\"/mh/user/main/register.do\" class=\"hyperlink\">회원가입</a>\r\n"); out.write("\t\t\t<a href=\"/mh/user/main/login.do\" class=\"hyperlink\">로그인</a>\r\n"); out.write("\t\t\t<a href=\"/mh/user/customercenter/customercenter.do\" class=\"hyperlink\">고객센터</a>\r\n"); out.write("\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); _jspx_th_c_005fif_005f0_reused = true; } finally { org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_c_005fif_005f0, _jsp_getInstanceManager(), _jspx_th_c_005fif_005f0_reused); } return false; } private boolean _jspx_meth_c_005fif_005f1(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f1 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); boolean _jspx_th_c_005fif_005f1_reused = false; try { _jspx_th_c_005fif_005f1.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f1.setParent(null); // /WEB-INF/views/inc/header.jsp(51,2) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f1.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${not empty sessionScope.seq }", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f1 = _jspx_th_c_005fif_005f1.doStartTag(); if (_jspx_eval_c_005fif_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write("\t\t\t<a href=\"/mh/user/main/loginout.do\" class=\"hyperlink\">로그아웃</a>\r\n"); out.write("\t\t\t<a href=\"/mh/user/mypage/orderlist.do\" class=\"hyperlink\">마이페이지</a>\r\n"); out.write("\t\t\t<a href=\"/mh/user/customercenter/customercenter.do\" class=\"hyperlink\">고객센터</a>\r\n"); out.write("\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f1.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1); _jspx_th_c_005fif_005f1_reused = true; } finally { org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_c_005fif_005f1, _jsp_getInstanceManager(), _jspx_th_c_005fif_005f1_reused); } return false; } private boolean _jspx_meth_c_005fif_005f2(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f2 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); boolean _jspx_th_c_005fif_005f2_reused = false; try { _jspx_th_c_005fif_005f2.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f2.setParent(null); // /WEB-INF/views/user/customercenter/customercenter.jsp(69,16) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f2.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${not empty search and list.size() == 0}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f2 = _jspx_th_c_005fif_005f2.doStartTag(); if (_jspx_eval_c_005fif_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write(" \t<tr>\r\n"); out.write(" \t\t<td colspan=\"5\">검색 결과가 없습니다.</td>\r\n"); out.write(" \t</tr> \t\r\n"); out.write(" \t"); int evalDoAfterBody = _jspx_th_c_005fif_005f2.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f2); _jspx_th_c_005fif_005f2_reused = true; } finally { org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_c_005fif_005f2, _jsp_getInstanceManager(), _jspx_th_c_005fif_005f2_reused); } return false; } private boolean _jspx_meth_c_005fif_005f3(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f3 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); boolean _jspx_th_c_005fif_005f3_reused = false; try { _jspx_th_c_005fif_005f3.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f3.setParent(null); // /WEB-INF/views/user/customercenter/customercenter.jsp(75,21) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f3.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${empty search and list.size() == 0}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f3 = _jspx_th_c_005fif_005f3.doStartTag(); if (_jspx_eval_c_005fif_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write(" \t<tr>\r\n"); out.write(" \t\t<td colspan=\"5\">게시물이 없습니다.</td>\r\n"); out.write(" \t</tr> \t\r\n"); out.write(" "); int evalDoAfterBody = _jspx_th_c_005fif_005f3.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f3); _jspx_th_c_005fif_005f3_reused = true; } finally { org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_c_005fif_005f3, _jsp_getInstanceManager(), _jspx_th_c_005fif_005f3_reused); } return false; } private boolean _jspx_meth_c_005fforEach_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:forEach org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class); boolean _jspx_th_c_005fforEach_005f0_reused = false; try { _jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fforEach_005f0.setParent(null); // /WEB-INF/views/user/customercenter/customercenter.jsp(86,16) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f0.setItems(new org.apache.jasper.el.JspValueExpression("/WEB-INF/views/user/customercenter/customercenter.jsp(86,16) '${list}'",_jsp_getExpressionFactory().createValueExpression(_jspx_page_context.getELContext(),"${list}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext())); // /WEB-INF/views/user/customercenter/customercenter.jsp(86,16) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f0.setVar("dto"); int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 }; try { int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag(); if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write(" \r\n"); out.write(" <tr>\r\n"); out.write(" <td>"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${dto.seq}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</td>\r\n"); out.write(" <td class=\"noticeTitle\" id=\"notice3\"><a href=\"/mh/user/customercenter/notice.do?seq="); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${dto.seq}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write('"'); out.write('>'); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${dto.title}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</a></td>\r\n"); out.write(" <td>"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${dto.regdate}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</td>\r\n"); out.write(" <td id=\"count\">"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${dto.readcount}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</td>\r\n"); out.write(" </tr>\r\n"); out.write(" \r\n"); out.write(" "); int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { return true; } } catch (java.lang.Throwable _jspx_exception) { while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0) out = _jspx_page_context.popBody(); _jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception); } finally { _jspx_th_c_005fforEach_005f0.doFinally(); } _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0); _jspx_th_c_005fforEach_005f0_reused = true; } finally { org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_c_005fforEach_005f0, _jsp_getInstanceManager(), _jspx_th_c_005fforEach_005f0_reused); } return false; } }
63648d880885dfb739ee4fc79234cae26671306b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/1/1_06f5f0c8eca2984a3dd78428d9045ca16ec77460/HttpPollingFunctionalTestCase/1_06f5f0c8eca2984a3dd78428d9045ca16ec77460_HttpPollingFunctionalTestCase_t.java
6885fbdf0754640faea6b2197684497abc782787
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,277
java
package com.muleinaction; import org.mule.api.service.Service; import org.mule.api.context.notification.EndpointMessageNotificationListener; import org.mule.api.context.notification.ServerNotification; import org.mule.tck.FunctionalTestCase; import org.mule.context.notification.EndpointMessageNotification; import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.WildcardFileFilter; import java.io.File; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; /** * @author John D'Emic ([email protected]) */ public class HttpPollingFunctionalTestCase extends FunctionalTestCase { private static String DEST_DIRECTORY = "./data/polling"; private CountDownLatch latch = new CountDownLatch(1); protected void doSetUp() throws Exception { super.doSetUp(); for (Object o : FileUtils.listFiles(new File(DEST_DIRECTORY), new String[]{"html"}, false)) { File file = (File) o; file.delete(); } muleContext.registerListener(new EndpointMessageNotificationListener() { public void onNotification(final ServerNotification notification) { if ("httpPollingService".equals(notification.getResourceIdentifier())) { final EndpointMessageNotification messageNotification = (EndpointMessageNotification) notification; if (messageNotification.getEndpoint().getName().equals("endpoint.file.data.polling")) { latch.countDown(); } } } }); } @Override protected String getConfigResources() { return "conf/http-polling-config.xml"; } public void testCorrectlyInitialized() throws Exception { final Service service = muleContext.getRegistry().lookupService( "httpPollingService"); assertNotNull(service); assertEquals("httpPollingModel", service.getModel().getName()); assertTrue("Message did not reach directory on time", latch.await(15, TimeUnit.SECONDS)); assertEquals(1, FileUtils.listFiles(new File(DEST_DIRECTORY), new WildcardFileFilter("*.*"), null).size()); } }
c0bb7ba4a3b5078a5a7d994dd37cd932ab72d123
73017c737d59acdb62b0dbf6e177ddf38518cf9b
/common/src/main/java/io/github/aquerr/eaglefactions/common/commands/DisbandCommand.java
ddf4ec5f494d153453d613601f352ec82ddb2625
[ "MIT" ]
permissive
michalzielinski913/EagleFactions
88ce90bef37f9d3a951fe645ba73a1547a59c845
a5c2ac3aa71f7bc39a710b7f7b25247cef3a0a68
refs/heads/master
2022-04-12T06:38:25.743986
2020-03-08T13:28:05
2020-03-08T13:28:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,019
java
package io.github.aquerr.eaglefactions.common.commands; import io.github.aquerr.eaglefactions.api.EagleFactions; import io.github.aquerr.eaglefactions.api.entities.Faction; import io.github.aquerr.eaglefactions.common.EagleFactionsPlugin; import io.github.aquerr.eaglefactions.common.PluginInfo; import io.github.aquerr.eaglefactions.common.messaging.MessageLoader; import io.github.aquerr.eaglefactions.common.messaging.Messages; import io.github.aquerr.eaglefactions.common.messaging.Placeholders; import org.spongepowered.api.command.CommandException; import org.spongepowered.api.command.CommandResult; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.command.args.CommandContext; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.format.TextColors; import java.util.Collections; import java.util.Optional; public class DisbandCommand extends AbstractCommand { public DisbandCommand(EagleFactions plugin) { super(plugin); } @Override public CommandResult execute(CommandSource source, CommandContext context) throws CommandException { if(!(source instanceof Player)) throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, Messages.ONLY_IN_GAME_PLAYERS_CAN_USE_THIS_COMMAND)); final Player player = (Player) source; // There's a bit of code duplicating, but... Optional<String> optionalFactionName = context.<String>getOne("faction name"); if (optionalFactionName.isPresent()) { if (!EagleFactionsPlugin.ADMIN_MODE_PLAYERS.contains(player.getUniqueId())) throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, Messages.YOU_NEED_TO_TOGGLE_FACTION_ADMIN_MODE_TO_DO_THIS)); Faction faction = super.getPlugin().getFactionLogic().getFactionByName(optionalFactionName.get()); if (faction == null) throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, MessageLoader.parseMessage(Messages.THERE_IS_NO_FACTION_CALLED_FACTION_NAME, Collections.singletonMap(Placeholders.FACTION_NAME, Text.of(TextColors.GOLD, optionalFactionName.get()))))); boolean didSecceed = super.getPlugin().getFactionLogic().disbandFaction(faction.getName()); if (didSecceed) { player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.GREEN, Messages.FACTION_HAS_BEEN_DISBANDED)); } else { player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.RED, Messages.SOMETHING_WENT_WRONG)); } return CommandResult.success(); } Optional<Faction> optionalPlayerFaction = super.getPlugin().getFactionLogic().getFactionByPlayerUUID(player.getUniqueId()); if(!optionalPlayerFaction.isPresent()) throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, Messages.YOU_MUST_BE_IN_FACTION_IN_ORDER_TO_USE_THIS_COMMAND)); Faction playerFaction = optionalPlayerFaction.get(); if(playerFaction.getName().equalsIgnoreCase("SafeZone") || playerFaction.getName().equalsIgnoreCase("WarZone")) throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, "This faction cannot be disbanded!")); //If player has adminmode if(EagleFactionsPlugin.ADMIN_MODE_PLAYERS.contains(player.getUniqueId())) { boolean didSucceed = super.getPlugin().getFactionLogic().disbandFaction(playerFaction.getName()); if(didSucceed) { player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.GREEN, Messages.FACTION_HAS_BEEN_DISBANDED)); EagleFactionsPlugin.AUTO_CLAIM_LIST.remove(player.getUniqueId()); EagleFactionsPlugin.CHAT_LIST.remove(player.getUniqueId()); } else { player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.RED, Messages.SOMETHING_WENT_WRONG)); } return CommandResult.success(); } //If player is leader if(!playerFaction.getLeader().equals(player.getUniqueId())) throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, Messages.YOU_MUST_BE_THE_FACTIONS_LEADER_TO_DO_THIS)); boolean didSucceed = super.getPlugin().getFactionLogic().disbandFaction(playerFaction.getName()); if(didSucceed) { player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.GREEN, Messages.FACTION_HAS_BEEN_DISBANDED)); EagleFactionsPlugin.AUTO_CLAIM_LIST.remove(player.getUniqueId()); EagleFactionsPlugin.CHAT_LIST.remove(player.getUniqueId()); } else { player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.RED, Messages.SOMETHING_WENT_WRONG)); } return CommandResult.success(); } }
c19f228f2046fd81228e14c6755edb01a8e0db83
4be43f5bdd7da067e2277a92ae7a8487073cd5f5
/src/com/amaze/graphs/SL.java
8a45c50380093bfdb9c2b1437d791cc0e21714c8
[]
no_license
vidhya2121/data-structure
eec8edc36f6780050bd8849574c39c1536a69371
581af0e64bcf9bc6d0827ef1ab4ccea289d93356
refs/heads/master
2023-04-04T23:32:33.117849
2021-04-11T03:27:27
2021-04-11T03:27:27
277,040,259
0
0
null
null
null
null
UTF-8
Java
false
false
2,290
java
package com.amaze.graphs; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class SL { /* * Given a snake and ladder board of order 5x6, find the minimum number of dice throws required * to reach the destination or last cell (30th cell) from source (1st cell) . */ /* * Input: 2 6 11 26 3 22 5 8 20 29 27 1 21 9 1 2 30 Output: 3 1 Explanation: Testcase 1: For 1st throw get a 2, which contains ladder to reach 22 For 2nd throw get a 6, which will lead to 28 Finally get a 2, to reach at the end 30. Thus 3 dice throws required to reach 30. */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int mat[] = new int[30+1]; for (int i = 1; i <= 30; i++) { mat[i] = -1; } for (int i = 0; i < n; i++) { int src = sc.nextInt(); mat[src] = sc.nextInt(); } System.out.println(snakeLadder(mat, 30)); } } /* * visited boolean array Queue of SNode(vertex,dist) * add 1,0 to q * loop till q is empty * curr = poll from q * if current vertex in n break * v = curr vertex * loop j = v + 1 j < v+6 and j<=n * if j not visited * create a new SNode and set its dist as curr.dist+1 * if mat[j] != -1 then set new node's vertex to mat[j] * else set to j only * add node to q * return curr.dist */ private static int snakeLadder(int[] mat, int n) { // mat [0, -1, -1, 22, -1, 8, -1, -1, -1, -1, -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, 29, 9, -1, -1, -1, -1, -1, 1, -1, -1, -1] boolean visited[] = new boolean[n+1]; Queue<SNode> q = new LinkedList<>(); q.add(new SNode(1, 0)); visited[0] = true; SNode curr = null; while (!q.isEmpty()) { curr = q.poll(); if (curr.vertex == n) { break; } int v = curr.vertex; for (int j = v + 1; j <= v + 6 && j <= n; j++) { if (!visited[j]) { SNode s = new SNode(); s.dist = curr.dist + 1; if (mat[j] != -1) { s.vertex = mat[j]; } else { s.vertex = j; } q.add(s); } } } return curr.dist; } } class SNode { int vertex; int dist; SNode(int vertex, int dist) { this.vertex = vertex; this.dist = dist; } public SNode() { } }
41f6730e132180e0daf28910035b1e32d1a86287
b3d9e98f353eaba1cf92e3f1fc1ccd56e7cecbc5
/xy-games/game-logic/trunk/src/main/java/com/cai/game/mj/henan/zhengzhou/MJHandlerGang_ZhengZhou.java
da26e6c7f54550633f0d76e0abc597ddd51bde26
[]
no_license
konser/repository
9e83dd89a8ec9de75d536992f97fb63c33a1a026
f5fef053d2f60c7e27d22fee888f46095fb19408
refs/heads/master
2020-09-29T09:17:22.286107
2018-10-12T03:52:12
2018-10-12T03:52:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
15,802
java
package com.cai.game.mj.henan.zhengzhou; import java.util.concurrent.TimeUnit; import com.cai.common.constant.GameConstants; import com.cai.common.constant.MsgConstants; import com.cai.common.domain.PlayerStatus; import com.cai.common.domain.WeaveItem; import com.cai.future.GameSchedule; import com.cai.future.runnable.GameFinishRunnable; import com.cai.game.mj.handler.MJHandlerGang; import protobuf.clazz.Protocol.Int32ArrayResponse; import protobuf.clazz.Protocol.RoomResponse; import protobuf.clazz.Protocol.TableResponse; import protobuf.clazz.Protocol.WeaveItemResponse; import protobuf.clazz.Protocol.WeaveItemResponseArrayResponse; public class MJHandlerGang_ZhengZhou extends MJHandlerGang<MJTable_ZhengZhou> { @Override public void exe(MJTable_ZhengZhou table) { for (int i = 0; i < table.getTablePlayerNumber(); i++) { if (table._playerStatus[i].has_action()) { table.operate_player_action(i, true); } table._playerStatus[i].clean_action(); table.change_player_status(i, GameConstants.INVALID_VALUE); } table._playerStatus[_seat_index].chi_hu_round_valid(); table.operate_effect_action(_seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1, new long[] { _action }, 1, GameConstants.INVALID_SEAT); if ((GameConstants.GANG_TYPE_AN_GANG == _type) || (GameConstants.GANG_TYPE_JIE_GANG == _type)) { exe_gang(table); return; } boolean bAroseAction = false; if (table.has_rule(GameConstants.GAME_RULE_HENAN_HENAN_PAO_HU)) { bAroseAction = table.estimate_gang_respond_henan(_seat_index, _center_card); } if (bAroseAction == false) { exe_gang(table); } else { PlayerStatus playerStatus = null; for (int i = 0; i < table.getTablePlayerNumber(); i++) { playerStatus = table._playerStatus[i]; if (playerStatus.has_chi_hu()) { table.change_player_status(i, GameConstants.Player_Status_OPR_CARD); table.operate_player_action(i, false); } } } } @Override public boolean handler_operate_card(MJTable_ZhengZhou table, int seat_index, int operate_code, int operate_card) { PlayerStatus playerStatus = table._playerStatus[seat_index]; if (playerStatus.has_action() == false) { table.log_player_error(seat_index, "出牌,玩家操作已失效"); return false; } if (playerStatus.is_respone()) { table.log_player_error(seat_index, "出牌,玩家已操作"); return false; } if ((operate_code != GameConstants.WIK_NULL) && (operate_code != GameConstants.WIK_CHI_HU)) { table.log_player_error(seat_index, "出牌操作,没有动作"); return false; } if ((operate_code != GameConstants.WIK_NULL) && (operate_card != _center_card)) { table.log_player_error(seat_index, "出牌操作,操作牌对象出错"); return false; } playerStatus.operate(operate_code, operate_card); if (operate_code == GameConstants.WIK_NULL) { table.record_effect_action(seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1, new long[] { GameConstants.WIK_NULL }, 1); table.GRR._chi_hu_rights[seat_index].set_valid(false); table._playerStatus[seat_index].chi_hu_round_invalid(); } else if (operate_code == GameConstants.WIK_CHI_HU) { table.GRR._chi_hu_rights[seat_index].set_valid(true); } else { table.log_player_error(seat_index, "出牌操作,没有动作"); return false; } table.operate_player_action(seat_index, true); // 变量定义 优先级最高操作的玩家和操作 int target_player = seat_index; int target_action = operate_code; int target_p = 0; for (int p = 0; p < table.getTablePlayerNumber(); p++) { int i = (_seat_index + p) % table.getTablePlayerNumber(); if (i == target_player) { target_p = table.getTablePlayerNumber() - p; } } for (int p = 0; p < table.getTablePlayerNumber(); p++) { int i = (_seat_index + p) % table.getTablePlayerNumber(); int cbUserActionRank = 0; int cbTargetActionRank = 0; if (table._playerStatus[i].has_action()) { if (table._playerStatus[i].is_respone()) { cbUserActionRank = table._logic.get_action_rank(table._playerStatus[i].get_perform()) + table.getTablePlayerNumber() - p; } else { cbUserActionRank = table._logic.get_action_list_rank(table._playerStatus[i]._action_count, table._playerStatus[i]._action) + table.getTablePlayerNumber() - p; } if (table._playerStatus[target_player].is_respone()) { cbTargetActionRank = table._logic.get_action_rank(table._playerStatus[target_player].get_perform()) + target_p; } else { cbTargetActionRank = table._logic.get_action_list_rank(table._playerStatus[target_player]._action_count, table._playerStatus[target_player]._action) + target_p; } if (cbUserActionRank > cbTargetActionRank) { target_player = i; target_action = table._playerStatus[i].get_perform(); target_p = table.getTablePlayerNumber() - p; } } } if (table._playerStatus[target_player].is_respone() == false) return true; operate_card = _center_card; if (target_action == GameConstants.WIK_NULL) { for (int i = 0; i < table.getTablePlayerNumber(); i++) { table.GRR._chi_hu_rights[i].set_valid(false); } exe_gang(table); return true; } for (int i = 0; i < table.getTablePlayerNumber(); i++) { if (i == target_player) { table.GRR._chi_hu_rights[i].set_valid(true); } else { table.GRR._chi_hu_rights[i].set_valid(false); } } table.process_chi_hu_player_operate(target_player, _center_card, false); for (int i = 0; i < table.getTablePlayerNumber(); i++) { table._playerStatus[i].clean_action(); table.change_player_status(i, GameConstants.INVALID_VALUE); table.operate_player_action(i, true); } int jie_pao_count = 0; for (int i = 0; i < table.getTablePlayerNumber(); i++) { if ((table.GRR._chi_hu_rights[i].is_valid() == false)) { continue; } jie_pao_count++; } if (jie_pao_count > 0) { table._cur_banker = target_player; table.GRR._chi_hu_card[target_player][0] = _center_card; table.process_chi_hu_player_score_henan(target_player, _seat_index, _center_card, false); table._player_result.jie_pao_count[target_player]++; table._player_result.dian_pao_count[_seat_index]++; GameSchedule.put(new GameFinishRunnable(table.getRoom_id(), table._cur_banker, GameConstants.Game_End_NORMAL), GameConstants.GAME_FINISH_DELAY, TimeUnit.SECONDS); } return true; } @Override protected boolean exe_gang(MJTable_ZhengZhou table) { int cbCardIndex = table._logic.switch_to_card_index(_center_card); int cbWeaveIndex = -1; if (GameConstants.GANG_TYPE_AN_GANG == _type) { cbWeaveIndex = table.GRR._weave_count[_seat_index]; table.GRR._weave_count[_seat_index]++; } else if (GameConstants.GANG_TYPE_JIE_GANG == _type) { cbWeaveIndex = table.GRR._weave_count[_seat_index]; table.GRR._weave_count[_seat_index]++; table.operate_remove_discard(_provide_player, table.GRR._discard_count[_provide_player]); } else if (GameConstants.GANG_TYPE_ADD_GANG == _type) { for (int i = 0; i < table.GRR._weave_count[_seat_index]; i++) { int cbWeaveKind = table.GRR._weave_items[_seat_index][i].weave_kind; int cbCenterCard = table.GRR._weave_items[_seat_index][i].center_card; if ((cbCenterCard == _center_card) && (cbWeaveKind == GameConstants.WIK_PENG)) { cbWeaveIndex = i; _provide_player = table.GRR._weave_items[_seat_index][i].provide_player; break; } } if (cbWeaveIndex == -1) { table.log_player_error(_seat_index, "杠牌出错"); return false; } } table.GRR._weave_items[_seat_index][cbWeaveIndex].public_card = _p == true ? 1 : 0; table.GRR._weave_items[_seat_index][cbWeaveIndex].center_card = _center_card; table.GRR._weave_items[_seat_index][cbWeaveIndex].weave_kind = _action; table.GRR._weave_items[_seat_index][cbWeaveIndex].provide_player = _provide_player; table._current_player = _seat_index; table.GRR._cards_index[_seat_index][cbCardIndex] = 0; table.GRR._card_count[_seat_index] = table._logic.get_card_count_by_index(table.GRR._cards_index[_seat_index]); int cards[] = new int[GameConstants.MAX_COUNT]; int hand_card_count = table._logic.switch_to_cards_data(table.GRR._cards_index[_seat_index], cards); for (int j = 0; j < hand_card_count; j++) { if (table._logic.is_magic_card(cards[j])) { cards[j] += GameConstants.CARD_ESPECIAL_TYPE_HUN; } } WeaveItem weaves[] = new WeaveItem[GameConstants.MAX_WEAVE]; int weave_count = table.GRR._weave_count[_seat_index]; for (int i = 0; i < weave_count; i++) { weaves[i] = new WeaveItem(); weaves[i].weave_kind = table.GRR._weave_items[_seat_index][i].weave_kind; weaves[i].center_card = table.GRR._weave_items[_seat_index][i].center_card; weaves[i].public_card = table.GRR._weave_items[_seat_index][i].public_card; weaves[i].provide_player = table.GRR._weave_items[_seat_index][i].provide_player + GameConstants.WEAVE_SHOW_DIRECT; } table.operate_player_cards(_seat_index, hand_card_count, cards, weave_count, weaves); table._playerStatus[_seat_index]._hu_card_count = table.get_henan_ting_card(table._playerStatus[_seat_index]._hu_cards, table.GRR._cards_index[_seat_index], table.GRR._weave_items[_seat_index], table.GRR._weave_count[_seat_index]); int ting_cards[] = table._playerStatus[_seat_index]._hu_cards; int ting_count = table._playerStatus[_seat_index]._hu_card_count; if (ting_count > 0) { table.operate_chi_hu_cards(_seat_index, ting_count, ting_cards); } else { ting_cards[0] = 0; table.operate_chi_hu_cards(_seat_index, 1, ting_cards); } boolean zhuang_gang = (table.GRR._banker_player == _seat_index ? true : false); boolean zhuang_fang_gang = (table.GRR._banker_player == _provide_player ? true : false); boolean jia_di = table.has_rule(GameConstants.GAME_RULE_HENAN_JIA_DI); boolean gang_pao = table.has_rule(GameConstants.GAME_RULE_HENAN_GANG_PAO); int cbGangIndex = table.GRR._gang_score[_seat_index].gang_count++; if (GameConstants.GANG_TYPE_AN_GANG == _type) { for (int i = 0; i < table.getTablePlayerNumber(); i++) { if (i == _seat_index) continue; int score = GameConstants.CELL_SCORE; if (jia_di) { if (zhuang_gang) { score += 1; } else if (table.GRR._banker_player == i) { score += 1; } } if (gang_pao) { score += table._player_result.pao[i] + table._player_result.pao[_seat_index]; } table.GRR._gang_score[_seat_index].scores[cbGangIndex][i] = -score; table.GRR._gang_score[_seat_index].scores[cbGangIndex][_seat_index] += score; } table._player_result.an_gang_count[_seat_index]++; } else if (GameConstants.GANG_TYPE_JIE_GANG == _type) { int score = GameConstants.CELL_SCORE; if (jia_di) { if (zhuang_gang) { score += 1; } else if (zhuang_fang_gang) { score += 1; } } if (gang_pao) { score += table._player_result.pao[_provide_player] + table._player_result.pao[_seat_index]; } table.GRR._gang_score[_seat_index].scores[cbGangIndex][_seat_index] = score; table.GRR._gang_score[_seat_index].scores[cbGangIndex][_provide_player] = -score; table._player_result.ming_gang_count[_seat_index]++; } else if (GameConstants.GANG_TYPE_ADD_GANG == _type) { int score = GameConstants.CELL_SCORE; if (jia_di) { if (zhuang_gang) { score += 1; } else if (zhuang_fang_gang) { score += 1; } } if (gang_pao) { score += table._player_result.pao[_provide_player] + table._player_result.pao[_seat_index]; } table.GRR._gang_score[_seat_index].scores[cbGangIndex][_seat_index] = score; table.GRR._gang_score[_seat_index].scores[cbGangIndex][table.GRR._weave_items[_seat_index][cbWeaveIndex].provide_player] = -score; table._player_result.ming_gang_count[_seat_index]++; } table.exe_dispatch_card_gang(_seat_index, _type, 0, _provide_player); return true; } @Override public boolean handler_player_be_in_room(MJTable_ZhengZhou table, int seat_index) { RoomResponse.Builder roomResponse = RoomResponse.newBuilder(); roomResponse.setType(MsgConstants.RESPONSE_RECONNECT_DATA); TableResponse.Builder tableResponse = TableResponse.newBuilder(); table.load_room_info_data(roomResponse); table.load_player_info_data(roomResponse); table.load_common_status(roomResponse); tableResponse.setBankerPlayer(table.GRR._banker_player); tableResponse.setCurrentPlayer(_seat_index); tableResponse.setCellScore(0); tableResponse.setActionCard(0); tableResponse.setOutCardData(0); tableResponse.setOutCardPlayer(0); for (int i = 0; i < table.getTablePlayerNumber(); i++) { tableResponse.addTrustee(false); tableResponse.addDiscardCount(table.GRR._discard_count[i]); Int32ArrayResponse.Builder int_array = Int32ArrayResponse.newBuilder(); for (int j = 0; j < 55; j++) { if (table._logic.is_magic_card(table.GRR._discard_cards[i][j])) { int_array.addItem(table.GRR._discard_cards[i][j] + GameConstants.CARD_ESPECIAL_TYPE_HUN); } else { int_array.addItem(table.GRR._discard_cards[i][j]); } } tableResponse.addDiscardCards(int_array); tableResponse.addWeaveCount(table.GRR._weave_count[i]); WeaveItemResponseArrayResponse.Builder weaveItem_array = WeaveItemResponseArrayResponse.newBuilder(); for (int j = 0; j < GameConstants.MAX_WEAVE; j++) { WeaveItemResponse.Builder weaveItem_item = WeaveItemResponse.newBuilder(); if (table._logic.is_magic_card(table.GRR._weave_items[i][j].center_card)) { weaveItem_item.setCenterCard(table.GRR._weave_items[i][j].center_card + GameConstants.CARD_ESPECIAL_TYPE_HUN); } else { weaveItem_item.setCenterCard(table.GRR._weave_items[i][j].center_card); } weaveItem_item.setProvidePlayer(table.GRR._weave_items[i][j].provide_player + GameConstants.WEAVE_SHOW_DIRECT); weaveItem_item.setPublicCard(table.GRR._weave_items[i][j].public_card); weaveItem_item.setWeaveKind(table.GRR._weave_items[i][j].weave_kind); weaveItem_array.addWeaveItem(weaveItem_item); } tableResponse.addWeaveItemArray(weaveItem_array); tableResponse.addWinnerOrder(0); tableResponse.addCardCount(table._logic.get_card_count_by_index(table.GRR._cards_index[i])); } tableResponse.setSendCardData(0); int cards[] = new int[GameConstants.MAX_COUNT]; int hand_card_count = table._logic.switch_to_cards_data(table.GRR._cards_index[seat_index], cards); for (int j = 0; j < hand_card_count; j++) { if (table._logic.is_magic_card(cards[j])) { cards[j] += GameConstants.CARD_ESPECIAL_TYPE_HUN; } } for (int i = 0; i < GameConstants.MAX_COUNT; i++) { tableResponse.addCardsData(cards[i]); } roomResponse.setTable(tableResponse); table.send_response_to_player(seat_index, roomResponse); table.operate_effect_action(_seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1, new long[] { _action }, 1, seat_index); if (table._playerStatus[seat_index].has_action() && table._playerStatus[seat_index].is_respone() == false) { table.operate_player_action(seat_index, false); } int ting_cards[] = table._playerStatus[seat_index]._hu_cards; int ting_count = table._playerStatus[seat_index]._hu_card_count; if (ting_count > 0) { table.operate_chi_hu_cards(seat_index, ting_count, ting_cards); } return true; } }
eb1cf23c20b482c704a4f64f9742235b8c506855
9d4f40389879aba12180fa4be0cf34b36865cf47
/build/app/generated/not_namespaced_r_class_sources/debug/r/androidx/legacy/coreui/R.java
f744f0130a4206f761cdc9b19d0f2daa1a9efea0
[]
no_license
Hash-IQ/PetApp
d3ebaac99b184899feb7df417c7cbbf09da35bc2
37475fe6de1cbe62de955e340925bce38e60ccb2
refs/heads/main
2023-03-08T17:11:39.288806
2021-02-09T15:50:57
2021-02-09T15:50:57
332,448,636
0
0
null
null
null
null
UTF-8
Java
false
false
12,452
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.legacy.coreui; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f010002; public static final int coordinatorLayoutStyle = 0x7f01000a; public static final int font = 0x7f01000d; public static final int fontProviderAuthority = 0x7f01000e; public static final int fontProviderCerts = 0x7f01000f; public static final int fontProviderFetchStrategy = 0x7f010010; public static final int fontProviderFetchTimeout = 0x7f010011; public static final int fontProviderPackage = 0x7f010012; public static final int fontProviderQuery = 0x7f010013; public static final int fontStyle = 0x7f010014; public static final int fontVariationSettings = 0x7f010015; public static final int fontWeight = 0x7f010016; public static final int keylines = 0x7f01001c; public static final int layout_anchor = 0x7f01001d; public static final int layout_anchorGravity = 0x7f01001e; public static final int layout_behavior = 0x7f01001f; public static final int layout_dodgeInsetEdges = 0x7f010020; public static final int layout_insetEdge = 0x7f010021; public static final int layout_keyline = 0x7f010022; public static final int statusBarBackground = 0x7f010033; public static final int ttcIndex = 0x7f010036; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f02000f; public static final int notification_icon_bg_color = 0x7f020010; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f030000; public static final int compat_button_inset_vertical_material = 0x7f030001; public static final int compat_button_padding_horizontal_material = 0x7f030002; public static final int compat_button_padding_vertical_material = 0x7f030003; public static final int compat_control_corner_material = 0x7f030004; public static final int compat_notification_large_icon_max_height = 0x7f030005; public static final int compat_notification_large_icon_max_width = 0x7f030006; public static final int notification_action_icon_size = 0x7f030009; public static final int notification_action_text_size = 0x7f03000a; public static final int notification_big_circle_margin = 0x7f03000b; public static final int notification_content_margin_start = 0x7f03000c; public static final int notification_large_icon_height = 0x7f03000d; public static final int notification_large_icon_width = 0x7f03000e; public static final int notification_main_column_padding_top = 0x7f03000f; public static final int notification_media_narrow_margin = 0x7f030010; public static final int notification_right_icon_size = 0x7f030011; public static final int notification_right_side_padding_top = 0x7f030012; public static final int notification_small_icon_background_padding = 0x7f030013; public static final int notification_small_icon_size_as_large = 0x7f030014; public static final int notification_subtext_size = 0x7f030015; public static final int notification_top_pad = 0x7f030016; public static final int notification_top_pad_large_text = 0x7f030017; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f040034; public static final int notification_bg = 0x7f040035; public static final int notification_bg_low = 0x7f040036; public static final int notification_bg_low_normal = 0x7f040037; public static final int notification_bg_low_pressed = 0x7f040038; public static final int notification_bg_normal = 0x7f040039; public static final int notification_bg_normal_pressed = 0x7f04003a; public static final int notification_icon_background = 0x7f04003b; public static final int notification_template_icon_bg = 0x7f04003c; public static final int notification_template_icon_low_bg = 0x7f04003d; public static final int notification_tile_bg = 0x7f04003e; public static final int notify_panel_notification_icon_bg = 0x7f04003f; } public static final class id { private id() {} public static final int action_container = 0x7f050022; public static final int action_divider = 0x7f050023; public static final int action_image = 0x7f050024; public static final int action_text = 0x7f050025; public static final int actions = 0x7f050026; public static final int async = 0x7f05002b; public static final int blocking = 0x7f05002d; public static final int bottom = 0x7f05002e; public static final int chronometer = 0x7f050033; public static final int end = 0x7f050038; public static final int forever = 0x7f050056; public static final int icon = 0x7f050057; public static final int icon_group = 0x7f050058; public static final int info = 0x7f05005a; public static final int italic = 0x7f05005b; public static final int left = 0x7f05005c; public static final int line1 = 0x7f05005e; public static final int line3 = 0x7f05005f; public static final int none = 0x7f050062; public static final int normal = 0x7f050063; public static final int notification_background = 0x7f050064; public static final int notification_main_column = 0x7f050065; public static final int notification_main_column_container = 0x7f050066; public static final int right = 0x7f050068; public static final int right_icon = 0x7f050069; public static final int right_side = 0x7f05006a; public static final int start = 0x7f05006d; public static final int tag_transition_group = 0x7f050075; public static final int tag_unhandled_key_event_manager = 0x7f050076; public static final int tag_unhandled_key_listeners = 0x7f050077; public static final int text = 0x7f050078; public static final int text2 = 0x7f050079; public static final int time = 0x7f05007b; public static final int title = 0x7f05007c; public static final int top = 0x7f05007d; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f060002; } public static final class layout { private layout() {} public static final int notification_action = 0x7f070007; public static final int notification_action_tombstone = 0x7f070008; public static final int notification_template_custom_big = 0x7f07000f; public static final int notification_template_icon_group = 0x7f070010; public static final int notification_template_part_chronometer = 0x7f070014; public static final int notification_template_part_time = 0x7f070015; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f09003b; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0a000a; public static final int TextAppearance_Compat_Notification_Info = 0x7f0a000b; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0a000d; public static final int TextAppearance_Compat_Notification_Time = 0x7f0a0010; public static final int TextAppearance_Compat_Notification_Title = 0x7f0a0012; public static final int Widget_Compat_NotificationActionContainer = 0x7f0a0014; public static final int Widget_Compat_NotificationActionText = 0x7f0a0015; public static final int Widget_Support_CoordinatorLayout = 0x7f0a0016; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f010002 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] CoordinatorLayout = { 0x7f01001c, 0x7f010033 }; public static final int CoordinatorLayout_keylines = 0; public static final int CoordinatorLayout_statusBarBackground = 1; public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020, 0x7f010021, 0x7f010022 }; public static final int CoordinatorLayout_Layout_android_layout_gravity = 0; public static final int CoordinatorLayout_Layout_layout_anchor = 1; public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2; public static final int CoordinatorLayout_Layout_layout_behavior = 3; public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4; public static final int CoordinatorLayout_Layout_layout_insetEdge = 5; public static final int CoordinatorLayout_Layout_layout_keyline = 6; public static final int[] FontFamily = { 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f01000d, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010036 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
acc75327912ec71105503123ab0cf162d1397d1a
b695f3c3b8458ac3b2e7096fddfc81fcfd1c99f6
/buffalocart/src/test/java/pageobject/HomePage.java
45428c17bacdfe9ec12285aa9751be20e7d0457d
[]
no_license
AminaSha/bufallocart
b0532d592f5afcbff2d6e9ae5a0681f01ac1ba79
315cab3e8afa1641af9b859b7942583ed4b38937
refs/heads/main
2023-05-31T12:29:05.778475
2021-06-15T07:23:02
2021-06-15T07:23:02
377,072,606
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
package pageobject; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class HomePage { WebDriver driver; public HomePage(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); } @FindBy(xpath = "//*[@id='user-block']/div/div[1]/div/img") public WebElement logo; @FindBy(xpath = "/html/body/div[1]/header/nav/div[2]/ul[2]/li[3]/a/span") public WebElement accountname; }
bb6defb28d4b38a7a472a37879d6aa7179184781
b6f3285d60fe9e117a934914e2c577aa300a2cda
/usbSerialExamples/src/main/java/com/hoho/android/usbserial/examples/CustomProber.java
80eaf7134e6e3d613d2bf174df43a2886cbdebe2
[ "MIT" ]
permissive
mik3y/usb-serial-for-android
58ea88714ed62f25d38eb11aacd2b0f218c1d664
fd8c155ca5f69ec80f8f0ac28bb73ffc97b92511
refs/heads/master
2023-08-05T15:45:34.366869
2023-07-31T06:19:24
2023-07-31T06:19:24
11,079,679
4,188
1,427
MIT
2023-08-24T16:49:30
2013-06-30T23:17:45
Java
UTF-8
Java
false
false
786
java
package com.hoho.android.usbserial.examples; import com.hoho.android.usbserial.driver.FtdiSerialDriver; import com.hoho.android.usbserial.driver.ProbeTable; import com.hoho.android.usbserial.driver.UsbSerialProber; /** * add devices here, that are not known to DefaultProber * * if the App should auto start for these devices, also * add IDs to app/src/main/res/xml/device_filter.xml */ class CustomProber { static UsbSerialProber getCustomProber() { ProbeTable customTable = new ProbeTable(); customTable.addProduct(0x1234, 0x0001, FtdiSerialDriver.class); // e.g. device with custom VID+PID customTable.addProduct(0x1234, 0x0002, FtdiSerialDriver.class); // e.g. device with custom VID+PID return new UsbSerialProber(customTable); } }
3bb1b080b3fed1cb78013f0e5e342d10c319068a
83d802faadccecb716e51039d71a144f49db74ae
/app/src/main/java/com/sabaysongs/music/App.java
2f80e5a171c20e305cb96d6c4504cfcb8edfc376
[]
no_license
phuongphally/music-client
76687206190430e5b105144bf5e56397c784dad2
e7d8f6811554ee6e5b77fe0c1214a4292cd40da6
refs/heads/master
2021-01-22T08:58:56.455701
2017-02-27T16:01:16
2017-02-27T16:01:16
81,924,562
0
1
null
null
null
null
UTF-8
Java
false
false
968
java
package com.sabaysongs.music; import android.app.Application; import com.sabaysongs.music.model.FavoriteSongs; import com.sabaysongs.music.model.PlayList; import com.bumptech.glide.Glide; import static nl.qbusict.cupboard.CupboardFactory.cupboard; /** * Created by phuon on 17-Jan-17. */ public class App extends Application { static { cupboard().register(FavoriteSongs.class); cupboard().register(PlayList.class); } private static App sInstance; public App() { sInstance = this; } public static synchronized App getInstance() { return sInstance; } @Override public void onCreate() { super.onCreate(); } @Override public void onLowMemory() { super.onLowMemory(); Glide.get(this).clearMemory(); } @Override public void onTrimMemory(int level) { super.onTrimMemory(level); Glide.get(this).trimMemory(level); } }
405a5b5a968fc44089f08be0b83661935efb7790
157d3f99a43fcedabc59992895eb9373bef87ed2
/TopCoder/src/com/topcoder/problems/round156/PathFinding.java
a9f56ad31f0a835213ffd248421ec580aa90dd87
[]
no_license
KaustubhMani/TopCoder
7fd189c54a887939b575110409043e749fe84d12
a96715777000d0ff618de72223d59115bf2493fe
refs/heads/master
2021-01-20T04:51:07.046815
2017-04-02T01:34:13
2017-04-02T01:34:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,055
java
package com.topcoder.problems.round156; //http://community.topcoder.com/stat?c=problem_statement&pm=1110&rd=4585 public class PathFinding { char[][] grid = new char[24][24]; int nr, nc; int dist[][] = new int[24*24][24*24]; int queue[]= new int[24*24*24*24]; int qptr = 0, qtail = 0; int dr[] = {0,-1,-1,-1,0,0,1,1,1}; int dc[] = {0,-1,0,1,-1,1,-1,0,1}; static class Position { int ar; int ac; int br; int bc; int stepCount; Position(int ar, int ac, int br, int bc, int stepCount) { this.ar = ar; this.ac = ac; this.br = br; this.bc = bc; this.stepCount = stepCount; } } public int minTurns(String[] bd) { int rowLength = bd.length; int colLength = bd[0].length(); boolean[][][][] visited= new boolean[20][20][20][20]; int startARow = 0; int startACol = 0; int startBRow = 0; int startBCol = 0; int ar = 0; int ac = 0; int br = 0; int bc = 0; char[][] matrix = new char[rowLength][colLength]; int best = Integer.MAX_VALUE; for(int i = 0 ; i < bd.length ; i++) { for(int j = 0 ; j < bd[i].length() ; j++) { if (bd[i].charAt(j) == 'A') { ar = i; startARow = ar; ac = j; startACol = ac; } else if (bd[i].charAt(j) == 'B') { br = i; startBRow = br; bc = j; startBCol = bc; } else if (bd[i].charAt(j) == 'X') { matrix[i][j] = 'X'; } else if (bd[i].charAt(j) == '.') { matrix[i][j] = '.'; } } } Position[] queue = new Position[24*24*24*24]; int qstart = 0; int qend = 0; queue[qend++] = new Position(ar, ac, br, bc, 1); visited[ar][ac][br][bc] = true; while(qstart != qend) { Position pos = queue[qstart++]; ar = pos.ar; ac = pos.ac; br = pos.br; bc = pos.bc; int stepCount = pos.stepCount; for(int aRow = -1 ; aRow <=1 ; aRow++) { int arr = ar + aRow; if ( !(arr >= 0 && arr < rowLength)) { continue; } for(int aCol = -1 ; aCol <= 1 ; aCol ++) { int acc = ac + aCol; if ( !(acc >= 0 && acc < colLength)) { continue; } if (matrix[arr][acc] == 'X') continue; for(int bRow = -1 ; bRow <=1 ; bRow ++) { int brr = br + bRow; if ( !(brr >= 0 && brr < rowLength)) { continue; } for(int bCol = -1 ; bCol <=1 ; bCol ++) { int bcc = bc + bCol; if ( !(bcc >= 0 && bcc < colLength)) { continue; } if (matrix[brr][bcc] == 'X') continue; // check for path cross if (ar == brr && ac == bcc && br == arr && bc == acc) { continue; } // check if already visited if (visited[arr][acc][brr][bcc]) continue; // check for overlap if (arr == brr && acc == bcc) { continue; } if (arr == startBRow && acc == startBCol && brr == startARow && bcc == startACol) { if (stepCount < best) { best = stepCount; } } queue[qend++] = new Position(arr, acc, brr, bcc, stepCount+1); visited[arr][acc][brr][bcc] = true; } } } } } return best == Integer.MAX_VALUE ? -1 : best; } public int minTurns1(String[] bd) { int sa = 0, sb = 0; for (int r = 0; r < 24; r++) for (int c = 0; c < 24; c++) grid[r][c] = 'X'; nr = bd.length; nc = bd[0].length(); for (int r = 0; r < nr; r++) for (int c = 0; c < nc; c++) { grid[r+1][c+1] = bd[r].charAt(c); if (grid[r+1][c+1] == 'A') { sa = 24 * (r+1) + (c+1); grid[r+1][c+1] = '.'; } else if (grid[r+1][c+1] == 'B') { sb = 24 * (r+1) + (c+1); grid[r+1][c+1] = '.'; } } for (int i = 0; i < 24*24; i++) for (int j = 0; j < 24*24; j++) dist[i][j] = -1; dist[sa][sb] = 0; queue[qptr++] = sa * 24 * 24 + sb; while (qptr != qtail) { int cur = queue[qtail++]; int a = cur / (24 * 24); int b = cur % (24 * 24); int ar = a / 24, ac = a % 24; int br = b / 24, bc = b % 24; // System.out.println(dist[a][b] + ": " + ar + "," + ac + " " + br + "," + bc); for (int i = 0; i < 9; i++) { int arr = ar + dr[i], acc = ac + dc[i]; if (grid[arr][acc] == 'X') continue; for (int j = 0; j < 9; j++) { int brr = br + dr[j], bcc = bc + dc[j]; if (grid[brr][bcc] == 'X') continue; // System.out.println(" * " + arr + "," + acc + " " + brr + "," + bcc); // check for collision if (arr == brr && acc == bcc) continue; // check for swap positions if (ar == brr && ac == bcc && br == arr && bc == acc) continue; // check for duplicate position int aa = arr * 24 + acc; int bb = brr * 24 + bcc; if (dist[aa][bb] >= 0) continue; // new position dist[aa][bb] = dist[a][b] + 1; queue[qptr++] = aa * 24 * 24 + bb; } } } return dist[sb][sa]; } public static void main(String[] args) { int result = new PathFinding().minTurns(new String[]{"AB.................X", "XXXXXXXXXXXXXXXXXXX.", "X..................X", ".XXXXXXXXXXXXXXXXXXX", "X..................X", "XXXXXXXXXXXXXXXXXXX.", "X..................X", ".XXXXXXXXXXXXXXXXXXX", "X..................X", "XXXXXXXXXXXXXXXXXXX.", "X..................X", ".XXXXXXXXXXXXXXXXXXX", "X..................X", "XXXXXXXXXXXXXXXXXXX.", "X..................X", ".XXXXXXXXXXXXXXXXXXX", "X..................X", "XXXXXXXXXXXXXXXXXXX.", "...................X", ".XXXXXXXXXXXXXXXXXXX"} ); System.out.println(result); } }