blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53ac791f7efaa2e1672aa5be4791ab96d8f6589d | d4d1013d3215088f7ec445b393b58fb30249ca1b | /jonix-codegen/src/main/java/com/tectonica/jonix/codegen/MetadataDump.java | 8cfe5f472607d9f5c8c55f13e07f2013c1053e72 | [
"Apache-2.0"
] | permissive | miyewd/jonix | 70de3ba4b2054e0a66f688185834c9b0c73a101f | 2ce4c9d7fddd453c4c76cf2a4bfae17b98e9b91d | refs/heads/master | 2022-11-28T18:00:52.049749 | 2020-08-06T09:21:47 | 2020-08-06T09:21:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,521 | java | /*
* Copyright (C) 2012-2020 Zach Melamed
*
* Latest version available online at https://github.com/zach-m/jonix
* Contact me at zach@tectonica.co.il
*
* 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.tectonica.jonix.codegen;
import com.tectonica.jonix.codegen.metadata.OnixMetadata;
import com.tectonica.jonix.codegen.metadata.OnixSimpleType;
import com.tectonica.jonix.codegen.util.JSON;
import com.tectonica.jonix.codegen.util.OnixSpecs;
import com.tectonica.jonix.codegen.util.ParseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.stream.Stream;
import static com.tectonica.jonix.codegen.GenerateCode.unifyCodelists;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_2_1_03_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_2_1_03_SHORT;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_01_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_02_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_03_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_04_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_05_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_06_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_07_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_LATEST_REF;
import static com.tectonica.jonix.codegen.util.OnixSpecs.SPECS_3_0_LATEST_SHORT;
public class MetadataDump {
private static final Logger LOGGER = LoggerFactory.getLogger(MetadataDump.class);
private static final File DUMP_FOLDER = new File("meta");
public static void main(String[] args) throws IOException, ParserConfigurationException, SAXException {
LOGGER.info("Parsing Onix2..");
parse2();
LOGGER.info("Parsing Onix3..");
parse3();
LOGGER.info("Parsing Onix3 History..");
parse3_unified_all_rev();
LOGGER.info("DONE");
}
private static void parse2() throws IOException, ParserConfigurationException, SAXException {
File parent = new File(DUMP_FOLDER, "onix2");
saveMetadata(SPECS_2_1_03_REF, new File(parent, "reference"));
saveMetadata(SPECS_2_1_03_SHORT, new File(parent, "short"));
}
private static void parse3() throws IOException, ParserConfigurationException, SAXException {
File parent = new File(DUMP_FOLDER, "onix3");
saveMetadata(SPECS_3_0_LATEST_REF, new File(parent, "reference"));
saveMetadata(SPECS_3_0_LATEST_SHORT, new File(parent, "short"));
}
private static void parse3_unified_all_rev() throws IOException, ParserConfigurationException, SAXException {
File parent = new File(DUMP_FOLDER, "onix3-history");
saveMetadata(SPECS_2_1_03_REF, SPECS_3_0_01_REF, new File(parent, "3.0.1"));
saveMetadata(SPECS_2_1_03_REF, SPECS_3_0_02_REF, new File(parent, "3.0.2"));
saveMetadata(SPECS_2_1_03_REF, SPECS_3_0_03_REF, new File(parent, "3.0.3"));
saveMetadata(SPECS_2_1_03_REF, SPECS_3_0_04_REF, new File(parent, "3.0.4"));
saveMetadata(SPECS_2_1_03_REF, SPECS_3_0_05_REF, new File(parent, "3.0.5"));
saveMetadata(SPECS_2_1_03_REF, SPECS_3_0_06_REF, new File(parent, "3.0.6"));
saveMetadata(SPECS_2_1_03_REF, SPECS_3_0_07_REF, new File(parent, "3.0.7"));
}
// ///////////////////////////////////////////////////////////////////////////////////////////////////////
public static void saveMetadata(OnixSpecs specs, File dir)
throws ParserConfigurationException, SAXException, IOException {
OnixMetadata metadata = ParseUtil.parse(specs);
saveMetadata(metadata, metadata.getEnums(), dir);
}
public static void saveMetadata(OnixSpecs specs2Ref, OnixSpecs specs3Ref, File dir)
throws IOException, ParserConfigurationException, SAXException {
OnixMetadata ref2 = ParseUtil.parse(specs2Ref);
OnixMetadata ref3 = ParseUtil.parse(specs3Ref);
saveMetadata(ref3, unifyCodelists(ref2, ref3).values(), dir);
}
private static void saveMetadata(OnixMetadata metadata, Collection<OnixSimpleType> enums, File dir) {
ensureDir(dir);
String folder = dir.getAbsolutePath();
saveAsJson(folder + "/types.txt", metadata.onixTypes.values());
ensureDir(new File(folder + "/composites"));
//occ.sortInternally();
metadata.getComposites()
.forEach(composite -> saveAsJson(folder + "/composites/" + composite.name + ".txt", composite));
ensureDir(new File(folder + "/elements"));
//ovc.sortInternally();
metadata.getElements()
.forEach(element -> saveAsJson(folder + "/elements/" + element.name + ".txt", element));
ensureDir(new File(folder + "/flags"));
//ofc.sortInternally();
metadata.getFlags()
.forEach(flag -> saveAsJson(folder + "/flags/" + flag.name + ".txt", flag));
ensureDir(new File(folder + "/enums"));
metadata.getEnums()
.forEach(ost -> saveAsJson(folder + "/enums/" + ost.name + ".txt", ost));
ensureDir(new File(folder + "/structs"));
metadata.getStructs()
.forEach(os -> saveAsJson(folder + "/structs/" + os.containingComposite.name + ".txt", os));
Stream<OnixSimpleType> sortedCodelists = enums.stream()
.filter(ost -> ost.enumAliasFor == null)
.sorted(Comparator.comparingInt(OnixSimpleType::extractCodeList));
saveCodelistCsv(folder + "/codelists.csv", sortedCodelists);
LOGGER.info("saved results to " + folder);
}
private static void ensureDir(File dir) {
if (dir.exists()) {
try {
deleteDir(dir);
} catch (IOException e) {
throw new RuntimeException((e));
}
}
if (!dir.mkdirs()) {
throw new RuntimeException(String.format("Couldn't create directory %s", dir.getAbsolutePath()));
}
}
private static void deleteDir(File dir) throws IOException {
Files.walk(dir.toPath())
.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
}
private static void saveAsJson(final String fileName, final Object obj) {
JSON.saveAsJson(new File(fileName), obj);
}
private static void saveCodelistCsv(final String fileName, Stream<OnixSimpleType> codelists) {
try (BufferedWriter out = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(fileName), StandardCharsets.UTF_8))) {
out.write('\ufeff');
out.write("CodeList");
out.write(",");
out.write("EnumName");
out.write(",");
out.write("Description");
out.write(",");
out.write("EnumCodelistIssue");
out.write('\n');
for (Iterator<OnixSimpleType> iter = codelists.iterator(); iter.hasNext(); ) {
OnixSimpleType ost = iter.next();
out.write(ost.extractCodeList().toString());
out.write(",");
out.write(ost.enumName);
out.write(",\"");
out.write(ost.description.replaceAll("\"", "\"\""));
out.write(",");
out.write(ost.enumCodelistIssue);
out.write('\n');
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
| [
"zach@tectonica.co.il"
] | zach@tectonica.co.il |
0e9c6c1f535e0f4e70ec97ae1fdccde02788414f | 37ff7a11e1e7aeb2c17d1f73c9e12bcfe7c19035 | /android/src/main/java/de/wellenvogel/avnav/appapi/UserDirectoryRequestHandler.java | 2ca2950b99fc7957b9dbb8db2953cb084947be50 | [
"MIT"
] | permissive | jhedtmann/avnav | 14c9caeb3b999ee8c280f350387a54702d96f897 | 0d230c1efe3fa12776128b872e7de4f57d2fca9f | refs/heads/master | 2022-12-27T03:05:03.798287 | 2022-11-01T15:45:33 | 2022-11-01T15:45:33 | 146,248,849 | 0 | 0 | MIT | 2018-08-27T05:00:44 | 2018-08-27T05:00:44 | null | UTF-8 | Java | false | false | 5,540 | java | package de.wellenvogel.avnav.appapi;
import android.content.res.AssetManager;
import android.net.Uri;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import de.wellenvogel.avnav.util.AvnLog;
import de.wellenvogel.avnav.worker.GpsService;
public class UserDirectoryRequestHandler extends DirectoryRequestHandler {
private static final byte[] PREFIX="try{(\nfunction(){\n".getBytes(StandardCharsets.UTF_8);
private static final byte[] SUFFIX="\n})();\n}catch(e){\nwindow.avnav.api.showToast(e.message+\"\\n\"+(e.stack||e));\n }\n".getBytes(StandardCharsets.UTF_8);
private static String templateFiles[]=new String[]{"user.css","user.js","splitkeys.json"};
private static String emptyJsonFiles[]=new String[]{"keys.json","images.json"};
//input stream for a js file wrapped by prefix and suffix
static class JsStream extends InputStream {
FileInputStream fs;
int prfxPtr=0;
int sfxPtr=0;
int mode=0; //0-prefix,1-file,2-suffix
byte[] prefix=null;
public JsStream(FileInputStream fs,byte[] additionalPrefix) throws UnsupportedEncodingException {
this.fs=fs;
this.prefix=new byte[PREFIX.length+additionalPrefix.length];
System.arraycopy(PREFIX,0,this.prefix,0,PREFIX.length);
System.arraycopy(additionalPrefix,0,this.prefix,PREFIX.length,additionalPrefix.length);
}
@Override
public int read() throws IOException {
switch (mode) {
case 0:
if (prfxPtr < this.prefix.length) {
int rt=this.prefix[prfxPtr];
prfxPtr++;
return rt;
}
mode=1;
case 1:
int rt=fs.read();
if (rt >= 0) return rt;
mode=2;
case 2:
if (sfxPtr < SUFFIX.length) {
int rts=SUFFIX[sfxPtr];
sfxPtr++;
return rts;
}
mode=3;
}
return -1;
}
@Override
public void close() throws IOException {
super.close();
fs.close();
mode=3;
}
};
public UserDirectoryRequestHandler(RequestHandler handler, GpsService ctx,IDeleteByUrl deleter) throws Exception {
super(RequestHandler.TYPE_USER, ctx,handler.getWorkDirFromType(RequestHandler.TYPE_USER), "user/viewer", deleter);
AssetManager assets=handler.service.getAssets();
for (String filename : templateFiles){
File file=new File(workDir,filename);
if (! file.exists()){
String templateName="viewer/"+filename;
try {
InputStream src = assets.open(templateName);
AvnLog.i("creating user file " + filename + " from template");
FileOutputStream out=new FileOutputStream(file);
byte buffer[]=new byte[10000];
int rd=0;
while ((rd=src.read(buffer)) >=0 ){
out.write(buffer,0,rd);
}
out.close();
src.close();
}catch (Throwable t){
AvnLog.e("unable to copy template "+templateName,t);
}
}
}
for (String filename : emptyJsonFiles){
File file=new File(workDir,filename);
if (! file.exists()){
try {
AvnLog.i("creating empty user file " + filename );
PrintWriter out= new PrintWriter(new FileOutputStream(file));
out.println("{ }");
out.close();
}catch (Throwable t){
AvnLog.e("unable to create "+filename,t);
}
}
}
}
@Override
public ExtendedWebResourceResponse handleDirectRequest(Uri uri, RequestHandler handler, String method) throws Exception {
String path=uri.getPath();
if (path == null) return null;
if (path.startsWith("/")) path=path.substring(1);
if (!path.startsWith(urlPrefix)) return null;
path = path.substring((urlPrefix.length()+1));
String[] parts = path.split("/");
if (parts.length < 1) return null;
if (parts.length > 1) return super.handleDirectRequest(uri, handler, method);
String name= URLDecoder.decode(parts[0],"UTF-8");
if (!name.equals("user.js")) return super.handleDirectRequest(uri, handler, method);
File foundFile=new File(workDir,name);
if (! foundFile.exists()) return super.handleDirectRequest(uri, handler, method);
String base="/"+urlPrefix;
byte[] baseUrl=("var AVNAV_BASE_URL=\""+base+"\";\n").getBytes(StandardCharsets.UTF_8);
long flen=foundFile.length()+SUFFIX.length+PREFIX.length+baseUrl.length;
JsStream out=new JsStream(new FileInputStream(foundFile),baseUrl);
return new ExtendedWebResourceResponse(
flen,
RequestHandler.mimeType(foundFile.getName()),
"", out);
}
}
| [
"andreas@wellenvogel.de"
] | andreas@wellenvogel.de |
de7be5970b086428471fdb7f72a386b62e44788b | 27b61d580a8790cf59014a54c7ef73ebfc422e7d | /springboot/microservices/review-microservice/src/main/java/com/thedevd/springboot/ReviewMicroserviceApplication.java | f3a28a627755dacde1340fa226933d0ac8f4f4a5 | [] | no_license | thedevd/techBlog | 4aea3ad95e9e3c66d67fdc5e46a3279208f43ace | 6d980b3ab2577e8d774b3e5dff26d69df4b89ba6 | refs/heads/master | 2023-07-25T10:35:08.751684 | 2023-05-17T07:11:06 | 2023-05-17T07:11:06 | 125,161,744 | 1 | 0 | null | 2023-07-07T21:44:14 | 2018-03-14T05:49:22 | Scala | UTF-8 | Java | false | false | 518 | java | package com.thedevd.springboot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableFeignClients
@EnableDiscoveryClient
public class ReviewMicroserviceApplication {
public static void main(String[] args) {
SpringApplication.run(ReviewMicroserviceApplication.class, args);
}
}
| [
"devendra.vishwakarma@renovite.com"
] | devendra.vishwakarma@renovite.com |
782f8d83b4c96e2ed8e7451f60d1fba77ec64777 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/main/java/org/gradle/test/performancenull_438/Productionnull_43800.java | dc1ac359d59baa9708955fb4d138fa1dae2c9122 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 588 | java | package org.gradle.test.performancenull_438;
public class Productionnull_43800 {
private final String property;
public Productionnull_43800(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
ed7d57163963df946a630cc8a12d5a6f723c3c02 | 79675380bf15dc788d1327d697104bd61f341452 | /src/sample/database/Consts.java | 571fc979e4632c2362f69fd37e080727d40f756b | [] | no_license | 9wilson6/To-do-app | dccce9d2a5c15df27b42d546ef95915958031184 | 1a70daf01c740ac2f655d7c282e5f30468c1b3e7 | refs/heads/master | 2020-08-19T22:47:55.595444 | 2019-10-18T07:06:15 | 2019-10-18T07:06:15 | 215,961,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 867 | java | package sample.database;
public class Consts {
public static final String USERS_TABLE="users";
public static final String TASKS_TABLE="tasks";
//user columns names
public static final String USER_FIRSTNAME="firstname";
public static final String USER_LASTNAME="lastname";
public static final String USER_USERNAME="username";
public static final String USER_LOCATION="location";
public static final String USER_GENDER="gender";
public static final String USER_PASSWORD="password";
public static final String USER_ID="userid";
//tasks columns names
public static final String TASK_ID="taskid";
public static final String TASK_TASK="task";
public static final String TASK_DATE="datecreated";
public static final String TASK_DESCRIPTION="description";
public static final String TASK_USERID="userid";
}
| [
"gatheruwilson@gmail.com"
] | gatheruwilson@gmail.com |
1d2a7c7b45cd8b1de2801bc533c2909cb6ba38f5 | 7070e43fa78eaaaee247cdc70e10b8c58d3c39d4 | /app/src/main/java/com/example/todolistapp/DatabaseHelper.java | 8750659155d26f024c4cfc319c5c12c96b38ac7f | [] | no_license | AbhinavMaddirala/ToDoList-Android-App | 070b4da9a414fdf2e07a77afd33fa99da79108d8 | 53aa51f702b896ff733f86f47ad202ac6746e4b8 | refs/heads/master | 2022-12-10T07:49:35.176649 | 2020-08-31T10:39:56 | 2020-08-31T10:39:56 | 291,687,362 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,331 | java | package com.example.todolistapp;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.widget.Toast;
import androidx.annotation.Nullable;
public class DatabaseHelper extends SQLiteOpenHelper {
public final static String DATABASE_NAME ="ToDoApp.db";
public final static String TABLE_NAME ="ToDoAppTable";
public final static String COl1 ="ID";
public final static String COl2 ="TASK";
public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE IF NOT EXISTS "+TABLE_NAME+" (ID INTEGER PRIMARY KEY AUTOINCREMENT,TASK TEXT)");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS "+TABLE_NAME);
onCreate(db);
}
public boolean addTask(String task){
SQLiteDatabase db=this.getWritableDatabase();
ContentValues contentValues=new ContentValues();
contentValues.put(COl2,task);
long result = db.insert(TABLE_NAME,null,contentValues);
if(result==-1)
{
return false;
}else{
return true;
}
}
public boolean updateTask(String id,String task){
SQLiteDatabase db =this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COl1,task);
db.update(TABLE_NAME,contentValues,"ID=?",new String[]{id});
return true;
}
public Cursor getData(String id) {
SQLiteDatabase db = this.getWritableDatabase();
String query ="SELECT * FROM " + TABLE_NAME + " WHERE ID='"+id+ "'";
Cursor cursor=db.rawQuery(query,null);
return cursor;
}
public Integer deleteData(String id){
SQLiteDatabase db=this.getWritableDatabase();
return db.delete(TABLE_NAME,"ID=?",new String[]{id});
}
public Cursor getAllData(){
SQLiteDatabase db= this.getWritableDatabase();
Cursor cursor=db.rawQuery("SELECT * FROM "+TABLE_NAME,null);
return cursor;
}
}
| [
"abhinavmaddirala@gmail.com"
] | abhinavmaddirala@gmail.com |
ee33dd231bbda4d0061a11f9944bda3ca5532ac0 | f9bc14fe84af8c43a1e2f6b66beb284a857f0d98 | /src/test/java/com/springboot/book/BookApplicationTests.java | 695f9ecd2a7b6993efaf5ca89ea510fa0aa2ae2a | [] | no_license | czj2021/springboot.io | ab024876a5f02ff20459281cafd6e04fa7df21ef | 0fe491e69eaddf67f8002d8356ce18dc8f6b615a | refs/heads/main | 2023-05-01T21:30:35.142422 | 2021-05-18T11:14:03 | 2021-05-18T11:14:03 | 367,571,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 466 | java | package com.springboot.book;
import com.springboot.book.component.SDK;
import com.springboot.book.controller.UserHandler;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class BookApplicationTests {
@Test
void contextLoads() {
}
@Test
void test(){
new SDK().SendSms("17350756083");
}
@Test
void sdk(){
new UserHandler().sdk("17350756083");
}
}
| [
"944453040@qq.com"
] | 944453040@qq.com |
5563fa05d2686b1298d2f6c6980702ddb22a5ebc | 68543a155314c5b8f72291e1fa3c5679b15973e2 | /src/main/java/il/ac/afeka/cloud/logic/PostBlogService.java | 2bb71b823cf4d8bc3e3b554298158f38b933694b | [] | no_license | Omrisha/reactive-blog | 0a3ded9e61a750ac5c19d93133689c803e83c0f2 | 10193e955b49d42cd089d88750e604a76d1f4b5a | refs/heads/main | 2023-02-20T11:46:23.511015 | 2021-01-24T12:37:17 | 2021-01-24T12:37:17 | 322,608,840 | 1 | 0 | null | 2021-01-24T07:14:30 | 2020-12-18T13:52:11 | Java | UTF-8 | Java | false | false | 795 | java | package il.ac.afeka.cloud.logic;
import il.ac.afeka.cloud.enums.FilterTypeEnum;
import il.ac.afeka.cloud.enums.SortByEnumaration;
import il.ac.afeka.cloud.layout.PostBoundary;
import java.util.List;
public interface PostBlogService {
PostBoundary create(PostBoundary value);
List<PostBoundary> getPostsAllByUser(String email, FilterTypeEnum filterType, String filterValue, SortByEnumaration sortBy, String sortOrder, int page, int size);
List<PostBoundary> getAllPostsByProduct(String productId, FilterTypeEnum filterType, String filterValue, SortByEnumaration sortBy, String sortOrder, int page, int size);
List<PostBoundary> getAllPosts(FilterTypeEnum filterType, String filterValue, SortByEnumaration sortBy, String sortOrder, int page, int size);
void delete();
}
| [
"omri@redefinemeat.com"
] | omri@redefinemeat.com |
2645e226fadc7a66db3a0c77a1eca6b64c68a138 | a840a5e110b71b728da5801f1f3e591f6128f30e | /src/main/java/com/google/security/zynamics/reil/translators/ppc/BtTranslator.java | 8c7666e9ed8f973843dd882f3cd82144ecaae1d9 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | tpltnt/binnavi | 0a25d2fde2c6029aeef4fcfec8eead5c8e51f4b4 | 598c361d618b2ca964d8eb319a686846ecc43314 | refs/heads/master | 2022-10-20T19:38:30.080808 | 2022-07-20T13:01:37 | 2022-07-20T13:01:37 | 107,143,332 | 0 | 0 | Apache-2.0 | 2023-08-20T11:22:53 | 2017-10-16T15:02:35 | Java | UTF-8 | Java | false | false | 2,006 | java | /*
Copyright 2011-2016 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.google.security.zynamics.reil.translators.ppc;
import com.google.security.zynamics.reil.ReilInstruction;
import com.google.security.zynamics.reil.translators.IInstructionTranslator;
import com.google.security.zynamics.reil.translators.ITranslationEnvironment;
import com.google.security.zynamics.reil.translators.InternalTranslationException;
import com.google.security.zynamics.reil.translators.TranslationHelpers;
import com.google.security.zynamics.zylib.disassembly.IInstruction;
import com.google.security.zynamics.zylib.disassembly.IOperandTreeNode;
import java.util.List;
public class BtTranslator implements IInstructionTranslator {
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction,
final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bt");
final IOperandTreeNode addressOperand1 =
instruction.getOperands().get(1).getRootNode().getChildren().get(0);
final IOperandTreeNode BIOperand =
instruction.getOperands().get(0).getRootNode().getChildren().get(0);
BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction,
instructions, "bt", BIOperand.getValue(), addressOperand1.getValue(), false, false, false,
false, true, false);
}
}
| [
"cblichmann@google.com"
] | cblichmann@google.com |
06a024a0b730792a6cb0ccdb25f976e4c6692508 | e6ac705f30abe769248cdcac411092784ccc6ebb | /app/src/main/java/com/arcsoft/arcfacedemo/main/MainModel.java | a769de65ddb2ff2bd558d473718715a04c4cb5d4 | [] | no_license | Mementto/FaceMovieAndroid | 361aea9f18689cf28f7c6769f29a748cc112073c | bd5effbbef2a7867e1d754e3cf702194f1a447c0 | refs/heads/master | 2022-07-13T15:30:12.056353 | 2020-04-28T10:34:05 | 2020-04-28T10:34:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 473 | java | package com.arcsoft.arcfacedemo.main;
import com.arcsoft.arcfacedemo.api.CallApi;
import com.arcsoft.arcfacedemo.utils.Data;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class MainModel {
private MainViewModel viewModel;
public MainModel(MainViewModel viewModel) {
this.viewModel = viewModel;
}
}
| [
"63023704@qq.com"
] | 63023704@qq.com |
436a4bd694b7951199d110b53ec1f0c343d4e1c2 | e75be673baeeddee986ece49ef6e1c718a8e7a5d | /submissions/blizzard/Corpus/eclipse.jdt.ui/8422.java | 6a30ed356425a296a6c72ffcc3126e6af19a7bd3 | [
"MIT"
] | permissive | zhendong2050/fse18 | edbea132be9122b57e272a20c20fae2bb949e63e | f0f016140489961c9e3c2e837577f698c2d4cf44 | refs/heads/master | 2020-12-21T11:31:53.800358 | 2018-07-23T10:10:57 | 2018-07-23T10:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 153 | java | package p;
class A<T> {
T g;
public T getG() {
return g;
}
public void setG(T f) {
this.g = f;
}
}
| [
"tim.menzies@gmail.com"
] | tim.menzies@gmail.com |
f1bd33c810e82685826ee6b3f30cc2ece395b0a6 | c5af47aa2e4a92b7ac722be807dfab13ef9cae46 | /ribbon-time-app/src/test/java/com/vvirlan/ribbontimeapp/RibbonTimeAppApplicationTests.java | 5e1e378b17295f126ce2a30e95a877e7c6e05b20 | [] | no_license | vladimirvs/spring-cloud-examples | 16689537cf0f551553d7aeda26c1b56388c6b08d | 7c40e7b9291bdbc8e176606c3b60b68a3aec65de | refs/heads/master | 2022-12-17T00:04:57.875361 | 2020-08-25T20:56:52 | 2020-08-25T20:56:52 | 290,321,456 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package com.vvirlan.ribbontimeapp;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class RibbonTimeAppApplicationTests {
@Test
void contextLoads() {
}
}
| [
"acv.number.one@gmail.com"
] | acv.number.one@gmail.com |
e07a4dca0f0232ee4edbf411800faa3b3d8787f9 | 7e428cb9d19c5447fd01ceddbbf236a0f1c8522e | /saf-core/src/main/java/cn/salesuite/saf/imagecache/RxImageLoader.java | 4664b13dd5663f9755e8671e4769cb1b5e15271c | [
"Apache-2.0"
] | permissive | weidiaoxiang/SAF | d2cc82fab5993aeb22b1f584b90010dc94b440e4 | d3689837a42a9b2b7786fcdf6dae6ee4270d553f | refs/heads/master | 2021-01-19T11:43:32.536266 | 2017-02-16T06:56:51 | 2017-02-16T06:56:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,827 | java | package cn.salesuite.saf.imagecache;
import android.app.Application;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.annotation.NonNull;
import android.widget.ImageView;
import com.safframwork.tony.common.utils.Preconditions;
import rx.Observable;
import rx.Observer;
import rx.android.schedulers.AndroidSchedulers;
import rx.observables.ConnectableObservable;
/**
* Created by Tony Shen on 15/11/13.
*/
public class RxImageLoader {
public static final String TAG = "RxImageLoader";
private Context mContext = null;
private Sources sources;
/**
* 初始化时 必须传Application,不能传activity的context和service的context
* @param context
*/
public void init(@NonNull Context context) {
if (context instanceof Application) {
mContext = context;
sources = new Sources(mContext);
} else {
throw new IllegalArgumentException("Application needs to pass");
}
}
/**
*
* @param url
* @param imageView
*/
public void displayImage(String url,ImageView imageView) {
displayImage(url,imageView,0);
}
/**
*
* @param url
* @param imageView
* @param default_img_id
*/
public void displayImage(String url, final ImageView imageView, int default_img_id) {
// 优先加载默认图片
if (default_img_id>0) {
imageView.setImageResource(default_img_id);
}
if (Preconditions.isBlank(url)) {
return;
}
ConnectableObservable<Data> connectableObservable = getObservables(url,imageView);
connectableObservable.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Data>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(Data data) {
if (DataUtils.isAvailable(data)) {
imageView.setImageBitmap(data.bitmap);
}
}
});
connectableObservable.connect();
}
/**
* get the observable that load img and set it to the given ImageView
*
* @param url the url for the img
* @return the observable to load img
*/
private ConnectableObservable<Data> getObservables(String url,ImageView imageView) {
Bitmap bitmap = getBitmapFromCache(url);
ConnectableObservable<Data> source;
if (bitmap != null) {
source = Observable.just(new Data(bitmap, url)).publish();
} else {
source = sources.getConnectableObservable(url,imageView);
}
return source;
}
/**
*
* @param url net url
* @return Bitmap
*/
private Bitmap getBitmapFromCache(String url) {
Bitmap bm = sources.memoryCacheObservable.cache(url);
if (bm != null) return bm;
if (sources.diskCacheObservable!=null) {
bm = sources.diskCacheObservable.cache(url);
}
if (bm != null) {
sources.memoryCacheObservable.putData(new Data(bm,url));
return bm;
}
return null;
}
/**
* 清空内存中的缓存
*/
public void clearMemCache() {
if (sources!=null) {
sources.memoryCacheObservable.clear();
}
}
/**
* 清空所有的缓存
*/
public void clearAllCache() {
if (sources!=null) {
sources.memoryCacheObservable.clear();
if (sources.diskCacheObservable!=null) {
sources.diskCacheObservable.clear();
}
}
}
}
| [
"fengzhizi715@126.com"
] | fengzhizi715@126.com |
3a1497a244e7ac86bf7c951423ae093141d73e72 | ba1263ca74c56e9f71e2a27ebb84ea6e3bfe0079 | /src/main/java/max/hubbard/bettershops/Versions/v1_9_R2/AnvilGUI.java | e8c381cb5f3295bd9421a5698d52717935107069 | [] | no_license | RealmOfTowny-Devs/BetterShops | 8cdb330c2d812270216ea3bb058bafeda2d7ad0b | eefc1ce76c621bbf48054773b7e61a2ed7daf873 | refs/heads/master | 2020-03-11T23:51:11.489984 | 2018-04-20T08:40:24 | 2018-04-20T08:40:24 | 130,333,645 | 0 | 0 | null | 2018-04-20T08:31:22 | 2018-04-20T08:31:22 | null | UTF-8 | Java | false | false | 10,766 | java | package max.hubbard.bettershops.Versions.v1_9_R2;
import max.hubbard.bettershops.Core;
import net.minecraft.server.v1_9_R2.*;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.HashMap;
public class AnvilGUI implements max.hubbard.bettershops.Versions.AnvilGUI {
private class AnvilContainer extends ContainerAnvil {
public AnvilContainer(EntityHuman entity) {
super(entity.inventory, entity.world, new BlockPosition(0, 0, 0), entity);
}
@Override
public boolean a(EntityHuman entityhuman) {
return true;
}
}
private class EightAnvilContainer extends ContainerAnvil {
public EightAnvilContainer(EntityHuman entity) {
super(entity.inventory, entity.world, new BlockPosition(0, 0, 0), entity);
}
@Override
public boolean a(EntityHuman entityhuman) {
return true;
}
}
public enum AnvilSlot {
INPUT_LEFT(0),
INPUT_RIGHT(1),
OUTPUT(2);
private int slot;
AnvilSlot(int slot) {
this.slot = slot;
}
public int getSlot() {
return slot;
}
public static AnvilSlot bySlot(int slot) {
for (AnvilSlot anvilSlot : values()) {
if (anvilSlot.getSlot() == slot) {
return anvilSlot;
}
}
return null;
}
}
public class AnvilClickEvent extends max.hubbard.bettershops.Versions.AnvilGUI.AnvilClickEvent {
private AnvilSlot slot;
private String name;
private boolean close = true;
private boolean destroy = true;
private ItemStack item;
private HumanEntity entity;
public AnvilClickEvent(AnvilSlot slot, String name, ItemStack it, HumanEntity ent) {
super();
this.slot = slot;
this.name = name;
this.item = it;
this.entity = ent;
}
public int getSlot() {
if (slot != null) {
return slot.getSlot();
} else {
return 0;
}
}
public ItemStack getCurrentItem() {
return item;
}
public HumanEntity getWhoClicked() {
return entity;
}
public String getName() {
return name;
}
public boolean getWillClose() {
return close;
}
public void setWillClose(boolean close) {
this.close = close;
}
public boolean getWillDestroy() {
return destroy;
}
public void setWillDestroy(boolean destroy) {
this.destroy = destroy;
}
}
public interface AnvilClickEventHandler extends max.hubbard.bettershops.Versions.AnvilGUI.AnvilClickEventHandler {
void onAnvilClick(AnvilClickEvent event);
@Override
void onAnvilClick(max.hubbard.bettershops.Versions.AnvilGUI.AnvilClickEvent ev);
}
public AnvilGUI() {
}
private Player player;
private max.hubbard.bettershops.Versions.AnvilGUI.AnvilClickEventHandler handler;
private HashMap<max.hubbard.bettershops.Versions.AnvilGUI.AnvilSlot, ItemStack> items = new HashMap<max.hubbard.bettershops.Versions.AnvilGUI.AnvilSlot, ItemStack>();
private Inventory inv;
private Listener listener;
public AnvilGUI(Player player, final AnvilClickEventHandler handler) {
this.player = player;
this.handler = handler;
this.listener = new Listener() {
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.getWhoClicked() instanceof Player) {
Player clicker = (Player) event.getWhoClicked();
if (event.getInventory().equals(inv)) {
event.setCancelled(true);
ItemStack item = event.getCurrentItem();
int slot = event.getRawSlot();
String name = "";
if (item != null) {
if (item.hasItemMeta()) {
ItemMeta meta = item.getItemMeta();
if (meta.hasDisplayName()) {
name = meta.getDisplayName();
}
}
}
AnvilClickEvent clickEvent = new AnvilClickEvent(AnvilSlot.bySlot(slot), name, event.getCurrentItem(), event.getWhoClicked());
handler.onAnvilClick(clickEvent);
if (clickEvent.getWillClose()) {
event.getWhoClicked().closeInventory();
}
if (clickEvent.getWillDestroy()) {
destroy();
}
}
}
}
@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
if (event.getPlayer() instanceof Player) {
Player player = (Player) event.getPlayer();
Inventory inv = event.getInventory();
if (inv.equals(AnvilGUI.this.inv)) {
inv.clear();
destroy();
}
}
}
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
if (event.getPlayer().equals(getPlayer())) {
destroy();
}
}
};
Bukkit.getPluginManager().registerEvents(listener, Core.getCore()); //Replace with instance of main class
}
@Override
public void doGUIThing(final Player player, final max.hubbard.bettershops.Versions.AnvilGUI.AnvilClickEventHandler handler) {
this.player = player;
this.handler = handler;
final float exp = player.getExp();
final int level = player.getLevel();
this.listener = new Listener() {
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.getWhoClicked() instanceof Player) {
Player clicker = (Player) event.getWhoClicked();
if (event.getInventory().equals(inv)) {
event.setCancelled(true);
ItemStack item = event.getCurrentItem();
int slot = event.getRawSlot();
String name = "";
if (item != null) {
if (item.hasItemMeta()) {
ItemMeta meta = item.getItemMeta();
if (meta.hasDisplayName()) {
name = meta.getDisplayName();
}
}
}
AnvilClickEvent clickEvent = new AnvilClickEvent(AnvilSlot.bySlot(slot), name, event.getCurrentItem(), event.getWhoClicked());
handler.onAnvilClick(clickEvent);
if (clickEvent.getWillClose()) {
event.getWhoClicked().closeInventory();
}
if (clickEvent.getWillDestroy()) {
destroy();
}
player.setExp(exp);
player.setLevel(level);
}
}
}
@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
if (event.getPlayer() instanceof Player) {
Player player = (Player) event.getPlayer();
Inventory inv = event.getInventory();
if (inv.equals(AnvilGUI.this.inv)) {
inv.clear();
destroy();
}
}
}
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
if (event.getPlayer().equals(getPlayer())) {
destroy();
}
}
};
Bukkit.getPluginManager().registerEvents(listener, Core.getCore()); //Replace with instance of main class
}
public Player getPlayer() {
return player;
}
@Override
public void setSlot(max.hubbard.bettershops.Versions.AnvilGUI.AnvilSlot slot, ItemStack item) {
if (items == null) {
items = new HashMap<max.hubbard.bettershops.Versions.AnvilGUI.AnvilSlot, ItemStack>();
}
if (slot != null && item != null)
items.put(slot, item);
}
public void open() {
EntityPlayer p = ((CraftPlayer) player).getHandle();
AnvilContainer container = new AnvilContainer(p);
//Set the items to the items from the inventory given
inv = container.getBukkitView().getTopInventory();
if (items == null) {
items = new HashMap<max.hubbard.bettershops.Versions.AnvilGUI.AnvilSlot, ItemStack>();
}
for (max.hubbard.bettershops.Versions.AnvilGUI.AnvilSlot slot : items.keySet()) {
inv.setItem(slot.getSlot(), items.get(slot));
}
//Counter stuff that the game uses to keep track of inventories
int c = p.nextContainerCounter();
//Send the packet
p.playerConnection.sendPacket(new PacketPlayOutOpenWindow(c, "minecraft:anvil", new ChatComponentText("Repairing")));
//Set their active container to the container
p.activeContainer = container;
//Set their active container window id to that counter stuff
p.activeContainer.windowId = c;
//Add the slot listener
p.activeContainer.addSlotListener(p);
}
public void destroy() {
player = null;
handler = null;
items = null;
if (listener != null) {
HandlerList.unregisterAll(listener);
}
listener = null;
}
}
| [
"omg@upal.se"
] | omg@upal.se |
8e458648d573fd56f59748d377162cfe2db84a1a | c789dd388febc439018b921f63edfc99460bfb1e | /BancoModels/src/com/zed/banco/atores/Funcionario.java | af11bf6a4aee4f132d6c2e4847ecd7c37faa4bbd | [] | no_license | Zeds2015/PequenoAppEmJava | 778674ef6bebf68f7f9d07157cde5c516e7005c0 | 97f319b052b25d15f1d923db9c3dcab0c9c6d93b | refs/heads/master | 2020-03-07T13:01:34.364941 | 2018-03-31T02:17:14 | 2018-03-31T02:17:14 | 127,490,830 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,734 | 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 com.zed.banco.atores;
import java.time.LocalDateTime;
import java.util.Objects;
/**
*
* @author arrud
*/
public class Funcionario {
private String nome, telefone, departamento;
private int idade;
private final String cpf;
private double salario;
private LocalDateTime dataDaContratacao;
private boolean naEmpresa;
public Funcionario(String nome, String telefone, String departamento, int idade, String cpf, double salario) {
this(nome, departamento, idade, cpf, salario);
this.telefone = telefone;
}
public Funcionario(String nome, String departamento, int idade, String cpf, double salario) {
this(nome, departamento, idade, cpf);
this.salario = salario;
}
public Funcionario(String nome, String departamento, int idade, String cpf) {
this.nome = nome;
this.departamento = departamento;
this.idade = idade;
this.cpf = cpf;
naEmpresa = true;
}
public void AumentarSalario(double valor) {
if (valor > 0) {
salario += valor;
}
}
public void ReduzirSalario(double valor) {
if (valor < salario) {
salario -= valor;
}
}
public void FazerAniversario() {
idade++;
}
public void Demitir() {
naEmpresa = false;
}
public void SetTelefone(String telefone) {
this.telefone = telefone;
}
public void SetDataDaContratacao(LocalDateTime dataDaContratacao) {
this.dataDaContratacao = dataDaContratacao;
}
public String GetNome() {
return nome;
}
public String GetTelefone() {
return telefone;
}
public String GetDepartamento() {
return departamento;
}
public int GetIdade() {
return idade;
}
public String GetCpf() {
return cpf;
}
public double GetSalario() {
return salario;
}
public LocalDateTime GetDataDaContratacao() {
return dataDaContratacao;
}
@Override
public String toString() {
return "Nome: " + nome + "\nTelefone: " + telefone + "\nDepartamento: " + departamento + "\nIdade: " + idade + "\nCpf: " + cpf + "\nSalário: " + salario + "\nData da contratacao: " + dataDaContratacao + "\nEstá na empresa: " + naEmpresa;
}
@Override
public int hashCode() {
int hash = 7;
hash = 89 * hash + Objects.hashCode(this.nome);
hash = 89 * hash + Objects.hashCode(this.telefone);
hash = 89 * hash + Objects.hashCode(this.departamento);
hash = 89 * hash + this.idade;
hash = 89 * hash + Objects.hashCode(this.cpf);
hash = 89 * hash + (int) (Double.doubleToLongBits(this.salario) ^ (Double.doubleToLongBits(this.salario) >>> 32));
hash = 89 * hash + Objects.hashCode(this.dataDaContratacao);
hash = 89 * hash + (this.naEmpresa ? 1 : 0);
return hash;
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof Funcionario))
return false;
Funcionario func = (Funcionario)obj;
return nome.equals(func.nome) && telefone.equals(func.telefone) && departamento.equals(func.departamento)
&& idade == func.idade && cpf.equals(func.cpf) && salario == func.salario && dataDaContratacao.equals(func.dataDaContratacao)
&& naEmpresa == func.naEmpresa;
}
} | [
"noreply@github.com"
] | noreply@github.com |
0e6598788251833f7fcd2f6a1c5e307144e27893 | 8e2a5d4980a2546f215af27bd6afc186c1025024 | /wlhg_user/src/main/java/com/yd/taozi/vo/UserVo.java | 86d48edd1eca9f8ca6dc6c881eb30e593edba28e | [] | no_license | 389399851/wlhg | 2b630dd06d2c7daf3df6c81119ef7a47e9339636 | a2917de38b2bb73e01095828db0778786d06ee43 | refs/heads/master | 2022-02-22T12:40:38.794900 | 2019-07-08T12:38:15 | 2019-07-08T12:38:15 | 195,809,022 | 0 | 0 | null | 2022-02-09T22:15:16 | 2019-07-08T12:37:58 | JavaScript | UTF-8 | Java | false | false | 237 | java | package com.yd.taozi.vo;
import lombok.Data;
/**
* Created by xiaotaozi on 2019/6/29.
*/
@Data
public class UserVo {
private String username;
private String password;
private String yanzhengma;
private String leiX;
}
| [
"389399851@qq.com"
] | 389399851@qq.com |
730a831509977c83f8663508f2d6e001077425d9 | bf85e3c7d34bea15942896f119871599eb36b195 | /Oclock/java/com/oclock/Cheeses.java | dfac0823335ba0e0fd9afb1ea7fa30aa84a3cad3 | [] | no_license | yangatekane/Oclock | ba0127eb79d17635be8e2a0c74af75038e84f404 | 3aa474138c6db92602f07d6a9d14fc579db80559 | refs/heads/master | 2021-01-22T04:57:28.499959 | 2013-11-28T16:30:20 | 2013-11-28T16:30:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,673 | java | /*
* Copyright (C) 2013 The Android Open Source Project
*
* 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.oclock;
public class Cheeses {
public static final String[] sCheeseStrings = {
"Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi",
"Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu", "Airag", "Airedale",
"Aisy Cendre", "Allgauer Emmentaler", "Alverca", "Ambert", "American Cheese",
"Ami du Chambertin", "Anejo Enchilado", "Anneau du Vic-Bilh", "Anthoriro", "Appenzell",
"Aragon", "Ardi Gasna", "Ardrahan", "Armenian String", "Aromes au Gene de Marc",
"Asadero", "Asiago", "Aubisque Pyrenees", "Autun", "Avaxtskyr", "Baby Swiss",
"Babybel", "Baguette Laonnaise", "Bakers", "Baladi", "Balaton", "Bandal", "Banon",
"Barry's Bay Cheddar", "Basing", "Basket Cheese", "Bath Cheese", "Bavarian Bergkase",
"Baylough", "Beaufort", "Beauvoorde", "Beenleigh Blue", "Beer Cheese", "Bel Paese",
"Bergader", "Bergere Bleue", "Berkswell", "Beyaz Peynir", "Bierkase", "Bishop Kennedy",
"Blarney", "Bleu d'Auvergne", "Bleu de Gex", "Bleu de Laqueuille",
"Bleu de Septmoncel", "Bleu Des Causses", "Blue", "Blue Castello", "Blue Rathgore",
"Blue Vein (Australian)", "Blue Vein Cheeses", "Bocconcini", "Bocconcini (Australian)",
"Boeren Leidenkaas", "Bonchester", "Bosworth", "Bougon", "Boule Du Roves",
"Boulette d'Avesnes", "Boursault", "Boursin", "Bouyssou", "Bra", "Braudostur",
"Breakfast Cheese", "Brebis du Lavort", "Brebis du Lochois", "Brebis du Puyfaucon",
"Bresse Bleu", "Brick", "Brie", "Brie de Meaux", "Brie de Melun", "Brillat-Savarin",
"Brin", "Brin d' Amour", "Brin d'Amour", "Brinza (Burduf Brinza)",
"Briquette de Brebis", "Briquette du Forez", "Broccio", "Broccio Demi-Affine",
"Brousse du Rove", "Bruder Basil", "Brusselae Kaas (Fromage de Bruxelles)", "Bryndza",
"Buchette d'Anjou", "Buffalo", "Burgos", "Butte", "Butterkase", "Button (Innes)",
"Buxton Blue", "Cabecou", "Caboc", "Cabrales", "Cachaille", "Caciocavallo", "Caciotta",
"Caerphilly", "Cairnsmore", "Calenzana", "Cambazola", "Camembert de Normandie",
"Canadian Cheddar", "Canestrato", "Cantal", "Caprice des Dieux", "Capricorn Goat",
"Capriole Banon", "Carre de l'Est", "Casciotta di Urbino", "Cashel Blue", "Castellano",
"Castelleno", "Castelmagno", "Castelo Branco", "Castigliano", "Cathelain",
"Celtic Promise", "Cendre d'Olivet", "Cerney", "Chabichou", "Chabichou du Poitou",
"Chabis de Gatine", "Chaource", "Charolais", "Chaumes", "Cheddar",
"Cheddar Clothbound", "Cheshire", "Chevres", "Chevrotin des Aravis", "Chontaleno",
"Civray", "Coeur de Camembert au Calvados", "Coeur de Chevre", "Colby", "Cold Pack",
"Comte", "Coolea", "Cooleney", "Coquetdale", "Corleggy", "Cornish Pepper",
"Cotherstone", "Cotija", "Cottage Cheese", "Cottage Cheese (Australian)",
"Cougar Gold", "Coulommiers", "Coverdale", "Crayeux de Roncq", "Cream Cheese",
"Cream Havarti", "Crema Agria", "Crema Mexicana", "Creme Fraiche", "Crescenza",
"Croghan", "Crottin de Chavignol", "Crottin du Chavignol", "Crowdie", "Crowley",
"Cuajada", "Curd", "Cure Nantais", "Curworthy", "Cwmtawe Pecorino",
"Cypress Grove Chevre", "Danablu (Danish Blue)", "Danbo", "Danish Fontina",
"Daralagjazsky", "Dauphin", "Delice des Fiouves", "Denhany Dorset Drum", "Derby",
"Dessertnyj Belyj", "Devon Blue", "Devon Garland", "Dolcelatte", "Doolin",
"Doppelrhamstufel", "Dorset Blue Vinney", "Double Gloucester", "Double Worcester",
"Dreux a la Feuille", "Dry Jack", "Duddleswell", "Dunbarra", "Dunlop", "Dunsyre Blue",
"Duroblando", "Durrus", "Dutch Mimolette (Commissiekaas)", "Edam", "Edelpilz",
"Emental Grand Cru", "Emlett", "Emmental", "Epoisses de Bourgogne", "Esbareich",
"Esrom", "Etorki", "Evansdale Farmhouse Brie", "Evora De L'Alentejo", "Exmoor Blue",
"Explorateur", "Feta", "Feta (Australian)", "Figue", "Filetta", "Fin-de-Siecle",
"Finlandia Swiss", "Finn", "Fiore Sardo", "Fleur du Maquis", "Flor de Guia",
"Flower Marie", "Folded", "Folded cheese with mint", "Fondant de Brebis",
"Fontainebleau", "Fontal", "Fontina Val d'Aosta", "Formaggio di capra", "Fougerus",
"Four Herb Gouda", "Fourme d' Ambert", "Fourme de Haute Loire", "Fourme de Montbrison",
"Fresh Jack", "Fresh Mozzarella", "Fresh Ricotta", "Fresh Truffles", "Fribourgeois",
"Friesekaas", "Friesian", "Friesla", "Frinault", "Fromage a Raclette", "Fromage Corse",
"Fromage de Montagne de Savoie", "Fromage Frais", "Fruit Cream Cheese",
"Frying Cheese", "Fynbo", "Gabriel", "Galette du Paludier", "Galette Lyonnaise",
"Galloway Goat's Milk Gems", "Gammelost", "Gaperon a l'Ail", "Garrotxa", "Gastanberra",
"Geitost", "Gippsland Blue", "Gjetost", "Gloucester", "Golden Cross", "Gorgonzola",
"Gornyaltajski", "Gospel Green", "Gouda", "Goutu", "Gowrie", "Grabetto", "Graddost",
"Grafton Village Cheddar", "Grana", "Grana Padano", "Grand Vatel",
"Grataron d' Areches", "Gratte-Paille", "Graviera", "Greuilh", "Greve",
"Gris de Lille", "Gruyere", "Gubbeen", "Guerbigny", "Halloumi",
"Halloumy (Australian)", "Haloumi-Style Cheese", "Harbourne Blue", "Havarti",
"Heidi Gruyere", "Hereford Hop", "Herrgardsost", "Herriot Farmhouse", "Herve",
"Hipi Iti", "Hubbardston Blue Cow", "Hushallsost", "Iberico", "Idaho Goatster",
"Idiazabal", "Il Boschetto al Tartufo", "Ile d'Yeu", "Isle of Mull", "Jarlsberg",
"Jermi Tortes", "Jibneh Arabieh", "Jindi Brie", "Jubilee Blue", "Juustoleipa",
"Kadchgall", "Kaseri", "Kashta", "Kefalotyri", "Kenafa", "Kernhem", "Kervella Affine",
"Kikorangi", "King Island Cape Wickham Brie", "King River Gold", "Klosterkaese",
"Knockalara", "Kugelkase", "L'Aveyronnais", "L'Ecir de l'Aubrac", "La Taupiniere",
"La Vache Qui Rit", "Laguiole", "Lairobell", "Lajta", "Lanark Blue", "Lancashire",
"Langres", "Lappi", "Laruns", "Lavistown", "Le Brin", "Le Fium Orbo", "Le Lacandou",
"Le Roule", "Leafield", "Lebbene", "Leerdammer", "Leicester", "Leyden", "Limburger",
"Lincolnshire Poacher", "Lingot Saint Bousquet d'Orb", "Liptauer", "Little Rydings",
"Livarot", "Llanboidy", "Llanglofan Farmhouse", "Loch Arthur Farmhouse",
"Loddiswell Avondale", "Longhorn", "Lou Palou", "Lou Pevre", "Lyonnais", "Maasdam",
"Macconais", "Mahoe Aged Gouda", "Mahon", "Malvern", "Mamirolle", "Manchego",
"Manouri", "Manur", "Marble Cheddar", "Marbled Cheeses", "Maredsous", "Margotin",
"Maribo", "Maroilles", "Mascares", "Mascarpone", "Mascarpone (Australian)",
"Mascarpone Torta", "Matocq", "Maytag Blue", "Meira", "Menallack Farmhouse",
"Menonita", "Meredith Blue", "Mesost", "Metton (Cancoillotte)", "Meyer Vintage Gouda",
"Mihalic Peynir", "Milleens", "Mimolette", "Mine-Gabhar", "Mini Baby Bells", "Mixte",
"Molbo", "Monastery Cheeses", "Mondseer", "Mont D'or Lyonnais", "Montasio",
"Monterey Jack", "Monterey Jack Dry", "Morbier", "Morbier Cru de Montagne",
"Mothais a la Feuille", "Mozzarella", "Mozzarella (Australian)",
"Mozzarella di Bufala", "Mozzarella Fresh, in water", "Mozzarella Rolls", "Munster",
"Murol", "Mycella", "Myzithra", "Naboulsi", "Nantais", "Neufchatel",
"Neufchatel (Australian)", "Niolo", "Nokkelost", "Northumberland", "Oaxaca",
"Olde York", "Olivet au Foin", "Olivet Bleu", "Olivet Cendre",
"Orkney Extra Mature Cheddar", "Orla", "Oschtjepka", "Ossau Fermier", "Ossau-Iraty",
"Oszczypek", "Oxford Blue", "P'tit Berrichon", "Palet de Babligny", "Paneer", "Panela",
"Pannerone", "Pant ys Gawn", "Parmesan (Parmigiano)", "Parmigiano Reggiano",
"Pas de l'Escalette", "Passendale", "Pasteurized Processed", "Pate de Fromage",
"Patefine Fort", "Pave d'Affinois", "Pave d'Auge", "Pave de Chirac", "Pave du Berry",
"Pecorino", "Pecorino in Walnut Leaves", "Pecorino Romano", "Peekskill Pyramid",
"Pelardon des Cevennes", "Pelardon des Corbieres", "Penamellera", "Penbryn",
"Pencarreg", "Perail de Brebis", "Petit Morin", "Petit Pardou", "Petit-Suisse",
"Picodon de Chevre", "Picos de Europa", "Piora", "Pithtviers au Foin",
"Plateau de Herve", "Plymouth Cheese", "Podhalanski", "Poivre d'Ane", "Polkolbin",
"Pont l'Eveque", "Port Nicholson", "Port-Salut", "Postel", "Pouligny-Saint-Pierre",
"Pourly", "Prastost", "Pressato", "Prince-Jean", "Processed Cheddar", "Provolone",
"Provolone (Australian)", "Pyengana Cheddar", "Pyramide", "Quark",
"Quark (Australian)", "Quartirolo Lombardo", "Quatre-Vents", "Quercy Petit",
"Queso Blanco", "Queso Blanco con Frutas --Pina y Mango", "Queso de Murcia",
"Queso del Montsec", "Queso del Tietar", "Queso Fresco", "Queso Fresco (Adobera)",
"Queso Iberico", "Queso Jalapeno", "Queso Majorero", "Queso Media Luna",
"Queso Para Frier", "Queso Quesadilla", "Rabacal", "Raclette", "Ragusano", "Raschera",
"Reblochon", "Red Leicester", "Regal de la Dombes", "Reggianito", "Remedou",
"Requeson", "Richelieu", "Ricotta", "Ricotta (Australian)", "Ricotta Salata", "Ridder",
"Rigotte", "Rocamadour", "Rollot", "Romano", "Romans Part Dieu", "Roncal", "Roquefort",
"Roule", "Rouleau De Beaulieu", "Royalp Tilsit", "Rubens", "Rustinu", "Saaland Pfarr",
"Saanenkaese", "Saga", "Sage Derby", "Sainte Maure", "Saint-Marcellin",
"Saint-Nectaire", "Saint-Paulin", "Salers", "Samso", "San Simon", "Sancerre",
"Sap Sago", "Sardo", "Sardo Egyptian", "Sbrinz", "Scamorza", "Schabzieger", "Schloss",
"Selles sur Cher", "Selva", "Serat", "Seriously Strong Cheddar", "Serra da Estrela",
"Sharpam", "Shelburne Cheddar", "Shropshire Blue", "Siraz", "Sirene", "Smoked Gouda",
"Somerset Brie", "Sonoma Jack", "Sottocenare al Tartufo", "Soumaintrain",
"Sourire Lozerien", "Spenwood", "Sraffordshire Organic", "St. Agur Blue Cheese",
"Stilton", "Stinking Bishop", "String", "Sussex Slipcote", "Sveciaost", "Swaledale",
"Sweet Style Swiss", "Swiss", "Syrian (Armenian String)", "Tala", "Taleggio", "Tamie",
"Tasmania Highland Chevre Log", "Taupiniere", "Teifi", "Telemea", "Testouri",
"Tete de Moine", "Tetilla", "Texas Goat Cheese", "Tibet", "Tillamook Cheddar",
"Tilsit", "Timboon Brie", "Toma", "Tomme Brulee", "Tomme d'Abondance",
"Tomme de Chevre", "Tomme de Romans", "Tomme de Savoie", "Tomme des Chouans", "Tommes",
"Torta del Casar", "Toscanello", "Touree de L'Aubier", "Tourmalet",
"Trappe (Veritable)", "Trois Cornes De Vendee", "Tronchon", "Trou du Cru", "Truffe",
"Tupi", "Turunmaa", "Tymsboro", "Tyn Grug", "Tyning", "Ubriaco", "Ulloa",
"Vacherin-Fribourgeois", "Valencay", "Vasterbottenost", "Venaco", "Vendomois",
"Vieux Corse", "Vignotte", "Vulscombe", "Waimata Farmhouse Blue",
"Washed Rind Cheese (Australian)", "Waterloo", "Weichkaese", "Wellington",
"Wensleydale", "White Stilton", "Whitestone Farmhouse", "Wigmore", "Woodside Cabecou",
"Xanadu", "Xynotyro", "Yarg Cornish", "Yarra Valley Pyramid", "Yorkshire Blue",
"Zamorano", "Zanetti Grana Padano", "Zanetti Parmigiano Reggiano"
};
}
| [
"yangat@double-eye.com"
] | yangat@double-eye.com |
d1c036d4aea1d0fa1e064d0ae1cb4717813f1d45 | c66f950fb75ccc92b8add98af6667728174c50dc | /ExBuilder/ExBuilder2/src/exbuilder2/PizzaBuilder.java | 1d9e72da9e15471e42da5d91bd21b8b452a8f8fe | [] | no_license | aparcerozas/Extras | 28eb53eb5c60c95ae2a95516c4e9df7db433b626 | a0395caf8d1e016c80535310c68dec6da2cbf13f | refs/heads/master | 2020-04-05T03:52:49.069995 | 2019-04-10T09:21:52 | 2019-04-10T09:21:52 | 156,530,585 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,592 | 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 exbuilder2;
public class PizzaBuilder {
private int grHarina;
private int mlAgua;
private int grSal = 0;
private int mlAceite = 0;
private String tipoAceite = "";
private int grTomate = 0;
private int grQueso = 0;
private String tipoQueso = "";
private int grPinha = 0;
public PizzaBuilder(final int grHarina, final int mlAgua) {
this.grHarina = grHarina;
this.mlAgua = mlAgua;
}
public PizzaBuilder setGrSal(int grSal) {
this.grSal = grSal;
return this;
}
public PizzaBuilder setMlAceite(int mlAceite) {
this.mlAceite = mlAceite;
return this;
}
public PizzaBuilder setTipoAceite(String tipoAceite) {
this.tipoAceite = tipoAceite;
return this;
}
public PizzaBuilder setGrTomate(int grTomate) {
this.grTomate = grTomate;
return this;
}
public PizzaBuilder setGrQueso(int grQueso) {
this.grQueso = grQueso;
return this;
}
public PizzaBuilder setTipoQueso(String tipoQueso) {
this.tipoQueso = tipoQueso;
return this;
}
public PizzaBuilder setGrPinha(int grPinha) {
this.grPinha = grPinha;
return this;
}
public Pizza createPizza() {
return new Pizza(grHarina, mlAgua, grSal, mlAceite, tipoAceite, grTomate, grQueso, tipoQueso, grPinha);
}
}
| [
"aparcerozas@victoria11.danielcastelao.org"
] | aparcerozas@victoria11.danielcastelao.org |
027bbe11fc00665afb4cb2817fd167c088819838 | 0f499ceae729734a0f5a17e4e1e26e393e6ede19 | /ITvKurzeSources/webinar 25/src/sk/itvkurze/webinar25/_03_zoliky_neohranicene/CitacOsob.java | c4499e0850555caf81ef96fc06e2368900e8c665 | [] | no_license | marekpatarak/personal-workspace | 5dbd7f50463c33cc151f8c8a9536949e72c7db58 | 95374b842e925531ea20bd7ff3fb342d9561e0fb | refs/heads/master | 2022-12-23T09:12:02.659254 | 2019-10-02T14:09:29 | 2019-10-02T14:09:29 | 149,508,965 | 0 | 0 | null | 2022-12-16T00:40:38 | 2018-09-19T20:33:44 | Java | UTF-8 | Java | false | false | 1,945 | java | package sk.itvkurze.webinar25._03_zoliky_neohranicene;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class CitacOsob
{
private final RandomAccessFile subor;
public CitacOsob(final File subor) throws FileNotFoundException
{
this.subor = new RandomAccessFile(subor, "rw");
}
public Osoba nacitaj() throws ClassNotFoundException
{
try
{
final String nazovTriedy = subor.readUTF();
final String menoOsoby = subor.readUTF();
final int vek = subor.readInt();
// class je trieda ktora reprezentuje samotnu triedu, je genericka
// metoda forName na zaklade retazca zisti o aku triedu sa jedna a vytvori jej
// instanciu, v case kompilacie nie sme schopni zistit presny typ tejto triedy
// a preto specifikujeme neohraniceny zolik, co moze predstavovat akykolvek typ
// mohli by sme to zapisat aj nasledovne, ale nema to ziadne logicke opodstatnene
// final Class<? extends Object> triedaOsoba = Class.forName(nazovTriedy);
// aky je roziel medzi <?> a <Object> ???
// <?> - specifikuje akykolvek typ triedy, ktory je ziatial neznamy
// <Object> specifikuje presny konkretny jeden typ, ktory je java.lang.Object
final Class<?> triedaOsoba = Class.forName(nazovTriedy);
final Constructor<?> konstruktor = triedaOsoba.getConstructor(String.class, int.class);
return (Osoba) konstruktor.newInstance(menoOsoby, vek);
}
catch (IOException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e)
{
return null;
}
}
public void nacitaj(List<? super Osoba> osoby) throws ClassNotFoundException
{
Osoba osoba;
while ((osoba = nacitaj()) != null)
{
osoby.add(osoba);
}
}
}
| [
"m.patarak@gmail.com"
] | m.patarak@gmail.com |
7dfff35f55c875d2099c52537904b3e0f8a18c5c | 1fb4e25af2e9ede6d4e61548cdbf1d0ca40dc0bf | /ask-sdk-runtime/src/com/amazon/ask/request/dispatcher/GenericRequestDispatcher.java | ebda60dc3fa85f49c6630b61ce8c0fabe0a09734 | [
"Apache-2.0"
] | permissive | cnxtech/alexa-skills-kit-sdk-for-java | 538971142d27636b38724e4924d28b47187b7518 | a6e9b84aee9fd26ca74d54cf389f02306ebc3f3c | refs/heads/2.0.x | 2022-11-20T11:00:10.450069 | 2019-06-05T22:58:27 | 2019-06-05T22:58:27 | 190,676,807 | 0 | 0 | Apache-2.0 | 2022-11-16T12:33:32 | 2019-06-07T02:16:03 | Java | UTF-8 | Java | false | false | 1,263 | java | /*
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License.
*/
package com.amazon.ask.request.dispatcher;
import com.amazon.ask.exception.AskSdkException;
/**
* Receives a request, dispatches to customer handling code, and returns a response
*
* @param <Input> handler input type
* @param <Output> handler output type
*/
public interface GenericRequestDispatcher<Input, Output> {
/**
* Dispatches an incoming request to the appropriate handling code and returns any output
*
* @param input input to the dispatcher
* @return output optionally containing a response
* @throws AskSdkException when an exception occurs during request processing
*/
Output dispatch(Input input) throws AskSdkException;
}
| [
"breedloj@amazon.com"
] | breedloj@amazon.com |
0cdfe7bd8a975b1508884dda26da7131d95924fe | 22dff8011eb9ed6ed8b673fde218e1e32e4d8467 | /lernejo-tester/src/main/java/fr/lernejo/tester/internal/TestClassDiscoverer.java | fe9c918ce966bb5510d84e4293b3087f0e4fc78f | [] | no_license | PiccaBro/maven_training_2 | fea78a692cffc0df2b638da033ebdb600ea9e406 | 08bc201de27b259937840adfee9532f7e6727c88 | refs/heads/main | 2023-06-02T16:32:06.569463 | 2021-06-17T11:15:01 | 2021-06-17T11:15:01 | 377,753,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package fr.lernejo.tester.internal;
import java.util.List;
public class TestClassDiscoverer {
private final String packageName;
public TestClassDiscoverer(String packageName){
this.packageName = packageName;
}
}
| [
"marius.mihai@epita.fr"
] | marius.mihai@epita.fr |
8fa9dc4356fac2b1280751dc44a03bbeb68ea75c | 1d4a1850d1947a3ddecea07e19377e5fdac8e12c | /src/main/java/com/hh/test/controller/MonitorController2.java | 51a45f481b90a85b7928e9e437e1af490de5f2a9 | [] | no_license | h10770303/monitor | db9aae8f84e17d7cbb6483b242ac005a5f5d5831 | 47b2d378d63906a2175425e6caa43bfaca4bce85 | refs/heads/master | 2020-04-07T16:12:01.588446 | 2019-04-12T02:46:25 | 2019-04-12T02:46:25 | 158,519,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,618 | java | package com.hh.test.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.hh.test.manager.MonitorManager;
import com.hh.test.pojo.AssetByTime;
import com.hh.test.util.JsonResult;
@Controller
public class MonitorController2 {
Logger log = LoggerFactory.getLogger(getClass());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@Resource
private MonitorManager monitorManager;
/**
* 获取各资源数据
*/
@ResponseBody
@RequestMapping("/getAssetBytime")
public String getAssetBytime(HttpServletRequest req, HttpServletResponse resp) {
log.info("进入getAssetBytime");
Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, 1);
String[] types = { "clue", "topic", "title" };
String site = "";
String beginTime = sdf.format(date);
String endTime = sdf.format(cal.getTime());
System.out.println("beginTime=" + beginTime);
System.out.println("endTime=" + endTime);
for (int i = 0; i < types.length; i++) {
monitorManager.insertClueBytime(types[i], site, beginTime, endTime);
if (("clue").equals(types[i])) {
site = "报片";
monitorManager.insertClueBytime(types[i], site, beginTime, endTime);
}
}
return "index";
}
/**
* 查询asset数据在页面上显示
*
* @param req
* @param resp
* @return
*/
@RequestMapping("/getMonitor")
public String getMonitor(HttpServletRequest req, HttpServletResponse resp) {
log.info("进入getMonitor");
return "monitor/node";
}
/**
* 获取线索、选题、报道的数量
*
* @param req
* @param resp
* @return
*/
@ResponseBody
@RequestMapping("/getAsset")
public JsonResult<Map<String, Integer>> getAsset(HttpServletRequest req, HttpServletResponse resp) {
log.info("进入getAsset");
List<AssetByTime> assetByTimes = new ArrayList<AssetByTime>();
Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, 1);
String beginTime = sdf.format(date);
String endTime = sdf.format(cal.getTime());
System.out.println("beginTime=" + beginTime);
System.out.println("endTime=" + endTime);
assetByTimes = monitorManager.searchAsset(null, beginTime, endTime);
int clue = 0, topic = 0, title = 0;
Map<String, Integer> map =new HashMap<>();
for (AssetByTime assetByTime : assetByTimes) {
if (assetByTime.getType().equals("clue")) {
clue+=assetByTime.getNumber();
map.put("clue", clue);
} else if (assetByTime.getType().equals("topic")) {
topic+=assetByTime.getNumber();
map.put("topic", topic);
} else if (assetByTime.getType().equals("title")) {
title+=assetByTime.getNumber();
map.put("title", title);
}
}
log.info("获取的数据:" + map);
return new JsonResult<Map<String,Integer>>(map).success();
}
/**
* 获取各线索具体数据:全媒报片、区县台、cptn、美联社等。
* @param req
* @param resp
* @return
*/
@ResponseBody
@RequestMapping("/getAssetList")
public JsonResult<Map<String, Integer>> getAssetList(HttpServletRequest req, HttpServletResponse resp) {
log.info("进入getAssetList");
List<AssetByTime> assetByTimes = new ArrayList<AssetByTime>();
List<String> key=new ArrayList<String>();
Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, 1);
String beginTime = sdf.format(date);
String endTime = sdf.format(cal.getTime());
System.out.println("beginTime=" + beginTime);
System.out.println("endTime=" + endTime);
assetByTimes = monitorManager.searchAsset(null, beginTime, endTime);
Map<String, Integer> map =new HashMap<>();
for (AssetByTime assetByTime : assetByTimes) {
if (assetByTime.getType().equals("clue")) {
map.put(assetByTime.getName(),assetByTime.getNumber());
key.add(assetByTime.getName());
}
}
System.out.println(map);
return new JsonResult<Map<String,Integer>>(map).success();
}
/**
* 获取报道数量:电视报道数量、数字报道数量、送看看数量、
* @param req
* @param resp
* @return
*/
@ResponseBody
@RequestMapping("/getTitleList")
public JsonResult<Map<String, Integer>> getTitleList(HttpServletRequest req, HttpServletResponse resp) {
log.info("进入getAssetList");
List<AssetByTime> assetByTimes = new ArrayList<AssetByTime>();
Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, 1);
String beginTime = sdf.format(date);
String endTime = sdf.format(cal.getTime());
System.out.println("beginTime=" + beginTime);
System.out.println("endTime=" + endTime);
assetByTimes = monitorManager.searchAsset(null, beginTime, endTime);
Map<String, Integer> map =new HashMap<>();
for (AssetByTime assetByTime : assetByTimes) {
if (assetByTime.getType().equals("title")) {
map.put(assetByTime.getName(),assetByTime.getNumber());
}
}
System.out.println(map);
return new JsonResult<Map<String,Integer>>(map).success();
}
}
| [
"hu_mingwei@smg.cn"
] | hu_mingwei@smg.cn |
1e63bdbe753b8fac174f4995c6efe843fb0b7cfc | 424bf7c7da4bd511b590579d4813726ae138dc8a | /JDBC/ResultSetTypeDemo1.java | 51178481169129309f12d9111657a505c4fb0bf7 | [] | no_license | PhoeniX-d/Java | 1b37e682bad84f5ce8b8b85899033e0b4154c70d | ec5a002437207b57ec72ee7c63905011eb9ef2a5 | refs/heads/master | 2021-11-23T10:54:18.443505 | 2021-11-06T05:08:32 | 2021-11-06T05:08:32 | 238,947,856 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,718 | java | import java.sql.*;
public class ResultSetTypeDemo1 {
public static void main(String[] args) throws Exception {
java.util.Properties p = new java.util.Properties();
try {
java.io.FileInputStream fis = new java.io.FileInputStream(".\\..\\..\\db.properties");
p.load(fis);
} catch (Exception e) {
e.printStackTrace();
}
String jdbc_url = p.getProperty("OracleURL");
String user = p.getProperty("OracleUser");
String pwd = p.getProperty("OraclePwd");
try (Connection con = DriverManager.getConnection(jdbc_url, user, pwd)) {
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
String sqlQuery = "select * from employee";
boolean flag = false;
ResultSet rs = st.executeQuery(sqlQuery);
System.out.println("Forward Direction:");
System.out.println("EID\tENAME\tECITY\tSAL");
System.out.println("--------------------------------------");
while (rs.next()) {
flag = true;
System.out.println(rs.getInt(1) + "\t" + rs.getString(2) + "\t" + rs.getString(3) + "\t" + rs.getFloat(4));
}
if (flag == false) {
System.out.println("No Records found");
return;
}
//rs.afterLast(); // Directly goes to After Last Record
System.out.println("\nBackward Direction:");
System.out.println("EID\tENAME\tECITY\tSAL");
System.out.println("--------------------------------------");
while (rs.previous()) {
flag = true;
System.out.println(rs.getInt(1) + "\t" + rs.getString(2) + "\t" + rs.getString(3) + "\t" + rs.getFloat(4));
}
if (flag == false) {
System.out.println("No Records found");
return;
}
}
}
}
| [
"prnv24choudhary@gmail.com"
] | prnv24choudhary@gmail.com |
626a503154f6dd64f839c7bff2ca551e9c2ef7fe | ce4a9084474a7c5f9016b0fb1c5d61dccd6eb0a7 | /week06/geekbang-lessons/projects/stage-1/middleware-frameworks/my-commons/src/main/java/org/geektimes/commons/util/PriorityComparator.java | f4bbbc18224463af7a79355b4e72c81c6a19cc30 | [
"Apache-2.0"
] | permissive | Zacharyye/xiaomage-homework | 752ad2398836cb9223fa315745119383336e3c1d | dc0be41e2a9ce97d27a02d7b68a5848c4efb5ece | refs/heads/main | 2023-08-07T17:32:22.336884 | 2021-09-21T02:59:21 | 2021-09-21T02:59:21 | 383,458,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,273 | 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.geektimes.commons.util;
import javax.annotation.Priority;
import java.util.Comparator;
import java.util.Objects;
import static org.geektimes.commons.util.AnnotationUtils.findAnnotation;
/**
* The {@link Comparator} for the annotation {@link Priority}
* <p>
* The less value of {@link Priority}, the more priority
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @see Priority
* @since 1.0.0
*/
public class PriorityComparator implements Comparator<Object> {
private static final Class<Priority> PRIORITY_CLASS = Priority.class;
/**
* Singleton instance of {@link PriorityComparator}
*/
public static final PriorityComparator INSTANCE = new PriorityComparator();
@Override
public int compare(Object o1, Object o2) {
return compare(o1.getClass(), o2.getClass());
}
public static int compare(Class<?> type1, Class<?> type2) {
if (Objects.equals(type1, type2)) {
return 0;
}
Priority priority1 = findAnnotation(type1, PRIORITY_CLASS);
Priority priority2 = findAnnotation(type2, PRIORITY_CLASS);
if (priority1 != null && priority2 != null) {
return Integer.compare(priority1.value(), priority2.value());
} else if (priority1 != null && priority2 == null) {
return -1;
} else if (priority1 == null && priority2 != null) {
return 1;
}
// else
return 0;
}
}
| [
"zhouyin1994@hotmail.com"
] | zhouyin1994@hotmail.com |
d3bea1b27f2c0b8083b6e90cacf000b042880db9 | 0abb9ddc0230a92fafaf416aa35233281032fe24 | /mybiblestudyservice/src/main/java/com/mybiblestudywebapp/security/CorsConfig.java | ae9ed52df0e35a33aecd453317df39b96d1a2f2b | [] | no_license | mikeyjay39/mybiblestudywebapp | af9ee4eeae713b106190d169475caa0e07995f24 | 032d7bb8baf061c113e37edd3ef1a960da36e175 | refs/heads/master | 2022-10-04T05:48:34.244723 | 2020-04-15T00:16:33 | 2020-04-15T00:16:33 | 212,696,370 | 0 | 0 | null | 2022-09-01T23:23:20 | 2019-10-03T22:58:14 | Java | UTF-8 | Java | false | false | 767 | java | package com.mybiblestudywebapp.security;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* Created by Michael Jeszenka.
* <a href="mailto:michael@jeszenka.com">michael@jeszenka.com</a>
* 10/26/19
*/
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry
.addMapping("/**")
.allowedOrigins("http://localhost:8000", "http://localhost:63342")
.allowedMethods("*")
.allowedHeaders("*")
.allowCredentials(true);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
8b5ce0d7953e66018f53b14bdb91cd049b134a07 | 4ed7e16520ef2cfec958ff8f26d83270cbfb4059 | /GaiaDemo/GaiaDemo.Android/obj/Debug/90/android/src/mono/MonoPackageManager_Resources.java | 56b88d6c89b3e7fa9b6fbc8b219512c499a6f8c7 | [] | no_license | moduware/Gaia---Xamarin.Form | 648110d689adbcef7957b2b7e3e4bd5f9d2f001b | 1b6a5ee270bbec6e3df0e76b9909824cb7819903 | refs/heads/master | 2023-03-02T11:33:37.676440 | 2021-02-02T08:58:32 | 2021-02-02T08:58:32 | 335,224,118 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,318 | java | package mono;
public class MonoPackageManager_Resources {
public static String[] Assemblies = new String[]{
/* We need to ensure that "GaiaDemo.Android.dll" comes first in this list. */
"GaiaDemo.Android.dll",
"FormsViewGroup.dll",
"GaiaDemo.dll",
"Plugin.BLE.Abstractions.dll",
"Plugin.BLE.dll",
"Xamarin.Android.Arch.Core.Common.dll",
"Xamarin.Android.Arch.Core.Runtime.dll",
"Xamarin.Android.Arch.Lifecycle.Common.dll",
"Xamarin.Android.Arch.Lifecycle.LiveData.Core.dll",
"Xamarin.Android.Arch.Lifecycle.LiveData.dll",
"Xamarin.Android.Arch.Lifecycle.Runtime.dll",
"Xamarin.Android.Arch.Lifecycle.ViewModel.dll",
"Xamarin.Android.Support.Animated.Vector.Drawable.dll",
"Xamarin.Android.Support.Annotations.dll",
"Xamarin.Android.Support.AsyncLayoutInflater.dll",
"Xamarin.Android.Support.Collections.dll",
"Xamarin.Android.Support.Compat.dll",
"Xamarin.Android.Support.CoordinaterLayout.dll",
"Xamarin.Android.Support.Core.UI.dll",
"Xamarin.Android.Support.Core.Utils.dll",
"Xamarin.Android.Support.CursorAdapter.dll",
"Xamarin.Android.Support.CustomTabs.dll",
"Xamarin.Android.Support.CustomView.dll",
"Xamarin.Android.Support.Design.dll",
"Xamarin.Android.Support.DocumentFile.dll",
"Xamarin.Android.Support.DrawerLayout.dll",
"Xamarin.Android.Support.Fragment.dll",
"Xamarin.Android.Support.Interpolator.dll",
"Xamarin.Android.Support.Loader.dll",
"Xamarin.Android.Support.LocalBroadcastManager.dll",
"Xamarin.Android.Support.Media.Compat.dll",
"Xamarin.Android.Support.Print.dll",
"Xamarin.Android.Support.SlidingPaneLayout.dll",
"Xamarin.Android.Support.SwipeRefreshLayout.dll",
"Xamarin.Android.Support.Transition.dll",
"Xamarin.Android.Support.v4.dll",
"Xamarin.Android.Support.v7.AppCompat.dll",
"Xamarin.Android.Support.v7.CardView.dll",
"Xamarin.Android.Support.v7.RecyclerView.dll",
"Xamarin.Android.Support.Vector.Drawable.dll",
"Xamarin.Android.Support.VersionedParcelable.dll",
"Xamarin.Android.Support.ViewPager.dll",
"Xamarin.Essentials.dll",
"Xamarin.Forms.Core.dll",
"Xamarin.Forms.Platform.Android.dll",
"Xamarin.Forms.Platform.dll",
"Xamarin.Forms.Xaml.dll",
};
public static String[] Dependencies = new String[]{
};
public static String ApiPackageName = "Mono.Android.Platform.ApiLevel_28";
}
| [
"enelphi@gmail.com"
] | enelphi@gmail.com |
0a149964ca9f957b84e5fabfdb362ca2141af69a | 3f6eab2999f06f8dceb8cc9e0d0fe63da780e387 | /mysite04/src/main/java/com/douzone/mysite/service/UserService.java | fa01396c327eb06bac8ea06c0d4a0ef5247b41d7 | [] | no_license | Choeinhyo825/mysite | 72647e0cd432f5291df4fba44127a6498368e75f | b50fc6cb62bb198fe156589e36196fca4d8c04d8 | refs/heads/master | 2022-12-21T21:14:31.609074 | 2020-04-17T13:57:48 | 2020-04-17T13:57:48 | 239,650,536 | 0 | 0 | null | 2022-12-16T09:50:34 | 2020-02-11T01:30:43 | Java | UTF-8 | Java | false | false | 817 | java | package com.douzone.mysite.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.douzone.mysite.repository.UserRepository;
import com.douzone.mysite.vo.UserVo;
@Service
public class UserService {
@Autowired
private UserRepository userRepository;
public Boolean join(UserVo vo) {
int count = userRepository.insert(vo);
return count == 1;
}
public UserVo getUser(UserVo vo) {
return userRepository.find(vo);
}
public UserVo getUser(Long no) {
return userRepository.find(no);
}
public Boolean updateUser(UserVo vo) {
int count = userRepository.updateUser(vo);
return count == 1;
}
public boolean existUser(String email) {
return userRepository.find(email) != null;
}
}
| [
"inhyo825@gmail.com"
] | inhyo825@gmail.com |
6e07c8861c0f5f7824dca2cfafc793460ba53f26 | a0bbe01da280183561e8a42c9c9613673120636c | /DataStructuresAndAlgorithms/src/SortingAlgorithms/Array.java | b5027bde2b4ef77085c4ce7b782a6793544d146d | [] | no_license | christianjaena/java-tingsz | 8552b3f0505a9d6887e3ab721e836c78c1f7edf2 | ae154a95592dee675008107663b2baa48eede424 | refs/heads/main | 2023-05-08T22:08:26.324754 | 2021-05-24T12:22:47 | 2021-05-24T12:22:47 | 370,342,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,830 | java |
package SortingAlgorithms;
import java.util.Arrays;
public class Array {
private int[] theArray = new int[50];
private int arraySize = 10;
public void generateArray(){
for (int i = 0; i < arraySize; i++) {
theArray[i] = (int) (Math.random() * 10) + 10;
}
}
public void printArray(){
for (int i = 0; i < arraySize; i++) {
System.out.println(i + " -> " + theArray[i]);
}
}
public boolean isThereAValue(int value){
boolean foundValue = false;
for (int i = 0; i < arraySize; i++) {
if(value == theArray[i]){
foundValue = true;
System.out.println("Found in index " + i);
}
}
if(foundValue == false){
System.out.println("None");
}
return foundValue;
}
public void deleteIndex(int index){
for (int i = index; i < (arraySize - 1); i++) {
theArray[i] = theArray[i + 1];
}
arraySize--;
printArray();
}
public void insertValue(int value){
theArray[arraySize] = value;
arraySize++;
printArray();
}
public String linearSearch(int value){
boolean valueInArray = false;
String result = "";
System.out.println("Value was found in indexs: ");
for (int i = 0; i < arraySize; i++) {
if (theArray[i] == value){
valueInArray = true;
System.out.print(i + " ");
result += i + " ";
}
}
if(!valueInArray){
System.out.print("None");
System.out.println(result);
}
return result;
}
public void bubbleSort(){
for (int i = (arraySize - 1); i > 1; i--) {
for (int j = 0; j < i; j++) {
if(theArray[j] > theArray[j+1]){
swapValues(j, j+1);
}
}
}
}
public void swapValues(int indexOne, int indexTwo){
int temp = theArray[indexOne];
theArray[indexOne] = theArray[indexTwo];
theArray[indexTwo] = temp;
}
public void binarySearch(int value){
int lowIndex = 0;
int highIndex = arraySize - 1;
while(lowIndex <= highIndex){
int middleIndex = (lowIndex + highIndex) / 2;
if(theArray[middleIndex] < value) lowIndex = middleIndex + 1;
else if (theArray[middleIndex] > value) highIndex = middleIndex - 1;
else {
System.out.print("\nFound Match " + value + " at index " + middleIndex);
lowIndex = highIndex + 1;
}
}
}
public void selectionSort(){
for (int i = 0; i < arraySize; i++) {
int minimum = i;
for (int j = i; j < arraySize; j++) {
if(theArray[minimum] > theArray[j])
minimum = j;
}
swapValues(i, minimum);
}
}
public void insertionSort() {
for (int i = 1; i < arraySize; i++) {
int j = i;
int toInsert = theArray[i];
while((j > 0) && (theArray[j - 1]) > toInsert) {
theArray[j] = theArray[j-1];
j--;
}
theArray[j] = toInsert;
}
}
public static void main(String[] args) {
Array array = new Array();
array.generateArray();
array.printArray();
array.insertionSort();
System.out.println();
array.printArray();
}
}
| [
"christian.jaena@msugensan.edu.ph"
] | christian.jaena@msugensan.edu.ph |
61036486b2a8776da5f7dd2faf4f8195670d729e | aea1e4aa4371b19f9f4a5a6416b48520f3dcb7ba | /Fontes/trunk/sop/src/java/web/chequeBancario/CadastrarChequeBancarioAction.java | 081a7787d0ec0a6220ef97b0d27c391f71d1e57e | [] | no_license | fabricioroot/sistemaodontologiapopular | 41d4acd6aee3f30e0a03a3e355909c69db01e171 | 7c0ea3a34cb78b5fd6f44ac93444097f0d5a32e3 | refs/heads/master | 2020-05-21T12:59:21.693759 | 2011-10-31T19:50:38 | 2011-10-31T19:50:38 | 32,459,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,682 | java | package web.chequeBancario;
import annotations.ChequeBancario;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collection;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import service.ChequeBancarioService;
import service.StatusChequeBancarioService;
/**
*
* @author Fabricio Reis
*/
public class CadastrarChequeBancarioAction extends org.apache.struts.action.Action {
private static final String SUCESSO = "sucesso";
private static final String FALHAFORMATARDATA = "falhaFormatarData";
private static final String OBRIGATORIOSEMBRANCO = "obrigatoriosEmBranco";
private static final String SESSAOINVALIDA = "sessaoInvalida";
/**
* This is the action called from the Struts framework.
* @param mapping The ActionMapping used to select this instance.
* @param form The optional ActionForm bean for this request.
* @param request The HTTP Request we are processing.
* @param response The HTTP Response we are processing.
* @throws java.lang.Exception
* @return
*/
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// Controle de sessao
if (request.getSession(false).getAttribute("status") == null) {
return mapping.findForward(SESSAOINVALIDA);
}
else {
if(!(Boolean)request.getSession(false).getAttribute("status")) {
return mapping.findForward(SESSAOINVALIDA);
}
}
CadastrarChequeBancarioActionForm formChequeBancario = (CadastrarChequeBancarioActionForm) form;
if ((formChequeBancario.getNomeTitular().trim().isEmpty()) || (formChequeBancario.getCpfTitular().trim().isEmpty())
|| (formChequeBancario.getBanco().equals("selected") && formChequeBancario.getOutroBanco().trim().isEmpty())
|| (formChequeBancario.getNumero().trim().isEmpty()) || (formChequeBancario.getValor().toString().trim().isEmpty())
|| (formChequeBancario.getValor() <= Double.parseDouble("0")) || (formChequeBancario.getDataParaDepositar().toString().trim().isEmpty()) ) {
return mapping.findForward(OBRIGATORIOSEMBRANCO);
}
// Captura o Collection<ChequeBancario> da sessao
Collection<ChequeBancario> chequeBancarioCollection = new ArrayList<ChequeBancario>();
if (request.getSession(false).getAttribute("chequeBancarioCollectionPagar") != null) {
chequeBancarioCollection = (Collection<ChequeBancario>)request.getSession(false).getAttribute("chequeBancarioCollectionPagar");
}
// Verifica se o registro ja nao foi incluido
if (!chequeBancarioCollection.isEmpty()) {
ChequeBancario chequeBancarioAux;
Iterator iterator = chequeBancarioCollection.iterator();
while (iterator.hasNext()) {
chequeBancarioAux = (ChequeBancario) iterator.next();
if (chequeBancarioAux.getNumero().equals(formChequeBancario.getNumero().trim()) && (chequeBancarioAux.getBanco().equals(formChequeBancario.getBanco().trim())
|| chequeBancarioAux.getBanco().equals(formChequeBancario.getOutroBanco().trim()))) {
System.out.println("Registro de cheque ja incluido na sessao! Excecao mapeada em CadastrarChequeBancarioAction.");
return mapping.findForward(SUCESSO);
}
}
}
ChequeBancario chequeBancario = new ChequeBancario();
chequeBancario.setNomeTitular(formChequeBancario.getNomeTitular().trim());
chequeBancario.setCpfTitular(formChequeBancario.getCpfTitular().trim());
chequeBancario.setRgTitular(formChequeBancario.getRgTitular().trim());
if (formChequeBancario.getBanco().equals("selected")) {
chequeBancario.setBanco(formChequeBancario.getOutroBanco().trim());
}
else {
chequeBancario.setBanco(formChequeBancario.getBanco().trim());
}
chequeBancario.setNumero(formChequeBancario.getNumero().trim());
chequeBancario.setValor(formChequeBancario.getValor());
Date dataParaDepositar = new Date();
SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yyyy");
try {
dataParaDepositar = formatador.parse(formChequeBancario.getDataParaDepositar().trim());
} catch (Exception e) {
System.out.println("Falha ao formatar a data para depositar de cheque bancario em cadastro! Exception: " + e.getMessage());
return mapping.findForward(FALHAFORMATARDATA);
}
chequeBancario.setDataParaDepositar(dataParaDepositar);
chequeBancario.setStatus(StatusChequeBancarioService.getStatusChequeBancarioNaoDepositado());
// Adiciona registro no Collection<ChequeBancario> criado / capturado
chequeBancarioCollection.add(chequeBancario);
// Atualiza / Coloca chequeBancarioCollection na sessao
request.getSession(false).setAttribute("chequeBancarioCollectionPagar", chequeBancarioCollection);
// Calcula o total dos cheques cadastrados e coloca o valor no request
request.getSession(false).setAttribute("totalCheques", ChequeBancarioService.calcularTotal(chequeBancarioCollection));
return mapping.findForward(SUCESSO);
}
} | [
"fabricioroot@918ea5c6-aa61-ff9e-963d-5679c44c1d85"
] | fabricioroot@918ea5c6-aa61-ff9e-963d-5679c44c1d85 |
2bc19f551540e637b29d10e65edf8b69d87ecc5f | 9796ea48d0841f86b6319635dacb8393f74d5d42 | /java-tftp/src/main/java/com/example/go/RunTests.java | 824aea553c5fc4910ecd7bbdde50c94c8c759952 | [] | no_license | dxh8808/AndroidDemo | 4779087cd9e5cdc30f881eaa7ce660c76c745325 | bb7ffb4229097e01d6b50b0427f9b2d0dfa2721a | refs/heads/master | 2021-12-23T21:56:27.283504 | 2017-11-25T14:39:39 | 2017-11-25T14:39:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,107 | java | package com.example.go;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class RunTests {
public static void main(String[] args) throws Exception {
int tests = 0;
int passed = 0;
Class testClass =Sample.class;
Constructor constructor = testClass.getConstructor();
Object o = constructor.newInstance();
Method[] methods = testClass.getDeclaredMethods();
for (Method m : methods) {
if (m.isAnnotationPresent(Test.class)) {
tests++;
try {
m.invoke(o);
passed++;
} catch (InvocationTargetException wrappedExc) {
Throwable exc = wrappedExc.getCause();
System.out.println(m + " failed: " + exc);
} catch (Exception exc) {
System.out.println("INVALID @Test: " + m);
}
}
}
System.out.printf("Passed: %d, Failed: %d%n", passed, tests - passed);
}
} | [
"425137849@qq.com"
] | 425137849@qq.com |
330db6f744a973b2d786bf33afb51d04bc7279d8 | 67de5c098151deb6b007212e9859d0d7173488b2 | /src/main/java/com/cfsummit/hackathon/model/Org.java | 9a937a2de6fcded7e35b17203330398522464eba | [] | no_license | cfsummitbuildpackteam/cf-data-api | 24dbe24e76d2cb62fe119cb7e66963efc29312d9 | 32df50bae0ca8d8f81e1e126b4f8fd09ea45461b | refs/heads/master | 2020-06-27T07:04:31.395258 | 2017-06-14T18:16:20 | 2017-06-14T18:16:20 | 94,246,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package com.cfsummit.hackathon.model;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* Created by michaltokarz on 13/06/2017.
*/
@Data
public class Org {
String id;
String name;
List<String> orgManagers = new ArrayList<>();
public void addManager(String manager) {
orgManagers.add(manager);
}
}
| [
"cfsummitsa@gmail.com"
] | cfsummitsa@gmail.com |
a3f03c317ce409b1593564736e387793aa127052 | a55bcaedf77ba3d120360fd4d11056f0fe14b06e | /src/main/java/ru/levelup/qa/at/java/generics/PairApp.java | 5a3731bf8349b81016627eda51b41088402d2ef4 | [] | no_license | khda91/levelup-qa-test-auto-autumn-2020 | 1f4e6d902ca3bda4f0a9fa478bbab5d94f088cad | 734d124d15532bcaab9fd7c50fed6a6a975ccf03 | refs/heads/master | 2023-01-07T11:21:58.062998 | 2020-11-05T17:38:54 | 2020-11-05T17:38:54 | 296,381,915 | 0 | 0 | null | 2020-09-17T18:55:32 | 2020-09-17T16:26:29 | null | UTF-8 | Java | false | false | 370 | java | package ru.levelup.qa.at.java.generics;
import java.math.BigDecimal;
public class PairApp {
public static void main(String[] args) {
Pair<BigDecimal, BigDecimal> coords = new Pair<>(new BigDecimal(25.33), new BigDecimal(98.46));
System.out.println("coords: " + coords);
Pair<String, String> pair = new Pair<>("Name A", "Name B");
}
}
| [
"khda91@gmail.com"
] | khda91@gmail.com |
949db4444f975c20f1da041d093b997775e78ad7 | 14d114d88d3625b5723e535c8e0879ba7ad507d6 | /src/TempExamples/ThreadEx.java | 715cfae76bf9fd8cc8b722fdb20b8815897a046a | [] | no_license | igerasimov23/JavaRushHomeWork | a07f78d81ad708b6541267816c5cf69c1f44da7b | 6c2664afb95b61fc34f9be8e4098e1126385a7d9 | refs/heads/master | 2021-01-24T08:11:50.281846 | 2017-09-07T03:06:45 | 2017-09-07T03:06:45 | 44,724,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 462 | java | package TempExamples;
public class ThreadEx {
public volatile static int COUNT = 4;
public static void main(String[] args) throws InterruptedException {
for (int i = 0; i < COUNT; i++) {
new SleepingThread();
//напишите тут ваш код
}
}
public static class SleepingThread extends Thread {
}
public void run() {
System.out.println("thread");
}
}
| [
"IGERASIM@cablevision.com"
] | IGERASIM@cablevision.com |
5bcf347fb174cf722639ae81b3c51a23fa878656 | e381a5353139716b5460a933691692ae21d7af11 | /android-pad/src/main/java/com/pactera/financialmanager/ui/model/Propertiesinfo.java | 3fd01c291719bbbaef914de3b0ea03bdc9b16b3d | [] | no_license | dysen2014/AS_Test | b432147a162ca0f696bc96c3ed7453906b48a635 | 1c29ece453b200f13519cfd6d1ac1c10f06346ae | refs/heads/master | 2020-05-21T11:49:50.689822 | 2018-12-23T08:39:53 | 2018-12-23T08:39:53 | 47,237,181 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,815 | java | package com.pactera.financialmanager.ui.model;
import java.io.Serializable;
/**
* 资产实体类
*
* @author Administrator
*/
public class Propertiesinfo implements Serializable {
private static final long serialVersionUID = 5421471583555369055L;
private String CUST_NUM; //客户数
private String PSN_CUST_NUM;//个人客户数
private String ENT_CUST_NUM;//公司客户数
private String BAL;//金融资产余额
private String PSN_BAL;//金融资产个人余额
private String ENT_BAL;//金融资产对公余额
private String CUR_DEP_BAL;//活期存款余额
private String PSN_CUR_DEPS_BAL;//个人活期存款余额
private String ENT_CUR_DEPS_BAL;//对公活期存款余额
private String RMB_FIX_DEP_BAL;//定期存款余额
private String PSN_FIX_DEPS_BAL;//个人定期期存款余额
private String ENT_FIX_DEPS_BAL;//对公定期期存款余额
private String DEPS_BAL;//存款余额
private String PSN_DEPS_BAL;//个人存款余额
private String ENT_DEPS_BAL;//对公存款余额
private String LOAN_BAL;//贷款余额
private String PSN_LOAN_BAL;//个人贷款余额
private String ENT_LOAN_BAL;//对公贷款余额
private String FINA_BAL;//理财余额
private String PSN_FINA_BAL;//个人理财余额
private String ENT_FINA_BAL;//对公理财余额
private String TJ_DATE;//统计时间
// private String PSN_FIX_DEPS_BAL;//管户个人定期存款余额
private String PSN_FIX_DEPS_LDBAL;//管户个人定期存款余额比上日
private String PSN_FIX_DEPS_LMBAL;//管户个人定期存款余额比上月
private String PSN_FIX_DEPS_LQBAL;//管户个人定期存款余额比上季
private String PSN_FIX_DEPS_LYBAL;//管户个人定期存款余额比上年
// private String ENT_FIX_DEPS_BAL;//管户对公定期存款余额
private String ENT_FIX_DEPS_LDBAL;//管户对公定期存款余额比上日
private String ENT_FIX_DEPS_LMBAL;//管户对公定期存款余额比上月
private String ENT_FIX_DEPS_LQBAL;//管户对公定期存款余额比上季
private String ENT_FIX_DEPS_LYBAL;//管户对公定期存款余额比上年
// private String PSN_CUR_DEPS_BAL;//管户个人活期存款余额
private String PSN_CUR_DEPS_LDBAL;//管户个人活期存款余额比上日
private String PSN_CUR_DEPS_LMBAL;//管户个人活期存款余额比上月
private String PSN_CUR_DEPS_LQBAL;//管户个人活期存款余额比上季
private String PSN_CUR_DEPS_LYBAL;//管户个人活期存款余额比上年
// private String ENT_CUR_DEPS_BAL;//管户对公活期存款余额
private String ENT_CUR_DEPS_LDBAL;//管户对公活期存款余额比上日
private String ENT_CUR_DEPS_LMBAL;//管户对公活期存款余额比上月
private String ENT_CUR_DEPS_LQBAL;//管户对公活期存款余额比上季
private String ENT_CUR_DEPS_LYBAL;//管户对公活期存款余额比上年
// private String PSN_FINA_BAL;//个人理财余额
private String PSN_FINA_LDBAL;//个人理财余额比上日
private String PSN_FINA_LMBAL;//个人理财余额比上月
private String PSN_FINA_LQBAL;//个人理财余额比上季
private String PSN_FINA_LYBAL;//个人理财余额比上年
// private String ENT_FINA_BAL;//对公理财余额
private String ENT_FINA_LDBAL;//对公理财余额比上日
private String ENT_FINA_LMBAL;//对公理财余额比上月
private String ENT_FINA_LQBAL;//对公理财余额比上季
private String ENT_FINA_LYBAL;//对公理财余额比上年
// private String PSN_BAL;//个人合计余额
private String PSN_LDBAL;//比上日
private String PSN_LMBAL;//比上月
private String PSN_LQBAL;//比上季
private String PSN_LYBAL;//比上年
// private String ENT_BAL;//对公合计余额
private String ENT_LDBAL;//比上日
private String ENT_LMBAL;//比上月
private String ENT_LQBAL;//比上季
private String ENT_LYBAL;//比上年
// private String BAL;//总计
private String LDBAL;//比上日
private String LMBAL;//比上月
private String LQBAL;//比上季
private String LYBAL;//比上年
// private String PSN_LOAN_BAL;//管户个人贷款余额
private String PSN_LOAN_LDBAL;//管户个人贷款余额比上日
private String PSN_LOAN_LMBAL;//管户个人贷款余额比上月
private String PSN_LOAN_LQBAL;//管户个人贷款余额比上季
private String PSN_LOAN_LYBAL;//管户个人贷款余额比上年
// private String ENT_LOAN_BAL;//管户对公贷款余额
private String ENT_LOAN_LDBAL;//管户对公贷款余额比上日
private String ENT_LOAN_LMBAL;//管户对公贷款余额比上月
private String ENT_LOAN_LQBAL;//管户对公贷款余额比上季
private String ENT_LOAN_LYBAL;//管户对公贷款余额比上年
// private String LOAN_BAL;//贷款余额
private String LOAN_LDBAL;//贷款余额比上日
private String LOAN_LMBAL;//贷款余额比上月
private String LOAN_LQBAL;//贷款余额比上季
private String LOAN_LYBAL;//贷款余额比上年
public String getCUST_NUM() {
return CUST_NUM;
}
public void setCUST_NUM(String cUST_NUM) {
CUST_NUM = cUST_NUM;
}
public String getPSN_FIX_DEPS_LDBAL() {
return PSN_FIX_DEPS_LDBAL;
}
public String getPSN_LOAN_LDBAL() {
return PSN_LOAN_LDBAL;
}
public void setPSN_LOAN_LDBAL(String PSN_LOAN_LDBAL) {
this.PSN_LOAN_LDBAL = PSN_LOAN_LDBAL;
}
public String getPSN_LOAN_LMBAL() {
return PSN_LOAN_LMBAL;
}
public void setPSN_LOAN_LMBAL(String PSN_LOAN_LMBAL) {
this.PSN_LOAN_LMBAL = PSN_LOAN_LMBAL;
}
public String getPSN_LOAN_LQBAL() {
return PSN_LOAN_LQBAL;
}
public void setPSN_LOAN_LQBAL(String PSN_LOAN_LQBAL) {
this.PSN_LOAN_LQBAL = PSN_LOAN_LQBAL;
}
public String getPSN_LOAN_LYBAL() {
return PSN_LOAN_LYBAL;
}
public void setPSN_LOAN_LYBAL(String PSN_LOAN_LYBAL) {
this.PSN_LOAN_LYBAL = PSN_LOAN_LYBAL;
}
public String getENT_LOAN_LDBAL() {
return ENT_LOAN_LDBAL;
}
public void setENT_LOAN_LDBAL(String ENT_LOAN_LDBAL) {
this.ENT_LOAN_LDBAL = ENT_LOAN_LDBAL;
}
public String getENT_LOAN_LMBAL() {
return ENT_LOAN_LMBAL;
}
public void setENT_LOAN_LMBAL(String ENT_LOAN_LMBAL) {
this.ENT_LOAN_LMBAL = ENT_LOAN_LMBAL;
}
public String getENT_LOAN_LQBAL() {
return ENT_LOAN_LQBAL;
}
public void setENT_LOAN_LQBAL(String ENT_LOAN_LQBAL) {
this.ENT_LOAN_LQBAL = ENT_LOAN_LQBAL;
}
public String getENT_LOAN_LYBAL() {
return ENT_LOAN_LYBAL;
}
public void setENT_LOAN_LYBAL(String ENT_LOAN_LYBAL) {
this.ENT_LOAN_LYBAL = ENT_LOAN_LYBAL;
}
public String getLOAN_LDBAL() {
return LOAN_LDBAL;
}
public void setLOAN_LDBAL(String LOAN_LDBAL) {
this.LOAN_LDBAL = LOAN_LDBAL;
}
public String getLOAN_LMBAL() {
return LOAN_LMBAL;
}
public void setLOAN_LMBAL(String LOAN_LMBAL) {
this.LOAN_LMBAL = LOAN_LMBAL;
}
public String getLOAN_LQBAL() {
return LOAN_LQBAL;
}
public void setLOAN_LQBAL(String LOAN_LQBAL) {
this.LOAN_LQBAL = LOAN_LQBAL;
}
public String getLOAN_LYBAL() {
return LOAN_LYBAL;
}
public void setLOAN_LYBAL(String LOAN_LYBAL) {
this.LOAN_LYBAL = LOAN_LYBAL;
}
public void setPSN_FIX_DEPS_LDBAL(String PSN_FIX_DEPS_LDBAL) {
this.PSN_FIX_DEPS_LDBAL = PSN_FIX_DEPS_LDBAL;
}
public String getPSN_FIX_DEPS_LMBAL() {
return PSN_FIX_DEPS_LMBAL;
}
public void setPSN_FIX_DEPS_LMBAL(String PSN_FIX_DEPS_LMBAL) {
this.PSN_FIX_DEPS_LMBAL = PSN_FIX_DEPS_LMBAL;
}
public String getPSN_FIX_DEPS_LQBAL() {
return PSN_FIX_DEPS_LQBAL;
}
public void setPSN_FIX_DEPS_LQBAL(String PSN_FIX_DEPS_LQBAL) {
this.PSN_FIX_DEPS_LQBAL = PSN_FIX_DEPS_LQBAL;
}
public String getPSN_FIX_DEPS_LYBAL() {
return PSN_FIX_DEPS_LYBAL;
}
public void setPSN_FIX_DEPS_LYBAL(String PSN_FIX_DEPS_LYBAL) {
this.PSN_FIX_DEPS_LYBAL = PSN_FIX_DEPS_LYBAL;
}
public String getENT_FIX_DEPS_LDBAL() {
return ENT_FIX_DEPS_LDBAL;
}
public void setENT_FIX_DEPS_LDBAL(String ENT_FIX_DEPS_LDBAL) {
this.ENT_FIX_DEPS_LDBAL = ENT_FIX_DEPS_LDBAL;
}
public String getENT_FIX_DEPS_LMBAL() {
return ENT_FIX_DEPS_LMBAL;
}
public void setENT_FIX_DEPS_LMBAL(String ENT_FIX_DEPS_LMBAL) {
this.ENT_FIX_DEPS_LMBAL = ENT_FIX_DEPS_LMBAL;
}
public String getENT_FIX_DEPS_LQBAL() {
return ENT_FIX_DEPS_LQBAL;
}
public void setENT_FIX_DEPS_LQBAL(String ENT_FIX_DEPS_LQBAL) {
this.ENT_FIX_DEPS_LQBAL = ENT_FIX_DEPS_LQBAL;
}
public String getENT_FIX_DEPS_LYBAL() {
return ENT_FIX_DEPS_LYBAL;
}
public void setENT_FIX_DEPS_LYBAL(String ENT_FIX_DEPS_LYBAL) {
this.ENT_FIX_DEPS_LYBAL = ENT_FIX_DEPS_LYBAL;
}
public String getPSN_CUR_DEPS_LDBAL() {
return PSN_CUR_DEPS_LDBAL;
}
public void setPSN_CUR_DEPS_LDBAL(String PSN_CUR_DEPS_LDBAL) {
this.PSN_CUR_DEPS_LDBAL = PSN_CUR_DEPS_LDBAL;
}
public String getPSN_CUR_DEPS_LMBAL() {
return PSN_CUR_DEPS_LMBAL;
}
public void setPSN_CUR_DEPS_LMBAL(String PSN_CUR_DEPS_LMBAL) {
this.PSN_CUR_DEPS_LMBAL = PSN_CUR_DEPS_LMBAL;
}
public String getPSN_CUR_DEPS_LQBAL() {
return PSN_CUR_DEPS_LQBAL;
}
public void setPSN_CUR_DEPS_LQBAL(String PSN_CUR_DEPS_LQBAL) {
this.PSN_CUR_DEPS_LQBAL = PSN_CUR_DEPS_LQBAL;
}
public String getPSN_CUR_DEPS_LYBAL() {
return PSN_CUR_DEPS_LYBAL;
}
public void setPSN_CUR_DEPS_LYBAL(String PSN_CUR_DEPS_LYBAL) {
this.PSN_CUR_DEPS_LYBAL = PSN_CUR_DEPS_LYBAL;
}
public String getENT_CUR_DEPS_LDBAL() {
return ENT_CUR_DEPS_LDBAL;
}
public void setENT_CUR_DEPS_LDBAL(String ENT_CUR_DEPS_LDBAL) {
this.ENT_CUR_DEPS_LDBAL = ENT_CUR_DEPS_LDBAL;
}
public String getENT_CUR_DEPS_LMBAL() {
return ENT_CUR_DEPS_LMBAL;
}
public void setENT_CUR_DEPS_LMBAL(String ENT_CUR_DEPS_LMBAL) {
this.ENT_CUR_DEPS_LMBAL = ENT_CUR_DEPS_LMBAL;
}
public String getENT_CUR_DEPS_LQBAL() {
return ENT_CUR_DEPS_LQBAL;
}
public void setENT_CUR_DEPS_LQBAL(String ENT_CUR_DEPS_LQBAL) {
this.ENT_CUR_DEPS_LQBAL = ENT_CUR_DEPS_LQBAL;
}
public String getENT_CUR_DEPS_LYBAL() {
return ENT_CUR_DEPS_LYBAL;
}
public void setENT_CUR_DEPS_LYBAL(String ENT_CUR_DEPS_LYBAL) {
this.ENT_CUR_DEPS_LYBAL = ENT_CUR_DEPS_LYBAL;
}
public String getPSN_FINA_LDBAL() {
return PSN_FINA_LDBAL;
}
public void setPSN_FINA_LDBAL(String PSN_FINA_LDBAL) {
this.PSN_FINA_LDBAL = PSN_FINA_LDBAL;
}
public String getPSN_FINA_LMBAL() {
return PSN_FINA_LMBAL;
}
public void setPSN_FINA_LMBAL(String PSN_FINA_LMBAL) {
this.PSN_FINA_LMBAL = PSN_FINA_LMBAL;
}
public String getPSN_FINA_LQBAL() {
return PSN_FINA_LQBAL;
}
public void setPSN_FINA_LQBAL(String PSN_FINA_LQBAL) {
this.PSN_FINA_LQBAL = PSN_FINA_LQBAL;
}
public String getPSN_FINA_LYBAL() {
return PSN_FINA_LYBAL;
}
public void setPSN_FINA_LYBAL(String PSN_FINA_LYBAL) {
this.PSN_FINA_LYBAL = PSN_FINA_LYBAL;
}
public String getENT_FINA_LDBAL() {
return ENT_FINA_LDBAL;
}
public void setENT_FINA_LDBAL(String ENT_FINA_LDBAL) {
this.ENT_FINA_LDBAL = ENT_FINA_LDBAL;
}
public String getENT_FINA_LMBAL() {
return ENT_FINA_LMBAL;
}
public void setENT_FINA_LMBAL(String ENT_FINA_LMBAL) {
this.ENT_FINA_LMBAL = ENT_FINA_LMBAL;
}
public String getENT_FINA_LQBAL() {
return ENT_FINA_LQBAL;
}
public void setENT_FINA_LQBAL(String ENT_FINA_LQBAL) {
this.ENT_FINA_LQBAL = ENT_FINA_LQBAL;
}
public String getENT_FINA_LYBAL() {
return ENT_FINA_LYBAL;
}
public void setENT_FINA_LYBAL(String ENT_FINA_LYBAL) {
this.ENT_FINA_LYBAL = ENT_FINA_LYBAL;
}
public String getPSN_LDBAL() {
return PSN_LDBAL;
}
public void setPSN_LDBAL(String PSN_LDBAL) {
this.PSN_LDBAL = PSN_LDBAL;
}
public String getPSN_LMBAL() {
return PSN_LMBAL;
}
public void setPSN_LMBAL(String PSN_LMBAL) {
this.PSN_LMBAL = PSN_LMBAL;
}
public String getPSN_LQBAL() {
return PSN_LQBAL;
}
public void setPSN_LQBAL(String PSN_LQBAL) {
this.PSN_LQBAL = PSN_LQBAL;
}
public String getPSN_LYBAL() {
return PSN_LYBAL;
}
public void setPSN_LYBAL(String PSN_LYBAL) {
this.PSN_LYBAL = PSN_LYBAL;
}
public String getENT_LDBAL() {
return ENT_LDBAL;
}
public void setENT_LDBAL(String ENT_LDBAL) {
this.ENT_LDBAL = ENT_LDBAL;
}
public String getENT_LMBAL() {
return ENT_LMBAL;
}
public void setENT_LMBAL(String ENT_LMBAL) {
this.ENT_LMBAL = ENT_LMBAL;
}
public String getENT_LQBAL() {
return ENT_LQBAL;
}
public void setENT_LQBAL(String ENT_LQBAL) {
this.ENT_LQBAL = ENT_LQBAL;
}
public String getENT_LYBAL() {
return ENT_LYBAL;
}
public void setENT_LYBAL(String ENT_LYBAL) {
this.ENT_LYBAL = ENT_LYBAL;
}
public String getLDBAL() {
return LDBAL;
}
public void setLDBAL(String LDBAL) {
this.LDBAL = LDBAL;
}
public String getLMBAL() {
return LMBAL;
}
public void setLMBAL(String LMBAL) {
this.LMBAL = LMBAL;
}
public String getLQBAL() {
return LQBAL;
}
public void setLQBAL(String LQBAL) {
this.LQBAL = LQBAL;
}
public String getLYBAL() {
return LYBAL;
}
public void setLYBAL(String LYBAL) {
this.LYBAL = LYBAL;
}
public String getENT_CUST_NUM() {
return ENT_CUST_NUM;
}
public void setENT_CUST_NUM(String eNT_CUST_NUM) {
ENT_CUST_NUM = eNT_CUST_NUM;
}
public String getPSN_CUST_NUM() {
return PSN_CUST_NUM;
}
public void setPSN_CUST_NUM(String pSN_CUST_NUM) {
PSN_CUST_NUM = pSN_CUST_NUM;
}
public String getBAL() {
return BAL;
}
public void setBAL(String bAL) {
BAL = bAL;
}
public String getPSN_BAL() {
return PSN_BAL;
}
public void setPSN_BAL(String pSN_BAL) {
PSN_BAL = pSN_BAL;
}
public String getENT_BAL() {
return ENT_BAL;
}
public void setENT_BAL(String eNT_BAL) {
ENT_BAL = eNT_BAL;
}
public String getCUR_DEP_BAL() {
return CUR_DEP_BAL;
}
public void setCUR_DEP_BAL(String cUR_DEP_BAL) {
CUR_DEP_BAL = cUR_DEP_BAL;
}
public String getPSN_CUR_DEPS_BAL() {
return PSN_CUR_DEPS_BAL;
}
public void setPSN_CUR_DEPS_BAL(String pSN_CUR_DEPS_BAL) {
PSN_CUR_DEPS_BAL = pSN_CUR_DEPS_BAL;
}
public String getENT_CUR_DEPS_BAL() {
return ENT_CUR_DEPS_BAL;
}
public void setENT_CUR_DEPS_BAL(String eNT_CUR_DEPS_BAL) {
ENT_CUR_DEPS_BAL = eNT_CUR_DEPS_BAL;
}
public String getRMB_FIX_DEP_BAL() {
return RMB_FIX_DEP_BAL;
}
public void setRMB_FIX_DEP_BAL(String rMB_FIX_DEP_BAL) {
RMB_FIX_DEP_BAL = rMB_FIX_DEP_BAL;
}
public String getPSN_FIX_DEPS_BAL() {
return PSN_FIX_DEPS_BAL;
}
public void setPSN_FIX_DEPS_BAL(String pSN_FIX_DEPS_BAL) {
PSN_FIX_DEPS_BAL = pSN_FIX_DEPS_BAL;
}
public String getENT_FIX_DEPS_BAL() {
return ENT_FIX_DEPS_BAL;
}
public void setENT_FIX_DEPS_BAL(String eNT_FIX_DEPS_BAL) {
ENT_FIX_DEPS_BAL = eNT_FIX_DEPS_BAL;
}
public String getDEPS_BAL() {
return DEPS_BAL;
}
public void setDEPS_BAL(String dEPS_BAL) {
DEPS_BAL = dEPS_BAL;
}
public String getPSN_DEPS_BAL() {
return PSN_DEPS_BAL;
}
public void setPSN_DEPS_BAL(String pSN_DEPS_BAL) {
PSN_DEPS_BAL = pSN_DEPS_BAL;
}
public String getENT_DEPS_BAL() {
return ENT_DEPS_BAL;
}
public void setENT_DEPS_BAL(String eNT_DEPS_BAL) {
ENT_DEPS_BAL = eNT_DEPS_BAL;
}
public String getLOAN_BAL() {
return LOAN_BAL;
}
public void setLOAN_BAL(String lOAN_BAL) {
LOAN_BAL = lOAN_BAL;
}
public String getPSN_LOAN_BAL() {
return PSN_LOAN_BAL;
}
public void setPSN_LOAN_BAL(String pSN_LOAN_BAL) {
PSN_LOAN_BAL = pSN_LOAN_BAL;
}
public String getENT_LOAN_BAL() {
return ENT_LOAN_BAL;
}
public void setENT_LOAN_BAL(String eNT_LOAN_BAL) {
ENT_LOAN_BAL = eNT_LOAN_BAL;
}
public String getFINA_BAL() {
return FINA_BAL;
}
public void setFINA_BAL(String fINA_BAL) {
FINA_BAL = fINA_BAL;
}
public String getENT_FINA_BAL() {
return ENT_FINA_BAL;
}
public void setENT_FINA_BAL(String eNT_FINA_BAL) {
ENT_FINA_BAL = eNT_FINA_BAL;
}
public String getPSN_FINA_BAL() {
return PSN_FINA_BAL;
}
public void setPSN_FINA_BAL(String pSN_FINA_BAL) {
PSN_FINA_BAL = pSN_FINA_BAL;
}
public String getTJ_DATE() {
return TJ_DATE;
}
public void setTJ_DATE(String tJ_DATE) {
TJ_DATE = tJ_DATE;
}
}
| [
"dysen@outlook.com"
] | dysen@outlook.com |
2e6ead0a10f43881e9672e08c4a658cfc4085dda | 1942b6cce4554b762df0e8e2282dc59dac025d48 | /Back-end/MiageTchat/src/main/java/start/Inscription.java | 089c3fa0d2d2a6e490eeec0b325b6cbd2f68df14 | [] | no_license | ganeis/MiageTchat-back-end | 564ff5d85515ac5ece51641066c9fc7b680cc4b0 | 5e4c4534c22931f701724863cfb50dc43b62ceee | refs/heads/master | 2020-04-01T23:20:48.716322 | 2019-04-02T18:00:53 | 2019-04-02T18:00:53 | 153,753,698 | 0 | 0 | null | 2019-04-02T18:00:54 | 2018-10-19T08:49:27 | null | UTF-8 | Java | false | false | 2,641 | java | package start;
import DAO.DataBaseConnection;
import javax.ejb.Local;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import annotation.Secured;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.json.Json;
import javax.json.JsonObject;
import javax.ws.rs.Consumes;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.PUT;
import javax.ws.rs.core.MediaType;
import model.User;
/**
* REST Web Service
*
* @author ganeistan
*/
@Local
@Path("/Inscription")
public class Inscription {
@Context
SecurityContext sctx;
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response creeCompte(@HeaderParam("UserId") String User_Id,@HeaderParam("First_Name") String First_Name,@HeaderParam("Last_Name") String Last_Name,@HeaderParam("Birth_Year") Integer Birth_Year,@HeaderParam("Gender") String Gender,@HeaderParam("Email") String Email,@HeaderParam("Password") String Password) {
if(!verifLogin(User_Id)){
return Response.status(Response.Status.BAD_REQUEST)
.entity(jsonMe("Utilisateur existe déja"))
.build();
}
User u=new User(User_Id,First_Name,Last_Name,Birth_Year,Gender,Email,Password,true);
if(u.newCompte()){
return Response.status(Response.Status.CREATED)
.entity(jsonMe("Compte crée")).build();
}
return Response.status(Response.Status.EXPECTATION_FAILED)
.entity(jsonMe("Erreur BD"))
.build();
}
public boolean verifLogin(String a) {
Connection conn=DataBaseConnection.ConnexionBD();
boolean rep=true;
try {
PreparedStatement ps=conn.prepareStatement("SELECT \"User_Id\" FROM \"User\"");
ResultSet rs=ps.executeQuery();
while(rs.next()){
if(rs.getString(1).equals(a)){
//MenuLoginController.setError(err,"");
return false;
};
}ps.close();
} catch (Exception e) {
e.printStackTrace();
}
//MenuLoginController.setError(err,"Nom utilisateur erroné");
return rep;
}
public String jsonMe(String msg){
JsonObject jsonObject = Json.createObjectBuilder()
.add("Message", msg)
.build();
return jsonObject.toString();
}
} | [
"ganeistan1@gmail.com"
] | ganeistan1@gmail.com |
8c259bf6f019559265ff538ec68a5e78b3ab4696 | ac3f2e7e7cad1040e09a67e2f420b7ea8b3f790d | /core/src/main/java/com/ham/p2p/business/service/impl/IPlatFormBankInfoServiceImpl.java | f23d47dfe78dec53f4475db9bf96aac4b195f60e | [] | no_license | C-cham/p2p | b59732d93e0684fa0c252eda9441467a659316a4 | 4092b5c413de3b6dd796cdf75b38bf92b3d76b66 | refs/heads/master | 2021-09-06T14:29:30.916253 | 2018-02-07T14:42:58 | 2018-02-07T14:43:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,698 | java | package com.ham.p2p.business.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ham.p2p.business.domain.PlatFormBankInfo;
import com.ham.p2p.business.mapper.PlatFormBankInfoMapper;
import com.ham.p2p.business.query.PlatFormBankInfoQueryObject;
import com.ham.p2p.business.service.IPlatFormBankInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class IPlatFormBankInfoServiceImpl implements IPlatFormBankInfoService {
@Autowired
private PlatFormBankInfoMapper platFormBankInfoMapper;
@Override
public int save(PlatFormBankInfo platFormBankInfo) {
return platFormBankInfoMapper.insert(platFormBankInfo);
}
@Override
public int update(PlatFormBankInfo platFormBankInfo) {
return platFormBankInfoMapper.updateByPrimaryKey(platFormBankInfo);
}
@Override
public PlatFormBankInfo get(Long id) {
return platFormBankInfoMapper.selectByPrimaryKey(id);
}
@Override
public PageInfo queryPage(PlatFormBankInfoQueryObject qo) {
PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
List list = platFormBankInfoMapper.queryPage(qo);
return new PageInfo(list);
}
@Override
public void saveOrUpdate(PlatFormBankInfo platFormBankInfo) {
if (platFormBankInfo.getId() == null) {
this.save(platFormBankInfo);
} else {
this.update(platFormBankInfo);
}
}
@Override
public List<PlatFormBankInfo> selectAll() {
return platFormBankInfoMapper.selectAll();
}
}
| [
"254@qq.com"
] | 254@qq.com |
67fcd878a85a170249e28c65018b2682c9bf6c2a | 58b6015757ca413c1f9814f12c09a44cb1f1e9f1 | /HotelManagementSystem/gen/com/qainfotech/hotelmanagementsystem/Manifest.java | e541f52dfa3ecb74c8a94d7037a4cb97a688c498 | [] | no_license | tnyadav/HotelManagement | 80b10cf42a706e03504dced5c1ccb48842491762 | dd6df39b62fa93061e294ddad819e3e0f7d6799b | refs/heads/master | 2021-01-02T22:57:20.003204 | 2014-05-02T12:07:16 | 2014-05-02T12:07:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.qainfotech.hotelmanagementsystem;
public final class Manifest {
public static final class permission {
public static final String MAPS_RECEIVE="com.qait.googlemapsv2.permission.MAPS_RECEIVE";
}
}
| [
"trilokinathyadav@HPDA0050.qait.com"
] | trilokinathyadav@HPDA0050.qait.com |
0e7f229f3c3e6892fdaa55dc07cd6b1dd4a159c4 | dc735a258e41c3b75fd90ce50eb97208fa93972d | /app/src/main/java/com/hbhgdating/imageFilter/filters/GaussianBlurStrong.java | 97418f69987d9ef4b5e389e02f2717cb00890154 | [] | no_license | sketchandroid01/HBHG2 | f977f61f3ed488a22989c616fd05d618015dcf6a | 6097d857949114e60750c061e96d2ca78e68077c | refs/heads/master | 2020-05-04T14:58:42.590100 | 2019-09-11T06:24:39 | 2019-09-11T06:24:39 | 179,218,149 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,469 | java | package com.hbhgdating.imageFilter.filters;
import android.graphics.Bitmap;
import com.hbhgdating.imageFilter.models.ConvolutionMask;
/**
* Applies a gaussian blur.
*/
public class GaussianBlurStrong extends Filter {
private Bitmap bitmapIn;
private ConvolutionMask convolutionMask;
public GaussianBlurStrong(Bitmap bitmapIn) {
this.bitmapIn = bitmapIn;
final double[][] convolutionMask = new double[][]{
{1, 4, 6, 4, 1},
{4, 16, 24, 16, 4},
{6, 24, 36, 24, 16, 6},
{4, 16, 24, 16, 4},
{1, 4, 6, 4, 1},
};
this.convolutionMask = new ConvolutionMask(5);
this.convolutionMask.applyConvolutionSettingsBig(convolutionMask);
this.convolutionMask.Factor = 256;
this.convolutionMask.Offset = 0;
}
/**
* Execute filter.
*
* @return the bitmap
*/
@Override
public Bitmap executeFilter() {
return ConvolutionMask.calculateConvolution5x5(this.getBitmapIn(),
this.getConvolutionMask());
}
public Bitmap getBitmapIn() {
return bitmapIn;
}
public void setBitmapIn(Bitmap bitmapIn) {
this.bitmapIn = bitmapIn;
}
public ConvolutionMask getConvolutionMask() {
return convolutionMask;
}
public void setConvolutionMask(ConvolutionMask convolutionMask) {
this.convolutionMask = convolutionMask;
}
}
| [
"sketch.dev01@gmail.com"
] | sketch.dev01@gmail.com |
6f9b2c25a04d80176e41c810674566dacdb746be | 7ad4781b180ce8efd3993505f4389eef86b3fcf8 | /chapter_005/src/main/java/ru/job4j/tree/BinaryTree.java | 27b951639f51ababcb6097376f63e4566e094826 | [
"Apache-2.0"
] | permissive | wolfdog007/aruzhev | a2ddd64e66250715f7a0ae5f91ec4e7fdfcc5828 | 90e1fc0dfd14c167e1ee9c65ee1c11c90321e629 | refs/heads/master | 2020-04-05T11:01:10.705585 | 2018-10-15T14:12:59 | 2018-10-15T14:12:59 | 81,443,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,524 | java | package ru.job4j.tree;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* The class Tree - use for storage value to tree.
*
* @param <E> This describes my type parameter. Type for key;
* @author Ruzhev Alexander
* @since 01.02.2018
*/
public class BinaryTree<E extends Comparable<E>> implements Iterable<E> {
/**
* The head tree.
*/
private Node<E> root;
/**
* The count value to tree.
*/
private int size;
/**
* The constructor for class Tree. Create head tree with value.
*
* @param values - array values;
*/
public BinaryTree(E[] values) {
addAll(values);
}
/**
* The default constructor for class BinaryTree.
*/
public BinaryTree() {
}
/**
* The method return count values to tree.
*
* @return - count values to tree;
*/
public int size() {
return this.size;
}
/**
* The method check tree is empty or is not empty.
*
* @return true - tree is empty; false - tree is not empty;
*/
public boolean isEmpty() {
return this.size == 0;
}
/**
* The method add array values to binary tree.
*
* @param values - array values;
*/
public void addAll(E[] values) {
if (values != null) {
for (E value : values) {
add(value);
}
}
}
/**
* The method add new value to binary tree.
*
* @param value - value;
* @return true - is add; false - is not add;
*/
public boolean add(E value) {
boolean result = value != null;
if (result) {
Node<E> temp = getPlace(this.root, value);
if (result = temp != null) {
temp.parent = value;
this.size++;
} else if (result = isEmpty()) {
this.root = new Node<>(value);
this.size++;
}
}
return result;
}
/**
* The recurse method for get link Node by value.
*
* @param parent - parent
* @param value - vlue
* @return link Node or null, if is not searching;
*/
private Node<E> getPlace(Node<E> parent, E value) {
if (parent != null && parent.parent != null) {
if (parent.parent.compareTo(value) > 0) {
if (parent.left == null) {
parent.left = new Node<>();
}
parent = getPlace(parent.left, value);
} else if (parent.parent.compareTo(value) < 0) {
if (parent.right == null) {
parent.right = new Node<>();
}
parent = getPlace(parent.right, value);
} else {
parent = null;
}
}
return parent;
}
/**
* The recurse method convert tree to list.
*
* @param root - heads tree;
* @param list - list with value tree;
* @return - list values;
*/
private List<E> getListToTree(Node<E> root, List<E> list) {
if (root != null) {
list = getListToTree(root.left, list);
list.add(root.parent);
list = getListToTree(root.right, list);
}
return list;
}
/**
* Returns an iterator over elements of type {@code T}.
*
* @return an Iterator.
*/
@Override
public Iterator<E> iterator() {
return getListToTree(this.root, new ArrayList<E>()).iterator();
}
@Override
public String toString() {
return getListToTree(this.root, new ArrayList<>()).toString();
}
/**
* The inner class Node - model element.
*
* @param <E> This describes my type parameter. Type for key;
*/
private class Node<E> {
/**
* The var - value.
*/
private E parent;
/**
* The link to min element.
*/
private Node<E> left;
/**
* The link to max element.
*/
private Node<E> right;
/**
* The constructor for inner class Node.
*
* @param parent - value;
*/
Node(E parent) {
this.parent = parent;
}
/**
* constructor without parameters.
*/
Node() {
}
@Override
public String toString() {
return this.parent != null ? parent.toString() : "null";
}
}
}
| [
"alexanderruzhev@gmail.com"
] | alexanderruzhev@gmail.com |
ac75bdcf7b167129ab0988182fda60e21eaceba5 | 9fd1e146c9cad6a1ed63f6afd783c3d1610492f6 | /web/master/src/main/java/com/book/master/service/BookService.java | 674bd6163d9bcb294cfe72b712fa0eed5e24fde3 | [] | no_license | yzc111/practice_project | 517a943a8426d8220bbaab4e45c882bf45961109 | 753dcdb876ffaa8f02b116a3bc6ee2a5a5fa9f18 | refs/heads/master | 2022-11-17T13:09:41.413435 | 2020-07-19T02:34:55 | 2020-07-19T02:34:55 | 280,777,322 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 499 | java | package com.book.master.service;
import com.book.master.bean.TabBook;
import com.book.master.dao.BookDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class BookService {
@Autowired
private BookDao bookDao;
public void saveBook(TabBook tabBook){
bookDao.save(tabBook);
}
public List<TabBook> findByUid(Integer uid){
return bookDao.findByUid(uid);
}
}
| [
"yzc@users.noreply.github.com"
] | yzc@users.noreply.github.com |
4bee25bba9b8e45bc1fc83fdb89dd44460bf4725 | f28d047b89e6f758d0e96d944767182fd23faa71 | /Mad Libs/src/main/java/com/vanderveldt/rens/mad_libs/Submit_activity.java | d5d2768f1ad29f489d85de7e2f64e88961308a33 | [] | no_license | rensvdveldt/Mad_libs | 6792f2454a503bc24362f509a7a5619cf8c940a4 | 67223bc3fb3e91312202d28379a83f9d60c46eb7 | refs/heads/master | 2021-06-06T07:42:16.745612 | 2016-11-11T14:27:04 | 2016-11-11T14:27:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,900 | java | package com.vanderveldt.rens.mad_libs;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.content.SharedPreferences;
import android.view.View;
import android.view.Window;
import android.widget.EditText;
import android.widget.TextView;
import android.content.Intent;
import android.widget.Toast;
import java.io.InputStream;
import static android.view.View.VISIBLE;
import static java.lang.String.format;
public class Submit_activity extends AppCompatActivity {
public static final String MyPREFERENCES = "myprefs";
SharedPreferences prefs;
String word;
String name;
boolean Init = false;
TextView welcomeTV;
TextView wordsToGoTV;
EditText wordSet;
InputStream stream;
Story story;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_submit_activity);
prefs = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
name = prefs.getString("name", "User");
welcomeTV = (TextView) findViewById(R.id.welcomeText);
welcomeTV.setText(format("Welcome %s !", name));
TextView wordsToGoTV = (TextView) findViewById(R.id.wordsToGo);
wordsToGoTV.setText("Click the button to start:");
}
public void onBackPressed() {
finish();
}
public void submitWord(View view) {
// Runs once to set the texts and story.
if (!Init){
// Create random story
int random = (int )(Math.random() * 5 + 1);
switch(random){
case 1: stream = this.getResources().openRawResource(R.raw.madlib0_simple);
break;
case 2: stream = this.getResources().openRawResource(R.raw.madlib1_tarzan);
break;
case 3: stream = this.getResources().openRawResource(R.raw.madlib2_university);
break;
case 4: stream = this.getResources().openRawResource(R.raw.madlib3_clothes);
break;
case 5: stream = this.getResources().openRawResource(R.raw.madlib4_dance);
break;
}
story = new Story(stream);
// Set the submit field to the right hint and make it visible
wordSet = (EditText) findViewById(R.id.submitField);
wordSet.setHint(story.getNextPlaceholder());
wordSet.setVisibility(VISIBLE);
// Set amount of words to go
wordsToGoTV = (TextView) findViewById(R.id.wordsToGo);
wordsToGoTV.setText(format("%s word(s) to go!", Integer.toString(story.getPlaceholderRemainingCount())));
// Make sure this only runs once.
Init = true;
}
else {
wordsToGoTV.setText(format("%s word(s) to go!", Integer.toString(story.getPlaceholderRemainingCount())));
// Check if all words are filled in
if (!story.isFilledIn()) {
// Get words from fill-in
wordSet.setHint(story.getNextPlaceholder());
wordSet = (EditText) findViewById(R.id.submitField);
word = wordSet.getText().toString();
// Reset filled in word and set hint to next placeholder
wordSet.setText("");
if (word.length() == 0) {
Toast toast = Toast.makeText(this, "Please enter a word", Toast.LENGTH_SHORT);
toast.show();
} else {
story.fillInPlaceholder(word);
wordsToGoTV.setText(format("%s word(s) to go!", Integer.toString(story.getPlaceholderRemainingCount())));
wordSet.setHint(story.getNextPlaceholder());
}
}
// Submit all words as a story to the next activity and clean the story
if (story.isFilledIn()) {
Intent goToStoryActivity = new Intent(this, Story_activity.class);
goToStoryActivity.putExtra("story", story.toString());
startActivity(goToStoryActivity);
finish();
story.clear();
}
}
}
public void onLogoutPressed(View view) {
// Allow user to log out and change their name, reset story and close previous windows.
SharedPreferences.Editor editor = prefs.edit();
editor.putString("name", "");
editor.apply();
editor.putBoolean("login", false);
editor.apply();
Intent goToRegister = new Intent(this, Register_activity.class);
startActivity(goToRegister);
finish();
if (story != null){
story.clear();
}
}
}
| [
"rensvanderveldt@gmail.com"
] | rensvanderveldt@gmail.com |
a0c8cc1d044312f2ad9066c9290e95ec3172bfd4 | 269832707dd1380e797498fc6cfe8401cd4550bb | /Documents/NetBeansProjects/Aula06/src/aula06/Aula06.java | 4d491111e0a90c967c88d71c173ef3aa77498827 | [] | no_license | MariaMarianaCagnoni/Java-Ex | c9cd562fac7d630ba3523f50ba3defb43e22f5dd | f41c92ca1008e2fbfe208113e743c494f9ce3a98 | refs/heads/master | 2022-12-14T06:46:15.586971 | 2020-09-28T14:50:48 | 2020-09-28T14:50:48 | 299,334,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 377 | java |
package aula06;
public class Aula06 {
public static void main(String[] args) {
ControleRemoto c = new ControleRemoto();
c.ligar();
c.maisVolume();
c.maisVolume();
c.menosVolume();
c.ligarMudo();
c.desligarMudo();
c.abrirMenu();
c.fecharMenu();
}
}
| [
"mariamariana.cagnoni@gmail.com"
] | mariamariana.cagnoni@gmail.com |
1f90da506065c98d86b3b36a0a9ead8186e73182 | 846ceb1369f994f930d0c64d2bb1877d7fd0b331 | /src/main/java/youen/dojo/web/propertyeditors/LocaleDateTimeEditor.java | 31cc258185254b46d1f98eb034f5e0fdd94aacf4 | [] | no_license | youenchene/codingdojo-jhipster2 | 4f7bb3908bd20b4975e1c153087e0fdd15bb2393 | 243e4533068fcb468afc9a51882d1dcf39e811a8 | refs/heads/master | 2021-01-25T07:28:58.189049 | 2015-01-25T12:15:43 | 2015-01-25T12:15:43 | 29,725,839 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,988 | java | package youen.dojo.web.propertyeditors;
import org.joda.time.LocalDateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.springframework.util.StringUtils;
import java.beans.PropertyEditorSupport;
import java.util.Date;
/**
* Custom PropertyEditorSupport to convert from String to
* Date using JodaTime (http://www.joda.org/joda-time/).
*/
public class LocaleDateTimeEditor extends PropertyEditorSupport {
private final DateTimeFormatter formatter;
private final boolean allowEmpty;
/**
* Create a new LocaleDateTimeEditor instance, using the given format for
* parsing and rendering.
* <p/>
* The "allowEmpty" parameter states if an empty String should be allowed
* for parsing, i.e. get interpreted as null value. Otherwise, an
* IllegalArgumentException gets thrown.
*
* @param dateFormat DateFormat to use for parsing and rendering
* @param allowEmpty if empty strings should be allowed
*/
public LocaleDateTimeEditor(String dateFormat, boolean allowEmpty) {
this.formatter = DateTimeFormat.forPattern(dateFormat);
this.allowEmpty = allowEmpty;
}
/**
* Format the YearMonthDay as String, using the specified format.
*
* @return DateTime formatted string
*/
public String getAsText() {
Date value = (Date) getValue();
return value != null ? new LocalDateTime(value).toString(formatter) : "";
}
/**
* Parse the value from the given text, using the specified format.
*
* @param text the text to format
* @throws IllegalArgumentException
*/
public void setAsText( String text ) throws IllegalArgumentException {
if ( allowEmpty && !StringUtils.hasText(text) ) {
// Treat empty String as null value.
setValue(null);
} else {
setValue(new LocalDateTime(formatter.parseDateTime(text)));
}
}
}
| [
"youen.chene@gadz.org"
] | youen.chene@gadz.org |
bddcd4014c632e0349a6c284cab12acffd793f22 | 18012fb416cd6700e43894cce47ae1dc7b2fe5f1 | /src/main/java/player/parsers/ESPN_2018_Parser.java | 977ea30d7a618ec88f26a9d0c390c18102d7b0d9 | [] | no_license | bbskeelz/rfbl | bb7ca59b97eb229310c6e999e3944429e9057846 | 7988dc16267f8e19ea67ef6d07900a311b72b958 | refs/heads/master | 2021-01-10T13:22:52.942741 | 2019-02-14T02:38:20 | 2019-02-14T02:38:20 | 55,275,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,888 | java | package player.parsers;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import player.domain.MLBTeam;
import player.domain.Player;
import player.domain.Position;
import player.exceptions.MLBTeamNotFoundException;
import player.exceptions.PositionNotFoundException;
import player.logger.PlayerLogger;
public class ESPN_2018_Parser extends Parser{
public ESPN_2018_Parser() {
}
public ESPN_2018_Parser(String file){
super(file, "201804");
}
@Override
public void parsePlayers() {
List<String> lines = new ArrayList<>();
File file = new File(getClass().getClassLoader().getResource(getFile()).getFile());
try (Stream<String> stream = Files.lines(Paths.get(file.getAbsolutePath()))) {
lines = stream
.collect(Collectors.toList());
int rank = 0;
for (String playerLine : lines){
Player player = playerFactory.getPlayer();
String name = playerLine.split(",")[1].trim();
String pos = playerLine.split(",")[2].trim();
player.setFullname(name);
String[] namePieces = player.getFullname().split(" ");
player.setLastname(namePieces[namePieces.length-1]); //most likely the last name
player.setEligible_positions(pos.split("/"));
try {
player.setPos(Position.getPosition(player.getEligible_positions()[0].trim()));
}catch(PositionNotFoundException p){
PlayerLogger.log(p.getMessage());
}
player.setPro_team(playerLine.split(",")[3].trim());
try {
MLBTeam.getMLBTeam(player.getPro_team());
}catch(MLBTeamNotFoundException p){
PlayerLogger.log(p.getMessage());
}
player.getMentions().get(getName()).setRank(++rank);
players.add(player);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"sean@Seans-MacBook-Pro-2.local"
] | sean@Seans-MacBook-Pro-2.local |
1a62ce84a7ddde905f912dbc04d01a46b0d76281 | a5f52d02303d10ee0f9a1a7dbd89e2c0f46ef62f | /app/src/main/java/com/example/hp/mvptest/base/IPresenter.java | 0a70ebfef633384fd1007cb00aeefd468e5f39d1 | [] | no_license | huang1xiaoxin/MVPTest | 065ea248071e11fcfc77c15f3ab7019a40152c68 | 9520959bc4db1801667222266481622c3de60d1d | refs/heads/master | 2022-11-23T04:04:02.040605 | 2020-07-29T14:55:52 | 2020-07-29T14:55:52 | 283,527,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 298 | java | package com.example.hp.mvptest.base;
import com.example.hp.mvptest.base.BaseView;
/**
* 因为我们需要在BasePresenter中拿到 View的对象,所以定义个接口给BasePresenter的继承
* @param <V>
*/
public interface IPresenter<V extends BaseView> {
void attachView(V View);
}
| [
"2296849804@qq.com"
] | 2296849804@qq.com |
778dd2b551d7475bf274c0c2b1b6f315da21db07 | 012c1675dc4495edb2bf84f8ec47237683c48568 | /JSP_Project/OpenProjectMVC/src/mvc/command/IndexCommand.java | 7aa3b30cd489a632ab89288cae69fbb380fbe9bc | [] | no_license | jechoiiii/JavaStudy | 7c6e79d6b1827c5f109873cf221903f0453a59a4 | de652615a69a81997c8f4583aba97df0615b2472 | refs/heads/master | 2023-03-19T11:00:08.900039 | 2021-03-12T07:48:35 | 2021-03-12T07:48:35 | 299,251,893 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package mvc.command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class IndexCommand implements Command {
@Override
public String getViewPage(HttpServletRequest request, HttpServletResponse response) {
return "/WEB-INF/view/index.jsp";
}
} | [
"jechoiiii@gmail.com"
] | jechoiiii@gmail.com |
7baaf09d85b4881662cd4e4a8e7bdd4d3961d489 | 72f6573f05194d264e496a9f4065a9e93f4f777d | /eCardCity2.0/0.ecardcity-makecard/src/main/java/cn/com/newcapec/citycard/system/service/IUserOrganService.java | d17d22ea095f59922a773b39e06a8ad4753e1f2d | [
"BSD-2-Clause"
] | permissive | zhangjunfang/eclipse-dir | 66c87159c3d95e129b0b8cfd89fdfc87a63570dd | 6a6a4a8114f07e850ed2efd2b7049fcebbd63032 | refs/heads/master | 2016-09-05T17:55:03.981020 | 2014-07-06T03:41:36 | 2014-07-06T03:41:36 | 21,530,444 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,014 | java | package cn.com.newcapec.citycard.system.service;
import java.util.List;
import cn.com.newcapec.common.domain.Node;
import cn.com.newcapec.common.exception.BusinessException;
import cn.com.newcapec.citycard.common.po.TOrgDept;
import cn.com.newcapec.citycard.common.po.TOrgUser;
/**
* <p>
* 功能描述:用户组织机构服务接口定义
*
* Author : Wangjian
* Date : 2008-06-05
* Time : 11:00:15
* Version: 1.0
* </p>
*/
public interface IUserOrganService {
/**
* 校验添加重复的部门
*
* @param name 部门名
* @return Integer 查询到的部门数目
* @throws BusinessException 业务异常
*/
public Integer checkDeptIsRepeat(String name) throws BusinessException;
/**
* 查询当前满足查询条件的部门总数
*
* @param fId: 父部门ID
* @return 根据给定的父部门返回记录总数
*/
public Integer getDepCountByFid(Integer fId) throws BusinessException;
/**
* 查询当前满足查询条件的部门列表
*
* @param fId: 父部门ID
* @return 根据给定的父部门返回部门列表
*/
public List<TOrgDept> getDepListByFid(Integer fId,int firstResult, int maxResults) throws BusinessException;
/**
* 查询当前满足查询条件的记录总数
*
* @param orgId:
* Long对象
* @return 根据给定的orgId返回记录总数
*/
public Integer getTOrgUserCountByQuery(Integer orgId)
throws BusinessException;
/**
* 功能描述:得到组织机构树型目录结点列表
*
* @return List<Node> 组织机构树型目录结点列表
*/
public List<Node> getEomsOrganInfoTreeNodeList() throws BusinessException;
/**
* 功能描述:得到指定orgID号组织机构所有包含的用户信息列表
*
* @return List<TOrgUser> 用户信息列表
*/
public List<TOrgUser> getAllUserByOrganId(Integer organId,
int firstResult, int maxResults);
/**
* 功能描述:给指定用户分配角色
* @param userId: 指定的用户ID
* roleIdList: 角色IDList
*
*/
public void saveRoleToUser(Integer userid,List <Integer> roleIdList) throws BusinessException;
/**
* 功能描述:给指定用户分配角色
* @param userId 用户ID
*
*/
public TOrgUser getTOrgUserByPk(Integer userId) throws BusinessException;
/**
* 保存或修改用户
*
* @param obj 用户
* @return
* @throws BusinessException 业务异常
*/
public void saveOrUpdateUser(TOrgUser obj)throws Exception;
/**
* 保存或修改部门
*
* @param obj 部门
* @return
* @throws BusinessException 业务异常
*/
public void saveOrUpdateDept(TOrgDept obj)throws BusinessException;
/**
* 删除部门及该部门下属的用户(包括子部门及子部门用户)
*
* @param list 部门列表
* @return List<List<Integer>> 部门列表、用户列表
* @throws BusinessException 业务异常
*/
public List<List<Integer>> delDeptAssociation(List<Integer> list)throws BusinessException;
}
| [
"zhangjunfang0505@163.com"
] | zhangjunfang0505@163.com |
8c063b482e7b860176e0daacf8cc665a82647f9b | c83e1feba5491a245e40f0e7a5719bc052f4567a | /app/src/main/java/de/koelle/christian/common/widget/tab/GenericTabListener.java | 8ee5a606ca7dcb03d2234337fddb3d5b2505e3bd | [
"Apache-2.0"
] | permissive | doofmars/trickytripper | dd973029e91ca56a0d5bcec26b30097f23586088 | 8d78a5766edd3b12afb73fde8fdf430a760203ee | refs/heads/master | 2020-06-29T11:48:57.175270 | 2019-01-16T21:53:46 | 2019-01-16T21:53:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,513 | java | package de.koelle.christian.common.widget.tab;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
public class GenericTabListener implements ActionBar.TabListener {
private Fragment fragment;
private final AppCompatActivity host;
private final Class<? extends Fragment> type;
private final int targetContainerViewId;
private String tag;
public GenericTabListener(AppCompatActivity parent, String tag, Class<? extends Fragment> type,
int targetContainerViewId) {
this.host = parent;
this.tag = tag;
this.type = type;
this.targetContainerViewId = targetContainerViewId;
}
public GenericTabListener(AppCompatActivity parent, String tag, Class<? extends Fragment> type) {
this(parent, tag, type, android.R.id.content);
}
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction transaction) {
/*
* The fragment which has been added to this listener may have been
* replaced (can be the case for lists when drilling down), but if the
* tag has been retained, we should find the actual fragment that was
* showing in this tab before the user switched to another.
*/
Fragment currentlyShowing = host.getSupportFragmentManager().findFragmentByTag(tag);
if (currentlyShowing == null) {
fragment = Fragment.instantiate(host, type.getName());
transaction.add(targetContainerViewId, fragment, tag);
} else {
transaction.attach(currentlyShowing);
}
}
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
/*
* The fragment which has been added to this listener may have been
* replaced (can be the case for lists when drilling down), but if the
* tag has been retained, we should find the actual fragment that's
* currently active.
*/
Fragment currentlyShowing = host.getSupportFragmentManager().findFragmentByTag(tag);
if (currentlyShowing != null) {
fragmentTransaction.detach(currentlyShowing);
} else if (this.fragment != null) {
fragmentTransaction.detach(fragment);
}
}
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
// Intentionally blank.
}
}
| [
"christian.koelle.android@googlemail.com"
] | christian.koelle.android@googlemail.com |
8b51fa0f0ef54ffb5a33ed31036c85ac47f2e61b | 797994afd7eaee88aa584708f1b659c9efee40b6 | /src/com/syntax/class06/AlertDemo.java | 66c7a8a82818f7a369ba01d2ac28c72a92ac191f | [] | no_license | gkayabay/Selenium | 9dd0f8ce30a06f49a4dcc2590e703da8a062ecef | 3d31cd002ba5c7be1e8d32974d6d62cf773c7131 | refs/heads/main | 2023-01-24T07:37:00.177879 | 2020-11-15T16:31:50 | 2020-11-15T16:31:50 | 313,074,300 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,107 | java | package com.syntax.class06;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import com.syntax.utils.BaseClass;
public class AlertDemo extends BaseClass{
public static void main(String[] args) throws InterruptedException {
//Types of alerts
//1.regular alert box
setUp(); //Below code is for UItestPractice.com //WebDriver driver = BaseClass.setup();--> teacher bu methodla yazdi
driver.findElement(By.xpath("//button[@id = 'alert']")).click();
// Handling Simple alertPopups Alert is an interface
Alert simpleAlert = driver.switchTo().alert(); //switch attention to the alertBox.
Thread.sleep(1000);
//get text from alert box
String simpleAText = simpleAlert.getText();
System.out.println("This is simple alert text::"+simpleAText);
Thread.sleep(1000);
simpleAlert.accept();
Thread.sleep(1000);
//2nd type: Handling confirmation alert box
driver.findElement(By.id("confirm")).click();
Alert confirmAlert = driver.switchTo().alert();//switch attention
Thread.sleep(1000);
String confirmAText = confirmAlert.getText();
System.out.println("This is confirm alert text::"+confirmAText);
Thread.sleep(1000);
confirmAlert.dismiss();
//3. Type Prompt Alert
//Handling Prompt alerts/confirmation alerts by providing some confirmation message
//message
String name = "Alex";
driver.findElement(By.id("prompt")).click();
Alert promptAlert = driver.switchTo().alert();
System.out.println("This is Prompt alert text : "+promptAlert.getText()); //get the text from alert box
promptAlert.sendKeys(name);
promptAlert.accept();//ok or cancel
String text = driver.findElement(By.xpath(" //div[@id= 'demo']")).getText();
System.out.println("Text added to the alert box :"+text);
System.out.println(text);
if(text.contains(name)) {
System.out.println("Text "+ name+ " was successfully added");
}else {
System.out.println("Text "+name+" was not entered");
}
BaseClass.tearDown(); //Teachers 2nd way
}
}
| [
"kayabaygulbahar@gmail.com"
] | kayabaygulbahar@gmail.com |
3affc0ae24150e35b72227a9589633d50cead874 | 3afc4fd511fddc2605cb296de0da027b442a3ee3 | /src/main/java/org/openbaton/vnfm/FortinetVNFM.java | 0db017afbcf82e567906852fd2f225f3835b8017 | [] | no_license | fortinet-solutions-cse/openbaton-vnfm | 3b95d32f2a75d295eb3c06e3ad135361030dc83c | af4f012c1f1481167c318e96638fdaf0bc986475 | refs/heads/master | 2021-01-01T16:57:19.040831 | 2017-07-27T14:36:44 | 2017-07-27T14:36:44 | 97,958,152 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,261 | java | package org.openbaton.vnfm;
import org.openbaton.catalogue.mano.descriptor.VNFComponent;
import org.openbaton.catalogue.mano.record.VNFCInstance;
import org.openbaton.catalogue.mano.record.VNFRecordDependency;
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord;
import org.openbaton.catalogue.nfvo.Action;
import org.openbaton.catalogue.nfvo.Script;
import org.openbaton.catalogue.nfvo.VimInstance;
import org.openbaton.common.vnfm_sdk.amqp.AbstractVnfmSpringAmqp;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.Collection;
import java.util.Map;
@SpringBootApplication
public class FortinetVNFM extends AbstractVnfmSpringAmqp{
public static void main(String[] args){
SpringApplication.run(FortinetVNFM.class);
}
/**
* This operation allows creating a VNF instance.
*
* @param virtualNetworkFunctionRecord
* @param scripts
* @param vimInstances
*/
@Override
public VirtualNetworkFunctionRecord instantiate(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, Object scripts, Map<String, Collection<VimInstance>> vimInstances) throws Exception {
return virtualNetworkFunctionRecord;
}
/**
* This operation allows retrieving
* VNF instance state and attributes.
*/
@Override
public void query() {
}
/**
* This operation allows scaling
* (out/in, up/down) a VNF instance.
*/
@Override
public VirtualNetworkFunctionRecord scale(Action scaleInOrOut, VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFComponent component, Object scripts, VNFRecordDependency dependency) throws Exception {
return virtualNetworkFunctionRecord;
}
/**
* This operation allows verifying if
* the VNF instantiation is possible.
*/
@Override
public void checkInstantiationFeasibility() {
}
/**
* This operation is called when one the VNFs fails
*/
@Override
public VirtualNetworkFunctionRecord heal(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFCInstance component, String cause) throws Exception {
return virtualNetworkFunctionRecord;
}
/**
* This operation allows applying a minor/limited
* software update (e.g. patch) to a VNF instance.
*/
@Override
public VirtualNetworkFunctionRecord updateSoftware(Script script, VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) throws Exception {
return virtualNetworkFunctionRecord;
}
/**
* This operation allows making structural changes
* (e.g. configuration, topology, behavior,
* redundancy model) to a VNF instance.
*
* @param virtualNetworkFunctionRecord
* @param dependency
*/
@Override
public VirtualNetworkFunctionRecord modify(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFRecordDependency dependency) throws Exception {
return virtualNetworkFunctionRecord;
}
/**
* This operation allows deploying a new
* software release to a VNF instance.
*/
@Override
public void upgradeSoftware() {
}
/**
* This operation allows terminating gracefully
* or forcefully a previously created VNF instance.
*
* @param virtualNetworkFunctionRecord
*/
@Override
public VirtualNetworkFunctionRecord terminate(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
log.info("Terminating vnfr with id " + virtualNetworkFunctionRecord.getId());
return virtualNetworkFunctionRecord;
}
@Override
public void handleError(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
}
@Override
public VirtualNetworkFunctionRecord start(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) throws Exception {
return virtualNetworkFunctionRecord;
}
@Override
public VirtualNetworkFunctionRecord stop(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) throws Exception {
return virtualNetworkFunctionRecord;
}
@Override
public VirtualNetworkFunctionRecord startVNFCInstance(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFCInstance vnfcInstance) throws Exception {
return virtualNetworkFunctionRecord;
}
@Override
public VirtualNetworkFunctionRecord stopVNFCInstance(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFCInstance vnfcInstance) throws Exception {
return virtualNetworkFunctionRecord;
}
@Override
public VirtualNetworkFunctionRecord configure(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) throws Exception {
return virtualNetworkFunctionRecord;
}
@Override
public VirtualNetworkFunctionRecord resume(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFCInstance vnfcInstance, VNFRecordDependency dependency) throws Exception {
return virtualNetworkFunctionRecord;
}
/**
* This operation allows providing notifications on state changes
* of a VNF instance, related to the VNF Lifecycle.
*/
@Override
public void NotifyChange() {
}
}
| [
"magonzalez@fortinet.com"
] | magonzalez@fortinet.com |
57cb045bba6b1a3a78978d413fb1cf338f236d58 | 04d091bcbc51abc3bd5d296d90e726edf3cf2987 | /src/main/java/com/jiazhi/java/jdkProxy/ProxyFactory.java | 879b8ec2c3bfd294431fd0c6140d789b990c8c54 | [] | no_license | CYWCODER/JavaProxy | 2a31c60763cc13210e229e4d76c9395e361cd8ae | 2be359c59171be8616a94d194c91ccbc74533bff | refs/heads/master | 2020-03-22T01:23:25.299037 | 2018-07-01T05:24:32 | 2018-07-01T05:24:32 | 139,302,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,104 | java | package com.jiazhi.java.jdkProxy;
import com.jiazhi.java.staticProxy.IUserDao;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
/**
* @Author jiazhi
* @Description
* @Date 2018/7/1/001 11:32
*/
public class ProxyFactory {
private IjdkUserDao target;
public ProxyFactory(IjdkUserDao userDao){
this.target = userDao;
}
public Object getProxyInstance(){
return Proxy.newProxyInstance(target.getClass().getClassLoader(),
target.getClass().getInterfaces(),
new InvocationHandler(){
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
System.out.println("目标对象运行前");
//执行目标对象方法
Object returnValue = method.invoke(target, args);
System.out.println("目标对象运行后");
return returnValue;
}
});
}
}
| [
"857142877@qq.com"
] | 857142877@qq.com |
a10c0fa92af94ddc41a10a36236ed580799d7582 | 1bd46cbb5e7e824cf85fffdda4b8f433238d166b | /src/database/jdbc/main/DatebaseMetaDataMain.java | 984dc55cc27760b6d825cb417558cadf811131a6 | [] | no_license | longxueyuu/javaprogram | 245411f8327e81b6fe2c7601fa91905ff6a33aef | 80a1accedbc8686a70776c14b674c68500affcf9 | refs/heads/master | 2021-01-10T08:16:50.094006 | 2016-02-22T04:48:51 | 2016-02-22T04:48:51 | 52,247,793 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,336 | java | package database.jdbc.main;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
public class DatebaseMetaDataMain {
private static Connection conn;
private static Statement stmt;
private static ResultSet rs;
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("hello world!");
try {
// 1、注册驱动
// 方式1
Class.forName("oracle.jdbc.driver.OracleDriver");
// 方式2
//Driver drv = new oracle.jdbc.driver.OracleDriver();
//DriverManager.registerDriver(drv);
//方式3
//System.setProperty("jdbc.drivers", "oracle.jdbc.driver.OracleDriver");
// 2、通过驱动管理器获得数据库连接
String url = "jdbc:oracle:thin:@127.0.0.1:1521:FM";
String user = "dbtest";
String password = "yuu";
conn = DriverManager.getConnection(url, user, password);
DatabaseMetaData dmd = conn.getMetaData();
System.out.println(dmd.getDatabaseProductName());
System.out.println(dmd.getDatabaseProductVersion());
System.out.println(dmd.getDriverName());
System.out.println(dmd.getDriverVersion());
System.out.println(dmd.getURL());
System.out.println(dmd.getUserName());
stmt = conn.createStatement();
String sql = "select id, name, registertime hiredate, email from emp";
rs = stmt.executeQuery(sql);
ResultSetMetaData rsmd = rs.getMetaData();
int colCount = rsmd.getColumnCount();
for(int i = 1; i <= colCount; i++)
{
System.out.print(rsmd.getColumnName(i) + "\t");
}
System.out.println();
for(int i = 1; i <= colCount; i++)
{
System.out.print(rsmd.getColumnTypeName(i) + "\t");
}
System.out.println();
while(rs.next())
{
for(int j = 1; j <= colCount; j++)
{
System.out.print(rs.getString(rsmd.getColumnName(j)) + "\t");
}
System.out.println();
}
// 5、关闭资源
//rs.close();
//stmt.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"longxueyuu@gmail.com"
] | longxueyuu@gmail.com |
91232d8a73326d2db8dcb88c1cd83ddbcac890f5 | 76dcd63236954b5f6a80f554cb42807d561f27fd | /src/com/company/vfs/MetadataManager.java | b8265215a0594dfbc5a636944a7fe73edbf33a29 | [] | no_license | 4u7/virtual-filesystem | 8edd2ec2c44d369c417f1bae913efb529b046ed8 | 4981278410b336e32addb45c70222c00e60fbcbf | refs/heads/master | 2020-07-04T13:31:09.764965 | 2016-09-08T07:36:54 | 2016-09-08T07:36:54 | 67,216,402 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,813 | java | package com.company.vfs;
import com.company.vfs.Metadata.Type;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.BitSet;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
class MetadataManager {
private final static int MAP_BLOCK_CHAIN = 0;
private final static int METADATA_BLOCK_CHAIN = 1;
private final static int MAX_METADATA_OFFSET = 0;
private final static int MAP_OFFSET = 4;
private final ReadWriteLock lock = new ReentrantReadWriteLock();
private final Map<Integer, WeakReference<MappedMetadata>> metadataCache = new HashMap<>();
private final BitSet metadataMap;
private final BlockManager blockManager;
private final ByteStorage dataBlocksStorage;
private final Metadata root;
private int maxMetadata;
private final int metadataPerBlock;
MetadataManager(BlockManager blockManager, ByteStorage dataBlocksStorage) throws IOException {
this.blockManager = blockManager;
this.dataBlocksStorage = dataBlocksStorage;
this.metadataPerBlock = blockManager.getBlockSize() / MappedMetadata.BYTES;
maxMetadata = readMaxMetadata();
int byteLength = (maxMetadata + 7) / 8;
if(maxMetadata > 0) {
byte[] mapBytes = new byte[byteLength];
int mapOffset = blockManager.getGlobalOffset(MAP_BLOCK_CHAIN, MAP_OFFSET);
dataBlocksStorage.getBytes(mapOffset, mapBytes);
metadataMap = BitSet.valueOf(mapBytes);
}
else {
metadataMap = new BitSet();
}
this.root = new MappedMetadata(0);
if(!isAllocated(0)) {
setAllocated(0);
this.root.setType(Type.Directory);
this.root.setDataLength(0);
this.root.setFirstBlock(Metadata.NO_BLOCK);
}
}
Metadata getRoot() {
return root;
}
Metadata getMetadata(int metadataId) throws IOException {
if(metadataId < 0) {
throw new IndexOutOfBoundsException();
}
if(metadataId == 0) {
return root;
}
lock.readLock().lock();
try {
if (metadataMap.get(metadataId)) {
WeakReference<MappedMetadata> cachedMetadata = metadataCache.get(metadataId);
if(cachedMetadata != null && cachedMetadata.get() != null)
{
return cachedMetadata.get();
}
MappedMetadata metadata = new MappedMetadata(metadataId);
metadataCache.put(metadataId, new WeakReference<>(metadata));
return metadata;
}
return null;
}
finally {
lock.readLock().unlock();
}
}
Metadata allocateMetadata(Type type) throws IOException {
lock.writeLock().lock();
try {
int index = metadataMap.nextClearBit(0);
if(index >= maxMetadata) {
maxMetadata = index + 1;
writeMaxMetadata(maxMetadata);
}
setAllocated(index);
MappedMetadata metadata = new MappedMetadata(index);
metadata.setType(type);
metadata.setDataLength(0);
metadata.setFirstBlock(Metadata.NO_BLOCK);
metadataCache.put(index, new WeakReference<>(metadata));
return metadata;
}
finally {
lock.writeLock().unlock();
}
}
void deallocateMetadata(Metadata metadata) throws IOException {
lock.writeLock().lock();
try {
int index = metadata.getId();
setDeallocated(index);
metadataCache.remove(index);
int max = metadataMap.previousSetBit(maxMetadata - 1) + 1;
if(max < maxMetadata) {
maxMetadata = max;
writeMaxMetadata(maxMetadata);
int mapByteLength = (maxMetadata + 7) / 8;
blockManager.truncateBlockChain(MAP_BLOCK_CHAIN, MAP_OFFSET + mapByteLength);
blockManager.truncateBlockChain(METADATA_BLOCK_CHAIN,
metadataOffset(maxMetadata) + MappedMetadata.BYTES);
}
}
finally {
lock.writeLock().unlock();
}
}
int getMetadataCount() {
lock.readLock().lock();
try {
return metadataMap.cardinality();
}
finally {
lock.readLock().unlock();
}
}
private boolean isAllocated(int index) {
return metadataMap.get(index);
}
private void setAllocated(int index) throws IOException {
metadataMap.set(index);
// Set bit in storage
int byteOffset = MAP_OFFSET + index / 8;
int offset = blockManager.ensureGlobalOffset(MAP_BLOCK_CHAIN, byteOffset);
byte mapByte = dataBlocksStorage.getByte(offset);
mapByte |= 1 << (index % 8);
dataBlocksStorage.putByte(offset, mapByte);
}
private void setDeallocated(int index) throws IOException {
metadataMap.clear(index);
// Set bit in storage
int byteOffset = MAP_OFFSET + index / 8;
int offset = blockManager.ensureGlobalOffset(MAP_BLOCK_CHAIN, byteOffset);
byte mapByte = dataBlocksStorage.getByte(offset);
mapByte &= ~(1 << (index % 8));
dataBlocksStorage.putByte(offset, mapByte);
}
private int readMaxMetadata() throws IOException {
int maxOffset = blockManager.getGlobalOffset(MAP_BLOCK_CHAIN, MAX_METADATA_OFFSET);
return dataBlocksStorage.getInt(maxOffset);
}
private void writeMaxMetadata(int maxMetadata) throws IOException {
int maxOffset = blockManager.getGlobalOffset(MAP_BLOCK_CHAIN, MAX_METADATA_OFFSET);
dataBlocksStorage.putInt(maxOffset, maxMetadata);
}
private int metadataOffset(int index) {
int blockIndex = index / metadataPerBlock;
int metadataIndexInBlock = index % metadataPerBlock;
return blockIndex * blockManager.getBlockSize() + metadataIndexInBlock * MappedMetadata.BYTES;
}
private class MappedMetadata implements Metadata {
private static final int BYTES = 12;
private static final int FIELD_SIZE = 4;
private static final int TYPE_INDEX = 0;
private static final int DATA_LENGTH_INDEX = 1;
private static final int FIRST_BLOCK_INDEX = 2;
private final int id;
private final int offset;
volatile private Integer dataLength;
volatile private Integer firstBlock;
volatile private Type type;
MappedMetadata(int id) throws IOException {
this.id = id;
this.offset = blockManager.ensureGlobalOffset(METADATA_BLOCK_CHAIN, metadataOffset(id));
}
@Override
public int getDataLength() throws IOException {
if(dataLength == null) {
dataLength = readField(DATA_LENGTH_INDEX);
}
return dataLength;
}
@Override
public void setDataLength(int length) throws IOException {
dataLength = length;
writeField(DATA_LENGTH_INDEX, length);
}
@Override
public int getFirstBlock() throws IOException {
if(firstBlock == null) {
firstBlock = readField(FIRST_BLOCK_INDEX);
}
return firstBlock;
}
@Override
public void setFirstBlock(int block) throws IOException {
firstBlock = block;
writeField(FIRST_BLOCK_INDEX, block);
}
@Override
public Type getType() throws IOException {
if(type == null) {
type = Type.valueOf(readField(TYPE_INDEX));
}
return type;
}
@Override
public void setType(Type type) throws IOException {
this.type = type;
writeField(TYPE_INDEX, type.value);
}
@Override
public int getId() {
return id;
}
@Override
public boolean equals(Object obj) {
return obj != null &&
obj instanceof Metadata &&
id == ((Metadata) obj).getId();
}
@Override
public int hashCode() {
return Integer.hashCode(id);
}
private int readField(int index) throws IOException {
return dataBlocksStorage.getInt(offset + index * FIELD_SIZE);
}
private void writeField(int index, int value) throws IOException {
dataBlocksStorage.putInt(offset + index * FIELD_SIZE, value);
}
}
}
| [
"vyacheslav.v.gerasimov@gmail.com"
] | vyacheslav.v.gerasimov@gmail.com |
e2959f1dd4a375addf2bb7a5fba05e68c64934c2 | ead81b06a9454b0fec7801786cfaee8724e02658 | /BinaryTree/src/IntBTree.java | e4424b2ae624c30a360bdcadc737038071c64638 | [] | no_license | vinodhinia/DataStructures | 3c2001db55481161de7b6e04912b5eef80703e5f | 731dbbdb35e8701951f7ddbdd45a899dab720601 | refs/heads/master | 2021-01-02T08:16:00.645728 | 2017-11-16T21:52:22 | 2017-11-16T21:52:22 | 98,980,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,060 | java | import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Queue;
class node{
protected int d;
protected int depth;
protected node parent;
protected node left;
protected node right;
node(int x){
d = x;
depth = 0;
parent = null;
left = null;
right = null;
}
}
public class IntBTree {
private node root;
private int num;
private int height;
static final int NULL = -99999999;
IntUtil u = new IntUtil();
public IntBTree() {
root = null;
num =0;
height = 0;
}
public IntBTree(int[][] t) {
this();
buildTree(t);
}
public int height() {
return height;
}
private int size() {
return num;
}
public boolean isLeaf(node d) {
return (d.left == null && d.right ==null ? true : false);
}
protected node isOneKid(node n) {
if(n.left != null && n.right ==null)
return n.left;
else if(n.left == null && n.right != null)
return n.right;
return null;
}
protected node buildNode(int x) {
node n = new node(x);
incSize();
return n;
}
public int incSize() {
return ++num;
}
private void depth_r(node r) {
if(r!=null) {
if(r == root) {
r.depth = 0;
}else {
r.depth = r.parent.depth + 1;
if(r.depth > height) {
height = r.depth;
}
}
depth_r(r.left);
depth_r(r.right);
}
}
public void computeDepth() {
depth_r(root);
}
private void buildTree(int[][] t) {
int size = t.length;
int max = 0;
int min = 99999;
//STEP 1: Find MAX
for(int i=0; i<size ;i++) {
int[] a = t[i];
u.myassert(a.length == 3);
for(int j = 0;j<a.length;++j) {
if(a[j] > max)
max = a[j];
if((a[j]!=NULL) && (a[j] < min)) {
min = a[j];
}
u.myassert(min >=0);
}
}
// STEP 2: Build a tree
node[] tn = new node[max + 1];
for(int i =0;i<size;i++) {
int[] a = t[i];
//father
if(tn[a[0]] == null) {
tn[a[0]] = buildNode(a[0]);
}else if((tn[a[0]].left!=null) || (tn[a[0]].right!=null)) {
System.out.println(a[0] + " has already a left or right child. Bug in Input");
root = null;
num = 0;
return;
}
//Left Kid
if(a[1]!=NULL) {
if(tn[a[1]] == null)
tn[a[1]] = buildNode(a[1]);
tn[a[0]].left = tn[a[1]];
tn[a[1]].parent = tn[a[0]];
}
//Right Kid
if(a[2]!=NULL) {
if(tn[a[2]] == null)
tn[a[2]] = buildNode(a[2]);
tn[a[0]].right = tn[a[2]];
tn[a[2]].parent = tn[a[0]];
}
}
//STEP 3: Find the node that has no father
root = null;
for(int i=0;i<tn.length;i++) {
if((tn[i])!=null && (tn[i].parent == null)) {
if(root!= null) {
System.out.println("Two Roots " + tn[i].d + " Bug in input");
root = null;
num = 0;
return;
}
root = tn[i];
}
}
}
private void preorder_r(node r,int[] a, int k) {
}
public void writeDot(String fname, String info) {
if(root!=null) {
try {
FileWriter o = new FileWriter(fname);
computeDepth();
o.write("### Vinodhini Asok Kumar ###\n");
o.write("### dot - Tpdf" + fname +" -o "+ fname +".pdf\n");
o.write("digraph g{\n");
/* make label */
String label = " label = ";
label = label + "\" " + " # nodes = " + size() + " # height = " + height() ;
if (info != null) {
label = label + " " + info ;
}
label = label + "\"\n";
o.write(label);
Queue<node> q = new LinkedList();
q.add(root);
int nk = 0; // null kount
while (q.isEmpty() == false) {
node n = q.remove();
if (n.left == null && n.right == null) {
o.write(" " + n.d + "[xlabel = \"" + n.depth + "\"]");
continue;
}
if (n.left == null) {
String nulls = " null" + nk++;
o.write(nulls + " [shape=point style=invis]\n");
o.write(" " + n.d + " ->" + nulls + " [color=red style=invis]\n");
} else {
o.write(" " + n.d + " ->" + n.left.d + " [color=red]\n");
o.write(" " + n.d + "[xlabel = \"" + n.depth + "\"]");
q.add(n.left);
}
if (n.right == null) {
String nulls = " null" + nk++;
o.write(nulls + " [shape=point style=invis]\n");
o.write(" " + n.d + " ->" + nulls + " [color=blue style=invis]\n");
}
else {
o.write(" " + n.d + " ->" + n.right.d + " [color=blue]\n");
o.write(" " + n.d + "[xlabel = \"" + n.depth + "\"]");
q.add(n.right);
}
}
o.write("}\n");
o.close();
System.out.println("You can see dot file at " + fname);
System.out.println("Run the following command to get pdf file");
System.out.println("dot -Tpdf " + fname + " -o " + fname + ".pdf");
}catch(IOException e){
e.printStackTrace();
}
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
int[][] t = {
{6,2,7},
{2,1,4},
{7, IntBTree.NULL,9},
{4,3,5},
{8,8,IntBTree.NULL},
};
int[][] t1 = {
{2,1,4},
{4,3,5},
{9,8,IntBTree.NULL},
{7,IntBTree.NULL,9},
{6,2,7},
{10,2,7}
};
IntBTree bt = new IntBTree(t1);
bt.writeDot("/home/vinu/BinaryTree1", null);
}
}
| [
"vino@fileit.tax"
] | vino@fileit.tax |
b17776745447ef259f3d67379a000e7dd292afa9 | 6303db8df0466a892121871f6e93d067c218f3fa | /CursoJavaAlura/sintaxe-variaveis-e-fluxo/src/TestaWhile.java | ba07c533d5a2f0333bee90f8565de3a939e26c35 | [] | no_license | damaresmaris/CursoJavaAlura | 2e83eec275a4f7173d180988c08de99190f56c1d | 39a002ee9f16ad3a82c6407891966425b93f7bef | refs/heads/master | 2023-02-02T06:54:32.646395 | 2020-12-18T17:41:30 | 2020-12-18T17:41:30 | 320,581,520 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 267 | java |
public class TestaWhile {
public static void main(String[] args) {
int contador = 0;
while(contador <= 10) {
System.out.println(contador);
//contador = contador + 1;
//contador +=1;
++contador;
}
System.out.println(contador);
}
}
| [
"damaresms@outlook.com.br"
] | damaresms@outlook.com.br |
93182e995ce189dbc0d29a35efbb7d8268adda18 | 23660c6e64b76c3375ae868534548b185b369aca | /开发者挑战项目/粉墨——戏曲登场/fenmo/biz-user/src/main/java/com/netease/yunxin/nertc/demo/user/ui/VerifyCodeActivity.java | 8a754a32f057bcf46ea7e901cf4b3e609509fe2d | [
"MIT"
] | permissive | outmanchen/Developer-Challenge-2021 | 04d60f8d10b6284bfd7a5022f9122f6a5a6b4a19 | 1921e40d8b5db27a4c8e0d9695f32b3dc87c0fa7 | refs/heads/main | 2023-04-26T11:08:39.674018 | 2021-05-26T08:33:05 | 2021-05-26T08:33:05 | 370,955,452 | 1 | 0 | MIT | 2021-05-26T08:06:32 | 2021-05-26T08:06:31 | null | UTF-8 | Java | false | false | 5,405 | java | package com.netease.yunxin.nertc.demo.user.ui;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.blankj.utilcode.util.ToastUtils;
import com.netease.yunxin.nertc.demo.basic.BaseActivity;
import com.netease.yunxin.nertc.demo.basic.StatusBarConfig;
import com.netease.yunxin.nertc.demo.user.business.UserBizControl;
import com.netease.yunxin.nertc.demo.user.network.UserServerImpl;
import com.netease.yunxin.nertc.demo.user.ui.view.VerifyCodeView;
import com.netease.yunxin.nertc.user.R;
import io.reactivex.annotations.NonNull;
import io.reactivex.observers.ResourceSingleObserver;
public class VerifyCodeActivity extends BaseActivity {
public static final String PHONE_NUMBER = "phone_number";
private VerifyCodeView verifyCodeView;//验证码输入框
private TextView tvMsmComment;
private Button btnNext;
private TextView tvTimeCountDown;
private String phoneNumber;
private CountDownTimer countDownTimer;
private TextView tvResendMsm;
public static void startVerifyCode(Context context, String phoneNumber) {
Intent intent = new Intent();
intent.setClass(context, VerifyCodeActivity.class);
intent.putExtra(PHONE_NUMBER, phoneNumber);
context.startActivity(intent);
}
@Override
protected StatusBarConfig provideStatusBarConfig() {
return new StatusBarConfig.Builder()
.statusBarDarkFont(true)
.statusBarColor(R.color.colorWhite)
.fitsSystemWindow(true)
.build();
}
@Override
protected boolean ignoredLoginEvent() {
return true;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.verify_code_layout);
initView();
initData();
}
private void initView() {
verifyCodeView = findViewById(R.id.vcv_sms);
tvMsmComment = findViewById(R.id.tv_msm_comment);
btnNext = findViewById(R.id.btn_next);
tvTimeCountDown = findViewById(R.id.tv_time_discount);
tvResendMsm = findViewById(R.id.tv_resend_msm);
}
private void initData() {
phoneNumber = getIntent().getStringExtra(PHONE_NUMBER);
tvMsmComment.setText("验证码已经发送至 +86-" + phoneNumber + ",请在下方输入验证码");
btnNext.setOnClickListener(v -> {
String smsCode = verifyCodeView.getResult();
if (!TextUtils.isEmpty(smsCode)) {
login(smsCode);
}
});
tvTimeCountDown.setOnClickListener(v -> {
reSendMsm();
});
initCountDown();
}
private void initCountDown() {
tvTimeCountDown.setText("60s");
tvResendMsm.setVisibility(View.VISIBLE);
tvTimeCountDown.setEnabled(false);
countDownTimer = new CountDownTimer(60000, 1000) {
@Override
public void onTick(long l) {
tvTimeCountDown.setText((l / 1000) + "s");
}
@Override
public void onFinish() {
tvTimeCountDown.setText("重新发送");
tvTimeCountDown.setEnabled(true);
tvResendMsm.setVisibility(View.GONE);
}
};
countDownTimer.start();
}
private void reSendMsm() {
if (!TextUtils.isEmpty(phoneNumber)) {
UserServerImpl.sendVerifyCode(phoneNumber).subscribe(new ResourceSingleObserver<Boolean>() {
@Override
public void onSuccess(@NonNull Boolean aBoolean) {
if (aBoolean) {
ToastUtils.showLong("验证码重新发送成功");
initCountDown();
} else {
ToastUtils.showLong("验证码重新发送失败");
}
}
@Override
public void onError(@NonNull Throwable e) {
ToastUtils.showLong("验证码重新发送失败");
}
});
}
}
private void login(String msmCode) {
if (!TextUtils.isEmpty(phoneNumber) && !TextUtils.isEmpty(msmCode)) {
UserBizControl.login(phoneNumber, msmCode).subscribe(new ResourceSingleObserver<Boolean>() {
@Override
public void onSuccess(@NonNull Boolean aBoolean) {
if (aBoolean){
ToastUtils.showLong("登录成功");
startMainActivity();
}else {
ToastUtils.showLong("登录失败");
}
}
@Override
public void onError(@NonNull Throwable e) {
ToastUtils.showLong("登录失败");
}
});
}
}
private void startMainActivity() {
Intent intent = new Intent();
intent.addCategory("android.intent.category.DEFAULT");
intent.setAction("com.nertc.g2.action.main");
startActivity(intent);
finish();
}
}
| [
"jnzhou90@163.com"
] | jnzhou90@163.com |
c8759ff451bb1ec15997f0b8e4f66a8cac0c5a63 | 4af46c51990059c509ed9278e8708f6ec2067613 | /java/l2server/gameserver/network/serverpackets/ExShowBeautyMenuPacket.java | 2060893d1e5b3907d3b181d1364c0ba025659036 | [] | no_license | bahamus007/l2helios | d1519d740c11a66f28544075d9e7c628f3616559 | 228cf88db1981b1169ea5705eb0fab071771a958 | refs/heads/master | 2021-01-12T13:17:19.204718 | 2017-11-15T02:16:52 | 2017-11-15T02:16:52 | 72,180,803 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,334 | java | /*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package l2server.gameserver.network.serverpackets;
import l2server.gameserver.model.actor.instance.L2PcInstance;
/**
* @author Pere
*/
public final class ExShowBeautyMenuPacket extends L2GameServerPacket
{
private boolean _isRestore;
private L2PcInstance _player;
public ExShowBeautyMenuPacket(boolean isRestore, L2PcInstance player)
{
_isRestore = isRestore;
_player = player;
}
@Override
protected final void writeImpl()
{
writeD(_isRestore ? 1 : 0); //0 add 1 remove
writeD(_player.getAppearance().getHairStyle());
writeD(_player.getAppearance().getHairColor());
writeD(_player.getAppearance().getFace());
}
}
| [
"singto52@hotmail.com"
] | singto52@hotmail.com |
5418a89f34388fdad0f83c194a0686cbe7410f3f | 262cf88ff96ff51eeda777fbd0e4b699afa87b5a | /src/java/logica/FaseProyectoLogicaLocal.java | c29db5f96d4fd19e2a973ff13e3d6b4aa973475e | [] | no_license | AndresFe/proyecto_competencias | 64cec520639806b2cb26be58c47cc3397b31a8b4 | 2e70ad7bab9a3cbd472487522eb30b26019d92d2 | refs/heads/master | 2021-01-13T00:52:21.099917 | 2016-04-02T15:32:18 | 2016-04-02T15:32:18 | 54,612,937 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | 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 logica;
import java.util.List;
import javax.ejb.Local;
import modelo.FaseProyecto;
/**
*
* @author andres
*/
@Local
public interface FaseProyectoLogicaLocal {
public void registrarFaseProyecto(FaseProyecto fase) throws Exception;
public void modificarFaseProyecto(FaseProyecto fase) throws Exception;
public FaseProyecto consultarxCodigoFaseProyecto(int codigo) throws Exception;
public List<FaseProyecto> consultarTodosFaseProyecto() throws Exception;
}
| [
"andresvasquez199402@gmail.com"
] | andresvasquez199402@gmail.com |
2a611f411287df6e02065c69e4b0d8b1cb645a2a | a85c05474b289d7747d4e15adaca87eeca080594 | /app/src/main/java/com/example/recyclerview/NoteDAO.java | c1a31ea2e22812b8a2e561dd10200764168e8149 | [] | no_license | NejiHamid/ApplicationAndroid | 6a30477a7c6cfdfb55188dddc24d30f61b4cbc3d | c2f229800f71e636265e011da8fbb28cf31ab3cf | refs/heads/master | 2022-05-24T23:37:30.920756 | 2020-04-30T05:06:36 | 2020-04-30T05:06:36 | 260,117,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 829 | java | package com.example.recyclerview;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Transaction;
import androidx.room.Update;
import java.util.List;
@Dao
public abstract class NoteDAO {
@Query("SELECT * FROM note")
public abstract List<NoteDto> getListeCourses();
@Query("SELECT COUNT(*) FROM note WHERE intitule = :intitule")
public abstract long countCoursesParIntitule(String intitule);
@Insert
public abstract void insert(NoteDto... note);
@Update
public abstract void update(NoteDto... notes);
@Delete
public abstract void delete(NoteDto... notes);
@Transaction
public void insertDelete(NoteDto noteDto1, NoteDto noteDto2)
{
insert(noteDto1);
delete(noteDto1);
}
}
| [
"abdelhamid.neji@vif.fr"
] | abdelhamid.neji@vif.fr |
f09804e081b0e6a2ca02d85007e80f102833508a | d5e0f48ab2e0d94c929185a10f130d7a491d41e5 | /src/com/decorator/Util.java | 95d92c16ca71731166f69fb7499752ff77b4a84b | [] | no_license | amitesh786/SalesTax | e3a87398baaa6ae7e2db08a938207dad487b3520 | 6da913d41ba4029bd0eb486ed89ce8fa8093d120 | refs/heads/master | 2021-08-23T11:56:39.275372 | 2017-12-04T20:36:08 | 2017-12-04T20:36:08 | 112,942,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,696 | java | package com.decorator;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashSet;
import java.util.Set;
public class Util {
private static Set<String> exemptItems = null;
static {
exemptItems = new HashSet<String>();
exemptItems.add("book");
exemptItems.add("headache pills");
exemptItems.add("packet of headache pills");
exemptItems.add("box of imported chocolates");
exemptItems.add("imported box of chocolates");
exemptItems.add("box of chocolates");
exemptItems.add("chocolate");
exemptItems.add("chocolate bar");
exemptItems.add("pills");
}
static public double nearest5Percent(double amount) {
return new BigDecimal(Math.ceil(amount * 20)/20).setScale(2,RoundingMode.HALF_UP).doubleValue();
}
public static double roundPrice(double amount) {
return new BigDecimal(amount).setScale(2, RoundingMode.HALF_UP)
.doubleValue();
}
public static boolean isExempt(String name) {
return exemptItems.contains(name);
}
public static void getFromFile(String fileName) {
ShoppingCart sc = new ShoppingCart();
try {
BufferedReader in = new BufferedReader(new FileReader(fileName));
String str;
while ((str = in.readLine()) != null) {
if (ItemParser.matches(str) && !str.isEmpty())
sc.put(ItemParser.parser(str), ItemParser.count(str));
else
if (!str.isEmpty()) System.out.println("unknown line format: " + str);
}
in.close();
} catch (IOException e) {
System.out.println("error:" + e.getMessage());
return;
}
sc.printOrderInput();
sc.printOrderResults();
}
}
| [
"amitesh.jy.786@gmail.com"
] | amitesh.jy.786@gmail.com |
d747fc6b976df30fb6837df854623a1636c9e72b | 52fe3fc4c43b8cbd9586b7198a1e2ffc92c138df | /app/src/main/java/com/evgeniy/recipesapp/data/LocalDatabase.java | 4d2c43497856f1698531ed18824a987a76523fcd | [] | no_license | DeEsthete/Android-RecipeApp | 5ef45c3ab1a33e3f9acdf257859b1dc70d655817 | d476e74d435dd098415de3d676a37ae2ef1fa69d | refs/heads/master | 2022-10-08T11:50:28.399361 | 2020-06-10T16:32:49 | 2020-06-10T16:32:49 | 270,990,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java | package com.evgeniy.recipesapp.data;
import androidx.room.Database;
import androidx.room.RoomDatabase;
import com.evgeniy.recipesapp.dao.RecipeDao;
import com.evgeniy.recipesapp.entity.RecipeEntity;
@Database(entities = {RecipeEntity.class}, version = 1)
public abstract class LocalDatabase extends RoomDatabase {
public abstract RecipeDao recipeDao();
}
| [
"djoniqaz@gmail.com"
] | djoniqaz@gmail.com |
7ac94e12771e79948b39be3ea9c164638bd01de5 | 0077ed1d47b03e159b27ee3af2d72ddab3964af9 | /wanduoduo/src/main/java/com/wanduoduo/utils/GsonTools.java | a65d6f388ac6391ecda77768f8d55ce737e2a50e | [] | no_license | jockie911/wanduoduo | 85b2d4985d4fdcffd93a29b89aa3bed68cadbe76 | 70605ed8abd25b3d72949d3b99c5e049e942e37a | refs/heads/master | 2020-07-15T02:55:26.483748 | 2017-06-14T07:39:34 | 2017-06-14T07:39:34 | 94,302,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,418 | java | package com.wanduoduo.utils;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.List;
import java.util.Map;
/**
* Created by jockie on 2016/3/31.
*/
public class GsonTools {
public GsonTools() {
}
public static String createGsonString(Object object) {
Gson gson = new Gson();
String gsonString = gson.toJson(object);
return gsonString;
}
public static <T> T changeGsonToBean(String gsonString, Class<T> cls) {
Gson gson = new Gson();
T t = gson.fromJson(gsonString, cls);
return t;
}
public static <T> List<T> changeGsonToList(String gsonString, Class<T> cls) {
Gson gson = new Gson();
List<T> list = gson.fromJson(gsonString, new TypeToken<List<T>>() {
}.getType());
return list;
}
public static <T> List<Map<String, T>> changeGsonToListMaps(
String gsonString) {
List<Map<String, T>> list = null;
Gson gson = new Gson();
list = gson.fromJson(gsonString, new TypeToken<List<Map<String, T>>>() {
}.getType());
return list;
}
public static <T> Map<String, T> changeGsonToMaps(String gsonString) {
Map<String, T> map = null;
Gson gson = new Gson();
map = gson.fromJson(gsonString, new TypeToken<Map<String, T>>() {
}.getType());
return map;
}
}
| [
"substitute001@live.com"
] | substitute001@live.com |
0ce7a61bc8bbe419be1247eb75d1c5fb6a669ac6 | bc0ecf8cc3ac3cb3bb95f09312ba75e0062c6969 | /src/main/java/efuture/domain/member/MemberVO.java | 84becf9122291b6ee9bf6738d3f373d5e955f402 | [] | no_license | juyoungyoo/TimeReport | c83043876d1c59af48a39389e39185a3f400f2c9 | f92b8b30d8a65a83c2fc07c3c4ad5491b71b6d2d | refs/heads/master | 2022-12-25T20:16:37.707742 | 2018-03-19T01:04:56 | 2018-03-19T01:04:56 | 125,488,608 | 0 | 0 | null | 2022-12-16T06:02:02 | 2018-03-16T08:44:03 | JavaScript | UTF-8 | Java | false | false | 490 | java | package efuture.domain.member;
import lombok.Data;
import java.util.Date;
/**
* 회원 테이블
* Created by user on 2017-03-29.
*/
@Data
public class MemberVO {
private int seq;
private String userid; // 아이디
private String pwd; // 비밀번호
private String name; // 이름
private String dept; // 부서 TB_COMMON_MASTESR 참고
private String grade; // 회원권한 TB_COMMON_MASTESR 참고
private Date regdate; // 등록일
}
| [
"juy5790@outlook.com"
] | juy5790@outlook.com |
04a676ceacf28b275f8b9a5c9b5543bca8947b6c | 532d22f9cd20ca2d9dfebc9c4c51b0ffe7902c5e | /AdX/src/main/java/edu/umich/eecs/tac/auction/AuctionFactory.java | ab463fa0096734f79bf4929816a8e5fbc6f80568 | [] | no_license | tomergreenwald/tac-adx | e9884f32d3d3dbc9452d2d5b33664a16091000fb | de6bafb67d35ef20f85e4ed431e486c0f8e8d131 | refs/heads/master | 2020-12-24T06:50:01.388563 | 2016-11-11T10:21:10 | 2016-11-11T10:21:10 | 32,334,996 | 8 | 8 | null | null | null | null | UTF-8 | Java | false | false | 2,209 | java | /*
* AuctionFactory.java
*
* COPYRIGHT 2008
* THE REGENTS OF THE UNIVERSITY OF MICHIGAN
* ALL RIGHTS RESERVED
*
* PERMISSION IS GRANTED TO USE, COPY, CREATE DERIVATIVE WORKS AND REDISTRIBUTE THIS
* SOFTWARE AND SUCH DERIVATIVE WORKS FOR NONCOMMERCIAL EDUCATION AND RESEARCH
* PURPOSES, SO LONG AS NO FEE IS CHARGED, AND SO LONG AS THE COPYRIGHT NOTICE
* ABOVE, THIS GRANT OF PERMISSION, AND THE DISCLAIMER BELOW APPEAR IN ALL COPIES
* MADE; AND SO LONG AS THE NAME OF THE UNIVERSITY OF MICHIGAN IS NOT USED IN ANY
* ADVERTISING OR PUBLICITY PERTAINING TO THE USE OR DISTRIBUTION OF THIS SOFTWARE
* WITHOUT SPECIFIC, WRITTEN PRIOR AUTHORIZATION.
*
* THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE UNIVERSITY OF
* MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT WARRANTY BY THE
* UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
* LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE. THE REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY
* DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WITH
* RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE,
* EVEN IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
package edu.umich.eecs.tac.auction;
import edu.umich.eecs.tac.props.Auction;
import edu.umich.eecs.tac.props.PublisherInfo;
import edu.umich.eecs.tac.props.Query;
import edu.umich.eecs.tac.props.ReserveInfo;
import edu.umich.eecs.tac.props.SlotInfo;
import edu.umich.eecs.tac.util.config.ConfigProxy;
/**
* @author Patrick Jordan
*/
public interface AuctionFactory {
Auction runAuction(Query query);
public BidManager getBidManager();
public PublisherInfo getPublisherInfo();
public void setPublisherInfo(PublisherInfo publisherInfo);
public void setBidManager(BidManager bidManager);
public SlotInfo getSlotInfo();
public void setSlotInfo(SlotInfo slotInfo);
public ReserveInfo getReserveInfo();
public void setReserveInfo(ReserveInfo reserveInfo);
public void configure(ConfigProxy configProxy);
}
| [
"tomerg@gmail.com"
] | tomerg@gmail.com |
e2522fceca96f46b0339d624d07bdea92271a062 | ba23bbea6fb9582f73c83018e7f1481f7124379d | /SinglyLinkedList/Node.java | 1dbf63a3d1b625a34482b5d48ba3d03dbb8fde93 | [] | no_license | jainnishkarsh18/Data_Structure | 5fbbf2a72470b9684ddde6f1cb8451060803a851 | 94d08d5d60b5c27694828946f1a50b182ba9ac75 | refs/heads/main | 2023-04-01T23:38:51.440976 | 2021-04-11T15:57:36 | 2021-04-11T15:57:36 | 344,724,221 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 171 | java | package Java_practice;
public class Node {
int data;
Node next;
public Node(int data) {
this.data = data;
this.next = null;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
0e8506bb26923b695084c7de3c8b1c045192ac7e | 3ec1a4d9358f172233574efc7fb9abe868fdb7de | /src/main/java/com/upcloud/client/models/StorageTier.java | 65238c57254edcb8610d1e2c725b112bd216def6 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | UpCloudLtd/upcloud-java-api | 99b7941e206555430870491d36c933579beb55e9 | da6bc0346ec360c02b73727672c3431aacde266d | refs/heads/master | 2021-07-06T13:50:51.073280 | 2021-05-25T13:45:37 | 2021-05-25T13:45:37 | 100,364,381 | 4 | 2 | MIT | 2021-05-25T13:45:37 | 2017-08-15T09:58:45 | Java | UTF-8 | Java | false | false | 2,104 | java | /*
* Upcloud api
* The UpCloud API consists of operations used to control resources on UpCloud. The API is a web service interface. HTTPS is used to connect to the API. The API follows the principles of a RESTful web service wherever possible. The base URL for all API operations is https://api.upcloud.com/. All API operations require authentication.
*
* OpenAPI spec version: 1.2.0
*
*/
package com.upcloud.client.models;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* Storage resources are divided into two tiers: * `hdd` (*HDD storages*) - Data is stored on hard disks resulting in lower costs than MaxIOPS. * `maxiops` (*MaxIOPS storages*) - Data is stored on MaxIOPS storage arrays resulting in highest throughput and lowest response times. Storage tiers affect both the performance and price of the storage.
*/
@JsonAdapter(StorageTier.Adapter.class)
public enum StorageTier {
HDD("hdd"),
MAXIOPS("maxiops");
private String value;
StorageTier(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StorageTier fromValue(String text) {
for (StorageTier b : StorageTier.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<StorageTier> {
@Override
public void write(final JsonWriter jsonWriter, final StorageTier enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StorageTier read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StorageTier.fromValue(String.valueOf(value));
}
}
}
| [
"gang7e@gmail.com"
] | gang7e@gmail.com |
5984996ca548b3c047935719bf6aacc5f07f022d | b146bd0679444b092f2a53163c752f4b9752fc6b | /org.xtext.daogen2/src-gen/org/xtext/parser/antlr/Daogen2AntlrTokenFileProvider.java | 9ba9e5b5c7859e58dfa8a3831bdbb0b55eccf36d | [] | no_license | xandjiji/DaoGen | 2c73b8257fa7b797493e79c525eab9bde88e7a77 | b15e5efcc9039f67e007e9bac1411d643a0504ab | refs/heads/master | 2020-04-18T19:51:06.651429 | 2018-11-22T12:46:47 | 2018-11-22T12:46:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | /*
* generated by Xtext 2.15.0
*/
package org.xtext.parser.antlr;
import java.io.InputStream;
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
public class Daogen2AntlrTokenFileProvider implements IAntlrTokenFileProvider {
@Override
public InputStream getAntlrTokenFile() {
ClassLoader classLoader = getClass().getClassLoader();
return classLoader.getResourceAsStream("org/xtext/parser/antlr/internal/InternalDaogen2.tokens");
}
}
| [
"biigarciam@gmail.com"
] | biigarciam@gmail.com |
32eb9823ba6386a966409ee8339f2ef7b37d4cba | 98ce066218363a92aabe158d319bde293a1e4383 | /src/main/java/com/ithinksky/patterns/a04behavioral/t09visitor/CTOVisitor.java | fbac29035c37317acb6f05f8e3be29febb9bf43a | [
"MIT"
] | permissive | ithinksky/java-patterns | 92d8bcfa8ed958018d77e99d9cbb93b67292bfc7 | 372735e3296b6cf14ec980fd342afd4ebc60f92f | refs/heads/master | 2022-08-15T15:46:27.733636 | 2022-07-29T02:47:10 | 2022-07-29T02:47:10 | 263,059,035 | 6 | 2 | MIT | 2020-07-02T18:51:07 | 2020-05-11T14:01:40 | Java | UTF-8 | Java | false | false | 451 | java | package com.ithinksky.patterns.a04behavioral.t09visitor;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
/**
* @author tengpeng.gao
*/
@Slf4j
public class CTOVisitor implements Visitor {
@Override
public void visit(ProjectElement element) {
log.info("CTO Visitor Element");
element.signature("CTO", new Date());
log.info("element === {}", new Gson().toJson(element));
}
}
| [
"tengpeng.gao@gmail.com"
] | tengpeng.gao@gmail.com |
76d17a5c4621f0b72bf515529da21c138ed8d111 | c985f6a4d4c93175e37c3d4ad8f9cafe8a4d15c1 | /FinalChatApplication/ServerMain.java | d1d9c2ade58302fad85d8bcaf72d08738afb7184 | [] | no_license | csr88/MultiUser-Chat-Application | e0fe5a647c2f0ca7e6b4ba1d0dc89671f32f96b2 | 1643d9f1aeb78a7bf64dc1068baf58b79d7ca048 | refs/heads/main | 2023-05-01T03:36:13.138672 | 2021-05-17T02:55:11 | 2021-05-17T02:55:11 | 365,523,114 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 258 | java |
public class ServerMain {
public static void main(String[] args) {
int port = 8818;
Server server = new Server(port);
server.start();
}
}
/* usernames and password
shishir = p@ssword
guest = guest69
anonymous = mrrobot
*/
| [
"noreply@github.com"
] | noreply@github.com |
05fc469df1494b40f035f06aa380d4d8e82d79e2 | c3d5529d9e391d1c345f10fd2ea4d640dd1b7ab7 | /src/MutiThread_test/window_tik.java | 448eb82f974cec49d43cb04d84a3001a59b03b46 | [] | no_license | Alpha2Cool/java_study | cebd1156c9331bf9c782d310e4350b298be70ebd | 56b0a06f4d08c65420b82cda06e25751ea64b377 | refs/heads/master | 2023-02-06T21:37:54.090100 | 2023-01-29T17:54:42 | 2023-01-29T17:54:42 | 250,977,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,347 | java | package MutiThread_test;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class window_tik implements Runnable {
private int ticket = 100;
Object obj = new Object(); //也可以是String obj = new String(); 任意写,都叫锁对象
Lock l = new ReentrantLock();
@Override
public void run() {
while (true) {
// synfun();
l.lock();
if (ticket > 0) {
try {
Thread.sleep(10); //sleep必须throw或try catch
System.out.println(Thread.currentThread().getName() + "-->正在卖第" + ticket + "张票");
ticket--;
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
l.unlock();
}
}
}
}
//使用同步方法
// public synchronized void synfun() {
// if (ticket > 0) {
// try {
// Thread.sleep(10); //sleep必须throw或try catch
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// System.out.println(Thread.currentThread().getName() + "-->正在卖第" + ticket + "张票");
// ticket--;
// }
// }
}
| [
"transistors1996@gmail.com"
] | transistors1996@gmail.com |
6cd482b0e24628e3b79ba6c28cb74bb4e026c4b8 | d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb | /PROMISE/archives/xalan/2.7/org/apache/.svn/pristine/6c/6cd482b0e24628e3b79ba6c28cb74bb4e026c4b8.svn-base | 8474694a6de32382070569d325a90fce4521316d | [] | no_license | hvdthong/DEFECT_PREDICTION | 78b8e98c0be3db86ffaed432722b0b8c61523ab2 | 76a61c69be0e2082faa3f19efd76a99f56a32858 | refs/heads/master | 2021-01-20T05:19:00.927723 | 2018-07-10T03:38:14 | 2018-07-10T03:38:14 | 89,766,606 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,223 | /*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
package org.apache.xalan.xsltc.compiler;
import org.apache.bcel.generic.ALOAD;
import org.apache.bcel.generic.ASTORE;
import org.apache.bcel.generic.ConstantPoolGen;
import org.apache.bcel.generic.INVOKEINTERFACE;
import org.apache.bcel.generic.INVOKESPECIAL;
import org.apache.bcel.generic.InstructionList;
import org.apache.bcel.generic.LocalVariableGen;
import org.apache.bcel.generic.NEW;
import org.apache.xalan.xsltc.compiler.util.ClassGenerator;
import org.apache.xalan.xsltc.compiler.util.MethodGenerator;
import org.apache.xalan.xsltc.compiler.util.NodeType;
import org.apache.xalan.xsltc.compiler.util.Type;
import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
import org.apache.xalan.xsltc.compiler.util.Util;
/**
* @author G. Todd Miller
*/
final class FilteredAbsoluteLocationPath extends Expression {
private Expression _path; // may be null
public FilteredAbsoluteLocationPath() {
_path = null;
}
public FilteredAbsoluteLocationPath(Expression path) {
_path = path;
if (path != null) {
_path.setParent(this);
}
}
public void setParser(Parser parser) {
super.setParser(parser);
if (_path != null) {
_path.setParser(parser);
}
}
public Expression getPath() {
return(_path);
}
public String toString() {
return "FilteredAbsoluteLocationPath(" +
(_path != null ? _path.toString() : "null") + ')';
}
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
if (_path != null) {
final Type ptype = _path.typeCheck(stable);
if (ptype instanceof NodeType) { // promote to node-set
_path = new CastExpr(_path, Type.NodeSet);
}
}
return _type = Type.NodeSet;
}
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
if (_path != null) {
final int initDFI = cpg.addMethodref(DUP_FILTERED_ITERATOR,
"<init>",
"("
+ NODE_ITERATOR_SIG
+ ")V");
// Backwards branches are prohibited if an uninitialized object is
// on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
// We don't know whether this code might contain backwards branches,
// so we mustn't create the new object until after we've created
// the suspect arguments to its constructor. Instead we calculate
// the values of the arguments to the constructor first, store them
// in temporary variables, create the object and reload the
// arguments from the temporaries to avoid the problem.
// Compile relative path iterator(s)
LocalVariableGen pathTemp =
methodGen.addLocalVariable("filtered_absolute_location_path_tmp",
Util.getJCRefType(NODE_ITERATOR_SIG),
il.getEnd(), null);
_path.translate(classGen, methodGen);
il.append(new ASTORE(pathTemp.getIndex()));
// Create new Dup Filter Iterator
il.append(new NEW(cpg.addClass(DUP_FILTERED_ITERATOR)));
il.append(DUP);
il.append(new ALOAD(pathTemp.getIndex()));
// Initialize Dup Filter Iterator with iterator from the stack
il.append(new INVOKESPECIAL(initDFI));
}
else {
final int git = cpg.addInterfaceMethodref(DOM_INTF,
"getIterator",
"()"+NODE_ITERATOR_SIG);
il.append(methodGen.loadDOM());
il.append(new INVOKEINTERFACE(git, 1));
}
}
}
| [
"hvdthong@github.com"
] | hvdthong@github.com | |
626bbc93209b7df6320388544bf01876c8698bf3 | 67680c165cf02effa00f4bac8cab254b0607ee23 | /LifeCycle/src/main/java/it/androidavanzato/rxorientation/RetainedObservableFragment.java | 302918de9c4672ac24cb609d424ee49c191e37ac | [] | no_license | AndroidAvanzato/Capitolo2 | 44d0b9bae38513c2ff56b791150b04749e5c1ad9 | c5b08f96a7c725c6d3ea084fff3efb32b2f2d0b2 | refs/heads/master | 2021-01-01T18:48:57.677388 | 2015-05-17T10:29:19 | 2015-05-17T10:29:19 | 35,761,855 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,110 | java | package it.androidavanzato.rxorientation;
import android.support.v4.app.Fragment;
import rx.Observable;
import rx.Subscription;
import rx.observables.ConnectableObservable;
import rx.subscriptions.Subscriptions;
public class RetainedObservableFragment<T> extends Fragment {
private Subscription connectableSubscription = Subscriptions.empty();
private ConnectableObservable<T> observable;
public RetainedObservableFragment() {
setRetainInstance(true);
}
public void bind(ConnectableObservable<T> observable) {
this.observable = observable;
connectableSubscription = observable.connect();
}
@Override public void onDestroy() {
super.onDestroy();
connectableSubscription.unsubscribe();
}
public Observable<T> get() {
if (observable == null) {
return Observable.empty();
}
return observable;
}
public boolean isRunning() {
return observable != null;
}
public void clear() {
observable = null;
connectableSubscription = Subscriptions.empty();
}
}
| [
"fabio.collini@gmail.com"
] | fabio.collini@gmail.com |
548aac1059c5dd293a7c33e369c96d2435d6fb48 | 475931c8cea30bef75619c308b90cb51dbb170cb | /app/src/main/java/ru/chizhikov/weather/fragments/ListOfCities.java | ad2f2004a5b6561e9148920c89c7f6e30f939fae | [] | no_license | gruf1977/Weather | 6a709a21d2a7bc6c06856f9156af5576a4824ea0 | 90fbac064587b053f1c7f72609aeb9e5a34007b9 | refs/heads/master | 2020-07-29T19:57:37.837159 | 2019-11-22T07:59:25 | 2019-11-22T07:59:25 | 209,941,679 | 0 | 1 | null | 2019-11-21T04:16:42 | 2019-09-21T07:12:55 | Java | UTF-8 | Java | false | false | 9,728 | java | package ru.chizhikov.weather.fragments;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
import com.google.android.material.snackbar.Snackbar;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import ru.chizhikov.weather.rest.CityRepo;
import ru.chizhikov.weather.rest.entities.CityRequestRestModel;
import ru.chizhikov.weather.MainActivity;
import ru.chizhikov.weather.OnSelectedPositionCity;
import ru.chizhikov.weather.R;
import static android.content.Context.LOCATION_SERVICE;
import static android.content.Context.MODE_PRIVATE;
public class ListOfCities extends Fragment {
private static final int PERMISSION_REQUEST_CODE = 10;
private static final String TAG = MainActivity.class.getName();
private LocationManager locationManager;
private int numberPosition;
private ListView listView;
private TextView emptyTextView;
private boolean isLandscapeOrientation;
private OnSelectedPositionCity listener;
private Boolean flag = false;
private String[] arrayCities;
private ArrayAdapter adapter;
public void setNumberPosition(int numberPosition) {
this.numberPosition = numberPosition;
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View viewListOfCities = inflater
.inflate(R.layout.fragment_list_cities, container, false);
if (ActivityCompat.checkSelfPermission(getContext(),
Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED
|| ActivityCompat.checkSelfPermission(getContext(),
Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
requestLocation();
} else {
requestLocationPermissions();
}
initViews(viewListOfCities);
numberPosition = MainActivity.getNumberPositionTemp();
return viewListOfCities;
}
@Override
public void onResume() {
super.onResume();
if (isLandscapeOrientation){
listener.onPositionSelected(numberPosition);
} else if (flag){
listener.onPositionSelected(numberPosition);
flag = false;
}
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
isLandscapeOrientation = getResources().getConfiguration().orientation
== Configuration.ORIENTATION_LANDSCAPE;
listener = (OnSelectedPositionCity) getActivity();
checkPosition();
}
private void initViews(View view) {
listView = view.findViewById(R.id.cities_list_view);
emptyTextView = view.findViewById(R.id.cities_list_empty_view);
createListView();
}
private void createListView() {
adapter = new ArrayAdapter<>(Objects.requireNonNull(getActivity()),
android.R.layout.simple_list_item_activated_1, setArrayCities());
listView.setAdapter(adapter);
listView.setEmptyView(emptyTextView);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
numberPosition = position;
getWeatherParameters();
}
});
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
outState.putInt("CurrentCity", numberPosition);
MainActivity.setNumberPositionTemp(numberPosition);
super.onSaveInstanceState(outState);
}
private void getWeatherParameters() {
checkPosition();
listener.onPositionSelected(numberPosition);
}
private void checkPosition(){
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
listView.setItemChecked(numberPosition, true);
}
private String[] setArrayCities() {
SharedPreferences listCities = Objects.requireNonNull(getActivity())
.getSharedPreferences("listCities",MODE_PRIVATE);
String nameCityStr = listCities.getString("LIST_CITIES", "Moscow");
nameCityStr = nameCityStr.replace("[", "");
nameCityStr = nameCityStr.replace("]", "");
arrayCities = nameCityStr.split(", ");
return arrayCities;
}
@SuppressLint("MissingPermission")
private void requestLocation() {
if (ActivityCompat.checkSelfPermission(getContext(),
Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(getContext(),
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)
return;
locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_COARSE);
String provider = locationManager.getBestProvider(criteria, true);
if (provider != null) {
locationManager.requestLocationUpdates(provider, 10000, 10,
new LocationListener() {
@Override
public void onLocationChanged(Location location) {
if (location != null) {
String lat = String.valueOf(location.getLatitude());
String lon = String.valueOf(location.getLongitude());
readCityFromInternet(lat, lon);
}
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public void onProviderEnabled(String provider) {
}
@Override
public void onProviderDisabled(String provider) {
}
});
}
}
private void requestLocationPermissions() {
if (!ActivityCompat.shouldShowRequestPermissionRationale(
Objects.requireNonNull(getActivity()),
Manifest.permission.CALL_PHONE)) {
ActivityCompat.requestPermissions(getActivity(),
new String[]{
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION
},
PERMISSION_REQUEST_CODE);
}
}
private void readCityFromInternet(String lat, String lon){
CityRepo.getSingleton().getAPI().loadWeather(lat, lon,
"f3f2763fe63803beef4851d6365c83bc")
.enqueue(new Callback<CityRequestRestModel>() {
@Override
public void onResponse(@NonNull Call<CityRequestRestModel> call,
@NonNull Response<CityRequestRestModel> response) {
if (response.body() != null && response.isSuccessful()) {
renderWeather(response.body());
}
}
@Override
public void onFailure(Call<CityRequestRestModel> call, Throwable t) {
return;
}
});
}
private void renderWeather(CityRequestRestModel body) {
String city = body.city;
if (isAdded()) {
ArrayList namesCities = new ArrayList(Arrays.asList(arrayCities));
if (!namesCities.contains(city)) {
addCity(city, namesCities);
}
}
}
private void addCity(final String city, final ArrayList nameCity) {
Snackbar.make(Objects.requireNonNull(getView()),
getResources().getString(R.string.you_in) + " " + city + " "
+ getResources().getString(R.string.add_this_place), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.yes), new View.OnClickListener() {
@Override
public void onClick(View v) {
nameCity.add(city);
SharedPreferences listCities = Objects.requireNonNull(getActivity())
.getSharedPreferences("listCities", MODE_PRIVATE);
SharedPreferences.Editor ed = listCities.edit();
ed.putString("LIST_CITIES", String.valueOf(nameCity));
ed.apply();
createListView();
}
}).show();
}
} | [
"gpuf@bk.ru"
] | gpuf@bk.ru |
9c13c5182d77fd6204f16c70828c203a008881a8 | e49e317ad439b089081c789f9f63e7ec32a8b52d | /app/src/main/java/com/eltamiuzcom/kafu/Activity/MainActivity.java | 87472c8b45f238899ea240a778175fc1116267be | [] | no_license | mostafazaghlol/kafu | a8a6b0463bae30f4023420b909f7cca508302ca2 | c353b7803a060e57479fc1c1d84f3fc43174324e | refs/heads/master | 2020-04-28T05:36:34.844763 | 2019-03-11T15:14:28 | 2019-03-11T15:14:28 | 175,026,762 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,344 | java | package com.eltamiuzcom.kafu.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import com.eltamiuzcom.kafu.Fragment.AuctionFragment;
import com.eltamiuzcom.kafu.Fragment.BestFragment;
import com.eltamiuzcom.kafu.Fragment.HomeFragment;
import com.eltamiuzcom.kafu.Fragment.moreFragment;
import com.eltamiuzcom.kafu.Fragment.oneAuctionFragment;
import com.eltamiuzcom.kafu.R;
import com.eltamiuzcom.kafu.Utils.contants;
public class MainActivity extends AppCompatActivity implements BottomNavigationView.OnNavigationItemSelectedListener {
BottomNavigationView navigation;
SharedPreferences mSharedPreferences;
SharedPreferences.Editor editor;
private String auctiontype,role;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mSharedPreferences = getSharedPreferences(contants.pref_account,MODE_PRIVATE);
role = mSharedPreferences.getString(contants.role,"0");
if(role.equals("1") || role.equals("2")){
auctiontype = "1";
}else{
auctiontype = "2";
}
if(getIntent().hasExtra("auctionId")){
oneAuctionFragment nextFrag= oneAuctionFragment.newInstance(getIntent().getStringExtra("auctionId"),auctiontype);
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, nextFrag, "findThisFragment")
.addToBackStack(null)
.commit();
}
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, HomeFragment.newInstance())
.commitNow();
}
navigation = (BottomNavigationView) findViewById(R.id.navigationView);
navigation.setOnNavigationItemSelectedListener(this);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
}
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
int id = menuItem.getItemId();
if(id == R.id.navigation_home){
startActivity(new Intent(this,MainActivity.class));
finish();
return true;
}else if(id == R.id.navigation_majad){
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, AuctionFragment.newInstance())
.commitNow();
return true;
}else if(id == R.id.navigation_offers){
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, BestFragment.newInstance())
.commitNow();
return true;
}else{
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, moreFragment.newInstance())
.commitNow();
return true;
}
}
}
| [
"mostafas.zaghlol@gmail.com"
] | mostafas.zaghlol@gmail.com |
341a51aa5ea29b7496ac93b60e8570f2163dd748 | 3991229a3d3d3864fc5af9f5a8b268558da42ed7 | /compiller/src/main/java/com/yheriatovych/reductor/processor/model/StateProperty.java | 7e1fe70684c6406c69b17693d79476a205955eb0 | [
"Apache-2.0"
] | permissive | h87kg/reductor | 2912cdce9ad589d17263d6128fa287bc0582205a | aa5f0764a5aac5dba0bc693c929a60a91f14c7ca | refs/heads/master | 2021-01-11T17:03:23.488775 | 2016-09-20T10:59:33 | 2016-09-20T11:01:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,496 | java | package com.yheriatovych.reductor.processor.model;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.yheriatovych.reductor.Reducer;
import com.yheriatovych.reductor.processor.ValidationException;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
public class StateProperty {
public final String name;
public final TypeMirror stateType;
public final ExecutableElement executableElement;
private StateProperty(String name, TypeMirror stateType, ExecutableElement executableElement) {
this.name = name;
this.stateType = stateType;
this.executableElement = executableElement;
}
static StateProperty parseStateProperty(Element element) throws ValidationException {
StateProperty stateProperty;
if (element.getKind() != ElementKind.METHOD) return null;
//We don't care about static methods, just ignore
if (element.getModifiers().contains(Modifier.STATIC)) return null;
//We also don't care about default methods.
//If default method is there, it probably not meant to be override
if (element.getModifiers().contains(Modifier.DEFAULT)) return null;
ExecutableElement executableElement = (ExecutableElement) element;
String propertyName = executableElement.getSimpleName().toString();
TypeMirror stateType = executableElement.getReturnType();
if (!executableElement.getParameters().isEmpty())
throw new ValidationException(executableElement, "state property accessor %s should not have any parameters", executableElement);
if (stateType.getKind() == TypeKind.VOID) {
throw new ValidationException(executableElement, "void is not allowed as return type for property method %s", executableElement);
}
stateProperty = new StateProperty(propertyName, stateType, executableElement);
return stateProperty;
}
public TypeName getReducerInterfaceTypeName() {
TypeName stateType = TypeName.get(this.stateType);
if (stateType.isPrimitive()) {
stateType = stateType.box();
}
return ParameterizedTypeName.get(ClassName.get(Reducer.class), stateType);
}
}
| [
"Yarikx@gmail.com"
] | Yarikx@gmail.com |
4879125a885cea7444c78f514f251060361f979f | 263452966aa9b5c2e3c64bc035e792d1a9c3ee5c | /src/main/java/in/nareshit/raghu/custom/handler/CustomExceptionHandler.java | f88fa9bab9141b8cc75fe685e1674d54d691d1ec | [] | no_license | ipriya1970/Example | 56d3a3fc1e620003cd0798337c3b128b162ce8c4 | 7a911b9183cf4803e6bf85cdd8dced75a7732e8f | refs/heads/main | 2023-08-10T15:33:21.524243 | 2021-09-27T06:50:25 | 2021-09-27T06:50:25 | 409,960,713 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | package in.nareshit.raghu.custom.handler;
import java.util.Date;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import in.nareshit.raghu.custom.error.ErrorType;
import in.nareshit.raghu.exception.ShipmentTypeNotFoundException;
import in.nareshit.raghu.exception.UomNotFoundException;
@RestControllerAdvice
public class CustomExceptionHandler {
@ExceptionHandler(UomNotFoundException.class)
public ResponseEntity<ErrorType> handleUomNotFound(
UomNotFoundException unfe
)
{
return new ResponseEntity<ErrorType>(
new ErrorType(
new Date().toString(),
"UOM",
unfe.getMessage()
),
HttpStatus.INTERNAL_SERVER_ERROR);
}
@ExceptionHandler(ShipmentTypeNotFoundException.class)
public ResponseEntity<ErrorType> handleShipmentTypeNotFound(
ShipmentTypeNotFoundException unfe
)
{
return new ResponseEntity<ErrorType>(
new ErrorType(
new Date().toString(),
"SHIPMENT TYPE",
unfe.getMessage()
),
HttpStatus.INTERNAL_SERVER_ERROR);
}
}
| [
"ipriya1970@gmail.com"
] | ipriya1970@gmail.com |
1800c89dcf16807628f9ff61f0e1966843d93de6 | 4edaefe049a3d2026623ce562d312a31f557b55e | /app/src/p_hotel/java/com/wolf/bestarch/hotel/viewmodel/HotelViewModel.java | 2902628897fa7d3140f3d38e2bfc96abeaa1ff32 | [] | no_license | superroye/zzc_mobile_arch | 88374d484d2ee8986f6c10561455cc5f42b18151 | 3e0cd694dfe6ed4da3bbaa488a7d23d7006e1c2d | refs/heads/master | 2020-04-20T06:42:59.293724 | 2019-05-07T09:26:11 | 2019-05-07T09:26:16 | 168,692,270 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,218 | java | package com.wolf.bestarch.hotel.viewmodel;
import android.arch.lifecycle.MediatorLiveData;
import com.wolf.bestarch.hotel.repository.HotelRepository;
import com.wolf.bestarch.hotel.repository.bean.HotelItem;
import com.supylc.mobilearch.general.arch.LifeViewModel;
import java.util.ArrayList;
import java.util.List;
/**
* @author Roye
* @date 2019/1/15
*/
public class HotelViewModel extends LifeViewModel {
private HotelRepository repository;
private MediatorLiveData<List> list = new MediatorLiveData<>();
private Object[] results = new Object[6];
public HotelViewModel() {
repository = new HotelRepository();
}
public MediatorLiveData<List> list() {
return list;
}
List items;
public void loadData() {
items = new ArrayList();
HotelItem item;
for (int i = 0; i < 20; i++) {
item = new HotelItem();
item.imgUrl = "https://dpic.tiankong.com/ih/tv/QJ6964436266.jpg?x-oss-process=style/670ws";
item.text = new java.util.Random().nextLong() + "";
items.add(item);
}
list().postValue(items);
}
public void refresh() {
list().postValue(items);
}
}
| [
"super_roye@qq.com"
] | super_roye@qq.com |
dfe954f80294a62a6b818c0f68cb86c15dd96525 | 543cc5366f1ec75469077e622ced784a8d54721b | /src/core/game_engine/physics/PhysicsComponent.java | 4e0e884a3f48c59f51ccb2e98cc6f7e591a5dd4a | [] | no_license | Hazzpersonalacc/JavaGameEngine2019HTaylor | 4382726d02602fad08ff601ae459c95d22deffa8 | ecfec0b7f837583fa759a3f4752356b151dff7de | refs/heads/master | 2020-08-23T06:36:22.704829 | 2019-10-21T12:27:38 | 2019-10-21T12:27:38 | 216,561,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,257 | java | package core.game_engine.physics;
import core.game_engine.Component;
import core.game_engine.GameObject;
import core.game_engine.Sprite;
import processing.core.PVector;
public class PhysicsComponent extends Component {
private PVector velocity = new PVector(0,0,0);
public float maxSpeed = 5f;
private float friction = 0.9f;
// box collider
private BoxCollider2D boxCollider2D;
public PhysicsComponent(GameObject g, BoxCollider2D b){
super(g);
this.boxCollider2D = b;
}
@Override
protected void update() {
if(this.velocity.mag() > this.maxSpeed){
this.velocity.setMag(this.maxSpeed);
}
if(this.boxCollider2D.otherColliders.size() > 0){
for(BoxCollider2D b : this.boxCollider2D.otherColliders){
// move player relative to what it collided with
velocity.x = 0;
velocity.y = 0;
System.out.println("collided!");
}
this.boxCollider2D.otherColliders.clear();
}
this.velocity.mult(friction);
this.gameObject.position.add(this.velocity);
}
public void setVelocity(float x, float y){
this.velocity.x += x;
this.velocity.y += y;
}
}
| [
"H.Taylor16@edu.salford.ac.uk"
] | H.Taylor16@edu.salford.ac.uk |
cf0fa0ab0ad4e369eb88f9136df24fd9232bbfd4 | d5515553d071bdca27d5d095776c0e58beeb4a9a | /src/net/sourceforge/plantuml/graphic/TextLink.java | f08561377a6a8ea44193eadf34a81ec1282b6a77 | [] | no_license | ccamel/plantuml | 29dfda0414a3dbecc43696b63d4dadb821719489 | 3100d49b54ee8e98537051e071915e2060fe0b8e | refs/heads/master | 2022-07-07T12:03:37.351931 | 2016-12-14T21:01:03 | 2016-12-14T21:01:03 | 77,067,872 | 1 | 0 | null | 2022-05-30T09:56:21 | 2016-12-21T16:26:58 | Java | UTF-8 | Java | false | false | 1,446 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.Url;
public class TextLink implements HtmlCommand {
private final Url url;
TextLink(Url url) {
if (url == null) {
throw new IllegalArgumentException();
}
this.url = url;
}
public String getText() {
return url.getLabel();
}
public Url getUrl() {
return url;
}
}
| [
"plantuml@gmail.com"
] | plantuml@gmail.com |
bddcd33df4b1426d558b673065fe8d16642b64be | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/7/7_3516acaebfc083c47fac57b191cb293adfc56588/FileManager/7_3516acaebfc083c47fac57b191cb293adfc56588_FileManager_s.java | fe459511eb99e55988b54994299503acf46f9f07 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 14,787 | java | package org.makumba.parade.model.managers;
import java.io.BufferedWriter;
import java.io.FileFilter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.makumba.parade.init.InitServlet;
import org.makumba.parade.model.File;
import org.makumba.parade.model.FileCVS;
import org.makumba.parade.model.Parade;
import org.makumba.parade.model.Row;
import org.makumba.parade.model.interfaces.CacheRefresher;
import org.makumba.parade.model.interfaces.ParadeManager;
import org.makumba.parade.model.interfaces.RowRefresher;
import org.makumba.parade.tools.SimpleFileFilter;
public class FileManager implements RowRefresher, CacheRefresher, ParadeManager {
static Logger logger = Logger.getLogger(FileManager.class.getName());
private FileFilter filter = new SimpleFileFilter();
/*
* Creates a first File for the row which is its root dir and invokes its refresh() method
*/
public void rowRefresh(Row row) {
logger.debug("Refreshing row information for row " + row.getRowname());
File root = new File();
try {
java.io.File rootPath = new java.io.File(row.getRowpath());
root.setName("_root_");
root.setPath(rootPath.getCanonicalPath());
root.setParentPath("");
root.setRow(row);
root.setDate(new Long(new java.util.Date().getTime()));
root.setFiledata(new HashMap());
root.setSize(new Long(0));
root.setOnDisk(false);
row.getFiles().clear();
root.setIsDir(true);
row.getFiles().put(root.getPath(), root);
} catch (Throwable t) {
logger.error("Couldn't access row path of row " + row.getRowname(), t);
}
root.refresh();
}
/**
* Refreshes the cache state of a directory
*
* @param row
* the row we work with
* @param path
* the path to the directory
* @param local
* indicates whether this should be a local refresh or if it should propagate also to subdirs
*
*
*/
public synchronized void directoryRefresh(Row row, String path, boolean local) {
java.io.File currDir = new java.io.File(path);
if (currDir.isDirectory()) {
java.io.File[] dir = currDir.listFiles();
Set dirContent = new HashSet();
for(int i = 0; i < dir.length; i++) {
dirContent.add(dir[i].getAbsolutePath());
}
// clear the cache of the entries of this directory
File fileInCache = (File) row.getFiles().get(path);
if(fileInCache != null) {
List children = fileInCache.getChildren(null);
for(int i = 0; i<children.size(); i++) {
File child = (File) children.get(i);
// if we do a local update only, we keep the subdirectories
if (local && child.getIsDir() && dirContent.contains(child.getPath()))
continue;
// otherwise, we trash
row.getFiles().remove(child.getPath());
}
}
for (int i = 0; i < dir.length; i++) {
if (filter.accept(dir[i]) && !(dir[i].getName() == null)) {
java.io.File file = dir[i];
cacheFile(row, file, local);
}
}
}
}
/**
public synchronized void directoryRefresh(Row row, String path, boolean local) {
java.io.File currDir = new java.io.File(path);
if (currDir.isDirectory()) {
java.io.File[] dir = currDir.listFiles();
Set dirContent = new HashSet();
for (int i = 0; i < dir.length; i++) {
dirContent.add(dir[i].getAbsolutePath());
}
HashSet<String> cachedFiles = new HashSet<String>();
logger.debug("Starting to populate cache entries of directory " + path + " of row " + row.getRowname());
for (int i = 0; i < dir.length; i++) {
if (filter.accept(dir[i]) && !(dir[i].getName() == null)) {
java.io.File file = dir[i];
cacheFile(row, file, local, cachedFiles);
}
}
logger.debug("Finished updating cache");
// clear the cache of the entries of this directory
logger.debug("Starting to clear the invalid cache entries of directory " + path + " of row " + row.getRowname());
File fileInCache = (File) row.getFiles().get(path);
if (fileInCache != null) {
List<String> children = fileInCache.getChildrenPaths();
for (int i = 0; i < children.size(); i++) {
String childPath = children.get(i);
if(!cachedFiles.contains(childPath)) {
// if we do a local update only, we keep the subdirectories
if (local && (new java.io.File(childPath).isDirectory() && dirContent.contains(childPath)))
continue;
// otherwise, we trash
else
row.getFiles().remove(childPath);
}
}
}
logger.debug("Finished clearing cache");
}
}
**/
public void cacheFile(Row row, java.io.File file, boolean local) {
if(!file.exists() || file == null) {
logger.warn("Trying to add null file");
return;
}
if(row == null) {
logger.error("Row was null while trying to add file with path "+file.getAbsolutePath());
return;
}
if (file.isDirectory()) {
File dirData = setFileData(row, file, true);
addFile(row, dirData);
if (!local)
dirData.refresh();
} else if (file.isFile()) {
File fileData = setFileData(row, file, false);
addFile(row, fileData);
}
}
/* adding file to Row files */
private void addFile(Row row, File fileData) {
row.getFiles().put(fileData.getPath(), fileData);
// logger.warn("Added file: "+fileData.getName());
}
/* setting File informations */
private File setFileData(Row row, java.io.File file, boolean isDir) {
File fileData = new File();
fileData.setIsDir(isDir);
fileData.setRow(row);
try {
fileData.setPath(file.getCanonicalPath());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
fileData.setParentPath(file.getParent().replace(java.io.File.separatorChar, '/'));
fileData.setName(file.getName());
fileData.setDate(new Long(file.lastModified()));
fileData.setSize(new Long(file.length()));
fileData.setOnDisk(true);
return fileData;
}
public static File setVirtualFileData(Row r, File path, String name, boolean dir) {
File cvsfile = new File();
cvsfile.setName(name);
cvsfile.setPath(path.getPath() + java.io.File.separator + name);
cvsfile.setParentPath(path.getPath().replace(java.io.File.separatorChar, '/'));
cvsfile.setOnDisk(false);
cvsfile.setIsDir(dir);
cvsfile.setRow(r);
cvsfile.setDate(new Long((new Date()).getTime()));
cvsfile.setSize(new Long(0));
return cvsfile;
}
public void newRow(String name, Row r, Map m) {
// TODO Auto-generated method stub
}
public String newFile(Row r, String path, String entry) {
java.io.File f = new java.io.File((path + "/" + entry).replace('/', java.io.File.separatorChar));
if (f.exists() && f.isFile())
return "This file already exists";
boolean success = false;
try {
success = f.createNewFile();
} catch (IOException e) {
e.printStackTrace();
return ("Error while trying to create file " + entry);
}
if (success) {
File newFile = setFileData(r, f, false);
try {
Session s = InitServlet.getSessionFactory().openSession();
Transaction tx = s.beginTransaction();
s.load(Row.class, r.getId());
r.getFiles().put(f.getCanonicalPath(), newFile);
tx.commit();
s.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "OK#" + f.getName();
}
return "Error while trying to create file " + entry;
}
public String newDir(Row r, String path, String entry) {
String absolutePath = (path + "/" + entry + "/").replace('/', java.io.File.separatorChar);
java.io.File f = new java.io.File(absolutePath);
if (f.exists() && f.isDirectory())
return "This directory already exists";
boolean success = f.mkdir();
if (success) {
File newFile = setFileData(r, f, true);
try {
Session s = InitServlet.getSessionFactory().openSession();
Transaction tx = s.beginTransaction();
r.getFiles().put(f.getCanonicalPath(), newFile);
tx.commit();
s.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "OK#" + f.getName();
}
return "Error while trying to create directory " + absolutePath
+ ". Make sure ParaDe has the security rights to write on the filesystem.";
}
public String deleteFile(Row r, String path, String entry) {
java.io.File f = new java.io.File(path + java.io.File.separator + entry);
boolean success = f.delete();
if (success) {
removeFileCache(r, path, entry);
return "OK#" + f.getName();
}
logger.error("Error while trying to delete file " + f.getAbsolutePath() + " " + "\n" + "Reason: exists: "
+ f.exists() + ", canRead: " + f.canRead() + ", canWrite: " + f.canWrite());
return "Error while trying to delete file " + f.getName();
}
public void removeFileCache(Row r, String path, String entry) {
Session s = InitServlet.getSessionFactory().openSession();
Transaction tx = s.beginTransaction();
File cacheFile = (File) r.getFiles().get(path + java.io.File.separator + entry);
Object cvsData = cacheFile.getFiledata().get("cvs");
// if there is CVS data for this file
// TODO do this check for Tracker as well once it will be done
if (cvsData != null) {
FileCVS cvsCache = (FileCVS) cvsData;
cacheFile.setOnDisk(false);
cvsCache.setStatus(CVSManager.NEEDS_CHECKOUT);
} else
r.getFiles().remove(path + java.io.File.separator + entry);
tx.commit();
s.close();
}
public String uploadFile(Parade p, String path, String context) {
Session s = InitServlet.getSessionFactory().openSession();
Transaction tx = s.beginTransaction();
Row r = (Row) p.getRows().get(context);
File f = new File();
java.io.File file = new java.io.File(path);
f = setFileData(r, file, false);
addFile(r, f);
tx.commit();
s.close();
return path;
}
/* removes a file from the cache */
public static void deleteSimpleFileCache(String context, String path) {
Session s = InitServlet.getSessionFactory().openSession();
Parade p = (Parade) s.get(Parade.class, new Long(1));
Row r = Row.getRow(p, context);
Transaction tx = s.beginTransaction();
r.getFiles().remove(path);
tx.commit();
s.close();
}
/* updates the File cache of a directory */
public static void updateFileCache(String context, String path, boolean local) {
FileManager fileMgr = new FileManager();
Session s = InitServlet.getSessionFactory().openSession();
Parade p = (Parade) s.get(Parade.class, new Long(1));
Row r = Row.getRow(p, context);
Transaction tx = s.beginTransaction();
fileMgr.directoryRefresh(r, path, local);
tx.commit();
s.close();
}
public void fileRefresh(Row row, String path) {
java.io.File f = new java.io.File(path);
if (!f.exists())
return;
cacheFile(row, f, false);
}
public static void fileWrite(java.io.File file, String content) throws IOException {
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
pw.print(content);
}
// checks if a file should still be cached or if it's a zombie
// fixme should probably be in a more general CacheManager or so
public static void checkShouldCache(String context, String absolutePath, String absoluteFilePath) {
Session s = InitServlet.getSessionFactory().openSession();
Parade p = (Parade) s.get(Parade.class, new Long(1));
Row r = Row.getRow(p, context);
Transaction tx = s.beginTransaction();
java.io.File f = new java.io.File(absoluteFilePath);
if(!f.exists()) {
File cachedFile = (File) r.getFiles().get(absoluteFilePath);
if(cachedFile != null) {
boolean hasCvsData = (cachedFile.getFiledata().get("cvs") != null);
if(!hasCvsData) {
r.getFiles().remove(absoluteFilePath);
}
}
}
tx.commit();
s.close();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
8d122b16ed7f8698b39eae1a02ec6096e5d4d9eb | bbc2f3a189eef2faca8ec29743755a44be4c38b9 | /app/src/main/java/com/qq8585083/dragicon/animator/DragBaseRunnable.java | 7890b686416cecd6121e01e9331f82c651827582 | [] | no_license | beasonshu/DragIcon | 8f23e49f7f7721fdcb1ba15efcf50b0774b3f3c0 | 5e49d33bdc9e08e2ff0b60712e1a1a630f8a73eb | refs/heads/master | 2021-01-17T08:05:29.286497 | 2016-09-13T03:43:37 | 2016-09-13T03:43:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 708 | java | package com.qq8585083.dragicon.animator;
import android.view.animation.Interpolator;
import android.widget.ImageView;
import com.qq8585083.dragicon.BaseAnimator;
import com.qq8585083.dragicon.DragView;
public abstract class DragBaseRunnable extends BaseAnimator {
protected final DragView mDragParent;
protected final ImageView mDragView;
protected final ImageView mDeleteView;
public DragBaseRunnable(DragView dragParent, ImageView dragView,
ImageView deleteView, long duration, Interpolator interpolator) {
super(dragParent, duration, interpolator);
mDragParent = dragParent;
mDragView = dragView;
mDeleteView = deleteView;
mDuration = duration;
mInterpolator = interpolator;
}
}
| [
"296224645@qq.com"
] | 296224645@qq.com |
58666b2f7a5c20931ab0aa26e6cc61f46d64258a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/35/35_e02b780c16b2ed9aabfb0ab1d62e4db6bcea53c0/PropertyVerifier/35_e02b780c16b2ed9aabfb0ab1d62e4db6bcea53c0_PropertyVerifier_s.java | ed0fd686614456524804d4f2e4e17037c2e496c1 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 20,547 | java | /**
* MVEL 2.0
* Copyright (C) 2007 The Codehaus
* Mike Brock, Dhanji Prasanna, John Graham, Mark Proctor
*
* 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.mvel2.compiler;
import org.mvel2.*;
import org.mvel2.ast.Function;
import org.mvel2.optimizers.AbstractOptimizer;
import org.mvel2.optimizers.impl.refl.nodes.WithAccessor;
import org.mvel2.util.ErrorUtil;
import org.mvel2.util.NullType;
import org.mvel2.util.ParseTools;
import org.mvel2.util.StringAppender;
import java.lang.reflect.*;
import java.util.*;
import static org.mvel2.util.ParseTools.*;
import static org.mvel2.util.PropertyTools.getFieldOrAccessor;
/**
* This verifier is used by the compiler to enforce rules such as type strictness. It is, as side-effect, also
* responsible for extracting type information.
*
* @author Mike Brock
* @author Dhanji Prasanna
*/
public class PropertyVerifier extends AbstractOptimizer {
private static final int DONE = -1;
private static final int NORM = 0;
private static final int METH = 1;
private static final int COL = 2;
private static final int WITH = 3;
private List<String> inputs = new LinkedList<String>();
private boolean first = false;
private boolean classLiteral = false;
private boolean resolvedExternally;
private boolean methodCall = false;
private boolean deepProperty = false;
private boolean fqcn = false;
private Map<String, Type> paramTypes;
private Class ctx = null;
public PropertyVerifier(char[] property, ParserContext parserContext) {
this.length = end = (this.expr = property).length;
this.pCtx = parserContext;
}
public PropertyVerifier(char[] property, int start, int offset, ParserContext parserContext) {
this.expr = property;
this.start = start;
this.length = offset;
this.end = start + offset;
this.pCtx = parserContext;
}
public PropertyVerifier(String property, ParserContext parserContext) {
this.length = end = (this.expr = property.toCharArray()).length;
this.pCtx = parserContext;
}
public PropertyVerifier(String property, ParserContext parserContext, Class root) {
this.end = this.length = (this.expr = property.toCharArray()).length;
if (property.length() > 0 && property.charAt(0) == '.') {
this.cursor = this.st = this.start = 1;
}
this.pCtx = parserContext;
this.ctx = root;
}
public List<String> getInputs() {
return inputs;
}
public void setInputs(List<String> inputs) {
this.inputs = inputs;
}
/**
* Analyze the statement and return the known egress type.
*
* @return known engress type
*/
public Class analyze() {
cursor = start;
resolvedExternally = true;
if (ctx == null) {
ctx = Object.class;
first = true;
}
while (cursor < end) {
classLiteral = false;
switch (nextSubToken()) {
case NORM:
ctx = getBeanProperty(ctx, capture());
break;
case METH:
ctx = getMethod(ctx, capture());
break;
case COL:
ctx = getCollectionProperty(ctx, capture());
break;
case WITH:
ctx = getWithProperty(ctx);
break;
case DONE:
break;
}
if (cursor < length && !first) deepProperty = true;
first = false;
}
return ctx;
}
private void recordTypeParmsForProperty(String property) {
if (pCtx.isStrictTypeEnforcement()) {
if ((paramTypes = pCtx.getTypeParameters(property)) == null) {
pCtx.addTypeParameters(property, pCtx.getVarOrInputType(property));
}
pCtx.setLastTypeParameters(pCtx.getTypeParametersAsArray(property));
}
}
/**
* Process bean property
*
* @param ctx - the ingress type
* @param property - the property component
* @return known egress type.
*/
private Class getBeanProperty(Class ctx, String property) {
if (first) {
if (pCtx.hasVarOrInput(property)) {
if (pCtx.isStrictTypeEnforcement()) {
recordTypeParmsForProperty(property);
}
return pCtx.getVarOrInputType(property);
}
else if (pCtx.hasImport(property)) {
resolvedExternally = false;
return pCtx.getImport(property);
}
else if (!pCtx.isStrongTyping()) {
return Object.class;
}
else if (pCtx.hasVarOrInput("this")) {
if (pCtx.isStrictTypeEnforcement()) {
recordTypeParmsForProperty("this");
}
ctx = pCtx.getVarOrInputType("this");
resolvedExternally = false;
}
}
st = cursor;
boolean switchStateReg;
Member member = ctx != null ? getFieldOrAccessor(ctx, property) : null;
if (MVEL.COMPILER_OPT_SUPPORT_JAVA_STYLE_CLASS_LITERALS) {
if ("class".equals(property)) {
return Class.class;
}
}
if (member instanceof Field) {
if (pCtx.isStrictTypeEnforcement()) {
Field f = ((Field) member);
if (f.getGenericType() != null && f.getGenericType() instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) f.getGenericType();
pCtx.setLastTypeParameters(pt.getActualTypeArguments());
Type[] gpt = pt.getActualTypeArguments();
Type[] classArgs = ((Class) pt.getRawType()).getTypeParameters();
if (gpt.length > 0 && paramTypes == null) paramTypes = new HashMap<String, Type>();
for (int i = 0; i < gpt.length; i++) {
paramTypes.put(classArgs[i].toString(), gpt[i]);
}
}
return f.getType();
}
else {
return ((Field) member).getType();
}
}
if (member != null) {
Method method = (Method) member;
if (pCtx.isStrictTypeEnforcement()) {
//if not a field, then this is a property getter
Type parametricReturnType = method.getGenericReturnType();
//push return type parameters onto parser context, only if this is a parametric type
if (parametricReturnType instanceof ParameterizedType) {
pCtx.setLastTypeParameters(((ParameterizedType) parametricReturnType).getActualTypeArguments());
ParameterizedType pt = (ParameterizedType) parametricReturnType;
Type[] gpt = pt.getActualTypeArguments();
Type[] classArgs = ((Class) pt.getRawType()).getTypeParameters();
if (gpt.length > 0 && paramTypes == null) paramTypes = new HashMap<String, Type>();
for (int i = 0; i < gpt.length; i++) {
paramTypes.put(classArgs[i].toString(), gpt[i]);
}
}
}
Class rt = method.getReturnType();
return rt.isPrimitive() ? boxPrimitive(rt) : rt;
}
if (pCtx != null && pCtx.hasImport(property)) {
Class<?> importedClass = pCtx.getImport(property);
if (importedClass != null) return pCtx.getImport(property);
}
if (pCtx != null && pCtx.getLastTypeParameters() != null && pCtx.getLastTypeParameters().length != 0
&& ((Collection.class.isAssignableFrom(ctx) && !(switchStateReg = false))
|| (Map.class.isAssignableFrom(ctx) && (switchStateReg = true)))) {
Type parm = pCtx.getLastTypeParameters()[switchStateReg ? 1 : 0];
pCtx.setLastTypeParameters(null);
if (parm instanceof ParameterizedType) {
return Object.class;
}
else {
return (Class) parm;
}
}
if (pCtx != null && "length".equals(property) && ctx.isArray()) {
return Integer.class;
}
Object tryStaticMethodRef = tryStaticAccess();
if (tryStaticMethodRef != null) {
fqcn = true;
resolvedExternally = false;
if (tryStaticMethodRef instanceof Class) {
classLiteral = !(MVEL.COMPILER_OPT_SUPPORT_JAVA_STYLE_CLASS_LITERALS &&
new String(expr, end - 6, 6).equals(".class"));
return MVEL.COMPILER_OPT_SUPPORT_JAVA_STYLE_CLASS_LITERALS ? Class.class : (Class) tryStaticMethodRef;
}
else if (tryStaticMethodRef instanceof Field) {
try {
return ((Field) tryStaticMethodRef).get(null).getClass();
}
catch (Exception e) {
throw new CompileException("in verifier: ", expr, start, e);
}
}
else {
try {
return ((Method) tryStaticMethodRef).getReturnType();
}
catch (Exception e) {
throw new CompileException("in verifier: ", expr, start, e);
}
}
}
if (ctx != null && ctx.getClass() == Class.class) {
for (Method m : ctx.getMethods()) {
if (property.equals(m.getName())) {
return m.getReturnType();
}
}
try {
return findClass(variableFactory, ctx.getName() + "$" + property, null);
}
catch (ClassNotFoundException cnfe) {
// fall through.
}
}
if (MVEL.COMPILER_OPT_ALLOW_NAKED_METH_CALL) {
Class cls = getMethod(ctx, property);
if (cls != Object.class) {
return cls;
}
}
if (pCtx.isStrictTypeEnforcement()) {
throw new CompileException("unqualified type in strict mode for: " + property, expr, tkStart);
}
return Object.class;
}
/**
* Process collection property
*
* @param ctx - the ingress type
* @param property - the property component
* @return known egress type
*/
private Class getCollectionProperty(Class ctx, String property) {
if (first) {
if (pCtx.hasVarOrInput(property)) {
ctx = getSubComponentType(pCtx.getVarOrInputType(property));
}
else if (pCtx.hasImport(property)) {
resolvedExternally = false;
ctx = getSubComponentType(pCtx.getImport(property));
}
else {
ctx = Object.class;
}
}
if (pCtx.isStrictTypeEnforcement()) {
if (Map.class.isAssignableFrom(property.length() != 0 ? ctx = getBeanProperty(ctx, property) : ctx)) {
ctx = (Class) (pCtx.getLastTypeParameters().length != 0 ? pCtx.getLastTypeParameters()[1] : Object.class);
}
else if (Collection.class.isAssignableFrom(ctx)) {
if (pCtx.getLastTypeParameters().length == 0 ) {
ctx = Object.class;
} else {
Type type = pCtx.getLastTypeParameters()[0];
if (type instanceof Class) ctx = (Class)type;
else ctx = (Class)((ParameterizedType)type).getRawType();
}
}
else if (ctx.isArray()) {
ctx = ctx.getComponentType();
}
else if (pCtx.isStrongTyping()) {
throw new CompileException("unknown collection type: " + ctx + "; property=" + property, expr, start);
}
}
else {
ctx = Object.class;
}
++cursor;
skipWhitespace();
int start = cursor;
if (scanTo(']')) {
addFatalError("unterminated [ in token");
}
MVEL.analysisCompile(new String(expr, start, cursor - start), pCtx);
++cursor;
return ctx;
}
/**
* Process method
*
* @param ctx - the ingress type
* @param name - the property component
* @return known egress type.
*/
private Class getMethod(Class ctx, String name) {
int st = cursor;
/**
* Check to see if this is the first element in the statement.
*/
if (first) {
first = false;
methodCall = true;
/**
* It's the first element in the statement, therefore we check to see if there is a static import of a
* native Java method or an MVEL function.
*/
if (pCtx.hasImport(name)) {
Method m = pCtx.getStaticImport(name).getMethod();
/**
* Replace the method parameters.
*/
ctx = m.getDeclaringClass();
name = m.getName();
}
else if (pCtx.hasFunction(name)) {
resolvedExternally = false;
Function f = pCtx.getFunction(name);
f.checkArgumentCount(
parseParameterList(
(((cursor = balancedCapture(expr, cursor, end, '(')) - st) > 1 ?
ParseTools.subset(expr, st + 1, cursor - st - 1) : new char[0]), 0, -1).size());
return f.getEgressType();
}
else if (pCtx.hasVarOrInput("this")) {
if (pCtx.isStrictTypeEnforcement()) {
recordTypeParmsForProperty("this");
}
ctx = pCtx.getVarOrInputType("this");
resolvedExternally = false;
}
}
/**
* Get the arguments for the method.
*/
String tk;
if (cursor < end && expr[cursor] == '(' && ((cursor = balancedCapture(expr, cursor, end, '(')) - st) > 1) {
tk = new String(expr, st + 1, cursor - st - 1);
}
else {
tk = "";
}
cursor++;
/**
* Parse out the arguments list.
*/
Class[] args;
List<char[]> subtokens = parseParameterList(tk.toCharArray(), 0, -1);
if (subtokens.size() == 0) {
args = new Class[0];
subtokens = Collections.emptyList();
}
else {
// ParserContext subCtx = pCtx.createSubcontext();
args = new Class[subtokens.size()];
/**
* Subcompile all the arguments to determine their known types.
*/
// ExpressionCompiler compiler;
List<ErrorDetail> errors = pCtx.getErrorList().isEmpty() ?
pCtx.getErrorList() : new ArrayList<ErrorDetail>(pCtx.getErrorList());
CompileException rethrow = null;
for (int i = 0; i < subtokens.size(); i++) {
try {
args[i] = MVEL.analyze(subtokens.get(i), pCtx);
if ("null".equals(String.valueOf(subtokens.get(i)))) {
args[i] = NullType.class;
}
}
catch (CompileException e) {
rethrow = ErrorUtil.rewriteIfNeeded(e, expr, this.st);
}
if (errors.size() < pCtx.getErrorList().size()) {
for (ErrorDetail detail : pCtx.getErrorList()) {
if (!errors.contains(detail)) {
detail.setExpr(expr);
detail.setCursor(new String(expr).substring(this.st).indexOf(new String(subtokens.get(i))) + this.st);
detail.setColumn(0);
detail.setLineNumber(0);
detail.calcRowAndColumn();
}
}
}
if (rethrow != null) {
throw rethrow;
}
}
}
/**
* If the target object is an instance of java.lang.Class itself then do not
* adjust the Class scope target.
*/
Method m;
/**
* If we have not cached the method then we need to go ahead and try to resolve it.
*/
if ((m = getBestCandidate(args, name, ctx, ctx.getMethods(), pCtx.isStrongTyping())) == null) {
if ((m = getBestCandidate(args, name, ctx, ctx.getDeclaredMethods(), pCtx.isStrongTyping())) == null) {
StringAppender errorBuild = new StringAppender();
for (int i = 0; i < args.length; i++) {
errorBuild.append(args[i] != null ? args[i].getName() : null);
if (i < args.length - 1) errorBuild.append(", ");
}
if (("size".equals(name) || "length".equals(name)) && args.length == 0 && ctx.isArray()) {
return Integer.class;
}
if (pCtx.isStrictTypeEnforcement()) {
throw new CompileException("unable to resolve method using strict-mode: "
+ ctx.getName() + "." + name + "(" + errorBuild.toString() + ")", expr, tkStart);
}
return Object.class;
}
}
/**
* If we're in strict mode, we look for generic type information.
*/
if (pCtx.isStrictTypeEnforcement() && m.getGenericReturnType() != null) {
Map<String, Class> typeArgs = new HashMap<String, Class>();
Type[] gpt = m.getGenericParameterTypes();
Class z;
ParameterizedType pt;
for (int i = 0; i < gpt.length; i++) {
if (gpt[i] instanceof ParameterizedType) {
pt = (ParameterizedType) gpt[i];
if ((z = pCtx.getImport(new String(subtokens.get(i)))) != null) {
/**
* We record the value of the type parameter to our typeArgs Map.
*/
if (pt.getRawType().equals(Class.class)) {
/**
* If this is an instance of Class, we deal with the special parameterization case.
*/
typeArgs.put(pt.getActualTypeArguments()[0].toString(), z);
}
else {
typeArgs.put(gpt[i].toString(), z);
}
}
}
}
if (pCtx.isStrictTypeEnforcement() && ctx.getTypeParameters().length != 0 && pCtx.getLastTypeParameters() !=
null && pCtx.getLastTypeParameters().length == ctx.getTypeParameters().length) {
TypeVariable[] typeVariables = ctx.getTypeParameters();
for (int i = 0; i < typeVariables.length; i++) {
Type typeArg = pCtx.getLastTypeParameters()[i];
typeArgs.put(typeVariables[i].getName(), typeArg instanceof Class ? (Class) pCtx.getLastTypeParameters()[i] : Object.class);
}
}
/**
* Get the return type argument
*/
Type parametricReturnType = m.getGenericReturnType();
String returnTypeArg = parametricReturnType.toString();
//push return type parameters onto parser context, only if this is a parametric type
if (parametricReturnType instanceof ParameterizedType) {
pCtx.setLastTypeParameters(((ParameterizedType) parametricReturnType).getActualTypeArguments());
}
if (paramTypes != null && paramTypes.containsKey(returnTypeArg)) {
/**
* If the paramTypes Map contains the known type, return that type.
*/
return (Class) paramTypes.get(returnTypeArg);
}
else if (typeArgs.containsKey(returnTypeArg)) {
/**
* If the generic type was declared as part of the method, it will be in this
* Map.
*/
return typeArgs.get(returnTypeArg);
}
}
if (!Modifier.isPublic(m.getModifiers())) {
StringAppender errorBuild = new StringAppender();
for (int i = 0; i < args.length; i++) {
errorBuild.append(args[i] != null ? args[i].getName() : null);
if (i < args.length - 1) errorBuild.append(", ");
}
String scope = Modifier.toString(m.getModifiers());
if (scope.trim().equals("")) scope = "<package local>";
addFatalError("the referenced method is not accessible: "
+ ctx.getName() + "." + name + "(" + errorBuild.toString() + ")"
+ " (scope: " + scope + "; required: public", this.tkStart);
}
return m.getReturnType();
}
private Class getWithProperty(Class ctx) {
String root = new String(expr, 0, cursor - 1).trim();
int start = cursor + 1;
cursor = balancedCaptureWithLineAccounting(expr, cursor, end, '{', pCtx);
new WithAccessor(root, expr, start, cursor++ - start, ctx, pCtx.isStrictTypeEnforcement());
return ctx;
}
public boolean isResolvedExternally() {
return resolvedExternally;
}
public boolean isClassLiteral() {
return classLiteral;
}
public boolean isDeepProperty() {
return deepProperty;
}
public boolean isInput() {
return resolvedExternally && !methodCall;
}
public boolean isMethodCall() {
return methodCall;
}
public boolean isFqcn() {
return fqcn;
}
public Class getCtx() {
return ctx;
}
public void setCtx(Class ctx) {
this.ctx = ctx;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
d6579d7017ab9b696ea85f7622a4f05dc7d26c5b | bc77e3c66f299f87443d9bfd23501eb89e93f552 | /freetest/src/freetest6/DramaArrayTest.java | b5c165b81d3faa74c9ecd8ee6904a26e803ec109 | [] | no_license | kimwoojin87/kitribasic | a38a8cddab2298ce0df3256d87f88dba80315ba7 | 872b376053f93f09d15d179e671371bf28d5a243 | refs/heads/master | 2020-06-20T00:35:37.194469 | 2019-07-15T05:42:08 | 2019-07-15T05:42:08 | 196,930,074 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 676 | java | package freetest6;
import java.util.ArrayList;
import java.util.List;
public class DramaArrayTest {
public static void main(String[] args) {
List<Drama> list = new ArrayList<Drama>();
list.add(new Drama("그 겨울 바람이 분다","SBS","김규태","조인성","송혜교"));
list.add(new Drama("백년의 유산","MBC","주성우"));
list.add(new Drama("아이리스2","KBS","김규태","표민수","이다해"));
list.add(new Drama("최고다 이순신","KBS","윤성식",null,"아이유"));
int size = list.size();
for (int i = 0; i < size; i++) {
System.out.println(i+1+""+list.get(i));
}
}
}
| [
"gregorirr@gmail.com"
] | gregorirr@gmail.com |
7b1726ce810a678907c117d6032cf889ae143d57 | 44481a8f7fde11ffbfb0177bb0c9497b09d2d7a6 | /src/main/java/com/mars/issue/repo/IssueRepository.java | e152d4e7e2f997299e9a889e9d7dd43835c1c10c | [
"Apache-2.0"
] | permissive | marsyang1/springboot-vue-2 | adab4b4f6842714d89281d357301ffc766e8da49 | c2effa3a861be086d0d2e60e55044dce088bd579 | refs/heads/master | 2021-08-22T07:43:37.806977 | 2017-11-29T17:12:56 | 2017-11-29T17:12:56 | 112,503,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | package com.mars.issue.repo;
import com.mars.issue.model.Issue;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@RepositoryRestResource
public interface IssueRepository extends PagingAndSortingRepository<Issue, String> {
}
| [
"marsyang1@gmail.com"
] | marsyang1@gmail.com |
18c3c3a1c4d6aa14ca6b9793b28698aff855aba2 | 89f5d66386ae95a23e81bebed061161618ff7c18 | /test/integration/testcases/noncompile/2014G20/cirkular.java | fd77547a9d60652f4d98b37cb5df442809fab860 | [] | no_license | hugoflug/compiler-haskell | 1b3b59b69d30368030ddc35fb3e335b29c3125c6 | 2c0b2444ea6c7bb3f358f899fcf987917afaadd5 | refs/heads/master | 2022-01-18T16:32:26.090155 | 2019-08-03T16:09:32 | 2019-08-03T16:09:32 | 192,170,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | // EXT:ISC
class cirkular
{
public static void main(String[] s)
{
System.out.println(1);
}
}
class A1 extends B1 { }
class A2 extends A1 { }
class A3 extends A2 { }
class A1 extends B1 { }
class B1 extends B2 { }
class B2 extends B3 { }
class B3 extends B1 { }
class C1 extends B2 { }
class C2 extends C1 { }
| [
"hugo.sandelius@gmail.com"
] | hugo.sandelius@gmail.com |
6ef5ea4585a349a50ac8ab0357447b6dda6f095d | e3c147c36db956fe18c346b95aa9653360698f2c | /demoJPA/src/demoJPA/Main.java | 4f7531a2f041438e5e6949c92d6be388150b6504 | [] | no_license | rjleurck/JavaTutorial | 2dc268fc75e13b2981c28a4086077359fff50a06 | b98d63afc34181f0547428306a1960dfa74ce0fd | refs/heads/master | 2016-09-05T12:40:07.444595 | 2013-08-24T03:52:20 | 2013-08-24T03:52:20 | 3,610,967 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,115 | java | package demoJPA;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import demoJPA.Todo;
public class Main {
private static final String PERSISTENCE_UNIT_NAME = "demoJPA";
private static EntityManagerFactory factory;
public static void main(String[] args) {
//factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
factory = Persistence.createEntityManagerFactory("demoJPA");
EntityManager em = factory.createEntityManager();
// Read the existing entries and write to console
Query q = em.createQuery("select t from Todo t");
List<Todo> todoList = q.getResultList();
for (Todo todo : todoList) {
System.out.println(todo);
}
System.out.println("Size: " + todoList.size());
// Create new todo
em.getTransaction().begin();
Todo todo = new Todo();
todo.setSummary("This is a test");
todo.setDescription("This is a test");
em.persist(todo);
em.getTransaction().commit();
em.close();
}
} | [
"rjleurck@yahoo.com"
] | rjleurck@yahoo.com |
ae60f1fca57d7329ea139d5f66440c3002a9fdf6 | b55340d57a4ce9fabd7abb5d0c5f878fb4bb46e1 | /src/com/newview/bysj/service/RemarkTemplateForDesignTutorService.java | dd71f55e41909c0f9016b6a8a40fcb82c6898c06 | [] | no_license | refactbysj/bysjrefactor | 94655d8a23550279ca77aa3273b369a82e3a62f6 | f32d7e090f4a335781199a35c9c0776ceb9c4cd5 | refs/heads/master | 2021-01-20T07:42:43.739838 | 2017-07-18T00:55:02 | 2017-07-18T00:55:02 | 90,032,511 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package com.newview.bysj.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.newview.bysj.dao.RemarkTemplateForDesignTutorDao;
import com.newview.bysj.domain.RemarkTemplateForDesignTutor;
import com.newview.bysj.jpaRepository.MyRepository;
@Service("remarkTemplateForDesignTutorService")
public class RemarkTemplateForDesignTutorService extends BasicService<RemarkTemplateForDesignTutor, Integer> {
RemarkTemplateForDesignTutorDao remarkTemplateForDesignTutorDao;
@Override
@Autowired
public void setDasciDao(MyRepository<RemarkTemplateForDesignTutor, Integer> basicDao) {
// TODO Auto-generated method stub
this.basicDao = basicDao;
remarkTemplateForDesignTutorDao = (RemarkTemplateForDesignTutorDao) basicDao;
}
}
| [
"1140439898@qq.com"
] | 1140439898@qq.com |
c569be42a15d25a5da70f2c65e9b9c0a0cf9ae1e | 626c8e412529de18838e7c34280c1ae244d94cfa | /src/main/java/com/eledger/dao/RegisterRepository.java | c2995e598735b1299bf71a3d25f717734d41719b | [] | no_license | dheerajpk89/eledger | d3d1c984a59b88c5f8324d83c2852a8ec67e20c4 | 26959074af370cbe0ac9dfe4df225dfa8d6c9c02 | refs/heads/master | 2020-04-03T09:07:48.966379 | 2018-11-06T11:25:23 | 2018-11-06T11:25:23 | 155,155,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 223 | java | package com.eledger.dao;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.eledger.mongo.model.*;
public interface RegisterRepository extends MongoRepository<RegisterMongoModel, String> {
}
| [
"dkumbar@accuratebackground.com"
] | dkumbar@accuratebackground.com |
d72bcc7bf3b4d2083a4a2744402cd5f90f5e1925 | 1545f0dda41f56beda536577d40bfae6658a79bb | /src/coolvolcano/myaccountbook/dao/AccountXMLAdapter.java | a4179264c2583fe5e80c945441faf19284f11178 | [] | no_license | coolVolcano/myaccountbook | 22605bb39a4c168902f932470f125424c7974514 | d6cad6284b1701bd9633121c54bcb2b268e93d30 | refs/heads/master | 2016-09-05T22:21:16.537220 | 2014-12-31T05:13:27 | 2014-12-31T05:13:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,662 | java | package coolvolcano.myaccountbook.dao;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xmlpull.v1.XmlSerializer;
import android.content.Context;
import android.os.Environment;
import android.util.Xml;
import coolvolcano.myaccountbook.R;
import coolvolcano.myaccountbook.bean.AccountBean;
public class AccountXMLAdapter implements AccountAdapter {
private HashMap<Date, AccountBean> accountCache = new HashMap<Date, AccountBean>();
@Override
public boolean write(Context context, AccountBean account) {
boolean flag = false;
String sdStatus = Environment.getExternalStorageState();
if(sdStatus.equals(Environment.MEDIA_MOUNTED)){
flag = writeToSdCard(context, account);
}else{
flag = writeToPhoneMemory(context, account);
}
return flag;
}
@Override
public boolean update(Context context, AccountBean oldAccount, AccountBean newAccount){
boolean flag = false;
// String sdStatus = Environment.getExternalStorageState();
//
// if(sdStatus.equals(Environment.MEDIA_MOUNTED)){
// flag = updateFileInSdCard(context, account);
// }else{
// flag = writeToPhoneMemory(context, account);
// }
return false;
}
@Override
public List<AccountBean> find(Context context, int year, int month, int day){
return null;
}
@Override
public boolean delete(Context context, AccountBean account){
return false;
}
private boolean writeToSdCard(Context context, AccountBean account){
boolean flag = false;
String path = Environment.getExternalStorageDirectory().getPath();
path = new StringBuilder(path)
.append("/")
.append(context.getResources().getString(R.string.root_folder_name))
.append("/")
.append(context.getResources().getString(R.string.data_folder_name))
.toString();
File file = new File(path);
if(!file.exists()){
file.mkdirs();
}
String filePath = new StringBuilder(path)
.append("/")
.append(context.getResources().getString(R.string.my_data_file_name))
.toString();
File dataFile = new File(filePath);
FileOutputStream fos = null;
try {
if(dataFile.exists()){
fos = new FileOutputStream(dataFile);
}else{
dataFile.createNewFile();
fos = new FileOutputStream(dataFile);
writeXML(context, account, fos);
}
flag = true;
} catch (IOException e) {
flag = false;
e.printStackTrace();
} finally{
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return flag;
}
private boolean writeToPhoneMemory(Context context, AccountBean account){
return false;
}
private void writeXML(Context context, AccountBean account, FileOutputStream fos){
XmlSerializer serializer = Xml.newSerializer();
Calendar calendar = Calendar.getInstance();
calendar.setTime(account.getRecordDate());
try{
serializer.setOutput(fos,"UTF-8");
serializer.startDocument(null, true);
serializer.startTag(null, "myaccountbook");
serializer.startTag(null, "user");
serializer.attribute(null, "name", account.getUserName());
serializer.startTag(null, "year");
serializer.attribute(null, "value", String.valueOf(calendar.get(Calendar.YEAR)));
serializer.startTag(null, "month");
serializer.attribute(null, "value", String.valueOf(calendar.get(Calendar.MONTH)+1));
serializer.startTag(null, "day");
serializer.attribute(null, "value", String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
serializer.startTag(null, "account");
serializer.startTag(null, "outcome_type");
serializer.text(String.valueOf(Arrays.binarySearch(context.getResources().getStringArray(R.array.outcome_types), account.getOutcomeType())));
serializer.endTag(null, "outcome_type");
serializer.startTag(null, "outcome");
serializer.text(String.valueOf(account.getOutcome()));
serializer.endTag(null, "outcome");
serializer.startTag(null, "time");
serializer.text(new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA).format(account.getRecordDate()));
serializer.endTag(null, "time");
serializer.startTag(null, "remark");
serializer.text(account.getRemark());
serializer.endTag(null, "remark");
serializer.endTag(null, "account");
serializer.endTag(null, "day");
serializer.endTag(null, "month");
serializer.endTag(null, "year");
serializer.endTag(null, "user");
serializer.endTag(null, "myaccountbook");
serializer.endDocument();
serializer.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
private boolean updateFileInSdCard(Context context, AccountBean account){
return false;
}
private void findInSdCard(Context context){
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
domFactory.setNamespaceAware(true); // never forget this!
DocumentBuilder builder;
Document doc;
String path = Environment.getExternalStorageDirectory().getPath();
path = new StringBuilder(path)
.append("/")
.append(context.getResources().getString(R.string.root_folder_name))
.append("/")
.append(context.getResources().getString(R.string.data_folder_name))
.append("/")
.append(context.getResources().getString(R.string.my_data_file_name))
.toString();
try{
builder = domFactory.newDocumentBuilder();
doc = builder.parse(path);
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
XPathExpression expr
= xpath.compile("//year[author='Neal Stephenson']/title/text()");
Object result = expr.evaluate(doc, XPathConstants.NODESET);
NodeList nodes = (NodeList) result;
for (int i = 0; i < nodes.getLength(); i++) {
System.out.println(nodes.item(i).getNodeValue());
}
}catch(Exception e){
e.printStackTrace();
}
}
@Override
public String read(Context context) {
// TODO Auto-generated method stub
return null;
}
}
| [
"yu-derrick.huang@schneider-electric.com"
] | yu-derrick.huang@schneider-electric.com |
ea02a18430039386b21dc50db9d5aec23f77ee1b | b2a3210ea197e86967e9d57d1390fd0f804b2a36 | /on-java8/src/main/java/com/ericaShy/java8/generics/LostInformation.java | f1ada837a86867a1037e84f8d306e46bff6bf70d | [] | no_license | 547358880/javatutorials | 5b97781755c7b00064e078228120cf8e8775aa67 | c4f698805e437a30ffd9d4804284c84327d8693b | refs/heads/master | 2021-06-26T19:28:17.101859 | 2020-01-02T00:49:07 | 2020-01-02T00:49:07 | 220,178,290 | 0 | 0 | null | 2021-03-31T21:38:17 | 2019-11-07T07:37:28 | Java | UTF-8 | Java | false | false | 756 | java | package com.ericaShy.java8.generics;
import java.util.*;
class Frob {}
class Fnorkle {}
class Quark<Q> {}
class Particle<POSITION, MOMENTUM> {}
public class LostInformation {
public static void main(String[] args) {
List<Frob> list = new ArrayList<>();
Map<Frob, Fnorkle> map = new HashMap<>();
Quark<Fnorkle> quark = new Quark<>();
Particle<Long, Double> p = new Particle<>();
System.out.println(Arrays.toString(list.getClass().getTypeParameters()));
System.out.println(Arrays.toString(map.getClass().getTypeParameters()));
System.out.println(Arrays.toString(quark.getClass().getTypeParameters()));
System.out.println(Arrays.toString(p.getClass().getTypeParameters()));
}
}
| [
"547358880@qq.com"
] | 547358880@qq.com |
5e627401ffa1893c809ddb667f032728d6799f62 | 25dc35ed3f9e2936dcce733226437eb50a72c97a | /TechFundamentalsProjects/StringAndTextProcessingLab/src/reverseStrings.java | c195f87421508caeb5ed577ddef2ea61d6719d9e | [] | no_license | ktodorova23/SoftUni-Java-Developer | 6a27c11a7e49ea4d9641e3299c5c5892d960c816 | 14965b779835d35c4763b951c8a4cbef645cefe3 | refs/heads/master | 2022-08-23T19:59:03.911634 | 2019-11-01T16:05:33 | 2019-11-01T16:05:33 | 199,443,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | import java.util.Scanner;
public class reverseStrings {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
String word = console.nextLine();
while (!word.equals("end")) {
StringBuilder reversedWord = new StringBuilder();
for (int i = word.length() - 1; i >= 0; i--) {
reversedWord.append(word.charAt(i));
}
System.out.println(String.format("%s = %s", word, reversedWord.toString()));
word = console.nextLine();
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
8b7cad49f35f466d63b359896876515fa749bca5 | 71671fc4949e0e57ebc621b3f95dd79e8fa2a1af | /app/src/main/java/com/kamus/kamusenglish/model/KamusModel.java | fdd54ee72bfddc28b6f0938d9027813cef51cc7a | [] | no_license | oohyugi/KamusEnglish | f04144ce10ae13b4a006d4a18aab5171b075c037 | 453da6ebc8750d544335930df8a8275eccab6eb8 | refs/heads/master | 2021-01-10T05:57:14.246106 | 2016-02-09T05:06:45 | 2016-02-09T05:06:45 | 51,347,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,075 | java | package com.kamus.kamusenglish.model;
import android.view.View;
import java.io.Serializable;
/**
* Created by koba on 11/23/15.
*/
public class KamusModel implements Serializable {
int id;
String kata;
String arti;
public int getId(){
return id;
}
public void setId(int id){
this.id=id;
}
public String getKata(){
return kata;
}
public void setKata(String kata){
this.kata=kata;
}
public String getArti(){
return arti;
}
public void setArti(String arti){
this.arti=arti;
}
public static KamusModel getKamusModel(String kata,String arti){
KamusModel kamusModel=new KamusModel();
kamusModel.setKata(kata);
kamusModel.setArti(arti);
return kamusModel;
}
public static KamusModel getKamusModel(int id,String kata,String arti){
KamusModel kamusModel=new KamusModel();
kamusModel.setKata(kata);
kamusModel.setArti(arti);
kamusModel.setId(id);
return kamusModel;
}
}
| [
"mail.yogiputra@gmail.com"
] | mail.yogiputra@gmail.com |
abd9538ad61357e031551e193f1ff52b2c11d92f | 795ec14633c5d9fecdb97bbbdfe8bea645270c2c | /FirstJavaProject/src/StartJava/B.java | b45a5bbbbe459b6bdfdf139a625d4959e27908e0 | [] | no_license | swami1984/ACESeleniumLab | b4ff9da4055093e53346fff80f986bb6272e3f39 | d7b468d6ae812b7a5348e7df17bb2e481ea2e1f3 | refs/heads/master | 2023-06-04T08:20:04.199620 | 2021-07-01T10:32:53 | 2021-07-01T10:32:53 | 381,936,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 542 | java | package StartJava;
public class B extends A {
public B () {
// Super is keyword is used to call parent method construtor
//if super keyword is there is defualt will not be called on parent constructor
//
super();
}
public B (int i) {
super(i);
System.out.println("const with one params");
}
public B (int i,int j) {
super(i,j);
System.out.println("const with tw params");
}
public static void main(String[] args) {
B obj = new B();
B obj1= new B(10);
B obj2= new B(10,20);
}
}
| [
"swamynttdata@gmail.com"
] | swamynttdata@gmail.com |
a53d6d589f68f66cfc15d3ffdad754ae7efe01db | 2bb2a7a9564feb1c93c699adb85ff9c6ec100c45 | /Wallet_Components/src/main/java/com/dasset/wallet/components/widget/tablayout/listener/OnScrollChangeListener.java | 507b932ab6a4e2e5f8d60a57bec12175058211d2 | [] | no_license | Tyeeee/Dasset_Wallet | 2c2a10bceee85b069b65def1da6bc09add737c0e | 310ff441afc276dcf1b65e256cd9b4d176d8a8f6 | refs/heads/master | 2021-09-07T14:06:14.699810 | 2018-02-24T01:38:32 | 2018-02-24T01:38:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | package com.dasset.wallet.components.widget.tablayout.listener;
/**
* Interface definition for a callback to be invoked when the scroll position of a view changes.
*/
public interface OnScrollChangeListener {
/**
* Called when the scroll position of a view changes.
*
* @param scrollX Current horizontal scroll origin.
* @param oldScrollX Previous horizontal scroll origin.
*/
void onScrollChanged(int scrollX, int oldScrollX);
}
| [
"yuanjintye@163.com"
] | yuanjintye@163.com |
0645bb6efd53585d80221210d3b654e0e4b14967 | b9f4d7a5da7f84e45ecd92491df783a41256a76e | /java/src/Strings/SherlockAndValidString.java | 304a9ed247bc6370e7ffdeb584e592afd0056c50 | [] | no_license | igorfil/hackerrank | 163a8b1d5c89465784630f7bbd51b1f034317e48 | dc971011fe239a776e9c0022422e2f203a051a1d | refs/heads/master | 2020-04-10T15:06:19.295401 | 2019-01-07T00:21:44 | 2019-01-07T00:21:44 | 161,097,185 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,017 | java | package Strings;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import static org.junit.jupiter.api.Assertions.assertEquals;
// https://www.hackerrank.com/challenges/sherlock-and-valid-string/
public class SherlockAndValidString {
static String isValid(String s) {
if(s.length() <= 3) return "YES";
Map<Integer, Long> freq = s.chars()
.boxed()
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
List<Long> values = new ArrayList<>(freq.values());
Collections.sort(values);
return allEqual(values) || oneCountExtra(values) || oneCharExtra(values) ? "YES" : "NO";
}
private static boolean allEqual(final List<Long> list) {
return list.get(0).equals(list.get(list.size() - 1));
}
private static boolean oneCountExtra(final List<Long> list) {
return list.get(0).equals (list.get(list.size() - 2))
&& list.get(0).equals (list.get(list.size() - 1) - 1);
}
private static boolean oneCharExtra(final List<Long> list) {
return list.get(0) == 1
&& list.get(1).equals(list.get(list.size() - 1));
}
@Test
void test() throws IOException {
assertEquals("YES", isValid("a"));
assertEquals("YES", isValid("abc"));
assertEquals("YES", isValid("abcc"));
assertEquals("YES", isValid("aabbc"));
assertEquals("NO", isValid("abccc"));
assertEquals("NO", isValid("aabbccddeefghi"));
assertEquals("YES", isValid("abcdefghhgfedecba"));
assertEquals("YES", isValid(Files.readAllLines(Paths.get("src/Strings/SherlockAndValidString_longInput.txt"), Charset.defaultCharset()).get(0)));
}
}
| [
"igor.v.fil@gmail.com"
] | igor.v.fil@gmail.com |
3c83c42b0e9b49ff0792555979d852298f2540c0 | 071a9fa7cfee0d1bf784f6591cd8d07c6b2a2495 | /corpus/norm-class/ecf/602.java | 26fa0e033442d2e8326318ba2051dfc9ac81bb64 | [
"MIT"
] | permissive | masud-technope/ACER-Replication-Package-ASE2017 | 41a7603117f01382e7e16f2f6ae899e6ff3ad6bb | cb7318a729eb1403004d451a164c851af2d81f7a | refs/heads/master | 2021-06-21T02:19:43.602864 | 2021-02-13T20:44:09 | 2021-02-13T20:44:09 | 187,748,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 971 | java | org eclipse ecf sync org eclipse core runtime i status istatus org eclipse ecf core util ecf exception ecfexception model update exception modelupdateexception ecf exception ecfexception serialversionuid i model change imodelchange model change modelchange object model model update exception modelupdateexception string message i model change imodelchange object model message model change modelchange model model model update exception modelupdateexception throwable i model change imodelchange object model model change modelchange model model model update exception modelupdateexception string message throwable i model change imodelchange object model message model change modelchange model model model update exception modelupdateexception i status istatus status i model change imodelchange object model status model change modelchange model model i model change imodelchange get model change getmodelchange model change modelchange object get model getmodel model | [
"masudcseku@gmail.com"
] | masudcseku@gmail.com |
be3420df7d66f1e67e5f717a5f1efecf09884ab4 | f4174e5fe2deb164e9ee4a866a9c4355827953e5 | /library/lib_common/src/com/c/rabbit/cache/memory/MemoryBitmapCache.java | 0e8a504d4f65d709e69ea1583124292910ddf27f | [] | no_license | androidbat/RabbitNew | f40fb99869473fc1210a6b4f9d40f34a99a99620 | ca1f46ca967b863e6ef423f4cab1be52d4ab8a2f | refs/heads/master | 2021-01-19T03:13:59.367557 | 2015-08-06T13:16:14 | 2015-08-06T13:16:14 | 35,936,574 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,688 | java | package com.c.rabbit.cache.memory;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.support.v4.util.LruCache;
import android.text.TextUtils;
import com.c.rabbit.utils.BitmapDecodeUtils;
import com.c.rabbit.utils.LLog;
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
public class MemoryBitmapCache {
private static final String TAG = "memory";
private MemoryBitmapCache(){
int maxMemory = (int) Runtime.getRuntime().maxMemory()/1024;
int mCacheSize = maxMemory / 8;
LLog.d("memory"," mcachesize "+mCacheSize);
mLruCache = new LruCache<String, Bitmap>(mCacheSize){
@Override
protected int sizeOf(String key, Bitmap bitmap) {
int bitmapSize = getBitmapSize(bitmap);
LLog.d("memory"," bitmapSize = "+bitmapSize);
return bitmapSize == 0 ? 1 : bitmapSize;
}
@Override
protected void entryRemoved(boolean evicted, String key,
Bitmap oldValue, Bitmap newValue) {
LLog.d("memory"," entryRemoved ");
}
};
}
protected int getBitmapSize(Bitmap bitmap) {
if (Build.VERSION.SDK_INT >= 12) {
return bitmap.getByteCount()/1024;
}
return bitmap.getRowBytes() * bitmap.getHeight()/1024;
}
private static MemoryBitmapCache instance;
private LruCache<String, Bitmap> mLruCache;
public static MemoryBitmapCache getInstance(){
if (instance == null) {
synchronized (MemoryBitmapCache.class) {
if (instance == null) {
instance = new MemoryBitmapCache();
}
}
}
return instance;
}
public void addBitmapToMemoryCache(String key, Bitmap bitmap) {
if (TextUtils.isEmpty(key) || bitmap == null) {
return;
}
if (getBitmapFromMemCache(key) == null) {
synchronized (mLruCache) {
mLruCache.put(key, bitmap);
}
}
}
public Bitmap getBitmapFromMemCache(String key) {
if (TextUtils.isEmpty(key)) {
return null;
}
Bitmap bitmap;
synchronized (mLruCache) {
bitmap = mLruCache.get(key);
if (bitmap != null) {
return bitmap;
}
}
return null;
}
public Bitmap getResource(int id,Context context){
Bitmap bm = getBitmapFromMemCache(id + "");
if (bm == null) {
LLog.d("memory"," bm == null ");
bm = BitmapDecodeUtils.decodeResource(context, id);
if (bm != null) {
synchronized (mLruCache) {
mLruCache.put(id + "", bm);
}
}
}else{
LLog.d("memory"," bm != null ");
}
return bm;
}
public Bitmap remove(String key){
synchronized (mLruCache) {
return mLruCache.remove(key);
}
}
}
| [
"hero3640@gmail.com"
] | hero3640@gmail.com |
e4fd086c16383e70d98daf83a3cd8be85cd0193d | 915a20efc1f0c5f89937ce656f8202e56996d94b | /src/main/java/com/shiro/steel/pojo/vo/RoleVo.java | e54b2fb3eceba0885494f0c5f2e8f7d58ea8744e | [] | no_license | bigbomb/ricebowl_back | ff94b9061730663d8667db18a3ca06928f99d89f | 80d3dbd24777c65a194e7cb1ac1fec09021a37bd | refs/heads/master | 2022-12-12T19:53:51.360974 | 2020-06-27T07:58:30 | 2020-06-27T07:58:30 | 221,870,830 | 0 | 0 | null | 2022-12-06T00:43:26 | 2019-11-15T07:43:26 | Java | UTF-8 | Java | false | false | 894 | java | package com.shiro.steel.pojo.vo;
import org.hibernate.validator.constraints.NotEmpty;
/**
* @desc: 角色vo
*
* @author: jwy
* @date: 2017/12/26
*/
public class RoleVo {
/**
* 名称
*/
@NotEmpty(message = "角色名称不能为空")
private String name;
/**
* 描述
*/
@NotEmpty(message = "角色描述不能为空")
private String description;
/**
* 类型
*/
private Integer type;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
| [
"76169099@qq.com"
] | 76169099@qq.com |
9fc6c51791ee5ccee7915700a53c263315387fa4 | d2dde19ee448dbd41b016d5029be0eed398c9c2d | /app/src/test/java/com/hg/mad/ExampleUnitTest.java | 9e2978db67292462d4611fd7442a9bc163d0b6e3 | [] | no_license | s-hliao/FBLA-Mobile-App-2019 | 02a164d738fc2c93ef491aa1116f673fdd67f3a9 | f008f96c3b108fb011de0f48cf4b909ac62fdcfa | refs/heads/master | 2020-11-26T17:22:55.543437 | 2020-04-25T21:55:07 | 2020-04-25T21:55:07 | 229,155,391 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package com.hg.mad;
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);
}
} | [
"georgezhang02@hotmail.com"
] | georgezhang02@hotmail.com |
4eaa7b397acebbfbf6f8474289cb2bc05312f6ab | cb6d92753c52a7d872f305dc984e1f1da286908f | /src/main/java/hello/HelloResponse.java | 534e0b08fec636097b73aebc283f89997ebd7668 | [] | no_license | dinhminhnguyen/KTHDV-GRPC | c27b7cc36be6e5bfc376b94b1bb89f91606ef007 | 3d9a9f75b217a1bbfe857c772e43765bacde9cdb | refs/heads/master | 2023-03-23T20:34:06.029923 | 2021-03-09T10:44:54 | 2021-03-09T10:44:54 | 345,967,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 204 | java | package hello;
public class HelloResponse {
public String message = " ";
private HelloResponse() {
message = "";
}
public HelloResponse(String id ){
message = id;
}
}
| [
"ndm.uet@gmail.com"
] | ndm.uet@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.