blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9c44be621c3a28c5c51b9269f83161049c092c8b | 854b014c38735e3f525dde7d3ed7695fb636913e | /crawl/itcast-jd-crawler/itcast-jd-crawler/src/main/java/cn/lyj/crawler/Main.java | 741c3356a79d7781e3e5843cbcb0bf844280871d | [] | no_license | Ja0ck5/TransferStation | 3d67ca3431385d6c2a0d2184ca3235a1cebd8e05 | 8ff2251bb87e4836b6c7c50aa2bad17ee74fee51 | refs/heads/master | 2021-01-12T05:10:35.985028 | 2018-07-18T04:25:41 | 2018-07-18T04:25:41 | 77,881,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 881 | java | package cn.lyj.crawler;
import java.util.Map;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import cn.lyj.crawler.thread.ThreadPool;
/**
* 爬虫程序入口
*
* @author 传智播客 张志君
*
* @date 2014年12月18日 下午2:39:10
*
* @version V1.0
*/
public class Main {
public static ApplicationContext applicationContext;
public static void main(String[] args) throws Exception {
applicationContext = new ClassPathXmlApplicationContext("spring/applicationContext*.xml");
//从Spring容器中获取到所有可以执行的爬虫,并且放到线程池中执行
Map<String, Crawler> map = applicationContext.getBeansOfType(Crawler.class);
for (Crawler crawler : map.values()) {
ThreadPool.runInThread(crawler);
}
}
}
| [
"975117619@qq.com"
] | 975117619@qq.com |
612ca912a380ecf85b9cd35daa16db7ea4e2fbde | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_53350.java | 80d05a0ead04279077fe093c777e5bde42b92f73 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 211 | java | @Override public ResponseList<Status> getFavorites(Paging paging) throws TwitterException {
return factory.createStatusList(get(conf.getRestBaseURL() + "favorites/list.json",paging.asPostParameterArray()));
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
a0ca436b6e92aafcd5f8a271384e3cc991e99940 | aa7e736db31974af73b5a5a8bc820e7d5f3740fa | /06-Ejercicio/src/pkg06/ejercicio/Ejercicio.java | 803d7a7bdada3104c186c950d5b677aba5fcdceb | [] | no_license | edwardrain27/Java-programming | c7fc4f8cb3efa8bef68effdedd464a6bcc345f9c | 9e781b4428dcb53962a186552b57a23bea149c96 | refs/heads/main | 2023-06-26T20:31:50.088133 | 2021-08-06T20:07:26 | 2021-08-06T20:07:26 | 393,489,632 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 958 | 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 pkg06.ejercicio;
import java.util.Scanner;
/**
*
* @author Pablo
*/
public class Ejercicio {
/**
* @param args the command line arguments
*/
static Scanner entrada = new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
float nota1, nota2, nota3, definitiva = 0;
System.out.println("Digite la nota 1: ");
nota1 = entrada.nextFloat();
System.out.println("Digite la nota 2: ");
nota2 = entrada.nextFloat();
System.out.println("Digite la nota 3: ");
nota3 = entrada.nextFloat();
definitiva = (float) (nota1*0.3+nota2*0.6+nota3*0.1);
System.out.println("La nota definitiva es: "+definitiva);
}
}
| [
"pablo522648@gmail.com"
] | pablo522648@gmail.com |
fb409ac9f2696ecbdddef70b1bdaae342072fee3 | de29afc31926d01cd6d44f1763fa02aab3b92953 | /src/ardrone2/messages/UnknownMessage.java | a505076fb3f93cd91959bb2f39f6301c88dee303 | [
"Apache-2.0"
] | permissive | Koheiru/J-ARDrone2 | 5849ceca81f3c1b1e52aab3d25b983a55788142a | b45d53f1780ac124746cbfe3ac220da038f11c19 | refs/heads/master | 2020-05-31T06:50:39.007167 | 2015-03-08T22:49:28 | 2015-03-08T22:49:28 | 28,962,993 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,326 | java | /*
* Copyright 2015 Prostov Yury.
*
* 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 ardrone2.messages;
import ardrone2.Message;
/**
* Class UnknownMessage
* @author Prostov Yury
*/
public class UnknownMessage implements Message {
public int tag = 0;
public byte[] data = null;
public UnknownMessage() {
}
public UnknownMessage(int tag, byte[] data) {
this.tag = tag;
this.data = data;
}
@Override
public String toString() {
StringBuilder buffer = new StringBuilder();
buffer.append("[UnknownMessage]")
.append(" tag: 0x").append(Integer.toHexString(tag)).append(";")
.append(" data: [blob] with size ").append(data.length).append(";");
return buffer.toString();
}
}
| [
"prosto_yurik@mail.ru"
] | prosto_yurik@mail.ru |
a9ee3e81c09c44fea67f756c5c692ca1216a3636 | 8e9dc2fcfa71f26bed31d36980da94ab3422159b | /src/main/java/com/lsj/springboot/creational/factory/SimpleFactory/Car.java | 81a50cda8498c6efac9b81547007e04f6bbdd994 | [] | no_license | enterpriseih/DesignMode | b08a9226a720092d9c5351adce1e5b3c8c7e2b3e | 8891e1411115a8345bc3f575f5ad2007a7a20d8c | refs/heads/master | 2023-08-20T17:47:39.503804 | 2020-11-08T12:39:44 | 2020-11-08T12:39:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 177 | java | package com.lsj.springboot.creational.factory.SimpleFactory;
/**
* Created by 10326 on 2019/4/16.
*/
public interface Car {
public void run();
public void stop();
}
| [
"yuanshuaif@yonyou.com"
] | yuanshuaif@yonyou.com |
69b9608af638cb0c8e48930186520e423df7b00d | fc1c4b0f84adabce0fee36aec8435fb18374ce8b | /2°_VEZ/Proy2_compi/src/proy2_compi/Yylex.java | c9eda81bcf5e5628b6ea96027bceb54bb83a9ddf | [] | no_license | Ginny28/Compi1 | 1385bd0c31d947e5b9c11ef21bfe541c9f859642 | 9bcb606022b7cd5bb85ee936ef6391e88b8a8d90 | refs/heads/master | 2020-12-24T15:50:49.506977 | 2016-03-22T04:06:15 | 2016-03-22T04:06:15 | 54,294,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 32,129 | java | package proy2_compi;/* The following code was generated by JFlex 1.4.3 on 5/26/13 10:02 PM */
import java.lang.System;
import java.util.*;
import java_cup.runtime.*;
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.4.3
* on 5/26/13 10:02 PM from the specification file
* <tt>mate.lex</tt>
*/
public class Yylex implements java_cup.runtime.Scanner {
/** This character denotes the end of file */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
private static final int ZZ_BUFFERSIZE = 16384;
/** lexical states */
public static final int comD = 4;
public static final int YYINITIAL = 0;
public static final int comS = 2;
/**
* ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
* ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
* at the beginning of a line
* l is of the form l = 2*k, k a non negative integer
*/
private static final int ZZ_LEXSTATE[] = {
0, 0, 1, 1, 2, 2
};
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\11\0\1\46\1\45\2\0\1\46\22\0\1\22\4\0\1\44\2\0"+
"\1\26\1\27\1\42\1\41\1\37\1\34\1\3\1\43\12\2\1\35"+
"\1\36\1\33\1\32\1\31\2\0\1\11\1\4\1\16\1\7\1\6"+
"\1\20\2\4\1\21\2\4\1\17\1\10\1\15\1\25\1\13\1\4"+
"\1\14\1\24\1\12\1\23\1\30\4\4\3\1\1\40\1\5\1\1"+
"\1\11\1\4\1\16\1\7\1\6\1\20\2\4\1\21\2\4\1\17"+
"\1\10\1\15\1\25\1\13\1\4\1\14\1\24\1\12\1\23\1\30"+
"\4\4\uff85\0";
/**
* Translates characters to character classes
*/
private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
/**
* Translates DFA states to action switch labels.
*/
private static final int [] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\3\0\2\1\1\2\13\3\1\4\2\3\1\5\1\6"+
"\1\3\1\7\1\1\1\10\1\11\1\12\1\13\1\14"+
"\1\15\1\16\1\17\1\20\1\21\1\22\1\4\1\23"+
"\1\4\3\0\14\3\1\24\1\25\1\3\1\26\1\27"+
"\1\30\1\31\1\32\1\33\1\34\1\35\3\0\1\36"+
"\4\3\1\37\2\3\1\0\6\3\3\0\5\3\1\40"+
"\1\3\1\41\1\3\1\0\2\3\1\42\1\3\1\43"+
"\1\0\7\3\5\0\2\3\1\44\1\45\5\3\1\46"+
"\4\0\1\47\3\3\1\50\1\51\1\3\1\52\5\0"+
"\1\3\1\53\1\54\1\55\3\0\1\56\1\0\1\3"+
"\4\0\1\57\5\0\1\60\2\0\1\61\1\62\1\0"+
"\1\63";
private static int [] zzUnpackAction() {
int [] result = new int[168];
int offset = 0;
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
return result;
}
private static int zzUnpackAction(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/**
* Translates a state to a row index in the transition table
*/
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\47\0\116\0\165\0\234\0\303\0\352\0\u0111"+
"\0\u0138\0\u015f\0\u0186\0\u01ad\0\u01d4\0\u01fb\0\u0222\0\u0249"+
"\0\u0270\0\u0297\0\u02be\0\u02e5\0\165\0\165\0\u030c\0\u0333"+
"\0\u035a\0\u0381\0\u03a8\0\165\0\165\0\165\0\234\0\165"+
"\0\165\0\u03cf\0\165\0\165\0\165\0\165\0\u03f6\0\234"+
"\0\u041d\0\u0444\0\u046b\0\u0492\0\u04b9\0\u04e0\0\u0507\0\u052e"+
"\0\u0555\0\u057c\0\u05a3\0\u05ca\0\u05f1\0\u0618\0\u063f\0\352"+
"\0\u0666\0\165\0\165\0\165\0\165\0\165\0\165\0\165"+
"\0\165\0\u068d\0\u06b4\0\u06db\0\u0444\0\u0702\0\u0729\0\u0750"+
"\0\u0777\0\352\0\u079e\0\u07c5\0\u07ec\0\u0813\0\u083a\0\u0861"+
"\0\u0888\0\u08af\0\u08d6\0\u08fd\0\u0924\0\u094b\0\u0972\0\u0999"+
"\0\u09c0\0\u09e7\0\u0a0e\0\352\0\u0a35\0\165\0\u0a5c\0\u0a83"+
"\0\u0aaa\0\u0ad1\0\352\0\u0af8\0\165\0\u0b1f\0\u0b46\0\u0b6d"+
"\0\u0b94\0\u0bbb\0\u0be2\0\u0c09\0\u0c30\0\u0c57\0\u0c7e\0\u0ca5"+
"\0\u0ccc\0\u0cf3\0\u0d1a\0\u0d41\0\352\0\352\0\u0d68\0\u0d8f"+
"\0\u0db6\0\u0ddd\0\u0e04\0\352\0\u0e2b\0\u0e52\0\u0e79\0\u0ea0"+
"\0\165\0\u0ec7\0\u0eee\0\u0f15\0\352\0\352\0\u0f3c\0\352"+
"\0\u0f63\0\u0f8a\0\u0fb1\0\u0fd8\0\u0fff\0\u1026\0\352\0\352"+
"\0\352\0\u104d\0\u1074\0\u109b\0\165\0\u10c2\0\u10e9\0\u1110"+
"\0\u1137\0\u115e\0\u1185\0\352\0\u11ac\0\u11d3\0\u11fa\0\u1221"+
"\0\u1248\0\165\0\u126f\0\u1296\0\165\0\165\0\u12bd\0\165";
private static int [] zzUnpackRowMap() {
int [] result = new int[168];
int offset = 0;
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
return result;
}
private static int zzUnpackRowMap(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
result[j++] = high | packed.charAt(i++);
}
return j;
}
/**
* The transition table of the DFA
*/
private static final int [] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\1\4\1\5\1\6\1\4\1\7\1\5\1\10\1\11"+
"\1\12\1\13\1\7\1\14\1\15\1\16\1\17\1\7"+
"\1\20\1\21\1\22\1\7\1\23\1\24\1\25\1\26"+
"\1\27\1\30\1\31\1\32\1\33\1\34\1\35\1\36"+
"\1\37\1\40\1\41\1\42\1\43\1\44\1\22\45\45"+
"\1\46\43\45\1\47\1\4\3\45\50\0\1\50\1\0"+
"\1\51\16\50\1\0\3\50\2\0\1\50\7\0\1\50"+
"\10\0\1\6\1\52\44\0\1\50\1\53\1\51\16\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\11\7\1\54\4\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\2\7"+
"\1\55\13\7\1\0\3\7\2\0\1\7\7\0\1\50"+
"\7\0\1\50\1\53\1\51\15\7\1\56\1\0\3\7"+
"\2\0\1\7\7\0\1\50\7\0\1\50\1\53\1\51"+
"\11\7\1\57\4\7\1\0\3\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\5\7\1\60\10\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\2\7\1\61\13\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\16\7"+
"\1\0\2\7\1\62\2\0\1\7\7\0\1\50\7\0"+
"\1\50\1\53\1\51\5\7\1\63\10\7\1\0\3\7"+
"\2\0\1\7\7\0\1\50\7\0\1\50\1\53\1\51"+
"\15\7\1\64\1\0\1\65\2\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\11\7\1\66\4\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\30\0\1\22"+
"\23\0\1\22\1\0\1\50\1\53\1\51\15\7\1\67"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\10\7\1\70\5\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\5\7"+
"\1\71\10\7\1\0\3\7\2\0\1\7\7\0\1\50"+
"\40\0\1\72\46\0\1\73\45\0\1\74\1\75\45\0"+
"\1\76\57\0\1\77\1\100\46\0\1\101\11\0\1\102"+
"\1\0\1\103\2\0\1\104\35\0\1\105\46\0\1\53"+
"\1\0\16\53\1\0\3\53\2\0\1\53\17\0\1\50"+
"\1\53\1\51\6\7\1\106\7\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\12\7"+
"\1\107\1\7\1\110\1\7\1\0\3\7\2\0\1\7"+
"\7\0\1\50\7\0\1\50\1\53\1\51\2\7\1\111"+
"\13\7\1\0\3\7\2\0\1\7\7\0\1\50\7\0"+
"\1\50\1\53\1\51\3\7\1\112\12\7\1\0\3\7"+
"\2\0\1\7\7\0\1\50\7\0\1\50\1\53\1\51"+
"\10\7\1\113\5\7\1\0\3\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\6\7\1\114\7\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\16\7\1\0\3\7\1\115\1\0\1\7"+
"\7\0\1\50\7\0\1\50\1\53\1\51\3\7\1\116"+
"\12\7\1\0\3\7\2\0\1\7\7\0\1\50\7\0"+
"\1\50\1\53\1\51\11\7\1\117\4\7\1\0\3\7"+
"\2\0\1\7\7\0\1\50\7\0\1\50\1\53\1\51"+
"\11\7\1\120\4\7\1\0\3\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\12\7\1\121\3\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\11\7\1\122\4\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\12\7"+
"\1\123\3\7\1\0\3\7\2\0\1\7\7\0\1\50"+
"\15\0\1\124\50\0\1\125\51\0\1\126\33\0\1\50"+
"\1\53\1\51\2\7\1\127\13\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\13\7"+
"\1\130\1\7\1\131\1\0\3\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\15\7\1\132\1\0"+
"\3\7\2\0\1\7\7\0\1\50\7\0\1\50\1\53"+
"\1\51\11\7\1\133\4\7\1\0\3\7\2\0\1\7"+
"\7\0\1\50\7\0\1\50\1\53\1\51\5\7\1\134"+
"\10\7\1\0\3\7\2\0\1\7\7\0\1\50\7\0"+
"\1\50\1\53\1\51\16\7\1\0\2\7\1\135\2\0"+
"\1\7\7\0\1\50\35\0\1\136\20\0\1\50\1\53"+
"\1\51\2\7\1\137\13\7\1\0\3\7\2\0\1\7"+
"\7\0\1\50\7\0\1\50\1\53\1\51\16\7\1\140"+
"\3\7\2\0\1\7\7\0\1\50\7\0\1\50\1\53"+
"\1\51\12\7\1\141\3\7\1\0\3\7\2\0\1\7"+
"\7\0\1\50\7\0\1\50\1\53\1\51\13\7\1\142"+
"\2\7\1\0\3\7\2\0\1\7\7\0\1\50\7\0"+
"\1\50\1\53\1\51\16\7\1\0\2\7\1\143\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\15\7"+
"\1\144\1\0\3\7\2\0\1\7\7\0\1\50\15\0"+
"\1\145\51\0\1\146\51\0\1\145\32\0\1\50\1\53"+
"\1\51\10\7\1\147\5\7\1\0\3\7\2\0\1\7"+
"\7\0\1\50\7\0\1\50\1\53\1\51\5\7\1\150"+
"\10\7\1\0\3\7\2\0\1\7\7\0\1\50\7\0"+
"\1\50\1\53\1\51\4\7\1\151\11\7\1\0\3\7"+
"\2\0\1\7\7\0\1\50\7\0\1\50\1\53\1\51"+
"\11\7\1\152\4\7\1\0\3\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\6\7\1\153\7\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\10\7\1\154\5\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\11\7"+
"\1\155\4\7\1\0\3\7\2\0\1\7\7\0\1\50"+
"\15\0\1\156\1\157\2\0\1\160\4\0\1\161\3\0"+
"\1\162\23\0\1\50\1\53\1\51\15\7\1\163\1\0"+
"\3\7\2\0\1\7\7\0\1\50\7\0\1\50\1\53"+
"\1\51\16\7\1\0\1\164\2\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\16\7\1\0\2\7"+
"\1\165\2\0\1\7\7\0\1\50\14\0\1\145\41\0"+
"\1\50\1\53\1\51\16\7\1\0\2\7\1\166\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\10\7"+
"\1\167\5\7\1\0\3\7\2\0\1\7\7\0\1\50"+
"\7\0\1\50\1\53\1\51\5\7\1\170\10\7\1\0"+
"\3\7\2\0\1\7\7\0\1\50\7\0\1\50\1\53"+
"\1\51\15\7\1\171\1\0\3\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\10\7\1\172\5\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\11\7\1\173\4\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\5\7"+
"\1\174\10\7\1\0\3\7\2\0\1\7\7\0\1\50"+
"\14\0\1\175\61\0\1\176\36\0\1\177\60\0\1\200"+
"\44\0\1\201\26\0\1\50\1\53\1\51\16\7\1\0"+
"\2\7\1\202\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\15\7\1\203\1\0\3\7\2\0\1\7"+
"\7\0\1\50\7\0\1\50\1\53\1\51\5\7\1\204"+
"\10\7\1\0\3\7\2\0\1\7\7\0\1\50\7\0"+
"\1\50\1\53\1\51\13\7\1\205\2\7\1\0\3\7"+
"\2\0\1\7\7\0\1\50\7\0\1\50\1\53\1\51"+
"\10\7\1\206\5\7\1\0\3\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\5\7\1\207\10\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\16\7\1\0\2\7\1\210\2\0\1\7"+
"\7\0\1\50\24\0\1\211\1\0\1\212\34\0\1\213"+
"\54\0\1\214\47\0\1\215\32\0\1\50\1\53\1\51"+
"\11\7\1\216\4\7\1\0\3\7\2\0\1\7\7\0"+
"\1\50\7\0\1\50\1\53\1\51\10\7\1\217\5\7"+
"\1\0\3\7\2\0\1\7\7\0\1\50\7\0\1\50"+
"\1\53\1\51\10\7\1\220\5\7\1\0\3\7\2\0"+
"\1\7\7\0\1\50\7\0\1\50\1\53\1\51\16\7"+
"\1\0\1\7\1\221\1\7\2\0\1\7\7\0\1\50"+
"\25\0\1\222\50\0\1\223\42\0\1\224\42\0\1\225"+
"\53\0\1\226\31\0\1\50\1\53\1\51\2\7\1\227"+
"\13\7\1\0\3\7\2\0\1\7\7\0\1\50\17\0"+
"\1\230\52\0\1\231\43\0\1\232\55\0\1\233\26\0"+
"\1\50\1\53\1\51\16\7\1\0\1\7\1\234\1\7"+
"\2\0\1\7\7\0\1\50\22\0\1\235\53\0\1\236"+
"\41\0\1\237\57\0\1\240\32\0\1\241\51\0\1\242"+
"\43\0\1\243\52\0\1\244\45\0\1\245\56\0\1\246"+
"\30\0\1\247\64\0\1\250\22\0";
private static int [] zzUnpackTrans() {
int [] result = new int[4836];
int offset = 0;
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
return result;
}
private static int zzUnpackTrans(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
value--;
do result[j++] = value; while (--count > 0);
}
return j;
}
/* error codes */
private static final int ZZ_UNKNOWN_ERROR = 0;
private static final int ZZ_NO_MATCH = 1;
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String ZZ_ERROR_MSG[] = {
"Unkown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
/**
* ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
*/
private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\3\0\1\11\20\1\2\11\5\1\3\11\1\1\2\11"+
"\1\1\4\11\1\1\3\0\17\1\10\11\3\0\10\1"+
"\1\0\6\1\3\0\7\1\1\11\1\1\1\0\4\1"+
"\1\11\1\0\7\1\5\0\12\1\4\0\1\11\7\1"+
"\5\0\4\1\3\0\1\11\1\0\1\1\4\0\1\1"+
"\5\0\1\11\2\0\2\11\1\0\1\11";
private static int [] zzUnpackAttribute() {
int [] result = new int[168];
int offset = 0;
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
return result;
}
private static int zzUnpackAttribute(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/** the input device */
private java.io.Reader zzReader;
/** the current state of the DFA */
private int zzState;
/** the current lexical state */
private int zzLexicalState = YYINITIAL;
/** this buffer contains the current text to be matched and is
the source of the yytext() string */
private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
/** the textposition at the last accepting state */
private int zzMarkedPos;
/** the current text position in the buffer */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read
from input */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/**
* the number of characters from the last newline up to the start of the
* matched text
*/
private int yycolumn;
/**
* zzAtBOL == true <=> the scanner is currently at the beginning of a line
*/
private boolean zzAtBOL = true;
/** zzAtEOF == true <=> the scanner is at the EOF */
private boolean zzAtEOF;
/** denotes if the user-EOF-code has already been executed */
private boolean zzEOFDone;
/* user code: */
public static ArrayList Li= new ArrayList();
public static ArrayList Co= new ArrayList();
public static ArrayList Ca= new ArrayList();
public static ArrayList ki= new ArrayList();
public static ArrayList simbols = new ArrayList();
/**
* Creates a new scanner
* There is also a java.io.InputStream version of this constructor.
*
* @param in the java.io.Reader to read input from.
*/
public Yylex(java.io.Reader in) {
this.zzReader = in;
}
/**
* Creates a new scanner.
* There is also java.io.Reader version of this constructor.
*
* @param in the java.io.Inputstream to read input from.
*/
public Yylex(java.io.InputStream in) {
this(new java.io.InputStreamReader(in));
}
/**
* Unpacks the compressed character translation table.
*
* @param packed the packed character translation table
* @return the unpacked character translation table
*/
private static char [] zzUnpackCMap(String packed) {
char [] map = new char[0x10000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 144) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
do map[j++] = value; while (--count > 0);
}
return map;
}
/**
* Refills the input buffer.
*
* @return <code>false</code>, iff there was new input.
*
* @exception java.io.IOException if any I/O-Error occurs
*/
private boolean zzRefill() throws java.io.IOException {
/* first: make room (if you can) */
if (zzStartRead > 0) {
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRead;
zzCurrentPos-= zzStartRead;
zzMarkedPos-= zzStartRead;
zzStartRead = 0;
}
/* is the buffer big enough? */
if (zzCurrentPos >= zzBuffer.length) {
/* if not: blow it up */
char newBuffer[] = new char[zzCurrentPos*2];
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
zzBuffer = newBuffer;
}
/* finally: fill the buffer with new input */
int numRead = zzReader.read(zzBuffer, zzEndRead,
zzBuffer.length-zzEndRead);
if (numRead > 0) {
zzEndRead+= numRead;
return false;
}
// unlikely but not impossible: read 0 characters, but not at end of stream
if (numRead == 0) {
int c = zzReader.read();
if (c == -1) {
return true;
} else {
zzBuffer[zzEndRead++] = (char) c;
return false;
}
}
// numRead < 0
return true;
}
/**
* Closes the input stream.
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null)
zzReader.close();
}
/**
* Resets the scanner to read from a new input stream.
* Does not close the old reader.
*
* All internal variables are reset, the old input stream
* <b>cannot</b> be reused (internal buffer is discarded and lost).
* Lexical state is set to <tt>ZZ_INITIAL</tt>.
*
* @param reader the new input stream
*/
public final void yyreset(java.io.Reader reader) {
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
zzEOFDone = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = 0;
yyline = yychar = yycolumn = 0;
zzLexicalState = YYINITIAL;
}
/**
* Returns the current lexical state.
*/
public final int yystate() {
return zzLexicalState;
}
/**
* Enters a new lexical state
*
* @param newState the new lexical state
*/
public final void yybegin(int newState) {
zzLexicalState = newState;
}
/**
* Returns the text matched by the current regular expression.
*/
public final String yytext() {
return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
}
/**
* Returns the character at position <tt>pos</tt> from the
* matched text.
*
* It is equivalent to yytext().charAt(pos), but faster
*
* @param pos the position of the character to fetch.
* A value from 0 to yylength()-1.
*
* @return the character at position pos
*/
public final char yycharat(int pos) {
return zzBuffer[zzStartRead+pos];
}
/**
* Returns the length of the matched text region.
*/
public final int yylength() {
return zzMarkedPos-zzStartRead;
}
/**
* Reports an error that occured while scanning.
*
* In a wellformed scanner (no or only correct usage of
* yypushback(int) and a match-all fallback rule) this method
* will only be called with things that "Can't Possibly Happen".
* If this method is called, something is seriously wrong
* (e.g. a JFlex bug producing a faulty scanner etc.).
*
* Usual syntax/scanner level error handling should be done
* in error fallback rules.
*
* @param errorCode the code of the errormessage to display
*/
private void zzScanError(int errorCode) {
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
}
catch (ArrayIndexOutOfBoundsException e) {
message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
throw new Error(message);
}
/**
* Pushes the specified amount of characters back into the input stream.
*
* They will be read again by then next call of the scanning method
*
* @param number the number of characters to be read again.
* This number must not be greater than yylength()!
*/
public void yypushback(int number) {
if ( number > yylength() )
zzScanError(ZZ_PUSHBACK_2BIG);
zzMarkedPos -= number;
}
/**
* Contains user EOF-code, which will be executed exactly once,
* when the end of file is reached
*/
private void zzDoEOF() throws java.io.IOException {
if (!zzEOFDone) {
zzEOFDone = true;
yyclose();
}
}
/**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
*/
public java_cup.runtime.Symbol next_token() throws java.io.IOException {
int zzInput;
int zzAction;
// cached fields:
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
int [] zzTransL = ZZ_TRANS;
int [] zzRowMapL = ZZ_ROWMAP;
int [] zzAttrL = ZZ_ATTRIBUTE;
while (true) {
zzMarkedPosL = zzMarkedPos;
yychar+= zzMarkedPosL-zzStartRead;
boolean zzR = false;
for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL;
zzCurrentPosL++) {
switch (zzBufferL[zzCurrentPosL]) {
case '\u000B':
case '\u000C':
case '\u0085':
case '\u2028':
case '\u2029':
yyline++;
zzR = false;
break;
case '\r':
yyline++;
zzR = true;
break;
case '\n':
if (zzR)
zzR = false;
else {
yyline++;
}
break;
default:
zzR = false;
}
}
if (zzR) {
// peek one character ahead if it is \n (if we have counted one line too much)
boolean zzPeek;
if (zzMarkedPosL < zzEndReadL)
zzPeek = zzBufferL[zzMarkedPosL] == '\n';
else if (zzAtEOF)
zzPeek = false;
else {
boolean eof = zzRefill();
zzEndReadL = zzEndRead;
zzMarkedPosL = zzMarkedPos;
zzBufferL = zzBuffer;
if (eof)
zzPeek = false;
else
zzPeek = zzBufferL[zzMarkedPosL] == '\n';
}
if (zzPeek) yyline--;
}
zzAction = -1;
zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
zzState = ZZ_LEXSTATE[zzLexicalState];
zzForAction: {
while (true) {
if (zzCurrentPosL < zzEndReadL)
zzInput = zzBufferL[zzCurrentPosL++];
else if (zzAtEOF) {
zzInput = YYEOF;
break zzForAction;
}
else {
// store back cached positions
zzCurrentPos = zzCurrentPosL;
zzMarkedPos = zzMarkedPosL;
boolean eof = zzRefill();
// get translated positions and possibly new buffer
zzCurrentPosL = zzCurrentPos;
zzMarkedPosL = zzMarkedPos;
zzBufferL = zzBuffer;
zzEndReadL = zzEndRead;
if (eof) {
zzInput = YYEOF;
break zzForAction;
}
else {
zzInput = zzBufferL[zzCurrentPosL++];
}
}
int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
if (zzNext == -1) break zzForAction;
zzState = zzNext;
int zzAttributes = zzAttrL[zzState];
if ( (zzAttributes & 1) == 1 ) {
zzAction = zzState;
zzMarkedPosL = zzCurrentPosL;
if ( (zzAttributes & 8) == 8 ) break zzForAction;
}
}
}
// store back cached position
zzMarkedPos = zzMarkedPosL;
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
case 37:
{ simbols.add(yytext()); return new Symbol(sym.intgr,yyline,yychar,new String(yytext()));
}
case 52: break;
case 49:
{ simbols.add(yytext()); return new Symbol(sym.fdec,yyline,yychar,new String(yytext()));
}
case 53: break;
case 33:
{ simbols.add(yytext()); return new Symbol(sym.nao,yyline,yychar,new String(yytext()));
}
case 54: break;
case 1:
{ Li.add(yyline+1);
Co.add(yychar);
Ca.add(yytext());
ki.add("Lexico");
System.out.println("error lexico en " + (yyline+1) + "," + yychar + " No se reconoce " + yytext());
yychar=0;
}
case 55: break;
case 35:
{ simbols.add(yytext()); return new Symbol(sym.incluish,yyline,yychar,new String(yytext()));
}
case 56: break;
case 46:
{ simbols.add(yytext()); return new Symbol(sym.endfor,yyline,yychar,new String(yytext()));
}
case 57: break;
case 50:
{ simbols.add(yytext()); return new Symbol(sym.endwhile,yyline,yychar,new String(yytext()));
}
case 58: break;
case 31:
{ simbols.add(yytext()); return new Symbol(sym.y,yyline,yychar,new String(yytext()));
}
case 59: break;
case 48:
{ simbols.add(yytext()); return new Symbol(sym.findef,yyline,yychar,new String(yytext()));
}
case 60: break;
case 25:
{ simbols.add(yytext()); return new Symbol(sym.menori,yyline,yychar,new String(yytext()));
}
case 61: break;
case 3:
{ simbols.add(yytext()); return new Symbol(sym.ident,yyline,yychar,new String(yytext()));
}
case 62: break;
case 6:
{ simbols.add(yytext()); return new Symbol(sym.cerra,yyline,yychar,new String(yytext()));
}
case 63: break;
case 40:
{ simbols.add(yytext()); return new Symbol(sym.decimal,yyline,yychar,new String(yytext()));
}
case 64: break;
case 8:
{ simbols.add(yytext()); return new Symbol(sym.menor,yyline,yychar,new String(yytext()));
}
case 65: break;
case 12:
{ simbols.add(yytext()); return new Symbol(sym.coma,yyline,yychar,new String(yytext()));
}
case 66: break;
case 15:
{ simbols.add(yytext()); return new Symbol(sym.multi,yyline,yychar,new String(yytext()));
}
case 67: break;
case 2:
{ simbols.add(yytext()); return new Symbol(sym.numero,yyline,yychar,new Integer(yytext()));
}
case 68: break;
case 27:
{ yybegin(comD);
}
case 69: break;
case 32:
{ simbols.add(yytext()); return new Symbol(sym.fors,yyline,yychar,new String(yytext()));
}
case 70: break;
case 10:
{ simbols.add(yytext()); return new Symbol(sym.dpts,yyline,yychar,new String(yytext()));
}
case 71: break;
case 41:
{ simbols.add(yytext()); return new Symbol(sym.def,yyline,yychar,new String(yytext()));
}
case 72: break;
case 34:
{ simbols.add(yytext()); return new Symbol(sym.elses,yyline,yychar,new String(yytext()));
}
case 73: break;
case 51:
{ simbols.add(yytext()); return new Symbol(sym.finfuc,yyline,yychar,new String(yytext()));
}
case 74: break;
case 24:
{ simbols.add(yytext()); return new Symbol(sym.dif,yyline,yychar,new String(yytext()));
}
case 75: break;
case 26:
{ simbols.add(yytext()); return new Symbol(sym.cosito,yyline,yychar,new String(yytext()));
}
case 76: break;
case 5:
{ simbols.add(yytext()); return new Symbol(sym.abi,yyline,yychar,new String(yytext()));
}
case 77: break;
case 7:
{ simbols.add(yytext()); return new Symbol(sym.maior,yyline,yychar,new String(yytext()));
}
case 78: break;
case 38:
{ simbols.add(yytext()); return new Symbol(sym.strng,yyline,yychar,new String(yytext()));
}
case 79: break;
case 17:
{ simbols.add(yytext()); return new Symbol(sym.mod,yyline,yychar,new String(yytext()));
}
case 80: break;
case 16:
{ simbols.add(yytext()); return new Symbol(sym.div,yyline,yychar,new String(yytext()));
}
case 81: break;
case 28:
{ yybegin(comS);
}
case 82: break;
case 21:
{ simbols.add(yytext()); return new Symbol(sym.ou,yyline,yychar,new String(yytext()));
}
case 83: break;
case 47:
{ simbols.add(yytext()); return new Symbol(sym.func,yyline,yychar,new String(yytext()));
}
case 84: break;
case 29:
{ yybegin(YYINITIAL); yychar=0; System.out.println("ComD");
}
case 85: break;
case 45:
{ simbols.add(yytext()); return new Symbol(sym.whiles,yyline,yychar,new String(yytext()));
}
case 86: break;
case 9:
{ simbols.add(yytext()); return new Symbol(sym.menos,yyline,yychar,new String(yytext()));
}
case 87: break;
case 39:
{ simbols.add(yytext()); return new Symbol(sym.endif,yyline,yychar,new String(yytext()));
}
case 88: break;
case 43:
{ simbols.add(yytext()); return new Symbol(sym.inc,yyline,yychar,new String(yytext()));
}
case 89: break;
case 22:
{ simbols.add(yytext()); return new Symbol(sym.maiori,yyline,yychar,new String(yytext()));
}
case 90: break;
case 18:
{ yychar=0;
}
case 91: break;
case 19:
{ yybegin(YYINITIAL); yychar=0; System.out.println("ComS");
}
case 92: break;
case 42:
{ simbols.add(yytext()); return new Symbol(sym.reto,yyline,yychar,new String(yytext()));
}
case 93: break;
case 11:
{ simbols.add(yytext()); return new Symbol(sym.pyc,yyline,yychar,new String(yytext()));
}
case 94: break;
case 20:
{ simbols.add(yytext()); return new Symbol(sym.ifs,yyline,yychar,new String(yytext()));
}
case 95: break;
case 14:
{ simbols.add(yytext()); return new Symbol(sym.mais,yyline,yychar,new String(yytext()));
}
case 96: break;
case 13:
{ simbols.add(yytext()); return new Symbol(sym.pot,yyline,yychar,new String(yytext()));
}
case 97: break;
case 23:
{ simbols.add(yytext()); return new Symbol(sym.igual,yyline,yychar,new String(yytext()));
}
case 98: break;
case 36:
{ simbols.add(yytext()); return new Symbol(sym.voids,yyline,yychar,new String(yytext()));
}
case 99: break;
case 44:
{ simbols.add(yytext()); return new Symbol(sym.dec,yyline,yychar,new String(yytext()));
}
case 100: break;
case 4:
{
}
case 101: break;
case 30:
{ simbols.add(yytext()); return new Symbol(sym.real,yyline,yychar,new String(yytext()));
}
case 102: break;
default:
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
zzAtEOF = true;
zzDoEOF();
{ return new java_cup.runtime.Symbol(sym.EOF); }
}
else {
zzScanError(ZZ_NO_MATCH);
}
}
}
}
}
| [
"andy@localhost.localdomain"
] | andy@localhost.localdomain |
6d99d5f345146f06806570649ac197d8fbc558de | 81bf34f29ffa3606fb97b9fffad3f2c7f43188dc | /src/com/oldscape/shared/cache/type/hitmarks/HitMarkType.java | d077c67c0f1f4ae852f81613edb2afcc2d665107 | [] | no_license | Hc747/VirtueOS | 3f7d2d304fd697722381d807dcc2a9d1efe349fd | 4ff0fa920c6cd8021d3b780ab4ba645599e77b44 | refs/heads/master | 2020-03-23T01:31:05.925830 | 2018-07-05T12:30:55 | 2018-07-05T12:30:55 | 140,922,166 | 1 | 0 | null | 2018-07-14T06:30:38 | 2018-07-14T06:30:38 | null | UTF-8 | Java | false | false | 6,557 | java | /**
* Copyright (c) Kyle Fricilone
* <p>
* ChatCrownType is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.oldscape.shared.cache.type.hitmarks;
import com.oldscape.shared.cache.type.Type;
import com.oldscape.shared.utility.ByteBufferUtils;
import java.nio.ByteBuffer;
/**
* Created by Kyle Fricilone on Jun 1, 2017.
*/
public class HitMarkType implements Type {
private final int id;
@SuppressWarnings("unused")
private int anInt2125 = -1;
@SuppressWarnings("unused")
private int anInt2126 = 16777215;
@SuppressWarnings("unused")
private int anInt2127 = -1;
@SuppressWarnings("unused")
private int anInt2133 = -1;
private int spriteId = -1;
@SuppressWarnings("unused")
private int anInt2131 = -1;
@SuppressWarnings("unused")
private int anInt2123 = 0;
@SuppressWarnings("unused")
private String aString2134 = "";
@SuppressWarnings("unused")
private int anInt2139 = 70;
@SuppressWarnings("unused")
private int anInt2122 = 0;
@SuppressWarnings("unused")
private int anInt2119 = -1;
@SuppressWarnings("unused")
private int anInt2135 = -1;
@SuppressWarnings("unused")
private int anInt2136 = 0;
private int anInt2138 = -1;
private int anInt2132 = -1;
private int[] anIntArray2137;
public HitMarkType(int id) {
this.id = id;
}
/*
* (non-Javadoc)
*
* @see com.oldscape.shared.cache.type.Type#decode(java.nio.ByteBuffer)
*/
@Override
public void decode(ByteBuffer buffer) {
while (true) {
int opcode = buffer.get() & 0xFF;
if (opcode == 0)
break;
if (opcode == 1) {
anInt2125 = ByteBufferUtils.getSmartInt(buffer);
} else if (opcode == 2) {
anInt2126 = ByteBufferUtils.getMedium(buffer);
} else if (opcode == 3) {
anInt2127 = ByteBufferUtils.getSmartInt(buffer);
} else if (opcode == 4) {
anInt2133 = ByteBufferUtils.getSmartInt(buffer);
} else if (opcode == 5) {
spriteId = ByteBufferUtils.getSmartInt(buffer);
} else if (opcode == 6) {
anInt2131 = ByteBufferUtils.getSmartInt(buffer);
} else if (opcode == 7) {
anInt2123 = buffer.getShort();
} else if (opcode == 8) {
aString2134 = ByteBufferUtils.getPrefixedString(buffer);
} else if (opcode == 9) {
anInt2139 = buffer.getShort() & 0xFFFF;
} else if (opcode == 10) {
anInt2122 = buffer.getShort();
} else if (opcode == 11) {
anInt2119 = 0;
} else if (opcode == 12) {
anInt2135 = buffer.get() & 0xFF;
} else if (opcode == 13) {
anInt2136 = buffer.getShort();
} else if (opcode == 14) {
anInt2119 = buffer.getShort() & 0xFFFF;
} else if (opcode == 17) {
anInt2138 = buffer.getShort() & 0xFFFF;
if (anInt2138 == '\uffff') {
anInt2138 = -1;
}
anInt2132 = buffer.getShort() & 0xFFFF;
if (anInt2132 == '\uffff') {
anInt2132 = -1;
}
int length = buffer.get() & 0xFFFF;
anIntArray2137 = new int[length + 2];
for (int var3 = 0; var3 <= length; ++var3) {
anIntArray2137[var3] = buffer.getShort() & 0xFFFF;
if (anIntArray2137[var3] == '\uffff') {
anIntArray2137[var3] = -1;
}
}
anIntArray2137[length + 1] = -1;
} else if (opcode == 18) {
anInt2138 = buffer.getShort() & 0xFFFF;
if (anInt2138 == '\uffff') {
anInt2138 = -1;
}
anInt2132 = buffer.getShort() & 0xFFFF;
if (anInt2132 == '\uffff') {
anInt2132 = -1;
}
int var = buffer.getShort() & 0xFFFF;
if (var == '\uffff') {
var = -1;
}
int length = buffer.get() & 0xFF;
anIntArray2137 = new int[length + 2];
for (int var3 = 0; var3 <= length; ++var3) {
anIntArray2137[var3] = buffer.getShort() & 0xFFFF;
if (anIntArray2137[var3] == '\uffff') {
anIntArray2137[var3] = -1;
}
}
anIntArray2137[length + 1] = var;
}
}
}
/*
* (non-Javadoc)
*
* @see com.oldscape.shared.cache.type.Type#encode()
*/
@Override
public ByteBuffer encode() {
ByteBuffer buffer = ByteBuffer.allocate(1132);
return (ByteBuffer) buffer.flip();
}
/*
* (non-Javadoc)
*
* @see com.oldscape.shared.cache.type.Type#encode317()
*/
@Override
public ByteBuffer encode317() {
ByteBuffer buffer = ByteBuffer.allocate(1132);
return (ByteBuffer) buffer.flip();
}
/*
* (non-Javadoc)
*
* @see com.oldscape.shared.cache.type.Type#getID()
*/
@Override
public int getID() {
return id;
}
/**
* @return the spriteId
*/
public int getSpriteId() {
return spriteId;
}
}
| [
"iano2k4@hotmail.com"
] | iano2k4@hotmail.com |
c50f6f95b625d03b76ad0cc8ad2d9b567d44c432 | e05194ef3957c3f0107376f4538d95474d4cf2de | /requery/src/main/java/io/requery/query/element/SelectionElement.java | 9e233ab439b1330f8f9faf3fdf1dfadcc6a67a54 | [
"Apache-2.0"
] | permissive | jbenezech/requery | f6c68ab53cd3a9d1dc3b776ccc431b3361475a17 | c6c3881cda38269d1d5028e32b311851e8705da4 | refs/heads/master | 2022-09-21T22:17:08.127119 | 2020-06-04T09:10:33 | 2020-06-04T09:10:33 | 269,224,315 | 0 | 0 | Apache-2.0 | 2020-06-04T00:34:30 | 2020-06-04T00:34:30 | null | UTF-8 | Java | false | false | 803 | java | /*
* Copyright 2016 requery.io
*
* 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 io.requery.query.element;
import io.requery.query.Expression;
import java.util.Set;
public interface SelectionElement {
Set<? extends Expression<?>> getSelection();
boolean isDistinct();
}
| [
"npurushe@gmail.com"
] | npurushe@gmail.com |
b17ce1b326a46dd0323cdff75c429b1cd8e9ea87 | d9c05067ed4063e544cbade2a8a89187f938d22c | /src/test/java/edu/kis/powp/jobs2d/events/SelectTestFigureJoeOptionListener.java | 966165354f382958520a5733a1604ef0d37d965d | [] | no_license | tobiaszkubiak31/powp_jobs2d | 26de292bb59194475379723f2b8d101487e91767 | 9e6285aa84bb6056b09f19cfa7aca598e03794f7 | refs/heads/master | 2021-03-11T18:56:54.189210 | 2020-04-28T14:24:43 | 2020-04-28T14:24:43 | 246,551,961 | 0 | 0 | null | 2020-03-11T11:22:09 | 2020-03-11T11:22:09 | null | UTF-8 | Java | false | false | 1,168 | java | package edu.kis.powp.jobs2d.events;
import edu.kis.powp.jobs2d.drivers.adapter.DriverAdapter;
import edu.kis.powp.jobs2d.magicpresets.FiguresJane;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import edu.kis.powp.jobs2d.drivers.DriverManager;
import edu.kis.powp.jobs2d.magicpresets.FiguresJoe;
public class SelectTestFigureJoeOptionListener implements ActionListener {
private DriverManager driverManager;
private TestOption testOption;
public SelectTestFigureJoeOptionListener(DriverManager driverManager, TestOption testOption) {
this.driverManager = driverManager;
this.testOption = testOption;
}
@Override
public void actionPerformed(ActionEvent e) {
if (this.testOption == TestOption.FIGURE_JOE1) {
FiguresJoe.figureScript1(driverManager.getCurrentDriver());
} else if (this.testOption == TestOption.FIGURE_JOE2) {
FiguresJoe.figureScript2(driverManager.getCurrentDriver());
} else if (this.testOption == TestOption.FIGURE_JANE) {
FiguresJane.figureScript(new DriverAdapter(driverManager.getCurrentDriver()));
}
}
}
| [
"tobiaszkubiak31@gmail.com"
] | tobiaszkubiak31@gmail.com |
367e891c673eefa3678c1c6bebf24e2f0c3678d2 | bcf74354d62746d432ab16b4dbe5b4516b880a95 | /MineSwep.java | e92f35e8268d1f878ce25e44085a5bfff441bdfa | [
"Unlicense"
] | permissive | Ponny035/Java | ad0ca2b8b43f88662676d40c60892ade7c6be1ff | d712ca6db14f72cc6391e8b29cd2c53a96948996 | refs/heads/master | 2021-06-07T01:34:31.075076 | 2020-10-26T08:55:47 | 2020-10-26T08:55:47 | 105,981,231 | 1 | 2 | Unlicense | 2020-10-26T08:55:49 | 2017-10-06T08:08:45 | Java | UTF-8 | Java | false | false | 2,256 | java | import java.util.Scanner;
// public class MineSwep {
// public static void main(String[] args) {
// Scanner scan = new Scanner(System.in);
// System.out.print("Input your Row : ");
// int m = scan.nextInt();
// System.out.print("Input your Colum : ");
// int n = scan.nextInt();
// System.out.print("Input your Probility of the bomb : ");
// int p = scan.nextInt();
// int[][] table = new table[m][n];
// for (int i = 1; i <= n; i++ ) {
// for (int j = 1; j<= m; j++) {
// System.out.print(table[i][j]);
// }
// System.out.println();
// }
// }
// }
public class MineSwep{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Input your Row : ");
int m = scan.nextInt();
System.out.print("Input your Colum : ");
int n = scan.nextInt();
System.out.print("Input your Probility of the bomb : ");
double p = scan.nextDouble();
// game grid is [1..m][1..n], border is used to handle boundary cases
boolean[][] bombs = new boolean[m+2][n+2];
for (int i = 1; i <= m; i++)
for (int j = 1; j <= n; j++)
bombs[i][j] = (Math.random() < p);
// print game
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++)
if (bombs[i][j]) System.out.print("* ");
else System.out.print(". ");
System.out.println();
}
// sol[i][j] = # bombs adjacent to cell (i, j)
int[][] sol = new int[m+2][n+2];
for (int i = 1; i <= m; i++)
for (int j = 1; j <= n; j++)
// (ii, jj) indexes neighboring cells
for (int ii = i - 1; ii <= i + 1; ii++)
for (int jj = j - 1; jj <= j + 1; jj++)
if (bombs[ii][jj]) sol[i][j]++;
// print solution
System.out.println();
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if (bombs[i][j]) System.out.print("* ");
else System.out.print(sol[i][j] + " ");
}
System.out.println();
}
}
}
| [
"patipolsaechan@gmail.com"
] | patipolsaechan@gmail.com |
0d6746d8c8d9b9de9756525485b2f7deb766cd98 | 2ddbce5fe85c97c8383285aa9e6b15193d97e5d1 | /app/src/main/java/com/okipramitasari12gmail/ancobelajar/MainActivity.java | 9ee7e47f9964b12f8e49cf11345b4c06d2514b37 | [] | no_license | okiarora12/ancobelajar | 65c432a38ecb699ce5f0f06a7e2d5c4b68ed3015 | a05f3678def7fd1bf7f94d7d7a9408c6e670c7eb | refs/heads/master | 2020-06-18T00:50:23.154311 | 2019-07-10T02:17:37 | 2019-07-10T02:17:37 | 196,114,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package com.okipramitasari12gmail.ancobelajar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"50449272+okiarora12@users.noreply.github.com"
] | 50449272+okiarora12@users.noreply.github.com |
6989aaa9e1d7abb56c0c1abf3d76e3a5bd3976e2 | 8c21b3b71304e07066512099dad7776c809ac71b | /src/test/java/gjm/house/designPattern/createPattern/abstractFactoryPattern/ProductB.java | 6bcdd5d27c1c5a9231644361457a0970dd64f83d | [] | no_license | guanjm/house | b11dd84b706d376a300a531ada0bb2ac4c093a5e | f59b2a1c32ebd84481e5cc1bb3b745569c731473 | refs/heads/master | 2021-05-05T13:35:44.112024 | 2018-09-20T08:35:02 | 2018-09-20T08:35:02 | 118,401,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package gjm.house.designPattern.createPattern.abstractFactoryPattern;
/**
* 产品实现类
* @author guanjm
*
*/
public class ProductB implements IProduct {
@Override
public void function() {
System.out.println(" This is productB !");
}
}
| [
"Tim@LAPTOP-LLB0RT7S"
] | Tim@LAPTOP-LLB0RT7S |
420b6cf12a5a40b8124f73d5c7e2f916e59fce85 | c2f4891ef266b7fa666a82c49217c903c84c3c98 | /src/main/java/protobufdsl/parse/tree/Start.java | d28d04a7ce4a7f0ab9c5bfea23eb410e1c4c4472 | [] | no_license | jackcptdev/ProtobufDSL | 316f3c62a8bb4e4f3010062ab7e50281bc653b99 | 5b66338ebd843435c4c5d5ecb9de42f32d4662b4 | refs/heads/master | 2016-09-06T11:17:59.211698 | 2014-03-20T08:03:46 | 2014-03-25T03:38:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,204 | java | package protobufdsl.parse.tree;
import protobufdsl.common.Utils;
/**
* @author jackcptdev<jackcptdev@gmail.com>
* @version Feb 24, 2014 5:44:22 PM
*
*/
public class Start extends Node {
private final StatementList statementList;
public Start(StatementList statementList) {
Utils.checkNotNull(statementList);
this.statementList = statementList;
}
public StatementList getStatementList() {
return statementList;
}
@Override
public <R, C> R accept(AstVisitor<R, C> visitor, C context) throws AstVisitingException {
return visitor.visitStart(this, context);
}
@Override
public int hashCode() {
return this.statementList == null ? 0 : this.statementList.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
} else if ((obj == null) || (getClass() != obj.getClass())) {
return false;
}
Start o = (Start) obj;
return this.statementList.equals(o.getStatementList());
}
@Override
public String toString() {
return String.format("Start: %s", this.statementList.toString());
}
}
| [
"jackcptdev@gmail.com"
] | jackcptdev@gmail.com |
18c13406bbb16aec32932767e10d3488d38bb85a | f09ffdad84df1d8aec945a19abccc826ba5a089e | /src/main/java/com/pdmanager/interfaces/IBandTileManager.java | 4520bbbb5b3f4c7978e9834835acbeb12330eb83 | [] | no_license | grigas3/pdmanager | d68dbcb34bac0d727bf25f7b8022ea05f5a9ae20 | adf9736febc876b51ea799b72b0abaee85b25b09 | refs/heads/master | 2021-01-09T20:17:09.637536 | 2018-02-02T15:08:29 | 2018-02-02T15:08:29 | 65,290,668 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package com.pdmanager.interfaces;
/**
* Created by george on 21/1/2017.
*/
public interface IBandTileManager {
void createTile();
}
| [
"george.a.rigas@gmail.com"
] | george.a.rigas@gmail.com |
c5ec621293d948f3e972442db47eedd2a2b7382a | 95a285c20c00ce12a18214fb7b8da6795ba31d36 | /app/src/main/java/shopping/gd/com/yw/gdshoppingmail/ui/activity/obligation/ObligationActivity.java | 0bd011696224d3253b2a0a78958b9083fa0bd7d7 | [] | no_license | ywen8/GDShoppingMail | 9de786da5b5f67287558bfcb18b70f46f61ea9bb | 666b809542ff1f10857c07eb843e0fe15c5dc235 | refs/heads/master | 2021-09-05T15:04:12.834026 | 2018-01-29T04:01:37 | 2018-01-29T04:01:37 | 119,329,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,242 | java | package shopping.gd.com.yw.gdshoppingmail.ui.activity.obligation;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.RadioGroup;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import shopping.gd.com.yw.commonlib.utils.AppManager;
import shopping.gd.com.yw.gdshoppingmail.R;
import shopping.gd.com.yw.gdshoppingmail.ui.activity.BaseAppActivity;
import shopping.gd.com.yw.gdshoppingmail.ui.adapter.HomeFragmentPageAdapter;
import shopping.gd.com.yw.gdshoppingmail.ui.fragment.order.ConsignmentFragment;
import shopping.gd.com.yw.gdshoppingmail.ui.fragment.order.ObligationFragment;
import shopping.gd.com.yw.gdshoppingmail.ui.fragment.order.OwnFinishFragment;
import shopping.gd.com.yw.gdshoppingmail.ui.fragment.order.OwnOrderFragment;
import shopping.gd.com.yw.gdshoppingmail.ui.fragment.order.ReceiveFragment;
import shopping.gd.com.yw.gdshoppingmail.ui.fragment.order.RefundFragment;
import shopping.gd.com.yw.gdshoppingmail.view.ScrollviewPager;
/**
* Created by yw on 2018/1/18.
*/
public class ObligationActivity extends BaseAppActivity {
@BindView(R.id.activity_obliation_content_vg)
ScrollviewPager obligation_vg;
@BindView(R.id.activity_obliation_content_tab)
RadioGroup obligation_tab;
@BindView(R.id.activity_obliation_ownorder_v)
View ownorder_v;
@BindView(R.id.activity_obliation_obliga_v)
View obliga_v;
@BindView(R.id.activity_obliation_consignment_v)
View consignment_v;
@BindView(R.id.activity_obliation_receiving_v)
View receiving_v;
@BindView(R.id.activity_obliation_refund_v)
View refund_v;
@BindView(R.id.activity_obliation_finish_v)
View finish_v;
private ArrayList<String> mTitleList = new ArrayList<>(6);
private ArrayList<Fragment> mFragments = new ArrayList<>(6);
private HomeFragmentPageAdapter adapter;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_obligation);
ButterKnife.bind(this);
AppManager.getAppManager().addActivity(this);
init();
}
private void init() {
initFragmentList();
obligation_tab.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.activity_obliation_ownorder:
obligation_vg.setCurrentItem(0);
break;
case R.id.activity_obliation_obliga:
obligation_vg.setCurrentItem(1);
break;
case R.id.activity_obliation_consignment:
obligation_vg.setCurrentItem(2);
break;
case R.id.activity_obliation_receiving:
obligation_vg.setCurrentItem(3);
break;
case R.id.activity_obliation_refund:
obligation_vg.setCurrentItem(4);
break;
case R.id.activity_obliation_finish_all:
obligation_vg.setCurrentItem(5);
break;
}
}
});
adapter = new HomeFragmentPageAdapter(getSupportFragmentManager(), mFragments, mTitleList);
obligation_vg.setAdapter(adapter);
obligation_vg.setCurrentItem(0);
obligation_vg.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
switch (position) {
case 0:
obligation_tab.check(R.id.activity_obliation_ownorder);
ownorder_v.setBackgroundColor(getResources().getColor(R.color.white));
obliga_v.setBackgroundColor(getResources().getColor(R.color.transparent));
consignment_v.setBackgroundColor(getResources().getColor(R.color.transparent));
receiving_v.setBackgroundColor(getResources().getColor(R.color.transparent));
refund_v.setBackgroundColor(getResources().getColor(R.color.transparent));
finish_v.setBackgroundColor(getResources().getColor(R.color.transparent));
break;
case 1:
obligation_tab.check(R.id.activity_obliation_obliga);
ownorder_v.setBackgroundColor(getResources().getColor(R.color.transparent));
obliga_v.setBackgroundColor(getResources().getColor(R.color.white));
consignment_v.setBackgroundColor(getResources().getColor(R.color.transparent));
receiving_v.setBackgroundColor(getResources().getColor(R.color.transparent));
refund_v.setBackgroundColor(getResources().getColor(R.color.transparent));
finish_v.setBackgroundColor(getResources().getColor(R.color.transparent));
break;
case 2:
obligation_tab.check(R.id.activity_obliation_consignment);
ownorder_v.setBackgroundColor(getResources().getColor(R.color.transparent));
obliga_v.setBackgroundColor(getResources().getColor(R.color.transparent));
consignment_v.setBackgroundColor(getResources().getColor(R.color.white));
receiving_v.setBackgroundColor(getResources().getColor(R.color.transparent));
refund_v.setBackgroundColor(getResources().getColor(R.color.transparent));
finish_v.setBackgroundColor(getResources().getColor(R.color.transparent));
break;
case 3:
obligation_tab.check(R.id.activity_obliation_receiving);
ownorder_v.setBackgroundColor(getResources().getColor(R.color.transparent));
obliga_v.setBackgroundColor(getResources().getColor(R.color.transparent));
consignment_v.setBackgroundColor(getResources().getColor(R.color.transparent));
receiving_v.setBackgroundColor(getResources().getColor(R.color.white));
refund_v.setBackgroundColor(getResources().getColor(R.color.transparent));
finish_v.setBackgroundColor(getResources().getColor(R.color.transparent));
break;
case 4:
obligation_tab.check(R.id.activity_obliation_refund);
ownorder_v.setBackgroundColor(getResources().getColor(R.color.transparent));
obliga_v.setBackgroundColor(getResources().getColor(R.color.transparent));
consignment_v.setBackgroundColor(getResources().getColor(R.color.transparent));
receiving_v.setBackgroundColor(getResources().getColor(R.color.transparent));
refund_v.setBackgroundColor(getResources().getColor(R.color.white));
finish_v.setBackgroundColor(getResources().getColor(R.color.transparent));
break;
case 5:
obligation_tab.check(R.id.activity_obliation_finish_all);
ownorder_v.setBackgroundColor(getResources().getColor(R.color.transparent));
obliga_v.setBackgroundColor(getResources().getColor(R.color.transparent));
consignment_v.setBackgroundColor(getResources().getColor(R.color.transparent));
receiving_v.setBackgroundColor(getResources().getColor(R.color.transparent));
refund_v.setBackgroundColor(getResources().getColor(R.color.transparent));
finish_v.setBackgroundColor(getResources().getColor(R.color.white));
break;
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
private void initFragmentList() {
if (mTitleList.size() != 0) {
return;
}
mTitleList.add("全部订单");
mTitleList.add("待付款");
mTitleList.add("待发货");
mTitleList.add("待收货");
mTitleList.add("退款/退货");
mTitleList.add("已完成");
mFragments.add(new OwnOrderFragment());
mFragments.add(new ObligationFragment());
mFragments.add(new ConsignmentFragment());
mFragments.add(new ReceiveFragment());
mFragments.add(new RefundFragment());
mFragments.add(new OwnFinishFragment());
}
}
| [
"381226310@qq.com"
] | 381226310@qq.com |
ecaa1f6f979bcef320199ea0654a08a943e0d5b9 | 5920532e9a0377a779cb7525b394928e8504ce81 | /ejercicios_practicaprc3/PruebaDoctor.java | 5e6e929d9b8814d22fb13cb440bafce5d7b61ee7 | [] | no_license | kodemakerDor/Java_programming | d1cf2aa161e6c09d7e09eb7a594a8c8edf63cb66 | c80a1a11a962ff9be5cf5cf24c07f90c19b1ec5e | refs/heads/master | 2021-12-22T11:22:30.744139 | 2017-10-12T19:30:31 | 2017-10-12T19:30:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,181 | java |
package ejercicios_practicaprc3;
/*
* @author Fabian Camp Mussa
*
* Date: April 19, 2017.
*/
public class PruebaDoctor {
public static void main(String[] args) {
Fecha fecha1 = new Fecha(12, 2, 1963);
Fecha fecha2 = new Fecha(3, 8, 1966);
Fecha fecha3 = new Fecha(16, 10, 1985);
Fecha fecha4 = new Fecha(1, 8, 1966);
Fecha fecha5 = new Fecha(16, 12, 1970);
Fecha fecha6 = new Fecha(4, 3, 1960);
Doctor angelica = new Doctor("Angelica", "Chavez", fecha1, "A23B2", "cardiologia", 23000.0, 2);
Doctor marco = new Doctor("Marco", "Gutierrez", fecha2, "G316C", "neurologia", 25000.0, 5);
Doctor mary = new Doctor("Mary", "Blanco", fecha3, "B987D", "oncologia", 15000.0, 4);
Doctor sergio = new Doctor("Sergio", "Suarez", fecha4, "N892D", "pediatria", 30000.0, 2);
Doctor irene = new Doctor("Irene", "Ruiz", fecha5, "I386J", "oncologia", 12000.0, 1);
Doctor ernesto = new Doctor("Ernesto", "Anaya", fecha6, "E776M", "gastroenterologia", 2000.0, 1);
System.out.println("\n" + angelica.toString());
System.out.println("\n" + marco.toString());
System.out.println("\n" + mary.toString());
System.out.println("\n" + sergio.toString());
System.out.println("\n" + irene.toString());
System.out.println("\n" + ernesto.toString());
System.out.println("\nEl total de doctores registrados es: " + Doctor.totalDoctores());
ernesto.setTotalAsociaciones(3);
System.out.println("\n\nActualizando los datos de Ernesto: \n" + ernesto.toString());
marco.setPagoBase(30000.0);
System.out.println("\n\nActualizando los datos de Marco: \n" + marco.toString());
sergio.setPagoBase(40000.0);
System.out.println("\n\nActualizando los datos de Sergio: \n" + sergio.toString());
mary.setTotalAsociaciones(2);
System.out.println("\n\nActualizando los datos de Mary: \n" + mary.toString());
System.out.println("\n\n");
}
}
| [
"fabian.camp@yahoo.com"
] | fabian.camp@yahoo.com |
78de9183591c19019ede414f6c98111f84f89447 | 7cb911221220d93b131f0ec73e53543ef13f49fd | /spring-boot-app/spring-boot-app/src/main/java/com/appslab/springbootapp/Components/DependencyInjectionDemo.java | 188c561421f93e8d5b2c5eab4bb94e50957026fb | [] | no_license | romankalab/Spring | 1bdbb0f59b948d3b686a7ff5572065ad2f989d9e | a9b38fa289c94081a87f1211aa2f9a4eae94cbee | refs/heads/master | 2023-04-05T22:30:49.100969 | 2021-04-12T12:08:51 | 2021-04-12T12:08:51 | 320,214,809 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,322 | java | package com.appslab.springbootapp.Components;
import com.appslab.springbootapp.Employee.Employee;
import com.appslab.springbootapp.Employee.Driver;
import com.appslab.springbootapp.Employee.EmployeeService;
import com.appslab.springbootapp.Employee.Programmer;
import com.appslab.springbootapp.Employee.Teacher;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
@Component
public class DependencyInjectionDemo {
EmployeeService employeeService;
public DependencyInjectionDemo(EmployeeService employeeService) {
this.employeeService = employeeService;
Programmer programmer = new Programmer(1254, 65);
Teacher teacher = new Teacher(854, 36);
Driver driver = new Driver(750, 41);
List<Employee> employees = Arrays.asList(programmer, teacher, driver);
System.out.println();
System.out.println();
for(Employee person : employees)
{
person.getInfo();
}
System.out.println("The summary of all salaries and bonuses is: " + getSum(employees));
employeeService.writeNumber();
}
float getSum(List<Employee> employees)
{
return (float) (employeeService.getTotalBonus(employees) + employeeService.getTotalSalary(employees));
}
} | [
"roan.kalabgmail.com"
] | roan.kalabgmail.com |
23f6104422d67ac6a22cd2bd60e8a8e9cd26e9fd | b4610b9965a9b6dea25f5b65f799e9060c1bc6b0 | /ATM-repo/src/Transaction.java | 6b2dcb7662caa6f52333a998ce3fdcd427cf194a | [] | no_license | KarimElsayad247/Term-4-Programming-Assignments | 40072eca566a33459973e02294e36d617fadbde9 | 7499260031c8156a40d7e478851c65181345f91e | refs/heads/master | 2022-11-14T07:07:40.377376 | 2020-07-10T09:49:45 | 2020-07-10T09:49:45 | 278,596,789 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | public class Transaction {
private String type;
private double value;
public String getType() {
return type;
}
public double getValue() {
return value;
}
public Transaction(String type, double value) {
this.type = type;
this.value = value;
}
}
| [
"karimelsayad1999@gmail.com"
] | karimelsayad1999@gmail.com |
fe1545c24177c85b8794499657238eae36735e72 | 6083f58004a955b65cb55e1e0255bb6b2ea10616 | /dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/mvn/AnnotationMojo.java | 79b5c65f312e086c1561a66449f1a9709b9e3e85 | [
"Apache-2.0",
"JSON"
] | permissive | OIUE/felix | 663e27d4d0c4dc8cb00dc3923356e94c5d875ca8 | 6e503154134daee2ddff38c035a7fe4fef128169 | refs/heads/trunk | 2021-01-18T13:35:44.614495 | 2018-04-29T10:21:06 | 2018-04-29T10:21:06 | 14,945,428 | 0 | 0 | null | 2018-04-29T10:39:19 | 2013-12-05T06:06:27 | Java | UTF-8 | Java | false | false | 9,644 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.felix.dm.annotation.plugin.mvn;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Set;
import org.apache.felix.dm.annotation.plugin.bnd.DescriptorGenerator;
import org.apache.maven.model.Build;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import aQute.bnd.osgi.Analyzer;
import aQute.bnd.osgi.Jar;
import aQute.bnd.osgi.Resource;
/**
* The <code>AnnotationMojo</code>
* generates a Dependency Manager component descriptor file based on annotations found from java classes.
*
* @goal scan
* @phase package
* @description Build DependencyManager component descriptors from class annotations.
* @requiresDependencyResolution compile
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public class AnnotationMojo extends AbstractMojo
{
/**
* The Maven project.
*
* @parameter expression="${project}"
* @required
* @readonly
*/
private MavenProject m_project;
/**
* The target extension
*
* @parameter default-value="jar"
* @required
*/
private String m_artifactExtension;
/**
* If set, configures the log level.
*
* @parameter alias="log"
*/
private String m_log;
/**
* If set, configures if we must auto generate Import-Service/Export-Service headers.
*
* @parameter alias="build-import-export-service" default-value="true"
*/
private boolean m_buildImportExportService;
/**
* The maven project bas directory, used when generating metadata in maven project directory.
*
* @parameter expression="${project.basedir}"
* @required
* @readonly
*/
private File m_projectBaseDir;
/**
* If set, configures the output directory where generated descriptor files are generated.
*
* @parameter alias="generated-output-dir"
*/
private String m_generatedOutputDir;
/**
* "Import-Service" osgi header
*/
private static final String IMPORT_SERVICE = "Import-Service";
/**
* "Export-Service" osgi header
*/
private static final String EXPORT_SERVICE = "Export-Service";
/**
* Executes this mojo. We'll use the bnd library in order to scan classes
* from our target bundle.
*/
public void execute() throws MojoExecutionException
{
Analyzer analyzer = null;
Jar jar = null;
try
{
// Get the name of our target bundle we are parsing for annotations.
File target = getBundleName();
getLog().info("Generating DM component descriptors for bundle " + target);
// Create a bnd analyzer and analyze our target bundle classes.
analyzer = new Analyzer();
analyzer.setJar(target);
analyzer.analyze();
// This helper class will parse classes using the analyzer we just created.
DescriptorGenerator generator = new DescriptorGenerator(analyzer, new MvnLogger(getLog(), m_log));
// Start scanning
if (generator.execute())
{
// Some annotations have been parsed.
// Add the list of generated component descriptors in our
// special header.
jar = analyzer.getJar();
jar.getManifest().getMainAttributes()
.putValue( "DependencyManager-Component", generator.getDescriptorPaths() );
// Add generated descriptors into the target bundle (we'll use a
// temp file).
Map<String, Resource> resources = generator.getDescriptors();
for (Map.Entry<String, Resource> entry : resources.entrySet())
{
addResource(entry.getKey(), entry.getValue().openInputStream());
jar.putResource(entry.getKey(), entry.getValue());
}
Resource metaType = generator.getMetaTypeResource();
if (metaType != null)
{
addResource("OSGI-INF/metatype/metatype.xml", metaType.openInputStream());
jar.putResource("OSGI-INF/metatype/metatype.xml", metaType);
}
// Possibly set the Import-Service/Export-Service header
if (m_buildImportExportService)
{
// Don't override Import-Service header, if it is found from
// the bnd directives.
if (jar.getManifest().getMainAttributes().getValue(IMPORT_SERVICE) == null)
{
buildImportExportService(jar, IMPORT_SERVICE, generator.getImportService());
}
// Don't override Export-Service header, if already defined
if (jar.getManifest().getMainAttributes().getValue(EXPORT_SERVICE) == null)
{
buildImportExportService(jar, EXPORT_SERVICE, generator.getExportService());
}
}
copy(jar, target);
}
}
catch (MojoExecutionException e)
{
throw e;
}
catch (Throwable t)
{
getLog().error("Exception while scanning annotation", t);
throw new MojoExecutionException(t.getMessage(), t.getCause());
}
finally
{
if (jar != null)
{
jar.close();
}
}
}
/**
* Adds a resource file into the project base directory
* @param key
* @param in
* @throws IOException
*/
private void addResource(String key, InputStream in) throws IOException
{
if (m_generatedOutputDir != null) {
File descriptorFile = new File( m_projectBaseDir + File.separator + m_generatedOutputDir, key );
descriptorFile.getParentFile().mkdirs();
BufferedInputStream bin = new BufferedInputStream( in );
BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( descriptorFile ) );
int b;
while ( ( b = bin.read() ) != -1 )
{
out.write( b );
}
out.close();
bin.close();
}
}
private void buildImportExportService(Jar jar, String header, Set<String> services) throws Exception
{
getLog().info("building " + header + " header with the following services: " + services);
if (services.size() > 0)
{
StringBuilder sb = new StringBuilder();
for (String service : services)
{
sb.append(service);
sb.append(",");
}
sb.setLength(sb.length() - 1); // skip last comma
jar.getManifest().getMainAttributes().putValue(header, sb.toString());
}
}
/**
* Returns the target name of this maven project.
*
* @return the target name of this maven project.
*/
private File getBundleName()
{
Build build = m_project.getBuild();
return new File(build.getDirectory() + File.separator + build.getFinalName() + "."
+ m_artifactExtension);
}
/**
* Copy the generated jar into our target bundle.
*
* @param jar the jar with the generated component descriptors
* @param target our target bundle
* @throws MojoExecutionException on any errors
* @throws Exception on any error
*/
private void copy(Jar jar, File target) throws MojoExecutionException, Exception
{
File tmp = new File(getBundleName() + ".tmp");
try
{
if (tmp.exists())
{
if (!tmp.delete())
{
throw new MojoExecutionException("Could not remove " + tmp);
}
}
jar.write(tmp);
jar.close();
if (target.exists() && !target.delete())
{
throw new MojoExecutionException("Could not remove " + target);
}
if (!tmp.renameTo(target))
{
throw new MojoExecutionException("Could not rename " + tmp + " to " + target);
}
}
finally
{
jar.close();
if (tmp.exists() && !tmp.delete())
{
throw new MojoExecutionException("Could not remove " + tmp);
}
}
}
}
| [
"pderop@apache.org"
] | pderop@apache.org |
63e5e3a0bada72cbf5084c469b7b13ed0d964d28 | b660e4a0485e6b724751f2412e9501fce03382ea | /src/Selenium_Training/S08_Lession49_Handle_dynamic_drop_downs.java | 39a82bf37c521d53c48c34189fe60dfc2863ed71 | [] | no_license | Ian-Chan-888/Projects---Selenium | cfbb477663b9aa327fe2f53d9e563dd948a637d0 | 70ecf48ad858c49f7609925ff43eb56d555c22b9 | refs/heads/master | 2021-12-14T22:28:53.414961 | 2019-12-09T02:21:16 | 2019-12-09T02:21:16 | 222,168,045 | 0 | 0 | null | 2021-12-14T21:37:29 | 2019-11-16T22:38:39 | HTML | UTF-8 | Java | false | false | 1,477 | java | package Selenium_Training;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class S08_Lession49_Handle_dynamic_drop_downs {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\eclipse\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://spicejet.com");// go to url
driver.manage().window().maximize();// max browser window
// Note: I was getting element not intractable when the window is a smaller
// size. I noticed that the drop down menu style changes when it is small in
// size vs max windows size.
// by maximizing the window i was able to avoid this error.
// //a[@value='MAA'] - Xpath for Chennai
// // a[@value='BLR']
driver.findElement(By.id("ctl00_mainContent_ddl_originStation1_CTXT")).clear(); // this will open the first
// drop-down
driver.findElement(By.xpath("//a[@value='BLR']")).click(); // this selects the Bengaluru (BLR) in the 'From'
// field
Thread.sleep(2000);
/*
* this xpath element "MAA" has 2 elements and thus you need to define which one
* you need to use to be accurate. then use
*
* (xpath)[2] example --> "(//a[@value='MAA'])[2]"
*
*/
driver.findElement(By.xpath("(//a[@value='MAA'])[2]")).click();
System.out.println("Passed");
// driver.close();
}
} | [
"iyc122@gmail.com"
] | iyc122@gmail.com |
cdf1a10a79bbcdc8654102508740e9ee87894989 | 50355ccb4feabd92ea4c3923963e995db3af4e83 | /src/cards/card/transition/QuestionSelectedTransition.java | 8c72ab763ac11cf07ae80bf334fa768c79fd576b | [] | no_license | jammie1903/CardsAgainstNormallity | 5f760e3296497cda2e74bf3a619042c293f7cfb4 | 55c5f1d9020d5cf089105904ac4eceecf2b69f83 | refs/heads/master | 2020-12-24T07:19:49.163673 | 2016-06-13T13:28:31 | 2016-06-13T13:28:31 | 60,776,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 460 | java | package cards.card.transition;
import javafx.animation.Transition;
import javafx.scene.effect.Glow;
import javafx.util.Duration;
public class QuestionSelectedTransition extends Transition {
private Glow glow;
public QuestionSelectedTransition(Glow glow) {
setCycleDuration(Duration.seconds(0.5));
this.glow = glow;
}
@Override
protected void interpolate(double fraction) {
glow.setLevel(0.5 * fraction);
}
} | [
"jamiepennell@live.com"
] | jamiepennell@live.com |
8c07efb797ac264b7d3cfae7ab22cbfd5d6a4b53 | 97a128204bf44b524c7359b6d4f932ecda474fd7 | /app/src/test/java/sg/edu/rp/c346/id19032110/demomysecondapp/ExampleUnitTest.java | efb32f76cb9a1dbabbd252abd30d4b8c91c8f287 | [] | no_license | OngJunJieRP/Demo_My_Second_App | a72e617ea46db8f15bd6ee0c76e89aead257a9fe | 1882e754389e4219e9f24cca644224f24cbeb696 | refs/heads/master | 2022-05-24T06:18:10.062034 | 2020-04-27T05:28:54 | 2020-04-27T05:28:54 | 259,187,261 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package sg.edu.rp.c346.id19032110.demomysecondapp;
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);
}
} | [
"19032110@myrp.edu.sg"
] | 19032110@myrp.edu.sg |
c7cdcb89882f4a59e1be328629a13a0f444a663a | 156a79095e27ca36fa1207bb3cc61a75b1f671e6 | /src/main/java/by/it/group473601/Zarudny/lesson02/B_Sheduler.java | cc1793bae227ee11ecad6e92b875e6687faf38b2 | [] | no_license | skalashynski/dynamic_programming | cc7fdd9cebb18e499fb0e6a502f6c170b898c5b3 | 6ed5894bd34488b109e25b26111d6e382f8ffa0a | refs/heads/master | 2023-04-14T23:47:46.686808 | 2021-04-18T08:26:49 | 2021-04-18T08:26:49 | 297,419,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,147 | java | package by.it.group473601.Zarudny.lesson02;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/*
даны интервальные события events
реализуйте метод calcStartTimes, так, чтобы число принятых к выполнению
непересекающихся событий было максимально.
Алгоритм жадный. Для реализации обдумайте надежный шаг.
*/
public class B_Sheduler {
//событие у аудитории(два поля: начало и конец)
static class Event implements Comparable {
int start;
int stop;
Event(int start, int stop) {
this.start = start;
this.stop = stop;
}
@Override
public String toString() {
return "("+ start +":" + stop + ")";
}
@Override
public int compareTo(Object o) {
Event someEvent = (Event) o;
if(this.stop>someEvent.stop){
return 1;
} else if(this.stop == someEvent.stop){
return 0;
}else {return -1;}
}
}
public static void main(String[] args) {
B_Sheduler instance = new B_Sheduler();
Event[] events = { new Event(0, 3), new Event(0, 1), new Event(1, 2), new Event(3, 5),
new Event(1, 3), new Event(1, 3), new Event(1, 3), new Event(3, 6),
new Event(2, 7), new Event(2, 3), new Event(2, 7), new Event(7, 9),
new Event(3, 5), new Event(2, 4), new Event(2, 3), new Event(3, 7),
new Event(4, 5), new Event(6, 7), new Event(6, 9), new Event(7, 9),
new Event(8, 9), new Event(4, 6), new Event(8, 10), new Event(7, 10)
};
List<Event> starts = instance.calcStartTimes(events,0,10); //рассчитаем оптимальное заполнение аудитории
System.out.println(starts); //покажем рассчитанный график занятий
}
List<Event> calcStartTimes(Event[] events, int from, int to) {
//events - события которые нужно распределить в аудитории
//в период [from, int] (включительно).
//оптимизация проводится по наибольшему числу непересекающихся событий.
//начало и конец событий могут совпадать.
List<Event> result;
result = new ArrayList<>();
//ваше решение.
Arrays.sort(events);
int nextEvent = from;
for(Event event:events){
if(event.start>=nextEvent){
if(event.stop<to){
nextEvent=event.stop;
result.add(event);
}
}
}
return result; //вернем итог
}
}
| [
"skalashynski@productiveedge.com"
] | skalashynski@productiveedge.com |
ee64dae82fd65ecf73d0f2a305e32277e0601b62 | 4d05c058bddf54e8c62ccb0487b4aefd7ed5e4d5 | /src/main/java/edu/eci/arsw/model/DatosCiudad.java | f881e721a61e530bf6134993cd47156ad5bfd30d | [] | no_license | nicolasOL/ORTEGA-ARSW-T2 | 100ccbf8393044b4d74d94c27417199e69863b99 | c704f884671388716ef67da18271f8a8af53b75b | refs/heads/main | 2022-12-30T06:11:02.907061 | 2020-10-22T20:32:01 | 2020-10-22T20:32:01 | 306,399,307 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,648 | java | package edu.eci.arsw.model;
/**
* @author Nicolás
* Almacena la informacion meteorologica de una ciudad
*/
public class DatosCiudad {
private String nombre;
private String temperatura;
private String sensacion;
private String tempminima;
private String tempmaxima;
private String presion;
private String humedad;
public DatosCiudad(String nombre, String temperatura, String sensacion, String tempminima, String tempmaxima,
String humedad, String presion) {
this.nombre = nombre;
this.temperatura = temperatura;
this.sensacion = sensacion;
this.tempminima = tempminima;
this.tempmaxima = tempmaxima;
this.humedad = humedad;
this.presion = presion;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getTemperatura() {
return temperatura;
}
public void setTemperatura(String temperatura) {
this.temperatura = temperatura;
}
public String getSensacion() {
return sensacion;
}
public void setSensacion(String sensacion) {
this.sensacion = sensacion;
}
public String getTempminima() {
return tempminima;
}
public void setTempminima(String tempminima) {
this.tempminima = tempminima;
}
public String getTempmaxima() {
return tempmaxima;
}
public void setTempmaxima(String tempmaxima) {
this.tempmaxima = tempmaxima;
}
public String getPresion() {
return presion;
}
public void setPresion(String presion) {
this.presion = presion;
}
public String getHumedad() {
return humedad;
}
public void setHumedad(String humedad) {
this.humedad = humedad;
}
}
| [
"nicolas.ortega-l@mail.escuelaing.edu.co"
] | nicolas.ortega-l@mail.escuelaing.edu.co |
dbff533c2a7fe14df67a2f3b9a2842fc2c639cb9 | 2e078e1be51f0e2d8533fdff38760e362517f149 | /src/main/java/com/jeesite/modules/state/dao/TbStateDao.java | 63a198edb9fc767e4a152c50d01d263a01317007 | [] | no_license | SupplyChainFinanceOrg/SupplyChainFinance | f7442f776d197d1bfeb2b62248a0b8fe72a95dc0 | e09e9e44d055e8d5618814092899d88039492063 | refs/heads/master | 2020-03-15T23:48:25.057551 | 2018-05-23T06:39:28 | 2018-05-23T06:39:28 | 132,401,115 | 0 | 1 | null | 2018-05-13T07:38:52 | 2018-05-07T03:16:05 | HTML | UTF-8 | Java | false | false | 395 | java | /**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
*/
package com.jeesite.modules.state.dao;
import com.jeesite.common.dao.CrudDao;
import com.jeesite.common.mybatis.annotation.MyBatisDao;
import com.jeesite.modules.state.entity.TbState;
/**
* tb_stateDAO接口
* @author z
* @version 2018-05-10
*/
@MyBatisDao
public interface TbStateDao extends CrudDao<TbState> {
} | [
"1170818821@qq.com"
] | 1170818821@qq.com |
790fd4a785deec2aa07fba21ed7cf611df7f6003 | d594a15df2f5935397aefa78c8e18935b777f7d1 | /home_work_3/calcs/api/ICalculator.java | 607341e46139275834ee517a54f83400a16288f2 | [] | no_license | Vullckan/tests | 475a5891d86ff0eca507634a5b7f9f3850b0fbc5 | b75ff4bbc3dcaa83172395b95af2477bf8855127 | refs/heads/main | 2023-05-07T01:07:26.135312 | 2021-05-30T21:44:48 | 2021-05-30T21:44:48 | 353,080,737 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package HomeWork3.calcs.api;
public interface ICalculator {
double divisionMethod(double a, double b);
double multiplicationMethod(double a, double b);
double subtractionMethod(double a, double b);
double additionMethod(double a, double b);
double exponentiationMethod(double a, int b);
double moduleMethod(double a);
double squareRootMethod(double a);
}
| [
"andrey.salov.87@mail.ru"
] | andrey.salov.87@mail.ru |
1647415ed5ccc29d96f24d8d5fa23b1ac953a122 | 12c453642784a3359363e33c007d5a5abdae9e4a | /framework/org/fdesigner/framework/service/packageadmin/ExportedPackage.java | d2125e917a4c626d36446842f120c2eb3150e50b | [] | no_license | WeControlTheFuture/fdesigner | 51e56b6d1935f176b23ebaf42119be4ef57e3bec | 84483c2f112c8d67ecdf61e9259c1c5556d398c4 | refs/heads/master | 2020-09-24T13:44:01.238867 | 2019-12-13T01:21:40 | 2019-12-13T01:21:40 | 225,771,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,942 | java | /*
* Copyright (c) OSGi Alliance (2001, 2014). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.fdesigner.framework.service.packageadmin;
import org.fdesigner.framework.framework.Bundle;
import org.fdesigner.framework.framework.Version;
/**
* An exported package.
*
* Objects implementing this interface are created by the Package Admin service.
*
* <p>
* The term <i>exported package</i> refers to a package that has been exported
* from a resolved bundle. This package may or may not be currently wired to
* other bundles.
*
* <p>
* The information about an exported package provided by this object may change.
* An {@code ExportedPackage} object becomes stale if the package it
* references has been updated or removed as a result of calling
* {@code PackageAdmin.refreshPackages()}.
*
* If this object becomes stale, its {@code getName()} and
* {@code getVersion()} methods continue to return their original values,
* {@code isRemovalPending()} returns {@code true}, and
* {@code getExportingBundle()} and {@code getImportingBundles()}
* return {@code null}.
*
* @ThreadSafe
* @noimplement
* @deprecated The PackageAdmin service has been replaced by the
* <code>org.osgi.framework.wiring</code> package.
* @author $Id$
*/
public interface ExportedPackage {
/**
* Returns the name of the package associated with this exported package.
*
* @return The name of this exported package.
*/
public String getName();
/**
* Returns the bundle exporting the package associated with this exported
* package.
*
* @return The exporting bundle, or {@code null} if this
* {@code ExportedPackage} object has become stale.
*/
public Bundle getExportingBundle();
/**
* Returns the resolved bundles that are currently wired to this exported
* package.
*
* <p>
* Bundles which require the exporting bundle associated with this exported
* package are considered to be wired to this exported package are included
* in the returned array. See {@link RequiredBundle#getRequiringBundles()}.
*
* @return The array of resolved bundles currently wired to this exported
* package, or {@code null} if this
* {@code ExportedPackage} object has become stale. The array
* will be empty if no bundles are wired to this exported package.
*/
public Bundle[] getImportingBundles();
/**
* Returns the version of this exported package.
*
* @return The version of this exported package, or {@code null} if no
* version information is available.
* @deprecated As of 1.2. Replaced by {@link #getVersion()}.
*/
public String getSpecificationVersion();
/**
* Returns the version of this exported package.
*
* @return The version of this exported package, or
* {@link Version#emptyVersion} if no version information is
* available.
* @since 1.2
*/
public Version getVersion();
/**
* Returns {@code true} if the package associated with this
* {@code ExportedPackage} object has been exported by a bundle that
* has been updated or uninstalled.
*
* @return {@code true} if the associated package is being exported
* by a bundle that has been updated or uninstalled, or if this
* {@code ExportedPackage} object has become stale;
* {@code false} otherwise.
*/
public boolean isRemovalPending();
}
| [
"491676539@qq.com"
] | 491676539@qq.com |
190702390e94facd144d01d7a1e7cbc148231f5b | 1f19aec2ecfd756934898cf0ad2758ee18d9eca2 | /u-1/u-11/u-11-111/u-11-111-1111/u-11-111-1111-f6751.java | bdfc0c69cd339e1b605190f4fbd5da68a60479da | [] | no_license | apertureatf/perftest | f6c6e69efad59265197f43af5072aa7af8393a34 | 584257a0c1ada22e5486052c11395858a87b20d5 | refs/heads/master | 2020-06-07T17:52:51.172890 | 2019-06-21T18:53:01 | 2019-06-21T18:53:01 | 193,039,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 106 | java | mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117
3016206842685 | [
"jenkins@khan.paloaltonetworks.local"
] | jenkins@khan.paloaltonetworks.local |
ed1e2ebf9634fba69252bedcc6ae9446309d4b55 | d28bf59d86876d7e5f3345c44af51302a8965603 | /scroopclassproject/src/main/java/com/wh/wang/scroopclassproject/newproject/ui/fragment/register_frag/SubmitResultFragment.java | 2f9da2aec19bf72e40d018620866c20f0b80a950 | [] | no_license | P79N6A/android2-master1 | e1be2a9179925eef49f5da56639186f7e89a0cbd | 83f553e36cc1880704adc84c6d1fea8eb187b1a8 | refs/heads/master | 2020-04-05T03:32:05.254641 | 2018-11-07T08:51:56 | 2018-11-07T08:51:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,838 | java | package com.wh.wang.scroopclassproject.newproject.ui.fragment.register_frag;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.wh.wang.scroopclassproject.R;
import com.wh.wang.scroopclassproject.newproject.callback.OnRegisterNextClickListener;
public class SubmitResultFragment extends Fragment implements View.OnClickListener {
private ImageView mResultIcon;
private TextView mNext;
private OnRegisterNextClickListener mOnRegisterNextClickListener;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
if(activity instanceof OnRegisterNextClickListener){
mOnRegisterNextClickListener = (OnRegisterNextClickListener) activity;
}else{
Log.e("DH_NEXT_LISTENER","未绑定监听");
return;
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_submit_result, container, false);
initView(view);
mNext.setOnClickListener(this);
return view;
}
private void initView(View view) {
mResultIcon = (ImageView) view.findViewById(R.id.result_icon);
mNext = (TextView) view.findViewById(R.id.next);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.next:
if(mOnRegisterNextClickListener!=null){
mOnRegisterNextClickListener.OnNextClick(-1);
}
break;
}
}
}
| [
"mentangzhihui@aliyun.com"
] | mentangzhihui@aliyun.com |
78b78930a82e3f1824b20c4b28dd2732e546ed13 | 2fb7792ce20ec93ad945fd3e963caacf997e22a6 | /Java/SimpleCalculator/app/src/main/java/com/dodemy/simplecalculator/MainActivity.java | bc7fa7b2e4a580df35b4deb74f671229dd69298e | [] | no_license | maduoma/Android | cea4436951df3bbad677856b05ea66c7829d648a | 1c51fd8e7a0426883a5b1c10889ff4e2627fddaa | refs/heads/master | 2022-07-25T23:57:16.306801 | 2021-02-28T00:07:40 | 2021-02-28T00:07:40 | 259,066,135 | 3 | 9 | null | 2020-10-24T13:23:07 | 2020-04-26T15:32:49 | Java | UTF-8 | Java | false | false | 18,751 | java | package com.dodemy.simplecalculator;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import me.anwarshahriar.calligrapher.Calligrapher;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
//setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // Fixed Portrait orientation
Button btnSin, btnCos, btnTan, btnFactorial, btnPow;
Button btnClear, btnBackSpace, btnBracketsOpen, btnBracketsClose, btnSquare;
Button btnSeven, btnNine, btnEight, btnDiv, btnMod;
Button btnFour, btnFive, btnSix, btnMulti, btnInverse;
Button btnOne, btnTwo, btnThree, btnMinus, btnAdd, btnResult;
Button btnZero, btnDot, btnPi;
TextView screenAns, screenMath;
StringBuilder textMath = new StringBuilder("");
StringBuilder textAns = new StringBuilder("0");
StringBuilder screenTextMath = new StringBuilder("");
double num1 = 0, num2 = 0, ans = 0;
//char mask = ' ';
int checkSubmit = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Set font
Calligrapher calligrapher = new Calligrapher(this);
calligrapher.setFont(this, "lato-regular.ttf", true);
//Control
screenAns = (TextView) findViewById(R.id.txtResult);
screenMath = (TextView) findViewById(R.id.txtCal);
btnZero = (Button) findViewById(R.id.btnZero);
btnZero.setOnClickListener(this);
btnOne = (Button) findViewById(R.id.btnOne);
btnOne.setOnClickListener(this);
btnTwo = (Button) findViewById(R.id.btnTwo);
btnTwo.setOnClickListener(this);
btnThree = (Button) findViewById(R.id.btnThree);
btnThree.setOnClickListener(this);
btnFour = (Button) findViewById(R.id.btnFour);
btnFour.setOnClickListener(this);
btnFive = (Button) findViewById(R.id.btnFive);
btnFive.setOnClickListener(this);
btnSix = (Button) findViewById(R.id.btnSix);
btnSix.setOnClickListener(this);
btnSeven = (Button) findViewById(R.id.btnSeven);
btnSeven.setOnClickListener(this);
btnEight = (Button) findViewById(R.id.btnEight);
btnEight.setOnClickListener(this);
btnNine = (Button) findViewById(R.id.btnNine);
btnNine.setOnClickListener(this);
btnSin = (Button) findViewById(R.id.btnSin);
btnSin.setOnClickListener(this);
btnCos = (Button) findViewById(R.id.btnCos);
btnCos.setOnClickListener(this);
btnTan = (Button) findViewById(R.id.btnTan);
btnTan.setOnClickListener(this);
btnFactorial = (Button) findViewById(R.id.btnFactorial);
btnFactorial.setOnClickListener(this);
btnPow = (Button) findViewById(R.id.btnPow);
btnPow.setOnClickListener(this);
btnClear = (Button) findViewById(R.id.btnClear);
btnClear.setOnClickListener(this);
btnBackSpace = (Button) findViewById(R.id.btnBack);
btnBackSpace.setOnClickListener(this);
btnBracketsClose = (Button) findViewById(R.id.btnBrackketsClose);
btnBracketsClose.setOnClickListener(this);
btnBracketsOpen = (Button) findViewById(R.id.btnBracketsOpen);
btnBracketsOpen.setOnClickListener(this);
btnSquare = (Button) findViewById(R.id.btnSquared);
btnSquare.setOnClickListener(this);
btnDot = (Button) findViewById(R.id.btnDot);
btnDot.setOnClickListener(this);
btnPi = (Button) findViewById(R.id.btnPi);
btnPi.setOnClickListener(this);
btnDiv = (Button) findViewById(R.id.btnDiv);
btnDiv.setOnClickListener(this);
btnMod = (Button) findViewById(R.id.btnMod);
btnMod.setOnClickListener(this);
btnMulti = (Button) findViewById(R.id.btnMulti);
btnMulti.setOnClickListener(this);
btnInverse = (Button) findViewById(R.id.btnInverse);
btnInverse.setOnClickListener(this);
btnMinus = (Button) findViewById(R.id.btnMinus);
btnMinus.setOnClickListener(this);
btnAdd = (Button) findViewById(R.id.btnAdd);
btnAdd.setOnClickListener(this);
btnResult = (Button) findViewById(R.id.btnResult);
btnResult.setOnClickListener(this);
}
public void error() {
screenAns.setText("Math Error !");
textAns = textMath = screenTextMath = new StringBuilder("");
}
public void submit(String[] elementMath) {
InfixToPostfix ITP = new InfixToPostfix();
if (textMath.length() > 0) {
try {
if (!ITP.check_error)
elementMath = ITP.processString(textMath.toString()); // split expression to element
if (!ITP.check_error)
elementMath = ITP.postfix(elementMath); // format elements to postfix
if (!ITP.check_error)
textAns = new StringBuilder(ITP.valueMath(elementMath)); // get result
screenAns.setText(textAns);
screenTextMath = new StringBuilder();
textMath = new StringBuilder();
checkSubmit = 1;
} catch (Exception e) {
error();
}
if (ITP.check_error) error();
}
}
@Override
public void onClick(View view) {
int id = view.getId();
String elementMath[] = null;
if (id == R.id.btnZero) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("0");
screenTextMath.append("0");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnOne) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("1");
screenTextMath.append("1");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnTwo) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("2");
screenTextMath.append("2");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnThree) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("3");
screenTextMath.append("3");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnFour) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("4");
screenTextMath.append("4");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnFive) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("5");
screenTextMath.append("5");
}
screenMath.setText(screenTextMath.toString());
} else if (id == R.id.btnSix) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("6");
screenTextMath.append("6");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnSeven) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("7");
screenTextMath.append("7");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnEight) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("8");
screenTextMath.append("8");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnNine) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("9");
screenTextMath.append("9");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnDot) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append(".");
screenTextMath.append(".");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnPi) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("π");
screenTextMath.append("π");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnAdd) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("+");
screenTextMath.append("+");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnMinus) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("-");
screenTextMath.append("-");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnMulti) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("*");
screenTextMath.append("*");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnDiv) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("/");
screenTextMath.append("/");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnPow) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("^(");
screenTextMath.append("^(");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnSquared) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("@");
screenTextMath.append("√");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnSin) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("s(");
screenTextMath.append("Sin(");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnCos) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("c(");
screenTextMath.append("Cos(");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnTan) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("t(");
screenTextMath.append("Tan(");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnBracketsOpen) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append("(");
screenTextMath.append("(");
}
screenMath.setText(screenTextMath);
} else if (id == R.id.btnBrackketsClose) {
if (screenTextMath.length() < 48) { //if length < 48
if (checkSubmit == 1) {
screenTextMath = new StringBuilder("");
textMath = new StringBuilder("");
checkSubmit = 0;
}
textMath.append(")");
screenTextMath.append(")");
}
screenMath.setText(screenTextMath);
}
//==========================================================
else if (id == R.id.btnMod) {
if (screenTextMath.length() == 0) screenTextMath = new StringBuilder("0");
screenTextMath = new StringBuilder("(" + screenTextMath + ")%");
screenMath.setText(screenTextMath.toString());
if (checkSubmit == 0) submit(null);
textMath = new StringBuilder(textAns + "/100");
submit(null);
} else if (id == R.id.btnInverse) {
if (screenTextMath.length() == 0) screenTextMath = new StringBuilder("0");
screenTextMath = new StringBuilder("1/(" + screenTextMath + ")");
screenMath.setText(screenTextMath);
if (checkSubmit == 0) submit(null);
textMath = new StringBuilder("1/" + textAns);
submit(null);
} else if (id == R.id.btnResult) {
submit(null);
} else if (id == R.id.btnClear) {
textMath = new StringBuilder("");
screenTextMath = new StringBuilder("");
textAns = new StringBuilder("0");
screenAns.setText(textAns);
screenMath.setText("|");
} else if (id == R.id.btnBack) {
if (screenMath.length() > 0) {
char c = textMath.charAt(textMath.length() - 1);
if (textMath.length() > 1 && c == '(' && textMath.charAt(textMath.length() - 2) == '^') {
screenTextMath = new StringBuilder(screenTextMath.substring(0, screenTextMath.length() - 2));
textMath = new StringBuilder(textMath.substring(0, textMath.length() - 2));
} else if (textMath.length() > 1 && c == '(' && (textMath.charAt(textMath.length() - 2) == 's' || textMath.charAt(textMath.length() - 2) == 'c' || textMath.charAt(textMath.length() - 2) == 't')) {
textMath = new StringBuilder(textMath.substring(0, textMath.length() - 2));
screenTextMath = new StringBuilder(screenTextMath.substring(0, screenTextMath.length() - 4));
} else {
textMath = new StringBuilder(textMath.substring(0, textMath.length() - 1));
screenTextMath = new StringBuilder(screenTextMath.substring(0, screenTextMath.length() - 1));
}
}
screenMath.setText(screenTextMath);
}
}
}
| [
"18477889+maduoma@users.noreply.github.com"
] | 18477889+maduoma@users.noreply.github.com |
21c3388f8d7e30fde54d54a068c361cb72ba12c0 | 39d1794da8a6815b0c52b51c86b69a12da3d0f86 | /ProgrammingApt/src/com/proapti/pkg/PRhombus_Alpha.java | 5107da10c3bec5fd1cb08178dcf914b0a9933aa7 | [] | no_license | RsBhargav/Java_Coding | 4a7ab5c6f9e7f8feee616703e0a992a9c06118bb | e6f099780363f724cad600b858fadee1483f8f43 | refs/heads/master | 2023-07-06T15:41:17.235986 | 2021-08-16T16:59:01 | 2021-08-16T16:59:01 | 157,197,793 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 560 | java | package com.proapti.pkg;
public class PRhombus_Alpha {
public static void main(String[] args) {
int n = 9;
for (int r = 0; r < n; r++)
{
for (int c = 0; c < n; c++)
{
if (r == n/2 && c == 0
|| r == n/4 && c==n/4
|| r == 3*n/4 && c == n/4
|| c == n/2 && r == 0
|| c == n/2 && r == n-1
|| c == 3*n/4 && r== n/4
|| c == 3*n/4 && r == 3*n/4
|| r == n/2 && c == n-1 )
System.out.print("*");
else
System.out.print(" ");
}
System.out.println();
}
}
}
| [
"bhargav.incredibl@gmail.com"
] | bhargav.incredibl@gmail.com |
59311dd674a4bf2c0d4c9da5b5ae14bced0f4f25 | 3e3a31f208c467354674c8b5ad7d007652981122 | /BackEnd/Spring/springcore/src/main/java/com/capgemini/springcore/beans/Validation.java | b75b4f61ae36b660b6245facca5116559e86a81d | [] | no_license | Ashwini12344/TY_CG_HTD_BangaloreNovember_JFS_AshwiniR | ea32a33b14beed8c79e59b9c9b976a847e560df0 | 9b586d01424c6029d85d35a3f43a073b556cf8cf | refs/heads/master | 2023-01-11T15:04:15.532481 | 2020-01-23T07:12:46 | 2020-01-23T07:12:46 | 225,852,291 | 0 | 0 | null | 2023-01-07T14:01:21 | 2019-12-04T11:34:44 | JavaScript | UTF-8 | Java | false | false | 809 | java | package com.capgemini.springcore.beans;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.springframework.context.annotation.ScannedGenericBeanDefinition;
public class Validation {
private static String text;
Scanner sc=new Scanner(System.in);
//String name=sc.next();
public static void main(String[] args) {
validateLetters(text);
}
public static boolean validateLetters(String text) {
String regx = "[a-zA-Z]+\\.?";
System.out.println("name");
Scanner sc=new Scanner(System.in);
String name=sc.next();
if(name==regx) {
System.out.println("valid name");
}
Pattern pattern = Pattern.compile(regx,Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(text);
return matcher.find();
}
}
| [
"ashwiniraghuram12"
] | ashwiniraghuram12 |
39f1ab4fd39427e7dceb38613282f9a3359370d1 | 564c60eba3f347aeecabbb4c7202b686fd78a987 | /core/src/com/heaven7/fantastictank/support/Direction.java | 9afd71865bf549ae9d19519a6a72085d634210c2 | [] | no_license | LightSun/FantasticTank | acdffca6491f91c4bb80aabaa53ee28e875f0c25 | add9ba740ec7f50c1bfe78122cc1c7c7c42e071f | refs/heads/master | 2021-01-22T04:36:51.011279 | 2014-12-02T12:35:46 | 2014-12-02T12:35:46 | 27,430,366 | 2 | 1 | null | null | null | null | WINDOWS-1252 | Java | false | false | 726 | java | package com.heaven7.fantastictank.support;
public enum Direction {
Up(1){
public Direction reverse() {
return Down;
}
@Override
public String toString() {
return "Up";
}
},
Down(2){
public Direction reverse() {
return Up;
}
@Override
public String toString() {
return "Down";
}
},
Left(3){
public Direction reverse() {
return Right;
}
@Override
public String toString() {
return "Left";
}
},
Right(4){
public Direction reverse() {
return Left;
}
@Override
public String toString() {
return "Right";
}
};
public final int value;
private Direction(int value){
this.value = value;
}
/**Ïà·´·½Ïò*/
public abstract Direction reverse();
}
| [
"532278976@qq.com"
] | 532278976@qq.com |
2e9c253e1947ee21302fc7f0f2c1ff861d2d1890 | 9074de19b74660feed0be240e0f69f247b3461fc | /src/main/java/ng2app/web/rest/errors/ParameterizedErrorVM.java | 29a77636347173929b742941d5f3929bf84b642d | [] | no_license | narci2010/Angular2-n-Spring-boot | 62bc029850ab65ebec7d6379e29ad0a217160a4b | 3f54a76a8be9eef8ac43b5df28262b404a53dcaa | refs/heads/master | 2021-01-20T04:09:08.390734 | 2017-04-01T22:11:22 | 2017-04-01T22:11:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 579 | java | package ng2app.web.rest.errors;
import java.io.Serializable;
/**
* View Model for sending a parameterized error message.
*/
public class ParameterizedErrorVM implements Serializable {
private static final long serialVersionUID = 1L;
private final String message;
private final String[] params;
public ParameterizedErrorVM(String message, String... params) {
this.message = message;
this.params = params;
}
public String getMessage() {
return message;
}
public String[] getParams() {
return params;
}
}
| [
"gabrielfreiredev@gmail.com"
] | gabrielfreiredev@gmail.com |
c45c0bbbd73659e9a4b90f219cae35eb579f50e0 | 74299024d81873b8d27e29bd44d20d66454532e9 | /app/src/main/java/com/example/ale/contiforno/Conto.java | 167c6094938f3bad54fe3a603e99aed914dcb514 | [] | no_license | pani94/ContiForno | 7def5eec13487885b01115ebee07f2d3e096bfe6 | 7ab3c9cd6140d90b91f23d5ed320567edbc8a85f | refs/heads/master | 2021-01-19T03:54:25.427629 | 2017-04-05T18:15:25 | 2017-04-05T18:15:25 | 87,341,904 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 942 | java | package com.example.ale.contiforno;
/**
* Created by ale on 05/04/2017.
*/
public class Conto {
private String cliente;
private int mese;
private int anno;
private double importo;
public Conto(String cliente, int mese, int anno, double importo) {
this.cliente = cliente;
this.mese = mese;
this.anno = anno;
this.importo = importo;
}
public String getCliente() {
return cliente;
}
public void setCliente(String cliente) {
this.cliente = cliente;
}
public int getMese() {
return mese;
}
public void setMese(int mese) {
this.mese = mese;
}
public int getAnno() {
return anno;
}
public void setAnno(int anno) {
this.anno = anno;
}
public double getImporto() {
return importo;
}
public void setImporto(double importo) {
this.importo = importo;
}
}
| [
"ale_94_10@hotmail.it"
] | ale_94_10@hotmail.it |
c370586498a98a7fa39876f0d83db9589471eb38 | 04f24c1505f0ef5329994d5cc1ff5979ccb44c70 | /H12/Quiz3_b.java | daea8cfae61377c2768991d3d046b409be3a7256 | [] | no_license | jeronsessink/H8 | 8ad23565180ddc65e30776df3471e08692e70e63 | f5166e9e25de7460aa0aca4c9d1380ac1990ab64 | refs/heads/master | 2020-05-31T08:39:40.207799 | 2019-06-16T14:32:51 | 2019-06-16T14:32:51 | 190,194,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 458 | java | package H12;
public class Quiz3_b extends Quiz3
{
int x = 3;
String methodeA(String s, int i)
{
String str = s + ", " + i;
super.x ++; //Hij geeft hier een fout weer omdat hij 1 wilt optellen bij 'x', maar dit is niet mgelijk want x is een final en kan niet worden aangepast.
return str;
}
public static void main(String[] args)
{
Quiz3_b mk = new Quiz3_b();
System.out.print(mk.methodeA(23, "Emma"));
}
}
| [
"noreply@github.com"
] | jeronsessink.noreply@github.com |
c359890051d1b8ce7ce293a4adefb4a91f5ff326 | 939a7559339ff04b56a94bd6512b7c06a7d9fcf9 | /src/main/java/com/milaboratory/mixcr/basictypes/VDJCAlignments.java | 8d75d46ee0702745c4c2700a17978069d5197ef4 | [] | no_license | mikessh/mixcr | 46c8e63eb4763b98ae36be96aa9b154ba0d6fe54 | ece6f5301d6e0a7964c427391c65809626d13255 | refs/heads/master | 2020-04-05T19:04:07.615785 | 2015-05-17T11:35:42 | 2015-05-17T11:35:42 | 35,747,531 | 1 | 0 | null | 2015-05-17T01:44:40 | 2015-05-17T01:44:40 | null | UTF-8 | Java | false | false | 3,297 | java | /*
* Copyright (c) 2014-2015, Bolotin Dmitry, Chudakov Dmitry, Shugay Mikhail
* (here and after addressed as Inventors)
* All Rights Reserved
*
* Permission to use, copy, modify and distribute any part of this program for
* educational, research and non-profit purposes, by non-profit institutions
* only, without fee, and without a written agreement is hereby granted,
* provided that the above copyright notice, this paragraph and the following
* three paragraphs appear in all copies.
*
* Those desiring to incorporate this work into commercial products or use for
* commercial purposes should contact the Inventors using one of the following
* email addresses: chudakovdm@mail.ru, chudakovdm@gmail.com
*
* IN NO EVENT SHALL THE INVENTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
* SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
* ARISING OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE INVENTORS HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE SOFTWARE PROVIDED HEREIN IS ON AN "AS IS" BASIS, AND THE INVENTORS HAS
* NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS. THE INVENTORS MAKES NO REPRESENTATIONS AND EXTENDS NO
* WARRANTIES OF ANY KIND, EITHER IMPLIED OR EXPRESS, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
* PARTICULAR PURPOSE, OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY
* PATENT, TRADEMARK OR OTHER RIGHTS.
*/
package com.milaboratory.mixcr.basictypes;
import com.milaboratory.core.sequence.NSequenceWithQuality;
import com.milaboratory.mixcr.reference.GeneType;
import com.milaboratory.primitivio.annotations.Serializable;
import java.util.EnumMap;
@Serializable(by = IO.VDJCAlignmentsSerializer.class)
public final class VDJCAlignments extends VDJCObject {
final long readId;
private volatile long alignmentsIndex = -1;
public VDJCAlignments(long readId, EnumMap<GeneType, VDJCHit[]> hits, NSequenceWithQuality target) {
super(hits, new NSequenceWithQuality[]{target});
this.readId = readId;
}
public VDJCAlignments(long readId, EnumMap<GeneType, VDJCHit[]> hits, NSequenceWithQuality... targets) {
super(hits, targets);
this.readId = readId;
}
public VDJCAlignments(long readId, VDJCHit[] vHits, VDJCHit[] dHits, VDJCHit[] jHits, VDJCHit[] cHits,
NSequenceWithQuality... targets) {
super(vHits, dHits, jHits, cHits, targets);
this.readId = readId;
}
public long getReadId() {
return readId;
}
public long getAlignmentsIndex() {
return alignmentsIndex;
}
public void setAlignmentsIndex(long alignmentsIndex) {
this.alignmentsIndex = alignmentsIndex;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof VDJCAlignments)) return false;
if (!super.equals(o)) return false;
VDJCAlignments that = (VDJCAlignments) o;
if (readId != that.readId) return false;
return true;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (int) (readId ^ (readId >>> 32));
return result;
}
}
| [
"bolotin.dmitriy@gmail.com"
] | bolotin.dmitriy@gmail.com |
ed1e24b63ae6019b93177d1d1af3fc61d0289465 | 317767eab845ff8db6abd698e302f1834a1d3e88 | /App/mobile/src/main/java/com/example/fangyulo/represent/MainActivity.java | ba7758efa7d664668c2eeda5f9c5fcd6286475ad | [] | no_license | cs160-berkeley/prog-02-represent-alo0822 | ee1e2f223981103857f9cbc66bc33acc73167bfe | be6bfe5f9c2eefd627afa476e864909cf1d2d5cb | refs/heads/master | 2021-01-18T05:12:02.182670 | 2016-03-12T07:42:04 | 2016-03-12T07:42:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,142 | java | package com.example.fangyulo.represent;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.location.Location;
import android.location.LocationManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.location.LocationServices;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class MainActivity extends Activity {
static final String GEOCODE_URL = "https://maps.googleapis.com/maps/api/geocode/json?latlng=";
static final String GOOGLE_API_KEY = "AIzaSyCHWGRDMGUrrVeFxSrttQ563uMhwU98pwE";
TextView title;
Typeface playfair;
RepsData rd;
String currentLocation;
String latitude;
String longitude;
StringBuilder urlString;
String current_zip;
protected LocationManager locationManager;
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
private final int REQUEST_PERMISSION = 10;
private Location mLastLocation;
// Google client to interact with Google API
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
Window window = MainActivity.this.getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(MainActivity.this.getResources().getColor(R.color.blue));
rd = (RepsData) getApplication();
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
title = (TextView) findViewById(R.id.main_title);
playfair = Typeface.createFromAsset(getAssets(), "fonts/PlayfairDisplaySC-Bold.ttf");
title.setTypeface(playfair);
final EditText zip_code_entry = (EditText) findViewById(R.id.zipcode_entry);
System.out.println("zip_code_entry: " + zip_code_entry.getText().toString());
TextView current_loc = (TextView) findViewById(R.id.current_loc);
current_loc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showCurrentLocation();
Log.i("GEO", "click button, calling getCurrentAddress()");
}
});
Button search_btn = (Button) findViewById(R.id.search_button);
search_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, RepsActivity.class);
intent.putExtra("zip_code", zip_code_entry.getText().toString());
startActivity(intent);
}
});
}
public void getLocation() {
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
Log.i("T", "lat: " + latitude);
Log.i("T", "long: " + longitude);
this.latitude = Double.toString(location.getLatitude());
this.longitude = Double.toString(location.getLongitude());
new DownloadWebpageTask().execute();
}
}
protected void showCurrentLocation() {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)== PackageManager.PERMISSION_GRANTED){
getLocation();
}
else{
requestLocationPermission();
}
}
private void requestLocationPermission() {
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION)) {
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_PERMISSION);
} else {
Toast toast = Toast.makeText(this, "Location permission denied", Toast.LENGTH_SHORT);
toast.show();
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, REQUEST_PERMISSION);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == REQUEST_PERMISSION) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
getLocation();
return;
} else {
Toast toast = Toast.makeText(this, "Location permission denied", Toast.LENGTH_SHORT);
toast.show();
}
}
}
private class DownloadWebpageTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
urlString = new StringBuilder();
urlString.append(GEOCODE_URL).append(latitude).append(",").append(longitude).append("&key=").append(GOOGLE_API_KEY);
Log.i("LOC", "making api call");
String result = makeAPICall();
if (result == null) {
Log.i("INFO", "Result is null");
}
try {
System.out.println("-------- got response --------");
JSONObject jsonRootObject = new JSONObject(result);
System.out.println("-------- got json object, --------");
JSONArray jsonArrayResults = jsonRootObject.optJSONArray("results");
JSONObject addr_components_obj = jsonArrayResults.getJSONObject(0);
JSONArray addr_components = addr_components_obj.optJSONArray("address_components");
String zip = null;
for (int i = 0; i < addr_components.length(); i++) {
try {
String possible = addr_components.getJSONObject(i).getString("short_name");
JSONArray types = addr_components.getJSONObject(i).getJSONArray("types");
if (types.get(0).equals("postal_code")) {
zip = possible;
}
} catch (JSONException e) {
e.printStackTrace();
}
}
current_zip = zip;
result = zip;
Log.i("LOC", "result is: " + result);
currentLocation = result;
} catch (JSONException e) {
e.printStackTrace();
}
return result;
}
@Override
protected void onPostExecute(String s) {
Log.i("LOC", "In onPostExecute for getting location information");
// Toast.makeText(MainActivity.this, "Current location: " + currentLocation, Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MainActivity.this, RepsActivity.class);
intent.putExtra("zip_code", current_zip);
startActivity(intent);
}
protected String makeAPICall() {
try {
URL url = new URL(urlString.toString());
System.out.println("-------- Setting connection with URL: " + url + " --------");
HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
StringBuilder stringBuilder = new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) {
stringBuilder.append(line).append("\n");
}
bufferedReader.close();
return stringBuilder.toString();
}
finally{
urlConnection.disconnect();
}
} catch (IOException e) {
Log.e("ERROR", e.getMessage(), e);
return "Unable to retrieve web page. URL may be invalid.";
}
}
}
}
| [
"annielo@berkeley.edu"
] | annielo@berkeley.edu |
bd3f5b71eb09eda9ce98d95dc2dcbad74edb17aa | afd514146867e77ce75099a598bd8d9acbd2b358 | /hsTalk (2)/app/src/main/java/com/example/hstalk/KcpWebViewClient.java | 8aaaac6faff69897d67f0cc6bd102fb0d37c9ec5 | [] | no_license | hanseul1/capD | ae692d2d4f010f8339543f1c0ef02ca201235913 | 025799c4352017db059ac923613f8ace94ca93da | refs/heads/master | 2020-07-27T02:20:57.314878 | 2020-02-09T10:19:28 | 2020-02-09T10:19:28 | 208,835,103 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,045 | java | package com.example.hstalk;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
/**
* Created by jang on 2017. 9. 14..
*/
public class KcpWebViewClient extends WebViewClient {
private Activity activity;
private WebView target;
final String KTFC_PACKAGE = "com.kftc.bankpay.android";
public KcpWebViewClient(Activity activity, WebView target) {
this.activity = activity;
this.target = target;
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (!url.startsWith("http://") && !url.startsWith("https://") && !url.startsWith("javascript:")) {
Intent intent = null;
try {
intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME); //IntentURI처리
Uri uri = Uri.parse(intent.getDataString());
activity.startActivity(new Intent(Intent.ACTION_VIEW, uri));
return true;
} catch (URISyntaxException ex) {
return false;
} catch (ActivityNotFoundException e) {
if (intent == null) return false;
if (handleNotFoundPaymentScheme(intent.getScheme())) return true;
String packageName = intent.getPackage();
if (packageName != null) {
activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName)));
return true;
}
return false;
}
}
return false;
}
/**
* @param scheme
* @return 해당 scheme에 대해 처리를 직접 하는지 여부
* <p>
* 결제를 위한 3rd-party 앱이 아직 설치되어있지 않아 ActivityNotFoundException이 발생하는 경우 처리합니다.
* 여기서 handler되지않은 scheme에 대해서는 intent로부터 Package정보 추출이 가능하다면 다음에서 packageName으로 market이동합니다.
*/
protected boolean handleNotFoundPaymentScheme(String scheme) {
//PG사에서 호출하는 url에 package정보가 없어 ActivityNotFoundException이 난 후 market 실행이 안되는 경우
if (PaymentScheme.ISP.equalsIgnoreCase(scheme)) {
activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + PaymentScheme.PACKAGE_ISP)));
return true;
} else if (PaymentScheme.BANKPAY.equalsIgnoreCase(scheme)) {
activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + PaymentScheme.PACKAGE_BANKPAY)));
return true;
}
return false;
}
} | [
"hsdeb11@gmail.com"
] | hsdeb11@gmail.com |
e0a5005030f02d015c2f1ae614d2f37c02a53836 | ac1590ae578eeba24f261629eff206620e536540 | /src/main/java/com/experiment/CalUserVectorWay3.java | 09e72b7fac72c77f65451bf5822b7af80a1c7a0d | [] | no_license | wdmyong/algorithm | 76d762dd3fa8a57474061d88f5ff1785d4242f28 | 1ae91f79841261e7da11e471ce6de826708cfd3a | refs/heads/master | 2021-04-22T06:43:04.377948 | 2017-06-17T04:10:34 | 2017-06-17T04:10:34 | 94,599,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,241 | java | package com.experiment;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static java.lang.Math.abs;
import static java.lang.Math.exp;
import static java.lang.Math.sqrt;
/**
* Created by yongduan on 2017/3/11.
*/
public class CalUserVectorWay3 {
// 评分时间-发布时间矩阵(用户对项目的评分时间-发布时间)
private static Map<Integer, Map<Integer, Long>> timeMatrix = new HashMap<>();
// 每个用户的评分集合(用户所有评分的项目集合)
private static Map<Integer, Set<Integer>> userMap = new HashMap<>();
private static long maxValue = 0L;
public static void cal(List<Rating> ratingList) {
for (Rating rating : ratingList) {
Map<Integer, Long> tmp = timeMatrix.get(rating.getUserId());
if (tmp == null) {
tmp = new HashMap<>();
}
tmp.put(rating.getItemId(), rating.getTimeActive() / 24 / 3600);
timeMatrix.put(rating.getUserId(), tmp);
Set<Integer> tmpSet = userMap.get(rating.getUserId());
if (tmpSet == null) {
tmpSet = new HashSet<>();
}
tmpSet.add(rating.getItemId());
userMap.put(rating.getUserId(), tmpSet);
}
for (int i = 1; i < 943; i++) {
for (int j = i + 1; j <= 943; j++) {
Set<Integer> inter = calIncludeSet(i, j);
if (inter != null && inter.size() > 0) {
for (Integer integer : inter) {
if (timeMatrix.get(i).get(integer) > maxValue) {
maxValue = timeMatrix.get(i).get(integer);
}
if (timeMatrix.get(j).get(integer) > maxValue) {
maxValue = timeMatrix.get(j).get(integer);
}
}
}
}
}
System.out.println("最大值:" + maxValue);
System.out.println("line1:");
calB(0, 5000000 / 3600 / 24);
System.out.println("line2:");
calA(4000000 / 3600 / 24, 200000000 / 3600 / 24);
calB(4000000 / 3600 / 24, 200000000 / 3600 / 24);
System.out.println("line3:");
calA(150000000 / 3600 / 24, 500000000 / 3600 / 24);
calB(150000000 / 3600 / 24, 500000000 / 3600 / 24);
System.out.println("line4:");
calA(400000000 / 3600 / 24, maxValue);
}
private static long calA(long a, long b) {
long c = calC(a, b);
int k = 1;
long sum = 0;
for (Map.Entry<Integer, Map<Integer, Long>> entry1 : timeMatrix.entrySet()) {
for (Map.Entry<Integer, Long> entry2 : entry1.getValue().entrySet()) {
if (entry2.getValue() <= c) {
sum += (c - entry2.getValue());
k++;
}
}
}
long result = 0;
if (k > 0 ) {
result = sum / k;
}
System.out.println("A: " + result);
return result;
}
private static long calB(long a, long b) {
long c = calC(a, b);
int k = 0;
long sum = 0;
for (Map.Entry<Integer, Map<Integer, Long>> entry1 : timeMatrix.entrySet()) {
for (Map.Entry<Integer, Long> entry2 : entry1.getValue().entrySet()) {
if (entry2.getValue() >= c && entry2.getValue() <= b) {
sum += (entry2.getValue() - c);
k++;
}
}
}
long result = 0;
if (k > 0 ) {
result = sum / k;
}
System.out.println("B: " + result);
return result;
}
private static long calC(long a, long b) {
if (a == 0) {
System.out.println("C: 0");
return 0;
}
if (a == 400000000 / 3600 / 24) {
System.out.println("C: " + b);
return b;
}
int k = 0;
long sum = 0;
for (Map.Entry<Integer, Map<Integer, Long>> entry1 : timeMatrix.entrySet()) {
for (Map.Entry<Integer, Long> entry2 : entry1.getValue().entrySet()) {
if (entry2.getValue() >= a && entry2.getValue() <= b) {
sum += entry2.getValue();
k++;
}
}
}
long result = 0;
if (k > 0 ) {
result = sum / k;
}
System.out.println("C: " + result);
return result;
}
public static double calCal(long x, int line) {
if (line == 1) {
long B = 32; //calB(0, 2000000);
long c = 0; //calC(0, 2000000);
long b = 5000000 / 3600 / 24;
if (x > c && x <= b) {
return calTmp(x, c, B);
} else {
return 0;
}
}
if (line == 2) {
long A = 468; //calA(1500000, 6000000);
long B = 586;//calB(1500000, 6000000);
long c = 888; //calC(1500000, 6000000);
long a = 4000000 / 3600 / 24;
long b = 200000000 / 3600 / 24;
if (x > c && x <= b) {
return calTmp(x, c, B);
} else if (x > a & x <= c){
return calTmp(x, c, A);
} else {
return 0;
}
}
if (line == 3) {
long A = 2027; //calA(5000000, 9000000);
long B = 1134; //calB(5000000, 9000000);
long c = 3011; //calC(5000000, 9000000);
long a = 150000000 / 3600 / 24;
long b = 500000000 / 3600 / 24;
if (x > c && x <= b) {
return calTmp(x, c, B);
} else if (x > a & x <= c){
return calTmp(x, c, A);
} else {
return 0;
}
}
if (line == 4) {
long A = 7350; //calA(8000000, maxValue);
long c = 10338; //calC(8000000, maxValue);
long a = 400000000 / 3600 / 24;
if (x > a & x <= c){
return calTmp(x, c, A);
} else {
return 0;
}
}
return 0.0;
}
private static double calTmp(long x, long c, long y) {
double tmp = 1.0d * (x - c) * (x - c);
tmp = 1.0d * tmp / (y);
double res = exp(-tmp);
if (res == 0) {
//System.out.println("" + x + "\t" + c + "\t" + y + "\t" + tmp);
}
return res;
}
// inter为空进不来的
public static double calGap(int i, int j, Set<Integer> inter) {
double result = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0;
for (Integer tmp : inter) {
t1 = calCal(timeMatrix.get(i).get(tmp), 1) - calCal(timeMatrix.get(j).get(tmp), 1);
t2 = calCal(timeMatrix.get(i).get(tmp), 2) - calCal(timeMatrix.get(j).get(tmp), 2);
t3 = calCal(timeMatrix.get(i).get(tmp), 3) - calCal(timeMatrix.get(j).get(tmp), 3);
t4 = calCal(timeMatrix.get(i).get(tmp), 4) - calCal(timeMatrix.get(j).get(tmp), 4);
double temp = t1 * t1;
temp += t2 * t2;
temp += t3 * t3;
temp += t4 * t4;
temp = sqrt(temp) * abs(timeMatrix.get(i).get(tmp) - timeMatrix.get(j).get(tmp));
result += temp;
}
result = result / (1.0d * inter.size());
if(result == 0) {
//System.out.println("" + t1 + "\t" + t2 + "\t" + t3 + "\t" + t4);
}
return result;
}
public static Set<Integer> calIncludeSet(Integer i, Integer j) {
Set<Integer> set1 = new HashSet<>();
Set<Integer> set2 = new HashSet<>();
if (userMap.get(i) != null) {
set1.addAll(userMap.get(i));
}
if (userMap.get(j) != null) {
set2.addAll(userMap.get(j));
}
set1.retainAll(set2);
return set1;
}
}
| [
"yongduan@sohu-inc.com"
] | yongduan@sohu-inc.com |
3118d600d4e850a63757f26eb90bf2c9a41aabc2 | 902bbf50f4e9147a8117f6c4ff04407e9ed22fd1 | /src/main/java/ktds/fresh/kafkaredisexample/redis/Point.java | fc5a5e0d442623a1aa4c594b7c26c0dc38c505f2 | [] | no_license | WonHyeongCho/kafka-redis-example | 4953e5f9b1226a0d05c2387df24be8bb54cd34c2 | fd054aa937bdb95a66dbcefc5ef4827dbb62ef3c | refs/heads/master | 2022-11-19T21:27:30.771259 | 2020-02-19T05:56:38 | 2020-02-19T05:56:38 | 228,138,105 | 1 | 0 | null | 2022-11-16T00:40:12 | 2019-12-15T06:18:46 | Java | UTF-8 | Java | false | false | 1,095 | java | package ktds.fresh.kafkaredisexample.redis;
import lombok.Builder;
import lombok.Getter;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import java.io.Serializable;
import java.time.LocalDateTime;
@Getter
@RedisHash("point")
public class Point implements Serializable {
@Id
private String id;
private int amount;
private LocalDateTime refreshTime;
@Builder
public Point(String id, int amount, LocalDateTime refreshTime) {
this.id = id;
this.amount = amount;
this.refreshTime = refreshTime;
}
public void refresh(int amount, LocalDateTime refreshTime){
if(refreshTime.isAfter(this.refreshTime)){ // 저장된 데이터보다 최신 데이터일 경우
this.amount = amount;
this.refreshTime = refreshTime;
}
}
@Override
public String toString() {
return "Point{" +
"id='" + id + '\'' +
", amount=" + amount +
", refreshTime=" + refreshTime +
'}';
}
}
| [
"whcho@kangwon.ac.kr"
] | whcho@kangwon.ac.kr |
b23725d33785fdad09699773a7ff8fed5b5b40a8 | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.browser-base/sources/defpackage/NQ0.java | 08e5bbf840b0354a2c75ae957839a497a2aac618 | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 863 | java | package defpackage;
import android.app.Activity;
import android.view.MenuItem;
import android.view.View;
import androidx.appcompat.widget.SearchView;
/* renamed from: NQ0 reason: default package */
/* compiled from: chromium-OculusBrowser.apk-stable-281887347 */
public final /* synthetic */ class NQ0 implements View.OnLayoutChangeListener {
public final MenuItem F;
public final SearchView G;
public final Activity H;
public NQ0(MenuItem menuItem, SearchView searchView, Activity activity) {
this.F = menuItem;
this.G = searchView;
this.H = activity;
}
public void onLayoutChange(View view, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
MenuItem menuItem = this.F;
SearchView searchView = this.G;
RQ0.e(menuItem, searchView.V.getText().toString(), this.H);
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
2af109876cb6bf4f8fe9530eb349f43e32705131 | 09df48b0e170c68b888edf170dd5e4f197634c8a | /app/src/test/java/com/xd/customgsonrequest/ExampleUnitTest.java | f0e1e94f17724a5ade516d32c6aafb94df1c675a | [] | no_license | hhhwww/CustomGsonRequest | 9437921de54394c73b56277e3089dda3d3a68814 | 3c024025a1429fcc330e655c2508096bea30a2b1 | refs/heads/master | 2021-01-10T10:02:26.616322 | 2016-03-20T15:36:43 | 2016-03-20T15:36:43 | 54,325,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package com.xd.customgsonrequest;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"xdhhhwww@foxmail.com"
] | xdhhhwww@foxmail.com |
b4b76f43021a50528f00949a77e9df434d132c7e | df4b57cbeb276e0db36614e6f8d4a6cfc6cdc07f | /Summer/src/main/java/com/yichen/summer/widgets/tagcloud/Tag.java | c9b22acb45c0de1952b0432698ef689164905163 | [
"Apache-2.0"
] | permissive | yichen454/Android-KotlinExp | 4212f002c93b3b0a468018a33962effb33923919 | 9c592e2e6bb9dee907fe4f8a22c8b9fd835579b8 | refs/heads/master | 2020-04-25T14:55:58.451546 | 2019-08-16T09:56:34 | 2019-08-16T09:56:34 | 172,859,605 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,986 | java | package com.yichen.summer.widgets.tagcloud;
import android.graphics.Color;
import android.view.View;
/**
* Copyright © 2016 moxun
* <p>
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the “Software”),
* to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
* OR OTHER DEALINGS IN THE SOFTWARE.
*/
public class Tag {
private int popularity; //this is the importance/popularity of the Tag
private float locX, locY, locZ; //the center of the 3D Tag
private float loc2DX, loc2DY;
private float scale;
private float alpha;
private float[] argb;
private static final int DEFAULT_POPULARITY = 5;
private View mView;
public Tag() {
this(0f, 0f, 0f, 1.0f, 0);
}
public Tag(int popularity) {
this(0f, 0f, 0f, 1.0f, popularity);
}
public Tag(float locX, float locY, float locZ) {
this(locX, locY, locZ, 1.0f, DEFAULT_POPULARITY);
}
public Tag(float locX, float locY, float locZ, float scale) {
this(locX, locY, locZ, scale, DEFAULT_POPULARITY);
}
public Tag(float locX, float locY, float locZ, float scale, int popularity) {
this.locX = locX;
this.locY = locY;
this.locZ = locZ;
this.loc2DX = 0;
this.loc2DY = 0;
this.argb = new float[]{1.0f, 0.5f, 0.5f, 0.5f};
this.scale = scale;
this.popularity = popularity;
}
public float getLocX() {
return locX;
}
public void setLocX(float locX) {
this.locX = locX;
}
public float getLocY() {
return locY;
}
public void setLocY(float locY) {
this.locY = locY;
}
public float getLocZ() {
return locZ;
}
public void setLocZ(float locZ) {
this.locZ = locZ;
}
public float getScale() {
return scale;
}
public void setScale(float scale) {
this.scale = scale;
}
public View getView() {
return mView;
}
public void setView(View view) {
this.mView = view;
}
public float getAlpha() {
return alpha;
}
public void setAlpha(float alpha) {
this.alpha = alpha;
this.argb[0] = alpha;
}
public int getPopularity() {
return popularity;
}
public void setPopularity(int popularity) {
this.popularity = popularity;
}
public float getLoc2DX() {
return loc2DX;
}
public void setLoc2DX(float loc2dx) {
loc2DX = loc2dx;
}
public float getLoc2DY() {
return loc2DY;
}
public void setLoc2DY(float loc2dy) {
loc2DY = loc2dy;
}
public void setColorByArray(float[] rgb) {
if (rgb != null) {
System.arraycopy(rgb, 0, this.argb, this.argb.length - rgb.length, rgb.length);
}
}
public int getColor() {
int[] result = new int[4];
for (int i = 0; i < 4; i++) {
result[i] = (int) (this.argb[i] * 0xff);
}
return Color.argb(result[0], result[1], result[2], result[3]);
}
}
| [
"Master_YiChen@163.com"
] | Master_YiChen@163.com |
030f662777961559df87b7f2b4e44400bb255dfb | d0088d7be7aedd7846894372b22c783e9a08e207 | /src/CCI/C4_FirstCommonAncestor.java | 42d7e9c2ec81b6dacc1e32ad1a63cd446a48e233 | [] | no_license | srishti77/Algorithm | 4b21c21f6cf307e3d3cb98242d0802d112977dd7 | 0cde94becc1623c6859b89c62abf15a48ddd356a | refs/heads/master | 2021-10-25T20:54:10.660676 | 2019-04-07T13:58:06 | 2019-04-07T13:58:06 | 106,170,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package CCI;
import CCI.Bc4_STSequences.BSTree;
public class C4_FirstCommonAncestor {
public static void main(String s[]) {
Bc4_STSequences tree = new Bc4_STSequences();
tree.insert(5);
tree.insert(3);
tree.insert(2);
tree.insert(4);
tree.insert(9);
tree.insert(7);
tree.insert(8);
tree.insert(10);
tree.insert(11);
tree.print();
// System.out.println(tree.root);
C4_FirstCommonAncestor cf = new C4_FirstCommonAncestor();
System.out.println(cf.checkDescend(tree.root, 54));
System.out.println("Find common:::" + cf.findCommonAnc(tree.root, 8, 11).data);
}
public BSTree findCommonAnc(BSTree root, int value1, int value2) {
if (checkDescend(root.left, value1)) {
if (checkDescend(root.left, value2)) {
root.left = findCommonAnc(root.left, value1, value2);
return root.left;
} else if (checkDescend(root.right, value2)) {
System.out.println("Root:" + root.data);
return root;
} else {
System.out.println("Do nothing");
return null;
}
} else if (checkDescend(root.right, value1)) {
if (checkDescend(root.right, value2)) {
root.right = findCommonAnc(root.right, value1, value2);
return root.right;
} else if (checkDescend(root.left, value2)) {
System.out.println("Root left:" + root.data);
return root;
}
}
return null;
}
public boolean checkDescend(BSTree node, int value) {
if (node == null)
return false;
if (node != null && node.data == value)
return true;
return checkDescend(node.left, value) || checkDescend(node.right, value);
}
} | [
"="
] | = |
8a530646742dd568aee37597a3fe2b3e800f3481 | 41dd628179a0c05021a3b61f030444609cfc0964 | /src/java/dal/BaseDAO.java | 042573f8de0d48c27b13e05424b23906e6c85b9c | [] | no_license | canhnam141120/ProjectWebChineseFood | 5adec9c7bfbdcf6499fd1fbfa9f3cae284c4fde0 | 78678040f4a18ba159725452d53f3486b9d53475 | refs/heads/master | 2023-06-08T08:36:39.479874 | 2021-06-26T19:01:25 | 2021-06-26T19:01:25 | 380,576,785 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,520 | 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 dal;
import entity.BaseModel;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author cauch
*/
public abstract class BaseDAO<T extends BaseModel> {
protected Connection connection;
public BaseDAO() {
try {
String user = "sa";
String pass = "sa";
String url = "jdbc:sqlserver://localhost:1433;databaseName=ChineseShop";
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
connection = DriverManager.getConnection(url, user, pass);
} catch (ClassNotFoundException | SQLException ex) {
Logger.getLogger(BaseDAO.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void closeConnection() {
// try {
// if (!connection.isClosed()) {
// connection.close();
// }
// } catch (SQLException ex) {
// Logger.getLogger(StudentDAO.class.getName()).log(Level.SEVERE, null, ex);
// }
}
public abstract void add(T model);
public abstract void update(T model);
public abstract void delete(int ID);
public abstract ArrayList<T> list();
public abstract T get(int ID);
}
| [
"namnche141707@fpt.edu.vn"
] | namnche141707@fpt.edu.vn |
bdf8d73885d49536162a8b1b5ca3c4d2cd3f8b55 | 934eecfb5ab4734a893398ee7aeb8b7a6415cf1c | /src/com/commonsware/cwac/camera/OnAutoFocus.java | 08e2513e5e80c7a108a657e60bccd7e4f69d4347 | [
"Apache-2.0"
] | permissive | quentin23soleil/cwac-camera | b121e4b6519df30600adfff0955a9c1b1c198471 | 1adebb72fbd1019d6c522f1b2f95cb21a77a2f68 | refs/heads/master | 2021-06-18T20:03:59.494524 | 2013-11-11T16:20:09 | 2013-11-11T16:20:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 153 | java | package com.commonsware.cwac.camera;
import android.hardware.Camera;
public interface OnAutoFocus {
public void onAutoFocus(boolean s, Camera c);
}
| [
"dommer_q@epitech.eu"
] | dommer_q@epitech.eu |
8f30f9f0ab36fcdf315da9b28417d9caf92562f2 | d4baadf8023faba5721d96f2a5e23ecab03059c9 | /Solution/triangular_pentagon_hexagon_E45.java | b1dfb651548f99dcebc59c62aa346dbf21ed0198 | [] | no_license | divyang2401/Algorithm_Problems | 194088fe288e5b5dfa8ecc55c46b5bd7f5f52d97 | dca57a2be32396e29b0c6f1f0abf12db8c340f17 | refs/heads/master | 2020-03-28T11:10:24.168328 | 2019-10-01T01:01:05 | 2019-10-01T01:01:05 | 148,085,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 480 | java | public class E45 {
public static void main(String[] args) {
int p = 286;
int q = 166;
int r = 144;
while (true) {
long tri = (long)p * (p + 1) / 2;
long pent = (long)q * (q * 3 - 1) / 2;
long hex = (long)r * (r * 2 - 1);
long min = Math.min(Math.min(tri, pent), hex);
if (min == tri && min == pent && min == hex){
System.out.println(Long.toString(min));break;}
if (min == tri) p++;
if (min == pent) q++;
if (min == hex ) r++;
}
}
} | [
"divyang.uaf101@gmail.com"
] | divyang.uaf101@gmail.com |
2a9b4bd0b50aff7de182a9978cd713dc31da9c7e | ec5fe8f20dfe82b479cea3da24c78190f768e086 | /cas-4.1.0/cas-server-webapp-support/src/test/java/org/jasig/cas/web/support/AbstractInMemoryThrottledSubmissionHandlerInterceptorAdapterTests.java | 46fc0d46f0a90620df5665321fd39815f62ca70b | [
"MIT",
"LicenseRef-scancode-jsr-107-jcache-spec-2013",
"EPL-1.0",
"Classpath-exception-2.0",
"LGPL-2.0-or-later",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"CDDL-1.1",
"MPL-1.1",
"LGPL-2.1-only",
"WTFPL",
"CDDL-1.0",
"GPL-2.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"W3C",
"SAX-PD",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later",
"GPL-1.0-or-later"
] | permissive | hsj-xiaokang/springboot-shiro-cas-mybatis | b4cf76dc2994d63f771da0549cf711ea674e53bf | 3673a9a9b279dd1e624c1a7a953182301f707997 | refs/heads/master | 2022-06-26T15:28:49.854390 | 2020-12-06T04:43:13 | 2020-12-06T04:43:13 | 103,009,179 | 42 | 24 | MIT | 2022-06-25T07:27:42 | 2017-09-10T06:35:28 | Java | UTF-8 | Java | false | false | 2,112 | java | /*
* Licensed to Apereo under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Apereo licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a
* copy of the License at the following location:
*
* 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.jasig.cas.web.support;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.test.MockRequestContext;
/**
* Base class for in-memory throttled submission handlers.
*
* @author Marvin S. Addison
* @since 3.0.0
*/
public abstract class AbstractInMemoryThrottledSubmissionHandlerInterceptorAdapterTests
extends AbstractThrottledSubmissionHandlerInterceptorAdapterTests {
@Override
protected MockHttpServletResponse loginUnsuccessfully(final String username, final String fromAddress) throws Exception {
final MockHttpServletRequest request = new MockHttpServletRequest();
final MockHttpServletResponse response = new MockHttpServletResponse();
request.setMethod("POST");
request.setParameter("username", username);
request.setRemoteAddr(fromAddress);
final MockRequestContext context = new MockRequestContext();
context.setCurrentEvent(new Event("", "error"));
request.setAttribute("flowRequestContext", context);
getThrottle().preHandle(request, response, null);
getThrottle().postHandle(request, response, null, null);
return response;
}
}
| [
"2356899074@qq.com"
] | 2356899074@qq.com |
14f321e7fe89bf16a52dcb592bbe34dd774256f0 | 79878c7664d649ec2fcf1532d12434aeeaec70bc | /zhiyu-baseplatform-handler/src/main/java/com/zhiyu/baseplatform/dto/ClassScheduleDetailDto.java | 0203a4a323fbef6e0877fc5418103c34c3ecf4ab | [] | no_license | asd435658185/qd-zp | 67e14c99afd2b4f7c1890c08c2713facad0e288a | 5e4259bb7ac57d416807bd7ac35e00e57feef997 | refs/heads/master | 2023-01-08T23:51:17.181806 | 2020-11-16T07:38:58 | 2020-11-16T07:38:58 | 313,223,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,567 | java | package com.zhiyu.baseplatform.dto;
public class ClassScheduleDetailDto {
/**
* 课程明细id
*/
private Integer id;
/**
* 任科老师id
*/
private Integer teacherId;
/**
* 科目id
*/
private Integer courseId;
/**
* 周几
*/
private Integer dayIndex;
/**
* 课节id
*/
private Integer lessionId;
/**
* 课程主表id
*/
private Integer scheduleId;
private String lessionName;
private String teacherName;
private String teacherTel;
private String courseName;
private String dayName;
/**
* 课节信息上课时间
*/
private String beginTime;
/**
* 课节信息下课时间
*/
private String endTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getTeacherId() {
return teacherId;
}
public void setTeacherId(Integer teacherId) {
this.teacherId = teacherId;
}
public Integer getCourseId() {
return courseId;
}
public void setCourseId(Integer courseId) {
this.courseId = courseId;
}
public Integer getDayIndex() {
return dayIndex;
}
public void setDayIndex(Integer dayIndex) {
this.dayIndex = dayIndex;
}
public Integer getLessionId() {
return lessionId;
}
public void setLessionId(Integer lessionId) {
this.lessionId = lessionId;
}
public Integer getScheduleId() {
return scheduleId;
}
public void setScheduleId(Integer scheduleId) {
this.scheduleId = scheduleId;
}
public String getLessionName() {
return lessionName;
}
public void setLessionName(String lessionName) {
this.lessionName = lessionName;
}
public String getTeacherName() {
return teacherName;
}
public void setTeacherName(String teacherName) {
this.teacherName = teacherName;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public String getDayName() {
return dayName;
}
public void setDayName(String dayName) {
this.dayName = dayName;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getTeacherTel() {
return teacherTel;
}
public void setTeacherTel(String teacherTel) {
this.teacherTel = teacherTel;
}
}
| [
"VPMT246@globalymc.com"
] | VPMT246@globalymc.com |
9e119ff30ad354b1ab0fd5dc0ca54d37b015f795 | dd0977a25cb544fb7b751a82ad22b85686ce9c29 | /school_framework/src/main/java/com/github/yiyan1992/carloan/config/shiro/ShiroSessionManager.java | 4000c8937d5fdc0bcdef4cf5dfeca1ea3041375a | [] | no_license | liangszzz/school | 727009f1b7d2160ffaee5ab977fdc59edc23b7f9 | 22727f39d433da2422bec26977d821d5ed811e1f | refs/heads/master | 2022-01-20T18:56:32.996110 | 2019-05-19T07:56:09 | 2019-05-19T07:56:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,334 | java | package com.github.yiyan1992.carloan.config.shiro;
import org.apache.shiro.web.servlet.ShiroHttpServletRequest;
import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.util.StringUtils;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.Serializable;
public class ShiroSessionManager extends DefaultWebSessionManager {
private static final String AUTHORIZATION = "Authorization";
private static final String REFERENCED_SESSION_ID_SOURCE = "Stateless request";
@Override
protected Serializable getSessionId(ServletRequest request, ServletResponse response) {
String id = WebUtils.toHttp(request).getHeader(AUTHORIZATION);
//如果请求头中有 Authorization 则其值为sessionId
if (!StringUtils.isEmpty(id)) {
request.setAttribute(REFERENCED_SESSION_ID_SOURCE, REFERENCED_SESSION_ID_SOURCE);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID, id);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_IS_VALID, Boolean.TRUE);
return id;
} else {
//否则按默认规则从cookie取sessionId
return super.getSessionId(request, response);
}
}
}
| [
"liang-shan@outlook.com"
] | liang-shan@outlook.com |
aded8c1aeab2dd8cb20916dafdc1a04980df6939 | 39dfce792c3b4277dafd97ec2bf02cc2115aa8d8 | /PBO Modul 2/src/com/narantyomaulan/modul2/Polimorfisme/Y.java | 6f293d9f714478bbcc1342f8208d57f37b51f0da | [] | no_license | narantyomaulana/Praktikum-Pemograman-Berorientasi-Objek | 3ecb169a2c240a28840a52b58357e24a1839829d | 342a081fb8df4e1b633b9fbd88808c0d3a7fd2b7 | refs/heads/main | 2023-01-04T01:27:04.247119 | 2020-10-17T03:34:41 | 2020-10-17T03:34:41 | 304,788,697 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | package com.narantyomaulan.modul2.Polimorfisme;
public class Y extends X{
@Override
public void getValue(String value) {
super.getValue(value);
System.out.println("value kelas y : " + value);
}
}
| [
"noreply@github.com"
] | narantyomaulana.noreply@github.com |
fad757abfd2d306334eeb44e93ee72f395dee0da | bffec1059335d9d75fdeea3d646180b232c8fd21 | /app/src/main/java/com/crt/whuseats/Dialog/LoadingDialog.java | 7d17974bdf3f19f76512dcdf5b54af6563d4fa6f | [] | no_license | crt106/WhuSeats | f5844a11439ca72345aa8c2c476857167e91e46f | 53ae30f026e1fcd54f2518dfbef45975edc7d522 | refs/heads/master | 2020-03-21T22:12:21.048733 | 2018-09-19T00:41:41 | 2018-09-19T00:41:41 | 139,111,287 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,934 | java | package com.crt.whuseats.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import com.crt.whuseats.R;
import com.wang.avi.AVLoadingIndicatorView;
import java.util.Random;
public class LoadingDialog extends AlertDialog
{
private static final String TAG = "LoadingDialog";
private AVLoadingIndicatorView aviview;
private static LoadingDialog instance;
private static String[] AVItypeArra={"BallClipRotatePulseIndicator","TriangleSkewSpinIndicator","PacmanIndicator","SemiCircleSpinIndicator"};
private LoadingDialog(@NonNull Context context)
{
super(context, R.style.LoadingDialog);
}
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_loadingdialog);
aviview=(AVLoadingIndicatorView)findViewById(R.id.avi);
this.setCancelable(false);
this.setCanceledOnTouchOutside(false);
}
/**
* 静态的展示对话框方法
*/
public static void LoadingShow(Context context)
{
LoadingDialog tmp=new LoadingDialog(context);
instance=tmp;
tmp.show();
}
/**
* 调用这个方法就会无条件随机式的切换loading风格 与random参数无关
* @param context
* @param random
*/
public static void LoadingShow(Context context,boolean random)
{
LoadingDialog tmp=new LoadingDialog(context);
int index= new Random().nextInt(4);
instance=tmp;
tmp.show();
tmp.aviview.setIndicator(AVItypeArra[index]);
}
public static void LoadingHide()
{
try
{
instance.dismiss();
} catch (Exception e)
{
Log.e(TAG, "LoadingHide: "+e.getMessage());
}
}
}
| [
"814909233@qq.com"
] | 814909233@qq.com |
2aa4b1aa260bd8d4549a1a606e80bb7d994039e6 | 466fc4dc548cfd895e6e748aabd55c5ce8b0ee2b | /src/test/java/com/uxpsystems/assignment/controller/UserControllerTest.java | 4fe58fcbc205d2394e1a6e22e61b06ef62c4231b | [] | no_license | shashank-on-codehunt/SpringRestFul | c459fbb8b17f66ed2e74ece1e6cfed46ccf13ac1 | 53c19cb91229dd331e0ce520d241d2e05472fa5f | refs/heads/master | 2021-05-18T19:55:27.704817 | 2020-03-30T18:27:59 | 2020-03-30T18:27:59 | 251,390,223 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java | package com.uxpsystems.assignment.controller;
import static org.junit.jupiter.api.Assertions.*;
class UserControllerTest {
} | [
"shashank4387@gmail.com"
] | shashank4387@gmail.com |
b0038dbcff2b64cff2ab3eb99c68ae94351a3d88 | 93025ef5f3f14e91e2c3543a0b4ab8ccc962b51d | /src/main/java/com/azmain/dcs/model/audit/DateAudit.java | 8b56fb8bb6a5d9d2deb3d89cac7b0370e169b37e | [] | no_license | azmain/server-document-capturing-system | daeef7fd08e03428c61de47b006418760e2e9a81 | e78aeafd21b22ea02d9b1db3b3f02112b366d316 | refs/heads/master | 2020-06-24T19:48:36.489874 | 2019-11-04T17:37:20 | 2019-11-04T17:37:20 | 199,066,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,195 | java | package com.azmain.dcs.model.audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.time.Instant;
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@JsonIgnoreProperties(
value = {"createdAt", "updatedAt"},
allowGetters = true
)
public abstract class DateAudit implements Serializable {
@CreatedDate
@Column(nullable = false, updatable = false)
private Instant createdAt;
@LastModifiedDate
@Column(nullable = false)
private Instant updatedAt;
public Instant getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public Instant getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Instant updatedAt) {
this.updatedAt = updatedAt;
}
}
| [
"azmainnishan@gmail.com"
] | azmainnishan@gmail.com |
3e2ffc78ca782da5a8f48aba5488452e91826888 | 028cbe18b4e5c347f664c592cbc7f56729b74060 | /external/modules/bean-validator/joda-time/1.6/src/test/org/joda/time/TestLocalDateTime_Basics.java | 20f061f987649a3a331cee55dfe65a478dcf94d5 | [
"Apache-2.0"
] | permissive | dmatej/Glassfish-SVN-Patched | 8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e | 269e29ba90db6d9c38271f7acd2affcacf2416f1 | refs/heads/master | 2021-05-28T12:55:06.267463 | 2014-11-11T04:21:44 | 2014-11-11T04:21:44 | 23,610,469 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 41,644 | java | /*
* Copyright 2001-2007 Stephen Colebourne
*
* 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.joda.time;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Arrays;
import java.util.Date;
import java.util.Locale;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.joda.time.chrono.BuddhistChronology;
import org.joda.time.chrono.CopticChronology;
import org.joda.time.chrono.GJChronology;
import org.joda.time.chrono.GregorianChronology;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
/**
* This class is a Junit unit test for LocalDate.
*
* @author Stephen Colebourne
*/
public class TestLocalDateTime_Basics extends TestCase {
private static final DateTimeZone PARIS = DateTimeZone.forID("Europe/Paris");
private static final DateTimeZone LONDON = DateTimeZone.forID("Europe/London");
private static final DateTimeZone TOKYO = DateTimeZone.forID("Asia/Tokyo");
private static final int OFFSET = 1;
private static final GJChronology GJ_UTC = GJChronology.getInstanceUTC();
private static final Chronology COPTIC_PARIS = CopticChronology.getInstance(PARIS);
private static final Chronology COPTIC_LONDON = CopticChronology.getInstance(LONDON);
private static final Chronology COPTIC_TOKYO = CopticChronology.getInstance(TOKYO);
private static final Chronology COPTIC_UTC = CopticChronology.getInstanceUTC();
private static final Chronology ISO_PARIS = ISOChronology.getInstance(PARIS);
private static final Chronology ISO_LONDON = ISOChronology.getInstance(LONDON);
private static final Chronology ISO_TOKYO = ISOChronology.getInstance(TOKYO);
private static final Chronology ISO_UTC = ISOChronology.getInstanceUTC();
private static final Chronology GREGORIAN_UTC = GregorianChronology.getInstanceUTC();
private static final Chronology BUDDHIST_PARIS = BuddhistChronology.getInstance(PARIS);
private static final Chronology BUDDHIST_LONDON = BuddhistChronology.getInstance(LONDON);
private static final Chronology BUDDHIST_TOKYO = BuddhistChronology.getInstance(TOKYO);
private static final Chronology BUDDHIST_UTC = BuddhistChronology.getInstanceUTC();
// private long TEST_TIME1 =
// (31L + 28L + 31L + 6L -1L) * DateTimeConstants.MILLIS_PER_DAY
// + 12L * DateTimeConstants.MILLIS_PER_HOUR
// + 24L * DateTimeConstants.MILLIS_PER_MINUTE;
//
// private long TEST_TIME2 =
// (365L + 31L + 28L + 31L + 30L + 7L -1L) * DateTimeConstants.MILLIS_PER_DAY
// + 14L * DateTimeConstants.MILLIS_PER_HOUR
// + 28L * DateTimeConstants.MILLIS_PER_MINUTE;
private int MILLIS_OF_DAY_UTC =
(int) (10L * DateTimeConstants.MILLIS_PER_HOUR
+ 20L * DateTimeConstants.MILLIS_PER_MINUTE
+ 30L * DateTimeConstants.MILLIS_PER_SECOND
+ 40L);
private long TEST_TIME_NOW_UTC =
(31L + 28L + 31L + 30L + 31L + 9L -1L) * DateTimeConstants.MILLIS_PER_DAY + MILLIS_OF_DAY_UTC;
private DateTimeZone zone = null;
public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
}
public static TestSuite suite() {
return new TestSuite(TestLocalDateTime_Basics.class);
}
public TestLocalDateTime_Basics(String name) {
super(name);
}
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW_UTC);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
zone = null;
}
//-----------------------------------------------------------------------
public void testGet_DateTimeFieldType() {
LocalDateTime test = new LocalDateTime(1970, 6, 9, 10, 20, 30, 40);
assertEquals(1970, test.get(DateTimeFieldType.year()));
assertEquals(6, test.get(DateTimeFieldType.monthOfYear()));
assertEquals(9, test.get(DateTimeFieldType.dayOfMonth()));
assertEquals(2, test.get(DateTimeFieldType.dayOfWeek()));
assertEquals(160, test.get(DateTimeFieldType.dayOfYear()));
assertEquals(24, test.get(DateTimeFieldType.weekOfWeekyear()));
assertEquals(1970, test.get(DateTimeFieldType.weekyear()));
assertEquals(10, test.get(DateTimeFieldType.hourOfDay()));
assertEquals(20, test.get(DateTimeFieldType.minuteOfHour()));
assertEquals(30, test.get(DateTimeFieldType.secondOfMinute()));
assertEquals(40, test.get(DateTimeFieldType.millisOfSecond()));
assertEquals(MILLIS_OF_DAY_UTC / 60000 , test.get(DateTimeFieldType.minuteOfDay()));
assertEquals(MILLIS_OF_DAY_UTC / 1000 , test.get(DateTimeFieldType.secondOfDay()));
assertEquals(MILLIS_OF_DAY_UTC , test.get(DateTimeFieldType.millisOfDay()));
assertEquals(10, test.get(DateTimeFieldType.hourOfHalfday()));
assertEquals(DateTimeConstants.AM, test.get(DateTimeFieldType.halfdayOfDay()));
test = new LocalDateTime(1970, 6, 9, 12, 30);
assertEquals(0, test.get(DateTimeFieldType.hourOfHalfday()));
assertEquals(12, test.get(DateTimeFieldType.clockhourOfHalfday()));
assertEquals(12, test.get(DateTimeFieldType.clockhourOfDay()));
assertEquals(DateTimeConstants.PM, test.get(DateTimeFieldType.halfdayOfDay()));
test = new LocalDateTime(1970, 6, 9, 14, 30);
assertEquals(2, test.get(DateTimeFieldType.hourOfHalfday()));
assertEquals(2, test.get(DateTimeFieldType.clockhourOfHalfday()));
assertEquals(14, test.get(DateTimeFieldType.clockhourOfDay()));
assertEquals(DateTimeConstants.PM, test.get(DateTimeFieldType.halfdayOfDay()));
test = new LocalDateTime(1970, 6, 9, 0, 30);
assertEquals(0, test.get(DateTimeFieldType.hourOfHalfday()));
assertEquals(12, test.get(DateTimeFieldType.clockhourOfHalfday()));
assertEquals(24, test.get(DateTimeFieldType.clockhourOfDay()));
assertEquals(DateTimeConstants.AM, test.get(DateTimeFieldType.halfdayOfDay()));
try {
test.get(null);
fail();
} catch (IllegalArgumentException ex) {}
}
public void testSize() {
LocalDateTime test = new LocalDateTime();
assertEquals(4, test.size());
}
public void testGetFieldType_int() {
LocalDateTime test = new LocalDateTime(COPTIC_PARIS);
assertSame(DateTimeFieldType.year(), test.getFieldType(0));
assertSame(DateTimeFieldType.monthOfYear(), test.getFieldType(1));
assertSame(DateTimeFieldType.dayOfMonth(), test.getFieldType(2));
assertSame(DateTimeFieldType.millisOfDay(), test.getFieldType(3));
try {
test.getFieldType(-1);
} catch (IndexOutOfBoundsException ex) {}
try {
test.getFieldType(3);
} catch (IndexOutOfBoundsException ex) {}
}
public void testGetFieldTypes() {
LocalDateTime test = new LocalDateTime(COPTIC_PARIS);
DateTimeFieldType[] fields = test.getFieldTypes();
assertSame(DateTimeFieldType.year(), fields[0]);
assertSame(DateTimeFieldType.monthOfYear(), fields[1]);
assertSame(DateTimeFieldType.dayOfMonth(), fields[2]);
assertSame(DateTimeFieldType.millisOfDay(), fields[3]);
assertNotSame(test.getFieldTypes(), test.getFieldTypes());
}
public void testGetField_int() {
LocalDateTime test = new LocalDateTime(COPTIC_PARIS);
assertSame(COPTIC_UTC.year(), test.getField(0));
assertSame(COPTIC_UTC.monthOfYear(), test.getField(1));
assertSame(COPTIC_UTC.dayOfMonth(), test.getField(2));
assertSame(COPTIC_UTC.millisOfDay(), test.getField(3));
try {
test.getField(-1);
} catch (IndexOutOfBoundsException ex) {}
try {
test.getField(3);
} catch (IndexOutOfBoundsException ex) {}
}
public void testGetFields() {
LocalDateTime test = new LocalDateTime(COPTIC_PARIS);
DateTimeField[] fields = test.getFields();
assertSame(COPTIC_UTC.year(), fields[0]);
assertSame(COPTIC_UTC.monthOfYear(), fields[1]);
assertSame(COPTIC_UTC.dayOfMonth(), fields[2]);
assertSame(COPTIC_UTC.millisOfDay(), fields[3]);
assertNotSame(test.getFields(), test.getFields());
}
public void testGetValue_int() {
LocalDateTime test = new LocalDateTime(ISO_UTC);
assertEquals(1970, test.getValue(0));
assertEquals(6, test.getValue(1));
assertEquals(9, test.getValue(2));
assertEquals(MILLIS_OF_DAY_UTC, test.getValue(3));
try {
test.getValue(-1);
} catch (IndexOutOfBoundsException ex) {}
try {
test.getValue(3);
} catch (IndexOutOfBoundsException ex) {}
}
public void testGetValues() {
LocalDateTime test = new LocalDateTime(ISO_UTC);
int[] values = test.getValues();
assertEquals(1970, values[0]);
assertEquals(6, values[1]);
assertEquals(9, values[2]);
assertEquals(MILLIS_OF_DAY_UTC, values[3]);
assertNotSame(test.getValues(), test.getValues());
}
public void testIsSupported_DateTimeFieldType() {
LocalDateTime test = new LocalDateTime();
assertEquals(true, test.isSupported(DateTimeFieldType.year()));
assertEquals(true, test.isSupported(DateTimeFieldType.monthOfYear()));
assertEquals(true, test.isSupported(DateTimeFieldType.dayOfMonth()));
assertEquals(true, test.isSupported(DateTimeFieldType.dayOfWeek()));
assertEquals(true, test.isSupported(DateTimeFieldType.dayOfYear()));
assertEquals(true, test.isSupported(DateTimeFieldType.weekOfWeekyear()));
assertEquals(true, test.isSupported(DateTimeFieldType.weekyear()));
assertEquals(true, test.isSupported(DateTimeFieldType.yearOfCentury()));
assertEquals(true, test.isSupported(DateTimeFieldType.yearOfEra()));
assertEquals(true, test.isSupported(DateTimeFieldType.centuryOfEra()));
assertEquals(true, test.isSupported(DateTimeFieldType.weekyearOfCentury()));
assertEquals(true, test.isSupported(DateTimeFieldType.era()));
assertEquals(true, test.isSupported(DateTimeFieldType.hourOfDay()));
assertEquals(true, test.isSupported(DateTimeFieldType.minuteOfHour()));
assertEquals(true, test.isSupported(DateTimeFieldType.secondOfMinute()));
assertEquals(true, test.isSupported(DateTimeFieldType.millisOfSecond()));
assertEquals(true, test.isSupported(DateTimeFieldType.minuteOfDay()));
assertEquals(true, test.isSupported(DateTimeFieldType.secondOfDay()));
assertEquals(true, test.isSupported(DateTimeFieldType.millisOfDay()));
assertEquals(true, test.isSupported(DateTimeFieldType.hourOfHalfday()));
assertEquals(true, test.isSupported(DateTimeFieldType.halfdayOfDay()));
assertEquals(true, test.isSupported(DateTimeFieldType.clockhourOfHalfday()));
assertEquals(true, test.isSupported(DateTimeFieldType.clockhourOfDay()));
assertEquals(false, test.isSupported((DateTimeFieldType) null));
}
public void testIsSupported_DurationFieldType() {
LocalDateTime test = new LocalDateTime();
assertEquals(false, test.isSupported(DurationFieldType.eras()));
assertEquals(true, test.isSupported(DurationFieldType.centuries()));
assertEquals(true, test.isSupported(DurationFieldType.years()));
assertEquals(true, test.isSupported(DurationFieldType.months()));
assertEquals(true, test.isSupported(DurationFieldType.weekyears()));
assertEquals(true, test.isSupported(DurationFieldType.weeks()));
assertEquals(true, test.isSupported(DurationFieldType.days()));
assertEquals(true, test.isSupported(DurationFieldType.hours()));
assertEquals(true, test.isSupported(DurationFieldType.minutes()));
assertEquals(true, test.isSupported(DurationFieldType.seconds()));
assertEquals(true, test.isSupported(DurationFieldType.millis()));
assertEquals(true, test.isSupported(DurationFieldType.halfdays()));
assertEquals(false, test.isSupported((DurationFieldType) null));
}
public void testEqualsHashCode() {
LocalDateTime test1 = new LocalDateTime(1970, 6, 9, 10, 20, 30, 40, COPTIC_PARIS);
LocalDateTime test2 = new LocalDateTime(1970, 6, 9, 10, 20, 30, 40, COPTIC_PARIS);
assertEquals(true, test1.equals(test2));
assertEquals(true, test2.equals(test1));
assertEquals(true, test1.equals(test1));
assertEquals(true, test2.equals(test2));
assertEquals(true, test1.hashCode() == test2.hashCode());
assertEquals(true, test1.hashCode() == test1.hashCode());
assertEquals(true, test2.hashCode() == test2.hashCode());
LocalDateTime test3 = new LocalDateTime(1971, 6, 9, 10, 20, 30, 40);
assertEquals(false, test1.equals(test3));
assertEquals(false, test2.equals(test3));
assertEquals(false, test3.equals(test1));
assertEquals(false, test3.equals(test2));
assertEquals(false, test1.hashCode() == test3.hashCode());
assertEquals(false, test2.hashCode() == test3.hashCode());
assertEquals(false, test1.equals("Hello"));
assertEquals(true, test1.equals(new MockInstant()));
Partial partial = new Partial(
new DateTimeFieldType[] {
DateTimeFieldType.year(), DateTimeFieldType.monthOfYear(),
DateTimeFieldType.dayOfMonth(), DateTimeFieldType.millisOfDay()},
new int[] {1970, 6, 9, MILLIS_OF_DAY_UTC}, COPTIC_PARIS);
assertEquals(true, test1.equals(partial));
assertEquals(true, test1.hashCode() == partial.hashCode());
assertEquals(false, test1.equals(MockPartial.EMPTY_INSTANCE));
}
class MockInstant extends MockPartial {
public Chronology getChronology() {
return COPTIC_UTC;
}
public DateTimeField[] getFields() {
return new DateTimeField[] {
COPTIC_UTC.year(),
COPTIC_UTC.monthOfYear(),
COPTIC_UTC.dayOfMonth(),
COPTIC_UTC.millisOfDay(),
};
}
public int[] getValues() {
return new int[] {1970, 6, 9, MILLIS_OF_DAY_UTC};
}
}
//-----------------------------------------------------------------------
public void testCompareTo() {
LocalDateTime test1 = new LocalDateTime(2005, 6, 2, 10, 20, 30, 40);
LocalDateTime test1a = new LocalDateTime(2005, 6, 2, 10, 20, 30, 40);
assertEquals(0, test1.compareTo(test1a));
assertEquals(0, test1a.compareTo(test1));
assertEquals(0, test1.compareTo(test1));
assertEquals(0, test1a.compareTo(test1a));
LocalDateTime test2 = new LocalDateTime(2005, 7, 2, 10, 20, 30, 40);
assertEquals(-1, test1.compareTo(test2));
assertEquals(+1, test2.compareTo(test1));
LocalDateTime test3 = new LocalDateTime(2005, 7, 2, 10, 20, 30, 40, GREGORIAN_UTC);
assertEquals(-1, test1.compareTo(test3));
assertEquals(+1, test3.compareTo(test1));
assertEquals(0, test3.compareTo(test2));
DateTimeFieldType[] types = new DateTimeFieldType[] {
DateTimeFieldType.year(),
DateTimeFieldType.monthOfYear(),
DateTimeFieldType.dayOfMonth(),
DateTimeFieldType.millisOfDay(),
};
int[] values = new int[] {2005, 6, 2, MILLIS_OF_DAY_UTC};
Partial p = new Partial(types, values);
assertEquals(0, test1.compareTo(p));
try {
test1.compareTo(null);
fail();
} catch (NullPointerException ex) {}
try {
test1.compareTo(new Date());
fail();
} catch (ClassCastException ex) {}
try {
test1.compareTo(new YearMonthDay());
fail();
} catch (ClassCastException ex) {}
try {
test1.compareTo(new TimeOfDay());
fail();
} catch (ClassCastException ex) {}
Partial partial = new Partial()
.with(DateTimeFieldType.centuryOfEra(), 1)
.with(DateTimeFieldType.halfdayOfDay(), 0)
.with(DateTimeFieldType.dayOfMonth(), 9);
try {
new LocalDateTime(1970, 6, 9, 10, 20, 30, 40).compareTo(partial);
fail();
} catch (ClassCastException ex) {}
}
//-----------------------------------------------------------------------
public void testIsEqual_LocalDateTime() {
LocalDateTime test1 = new LocalDateTime(2005, 6, 2, 10, 20, 30, 40);
LocalDateTime test1a = new LocalDateTime(2005, 6, 2, 10, 20, 30, 40);
assertEquals(true, test1.isEqual(test1a));
assertEquals(true, test1a.isEqual(test1));
assertEquals(true, test1.isEqual(test1));
assertEquals(true, test1a.isEqual(test1a));
LocalDateTime test2 = new LocalDateTime(2005, 7, 2, 10, 20, 30, 40);
assertEquals(false, test1.isEqual(test2));
assertEquals(false, test2.isEqual(test1));
LocalDateTime test3 = new LocalDateTime(2005, 7, 2, 10, 20, 30, 40, GREGORIAN_UTC);
assertEquals(false, test1.isEqual(test3));
assertEquals(false, test3.isEqual(test1));
assertEquals(true, test3.isEqual(test2));
try {
new LocalDateTime(2005, 7, 2, 10, 20, 30, 40).isEqual(null);
fail();
} catch (IllegalArgumentException ex) {}
}
//-----------------------------------------------------------------------
public void testIsBefore_LocalDateTime() {
LocalDateTime test1 = new LocalDateTime(2005, 6, 2, 10, 20, 30, 40);
LocalDateTime test1a = new LocalDateTime(2005, 6, 2, 10, 20, 30, 40);
assertEquals(false, test1.isBefore(test1a));
assertEquals(false, test1a.isBefore(test1));
assertEquals(false, test1.isBefore(test1));
assertEquals(false, test1a.isBefore(test1a));
LocalDateTime test2 = new LocalDateTime(2005, 7, 2, 10, 20, 30, 40);
assertEquals(true, test1.isBefore(test2));
assertEquals(false, test2.isBefore(test1));
LocalDateTime test3 = new LocalDateTime(2005, 7, 2, 10, 20, 30, 40, GREGORIAN_UTC);
assertEquals(true, test1.isBefore(test3));
assertEquals(false, test3.isBefore(test1));
assertEquals(false, test3.isBefore(test2));
try {
new LocalDateTime(2005, 7, 2, 10, 20, 30, 40).isBefore(null);
fail();
} catch (IllegalArgumentException ex) {}
}
//-----------------------------------------------------------------------
public void testIsAfter_LocalDateTime() {
LocalDateTime test1 = new LocalDateTime(2005, 6, 2, 10, 20, 30, 40);
LocalDateTime test1a = new LocalDateTime(2005, 6, 2, 10, 20, 30, 40);
assertEquals(false, test1.isAfter(test1a));
assertEquals(false, test1a.isAfter(test1));
assertEquals(false, test1.isAfter(test1));
assertEquals(false, test1a.isAfter(test1a));
LocalDateTime test2 = new LocalDateTime(2005, 7, 2, 10, 20, 30, 40);
assertEquals(false, test1.isAfter(test2));
assertEquals(true, test2.isAfter(test1));
LocalDateTime test3 = new LocalDateTime(2005, 7, 2, 10, 20, 30, 40, GREGORIAN_UTC);
assertEquals(false, test1.isAfter(test3));
assertEquals(true, test3.isAfter(test1));
assertEquals(false, test3.isAfter(test2));
try {
new LocalDateTime(2005, 7, 2, 10, 20, 30, 40).isAfter(null);
fail();
} catch (IllegalArgumentException ex) {}
}
//-----------------------------------------------------------------------
public void testWithDate() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
LocalDateTime result = test.withDate(2006, 2, 1);
check(test, 2004, 6, 9, 10, 20, 30, 40);
check(result, 2006, 2, 1, 10, 20, 30, 40);
}
//-----------------------------------------------------------------------
public void testWithTime() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
LocalDateTime result = test.withTime(9, 8, 7, 6);
check(test, 2004, 6, 9, 10, 20, 30, 40);
check(result, 2004, 6, 9, 9, 8, 7, 6);
}
//-----------------------------------------------------------------------
public void testWithField_DateTimeFieldType_int_1() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
LocalDateTime result = test.withField(DateTimeFieldType.year(), 2006);
assertEquals(new LocalDateTime(2004, 6, 9, 10, 20, 30, 40), test);
assertEquals(new LocalDateTime(2006, 6, 9, 10, 20, 30, 40), result);
}
public void testWithField_DateTimeFieldType_int_2() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
try {
test.withField(null, 6);
fail();
} catch (IllegalArgumentException ex) {}
}
public void testWithField_DateTimeFieldType_int_3() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
LocalDateTime result = test.withField(DateTimeFieldType.year(), 2004);
assertEquals(new LocalDateTime(2004, 6, 9, 10, 20, 30, 40), test);
assertSame(test, result);
}
//-----------------------------------------------------------------------
public void testWithFieldAdded_DurationFieldType_int_1() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
LocalDateTime result = test.withFieldAdded(DurationFieldType.years(), 6);
assertEquals(new LocalDateTime(2004, 6, 9, 10, 20, 30, 40), test);
assertEquals(new LocalDateTime(2010, 6, 9, 10, 20, 30, 40), result);
}
public void testWithFieldAdded_DurationFieldType_int_2() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
try {
test.withFieldAdded(null, 0);
fail();
} catch (IllegalArgumentException ex) {}
}
public void testWithFieldAdded_DurationFieldType_int_3() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
try {
test.withFieldAdded(null, 6);
fail();
} catch (IllegalArgumentException ex) {}
}
public void testWithFieldAdded_DurationFieldType_int_4() {
LocalDateTime test = new LocalDateTime(2004, 6, 9, 10, 20, 30, 40);
LocalDateTime result = test.withFieldAdded(DurationFieldType.years(), 0);
assertSame(test, result);
}
//-----------------------------------------------------------------------
public void testPlus_RP() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plus(new Period(1, 2, 3, 4, 29, 6, 7, 8));
LocalDateTime expected = new LocalDateTime(2003, 7, 29, 15, 26, 37, 48, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plus((ReadablePeriod) null);
assertSame(test, result);
}
public void testPlusYears_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plusYears(1);
LocalDateTime expected = new LocalDateTime(2003, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plusYears(0);
assertSame(test, result);
}
public void testPlusMonths_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plusMonths(1);
LocalDateTime expected = new LocalDateTime(2002, 6, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plusMonths(0);
assertSame(test, result);
}
public void testPlusWeeks_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plusWeeks(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 10, 10, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plusWeeks(0);
assertSame(test, result);
}
public void testPlusDays_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plusDays(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 4, 10, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plusDays(0);
assertSame(test, result);
}
public void testPlusHours_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plusHours(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 3, 11, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plusHours(0);
assertSame(test, result);
}
public void testPlusMinutes_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plusMinutes(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 3, 10, 21, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plusMinutes(0);
assertSame(test, result);
}
public void testPlusSeconds_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plusSeconds(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 3, 10, 20, 31, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plusSeconds(0);
assertSame(test, result);
}
public void testPlusMillis_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.plusMillis(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 3, 10, 20, 30, 41, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.plusMillis(0);
assertSame(test, result);
}
//-----------------------------------------------------------------------
public void testMinus_RP() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minus(new Period(1, 1, 1, 1, 1, 1, 1, 1));
LocalDateTime expected = new LocalDateTime(2001, 3, 26, 9, 19, 29, 39, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minus((ReadablePeriod) null);
assertSame(test, result);
}
public void testMinusYears_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minusYears(1);
LocalDateTime expected = new LocalDateTime(2001, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minusYears(0);
assertSame(test, result);
}
public void testMinusMonths_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minusMonths(1);
LocalDateTime expected = new LocalDateTime(2002, 4, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minusMonths(0);
assertSame(test, result);
}
public void testMinusWeeks_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minusWeeks(1);
LocalDateTime expected = new LocalDateTime(2002, 4, 26, 10, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minusWeeks(0);
assertSame(test, result);
}
public void testMinusDays_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minusDays(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 2, 10, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minusDays(0);
assertSame(test, result);
}
public void testMinusHours_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minusHours(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 3, 9, 20, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minusHours(0);
assertSame(test, result);
}
public void testMinusMinutes_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minusMinutes(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 3, 10, 19, 30, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minusMinutes(0);
assertSame(test, result);
}
public void testMinusSeconds_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minusSeconds(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 3, 10, 20, 29, 40, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minusSeconds(0);
assertSame(test, result);
}
public void testMinusMillis_int() {
LocalDateTime test = new LocalDateTime(2002, 5, 3, 10, 20, 30, 40, BUDDHIST_LONDON);
LocalDateTime result = test.minusMillis(1);
LocalDateTime expected = new LocalDateTime(2002, 5, 3, 10, 20, 30, 39, BUDDHIST_LONDON);
assertEquals(expected, result);
result = test.minusMillis(0);
assertSame(test, result);
}
//-----------------------------------------------------------------------
public void testGetters() {
LocalDateTime test = new LocalDateTime(1970, 6, 9, 10, 20, 30, 40, GJ_UTC);
assertEquals(1970, test.getYear());
assertEquals(6, test.getMonthOfYear());
assertEquals(9, test.getDayOfMonth());
assertEquals(160, test.getDayOfYear());
assertEquals(2, test.getDayOfWeek());
assertEquals(24, test.getWeekOfWeekyear());
assertEquals(1970, test.getWeekyear());
assertEquals(70, test.getYearOfCentury());
assertEquals(20, test.getCenturyOfEra());
assertEquals(1970, test.getYearOfEra());
assertEquals(DateTimeConstants.AD, test.getEra());
assertEquals(10, test.getHourOfDay());
assertEquals(20, test.getMinuteOfHour());
assertEquals(30, test.getSecondOfMinute());
assertEquals(40, test.getMillisOfSecond());
assertEquals(MILLIS_OF_DAY_UTC, test.getMillisOfDay());
}
//-----------------------------------------------------------------------
public void testWithers() {
LocalDateTime test = new LocalDateTime(1970, 6, 9, 10, 20, 30, 40, GJ_UTC);
check(test.withYear(2000), 2000, 6, 9, 10, 20, 30, 40);
check(test.withMonthOfYear(2), 1970, 2, 9, 10, 20, 30, 40);
check(test.withDayOfMonth(2), 1970, 6, 2, 10, 20, 30, 40);
check(test.withDayOfYear(6), 1970, 1, 6, 10, 20, 30, 40);
check(test.withDayOfWeek(6), 1970, 6, 13, 10, 20, 30, 40);
check(test.withWeekOfWeekyear(6), 1970, 2, 3, 10, 20, 30, 40);
check(test.withWeekyear(1971), 1971, 6, 15, 10, 20, 30, 40);
check(test.withYearOfCentury(60), 1960, 6, 9, 10, 20, 30, 40);
check(test.withCenturyOfEra(21), 2070, 6, 9, 10, 20, 30, 40);
check(test.withYearOfEra(1066), 1066, 6, 9, 10, 20, 30, 40);
check(test.withEra(DateTimeConstants.BC), -1970, 6, 9, 10, 20, 30, 40);
check(test.withHourOfDay(6), 1970, 6, 9, 6, 20, 30, 40);
check(test.withMinuteOfHour(6), 1970, 6, 9, 10, 6, 30, 40);
check(test.withSecondOfMinute(6), 1970, 6, 9, 10, 20, 6, 40);
check(test.withMillisOfSecond(6), 1970, 6, 9, 10, 20, 30, 6);
check(test.withMillisOfDay(61234), 1970, 6, 9, 0, 1, 1, 234);
try {
test.withMonthOfYear(0);
fail();
} catch (IllegalArgumentException ex) {}
try {
test.withMonthOfYear(13);
fail();
} catch (IllegalArgumentException ex) {}
}
//-----------------------------------------------------------------------
public void testToDateTime() {
LocalDateTime base = new LocalDateTime(2005, 6, 9, 6, 7, 8, 9, COPTIC_PARIS); // PARIS irrelevant
DateTime test = base.toDateTime();
check(base, 2005, 6, 9, 6, 7, 8, 9);
DateTime expected = new DateTime(2005, 6, 9, 6, 7, 8, 9, COPTIC_LONDON);
assertEquals(expected, test);
}
//-----------------------------------------------------------------------
public void testToDateTime_Zone() {
LocalDateTime base = new LocalDateTime(2005, 6, 9, 6, 7, 8, 9, COPTIC_PARIS); // PARIS irrelevant
DateTime test = base.toDateTime(TOKYO);
check(base, 2005, 6, 9, 6, 7, 8, 9);
DateTime expected = new DateTime(2005, 6, 9, 6, 7, 8, 9, COPTIC_TOKYO);
assertEquals(expected, test);
}
public void testToDateTime_nullZone() {
LocalDateTime base = new LocalDateTime(2005, 6, 9, 6, 7, 8, 9, COPTIC_PARIS); // PARIS irrelevant
DateTime test = base.toDateTime((DateTimeZone) null);
check(base, 2005, 6, 9, 6, 7, 8, 9);
DateTime expected = new DateTime(2005, 6, 9, 6, 7, 8, 9, COPTIC_LONDON);
assertEquals(expected, test);
}
//-----------------------------------------------------------------------
public void testToLocalDate() {
LocalDateTime base = new LocalDateTime(2005, 6, 9, 6, 7, 8, 9, COPTIC_PARIS); // PARIS irrelevant
LocalDate expected = new LocalDate(2005, 6, 9, COPTIC_LONDON);
assertEquals(expected,base.toLocalDate());
}
public void testToLocalTime() {
LocalDateTime base = new LocalDateTime(2005, 6, 9, 6, 7, 8, 9, COPTIC_PARIS); // PARIS irrelevant
LocalTime expected = new LocalTime(6, 7, 8, 9, COPTIC_LONDON);
assertEquals(expected,base.toLocalTime());
}
//-----------------------------------------------------------------------
public void testToDateTime_RI() {
LocalDateTime base = new LocalDateTime(2005, 6, 9, 10, 20, 30, 40, COPTIC_PARIS);
DateTime dt = new DateTime(2002, 1, 3, 4, 5, 6, 7, BUDDHIST_TOKYO);
DateTime test = base.toDateTime(dt);
check(base, 2005, 6, 9, 10, 20, 30, 40);
DateTime expected = new DateTime(2005, 6, 9, 10, 20, 30, 40, BUDDHIST_TOKYO);
assertEquals(expected, test);
}
public void testToDateTime_nullRI() {
LocalDateTime base = new LocalDateTime(2005, 6, 9, 10, 20, 30, 40, COPTIC_PARIS);
DateTime test = base.toDateTime((ReadableInstant) null);
check(base, 2005, 6, 9, 10, 20, 30, 40);
DateTime expected = new DateTime(2005, 6, 9, 10, 20, 30, 40, ISO_LONDON);
assertEquals(expected, test);
}
//-----------------------------------------------------------------------
public void testProperty() {
LocalDateTime test = new LocalDateTime(2005, 6, 9, 10, 20, 30, 40, GJ_UTC);
assertEquals(test.year(), test.property(DateTimeFieldType.year()));
assertEquals(test.monthOfYear(), test.property(DateTimeFieldType.monthOfYear()));
assertEquals(test.dayOfMonth(), test.property(DateTimeFieldType.dayOfMonth()));
assertEquals(test.dayOfWeek(), test.property(DateTimeFieldType.dayOfWeek()));
assertEquals(test.dayOfYear(), test.property(DateTimeFieldType.dayOfYear()));
assertEquals(test.weekOfWeekyear(), test.property(DateTimeFieldType.weekOfWeekyear()));
assertEquals(test.weekyear(), test.property(DateTimeFieldType.weekyear()));
assertEquals(test.yearOfCentury(), test.property(DateTimeFieldType.yearOfCentury()));
assertEquals(test.yearOfEra(), test.property(DateTimeFieldType.yearOfEra()));
assertEquals(test.centuryOfEra(), test.property(DateTimeFieldType.centuryOfEra()));
assertEquals(test.era(), test.property(DateTimeFieldType.era()));
assertEquals(test.hourOfDay(), test.property(DateTimeFieldType.hourOfDay()));
assertEquals(test.minuteOfHour(), test.property(DateTimeFieldType.minuteOfHour()));
assertEquals(test.secondOfMinute(), test.property(DateTimeFieldType.secondOfMinute()));
assertEquals(test.millisOfSecond(), test.property(DateTimeFieldType.millisOfSecond()));
assertEquals(test.millisOfDay(), test.property(DateTimeFieldType.millisOfDay()));
try {
test.property(null);
fail();
} catch (IllegalArgumentException ex) {}
assertEquals(test, test.property(DateTimeFieldType.minuteOfDay()).getLocalDateTime());
}
//-----------------------------------------------------------------------
public void testSerialization() throws Exception {
LocalDateTime test = new LocalDateTime(1972, 6, 9, 10, 20, 30, 40, COPTIC_PARIS);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(test);
byte[] bytes = baos.toByteArray();
oos.close();
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(bais);
LocalDateTime result = (LocalDateTime) ois.readObject();
ois.close();
assertEquals(test, result);
assertTrue(Arrays.equals(test.getValues(), result.getValues()));
assertTrue(Arrays.equals(test.getFields(), result.getFields()));
assertEquals(test.getChronology(), result.getChronology());
}
//-----------------------------------------------------------------------
public void testToString() {
LocalDateTime test = new LocalDateTime(2002, 6, 9, 10, 20, 30, 40);
assertEquals("2002-06-09T10:20:30.040", test.toString());
}
//-----------------------------------------------------------------------
public void testToString_String() {
LocalDateTime test = new LocalDateTime(2002, 6, 9, 10, 20, 30, 40);
assertEquals("2002 10", test.toString("yyyy HH"));
assertEquals("2002-06-09T10:20:30.040", test.toString((String) null));
}
//-----------------------------------------------------------------------
public void testToString_String_Locale() {
LocalDateTime test = new LocalDateTime(1970, 6, 9, 10, 20, 30, 40);
assertEquals("Tue 9/6", test.toString("EEE d/M", Locale.ENGLISH));
assertEquals("mar. 9/6", test.toString("EEE d/M", Locale.FRENCH));
assertEquals("1970-06-09T10:20:30.040", test.toString(null, Locale.ENGLISH));
assertEquals("Tue 9/6", test.toString("EEE d/M", null));
assertEquals("1970-06-09T10:20:30.040", test.toString(null, null));
}
//-----------------------------------------------------------------------
public void testToString_DTFormatter() {
LocalDateTime test = new LocalDateTime(2002, 6, 9, 10, 20, 30, 40);
assertEquals("2002 10", test.toString(DateTimeFormat.forPattern("yyyy HH")));
assertEquals("2002-06-09T10:20:30.040", test.toString((DateTimeFormatter) null));
}
//-----------------------------------------------------------------------
private void check(LocalDateTime test, int year, int month, int day, int hour, int min, int sec, int mil) {
assertEquals(year, test.getYear());
assertEquals(month, test.getMonthOfYear());
assertEquals(day, test.getDayOfMonth());
assertEquals(hour, test.getHourOfDay());
assertEquals(min, test.getMinuteOfHour());
assertEquals(sec, test.getSecondOfMinute());
assertEquals(mil, test.getMillisOfSecond());
}
}
| [
"janey@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5"
] | janey@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5 |
abae627c9c6b958770e73336a0c11482aa379509 | 67ebd67cfbf8e29aab2311d7f279471d8751e06d | /src/test/java/com/hiltoncsj/cursomc/CursomcApplicationTests.java | 5f5b41e20c84f257b32598c19c676e8a69cbdcad | [] | no_license | hiltoncsj/cursomc | 58af819886e1ed8f3d35a319f74db1ecbfb290ec | ec378c188f25549a58bf8421d9bbe4fdf0046897 | refs/heads/master | 2021-08-30T17:30:11.942651 | 2017-12-18T20:23:41 | 2017-12-18T20:23:41 | 114,305,479 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package com.hiltoncsj.cursomc;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class CursomcApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"hiltoncsj@gmail.com"
] | hiltoncsj@gmail.com |
6fd64ed083360497e940c3d4113a905dde20c964 | 4efc908f61496dcdc1737f58aa8fd34c6d587450 | /client/src/main/java/com/dubbo/test/Caller.java | 8e9d482b7888e211627be72e52347f5a8df7a348 | [] | no_license | qshuai/spring-dubbo-test | 0c03351adaa1771ed01c9f16f28e62771b32e982 | 06cb01f4e3decd69c2b0d95eed46663af92330f8 | refs/heads/master | 2020-06-21T23:25:04.825712 | 2019-07-18T11:55:12 | 2019-07-18T11:55:12 | 197,577,898 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | package com.dubbo.test;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;
@Component
public class Caller {
@Reference(version = "1.0.0")
SayHello sayHello;
public String greet() {
return sayHello.greet();
}
}
| [
"qishuai231@gmail.com"
] | qishuai231@gmail.com |
d768355c1a902cef19b07b23d2d89cfdb28b9faa | 82841a3ac41472238cc6ec4a06ade13993510c02 | /weekday/src/main/java/com/team3/weekday/utils/StringBuilderUtil.java | f6a129630b70006c7fe18eaf8e18341392c0b645 | [] | no_license | tianqingyk/Weekday | d5725df14ba98358b6ced3b5872c5a9057375dfa | cc3761b998c08ff9b6d3e56bd6e2c51560acbcbf | refs/heads/master | 2023-02-02T22:13:16.945487 | 2020-12-20T16:34:10 | 2020-12-20T16:34:10 | 320,639,508 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,241 | java | package com.team3.weekday.utils;
import org.apache.commons.beanutils.ConvertUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class StringBuilderUtil {
public static String deleteElement(Long id, String oldString) {
if(!oldString.isBlank()) {
var list =stringToList(oldString);
list.remove(id);
return listToString(list);
}
return oldString;
}
public static String addElement(Long id, String oldString){
var list = stringToList(oldString);
list.add(id);
return listToString(list);
}
public static String listToString(List<Long> list){
StringBuilder newString = new StringBuilder();
for (Long i : list) {
newString.append(i).append(";");
}
if (newString.length() > 0) {
newString.deleteCharAt(newString.length() - 1);
}
return newString.toString();
}
public static ArrayList<Long> stringToList(String str){
if (str == null || str.isBlank()){
return new ArrayList<>();
}
return new ArrayList<>(Arrays.asList((Long[]) ConvertUtils.convert(str.split(";"), Long.class)));
}
}
| [
"70924701+FrankKeYang@users.noreply.github.com"
] | 70924701+FrankKeYang@users.noreply.github.com |
c7e29848a47c9345c3e81591d416cd574e28a138 | 5b5ef74382c70a64b42ecb855d1b00d4906324e3 | /src/Player.java | 274f1611e5fb0e14f8c0606d9d3fc07d624431c0 | [] | no_license | Martin36/DuckHunt | feef7b80cbd5d86bedb562983e3df59181bd14e6 | 3fb4e9f8da26a3e388fc15ea2742900eddc9b333 | refs/heads/master | 2021-01-10T16:16:11.240664 | 2015-10-12T18:57:48 | 2015-10-12T18:57:48 | 44,107,406 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 6,259 | java | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Random;
class Player {
HMM hmm;
double probOfEmissionSeq;
boolean trainModel;
public Player() {
hmm = new HMM(3,3);
probOfEmissionSeq = 0;
trainModel = true;
}
/**
* Shoot!
*
* This is the function where you start your work.
*
* You will receive a variable pState, which contains information about all
* birds, both dead and alive. Each bird contains all past moves.
*
* The state also contains the scores for all players and the number of
* time steps elapsed since the last time this function was called.
*
* @param pState the GameState object with observations etc
* @param pDue time before which we must have returned
* @return the prediction of a bird we want to shoot at, or cDontShoot to pass
*/
public Action shoot(GameState pState, Deadline pDue) {
/*
* Here you should write your clever algorithms to get the best action.
* This skeleton never shoots.
*/
int noObs = pState.getBird(0).getSeqLength();
//Doesn't do anything if the nr of observations
//ain't large enough.
if(noObs < 10){
return cDontShoot;
}
int noBirds = pState.getNumBirds();
int[][] observations = new int[noBirds][noObs];
for(int i = 0; i < noBirds; i++){
for(int j = 0; j < noObs; j++){
observations[i][j] = pState.getBird(i).getObservation(j)-3;
}
//Check if training the model will improve it.
if(trainModel){
hmm.estimateModel(observations[i]);
double estProb = hmm.estimateProbabilityOfEmissionSequence(observations[i]);
if(estProb > probOfEmissionSeq){
probOfEmissionSeq = estProb;
}else{
trainModel = false;
}
}
}
//Now we want to check which bird to shoot
int [] lastMoves = new int[noBirds];
double [] currentStateDist = new double[hmm.getNrOfEmissions()];
//First we calculate how many birds at each position
for(int i = 0; i < noBirds; i++){
lastMoves[i] = pState.getBird(i).getLastObservation();
currentStateDist[lastMoves[i]-3] += 1;
}
//Then we make the list to hold the probability
//of a bird being in position i
for(int i = 0; i < currentStateDist.length; i++){
currentStateDist[i] = currentStateDist[i]/noBirds;
}
//Here we estimate the probabilities of the birds positions
//in the next state
double [] estimatedDistOfNextState = new double[currentStateDist.length];
estimatedDistOfNextState = hmm.estimateProbabilityDistributionOfNextEmission(currentStateDist);
//Now we want to check which of these probabilities are the largest
int nextMove = 0;
double maxDistOfNextState = 0;
for(int i = 0; i < estimatedDistOfNextState.length; i++){
double maxTemp = estimatedDistOfNextState[i];
if (maxTemp > maxDistOfNextState){
maxDistOfNextState = maxTemp;
nextMove = i;
}
}
//Now we need to check which bird has the highest probability
//to move in the direction which was the maximum
double [] emiSeqProb = new double[noBirds];
for(int i = 0; i < noBirds; i++){
//First we make the emission sequence
int [] emiSeq = new int[2];
emiSeq[0] = pState.getBird(i).getLastObservation()-3;
emiSeq[1] = nextMove;
//Fel här
emiSeqProb[i] = hmm.estimateProbabilityOfEmissionSequence(emiSeq);
//emiSeqProb[i] = hmm.estimateProbabilityOfEmissionSequence(observations[0]);
}
//We need to find the maximized sequence probability
double maxProb = 0;
int birdIndex = 0;
for(int i = 0; i < emiSeqProb.length; i++){
double maxProbTemp = emiSeqProb[i];
if(maxProbTemp > maxProb){
maxProb = maxProbTemp;
birdIndex = i;
}
}
//There has to be a limit of probability so
//we don't shoot if the probability ain't high enough
double minProb = 0.6;
if(maxProb >= minProb){
return new Action(birdIndex,nextMove);
// Random rand = new Random();
// return new Action(birdIndex, rand.nextInt(2));
}
// This line chooses not to shoot.
return cDontShoot;
// This line would predict that bird 0 will move right and shoot at it.
// return Action(0, MOVE_RIGHT);
}
/**
* Guess the species!
* This function will be called at the end of each round, to give you
* a chance to identify the species of the birds for extra points.
*
* Fill the vector with guesses for the all birds.
* Use SPECIES_UNKNOWN to avoid guessing.
*
* @param pState the GameState object with observations etc
* @param pDue time before which we must have returned
* @return a vector with guesses for all the birds
*/
public int[] guess(GameState pState, Deadline pDue) {
/*
* Here you should write your clever algorithms to guess the species of
* each bird. This skeleton makes no guesses, better safe than sorry!
*/
int[] lGuess = new int[pState.getNumBirds()];
for (int i = 0; i < pState.getNumBirds(); ++i)
lGuess[i] = Constants.SPECIES_UNKNOWN;
return lGuess;
}
/**
* If you hit the bird you were trying to shoot, you will be notified
* through this function.
*
* @param pState the GameState object with observations etc
* @param pBird the bird you hit
* @param pDue time before which we must have returned
*/
public void hit(GameState pState, int pBird, Deadline pDue) {
System.err.println("HIT BIRD!!!");
}
/**
* If you made any guesses, you will find out the true species of those
* birds through this function.
*
* @param pState the GameState object with observations etc
* @param pSpecies the vector with species
* @param pDue time before which we must have returned
*/
public void reveal(GameState pState, int[] pSpecies, Deadline pDue) {
}
public static final Action cDontShoot = new Action(-1, -1);
}
| [
"martin.funkquist@gmail.com"
] | martin.funkquist@gmail.com |
50cb8ea76939bde4be5a1e392bf7c2709d7fd970 | 8c37719c21df9372e507ed38aa49e0ad613c316e | /src/NestedLoops/SpecialNumbers.java | 7c5962cb8f9aedffa658801e5d846fb2ca1f937e | [] | no_license | nkohchiev/Java-Basics | ce8aab0dc12258b5b840dbc3869ebd0255c9cfca | a22040a80fa12eb91e28f865e47130ef23a36e9c | refs/heads/master | 2023-03-13T23:30:19.173752 | 2021-03-12T13:59:21 | 2021-03-12T14:00:06 | 346,429,476 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 909 | java | package NestedLoops;
import java.util.Scanner;
public class SpecialNumbers {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = Integer.parseInt(scanner.nextLine());
for (int i = 1; i <= 9 ; i++) {
if (n % i !=0) {
continue;
}
for (int j = 1; j <= 9 ; j++) {
if (n % j !=0) {
continue;
}
for (int k = 1; k <=9 ; k++) {
if (n % k !=0) {
continue;
}
for (int l = 1; l <=9 ; l++) {
if (n % l !=0) {
continue;
}
System.out.printf("%d%d%d%d ", i, j, k, l);
}
}
}
}
}
}
| [
"j0h@example.com"
] | j0h@example.com |
1e779d47a7bdf886c79b0bcbea9122b0ee45496b | 8b9ae4242edd840c260b58212ed705dd4c18ebc6 | /dxa-framework/dxa-common-api/src/main/java/com/sdl/webapp/common/util/Dd4tUtils.java | 2b9e59b2752e40a7e26f23860c5ff6d554677898 | [
"Apache-2.0"
] | permissive | smaryenko/dxa-web-application-java | fe50f850ef81f7c089d7b1a12ffdf3bc85c65e53 | a3a77b251d46eb1329d203e114ab30506bb29c2a | refs/heads/master | 2021-01-17T03:42:50.144580 | 2016-07-19T06:40:56 | 2016-07-19T06:40:56 | 62,383,467 | 0 | 0 | null | 2016-07-01T09:55:45 | 2016-07-01T09:55:45 | null | UTF-8 | Java | false | false | 563 | java | package com.sdl.webapp.common.util;
import java.util.Map;
/**
* <p>Dd4tUtils interface.</p>
*/
public interface Dd4tUtils {
/**
* <p>getFromNestedMultiLevelMapOrAlternative.</p>
*
* @param multiLevelMap a {@link java.util.Map} object.
* @param key a {@link java.lang.String} object.
* @param alternative a {@link java.lang.Object} object.
* @return a {@link java.lang.Object} object.
*/
Object getFromNestedMultiLevelMapOrAlternative(Map<String, Object> multiLevelMap, String key, Object alternative);
}
| [
"rpannekoek@sdl.com"
] | rpannekoek@sdl.com |
99d23295d16982de59b29a1f0d8481760678823f | 9e5d0c270ca9467c18bd2b7be8e161755bb4c989 | /Pant.java | 8fc85fc6293def723d11c9ee297f75d20bdda7b8 | [] | no_license | jgperez2/Fireball-Game | 734ba93e6b43c100452c7e1d58a561d23f0b1f96 | e0cd47f51ece6fe14fb0dcd675231e015f98913c | refs/heads/master | 2021-09-01T11:49:50.359275 | 2017-12-26T20:18:35 | 2017-12-26T20:18:35 | 115,452,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,840 | java | import java.util.ArrayList;
import java.util.Random;
public class Pant {
private Graphic graphic;
private Random randGen;
private boolean isAlive;
private Fire1 fire;
private Pant pant;
private Enemy enemy;
public Pant(float x, float y, Random randGen) {
graphic = new Graphic("n");
graphic.setPosition(x, y);
graphic.setDirection(randGen.nextInt((int) (2 * Math.PI)));
isAlive = true;
this.randGen = randGen;
}
public boolean shouldRemove() {
if (isAlive){
return false;
}
else{
return true;
}
}
public Fire1 handleFireballCollisions1(ArrayList<Fireball1> fireballs) {
if (!this.isAlive)
return null;
for (int i = 0; i < fireballs.size(); ++i){
if (graphic.isCollidingWith(fireballs.get(i).giveGraphic())){
Fire1 fire = new Fire1(graphic.getX(), graphic.getY(), randGen);
isAlive = false;
fireballs.get(i).destroy();
return fire;
}
}
return null;
}
public Fire2 handleFireballCollisions2(ArrayList<Fireball2> fireballs) {
if (!this.isAlive)
return null;
for (int i = 0; i < fireballs.size(); ++i){
if (graphic.isCollidingWith(fireballs.get(i).giveGraphic())){
Fire2 fire = new Fire2(graphic.getX(), graphic.getY(), randGen);
isAlive = false;
fireballs.get(i).destroy();
return fire;
}
}
return null;
}
public Enemy handleFireballCollisions3(ArrayList<Fireball2> fireballs) {
if (!this.isAlive)
return null;
for (int i = 0; i < fireballs.size(); ++i){
if (graphic.isCollidingWith(fireballs.get(i).giveGraphic())){
Enemy enemy = new Enemy(graphic.getX(), graphic.getY(), randGen);
isAlive = false;
fireballs.get(i).destroy();
return enemy;
}
}
return null;
}
public void update(int time) {
graphic.draw();
}
}
| [
"noreply@github.com"
] | jgperez2.noreply@github.com |
e1272ff9e9587fdec4655ce14872cbdc0aeb571c | e25520b0324619c1df48f58e32205c69205708fa | /Maingui.java | 22e17f764ea638e98e2cb9c13a9dc7b865d29c26 | [] | no_license | rezaaulia552/kalkulatorGui | 0a5ceafda1a48541858fd6b02a31ab744abcb2a3 | e3ad91fc1188afbb9a2cbfe43aa649a9572a6f58 | refs/heads/master | 2023-05-13T05:16:38.505393 | 2021-05-30T10:54:03 | 2021-05-30T10:54:03 | 372,188,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,235 | java | import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.scene.control.TableView;
/**
* JavaFX class Maingui.
*
* @author reza aulia
* @version 0.5
*/
public class Maingui extends Application
{
// We keep track of the count, and label displaying the count:
private int count = 0;
//private Label myLabel = new Label("0");
private Label hasilLabel1 = new Label("");
private Label hasilLabel2 = new Label("");
private Label hasilLabel3 = new Label("");
private Label hasilLabel4 = new Label("");
private TextField op1Tf = new TextField();
private TextField op2Tf = new TextField();
private Calculator calc = new Calculator();
@Override
public void start(Stage stage)
{
// Create a Button or any control item
Button myButton1 = new Button("+");
Button myButton2 = new Button("-");
Button myButton3 = new Button("*");
Button myButton4 = new Button("/");
Label op1Label = new Label("OP1");
Label op2Label = new Label("OP2");
// Create a new grid pane
GridPane pane = new GridPane();
pane.setPadding(new Insets(20, 20, 20, 20));
pane.setMinSize(400, 400);
pane.setVgap(20);
pane.setHgap(20);
//set an action on the button using method reference
myButton1.setOnAction(this::buttonClick1);
// Add the button and label into the pane
pane.add(op1Label, 0, 0);
pane.add(op1Tf, 1, 0);
pane.add(op2Label, 0, 1);
pane.add(op2Tf, 1, 1);
pane.add(myButton1, 0, 2);
pane.add(hasilLabel1, 1, 2);
//set an action on the button using method reference
myButton2.setOnAction(this::buttonClick2);
pane.add(myButton2, 0, 3);
pane.add(hasilLabel2, 1, 3);
myButton3.setOnAction(this::buttonClick3);
pane.add(myButton3, 0, 4);
pane.add(hasilLabel3, 1, 4);
myButton4.setOnAction(this::buttonClick4);
pane.add(myButton4, 0, 5);
pane.add(hasilLabel4, 1, 5);
// JavaFX must have a Scene (window content) inside a Stage (window)
Scene scene = new Scene(pane, 500,300);
stage.setTitle("Simple Calculator");
stage.setScene(scene);
// Show the Stage (window)
stage.show();
}
/**
* This will be executed when the button is clicked
* It increments the count by 1
*/
private void buttonClick1(ActionEvent event)
{
// Counts number of button clicks and shows the result on a label
int numop1 = Integer.parseInt(op1Tf.getText());
int numop2 = Integer.parseInt(op2Tf.getText());
int hasil1 = calc.jumlah(numop1,numop2);
hasilLabel1.setText(Integer.toString(hasil1));
}
private void buttonClick2(ActionEvent event)
{
// Counts number of button clicks and shows the result on a label
int numop1 = Integer.parseInt(op1Tf.getText());
int numop2 = Integer.parseInt(op2Tf.getText());
int hasil2 = calc.kurang(numop1,numop2);
hasilLabel2.setText(Integer.toString(hasil2));
}
private void buttonClick3(ActionEvent event)
{
// Counts number of button clicks and shows the result on a label
int numop1 = Integer.parseInt(op1Tf.getText());
int numop2 = Integer.parseInt(op2Tf.getText());
int hasil3 = calc.kali(numop1,numop2);
hasilLabel3.setText(Integer.toString(hasil3));
}
private void buttonClick4(ActionEvent event)
{
// Counts number of button clicks and shows the result on a label
int numop1 = Integer.parseInt(op1Tf.getText());
int numop2 = Integer.parseInt(op2Tf.getText());
float hasil4 = calc.bagi(numop1,numop2);
hasilLabel4.setText(Float.toString(hasil4));
}
} | [
"HP@LAPTOP-MHAK16T0"
] | HP@LAPTOP-MHAK16T0 |
63739048970a088d7fb44e8700fdb5ffc77754f2 | affa8b2ca3d7b4d438417e945cc3e785fa500a06 | /Main/phase 2 java code/src/com/b07/store/SalesLog.java | 7529799d4a58633c9df1552c741210cbfda97bf4 | [] | no_license | owenbc44/cscb07Project | b7a8164ee742b4db688e88ebaa030ca666a6dcc5 | 92c902265238ac8a89c11079a07d80c882d0281f | refs/heads/master | 2022-08-07T11:42:16.217852 | 2020-05-21T15:11:51 | 2020-05-21T15:11:51 | 265,878,760 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package com.b07.store;
import java.util.List;
public interface SalesLog {
public void addSale(Sale sale);
public List<Sale> getSales();
}
| [
"owen.chiu@mail.utoronto.ca"
] | owen.chiu@mail.utoronto.ca |
8ca8a8e02cbb83f2ba582583b3ad3bc22454b3d1 | 27d0400827da0aa6831ac4dcf962f2329f278a89 | /main/java/entites/Channel.java | ee6df11459f3a77e634e08cb1a921ad8338684b5 | [] | no_license | glours/KataVisitorPattern | 352821300d54aed6eba6c7d129f7964028491829 | 3d8ea318307068ebfefd8c8227daf9e40b72008f | refs/heads/master | 2020-12-24T20:14:53.149229 | 2016-05-24T15:35:57 | 2016-05-24T15:42:08 | 59,585,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | /**
* Created by guillaumelours on 9/21/15.
*/
package entites;
import java.time.LocalDateTime;
import entites.visitor.ChannelVisitor;
public abstract class Channel {
private String content;
private LocalDateTime validityDate;
public Channel(String content) {
this.content = content;
this.validityDate = LocalDateTime.now().plusHours(1);
}
public abstract <T> T accept(ChannelVisitor<T> visitor);
public String getContent() {return content; }
public void setContent(String content) { this.content = content; }
public LocalDateTime getValidityDate() { return validityDate; }
public void setValidityDate(LocalDateTime validityDate) { this.validityDate = validityDate; }
}
| [
"g.lours@agileit.fr"
] | g.lours@agileit.fr |
2282a706aea7e20c332c2f9139936ba24c35e78f | c61de7a00b4b4bd56a91bab7aad00354ed071988 | /src/main/java/main/model/CaptchaCode.java | 767b6d58ffff444b1f5aead57553fd275c5bf51b | [] | no_license | AlewBrex/BlogEngine | 76084b1e36f166da71119fd56d5dfa86a3cf5475 | 68bdb3d2d326dbe65ab4f956206a08f44bba8ea3 | refs/heads/master | 2023-04-19T15:40:41.949573 | 2021-04-27T12:37:59 | 2021-04-27T12:37:59 | 296,599,009 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 923 | java | package main.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
@Entity
@Table(name = "captcha_codes")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CaptchaCode {
@Id
@NotNull
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "time", nullable = false, columnDefinition = "DATETIME")
private LocalDateTime time;
@Column(name = "code", nullable = false, columnDefinition = "TINYTEXT")
private String code;
@Column(name = "secret_code", nullable = false, columnDefinition = "TINYTEXT")
private String secretCode;
public CaptchaCode(LocalDateTime time, String code, String secretCode) {
this.time = time;
this.code = code;
this.secretCode = secretCode;
}
}
| [
"alewbrex@gmail.com"
] | alewbrex@gmail.com |
77991014be659187cde04c7658892e1a95b0871b | 13fe36b8601934205d43a0f6e6491b9f9681d43f | /src/main/java/com/network/OnProgress.java | 3dbe212e1060548c59c815fe2e290f390baeda8c | [] | no_license | harsewak/nlib | ffea0fdb51e4607650e733e082e4acb221167054 | 3ff1f5efa9244a470c028cb40909789f203fc021 | refs/heads/master | 2021-01-12T12:16:26.030919 | 2016-10-31T06:07:20 | 2016-10-31T06:07:20 | 72,405,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 192 | java | package com.network;
/**
* Created by harsewaksingh on 02/03/16.
*/
public interface OnProgress {
void progress(int progress);
void onCompleted(String url);
void onFailed();
} | [
"9780154140har"
] | 9780154140har |
f1f93750680d93ba42ffef132abb07f3e574e808 | f4d09dc71a88168fcc7b8031db01bffe38127907 | /DepotRapportWorkflow35/src/main/java/com/sample/action/UnlockDocumentHandler.java | 7b9db29809a7e96e35f2dd906815740ca605d171 | [] | no_license | Forceaim/WF_RECOM | eb5d8e88242a7cff01aff514128124b2b71ccec5 | ac38afcd3b98a44b650ef49d3661f213027c0541 | refs/heads/master | 2023-03-02T11:40:42.638887 | 2021-02-09T07:56:48 | 2021-02-09T07:56:48 | 337,320,808 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 948 | java | /**
*
*/
package com.sample.action;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import com.openkm.api.OKMAuth;
import com.openkm.api.OKMDocument;
/**
* @author openkm
*
*/
public class UnlockDocumentHandler implements ActionHandler {
private static final long serialVersionUID = 1L;
String uuid;
String docPath;
@Override
public void execute(ExecutionContext context) throws Exception {
// TODO Auto-generated method stub
/*if (Main.get().mainPanel.desktop.browser.fileBrowser.isDocumentSelected()) {
Main.get().mainPanel.desktop.browser.fileBrowser.getDocument().setLocked(true);
}*/
String uuid = (String)context.getContextInstance().getVariable("uuid");
if (uuid !=""){
String docPath = OKMDocument.getInstance().getPath(null, uuid);
OKMDocument.getInstance().forceUnlock(null, docPath);
//OKMAuth.getInstance().login();
context.getToken().signal();
}
}
}
| [
"vrazafindrakoto@fthmconsulting.com"
] | vrazafindrakoto@fthmconsulting.com |
922961cf291045e1c6c1e7f47664c5f99cb827b4 | 5b36a6fdc838077e0e25a912f11895dbd39ff133 | /src/main/java/com/manpower/clientTest/jsonApiClass.java | 67e939bab99be334e840a2594abfc384a002f83d | [] | no_license | Tiana345/SpringMaven | fbc83cf401d6a617c36a7a34d8e8718b1dd337bd | 5acc5e5ee7e46510ccfa243519572fc2e9d7843c | refs/heads/master | 2020-03-19T01:33:12.213940 | 2018-05-31T08:13:13 | 2018-05-31T08:13:13 | 135,553,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 712 | java | package com.manpower.clientTest;
public class jsonApiClass {
private int userId;
private int id;
private String title;
private String body;
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
@Override
public String toString() {
return "jsonApiClass [userId=" + userId + ", id=" + id + ", title=" + title + ", body=" + body + "]";
}
}
| [
"tianaced@gmail.com"
] | tianaced@gmail.com |
3a48811abc42dc83a1a62067966f7f4890867b7e | 49ce26815bd4d0ac3b3ac29d42f4a7d1986f3249 | /app/src/test/java/nv/edu/ntu/uyennhi/lifecycle59cntt2/ExampleUnitTest.java | 5fdfb77414531e6b2eda1e2b18d6008fd86e16bc | [] | no_license | Hthiunhi/HoThiUyenNhi_59131707_LifeCycle59CNTT2 | 3d4d308d3e4dcecb3d2ffb0377bdafbc6f2163a7 | 4e8ec0106eea113e318d95c72f98d8629817ebd3 | refs/heads/master | 2022-04-19T08:09:04.799494 | 2020-04-19T08:54:36 | 2020-04-19T08:54:36 | 256,148,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package nv.edu.ntu.uyennhi.lifecycle59cntt2;
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);
}
} | [
"62916555+Hthiunhi@users.noreply.github.com"
] | 62916555+Hthiunhi@users.noreply.github.com |
04b9277de8ee4ba817c7ffb831578ee96a12bc8d | d4ea70e7a9ed8af0695cc8ee70c9a20fb728d192 | /arkanoid/Trabalho_Pratico_1_Carla_Graca/src/Arkanoid/vistaArkanoid.java | da4b9f882f84077759f1298d3e56faddd13dd37f | [] | no_license | carlaraquelgraca/college_projects | 44a454718cad78acfc355a792c606ea9d5d177e0 | e5ffe2c21d825629e0aaed950bf53201604c22ac | refs/heads/master | 2021-01-13T14:58:38.486310 | 2016-12-16T13:24:42 | 2016-12-16T13:24:42 | 76,651,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,456 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Arkanoid;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.io.Serializable;
import java.util.Observable;
import java.util.Observer;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
*
* @author Carla Raquel
*/
public class vistaArkanoid extends JFrame implements Observer, Serializable {
private ModeloArkanoid ar; //liga ao modelo
private Desenho desenho;
private Container c;
private JButton iniciar;
private JButton novoJogo;
private JButton carregarJogo;
private JButton guardarJogo;
private JButton pausarJogo;
private JButton sairJogo;
private Tempo tempo;
public vistaArkanoid(int ms, ModeloArkanoid a, int largura, int altura) {
super("Arkanoid por Carla Graça a21150031 e André César a21150076");//define o título da frame
ar = a;//liga o modelo a esta vista
ar.addObserver(this);//coloca este objecto como observador do modelo
c = getContentPane();
tempo = new Tempo(ar, ms);//cria um timer que coordena o movimento da bola num determinado tempo
setSize(largura, altura);//define as dimensoes da JFrame
criaObjectosGraficos(); //cria os objectos gráficos
disporVista();//coloca os objectos gráficos na tela
registarListeners();//regista os listeners que ficarão á escuta por interacções do utilizador com a vista
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);//centra no ecrã a jframe
setVisible(true);//coloca a frame como visível
update(ar, null);//invoca a função paint component para actualizar e redesenhar os objectos gráficos e as suas novas posições an tela
validate();
}
public void criaObjectosGraficos() {
desenho = new Desenho(ar);
iniciar = new JButton("Start");
carregarJogo = new JButton("Load");
guardarJogo = new JButton("Save");
pausarJogo = new JButton("Pause");
sairJogo = new JButton("Quit");
}
protected void disporVista()//desenha objectos na vista
{
JPanel fundo = new JPanel();
c.add(fundo);
fundo.add(desenho);
JPanel sul = new JPanel();
c.add(sul, BorderLayout.SOUTH);
sul.add(iniciar);
c.add(sul, BorderLayout.SOUTH);
sul.add(carregarJogo);
c.add(sul, BorderLayout.SOUTH);
sul.add(guardarJogo);
c.add(sul, BorderLayout.SOUTH);
sul.add(pausarJogo);
c.add(sul, BorderLayout.SOUTH);
sul.add(sairJogo);
}
public void registarListeners() {
iniciar.addActionListener(new IniciarListener());
desenho.addMouseListener(new BolaListener());
desenho.addMouseMotionListener(new RaqueteListener());
carregarJogo.addActionListener(new CarregaJogoListener());
guardarJogo.addActionListener(new GuardaJogoListener());
pausarJogo.addActionListener(new PausaJogoListener());
sairJogo.addActionListener(new SairJogoListener());
}
public void update(Observable o, Object arg) {//actualiza a vista
desenho.repaint();
}
class IniciarListener implements ActionListener {//listener que escuta pelo clique do rato no botão para iniciar jogo
public void actionPerformed(ActionEvent e) {
ar.iniciaJogo();
tempo.continuarTimer();
}
}
class SairJogoListener implements ActionListener {//listener que escuta pelo clique do rato no botão para sair do jogo
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}
class CarregaJogoListener implements ActionListener {//listener que escuta pelo clique do rato no botão para carregar jogo
public void actionPerformed(ActionEvent e) {
ModeloArkanoid ob = new ModeloArkanoid(ar.carregaJogo());
update(ob, null);
tempo.continuarTimer();
}
}
class GuardaJogoListener implements ActionListener {//listener que escuta pelo clique do rato no botão para guarda jogo
public void actionPerformed(ActionEvent e) {
ar.salvaJogo();
tempo.continuarTimer();
}
}
class PausaJogoListener implements ActionListener {//listener que escuta pelo clique do rato no botão para pausar ou continuar jogo
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("Pause")) {
tempo.pararTimer();
pausarJogo.setText("Unpause");
} else {
tempo.continuarTimer();
pausarJogo.setText("Pause");
}
}
}
class RaqueteListener extends MouseMotionAdapter {//listener que está à escuta pelo movimento do rato do utilizador
public void mouseMoved(MouseEvent e) {
ar.moveRaquete(e.getX());
}
}
class BolaListener extends MouseAdapter {//listener que está à escuta pelo movimento do rato do utilizador
public void mouseClicked(MouseEvent e) {
ar.libertaBola();
}
}
}
| [
"carlaaa_raquel@hotmail.com"
] | carlaaa_raquel@hotmail.com |
f79cc22b58ec2d7d432100ff51a64bb742f460dd | 4a4e8a588fa5fcf19d60f819a6cbcef7ea5ca98c | /Solution.java | e0c9cc8e67a45974061c497d7583721c4a1f9f03 | [] | no_license | francoccc/leetcode | 38b7a3d336f40dd8256e818c64af7f8859c9da7c | af25d9cad9c4a1c15b4fba89f7909a8dff615d23 | refs/heads/master | 2020-04-07T15:59:23.733077 | 2018-11-27T09:13:18 | 2018-11-27T09:13:18 | 158,510,450 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | package leetcode;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public List<Integer> getRow(int rowIndex) {
int[] olds = new int[]{1};
int[] news;
while(rowIndex > 0) {
news = new int[olds.length + 1];
news[0] = 1;
news[news.length - 1] = 1;
for(int i = 1; i < news.length - 2; i++) {
news[i] = olds[i] + olds[i - 1];
}
olds = news;
rowIndex--;
}
List<Integer> list = new ArrayList<>();
for(int i = 0; i < olds.length; i++) {
list.add(olds[i]);
}
return list;
}
}
| [
"chenxy@game-reign.com"
] | chenxy@game-reign.com |
39e3d99d8c5256491c8fe8211e21049059552268 | b54eaf00aa8dc286d6452e41d0a92f3f0a8ecf95 | /app/src/main/java/com/example/yifu/earthquakesdemo/view/OverviewActivity.java | 042e3007da264a4001c34adbc3426bdf3367a4d3 | [] | no_license | yiful/EarthquakesDemo | 6b7e41f5a763a2aa3375298bfe7997f21aa1766d | b2daa1ed080dbd8cda0537997297b6a61ff05dbb | refs/heads/master | 2020-04-19T07:26:45.091826 | 2019-01-28T22:19:30 | 2019-01-28T22:19:30 | 168,047,208 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,390 | java | package com.example.yifu.earthquakesdemo.view;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ListView;
import com.example.yifu.earthquakesdemo.R;
import com.example.yifu.earthquakesdemo.model.EarthquakesResponse;
import com.example.yifu.earthquakesdemo.network.APIService;
import com.example.yifu.earthquakesdemo.network.ApiClient;
import com.example.yifu.earthquakesdemo.utility.EarthquakesListAdapter;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class OverviewActivity extends AppCompatActivity {
private static final String TAG = OverviewActivity.class.getName();
ListView listView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_overview);
listView = findViewById(R.id.listview);
getEarthquakes();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.summary_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == R.id.action_refresh) {
getEarthquakes();
}
return super.onOptionsItemSelected(item);
}
// making the earthquakes summary call
private void getEarthquakes() {
APIService APIService = ApiClient.getClient().create(APIService.class);
Call<EarthquakesResponse> earthQuakesResponseCall = APIService.getEarthQuakes();
earthQuakesResponseCall.enqueue(new Callback<EarthquakesResponse>() {
@Override
public void onResponse(Call<EarthquakesResponse> call, Response<EarthquakesResponse> response) {
Log.i(TAG, response.body().toString());
EarthquakesListAdapter adapter = new EarthquakesListAdapter(OverviewActivity.this,
R.layout.earthquake_list_item, response.body().getFeatures());
listView.setAdapter(adapter);
}
@Override
public void onFailure(Call<EarthquakesResponse> call, Throwable t) {
Log.d(TAG, "failed to load earthquakes summary. ");
}
});
}
}
| [
"yiful@umich.edu"
] | yiful@umich.edu |
ba12badbdf99b87a6921a23f98c04c4bf6271dfc | 155c25f37ede044f75f3957d9c380f369be8aa7f | /app/src/main/java/com/example/taya/hello/MainActivity.java | ae526eaff90d6f08d66cde6abbab126b748a07c4 | [] | no_license | thehien0112/Hello | 3652c685aea2638785af852a068b183b1dc09ae6 | c8694f88ecb4166cddc0fcb8cd8d3785902a27c0 | refs/heads/master | 2021-05-16T17:26:35.715902 | 2017-08-16T06:50:02 | 2017-08-16T06:50:02 | 100,457,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package com.example.taya.hello;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"kangta112@gmail.com"
] | kangta112@gmail.com |
2c2cb37c4c4dc2defedb3fabcc4c0c48c6154480 | 57664c3116a52a438ea31f42618153d69ac73d23 | /src/main/java/my_java_exercises_from_different_sources/java_1_java_manual_sda/ex_18_interface/Train.java | f4fd738b7f3f904fbe86972485cb80084536622b | [] | no_license | TZakrzewski1986/my_java_exercises_from_different_sources | a5c229c1d12506ae57893c6618abbf1bfd703cc3 | 41cda65ea75870043c73815e43b811f58ab1ede5 | refs/heads/master | 2022-12-10T03:58:53.313408 | 2020-09-01T07:15:12 | 2020-09-01T07:15:12 | 289,918,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package my_java_exercises_from_different_sources.java_1_java_manual_sda.ex_18_interface;
public class Train implements Vehicle, Payable {
private static final double value = 25.50;
@Override
public void drive() {
System.out.println("Drive by train");
}
@Override
public void pay(int quantity) {
System.out.println(quantity * value);
}
}
| [
"tomasz.zakrzewski86@gmail.com"
] | tomasz.zakrzewski86@gmail.com |
d87fa9e62d361cc522dde36b911cb5d1380b674f | cf987a539d2f1815cd7944f38e8b6c25d804440b | /src/com/company/Lesson06_Arrays/Test01.java | 9e1a569a700090fa6971cb6bd26cb52e73bbe0eb | [] | no_license | Mila511/Java_for_interview | 1591cf9417a8d945eb20f9c294610288b0894d08 | 83b22ca3633da00097b7923ea552146be7484823 | refs/heads/master | 2021-01-23T01:57:00.465474 | 2017-05-20T12:07:41 | 2017-05-20T12:07:41 | 85,952,327 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 435 | java | package com.company.Lesson06_Arrays;
/**
* Created by plkff on 12/16/2016.
* a[6]
* array - 0[78]1[]2[68]3[]4[]
*/
public class Test01 {
public static void main(String[] args) {
int a = 6;
int[] array = new int[5];
array[2] = 68;
array[0] = 78;
System.out.println(array[2]);
for (int i = 0; i < array.length; i++) {
System.out.println(array[i]);
}
}
}
| [
"jixareva@gmail.com"
] | jixareva@gmail.com |
ca66b47e993fea864023be1666af4d565f70a124 | d88d9d586af582ad57476133898c763e09f8a85a | /ScroogeCoin/src/TxHandler.java | 8aecb99f3fe1459b34adc267a0f871c4b67d09d1 | [
"MIT"
] | permissive | yellowred/coursera-cryptocurrency | 19ba24dc6d637d60b00ca88124266874a6967fd6 | 30298dd8e97c876c94b26d92051f847a583e8307 | refs/heads/master | 2021-01-17T21:44:39.364887 | 2017-03-11T15:48:32 | 2017-03-11T15:48:32 | 84,181,286 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,935 | java |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Collectors;
public class TxHandler {
private UTXOPool ledger;
/**
* Creates a public ledger whose current UTXOPool (collection of unspent transaction outputs) is
* {@code utxoPool}. This should make a copy of utxoPool by using the UTXOPool(UTXOPool uPool)
* constructor.
*/
public TxHandler(UTXOPool utxoPool) {
ledger = new UTXOPool(utxoPool);
}
/**
* @return true if:
* (1) all outputs claimed by {@code tx} are in the current UTXO pool,
* (2) the signatures on each input of {@code tx} are valid,
* (3) no UTXO is claimed multiple times by {@code tx},
* (4) all of {@code tx}s output values are non-negative, and
* (5) the sum of {@code tx}s input values is greater than or equal to the sum of its output
* values; and false otherwise.
*/
public boolean isValidTx(Transaction tx) {
// IMPLEMENT THIS
// (1)
if (
!tx.getInputs().stream()
.map(input -> new UTXO(input.prevTxHash, input.outputIndex))
.allMatch(utxo -> ledger.contains(utxo))
) return false;
System.out.println("Pass 1");
// (2)
for (int index = 0; index < tx.getInputs().size(); index++) {
Transaction.Input input = tx.getInput(index);
UTXO utxo = new UTXO(input.prevTxHash, input.outputIndex);
if (!Crypto.verifySignature(ledger.getTxOutput(utxo).address, tx.getRawDataToSign(index), input.signature)) {
return false;
}
}
System.out.println("Pass 2");
// (3)
if (
tx.getInputs().stream()
.map(input -> new UTXO(input.prevTxHash, input.outputIndex))
.map(utxo -> utxo.hashCode())
.collect(Collectors.toSet())
.size() != tx.getInputs().size()
) return false;
System.out.println("Pass 3");
// (4)
if (!tx.getOutputs().stream().allMatch(output -> output.value >= 0)) return false;
System.out.println("Pass 4");
// (5)
Double sum1 = tx.getInputs().stream()
.mapToDouble(input -> ledger.getTxOutput(new UTXO(input.prevTxHash, input.outputIndex)).value)
.sum();
Double sum2 = tx.getOutputs().stream().mapToDouble(output -> output.value).sum();
System.out.println(String.format("Sums %s : %s : %s", sum1, sum2, sum1 >= sum2));
if (
tx.getInputs().stream()
.mapToDouble(input -> ledger.getTxOutput(new UTXO(input.prevTxHash, input.outputIndex)).value)
.sum() < tx.getOutputs().stream().mapToDouble(output -> output.value).sum()
) return false;
System.out.println("Pass 5");
return true;
}
/**
* Handles each epoch by receiving an unordered array of proposed transactions, checking each
* transaction for correctness, returning a mutually valid array of accepted transactions, and
* updating the current UTXO pool as appropriate.
*/
public Transaction[] handleTxs(Transaction[] possibleTxs) {
return Arrays.stream(possibleTxs)
.filter(trn -> isValidTx(trn))
.peek(trn -> {
for (Transaction.Input input : trn.getInputs()) {
ledger.removeUTXO(new UTXO(input.prevTxHash, input.outputIndex));
}
for (int index = 0; index < trn.getOutputs().size(); index++) {
ledger.addUTXO(new UTXO(trn.getHash(), index), trn.getOutput(index));
}
})
.toArray(Transaction[]::new);
}
}
| [
"surfingcat@surfingcat.local"
] | surfingcat@surfingcat.local |
34213b4310cb85dbf06fb8187c5007a6c62e4f66 | 663ee44c22a215e2ec8ab2d54a04da2a7d417858 | /src/main/java/com/example/listmaker/server/auth/GPlus.java | f51d46c211072ae7fd73ed5137aa7ea384148950 | [
"Apache-2.0"
] | permissive | turbomanage/listmaker | 01e0914039af4526e52f3ce8d9ca970c2e588510 | 5a2cfbc0923d32c97cb48c12d5e3b49706c1e42f | refs/heads/master | 2021-01-01T19:50:53.529991 | 2015-01-23T16:28:36 | 2015-01-23T16:28:36 | 29,741,130 | 4 | 2 | null | 2015-03-20T22:44:27 | 2015-01-23T16:22:06 | Java | UTF-8 | Java | false | false | 9,200 | java | /*
* Copyright 2013 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.listmaker.server.auth;
import com.google.api.client.auth.oauth2.TokenResponseException;
import com.google.api.client.googleapis.auth.oauth2.*;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson.JacksonFactory;
import com.google.api.services.plus.Plus;
import com.google.api.services.plus.model.Person;
import com.example.listmaker.common.domain.User;
import com.example.listmaker.server.exception.DuplicateUserException;
import com.example.listmaker.server.exception.RestException;
import com.turbomanage.gwt.server.servlet.AuthFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
/**
* Simple server to demonstrate how to use Google+ Sign-In and make a request
* via your own server.
*
* @author joannasmith@google.com (Joanna Smith)
* @author vicfryzel@google.com (Vic Fryzel)
*/
@Path("auth/g")
@Produces(MediaType.APPLICATION_JSON)
public class GPlus extends LoginHelper {
protected static final HttpTransport TRANSPORT = new NetHttpTransport();
protected static final JacksonFactory JSON_FACTORY = new JacksonFactory();
protected static final String CLIENT_ID = "GPLUS_CLIENT_ID";
protected static final String CLIENT_SECRET = "GPLUS_CLIENT_SECRET";
/**
* Upgrade given auth code to token, and store it in the session.
* POST body of request should be the authorization code.
* Example URI: /login?code=
*/
@GET
@Path("login")
public Response login(@QueryParam("code") String code,
@Context HttpServletRequest req,
@Context HttpServletResponse res) throws IOException {
// already logged in
if (AuthFilter.getUser() != null) {
try {
return Response.temporaryRedirect(new URI(getAppUrl(req))).build();
} catch (URISyntaxException e) {
throw new RestException(e);
}
}
try {
// Upgrade the authorization code into an access and refresh token.
String callbackUri = getCallbackURI(req);
GoogleTokenResponse tokenResponse =
new GoogleAuthorizationCodeTokenRequest(TRANSPORT, JSON_FACTORY,
CLIENT_ID, CLIENT_SECRET, code, callbackUri).execute();
// You can read the Google user ID in the ID token.
// This sample does not use the user ID.
GoogleIdToken idToken = tokenResponse.parseIdToken();
String email = idToken.getPayload().getEmail();
User user = appUserSvc.getRegisteredUser(email);
if ((user == null) || user.getGoogleId() == null) {
// Register new user
User newUser = getUserInfo(tokenResponse);
try {
user = registerUser(newUser);
} catch (DuplicateUserException e) {
res.sendRedirect("/s/ar.html");
}
}
AuthFilter.login(user, tokenResponse.toString());
return Response.temporaryRedirect(new URI(getAppUrl(req))).build();
} catch (TokenResponseException e) {
throw new RestException(e);
} catch (IOException e) {
throw new RestException(e);
} catch (URISyntaxException e) {
throw new RestException(e);
}
}
private User getUserInfo(GoogleTokenResponse accessToken) {
try {
// Build credential from stored token data.
GoogleCredential credential = new GoogleCredential.Builder()
.setJsonFactory(JSON_FACTORY)
.setTransport(TRANSPORT)
.setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()
.setFromTokenResponse(JSON_FACTORY.fromString(
accessToken.toString(), GoogleTokenResponse.class));
// Create a new authorized API client.
Plus service = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
.setApplicationName(APPLICATION_NAME)
.build();
// Get a list of people that this user has shared with this app.
Person me = service.people().get("me").execute();
User newUser = new User();
GoogleIdToken idToken = accessToken.parseIdToken();
newUser.setEmailAddress(idToken.getPayload().getEmail());
newUser.setGoogleId(idToken.getPayload().getSubject());
newUser.setFirstName(me.getName().getGivenName());
newUser.setLastName(me.getName().getFamilyName());
String imageUrl = me.getImage().getUrl();
newUser.setImgUrl(imageUrl);
return newUser;
// PeopleFeed people = service.people().list("me", "visible").execute();
} catch (IOException e) {
throw new RestException(e);
}
}
/**
* Revoke current user's token and reset their session.
*/
//public static class DisconnectServlet extends HttpServlet {
// @Override
// protected void doPost(HttpServletRequest request, HttpServletResponse response)
// throws ServletException, IOException {
// response.setContentType("application/json");
//
// // Only disconnect a connected user.
// String tokenData = (String) request.getSession().getAttribute("token");
// if (tokenData == null) {
// response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
// response.getWriter().print(GSON.toJson("Current user not connected."));
// return;
// }
// try {
// // Build credential from stored token data.
// GoogleCredential credential = new GoogleCredential.Builder()
// .setJsonFactory(JSON_FACTORY)
// .setTransport(TRANSPORT)
// .setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()
// .setFromTokenResponse(JSON_FACTORY.fromString(
// tokenData, GoogleTokenResponse.class));
// // Execute HTTP GET request to revoke current token.
// HttpResponse revokeResponse = TRANSPORT.createRequestFactory()
// .buildGetRequest(new GenericUrl(
// String.format(
// "https://accounts.google.com/o/oauth2/revoke?token=%s",
// credential.getAccessToken()))).execute();
// // Reset the user's session.
// request.getSession().removeAttribute("token");
// response.setStatus(HttpServletResponse.SC_OK);
// response.getWriter().print(GSON.toJson("Successfully disconnected."));
// } catch (IOException e) {
// // For whatever reason, the given token was invalid.
// response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
// response.getWriter().print(GSON.toJson("Failed to revoke token for given user."));
// }
// }
//}
/**
* Get list of people user has shared with this app.
*/
private Person listPeople() {
String tokenData = AuthFilter.getToken();
try {
// Build credential from stored token data.
GoogleCredential credential = new GoogleCredential.Builder()
.setJsonFactory(JSON_FACTORY)
.setTransport(TRANSPORT)
.setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()
.setFromTokenResponse(JSON_FACTORY.fromString(
tokenData, GoogleTokenResponse.class));
// Create a new authorized API client.
Plus service = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
.setApplicationName(APPLICATION_NAME)
.build();
// Get a list of people that this user has shared with this app.
Person me = service.people().get("me").execute();
// PeopleFeed people = service.people().list("me", "visible").execute();
return me;
} catch (IOException e) {
throw new RestException(e);
}
}
} | [
"turbomanage@gmail.com"
] | turbomanage@gmail.com |
2261882e77c7119755ceae0fd8e9916a7f8c66eb | e3abe2b3a77cb7778b9dbc6c15667e69f2911756 | /weCompany/WebUI/src/main/java/com/dp/ui/controller/ManagerController.java | a0e6705e74a8c53b8372bf2f5e8085599d0a9b8d | [] | no_license | dtscal/jpotato | 9675426bdb3355dac8e17312acdd03ffce6f7567 | 8e23f3bc7ea80cb0c5de32d821cfdedbb5edfe9d | refs/heads/master | 2021-01-22T23:16:11.623711 | 2014-11-24T05:39:24 | 2014-11-24T05:39:24 | 22,097,803 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package com.dp.ui.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* Created by dp on 14-10-16.
*/
@Controller
@RequestMapping("mg")
public class ManagerController {
@RequestMapping("/")
public String index(){
return "/manager/index";
}
}
| [
"dtscal@gmail.com"
] | dtscal@gmail.com |
ba9a1f9e37009e76573cae58b8acbbf1665e19a4 | 3e9647d65eced048bbdbf11a7a4c28f1b1694c1d | /EventDemo/app/src/main/java/com/glen/eventdemo/MyEvent.java | f4b21df8256a15a9cfbb613ada01b8db45c555b3 | [] | no_license | heman793/learn_android | 8e542a41f24a11213554c389b30f18938b6e7a45 | ff6e9cb0b6c6b571b8ca64a733c383c7e9860ec7 | refs/heads/master | 2021-08-24T05:45:41.309073 | 2017-12-08T08:25:53 | 2017-12-08T08:25:53 | 113,517,750 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package com.glen.eventdemo;
import android.view.View;
import android.widget.TextView;
/**
* Created by heman on 17/11/21.
*/
public class MyEvent implements View.OnClickListener {
private TextView tvShow;
//把文本框作为参数传入
public MyEvent(TextView tv){
this.tvShow = tv;
}
@Override
public void onClick(View v) {
//点击后设置文本框显示的文字
tvShow.setText("点击<外部类>按钮");
}
}
| [
"648363313@qq.com"
] | 648363313@qq.com |
cf879ca7c36820882556b1613346230f600e6446 | ff0c33ccd3bbb8a080041fbdbb79e29989691747 | /jdk.localedata/sun/util/resources/cldr/ext/CurrencyNames_nl_CW.java | 09212c64d05f98ae6e32f8a937c4e9ebb8fb15e4 | [] | no_license | jiecai58/jdk15 | 7d0f2e518e3f6669eb9ebb804f3c89bbfb2b51f0 | b04691a72e51947df1b25c31175071f011cb9bbe | refs/heads/main | 2023-02-25T00:30:30.407901 | 2021-01-29T04:48:33 | 2021-01-29T04:48:33 | 330,704,930 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,606 | java | /*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* COPYRIGHT AND PERMISSION NOTICE
*
* Copyright (C) 1991-2016 Unicode, Inc. All rights reserved.
* Distributed under the Terms of Use in
* http://www.unicode.org/copyright.html.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of the Unicode data files and any associated documentation
* (the "Data Files") or Unicode software and any associated documentation
* (the "Software") to deal in the Data Files or Software
* without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, and/or sell copies of
* the Data Files or Software, and to permit persons to whom the Data Files
* or Software are furnished to do so, provided that
* (a) this copyright and permission notice appear with all copies
* of the Data Files or Software,
* (b) this copyright and permission notice appear in associated
* documentation, and
* (c) there is clear notice in each modified Data File or in the Software
* as well as in the documentation associated with the Data File(s) or
* Software that the data or software has been modified.
*
* THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
* ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT OF THIRD PARTY RIGHTS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
* NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
* DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THE DATA FILES OR SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in these Data Files or Software without prior
* written authorization of the copyright holder.
*/
package sun.util.resources.cldr.ext;
import sun.util.resources.OpenListResourceBundle;
public class CurrencyNames_nl_CW extends OpenListResourceBundle {
@Override
protected final Object[][] getContents() {
final Object[][] data = new Object[][] {
{ "ANG", "NAf." },
};
return data;
}
}
| [
"caijie2@tuhu.cn"
] | caijie2@tuhu.cn |
4684526b70493fb1573cf3cdaf72d6eefbca7ab9 | 611a518fc1c33fa0e981be1303e1335b2bb6349a | /Proyecto_DDB_completo/src/java/db/dao/CancionListaDAO.java | 09485b2c53a5fa07e1b23a23ce150083f5ea3c65 | [] | no_license | jonciverka/Proyecto_BDD_Completo | dd4dfd2ba8c633cb85ea55aae0b57bec3a2913fe | 7cb52e8f6f9911b8e34f1186ff408ccdb467367b | refs/heads/master | 2020-03-11T17:19:14.882228 | 2018-05-02T16:14:50 | 2018-05-02T16:14:50 | 130,143,796 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,656 | java | package db.dao;
//cancion_lista
import db.connection.Conexion;
import db.entity.Cancion;
import java.sql.SQLException;
import db.entity.CancionLista;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
public class CancionListaDAO {
public CancionListaDAO(){}
public void agregarCancionEnLista(CancionLista c) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
Conexion conector = new Conexion();
String query = "insert into cancion_lista values(?,?)";
PreparedStatement pS;
conector.setBd("proyecto_DDB");
conector.abrirConexion();
pS = conector.getConect().prepareStatement(query);
conector.getConect().setAutoCommit(false);
pS.setInt(1, c.getIdLista());
pS.setInt(2, c.getIdCancion());
pS.execute();
conector.getConect().commit();
conector.cerrarConexion();
}
public CancionLista buscarCancionEnListas(int id) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
Conexion conector = new Conexion();
String query = "select * from cancion_lista where idCancion = ?";
PreparedStatement pS;
ResultSet rS;
conector.setBd("proyecto_DDB");
conector.abrirConexion();
pS = conector.getConect().prepareStatement(query);
conector.getConect().setAutoCommit(false);
pS.setInt(1, id);
rS = pS.executeQuery();
conector.getConect().commit();
return rS.next()
? new CancionLista(rS.getInt(1), rS.getInt(2))
: null;
}
public List<CancionLista> buscarLista(int id) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
Conexion conector = new Conexion();
String query = "select * from cancion_lista where idLista = ?";
PreparedStatement pS;
ResultSet rS;
conector.setBd("proyecto_DDB");
conector.abrirConexion();
pS = conector.getConect().prepareStatement(query);
conector.getConect().setAutoCommit(false);
pS.setInt(1, id);
rS = pS.executeQuery();
conector.getConect().commit();
List<CancionLista> lista = new ArrayList<>();
while (rS.next()) {
lista.add(new CancionLista(rS.getInt(1), rS.getInt(2)));
}
return lista;
}
public CancionLista buscarLista1(int id) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
Conexion conector = new Conexion();
String query = "select * from cancion_lista where idLista = ?";
PreparedStatement pS;
ResultSet rS;
conector.setBd("proyecto_DDB");
conector.abrirConexion();
pS = conector.getConect().prepareStatement(query);
conector.getConect().setAutoCommit(false);
pS.setInt(1, id);
rS = pS.executeQuery();
conector.getConect().commit();
return rS.next()
? new CancionLista(rS.getInt(1), rS.getInt(2))
: null;
}
public void eliminarCancionEnLista(CancionLista cl) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
Conexion conector = new Conexion();
String query = "delete from cancion_lista where idLista=? and idCancion=?";
PreparedStatement pS;
conector.setBd("proyecto_DDB");
conector.abrirConexion();
pS = conector.getConect().prepareStatement(query);
conector.getConect().setAutoCommit(false);
pS.setInt(1,cl.getIdLista());
pS.setInt(2,cl.getIdCancion());
pS.execute();
conector.getConect().commit();
conector.cerrarConexion();
}
public List<CancionLista> getListaCanciones() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
Conexion conector = new Conexion();
String query = "SELECT * FROM cancion_lista ORDER BY idCancion";
PreparedStatement pS;
ResultSet rS;
conector.setBd("proyecto_DDB");
conector.abrirConexion();
pS = conector.getConect().prepareStatement(query);
conector.getConect().setAutoCommit(false);
rS = pS.executeQuery();
conector.getConect().commit();
List<CancionLista> lista = new ArrayList<>();
while (rS.next()) {
lista.add(new CancionLista(rS.getInt(1), rS.getInt(2)));
}
return lista;
}
}
| [
"avilesgomezjonathan@hotmail.com"
] | avilesgomezjonathan@hotmail.com |
f42d8b4e83875fae015b05f7dcbaedb10a2491e5 | 819e50643b992913da77cb4731c743eeb8557d5f | /tagfilter/src/main/java/org/openstreetmap/osmosis/tagfilter/v0_6/NodeKeyValueFilter.java | 7f632293058f769ba96c428ac8081e6e5c5adca1 | [] | no_license | Jean-Emile/osmosis | a3a97f8f450b5b669c25ecfe7ca896c90739f3da | 7c1454355151c9a38868cf4b776d65714545d73f | refs/heads/master | 2021-01-21T01:10:56.939377 | 2012-03-18T03:27:15 | 2012-03-18T03:27:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,822 | java | // This software is released into the Public Domain. See copying.txt for details.
package org.openstreetmap.osmosis.tagfilter.v0_6;
import java.util.HashSet;
import java.util.Map;
import org.openstreetmap.osmosis.core.container.v0_6.BoundContainer;
import org.openstreetmap.osmosis.core.container.v0_6.EntityContainer;
import org.openstreetmap.osmosis.core.container.v0_6.EntityProcessor;
import org.openstreetmap.osmosis.core.container.v0_6.NodeContainer;
import org.openstreetmap.osmosis.core.container.v0_6.RelationContainer;
import org.openstreetmap.osmosis.core.container.v0_6.WayContainer;
import org.openstreetmap.osmosis.core.domain.v0_6.Tag;
import org.openstreetmap.osmosis.core.domain.v0_6.Node;
import org.openstreetmap.osmosis.core.task.v0_6.Sink;
import org.openstreetmap.osmosis.core.task.v0_6.SinkSource;
/**
* A class filtering everything but allowed nodes.
*
* @author Aurelien Jacobs
*/
public class NodeKeyValueFilter implements SinkSource, EntityProcessor {
private Sink sink;
private HashSet<String> allowedKeyValues;
/**
* Creates a new instance.
*
* @param keyValueList
* Comma-separated list of allowed key-value combinations,
* e.g. "place.city,place.town"
*/
public NodeKeyValueFilter(String keyValueList) {
allowedKeyValues = new HashSet<String>();
String[] keyValues = keyValueList.split(",");
for (int i = 0; i < keyValues.length; i++) {
allowedKeyValues.add(keyValues[i]);
}
}
/**
* {@inheritDoc}
*/
public void initialize(Map<String, Object> metaData) {
sink.initialize(metaData);
}
/**
* {@inheritDoc}
*/
public void process(EntityContainer entityContainer) {
// Ask the entity container to invoke the appropriate processing method
// for the entity type.
entityContainer.process(this);
}
/**
* {@inheritDoc}
*/
public void process(BoundContainer boundContainer) {
// By default, pass it on unchanged
sink.process(boundContainer);
}
/**
* {@inheritDoc}
*/
public void process(NodeContainer container) {
Node node = container.getEntity();
boolean matchesFilter = false;
for (Tag tag : node.getTags()) {
String keyValue = tag.getKey() + "." + tag.getValue();
if (allowedKeyValues.contains(keyValue)) {
matchesFilter = true;
break;
}
}
if (matchesFilter) {
sink.process(container);
}
}
/**
* {@inheritDoc}
*/
public void process(WayContainer container) {
// Do nothing.
}
/**
* {@inheritDoc}
*/
public void process(RelationContainer container) {
// Do nothing.
}
/**
* {@inheritDoc}
*/
public void complete() {
sink.complete();
}
/**
* {@inheritDoc}
*/
public void release() {
sink.release();
}
/**
* {@inheritDoc}
*/
public void setSink(Sink sink) {
this.sink = sink;
}
}
| [
"brett@bretth.com"
] | brett@bretth.com |
72116043141ae31e11481de9695915a398d5393f | eec0ccb88f90473bcdb8a15f524bfaf108f1cdb8 | /src/test/java/cn/tedu/store/service/OrderServiceTestCase.java | 112a18e8b2e635bfd90b84ce25978597826527ee | [] | no_license | yen525681/store | 22d52047350330a5491f6b982236e81d5f10abc9 | a3ef0819b8ede05e02d47f101d0129e182c572c4 | refs/heads/master | 2020-06-19T12:00:13.837349 | 2019-07-13T08:53:16 | 2019-07-13T08:53:16 | 196,699,225 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,070 | java | package cn.tedu.store.service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import cn.tedu.store.entity.Order;
import cn.tedu.store.service.exception.ServiceException;
import cn.tedu.store.vo.OrderVO;
@RunWith(SpringRunner.class)
@SpringBootTest
public class OrderServiceTestCase {
@Autowired
private IOrderService service;
@Test
public void createOrde() {
try {
Integer uid = 1;
String username = "傳奇";
Integer addressId = 10;
Integer[] cartIds = {7,8,9};
Order order = service.createOrder(uid, username, addressId, cartIds);
System.err.println(order);
} catch (ServiceException e) {
System.err.println("錯誤類型:" + e.getClass().getName());
System.err.println("錯誤描述:" + e.getMessage());
}
}
@Test
public void getById() {
Integer id = 4;
OrderVO data = service.getById(id);
System.err.println(data);
}
}
| [
"yen525681@gmail.com"
] | yen525681@gmail.com |
1b57b142215c6c5c72e3914632dc2b6b9843b351 | 5f0e3e77d1a9e49e6937202e52fd6ef6fcafc103 | /src/test/java/es/pmg/tennisjazz/config/WebConfigurerTest.java | 0323ce811dde0e1a3fc17df9739c7088ca864c17 | [] | no_license | PacoMunoz/tennis-jazz | 735b0cdc1b6852bb84aafa864216d69bdf0ca8a9 | 8a5a2ad85969965fb798bf5e9ac0dc8bc29d43e5 | refs/heads/master | 2023-06-08T17:35:54.329938 | 2023-03-19T20:54:27 | 2023-03-19T20:54:27 | 197,720,205 | 0 | 0 | null | 2023-05-24T01:40:01 | 2019-07-19T07:03:50 | Java | UTF-8 | Java | false | false | 7,175 | java | package es.pmg.tennisjazz.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.github.jhipster.web.filter.CachingHttpHeadersFilter;
import org.h2.server.web.WebServlet;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.mock.web.MockServletContext;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import javax.servlet.*;
import java.io.File;
import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Unit tests for the {@link WebConfigurer} class.
*/
public class WebConfigurerTest {
private WebConfigurer webConfigurer;
private MockServletContext servletContext;
private MockEnvironment env;
private JHipsterProperties props;
@BeforeEach
public void setup() {
servletContext = spy(new MockServletContext());
doReturn(mock(FilterRegistration.Dynamic.class))
.when(servletContext).addFilter(anyString(), any(Filter.class));
doReturn(mock(ServletRegistration.Dynamic.class))
.when(servletContext).addServlet(anyString(), any(Servlet.class));
env = new MockEnvironment();
props = new JHipsterProperties();
webConfigurer = new WebConfigurer(env, props);
}
@Test
public void testStartUpProdServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
webConfigurer.onStartup(servletContext);
verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class));
}
@Test
public void testStartUpDevServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
webConfigurer.onStartup(servletContext);
verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class));
}
@Test
public void testCustomizeServletContainer() {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
UndertowServletWebServerFactory container = new UndertowServletWebServerFactory();
webConfigurer.customize(container);
assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg");
assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8");
assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8");
if (container.getDocumentRoot() != null) {
assertThat(container.getDocumentRoot()).isEqualTo(new File("target/classes/static/"));
}
}
@Test
public void testCorsFilterOnApiPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
options("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"))
.andExpect(header().string(HttpHeaders.VARY, "Origin"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800"));
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"));
}
@Test
public void testCorsFilterOnOtherPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/test/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testCorsFilterDeactivated() throws Exception {
props.getCors().setAllowedOrigins(null);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testCorsFilterDeactivated2() throws Exception {
props.getCors().setAllowedOrigins(new ArrayList<>());
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
}
| [
"iicc96@hotmail.com"
] | iicc96@hotmail.com |
adc11b860ff3b73c09e5dba6e80c73f0e35817f3 | b14b055eefe860ee1f273a722279685f2a558a49 | /src/javaWeek_5/exercise3/RectangleTest.java | 2e501e0b85d73bbff0d44c0cde500efd0a6fa22d | [] | no_license | janamava/nacs_java | 7ef887d95a45b885c895d24cd9fa553122f50fb8 | 97f8392067ce2a930c0f9bf298911b2170315bc7 | refs/heads/master | 2020-04-07T22:02:50.187446 | 2019-02-01T09:57:42 | 2019-02-01T09:57:42 | 158,752,209 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 850 | java | package javaWeek_5.exercise3;
import javaWeek_5.exercise1.Shape;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class RectangleTest {
private Rectangle rectangle = new Rectangle();
private Coloured colouredRectangle = new Rectangle();
private Shape shapeRectangle = new Rectangle();
@Test
void testAsRectangle() {
String displayed = rectangle.getName();
Assertions.assertEquals("rectangle", displayed);
}
@Test
void testAsColored() {
String displayedColour = colouredRectangle.getColour();
Assertions.assertEquals("green", displayedColour);
}
@Test
void testAsShape() {
String displayed = shapeRectangle.getName();
Assertions.assertEquals("rectangle", displayed);
}
} | [
"aizhana.kamalova@gmail.com"
] | aizhana.kamalova@gmail.com |
3e4bdcae5f471a5f39bfa47a99e0dd5b56c092ce | 294392f06c49e472ba82127ffc37805cedcfb8ca | /oa-test/src/test/java/com/wantai/oa/test/utils/TemplateUtilsTest.java | d92c5625510039217493107cd58ded40afcc46b6 | [] | no_license | kingj1261/oa | 70d50629c03775c0f78a4c34542904ed337ae357 | 314f54d74a5ca7c565e0be0b17518c38b7be549d | refs/heads/master | 2021-01-10T08:27:05.591431 | 2016-02-02T06:23:52 | 2016-02-02T06:23:52 | 49,220,878 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 528 | java | package com.wantai.oa.test.utils;
import com.wantai.oa.common.util.TemplateUtils;
import org.junit.Assert;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
/**
* Created by mapingmp on 16/1/10.
*/
public class TemplateUtilsTest extends Assert {
@Test
public void testRender() {
String template = "hello ${name}!";
Map<String, Object> data = new HashMap<>();
data.put("name", "jack");
assertEquals(TemplateUtils.process(template, data), "hello jack!");
}
}
| [
"maping.mp@alibaba-inc.com"
] | maping.mp@alibaba-inc.com |
268c9777d08e05a3bb3998ec60413a135926b8cb | e136539089a63ff69cfd4441de6fa289801dc1d7 | /app/src/main/java/com/pudding/tangentninety/module/bean/SectionListBean.java | 89e9ffcfb73cff365ca9db98806575571197b6f7 | [] | no_license | lazy-play/TangentNinety | 68c4c048f4a29c2d906ca753200914ad9253063c | df466b2c7a8e768a662b4ab1c8fb46a620be74b8 | refs/heads/master | 2021-07-14T15:12:19.191735 | 2017-10-09T08:21:28 | 2017-10-09T08:21:28 | 106,252,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,392 | java | package com.pudding.tangentninety.module.bean;
import java.util.List;
/**
* Created by Error on 2017/6/26 0026.
*/
public class SectionListBean{
private List<DataBean> data;
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
/**
* description : 看别人的经历,理解自己的生活
* id : 1
* name : 深夜惊奇
* thumbnail : http://pic3.zhimg.com/91125c9aebcab1c84f58ce4f8779551e.jpg
*/
private String description;
private int id;
private String name;
private String thumbnail;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
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 getThumbnail() {
return thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
}
}
| [
"277591421@qq.com"
] | 277591421@qq.com |
5d34fa0045d5b21c3022728fe086b9e356b7c863 | 3d6c20dc57a8eb1a015c5d2353a515f29525a1d6 | /October24Swing/src/newpackage/TryWindows4.java | 1dee392970712c7721940cfc65e869c7fc17148e | [] | no_license | nparvez71/NetbeanSoftware | b9e5c93addc2583790c69f53c650c29665e16721 | 1e18ff07914c4c4530bcfd93693d838bea8f9641 | refs/heads/master | 2020-03-13T19:14:53.285683 | 2018-04-29T04:34:07 | 2018-04-29T04:34:07 | 131,249,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 659 | java |
package newpackage;
import java.awt.*;
import javax.swing.JFrame;
public class TryWindows4 {
static JFrame aWindow=new JFrame("this is tittle");
public static void main(String[] args) {
Toolkit theKit=aWindow.getToolkit();
Dimension wndSize=theKit.getScreenSize();
aWindow.setBounds(wndSize.width/4, wndSize.height/4,
wndSize.width/2, wndSize.height/2);
aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
aWindow.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
aWindow.getContentPane().setBackground(Color.LIGHT_GRAY);
aWindow.setVisible(true);
}
}
| [
"nparvez92@gmail.com"
] | nparvez92@gmail.com |
e590ce27885eb696b7f290478932bd9033bbc292 | 738d3484ccd27d66d3f30a195f96efb28da68fe1 | /src/com/smile/thread/util/Web_simulate.java | 11aa5d45e8cf58d26bee989d5fb977544268e3bb | [] | no_license | abigbigsmile/java-concurrent | e77fd882bd433de53839eb1041be7624eeda0ddc | 5d1ed4b99aa36ce492fbefe2cf4c87835ec89b84 | refs/heads/master | 2020-05-27T08:27:38.314608 | 2019-06-05T03:26:16 | 2019-06-05T03:26:16 | 188,545,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package com.smile.thread.util;
import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
public class Web_simulate {
public static void main(String[] args) throws IOException {
ServerSocket server = new ServerSocket(1234);
while(!Thread.interrupted()){
Socket client = server.accept();
new Thread(new ServerThread(client)).start();
}
}
}
| [
"smile06280629@yeah.net"
] | smile06280629@yeah.net |
5b0d711dc391e02a70bd50afa287e654f1cd2ac0 | 5c763d5fb2aedc9a7afeda6eeb03eeb2b13dc16d | /stubs/sources/kotlin/com/android/internal/os/ZygoteInit.java | 69a014ed63bf06c9950bc3fad4fa612dd6b93c7c | [
"Apache-2.0"
] | permissive | siylt007/toolkit | 0a4a64fdf251e47aff4466132bced7415faaa801 | df82f0588beb13fbd22308b3d015852c25781612 | refs/heads/master | 2023-02-04T06:23:24.156084 | 2020-12-29T13:47:16 | 2020-12-29T13:47:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 170 | java | package com.android.internal.os;
public class ZygoteInit {
public static void main(String[] argv) {
throw new UnsupportedOperationException("Stub!");
}
} | [
"710360540@qq.com"
] | 710360540@qq.com |
9e081a91776c4c64d875e366d10451206250dfa6 | 2b5a227645c895feeee7b2b78d2a06cacb659096 | /src/main/java/com/algaworks/algamoney/security/util/GeradorSenha.java | aa2eaf0a9ec8306a8668ce7a9a693bc44c0f6f3e | [] | no_license | juniorjrjl/algamoney-api | 4a8d342c47e12982ba52ac3db32a0accb030520c | ea0f6dd52cae7c392ffe22814ddec9dca16fa8d8 | refs/heads/master | 2022-12-08T04:09:01.691356 | 2022-11-16T19:34:17 | 2022-11-16T19:34:17 | 142,184,162 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 325 | java | package com.algaworks.algamoney.security.util;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
public class GeradorSenha {
public static void main(String[] args) {
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
System.out.println(encoder.encode("@ngul@r0"));
}
}
| [
"junior.jr.jl@gmail.com"
] | junior.jr.jl@gmail.com |
3b73d5cc7c20371513de41160db4a3fb43f31892 | 308d82f6303d41a5fc99addb331061f2e24f3225 | /excel-importer/src/main/java/uk/gov/hmcts/ccd/definition/store/excel/service/ProcessUploadServiceImpl.java | 14e882688a70fe251424e7d9f9006aa981a998ec | [
"MIT",
"JSON"
] | permissive | hmcts/ccd-definition-store-api | 3bd1af1352d4561cbeda960eb0f6aebcf23e9e10 | a2710aa561b63abd4848f91d0a986abb2cc47e72 | refs/heads/master | 2023-08-31T23:52:35.058486 | 2023-08-31T19:10:06 | 2023-08-31T19:10:06 | 125,355,388 | 8 | 13 | MIT | 2023-08-31T12:34:38 | 2018-03-15T11:10:38 | Java | UTF-8 | Java | false | false | 3,278 | java | package uk.gov.hmcts.ccd.definition.store.excel.service;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import uk.gov.hmcts.ccd.definition.store.excel.azurestorage.AzureStorageConfiguration;
import uk.gov.hmcts.ccd.definition.store.excel.azurestorage.service.FileStorageService;
import uk.gov.hmcts.ccd.definition.store.excel.domain.definition.model.DefinitionFileUploadMetadata;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@Component
public class ProcessUploadServiceImpl implements ProcessUploadService {
private static final Logger LOG = LoggerFactory.getLogger(ProcessUploadServiceImpl.class);
private ImportServiceImpl importService;
private FileStorageService fileStorageService;
private AzureStorageConfiguration azureStorageConfiguration;
@Autowired
public ProcessUploadServiceImpl(ImportServiceImpl importService,
@Autowired(required = false) FileStorageService fileStorageService,
@Autowired(required = false) AzureStorageConfiguration azureStorageConfiguration) {
this.importService = importService;
this.fileStorageService = fileStorageService;
this.azureStorageConfiguration = azureStorageConfiguration;
}
@Transactional
@Override
public ResponseEntity processUpload(MultipartFile file) throws IOException {
if (file == null || file.getSize() == 0) {
throw new IOException(IMPORT_FILE_ERROR);
} else {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (final InputStream inputStream = file.getInputStream()) {
IOUtils.copy(inputStream, baos);
}
byte[] bytes = baos.toByteArray();
LOG.info("Importing Definition file...");
final DefinitionFileUploadMetadata metadata =
importService.importFormDefinitions(new ByteArrayInputStream(bytes));
if (azureStorageConfiguration != null
&& azureStorageConfiguration.isAzureUploadEnabled()
&& fileStorageService != null) {
LOG.info("Uploading Definition file to Azure Storage...");
fileStorageService.uploadFile(file, metadata);
}
if (!importService.getImportWarnings().isEmpty()) {
for (String warning : importService.getImportWarnings()) {
LOG.warn(warning);
}
return ResponseEntity.status(HttpStatus.CREATED)
.header(IMPORT_WARNINGS_HEADER, importService.getImportWarnings().toArray(new String[0]))
.body(SUCCESSFULLY_CREATED);
}
return ResponseEntity.status(HttpStatus.CREATED).body(SUCCESSFULLY_CREATED);
}
}
}
| [
"noreply@github.com"
] | hmcts.noreply@github.com |
3c1befdc804ace3aec4d3741e9df49248db1aacf | fd364714e8eb82fa011745ca38edffb416f5a58e | /src/maternity/DBConnection.java | fd10e58a2ddde1c51903d9824bb533b5e27f2ae2 | [] | no_license | davisaaron/HOSPITAL-MANAGEMENT | fd569db77a826d84afc605dd31bf65cce4e0dd7e | 9f616390d2a07a25e92d9ba6f82f0ec87910ccce | refs/heads/master | 2022-06-08T23:50:34.816223 | 2020-05-09T07:15:18 | 2020-05-09T07:15:18 | 261,668,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,377 | 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 maternity;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* @author Sivakumar
*/
public class DBConnection {
private static String driverClass = "com.mysql.jdbc.Driver";
private static String url = "jdbc:mysql://localhost:3306/yarlmothercare";
private static String db_username = "root";
private static String db_password = "";
public static Connection getConnection(){
Connection conn = null;
Statement stmt = null;
try {
Class.forName(driverClass).newInstance();
conn = DriverManager.getConnection(url, db_username, db_password);
return conn;
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (InstantiationException ex) {
ex.printStackTrace();
} catch (IllegalAccessException ex) {
ex.printStackTrace();
} catch (SQLException ex) {
ex.printStackTrace();
}
return null;
}
}
| [
"davisabraham32@gmail.com"
] | davisabraham32@gmail.com |
429bf6df62518ed80ace3fb153152a354cd7abd1 | 3ac03f352656c22bea29bcedd8555965342d2c7e | /Personalizarea Preferintelor/Development/CustomizePreferences_v3/src/customize_preferences/SimpleKMeansGUI.java | 99466117a269218c13493cf73cf7f967729b01df | [] | no_license | voicurobert/oldProjects | eadafb89c688ff7ad2dcffa8f165db604f9b8ef2 | b38e88d33b32c33a10593e472375ce54640f65df | refs/heads/master | 2022-04-01T07:51:35.406791 | 2020-01-29T17:46:06 | 2020-01-29T17:46:06 | 237,045,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,185 | 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 customize_preferences;
import java.awt.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
/**
*
* @author Robert
*/
public class SimpleKMeansGUI extends javax.swing.JFrame {
private CentroidsTableModel centroidModel;
private SimpleKMeansThread thread;
/**
* Creates new form SimpleKMeansGUI
*/
public SimpleKMeansGUI( ) {
getContentPane().setBackground( new Color(200, 100, 100) );
initComponents();
nrOfClustersTextField.setText("");
centroidModel = new CentroidsTableModel();
thread = new SimpleKMeansThread();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
nrOfClustersTextField = new javax.swing.JFormattedTextField();
jLabel2 = new javax.swing.JLabel();
nrOfIterationsTextField = new javax.swing.JFormattedTextField();
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
centroidsTable = new javax.swing.JTable();
startButton = new javax.swing.JButton();
nextStepButton = new javax.swing.JButton();
autoIterateCheckBox = new javax.swing.JCheckBox();
jScrollPane2 = new javax.swing.JScrollPane();
allocationMappingTree = new javax.swing.JTree();
jScrollPane3 = new javax.swing.JScrollPane();
clusterMappingTree = new javax.swing.JTree();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Algoritmul Simple K-Means");
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
jLabel1.setFont(new java.awt.Font("Consolas", 1, 12)); // NOI18N
jLabel1.setText("Numar de oferte de creat");
nrOfClustersTextField.setText(" ");
jLabel2.setFont(new java.awt.Font("Consolas", 1, 12)); // NOI18N
jLabel2.setText("Numar de iteratii");
jPanel1.setBackground(new java.awt.Color(200, 100, 100));
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Centroizi", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Consolas", 1, 12))); // NOI18N
centroidsTable.setFont(new java.awt.Font("Consolas", 1, 12)); // NOI18N
centroidsTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null}
},
new String [] {
"Valoare 1", "Valoare 2", "Valoare 3", "Valoare 4", "Valoare 5", "Valoare 6", "Valoare 7", "Valoare 8"
}
));
jScrollPane1.setViewportView(centroidsTable);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 678, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(20, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(38, Short.MAX_VALUE))
);
startButton.setBackground(new java.awt.Color(102, 102, 102));
startButton.setFont(new java.awt.Font("Consolas", 1, 12)); // NOI18N
startButton.setText("Start");
startButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
startButtonActionPerformed(evt);
}
});
nextStepButton.setBackground(new java.awt.Color(102, 102, 102));
nextStepButton.setFont(new java.awt.Font("Consolas", 1, 12)); // NOI18N
nextStepButton.setText("Pasul urmator");
nextStepButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
nextStepButtonActionPerformed(evt);
}
});
autoIterateCheckBox.setFont(new java.awt.Font("Consolas", 1, 12)); // NOI18N
autoIterateCheckBox.setText("Itereaza automat");
autoIterateCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
autoIterateCheckBoxActionPerformed(evt);
}
});
javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("Client/Centroid - pas intermediar");
allocationMappingTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
jScrollPane2.setViewportView(allocationMappingTree);
treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("Alocare centroid/client");
clusterMappingTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
jScrollPane3.setViewportView(clusterMappingTree);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(73, 73, 73)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(nrOfClustersTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(nrOfIterationsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(autoIterateCheckBox)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 315, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(19, 19, 19))))
.addGroup(layout.createSequentialGroup()
.addGap(113, 113, 113)
.addComponent(startButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(nextStepButton)
.addGap(119, 119, 119))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(nrOfClustersTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(nrOfIterationsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(autoIterateCheckBox))
.addGap(18, 18, 18)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(startButton)
.addComponent(nextStepButton))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void nextStepButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextStepButtonActionPerformed
// TODO add your handling code here:
thread.resume();
centroidModel.setCentroids( thread.getCentroids() );
centroidModel.fireTableDataChanged();
thread.suspend();
}//GEN-LAST:event_nextStepButtonActionPerformed
private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed
// TODO add your handling code here:
if( areValuesSet() ){
computeCentroids();
int nrOfClusters = (int)Integer.valueOf( nrOfClustersTextField.getText() );
int nrOfSteps = (int)Integer.valueOf( nrOfIterationsTextField.getText() );
thread.setClusterNumber( nrOfClusters );
thread.setNrOfSteps( nrOfSteps );
thread.setClients( DatabaseManager.instance.getClients() );
if( autoIterateCheckBox.isSelected() ){
thread.setAutoIterate( true );
}else{
thread.setAutoIterate( false );
}
thread.start();
startButton.setEnabled( false );
}else{
new JOptionPane().showMessageDialog(this, "!!!");
}
}//GEN-LAST:event_startButtonActionPerformed
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
// TODO add your handling code here:
FrameInstanceHolder.instance.setSimpleKMeansFrame(null);
}//GEN-LAST:event_formWindowClosed
private void autoIterateCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_autoIterateCheckBoxActionPerformed
// TODO add your handling code here:
if( autoIterateCheckBox.isSelected() ){
nextStepButton.setEnabled( false );
}else{
nextStepButton.setEnabled( true );
}
}//GEN-LAST:event_autoIterateCheckBoxActionPerformed
private void computeCentroids(){
List<Centroid> centroids = new ArrayList<Centroid>();
int nrOfClusters = (int) Integer.valueOf( nrOfClustersTextField.getText() );
for (int i = 1; i <= nrOfClusters; i++) {
Centroid centroid = new Centroid();
centroid.generateRandomData();
System.out.println(centroid.toString());
centroids.add(centroid);
// DatabaseManager.instance.insertCentroid(centroid);
}
thread.setCentroids(centroids);
setTableData(centroids);
}
private boolean areValuesSet(){
if( nrOfClustersTextField.getText().isEmpty() || nrOfIterationsTextField.getText().isEmpty() ){
return false;
}else{
return true;
}
}
public void setAllocationMappingTree(){
// get model from tree
DefaultTreeModel allocationTreeModel = ( DefaultTreeModel ) allocationMappingTree.getModel();
// get root
DefaultMutableTreeNode allocationTreeRoot = ( DefaultMutableTreeNode ) allocationTreeModel.getRoot();
allocationTreeRoot.removeAllChildren();
for( Integer clientIndex : thread.getAllocationMapping().keySet() ){
DefaultMutableTreeNode clientNode = new DefaultMutableTreeNode( clientIndex + 1 );
allocationTreeRoot.add( clientNode );
HashMap<Double, Integer> info = thread.getAllocationMapping().get( clientIndex );
for( Double result : info.keySet() ){
Integer centroidIndex = info.get( result );
String value = result.toString() + " => " + ( centroidIndex + 1 );
DefaultMutableTreeNode childNode = new DefaultMutableTreeNode( value );
clientNode.add(childNode);
}
}
allocationTreeModel.reload();
}
public void setClusterAllocationTree(){
// get model from tree
DefaultTreeModel clusterTreeModel = ( DefaultTreeModel ) clusterMappingTree.getModel();
DefaultMutableTreeNode clusterTreeRoot = ( DefaultMutableTreeNode ) clusterTreeModel.getRoot();
clusterTreeRoot.removeAllChildren();
for( Integer centroidIndex : thread.getClusterAllocation().keySet() ){
DefaultMutableTreeNode centroidNode = new DefaultMutableTreeNode( centroidIndex + 1 );
List<Client> clients = thread.getClusterAllocation().get( centroidIndex );
clusterTreeRoot.add( centroidNode );
DefaultMutableTreeNode clientsListChild = new DefaultMutableTreeNode( getClientsListAsString( clients ) );
centroidNode.add( clientsListChild );
}
clusterTreeModel.reload();
}
public void setTableData( List<Centroid> centroids ){
centroidModel.setCentroids(centroids);
centroidModel.fireTableDataChanged();
centroidsTable.setModel(centroidModel);
}
public void disableNextButton(){
nextStepButton.setEnabled( false );
}
private String getClientsListAsString( List<Client> clients ){
String message = "";
for( int i = 0; i<clients.size(); i++ ){
Client client = clients.get(i);
if( (i + 1) == clients.size() ){
message += client.getIdClient();
}else{
message += client.getIdClient() + " , ";
}
}
return message;
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTree allocationMappingTree;
private javax.swing.JCheckBox autoIterateCheckBox;
private javax.swing.JTable centroidsTable;
private javax.swing.JTree clusterMappingTree;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JButton nextStepButton;
private javax.swing.JFormattedTextField nrOfClustersTextField;
private javax.swing.JFormattedTextField nrOfIterationsTextField;
private javax.swing.JButton startButton;
// End of variables declaration//GEN-END:variables
}
| [
"voicu.eduardrobert@gmail.com"
] | voicu.eduardrobert@gmail.com |
62127f434df38b2c67383cf9a7782d2f001766e1 | 127a9c13f855e164098b0c35de5105c7601ab13a | /src/main/java/sequenceplanner/model/SPconst.java | 894869c998452c02122e1fbe0a3b45d0b671a0a4 | [] | no_license | eohlson/Sequence-Planner | 361774768eaf7c233bfb27a0bbbb84b9ff80f8fa | 37ac3813bc4b629dbb813bf94ee6066e4eda061f | refs/heads/master | 2020-12-25T16:25:29.048889 | 2010-11-05T22:45:06 | 2010-11-05T22:45:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package sequenceplanner.model;
/**
*
* @author erik
*/
public class SPconst {
public final static String LOGIC_AND = "^^";
}
| [
"viktor.nyblom@gmail.com"
] | viktor.nyblom@gmail.com |
cc248fd552f14f7c419dc4d02053ca16ecd06f8a | 6880f1589d5434b22ba44180cfb42a0959bfa45e | /cybern/src/ru/company/portal/users/start/Main.java | 4f22914c4abb60144ea69a9b46968608641e1bda | [] | no_license | javacode2016/workspace | 3a036e10b073d2d11f42c1c42db9c10c111cc6c6 | 80c9b41f75fd9d264f28efc6352211cdeb8f0e85 | refs/heads/master | 2021-07-06T23:23:33.866109 | 2017-09-26T17:51:47 | 2017-09-26T17:51:47 | 104,913,036 | 0 | 0 | null | null | null | null | WINDOWS-1251 | Java | false | false | 327 | java | package ru.company.portal.users.start;//название пакета
import ru.company.portal.users.modernman.Human;//импорт класса
public class Main {
public static void main(String[] args) {
Human oldhuman = new Human();
//oldhuman.setName("Вася");
//h.setHeight(4);
oldhuman.call();
}
}
| [
"javacode@mail.ru"
] | javacode@mail.ru |
451b112e7e8f845f2de689ed0c649e7f8d5009cf | 947377c88dffde0a7c44871f6829ba2dafec9ae0 | /app/src/test/java/edu/quinnipiac/ser210/ch1demo/ExampleUnitTest.java | 37c801b92179b6a34aa6a9e7bc6d166d13784117 | [] | no_license | SER210-SP19/headfirst-ch1-kevin-96 | 969cfe4b0736fb46efaf6ca7c1b0c59ba6d1b1c0 | a277825b4c1ee46b3f7f3672bd8c7c4ee844decb | refs/heads/master | 2020-04-18T00:14:07.847943 | 2019-01-24T21:21:14 | 2019-01-24T21:21:14 | 167,068,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package edu.quinnipiac.ser210.ch1demo;
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);
}
} | [
"kevin.sangurima@quinnipiac.edu"
] | kevin.sangurima@quinnipiac.edu |
80c407d4115588178a2448dea5a38d916a188be9 | cb52955c4a8193325ba32c0ee697a82425d22bc6 | /PhoneBook/src/ver06/PhoneUnivInfor.java | 91f030e5828c917b4a594826e57bd71d7b54d572 | [] | no_license | JeongSuIn/classproject | c847edc5fe83b8042e59ca6f99cfbc943fafb0f5 | 4f3e386c752864c5e735a8105d59db79722181ec | refs/heads/master | 2023-03-24T06:10:32.201139 | 2021-03-19T04:44:24 | 2021-03-19T04:44:24 | 299,173,479 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 970 | java | package ver06;
public class PhoneUnivInfor extends PhoneInfor {
// 대학 친구: 전공, 학년 추가
private String major;
private int grade;
public PhoneUnivInfor(String name, String phoneNumber, String address, String email, String major, int grade) {
// 상위 클래스의 생성자 호출: 상위클래스의 멤버 변수 초기화
super(name, phoneNumber, address, email);
// 새로 추가된 멤버 변수 초기화
this.major = major;
this.grade = grade;
}
// getter/setter
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public int getGrade() {
return grade;
}
public void setGrade(int grade) {
this.grade = grade;
}
@Override
public void showInfor() {
super.showInfor();
System.out.println("전공 >> " + major);
System.out.println("학년 >> " + grade);
}
// 20.10.21 추가
@Override
public void showBasicInfor() {
super.showInfor();
}
}
| [
"71997955+JeongSuIn@users.noreply.github.com"
] | 71997955+JeongSuIn@users.noreply.github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.