blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
726b4dd709e3273b2bff83e3ab2cee3a3b399891
|
35491da5c302de8e38a2cd79dd89d44f5787c8e2
|
/src/cn/rain/Exceptions/UserExistedException.java
|
38206e79c947b9e95e10a25acb6e91da8e4146b1
|
[] |
no_license
|
YangBingxi/Java-StudentCourse-Manage_Server
|
9ba905a18f05484561ae7f17445dd1f3fd3f5ef3
|
13b0e5c25c13730ad6f9872bb69984eacaeb6751
|
refs/heads/master
| 2022-01-08T03:17:30.348915
| 2019-06-01T13:58:46
| 2019-06-01T13:58:46
| null | 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 886
|
java
|
package cn.rain.Exceptions;
/**
* 用户已存在时抛出此异常
*
* @author SwYoung
* @version V1.0
* @since 2019-4-29
*/
public class UserExistedException extends Exception {
private static final long serialVersionUID = 2958039873765717022L;
public UserExistedException() {
super();
// TODO Auto-generated constructor stub
}
public UserExistedException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super();
// TODO Auto-generated constructor stub
}
public UserExistedException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public UserExistedException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public UserExistedException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
}
|
[
"798640762@qq.com"
] |
798640762@qq.com
|
5352f6587bca89a73fc72a6827f583d0cc1508d3
|
60c5a55e6577b865f8af774ca7c62c81b6eced88
|
/SimpleDBServer/src/simpledb/parse/InsertData.java
|
0c14f33416a8098412b7875ba7cfcc1eafc5d531
|
[] |
no_license
|
philip-w-howard/SimpleDB
|
30ac2062e8bd9e3ac38b8dffe00ccd4ddc3e55a5
|
a7578bed712c28f82c9e09c1a4aa0f8d5d03a547
|
refs/heads/master
| 2021-01-25T12:01:56.290610
| 2014-04-28T21:54:30
| 2014-04-28T21:54:30
| 18,180,317
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,154
|
java
|
package simpledb.parse;
import simpledb.query.Constant;
import java.util.*;
/**
* Data for the SQL <i>insert</i> statement.
* @author Edward Sciore
*/
public class InsertData {
private String tblname;
private List<String> flds;
private List<Constant> vals;
/**
* Saves the table name and the field and value lists.
*/
public InsertData(String tblname, List<String> flds, List<Constant> vals) {
this.tblname = tblname;
this.flds = flds;
this.vals = vals;
}
/**
* Returns the name of the affected table.
* @return the name of the affected table
*/
public String tableName() {
return tblname;
}
/**
* Returns a list of fields for which
* values will be specified in the new record.
* @return a list of field names
*/
public List<String> fields() {
return flds;
}
/**
* Returns a list of values for the specified fields.
* There is a one-one correspondence between this
* list of values and the list of fields.
* @return a list of Constant values.
*/
public List<Constant> vals() {
return vals;
}
}
|
[
"phil.w.howard@gmail.com"
] |
phil.w.howard@gmail.com
|
b9fa02b1a40eb013c89e3c25ec7e1bb29236123a
|
f70b9696255c875960460f5c3508c305a81c2858
|
/Lab4/DisplayCalendars.java
|
e21a5f8f45507e5536aabd47c042eabc815ddffb
|
[] |
no_license
|
ashwinath/JavaLab
|
df82036d9faff5a2a3ac0576a84fde61b6f7ef7b
|
a0bb99656adbc6b2100b690dd5a2ad11c73e5e1b
|
refs/heads/master
| 2021-01-10T14:02:39.919649
| 2016-03-11T16:29:29
| 2016-03-11T16:29:29
| 52,792,426
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,367
|
java
|
// File: DisplayCalendars.java
// Purpose: Generate months of a calendar
// Author: Ashwin Nath Chatterji
// Date: 14-02-2016
import java.util.Scanner;
public class DisplayCalendars {
public class Calendar {
// sunday is 0, wed is 3 and sun is 6; i.e 0-6
private int startDay;
private int year;
public Calendar(int startDay, int year) {
this.startDay = startDay;
this.year = year;
}
private boolean isLeapYear() {
return ((this.year % 4 == 0) && (this.year % 100 != 0) || (this.year % 400 == 0));
}
private int getDaysInMonth(int month) {
switch (month) {
case (1) : return 31;
case (2) : return isLeapYear() ? 29 : 28;
case (3) : return 31;
case (4) : return 30;
case (5) : return 31;
case (6) : return 30;
case (7) : return 31;
case (8) : return 31;
case (9) : return 30;
case (10) : return 31;
case (11) : return 30;
case (12) : return 31;
default: return -1;
}
}
private String getMonthName(int month) {
String monthName;
switch (month) {
case (1) : monthName = "January"; break;
case (2) : monthName = "February"; break;
case (3) : monthName = "March"; break;
case (4) : monthName = "April"; break;
case (5) : monthName = "May"; break;
case (6) : monthName = "June"; break;
case (7) : monthName = "July"; break;
case (8) : monthName = "August"; break;
case (9) : monthName = "September"; break;
case (10) : monthName = "October"; break;
case (11) : monthName = "November"; break;
case (12) : monthName = "December"; break;
default: monthName = "Error"; break;
}
return monthName;
}
private void printCalendarHeader(int month) {
String monthName = getMonthName(month);
System.out.println(" " + monthName + " " + this.year);
System.out.println("-----------------------------");
System.out.println(" Sun Mon Tue Wed Thu Fri Sat");
}
private void generateMonth(int month) {
// do something
int count = 1;
int daysInLine = 0;
// skip initial days first
for (; daysInLine != this.startDay; ++daysInLine) {
System.out.print(" ");
}
// print the numbers on the calendar
int numberOfDays = getDaysInMonth(month);
for (; count <= numberOfDays; ++count, ++daysInLine, ++(this.startDay)) {
System.out.print(String.format("%4d", count));
if (daysInLine == 6) {
System.out.println();
daysInLine = -1;
}
if (this.startDay == 6)
this.startDay = -1;
}
}
public void generateCalendar() {
for (int i = 1; i != 13; ++i) {
printCalendarHeader(i);
generateMonth(i);
System.out.println();
System.out.println();
}
}
}
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a year: ");
int year = scanner.nextInt();
System.out.print("Enter the first day of the year (0-6): ");
int startDay = scanner.nextInt();
DisplayCalendars meh = new DisplayCalendars();
Calendar mehmeh = meh.new Calendar(startDay, year);
mehmeh.generateCalendar();
}
}
|
[
"ashwinath@hotmail.com"
] |
ashwinath@hotmail.com
|
27eb18cf9df464475e33b2f7df73417113ee97a2
|
7269fd6a4cb9355a33b6510eb35c3e3d3326201c
|
/product-service/src/main/java/com/labs/entities/enums/OrderStatus.java
|
b07b9ba6ad28c361b078075b3f15585cba101feb
|
[] |
no_license
|
medmedCH/Bubble-store-back-end
|
484a70ab55c92778ba45464159bfed1d98a00e58
|
4de4f8d303e6724d5b908a306485fd815fc2024e
|
refs/heads/main
| 2023-06-07T16:43:33.331238
| 2021-06-18T09:28:27
| 2021-06-18T09:28:27
| 341,688,027
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 89
|
java
|
package com.labs.entities.enums;
public enum OrderStatus {
CREATION, CLOSED,PAID
}
|
[
"mohamed.chabbouh@esprit.tn"
] |
mohamed.chabbouh@esprit.tn
|
e78dc6dc30e9caf3685d096b35ea7f6d32af4c8a
|
a52db087080bf4fe1be941cadda246af3ca06bc6
|
/src/main/java/com/why/platform/framework/engine/http/ExporterServer.java
|
d5d6d1aa22e6c6c1571ad6fd1b1e926ea43534b1
|
[] |
no_license
|
wanghaiyang1221/application-engine
|
0ec5f5b8b606acf1490bce3528572fef5374c49f
|
98effce84d3106a5f21054398b10b61479cb27d3
|
refs/heads/master
| 2021-04-09T15:04:34.930535
| 2018-03-16T08:32:36
| 2018-03-16T08:32:36
| 125,479,952
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 205
|
java
|
package com.why.platform.framework.engine.http;
/**
* Created by zhouxl on 2016/11/17 0017.
*/
public interface ExporterServer {
void start() throws Exception;
void stop() throws Exception;
}
|
[
"619331247@qq.com"
] |
619331247@qq.com
|
188ec7ee84307e0338c2ba4b57d95ae3648c1eea
|
1a51f14e3356da0784cafa3da9812fd0ad186a52
|
/src/com/stock/userInfomation/ChangeEquipAction.java
|
1d0335dfd0afd5b2b7dc5973778c61f83bc05ff4
|
[] |
no_license
|
heavendarren/tfkj_stock
|
5c25851ca3360a4c800f4cbc5639e8313d392c19
|
5ad5640293160ee40107887a53d6260a4c15f3d5
|
refs/heads/master
| 2020-11-29T14:44:07.613103
| 2017-04-07T02:29:52
| 2017-04-07T02:29:52
| 87,493,214
| 0
| 1
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 1,636
|
java
|
package com.stock.userInfomation;
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 com.hrbank.business.frame.BusinessPaginationAction;
import com.takucin.aceeci.frame.sql.DataRow;
import com.takucin.aceeci.frame.sql.DataSet;
public class ChangeEquipAction extends BusinessPaginationAction{
private ChangeEquipService service = new ChangeEquipService();
public ActionForward init(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ChangeEquipForm f = (ChangeEquipForm) form;
if(request.getParameter("equtype").equals("1")){
f.setType("ONU");
}else {
f.setType("»ú¶¥ºÐ");
}
return firstPage(mapping, form, request, response);
}
public ActionForward query(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ChangeEquipForm f = (ChangeEquipForm) form;
f.setHidden();
return firstPage(mapping, form, request, response);
}
public ActionForward getActionForward(ActionMapping mapping) {
return mapping.findForward(FW_INIT);
}
public DataSet<DataRow> getResult(ActionForm form, int first, int rows)
throws Exception {
ChangeEquipForm f = (ChangeEquipForm) form;
return service.getResult((ChangeEquipForm) form, first, rows);
}
public int getResultCount(ActionForm form) throws Exception {
return service.getResultCount((ChangeEquipForm) form);
}
}
|
[
"heavendarren@126.com"
] |
heavendarren@126.com
|
42807a20cac64dd1d28280442160dce521a6a064
|
0422cecf7ca43765afaaeaacc012fc13f70db88f
|
/spring-40-security/spring-02-security-customize/src/main/java/tian/pusen/handler/CustomAccessDeniedHandler.java
|
a8527b5dfd96ed2c548546cb9e77e7c36cee1b45
|
[
"MIT"
] |
permissive
|
pustian/learn-spring-boot
|
bf4982782942073bb4cff2b3f855f247f012dd63
|
9fe44b486d4f4d155e65147a4daface52e76d32d
|
refs/heads/master
| 2021-04-16T04:25:09.211648
| 2020-06-10T15:16:35
| 2020-06-10T15:16:35
| 249,327,629
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,409
|
java
|
package tian.pusen.handler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
*
* @author: BaoZhou
* @date : 2018/6/25 19:27
*/
@Component
public class CustomAccessDeniedHandler implements AccessDeniedHandler {
private static Logger logger = LoggerFactory.getLogger(CustomAccessDeniedHandler.class);
@Override
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AccessDeniedException e) throws IOException, ServletException {
Authentication auth
= SecurityContextHolder.getContext().getAuthentication();
if (auth != null) {
logger.info("User '" + auth.getName()
+ "' attempted to access the protected URL: "
+ httpServletRequest.getRequestURI());
}
httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/403");
}
}
|
[
"pustian@msn.com"
] |
pustian@msn.com
|
5f837d54bd8fb2980331431ef8bf0d40dc90ecb5
|
63d319fbd88e49701d8dcc2919c8f3a6013e90d0
|
/CoCoNut/org.reuseware.coconut.fragment.edit/src/org/reuseware/coconut/fragment/provider/ComposedFragmentItemProvider.java
|
c005d3bf1642854d10a0448af01fa3475d10aa53
|
[] |
no_license
|
DevBoost/Reuseware
|
2e6b3626c0d434bb435fcf688e3a3c570714d980
|
4c2f0170df52f110c77ee8cffd2705af69b66506
|
refs/heads/master
| 2021-01-19T21:28:13.184309
| 2019-06-09T20:39:41
| 2019-06-09T20:48:34
| 5,324,741
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,477
|
java
|
/*******************************************************************************
* Copyright (c) 2006-2012
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.reuseware.coconut.fragment.provider;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposedImage;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.ui.PlatformUI;
import org.reuseware.coconut.fragment.Fragment;
/**
* This is the item provider adapter for a {@link org.reuseware.coconut.fragment.ComposedFragment} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ComposedFragmentItemProvider
extends FragmentItemProvider
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComposedFragmentItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns ComposedFragment.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public Object getImage(Object object) {
Fragment fragment = (Fragment) object;
List<String> ufi = fragment.getUFI();
if (ufi.isEmpty()) {
return overlayImage(object,
getResourceLocator().getImage("full/obj16/FragmentDiagramFile"));
}
String fileName = ufi.get(ufi.size()-1);
List<Object> images = new ArrayList<Object>(2);
// XXX the PlatformUI dependency could be set to optional and only used
// when available
images.add(PlatformUI.getWorkbench().getEditorRegistry()
.getImageDescriptor(fileName));
images.add(getResourceLocator().getImage("full/obj16/OverlayComposed"));
return new ComposedImage(images);
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public String getText(Object object) {
return super.getText(object);
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
|
[
"jendrik.johannes@devboost.de"
] |
jendrik.johannes@devboost.de
|
a5ccf0e9df3439943ff9edf595241d6c4d271e5b
|
c4e55cd102753b609836e8db4d6b30b8029aea0a
|
/src/Checkbook.java
|
5a4d6fa222c190784819631528e465697781a5fc
|
[] |
no_license
|
kellykurkowski/csi2310-project
|
56df03abf34d3b94ac30b966acec766f14d5f590
|
0c5aab60aada31ce595ef92849e6fe07695e2cc6
|
refs/heads/master
| 2020-05-01T07:53:53.215302
| 2019-03-24T02:46:48
| 2019-03-24T02:46:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,440
|
java
|
package finalproject;
/**
* CSE 231 - Final Project
* Kelly Kurkowski & Wendy Yang
*/
import static java.lang.Math.*;
import java.util.ArrayList;
import java.text.DecimalFormat;
public class Checkbook
{
ArrayList<Transaction> chbk;
Transaction trans;
int n = 0;
private boolean found;
DecimalFormat formatter = new DecimalFormat("$#0.00");
public Checkbook()
{
chbk = new ArrayList<>();
}
public void add(Transaction t)
{
chbk.add(t);
}
public void remove()
{
n = chbk.size()-1;
chbk.remove(n);
}
private void find(String e)
{
n = 0;
found = false;
while (n < chbk.size())
{
if (chbk.get(n).getDate().equals(e)
|| chbk.get(n).getDsc().equals(e)
|| chbk.get(n).getCat().equals(e))
{
found = true;
return;
}
else
n++;
}
}
public boolean contains(String e)
{
find(e);
return found;
}
public String toString()
{
String result = "";
for(Transaction temp : chbk)
{
result += temp.toString() + "\n";
}
return result;
}
public String calculateSpending(String e)
{
double sum = 0;
n=0;
while (n < chbk.size())
{
if (chbk.get(n).getCat().equals(e))
{
found = true;
sum += chbk.get(n).getAmt();
}
n++;
}
return formatter.format(abs(sum));
}
public String getBalance()
{
double sum = 0;
for (Transaction chbk1 : chbk)
{
sum += chbk1.getAmt();
}
return formatter.format(sum);
}
public boolean isEmpty()
{
return chbk.isEmpty();
}
// public void quickSort()
// {
// recQuickSort(0, chbk.size()-1);
// }
//
// public void recQuickSort(int left, int right)
// {
// if(right-left <= 0)
// return;
// else
// {
// Transaction pivot = chbk.get(right);
//
// int partition = partitionIt(left, right, pivot);
// recQuickSort(left, partition-1);
// recQuickSort(partition+1, right);
// }
// }
//
// public int partitionIt(int left, int right, Transaction pivot)
// {
// int leftPtr = left-1;
// int rightPtr = right;
//
// while(true)
// {
// while(chbk.get(++leftPtr) < pivot)
// ;
//
// while(rightPtr > 0 && chbk.get(--rightPtr) > pivot)
// ;
//
// if(leftPtr >= rightPtr)
// break;
// else
// swap(leftPtr, rightPtr);
// }
//
// swap(leftPtr, right);
// return leftPtr;
// }
//
// public void swap(int a, int b)
// {
// Transaction temp = chbk.get(a);
// chbk.get(a) = chbk.get(b);
// chbk.get(b) = temp;
// }
}
|
[
"noreply@github.com"
] |
kellykurkowski.noreply@github.com
|
b15ea9398ec8def2efcfc196d4405de8f827f081
|
7b2310271ae64060cf1f1460c79990a09b95ca59
|
/src/main/java/queue/LinkedQueue.java
|
7733893c2edd934e1c1756b781795e7fb64b62c4
|
[] |
no_license
|
balajivenki/algo
|
924045d21d41099a44239a2e2712c8c17f129e36
|
d89a37aeeb2f4352273ad0d4fa3e5ca1389f3c03
|
refs/heads/master
| 2021-01-01T16:45:56.011704
| 2017-08-03T13:00:06
| 2017-08-03T13:00:06
| 97,911,978
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,175
|
java
|
package queue;
/**
* Created by bvenkatesan on 7/16/17.
*/
public class LinkedQueue {
public static class QNode {
int data;
QNode next;
QNode(int data) {
this.data = data;
next = null;
}
}
public QNode front, rear;
public void enqueue(int data) {
QNode qNode = new QNode(data);
if(rear == null) {
this.front = this.rear = qNode;
return;
} else {
this.rear.next = qNode;
this.rear = qNode;
}
}
public int dequeue() {
if(this.front == null) {
return Integer.MIN_VALUE;
}
int item = this.front.data;
this.front = this.front.next;
if(this.front == null) {
this.rear = null;
}
System.out.println("Dequeued item is "+ item);
return item;
}
public static void main(String[] args) {
LinkedQueue q=new LinkedQueue();
q.enqueue(10);
q.enqueue(20);
q.dequeue();
q.dequeue();
q.enqueue(30);
q.enqueue(40);
q.enqueue(50);
q.dequeue();
}
}
|
[
"venkatesan.balaji@gmail.com"
] |
venkatesan.balaji@gmail.com
|
7a63b6815607a51ecfbf3137de28efd5102ef793
|
d5ec76cc9a2a170cb7939a0f09304e6190d7d2df
|
/src/main/java/duke605/ms/glow/lib/GlowTab.java
|
8749b66fdfb28635ebdf19e67a21d09fecd8f4d2
|
[] |
no_license
|
duke605/Glow
|
60bc5faa8de83dc80d484f0f9835c9f5f55d9831
|
8889e35540d1e94272822985bfa2c6e2879c0d94
|
refs/heads/master
| 2021-01-22T16:25:57.931609
| 2014-08-28T20:41:32
| 2014-08-28T20:41:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 314
|
java
|
package duke605.ms.glow.lib;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
public class GlowTab extends CreativeTabs {
public GlowTab() {
super("glow");
}
@Override
public Item getTabIconItem() {
return LibItems.glowstoneGoggles;
}
}
|
[
"duke6605@gmail.com"
] |
duke6605@gmail.com
|
9c3eede81de50356ec51bb377ff47eb124e99f68
|
377405a1eafa3aa5252c48527158a69ee177752f
|
/src/com/paypal/android/sdk/payments/aD.java
|
261d0f8a2e9958f2c5067dc37cf2ddd026c62f72
|
[] |
no_license
|
apptology/AltFuelFinder
|
39c15448857b6472ee72c607649ae4de949beb0a
|
5851be78af47d1d6fcf07f9a4ad7f9a5c4675197
|
refs/heads/master
| 2016-08-12T04:00:46.440301
| 2015-10-25T18:25:16
| 2015-10-25T18:25:16
| 44,921,258
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 878
|
java
|
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.paypal.android.sdk.payments;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
// Referenced classes of package com.paypal.android.sdk.payments:
// PayPalService
final class aD extends BroadcastReceiver
{
private PayPalService a;
aD(PayPalService paypalservice)
{
a = paypalservice;
super();
}
public final void onReceive(Context context, Intent intent)
{
if (intent.getAction().equals("com.paypal.android.sdk.clearAllUserData"))
{
a.g();
Log.w("paypal.sdk", "active service user data cleared");
}
}
}
|
[
"rich.foreman@apptology.com"
] |
rich.foreman@apptology.com
|
9a105b6b300cb60f4cc7e90202d264e89bef3940
|
d537d9e6e7768f72a6bdf6325c23a82c936b5ed6
|
/src/main/java/pl/paweln/agricola/action/Build1BarnOrBakeBreadAction.java
|
71aef349c07793d7e1c8ff179c81c7a769098a5c
|
[] |
no_license
|
paweln1975/Agricola
|
1a1608583925f100fffb71ae60f03a543fc9737b
|
b06be24cf1d8e66ed9818a99294b8c5d8a785d80
|
refs/heads/master
| 2023-02-21T19:24:34.557599
| 2021-01-24T15:23:31
| 2021-01-24T15:23:31
| 323,131,677
| 0
| 0
| null | 2021-01-24T15:23:33
| 2020-12-20T17:52:28
|
Java
|
UTF-8
|
Java
| false
| false
| 260
|
java
|
package pl.paweln.agricola.action;
public class Build1BarnOrBakeBreadAction extends SpecificAction {
public Build1BarnOrBakeBreadAction() {
super(ActionType.BUILD_1_BARN_OR_BAKE_BREAD);
super.setName("Build 1 Barn or Bake Bread");
}
}
|
[
"pawel.niedziela@gmail.com"
] |
pawel.niedziela@gmail.com
|
6dc78a527ab6677dbcc7713f7decf8bbaca8bcf0
|
ca896234acd4afd79d7f7fbe92058774570c1671
|
/01.project_as_tool/myTool/src/testObject/ClsMaker.java
|
3f615ca9197e9a3d2123baa01ac0713050264fb5
|
[] |
no_license
|
lotuswlz/wlz-project
|
a315a923fa64950a338df74a7a22c8ccb2a6ac19
|
33c5c2453eddc9f8bf254bb18733cc0d785e1fd1
|
refs/heads/master
| 2021-03-12T21:58:23.089919
| 2011-08-03T11:37:10
| 2011-08-03T11:37:10
| 37,233,555
| 0
| 0
| null | null | null | null |
EUC-JP
|
Java
| false
| false
| 497
|
java
|
/*
* All Rights Reserved. Copyright(C) 2008 OfferMe.com.au, Australia
*
* History
* Version Update Date Updater Details
* 1.0.00 2009-11-27 Cathy Wu Create
*/
package testObject;
public abstract class ClsMaker<T> {
private T data;
public ClsMaker() {
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
|
[
"cathywu1983@7a8edffc-7ee6-fc29-a90d-33c668f46aec"
] |
cathywu1983@7a8edffc-7ee6-fc29-a90d-33c668f46aec
|
c8a10bbfc3bf8cefbefa6a390822de29fee55d5c
|
1153de40cf48076779039f1b29df45067b72397d
|
/nettosphere-samples/games/src/main/java/org/nettosphere/samples/games/NettoSphereGamesServer.java
|
443039e52169f4be5a8f8ff56f27c496b125ff13
|
[
"Apache-2.0"
] |
permissive
|
seamusmac/atmosphere-samples
|
9b90a648cf148a8b3c59d9da7f8efd3535c16c3f
|
5faf36a6b98d90598b9289fe6b2c5313ab977bb5
|
refs/heads/master
| 2021-01-14T10:53:09.766108
| 2016-02-18T20:26:08
| 2016-02-18T20:26:08
| 24,748,345
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,134
|
java
|
/*
* Copyright 2014 Jeanfrancois Arcand
*
* 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.nettosphere.samples.games;
import org.atmosphere.cpr.ApplicationConfig;
import org.atmosphere.nettosphere.Config;
import org.atmosphere.nettosphere.Nettosphere;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* A bootstrap class that start Nettosphere and Snake!.
*/
public class NettoSphereGamesServer {
private static final Logger logger = LoggerFactory.getLogger(Nettosphere.class);
public static void main(String[] args) throws IOException {
Config.Builder b = new Config.Builder();
b.resource(SnakeManagedService.class)
// For *-distrubution
.resource("./webapps")
// For mvn exec:java
.resource("./src/main/resources")
// For running inside an IDE
.resource("./nettosphere-samples/games/src/main/resources")
.initParam(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true")
.port(8080).host("127.0.0.1").build();
Nettosphere s = new Nettosphere.Builder().config(b.build()).build();
s.start();
String a = "";
logger.info("NettoSphere Games Server started on port {}", 8080);
logger.info("Type quit to stop the server");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while (!(a.equals("quit"))) {
a = br.readLine();
}
System.exit(-1);
}
}
|
[
"jfarcand@apache.org"
] |
jfarcand@apache.org
|
9a7b2390867a556f4fdbb9ef3188f97d3173a86a
|
558807267252c629fb720e61c6420a952d408701
|
/personWebService/src/main/java/org/personWebService/server/ws/rest/PwsRestLogicTrafficLog.java
|
e578782134256bc7446c30dc6bcc29245fc87069
|
[] |
no_license
|
mchyzer/personWebService
|
8c4857b6e44b6da8b81cf0910c8d29972ed9abd2
|
dc560577f87932d0a39db9e2c8574fe1d64fd7de
|
refs/heads/master
| 2020-12-24T16:24:08.849430
| 2019-05-09T13:42:01
| 2019-05-09T13:42:01
| 20,572,298
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 914
|
java
|
/**
* @author mchyzer
* $Id: TfRestLogicTrafficLog.java,v 1.1 2013/06/20 06:02:50 mchyzer Exp $
*/
package org.personWebService.server.ws.rest;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.personWebService.server.util.PersonWsServerUtils;
/**
* logger to log the traffic of
*/
public class PwsRestLogicTrafficLog {
/** logger */
private static final Log LOG = PersonWsServerUtils.getLog(PwsRestLogicTrafficLog.class);
/**
* log something to the log file
* @param message
*/
public static void wsRestTrafficLog(String message) {
LOG.debug(message);
}
/**
* log something to the log file
* @param messageMap
*/
public static void wsRestTrafficLog(Map<String, Object> messageMap) {
if (LOG.isDebugEnabled()) {
LOG.debug(PersonWsServerUtils.mapToString(messageMap));
}
}
}
|
[
"mchyzer@yahoo.com"
] |
mchyzer@yahoo.com
|
d400cd61df61f7d42447d626fd1d137cab609bc5
|
dda348e7d91802e03d9ce49b32f175d989f2e8a9
|
/if-ifelse/HexToBinary/HexToBinaryRunner.java
|
387c8fe57e479251b54f576083f140bd1a3dd8d5
|
[] |
no_license
|
doubleterr/Computer-Science-Labs
|
1eab67b8f8a25401ef446bbf625592b85ce028fe
|
f02913151aa566233824a91317e916b7c9ea0970
|
refs/heads/master
| 2021-01-13T08:48:27.028168
| 2016-11-22T19:47:56
| 2016-11-22T19:47:56
| 71,928,389
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 648
|
java
|
package HexToBinary;
public class HexToBinaryRunner{
public static void main(String[] args){
HexToBinary test = new HexToBinary();
test.getVals();
System.out.println(test);
test.getVals();
System.out.println(test);
test.getVals();
System.out.println(test);
test.getVals();
System.out.println(test);
test.getVals();
System.out.println(test);
test.getVals();
System.out.println(test);
test.getVals();
System.out.println(test);
}
}
|
[
"noreply@github.com"
] |
doubleterr.noreply@github.com
|
eeb450c0048b756ede386f99afa4aa7e76bb2894
|
e8ee8a6095e94803be76419fa5ffa6147300c76a
|
/caffeine/src/test/java/com/github/benmanes/caffeine/cache/testing/CacheValidationListener.java
|
8d8eb3cf21ac88386acbf697d9d47a0cc1c3f309
|
[
"Apache-2.0"
] |
permissive
|
misselvexu/caffeine
|
3a35883fc1de8578560d2109bf1120af44b3f10c
|
24da0f842fffe9d6854832a1490264fcf531ca0f
|
refs/heads/master
| 2022-11-25T14:17:05.683492
| 2022-11-09T07:03:43
| 2022-11-09T07:03:43
| 198,823,831
| 0
| 0
|
Apache-2.0
| 2019-07-25T12:05:26
| 2019-07-25T12:05:25
| null |
UTF-8
|
Java
| false
| false
| 12,567
|
java
|
/*
* Copyright 2014 Ben Manes. 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.github.benmanes.caffeine.cache.testing;
import static com.github.benmanes.caffeine.cache.testing.AsyncCacheSubject.assertThat;
import static com.github.benmanes.caffeine.cache.testing.CacheContextSubject.assertThat;
import static com.github.benmanes.caffeine.cache.testing.CacheSubject.assertThat;
import static com.github.benmanes.caffeine.testing.Awaits.await;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static org.testng.ITestResult.FAILURE;
import static uk.org.lidalia.slf4jext.ConventionalLevelHierarchy.TRACE_LEVELS;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.lang3.StringUtils;
import org.joor.Reflect;
import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.IInvokedMethod;
import org.testng.IInvokedMethodListener;
import org.testng.ISuite;
import org.testng.ISuiteListener;
import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.SuiteRunner;
import org.testng.TestListenerAdapter;
import org.testng.TestRunner;
import org.testng.internal.TestResult;
import com.github.benmanes.caffeine.cache.AsyncCache;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.Policy.Eviction;
import com.github.benmanes.caffeine.cache.Policy.FixedExpiration;
import com.github.benmanes.caffeine.cache.Policy.VarExpiration;
import com.github.benmanes.caffeine.cache.Reset;
import com.github.benmanes.caffeine.cache.testing.CacheSpec.CacheExecutor;
import com.github.benmanes.caffeine.cache.testing.CacheSpec.CacheExpiry;
import com.github.benmanes.caffeine.cache.testing.CacheSpec.CacheScheduler;
import com.github.benmanes.caffeine.cache.testing.CacheSpec.ExecutorFailure;
import com.github.valfirst.slf4jtest.TestLoggerFactory;
/**
* A listener that validates the internal structure after a successful test execution.
*
* @author ben.manes@gmail.com (Ben Manes)
*/
public final class CacheValidationListener implements ISuiteListener, IInvokedMethodListener {
private static final Cache<Object, String> simpleNames = Caffeine.newBuilder().build();
private static final ITestContext testngContext = Mockito.mock(ITestContext.class);
private static final AtomicBoolean detailedParams = new AtomicBoolean(false);
private static final Object[] EMPTY_PARAMS = {};
private final List<Collection<?>> resultQueues = new CopyOnWriteArrayList<>();
private final AtomicBoolean beforeCleanup = new AtomicBoolean();
@Override
public void onStart(ISuite suite) {
if (suite instanceof SuiteRunner) {
var invokedMethods = Reflect.on(suite).fields().get("invokedMethods");
if ((invokedMethods != null) && (invokedMethods.get() instanceof Collection)) {
resultQueues.add(invokedMethods.get());
}
}
}
@Override
public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
TestLoggerFactory.getAllTestLoggers().values().stream()
.forEach(logger -> logger.setEnabledLevels(TRACE_LEVELS));
TestLoggerFactory.clear();
if (beforeCleanup.get() || !beforeCleanup.compareAndSet(false, true)) {
return;
}
// Remove unused listener that retains all test results
// https://github.com/cbeust/testng/issues/2096#issuecomment-706643074
if (testResult.getTestContext() instanceof TestRunner) {
var runner = (TestRunner) testResult.getTestContext();
runner.getTestListeners().stream()
.filter(listener -> listener.getClass() == TestListenerAdapter.class)
.flatMap(listener -> Reflect.on(listener).fields().values().stream())
.filter(field -> field.get() instanceof Collection)
.forEach(field -> resultQueues.add(field.get()));
resultQueues.add(runner.getFailedButWithinSuccessPercentageTests().getAllResults());
resultQueues.add(runner.getSkippedTests().getAllResults());
resultQueues.add(runner.getPassedTests().getAllResults());
resultQueues.add(runner.getFailedTests().getAllResults());
var invokedMethods = Reflect.on(runner).fields().get("m_invokedMethods");
if ((invokedMethods != null) && (invokedMethods.get() instanceof Collection)) {
resultQueues.add(invokedMethods.get());
}
}
}
@Override
public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
try {
if (testResult.isSuccess()) {
validate(testResult);
} else if (!detailedParams.get()) {
detailedParams.set(true);
}
} catch (Throwable caught) {
testResult.setStatus(FAILURE);
testResult.setThrowable(new AssertionError(getTestName(method), caught));
} finally {
cleanUp(testResult);
}
}
/** Validates the internal state of the cache. */
private void validate(ITestResult testResult) {
CacheContext context = Arrays.stream(testResult.getParameters())
.filter(param -> param instanceof CacheContext)
.map(param -> (CacheContext) param)
.findFirst().orElse(null);
if (context != null) {
awaitExecutor(context);
checkCache(context);
checkNoStats(testResult, context);
checkExecutor(testResult, context);
checkNoEvictions(testResult, context);
}
checkLogger(testResult);
}
/** Waits until the executor has completed all of the submitted work. */
private void awaitExecutor(CacheContext context) {
if (context.executor() != null) {
context.executor().resume();
if ((context.cacheExecutor != CacheExecutor.DIRECT)
&& (context.cacheExecutor != CacheExecutor.DISCARDING)
&& (context.executor().submitted() != context.executor().completed())) {
await().pollInSameThread().until(() ->
context.executor().submitted() == context.executor().completed());
}
}
}
/** Returns the name of the executed test. */
private static String getTestName(IInvokedMethod method) {
return StringUtils.substringAfterLast(method.getTestMethod().getTestClass().getName(), ".")
+ "#" + method.getTestMethod().getConstructorOrMethod().getName();
}
/** Checks whether the {@link TrackingExecutor} had unexpected failures. */
private static void checkExecutor(ITestResult testResult, CacheContext context) {
var testMethod = testResult.getMethod().getConstructorOrMethod().getMethod();
var cacheSpec = testMethod.getAnnotation(CacheSpec.class);
if ((cacheSpec == null) || (context.executor() == null)) {
return;
}
if (cacheSpec.executorFailure() == ExecutorFailure.EXPECTED) {
assertThat(context.executor().failed()).isGreaterThan(0);
} else if (cacheSpec.executorFailure() == ExecutorFailure.DISALLOWED) {
assertThat(context.executor().failed()).isEqualTo(0);
}
}
/** Checks that the cache is in an valid state. */
private void checkCache(CacheContext context) {
if (context.cache != null) {
assertThat(context.cache).isValid();
} else if (context.asyncCache != null) {
assertThat(context.asyncCache).isValid();
} else {
Assert.fail("Test requires that the CacheContext holds the cache under test");
}
}
/** Checks the statistics if {@link CheckNoStats} is found. */
private static void checkNoStats(ITestResult testResult, CacheContext context) {
var testMethod = testResult.getMethod().getConstructorOrMethod().getMethod();
boolean checkNoStats = testMethod.isAnnotationPresent(CheckNoStats.class)
|| testResult.getTestClass().getRealClass().isAnnotationPresent(CheckNoStats.class);
if (!checkNoStats) {
return;
}
assertThat(context).stats().hits(0).misses(0).success(0).failures(0);
}
/** Checks the statistics if {@link CheckNoEvictions} is found. */
private static void checkNoEvictions(ITestResult testResult, CacheContext context) {
var testMethod = testResult.getMethod().getConstructorOrMethod().getMethod();
boolean checkNoEvictions = testMethod.isAnnotationPresent(CheckNoEvictions.class)
|| testResult.getTestClass().getRealClass().isAnnotationPresent(CheckNoEvictions.class);
if (!checkNoEvictions) {
return;
}
assertThat(context).removalNotifications().hasNoEvictions();
assertThat(context).evictionNotifications().isEmpty();
}
/** Checks that no logs above the specified level were emitted. */
private static void checkLogger(ITestResult testResult) {
var testMethod = testResult.getMethod().getConstructorOrMethod().getMethod();
var checkMaxLogLevel = Optional.ofNullable(testMethod.getAnnotation(CheckMaxLogLevel.class))
.orElse(testResult.getTestClass().getRealClass().getAnnotation(CheckMaxLogLevel.class));
if (checkMaxLogLevel != null) {
var events = TestLoggerFactory.getLoggingEvents().stream()
.filter(event -> event.getLevel().ordinal() > checkMaxLogLevel.value().ordinal())
.collect(toImmutableList());
assertWithMessage("maxLevel=%s", checkMaxLogLevel.value()).that(events).isEmpty();
}
}
/** Free memory by clearing unused resources after test execution. */
private void cleanUp(ITestResult testResult) {
resultQueues.forEach(Collection::clear);
TestLoggerFactory.clear();
resetMocks(testResult);
resetCache(testResult);
boolean briefParams = !detailedParams.get();
if (testResult.isSuccess() && briefParams) {
clearTestResults(testResult);
}
stringifyParams(testResult, briefParams);
dedupTestName(testResult, briefParams);
CacheContext.interner().clear();
}
private void dedupTestName(ITestResult testResult, boolean briefParams) {
if ((testResult.getName() != null) && briefParams) {
testResult.setTestName(simpleNames.get(testResult.getName(), Object::toString));
}
}
@SuppressWarnings("unchecked")
private void resetMocks(ITestResult testResult) {
for (Object param : testResult.getParameters()) {
if (param instanceof CacheContext) {
var context = (CacheContext) param;
if (context.expiryType() == CacheExpiry.MOCKITO) {
Mockito.clearInvocations(context.expiry());
}
if (context.cacheScheduler == CacheScheduler.MOCKITO) {
Mockito.clearInvocations(context.scheduler());
}
}
}
}
private void resetCache(ITestResult testResult) {
for (Object param : testResult.getParameters()) {
if (param instanceof CacheContext) {
var context = (CacheContext) param;
if (context.isCaffeine()) {
Reset.destroy(context.cache());
}
}
}
}
private void clearTestResults(ITestResult testResult) {
var result = (TestResult) testResult;
result.setParameters(EMPTY_PARAMS);
result.setContext(testngContext);
}
private void stringifyParams(ITestResult testResult, boolean briefParams) {
Object[] params = testResult.getParameters();
for (int i = 0; i < params.length; i++) {
Object param = params[i];
if ((param instanceof AsyncCache<?, ?>) || (param instanceof Cache<?, ?>)
|| (param instanceof Map<?, ?>) || (param instanceof Eviction<?, ?>)
|| (param instanceof FixedExpiration<?, ?>) || (param instanceof VarExpiration<?, ?>)
|| ((param instanceof CacheContext) && briefParams)) {
params[i] = simpleNames.get(param.getClass(), key -> ((Class<?>) key).getSimpleName());
} else if (param instanceof CacheContext) {
params[i] = simpleNames.get(param.toString(), Object::toString);
} else {
params[i] = Objects.toString(param);
}
}
}
}
|
[
"ben.manes@gmail.com"
] |
ben.manes@gmail.com
|
c4cb4c3253df8464b77eadb5e2105903bc7c8ff4
|
c49a7251aaaf759e5a60e2114f283fbe59ac17cf
|
/threads/src/Habitant.java
|
2d1a6187ebb295ac47f2b964dc7d45dc73cb7d19
|
[] |
no_license
|
laurentkeil/work
|
4d64d63751f0308f3c28abb69a31240015c5b36d
|
763092b8dd385f7debb14900dda0fcf518c0abbe
|
refs/heads/master
| 2021-05-01T05:17:17.471722
| 2017-01-22T17:57:17
| 2017-01-22T17:57:17
| 79,734,666
| 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 668
|
java
|
public class Habitant implements Runnable {
// construction de notre unique chaudiere
final Chaudiere chaudiere = new Chaudiere() ;
public void run() {
// chaque habitant possède son propre thermostat
Thermostat thermostat = new Thermostat(chaudiere) ;
int nTry = 0 ;
do {
// il demande a monter la temperature
thermostat.plusChaud() ;
nTry++ ;
// on lui donne le droit de le faire 5 fois
} while (nTry < 5) ;
}
public int getTemperature() {
return this.chaudiere.getTemperature() ;
}
}
|
[
"laurent_0306@hotmail.com"
] |
laurent_0306@hotmail.com
|
d9e05a7cd157fbd201bd7bc86a222e30c92dc514
|
a2cdbc692c05a073ba83c1b6368965fab0d90ccb
|
/src/main/java/com/mongodb/hvdf/allocators/SliceDetails.java
|
e099044007d678dd7cfe283d5d5a481024b07945
|
[
"Apache-2.0"
] |
permissive
|
mridul-sahu/hvdf
|
4f378813789db604b9f12716d81294e6aeea7b70
|
b2480b5602e3bf4fae7de7867bf4e5e58f92f329
|
refs/heads/master
| 2020-04-18T06:34:12.657975
| 2014-11-25T19:12:44
| 2014-11-25T19:12:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 632
|
java
|
package com.mongodb.hvdf.allocators;
import java.util.Comparator;
public class SliceDetails {
public String name;
public long minTime;
public long maxTime;
public SliceDetails(String name, long minTime, long maxTime) {
this.name = name;
this.maxTime = maxTime;
this.minTime = minTime;
}
public static class Comparators {
public static Comparator<SliceDetails> MIN_TIME_DESCENDING = new Comparator<SliceDetails>() {
@Override
public int compare(SliceDetails o1, SliceDetails o2) {
return Long.compare(o2.minTime, o1.minTime);
}
};
}
}
|
[
"darren.wood@10gen.com"
] |
darren.wood@10gen.com
|
53b8371b961a29bf4876bc895abe65a9721a1657
|
2760ddb02280f03048c89efc1df20a8c85946be3
|
/src/estruturadecisao/NotaAluno.java
|
08c414a17081ce77900cdb8bd81d338debec0c0d
|
[] |
no_license
|
andreldsr/fixacao01
|
a53bdb3c99f863b89d652fdfac0e1c1d41bccef0
|
d55ba37af179e33eae1ba04ceb5aa171b9f0cb49
|
refs/heads/master
| 2023-06-05T03:56:31.841198
| 2021-06-29T23:53:49
| 2021-06-29T23:53:49
| 381,525,464
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 616
|
java
|
package estruturadecisao;
import java.util.Scanner;
public class NotaAluno {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Digite a primeira nota: ");
Double nota1 = in.nextDouble();
System.out.println("Digite a segunda nota: ");
Double nota2 = in.nextDouble();
double media = (nota1 + nota2)/2;
if(media >= 7){
System.out.println("O aluno foi aprovado. Nota final: " + media);
}else {
System.out.println("O aluno foi reprovado. Nota final: " + media);
}
}
}
|
[
"andre.silva@saude.ce.gov.br"
] |
andre.silva@saude.ce.gov.br
|
b2b84678f4d4a85dbbafd3428ea5c676565fd000
|
648d6ed9897b49755cb6791f6a843f7835998f5f
|
/src/leetcode/pro123/Solution2.java
|
953917a4233f234b5078053299723788a308a3c3
|
[] |
no_license
|
12Dong/leetCode
|
06c4016b074c746b7ed88b67c45f3e169d58f27e
|
71dbcab669a5c81adc52a0c2fd47b6f823bfd518
|
refs/heads/master
| 2023-07-18T01:12:07.677778
| 2023-06-26T15:57:34
| 2023-06-26T15:57:34
| 127,150,489
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 53
|
java
|
package leetcode.pro123;
public class Solution2 {
}
|
[
"289663639@qq.com"
] |
289663639@qq.com
|
0fd3119a14fa7c05deca906c4abd82725792d2d2
|
4a2785fa22dbf1b8d7507bee2af22015c98ac73b
|
/Source code/keshe12/app/src/main/java/com/example/hp/materialtest/db/user_comment_deliver.java
|
ff475c67aeadae75f6b40976aca94813ead98b54
|
[] |
no_license
|
HWenTing/Take-out
|
9607b93e5f1324e4cec99200441503d00a694c67
|
3b2c84a029d6446c31c0df723965b966e8515e81
|
refs/heads/master
| 2020-05-09T17:22:47.837614
| 2019-04-14T12:47:42
| 2019-04-14T12:47:42
| 181,305,007
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 648
|
java
|
package com.example.hp.materialtest.db;
import org.litepal.crud.DataSupport;
/**
* Created by HP on 2018/9/3.
*/
public class user_comment_deliver extends DataSupport {
private int id;
private double score;
private String comment;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public double getScore() {
return score;
}
public void setScore(double score) {
this.score = score;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
}
|
[
"982740445@qq.com"
] |
982740445@qq.com
|
3aaefd5174a45ae6aab3ad2cf548bd8ef93f1675
|
dec6bbc5db0759c4b04f50fe891977ba7f72b62c
|
/Programs/src/main/java/com/scriptbees/sample/SimpleCompoundInterest.java
|
198f2e404796f9b2ed61c28509848274dd1c6a4f
|
[] |
no_license
|
vamsi340/TestGet
|
a3964c205d3f14d4f689f860226d13260cb91379
|
09cdf36e3cffc2120aa4cad4a214e73ff50e8ebd
|
refs/heads/master
| 2021-07-07T04:49:45.965117
| 2019-07-08T04:48:19
| 2019-07-08T04:48:19
| 192,918,278
| 0
| 0
| null | 2020-10-13T14:25:40
| 2019-06-20T12:44:06
|
Java
|
UTF-8
|
Java
| false
| false
| 628
|
java
|
package com.scriptbees.sample;
import java.util.Scanner;
public class SimpleCompoundInterest {
public static void main(String argu[]) {
double pr, rate, t, sim, com;
Scanner s = new Scanner(System.in);
System.out.println("Enter the amount:");
pr = s.nextDouble();
System.out.println("Enter the No.of years:");
t = s.nextDouble();
System.out.println("Enter the Rate of interest");
rate = s.nextDouble();
sim = (pr * t * rate) / 100;
com = pr * Math.pow(1.0 + rate / 100.0, t) - pr;
System.out.println("Simple Interest=" + sim);
System.out.println("Compound Interest=" + com);
}
}
|
[
"vamsi.r@scriptbees.com"
] |
vamsi.r@scriptbees.com
|
4e8742cd92bf05fd979c6de46c47a4426faec6b7
|
e700ea2696fa70c88699ae12ffc4e68423d8af8d
|
/Farmaceutica/src/java/Models/Categoria.java
|
88c27bbc8f6c919ca617c7ab41bbe1996cbb180c
|
[] |
no_license
|
MaximilianoFarias1987/ProyectoJavaWeb
|
a79288c7c5f6d88462b8161e48a425d3fcc1b53f
|
b35eaa69e321868ef5a3deba719c9f5662ef709b
|
refs/heads/main
| 2023-08-28T07:10:14.160999
| 2021-11-12T15:15:32
| 2021-11-12T15:15:32
| 426,604,775
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 820
|
java
|
package Models;
public class Categoria {
private int idCategoria;
private String descripcion;
public Categoria() {
}
public Categoria(int idCategoria, String descripcion) {
this.idCategoria = idCategoria;
this.descripcion = descripcion;
}
public int getIdCategoria() {
return idCategoria;
}
public void setIdCategoria(int idCategoria) {
this.idCategoria = idCategoria;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
@Override
public String toString() {
return "Categoria{" + "idCategoria=" + idCategoria + ", descripcion=" + descripcion + '}';
}
}
|
[
"maximilianocba07@gmail.com"
] |
maximilianocba07@gmail.com
|
fbf5ec219ad5b88f5d0fb8a5e97b93ac34fb63cb
|
57c9af82c8ef038adbf13eb4986eca44ba9de4c1
|
/app/src/main/java/com/example/microsoftengageapp2021/adapters/PendingUsersAdapter.java
|
6079743bf3ab882249b5456a4db7ccd7d2b3e4f7
|
[] |
no_license
|
ayushr1912/Microsoft
|
35f054a8717ab1a8c41ca64ee7a1c5a695b40142
|
e4d6f515ace0d2b9782fe5184fd55864f118218d
|
refs/heads/master
| 2023-06-15T04:03:34.936117
| 2021-07-13T08:39:37
| 2021-07-13T08:39:37
| 385,535,442
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,765
|
java
|
package com.example.microsoftengageapp2021.adapters;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.example.microsoftengageapp2021.R;
import com.example.microsoftengageapp2021.models.User;
import com.example.microsoftengageapp2021.receivers.PendingUsersReceiver;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
public class PendingUsersAdapter extends RecyclerView.Adapter<PendingUsersAdapter.UserViewHolder>{
private final List<User> users;
private final PendingUsersReceiver pendingUsersReceiver;
private final List<User> selectedPendingUsers;
public PendingUsersAdapter(List<User> users, PendingUsersReceiver pendingUsersReceiver) {
this.users = users;
this.pendingUsersReceiver = pendingUsersReceiver;
selectedPendingUsers = new ArrayList<>();
}
public List<User> getSelectedPendingUsers(){
return selectedPendingUsers;
}
@NotNull
@Override
public UserViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
return new UserViewHolder(
LayoutInflater.from(parent.getContext()).inflate(
R.layout.display_pending_user,
parent,
false
)
);
}
@Override
public void onBindViewHolder(@NonNull @NotNull PendingUsersAdapter.UserViewHolder holder, int position) {
holder.setUserData(users.get(position));
}
@Override
public int getItemCount() {
return users.size();
}
class UserViewHolder extends RecyclerView.ViewHolder{
TextView displayPendingUser;
ImageView sendInvite, selectedPendingUserImg, verifiedUser, unknownUser, sendRoomCode;
ConstraintLayout pendingUserContainer;
UserViewHolder(@NotNull View itemView) {
super(itemView);
displayPendingUser = itemView.findViewById(R.id.displayFullName);
sendInvite = itemView.findViewById(R.id.IC_addUser);
sendRoomCode = itemView.findViewById(R.id.IC_chat);
verifiedUser = itemView.findViewById(R.id.pendingVerifiedImg);
unknownUser = itemView.findViewById(R.id.pendingUnknownImg);
pendingUserContainer = itemView.findViewById(R.id.pendingUserContainer);
selectedPendingUserImg = itemView.findViewById(R.id.selectedPendingUserImg);
}
void setUserData(User user)
{
displayPendingUser.setText(String.format("%s",user.fullName));
if(user.email==null){
unknownUser.setVisibility(View.VISIBLE);
verifiedUser.setVisibility(View.INVISIBLE);
sendRoomCode.setVisibility(View.INVISIBLE);
} else{
unknownUser.setVisibility(View.INVISIBLE);
verifiedUser.setVisibility(View.VISIBLE);
}
sendInvite.setOnClickListener(v -> pendingUsersReceiver.sendInvitation(user));
sendRoomCode.setOnClickListener(v -> pendingUsersReceiver.sendRoomCode(user));
pendingUserContainer.setOnLongClickListener(v -> {
if(selectedPendingUserImg.getVisibility()!= View.VISIBLE){
selectedPendingUsers.add(user);
selectedPendingUserImg.setVisibility(View.VISIBLE);
sendInvite.setVisibility(View.GONE);
sendRoomCode.setVisibility(View.GONE);
if(verifiedUser.getVisibility()==View.VISIBLE){
verifiedUser.setVisibility(View.GONE);
}
if(unknownUser.getVisibility()==View.VISIBLE){
unknownUser.setVisibility(View.GONE);
}
pendingUsersReceiver.onMultiplePendingUsersAction(true);
}
return true;
});
pendingUserContainer.setOnClickListener(v -> {
if(selectedPendingUserImg.getVisibility()==View.VISIBLE) {
selectedPendingUsers.remove(user);
selectedPendingUserImg.setVisibility(View.GONE);
if(verifiedUser.getVisibility()==View.GONE){
verifiedUser.setVisibility(View.VISIBLE);
}
if(unknownUser.getVisibility()==View.GONE){
unknownUser.setVisibility(View.VISIBLE);
}
sendInvite.setVisibility(View.VISIBLE);
sendRoomCode.setVisibility(View.VISIBLE);
if (selectedPendingUsers.size() == 0) {
pendingUsersReceiver.onMultiplePendingUsersAction(false);
}
}else{
if(selectedPendingUsers.size()>0){
selectedPendingUsers.add(user);
selectedPendingUserImg.setVisibility(View.VISIBLE);
sendInvite.setVisibility(View.GONE);
sendRoomCode.setVisibility(View.GONE);
if(verifiedUser.getVisibility()==View.VISIBLE){
verifiedUser.setVisibility(View.GONE);
}
if(unknownUser.getVisibility()==View.VISIBLE){
unknownUser.setVisibility(View.GONE);
}
}
}
});
}
}
}
|
[
"ayushr1900@gmail.com"
] |
ayushr1900@gmail.com
|
229e6eeefe05adcae649695bcc57afdc6de661eb
|
9cb4c5e68a9873d74bd9d972be0f0310b8b7ec84
|
/coleccionesI/src/teoria/listas/Lista1.java
|
53f29973ae41f023d721cc5670f6b1f7f388cd1c
|
[] |
no_license
|
programacionDAMVC/curso_2020_2021
|
386929260d64f6f9e00f40aec0ecef9d72e9fae6
|
2fada19efeda3c75bf753c05952edd9273a3cf85
|
refs/heads/main
| 2023-05-10T02:15:21.991906
| 2021-06-15T14:42:17
| 2021-06-15T14:42:17
| 355,239,758
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,126
|
java
|
package teoria.listas;
import java.util.*;
public class Lista1 {
public static void main(String[] args) {
//no parametrizamos
ArrayList lista1 = new ArrayList(); //de objetos iguales, los guardo como Object
lista1.add("hola"); //objeto String
lista1.add('c'); //lo guarda como Character
lista1.add(2); //lo guarda como Integer
//vamos a ver los datos
System.out.println(lista1);
String dato1 = (String) lista1.get(0);
char dato2 = (char) lista1.get(1);
int dato3 = (int) lista1.get(2);
System.out.printf("Cadena %s, char %c y entero %d%n", dato1, dato2, dato3);
//mejora, parametrizando la listas, todos son de la misma clase, permite clases hijas de Object
List<String> listaCadenas = new ArrayList<>();
listaCadenas.add("hola");
listaCadenas.add("buenas");
// listaCadenas.add(1); no permitido, solo String
//listaCadenas.add('c'); no permitido, solo String
System.out.println(listaCadenas);
listaCadenas.add(0, "bye");
System.out.println(listaCadenas);
listaCadenas.set(0, "hello");
System.out.println(listaCadenas);
int posicion = 12;
if (posicion < listaCadenas.size())
System.out.println(listaCadenas.get(posicion));
listaCadenas.remove("hello");
listaCadenas.remove(0);
System.out.println(listaCadenas); //solo queda la cadena buenas
System.out.printf("¿Contiene buenas la lista? %b%n", listaCadenas.contains("buenas"));
System.out.printf("¿Contiene hello la lista? %b%n", listaCadenas.contains("hello"));
System.out.printf("Posición de buenas en la lista %d%n", listaCadenas.indexOf("buenas"));
listaCadenas.add("buenas");
System.out.printf("Posición de buenas en la lista %d%n", listaCadenas.indexOf("buenas"));
//ejemplo de lista de float
List<Float> listaFloat = new ArrayList<>(); //crea una lista dinámica, se crea inicialmente con cero elemento
float[] arrayFloat = new float[12]; //crea una lista estática, no puede cambier el tamaño, y se crea con 12 floats que son todos 0.0
listaFloat.add(2.2f);
arrayFloat[11] = 2.2f;
listaFloat.add(2f);
listaFloat.add(0, 2.3f);
System.out.println(listaFloat);
//inicializando lista con contenido
List<String> listaInmutableString = List.of("uno", "dos");
System.out.println(listaInmutableString);
// listaInmutableString.add("tres"); es inmutable no se puede añadir mas elementos
// listaInmutableString.remove(0); es inmutable no se puede quitar elementos
//parecido
String[] arrayCadenas = {"uno", "dos"};
// listaInmutableString.set(0, "one");
System.out.println(listaInmutableString);
//otra forma de crear listas con valores inciales
List<String> stringList = Arrays.asList("one", "two");
System.out.println(stringList);
//stringList.add("three");
//stringList.remove(0);
//INMUTABLES
}
}
|
[
"programacionpsdam@gmail.com"
] |
programacionpsdam@gmail.com
|
dba8ea5ed315f0a938e2d3f666978509c112944b
|
88dc4ee40e395ef0ce7f681590d2063bc3ea2aaa
|
/app/src/main/java/com/muliamaulana/denius/model/Sources.java
|
b428bb4f87593f42b334051c9763ac429aeb84b7
|
[] |
no_license
|
muliamaulana/Denius
|
c2588c7d5e9b90d4cd1c4cc80fca7258c44f7eb7
|
5c45c095018628d6ddb310b80f4b4ff18df27ce6
|
refs/heads/master
| 2020-03-27T13:12:09.580762
| 2018-08-30T16:30:01
| 2018-08-30T16:30:01
| 146,286,960
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 589
|
java
|
package com.muliamaulana.denius.model;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* Created by muliamaulana on 8/19/2018.
*/
public class Sources {
@SerializedName("status")
public String status;
@SerializedName("sources")
public List<AllSources> sources = null;
public Sources(String status, List<AllSources> sources) {
this.status = status;
this.sources = sources;
}
public String getStatus() {
return status;
}
public List<AllSources> getSources() {
return sources;
}
}
|
[
"m.muliamaulana@gmail.com"
] |
m.muliamaulana@gmail.com
|
434f255b9ef3b65ce78f52b1a3726044155a1b41
|
32d71a1f8b198805ae9c3e6a8ad5ec2490eff804
|
/src/main/java/org/core/implementation/bukkit/entity/BSnapshotValueEntity.java
|
9865b2714aac5e8179fe32112da267c281e5aa57
|
[] |
no_license
|
Minecraft-Ships/CoreToBukkit
|
9baeeb947ce52e044c1c4e852e194af365e1c901
|
5babd2ae7137101492aab73d34989de98f12f9c3
|
refs/heads/master
| 2023-07-07T02:23:10.031569
| 2023-06-21T20:09:05
| 2023-06-21T20:09:05
| 143,561,258
| 0
| 1
| null | 2023-02-05T19:39:48
| 2018-08-04T20:34:02
|
Java
|
UTF-8
|
Java
| false
| false
| 7,297
|
java
|
package org.core.implementation.bukkit.entity;
import org.bukkit.Location;
import org.bukkit.util.Vector;
import org.core.TranslateCore;
import org.core.adventureText.AText;
import org.core.entity.Entity;
import org.core.entity.EntitySnapshot;
import org.core.entity.EntityType;
import org.core.entity.LiveEntity;
import org.core.implementation.bukkit.platform.BukkitPlatform;
import org.core.implementation.bukkit.world.BWorldExtent;
import org.core.implementation.bukkit.world.position.impl.sync.BExactPosition;
import org.core.utils.entry.AbstractSnapshotValue;
import org.core.vector.type.Vector3;
import org.core.world.position.impl.Position;
import org.core.world.position.impl.sync.SyncExactPosition;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
public class BSnapshotValueEntity<BE extends org.bukkit.entity.Entity, E extends BLiveEntity<BE>>
implements EntitySnapshot<E> {
private final EntityType<E, ? extends EntitySnapshot<E>> type;
private final E createdFrom;
private Set<EntitySnapshotValue<? super BE, ?>> snapshotValues = new HashSet<>();
public BSnapshotValueEntity(E entity) {
BE bukkitEntity = entity.getBukkitEntity();
this.snapshotValues = EntitySnapshotValue.getSnapshotValues(bukkitEntity);
this.type = entity.getType();
this.createdFrom = entity;
this.snapshotValues.forEach(sv -> sv.storeValue(bukkitEntity));
}
public BSnapshotValueEntity(BSnapshotValueEntity<BE, E> entity) {
this.snapshotValues.addAll(entity.snapshotValues);
this.type = entity.getType();
this.createdFrom = entity.createdFrom;
}
private <V> Optional<EntitySnapshotValue<?, V>> getSnapshotValue(String id) {
return this.snapshotValues
.parallelStream()
.filter(v -> v.getId().equals(id))
.findAny()
.map(v -> (EntitySnapshotValue<?, V>) v);
}
@Override
public SyncExactPosition getPosition() {
return new BExactPosition(this.<Location>getSnapshotValue("LOCATION").get().getValue());
}
@Override
public EntityType<E, ? extends EntitySnapshot<E>> getType() {
return this.type;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setPitch(double value) {
Location loc = this.<Location>getSnapshotValue("LOCATION").get().getValue();
loc.setPitch((float) value);
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setYaw(double value) {
Location loc = this.<Location>getSnapshotValue("LOCATION").get().getValue();
loc.setYaw((float) value);
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setRoll(double value) {
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setPosition(Position<? extends Number> position) {
EntitySnapshotValue<?, Location> locValue = this.<Location>getSnapshotValue("LOCATION").get();
Location oldLoc = locValue.getValue();
Location loc = new Location(((BWorldExtent) position.getWorld()).getBukkitWorld(),
position.getX().doubleValue(), position.getY().doubleValue(),
position.getZ().doubleValue());
loc.setPitch(oldLoc.getPitch());
loc.setYaw(oldLoc.getYaw());
locValue.setValue(loc);
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setGravity(boolean check) {
this.<Boolean>getSnapshotValue("GRAVITY").get().setValue(check);
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setVelocity(Vector3<Double> velocity) {
this
.<Vector>getSnapshotValue("VELOCITY")
.get()
.setValue(new Vector(velocity.getX(), velocity.getY(), velocity.getZ()));
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setCustomName(@Nullable AText text) {
if (text == null) {
this.<String>getSnapshotValue("CUSTOM_NAME").get().setValue(null);
return this;
}
this.<String>getSnapshotValue("CUSTOM_NAME").get().setValue(text.toLegacy());
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setCustomNameVisible(boolean visible) {
this.<Boolean>getSnapshotValue("CUSTOM_NAME_VISIBLE").get().setValue(visible);
return this;
}
@Override
public double getPitch() {
return this.<Location>getSnapshotValue("LOCATION").get().getValue().getPitch();
}
@Override
public double getYaw() {
return this.<Location>getSnapshotValue("LOCATION").get().getValue().getYaw();
}
@Override
public double getRoll() {
return 0;
}
@Override
public boolean hasGravity() {
return this.<Boolean>getSnapshotValue("GRAVITY").get().getValue();
}
@Override
public Vector3<Double> getVelocity() {
Vector vector = this.<Vector>getSnapshotValue("VELOCITY").get().getValue();
return Vector3.valueOf(vector.getX(), vector.getY(), vector.getZ());
}
@Override
public Optional<AText> getCustomName() {
Optional<EntitySnapshotValue<?, String>> opText = this.getSnapshotValue("CUSTOM_NAME");
return opText.map(stringEntitySnapshotValue -> AText.ofLegacy(stringEntitySnapshotValue.getValue()));
}
@Override
public boolean isCustomNameVisible() {
return this.<Boolean>getSnapshotValue("CUSTOM_NAME_VISIBLE").get().getValue();
}
@Override
public Collection<EntitySnapshot<? extends LiveEntity>> getPassengers() {
return new HashSet<>();
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> addPassengers(Collection<? extends EntitySnapshot<? extends LiveEntity>> entities) {
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> removePassengers(Collection<EntitySnapshot<? extends LiveEntity>> entities) {
return this;
}
@Override
public boolean isOnGround() {
return this.<Boolean>getSnapshotValue("IS_ON_GROUND").get().getValue();
}
@Override
public boolean isRemoved() {
return this.<Boolean>getSnapshotValue("IS_REMOVED").map(AbstractSnapshotValue::getValue).orElse(false);
}
@Override
public E spawnEntity() {
Location loc = this.<Location>getSnapshotValue("LOCATION").get().getValue();
BE entity = (BE) loc.getWorld().spawnEntity(loc, ((BEntityType<?, ?>) this.type).getBukkitEntityType());
this.snapshotValues.stream().map(sv -> (EntitySnapshotValue<BE, ?>) sv).forEach(sv -> sv.applyValue(entity));
return (E) ((BukkitPlatform) TranslateCore.getPlatform()).createEntityInstance(entity);
}
@Override
public EntitySnapshot<E> createSnapshot() {
return new BSnapshotValueEntity<>(this);
}
@Override
public Optional<E> getCreatedFrom() {
return Optional.ofNullable(this.createdFrom);
}
}
|
[
"nekronmoseley@gmail.com"
] |
nekronmoseley@gmail.com
|
6582abad8b70cc53cd63a073a34e071fa48b6e8d
|
9591131978b71781509dd90521308a7f6b942fb0
|
/app/src/main/java/com/vartista/www/vartista/fragments/NotificationsFragment.java
|
e18e29230e2364e6290fd4603213054a8b188bb9
|
[] |
no_license
|
zaptox/vartistaa
|
5722fc4ab3a74037249fb89ee386c44e4f00ae5d
|
b7d7b1ee06fa7e3e2660f5b0ed91cbea65bbe30a
|
refs/heads/master
| 2020-03-26T05:59:19.733172
| 2019-07-24T14:55:35
| 2019-07-24T14:55:35
| 144,584,210
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,696
|
java
|
package com.vartista.www.vartista.fragments;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.vartista.www.vartista.R;
import com.vartista.www.vartista.adapters.TwoListInRecyclerView;
import com.vartista.www.vartista.beans.usernotificationitems;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
/**
* Created by Dell on 2019-04-18.
*/
public class NotificationsFragment extends Fragment {
RecyclerView view;
private RecyclerView.LayoutManager layoutManager;
private TwoListInRecyclerView listadapter;
ArrayList<usernotificationitems> requestlist;
ArrayList<usernotificationitems> notificationlist;
TabLayout tabLayout;
int user_id;
public NotificationsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view1 =inflater.inflate(R.layout.activity_asynctask__multiple_url, container, false);
// become_sp=(Button)view.findViewById(R.id.become_sp);
view = (RecyclerView)view1.findViewById(R.id.user_notificationlist);
requestlist=new ArrayList<usernotificationitems>();
notificationlist=new ArrayList<usernotificationitems>();
layoutManager = new LinearLayoutManager(getContext());
view.setHasFixedSize(true);
view.setLayoutManager(layoutManager);
SharedPreferences ob = getActivity().getSharedPreferences("Login", Context.MODE_PRIVATE);
user_id = ob.getInt("user_id", 0);
new NotificationsFragment.Conncetion(getContext(),user_id).execute();
return view1;
}
class Conncetion extends AsyncTask<String,String ,String[]> {
private int user_customer_id;
private ProgressDialog dialog;
public Conncetion(Context activity, int user_customer_id) {
dialog = new ProgressDialog(activity);
this.user_customer_id = user_customer_id;
}
@Override
protected void onPreExecute() {
dialog.setMessage("Retriving data Please Wait..");
dialog.show();
}
@Override
protected String[] doInBackground(String... strings) {
final String BASE_URL = "http://vartista.com/vartista_app/usernotificationstatus.php?user_customer_id="+user_id;
final String BASE_URL2 = "http://vartista.com/vartista_app/fetch_notificationmsg.php?user_id="+user_id;
String[] ob = new String[2];
ob[0] = getjsonfromurl(BASE_URL);
ob[1] = getjsonfromurl(BASE_URL2);
return ob;
}
@Override
protected void onPostExecute(String[] result) {
if (dialog.isShowing()) {
dialog.dismiss();
}
try {
JSONObject jsonResult = new JSONObject(result[0]);
JSONObject jsonResult2 = new JSONObject(result[1]);
int success = jsonResult.getInt("success");
int success2 = jsonResult2.getInt("success");
if (success == 1) {
JSONArray services = jsonResult.getJSONArray("services");
for (int j = 0; j < services.length(); j++) {
JSONObject ser1 = services.getJSONObject(j);
String username = ser1.getString("username");
String image = ser1.getString("image");
String request_detail = ser1.getString("request_status");
String Time = ser1.getString("time");
String reqest_sendat = ser1.getString("reqeustsend_at") ;
String accepted_date = ser1.getString("accepted_date");
String rejected_date = ser1.getString("rejected_date");
String pay_verify_date = ser1.getString("pay_verify_date");
String Cancelled_date = ser1.getString("cancelled_date");
String completed_date = ser1.getString("completed_date");
String Canceled_by_id = ser1.getString("cancelled_by_id");
String Service_title = ser1.getString("service_title");
Double price = ser1.getDouble("price");
requestlist.add(new usernotificationitems(username,image,request_detail,Time,reqest_sendat,accepted_date,rejected_date,pay_verify_date,Cancelled_date,completed_date,Canceled_by_id,Service_title,price));
}
} else {
}
if(success2==1){
JSONArray services2 = jsonResult2.getJSONArray("services");
for ( int i = 0 ; i < services2.length(); i++){
JSONObject serv2 = services2.getJSONObject(i);
String notificationid = serv2.getString("id");
String username = serv2.getString("name");
String title = serv2.getString("title");
String msg = serv2.getString("msg");
String created_at = serv2.getString("created_at");
String sp_status = serv2.getString("sp_status");
notificationlist.add(new usernotificationitems(notificationid,username,title,msg,created_at,sp_status));
}
} else {
}
listadapter = new TwoListInRecyclerView(getContext(),requestlist,notificationlist);
view.setAdapter(listadapter);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
public String getjsonfromurl(String BASE_URL){
String result = "";
try {
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet();
request.setURI(new URI(BASE_URL));
HttpResponse response = client.execute(request);
BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer stringBuffer = new StringBuffer();
String line = "";
while ((line = reader.readLine()) != null) {
stringBuffer.append(line);
break;
}
reader.close();
result = stringBuffer.toString();
} catch (URISyntaxException e) {
e.printStackTrace();
return new String("Exception is " + e.getMessage());
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
}
|
[
"mallahgq2252@gmail.com"
] |
mallahgq2252@gmail.com
|
7464807bf74c71e8cbb084121eafa3268bfbc902
|
6eb3c4a10a24970c424bd3877e553fbfea32fe41
|
/profile-service/src/main/java/com/rentcarsplatform/profileservice/repository/CustomerRepository.java
|
6aade772385a7b3c8b0f080b05bb617f98dcefb1
|
[] |
no_license
|
kpsdilshan/AJ-Rent-A-Car-Service
|
7bb4c9c6c636dae504793193dd5c141294aaa849
|
0e27ba8ce817d57ff103806877c1da14b7bfd968
|
refs/heads/master
| 2022-12-06T17:17:35.615637
| 2020-08-01T11:18:15
| 2020-08-01T11:18:15
| 284,013,524
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 321
|
java
|
package com.rentcarsplatform.profileservice.repository;
import com.rentcarsplatform.profileservice.model.Customer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface CustomerRepository extends JpaRepository<Customer,Integer> {
}
|
[
"kpsdilshan2@gmail.com"
] |
kpsdilshan2@gmail.com
|
e9183eb416658372f87a950b6b8740379501c37c
|
34ffaac3490fe8199a476712ed69c61740298a0e
|
/mplus/mplus-data/src/main/java/de/hydro/gv/mplus/data/ContractApproverId.java
|
04bdc2297a557e1ea40444ef587027268cc48969
|
[] |
no_license
|
yevhen-miro/myrepo
|
e34bb3bab000e2cbc9b145c121e46b0907b5a7e5
|
7fb52a43ebff3f9ede3509ce5331defb57783441
|
refs/heads/master
| 2022-12-06T06:24:31.815644
| 2019-09-09T08:43:42
| 2019-09-09T08:43:42
| 31,064,078
| 0
| 0
| null | 2022-11-24T04:24:44
| 2015-02-20T12:32:28
|
TSQL
|
UTF-8
|
Java
| false
| false
| 1,980
|
java
|
package de.hydro.gv.mplus.data;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
public class ContractApproverId implements Serializable{
private static final long serialVersionUID = 1322156687657879113L;
private Long contractId;
private Integer signLevel;
private String approverId;
public ContractApproverId() {
}
public ContractApproverId(Long conId, Integer signLevel, String approverId ) {
this.contractId = conId;
this.signLevel = signLevel;
this.approverId = approverId;
}
public Long getConId() {
return contractId;
}
public void setConId(Long conId) {
this.contractId = conId;
}
public Integer getSignLevel() {
return signLevel;
}
public void setSignLevel(Integer signLevel) {
this.signLevel = signLevel;
}
public String getApproverId() {
return approverId;
}
public void setApproverId(String approverId) {
this.approverId = approverId;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((approverId == null) ? 0 : approverId.hashCode());
result = prime * result + ((contractId == null) ? 0 : contractId.hashCode());
result = prime * result + ((signLevel == null) ? 0 : signLevel.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ContractApproverId other = (ContractApproverId) obj;
if (approverId == null) {
if (other.approverId != null)
return false;
} else if (!approverId.equals(other.approverId))
return false;
if (contractId == null) {
if (other.contractId != null)
return false;
} else if (!contractId.equals(other.contractId))
return false;
if (signLevel == null) {
if (other.signLevel != null)
return false;
} else if (!signLevel.equals(other.signLevel))
return false;
return true;
}
}
|
[
"yevhen.miroshnychenko@hydro.com"
] |
yevhen.miroshnychenko@hydro.com
|
ffd7c98baee5d3a658e4bee0bfe5e788b938b608
|
dd8a642e5277919744ffb9bb7951e13084c44250
|
/bundles/at.bestsolution.dart.server.api/src-gen/at/bestsolution/dart/server/api/model/NavigationRegion.java
|
f2c2e64cfe90838581882386e687c7e13093df61
|
[] |
no_license
|
tomsontom/dartedit
|
7107ce2631d2c39eb0c4fc35db82576ebe456844
|
4bf2402692ef260db80631d4adbb772c83555604
|
refs/heads/master
| 2016-08-08T03:17:49.099642
| 2015-07-08T10:53:01
| 2015-07-08T10:53:01
| 38,748,516
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 711
|
java
|
package at.bestsolution.dart.server.api.model;
import java.util.Map;
public class NavigationRegion {
private int offset ;
private int length ;
private int[] targets ;
public NavigationRegion() {
}
public int getOffset() {
return this.offset;
}
public void setOffset(int offset) {
this.offset = offset;
}
public int getLength() {
return this.length;
}
public void setLength(int length) {
this.length = length;
}
public int[] getTargets() {
return this.targets;
}
public void setTargets(int[] targets) {
this.targets = targets;
}
public String toString() {
return "NavigationRegion@"+hashCode()+"[offset = "+offset+", length = "+length+", targets = "+targets+"]";
}
}
|
[
"tom.schindl@bestsolution.at"
] |
tom.schindl@bestsolution.at
|
ff057ad8d3ab0573b8142a1ad80eba1d72003c28
|
ba41f386b8a2dee857cec6b43666977e5adbad34
|
/src/main/java/_00_universalUtil/model/StorePic.java
|
34c373d69f5d3dab8c41478ed7eec7f6aa5e982a
|
[] |
no_license
|
eatogo/Web-Service-Recommendation
|
7bcaf3ce119897448dc4faf2e6005b3ed00dbc19
|
d7596edb5691d37a583c81b535291168ad083cf5
|
refs/heads/master
| 2021-09-11T21:13:21.056231
| 2018-04-12T14:03:37
| 2018-04-12T14:03:37
| 119,363,865
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 61
|
java
|
package _00_universalUtil.model;
public class StorePic {
}
|
[
"idontwannarock@gmail.com"
] |
idontwannarock@gmail.com
|
7a743a082e2844a3883e2349657ce488318df118
|
6c82d44d378f0a0a870d76e129d7f9845d957317
|
/app/src/main/java/com/android/sportclub/MainActivity.java
|
6fc7e6fedac0f17b11557a80ff8ce7eb0281067a
|
[] |
no_license
|
Rolar12/SportClub
|
9576c460c944755271f72535cd6124fb01290dcb
|
3bfba7fba74c26dd1c5031ea3c0f99f165cde352
|
refs/heads/master
| 2022-11-30T08:23:19.190430
| 2020-07-27T19:08:44
| 2020-07-27T19:08:44
| 282,991,552
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,991
|
java
|
package com.android.sportclub;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.CursorLoader;
import androidx.loader.content.Loader;
import android.content.ContentUris;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.android.sportclub.data.MemberCursorAdapter;
import com.android.sportclub.data.SportClubContract.MemberEntry;
import com.android.sportclub.data.SportClubDbHelper;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
public class MainActivity extends AppCompatActivity implements View.OnClickListener, LoaderManager.LoaderCallbacks<Cursor> {
ListView membersListView;
public static final int MEMBER_LOADER = 123;
MemberCursorAdapter memberCursorAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
membersListView = findViewById(R.id.memberListView);
FloatingActionButton addUserButton = findViewById(R.id.floatingActionButton);
addUserButton.setOnClickListener(this);
memberCursorAdapter = new MemberCursorAdapter(this, null, false);
membersListView.setAdapter(memberCursorAdapter);
membersListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(MainActivity.this, AddMemberActivity.class);
Uri currentMemberUri = ContentUris.withAppendedId(MemberEntry.CONTENT_URI, id);
intent.setData(currentMemberUri);
startActivity(intent);
}
});
getSupportLoaderManager().initLoader(MEMBER_LOADER, null, this);
}
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, AddMemberActivity.class);
startActivity(intent);
}
@NonNull
@Override
public Loader<Cursor> onCreateLoader(int i, @Nullable Bundle bundle) {
String [] projection = {MemberEntry._ID, MemberEntry.COLUMN_FIRST_NAME, MemberEntry.COLUMN_LAST_NAME, MemberEntry.COLUMN_SPORT};
CursorLoader cursorLoader = new CursorLoader(this, MemberEntry.CONTENT_URI, projection, null, null, null);
return cursorLoader;
}
@Override
public void onLoadFinished(@NonNull Loader<Cursor> loader, Cursor cursor) {
memberCursorAdapter.swapCursor(cursor);
}
@Override
public void onLoaderReset(@NonNull Loader<Cursor> loader) {
memberCursorAdapter.swapCursor(null);
}
}
|
[
"orlovmaxims@gmail.com"
] |
orlovmaxims@gmail.com
|
3e2157ade1e08804f960d718b1fa404ac20d48ad
|
30e830d8e2e3fd14d700444f14a02de27e849316
|
/夏天酒店管理系统/jdglxt/.svn/pristine/79/799746e19e59c399095e8170385b762cffb6d627.svn-base
|
2c267cb8bb0ac4ae1537cdcf69ba8faddfcfab79
|
[] |
no_license
|
MissionSuccess/JavaSwing
|
74d8320cc89274c28432b8ddf814e330575b730e
|
fe50f974aabdcad7b643268d7f8b3318b51b2c66
|
refs/heads/master
| 2021-08-07T03:54:02.357265
| 2018-11-21T11:41:49
| 2018-11-21T11:41:49
| 146,053,786
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,835
|
package org.lanqiao.jdmrg.view;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.jar.Pack200;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import org.lanqiao.jdmrg.view.*;
//import dao.UpdateClient;
//import view.CanvasFrame;
//import view.KeyFrame;
//import view.RoomClientFrame;
/**
* 前台界面
*
* @author wzg
*/
@SuppressWarnings("serial")
public class QTPanel extends JPanel{
public QTPanel() {
JPanel jj=this;
this.setLayout(null);
this.setSize(210, 640);
this.setLocation(0, 0);
this.setBackground(Color.white);
JButton Key = new JButton();
Key.setFont(new Font("楷体",Font.BOLD,32));
Key.setSize(195, 65);
Key.setLocation(7, 90);
Key.setIcon(new ImageIcon("src/images/房卡激活.png"));
JButton Indent = new JButton();
Indent.setFont(new Font("楷体",Font.BOLD,32));
Indent.setSize(195, 65);
Indent.setLocation(7, 180);
Indent.setIcon(new ImageIcon("src/images/订单处理.png"));
JButton Client= new JButton();
Client.setFont(new Font("楷体",Font.BOLD,32));
Client.setSize(195, 65);
Client.setLocation(7, 270);
Client.setIcon(new ImageIcon("src/images/房客信息.png"));
JButton Roomdie = new JButton();
Roomdie.setFont(new Font("楷体",Font.BOLD,32));
Roomdie.setSize(195, 65);
Roomdie.setLocation(7, 360);
Roomdie.setIcon(new ImageIcon("src/images/房间维护.png"));
JButton Money = new JButton();
Money.setFont(new Font("楷体",Font.BOLD,32));
Money.setSize(195, 65);
Money.setLocation(7, 450);
Money.setIcon(new ImageIcon("src/images/历史订单.png"));
JButton Exit = new JButton();
Exit.setFont(new Font("楷体",Font.BOLD,32));
Exit.setSize(195, 65);
Exit.setLocation(7, 540);
Exit.setIcon(new ImageIcon("src/images/退出系统.png"));
this.add(Key);
this.add(Indent);
this.add(Client);
this.add(Roomdie);
this.add(Money);
this.add(Exit);
/**
* 房卡激活
*/
Key.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
KeyPanel aKeyFrame=new KeyPanel();
CanvasFrame2.delePanelRight(aKeyFrame);
return;
}
});
/**
* 订单处理
*/
Indent.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
new TestFrame().addRecepIndent();
CanvasFrame2.delePanelRight(TestFrame.j2);
return;
}
});
/**
* 房客信息
*/
Client.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
RoomClientPanel aRoomClientFrame =new RoomClientPanel ();
CanvasFrame2.delePanelRight(aRoomClientFrame );
}
});
/**
* 房间维护
*/
Roomdie.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
new TestFrame().addRoomMaintain();
CanvasFrame2.delePanelRight(TestFrame.j2);
return;
}
});
/**
* 历史订单
*/
Money.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
new TestFrame().addHistoryIndent();
CanvasFrame2.delePanelRight(TestFrame.j2);
return;
}
});
/**
* 退出系统
*/
Exit.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
new Denglu();
CanvasFrame2.deleAllPanelRight();
CanvasFrame2.jfff.dispose();
return;
}
});
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Image img = null;
try {
img = new ImageIcon("src/images/左边有logo.png").getImage();
} catch (Exception e) {
e.printStackTrace();
}
g.drawImage(img, 0, 0, 210,640,null);
repaint();
}
}
|
[
"41855798+MissionSuccess@users.noreply.github.com"
] |
41855798+MissionSuccess@users.noreply.github.com
|
|
28a47d03df05bdaad7ac6394eaa2d73052575bfa
|
034b53d3b28244e69ae6233c64aff2ed572fd3b0
|
/eclipse workspace-oxygen/Experiment2/src/exp2/Experiment2.java
|
933c699cd918ab4f0bfae1704798a3a828a143db
|
[] |
no_license
|
871049921/MyCode
|
87aeee00db3bf7036b8b1f9c1d9c537643bb439b
|
3f6ec85bad7c0f69720c1627fd6be9e1e0ccb5fe
|
refs/heads/master
| 2020-05-20T06:42:32.200976
| 2019-06-20T13:57:26
| 2019-06-20T13:57:26
| 185,433,073
| 1
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,399
|
java
|
package exp2;
import java.io.*;
public class Experiment2 {
public static void main(String[] args) throws Exception{
String allInformation = "";//所有信息
int i = 0;
Goods[] goods = new Goods[10];
String randomGoodsName[] = {"pen", "pencil", "backpack", "ruler", "apple", "pear",
"banana", "strawberry", "watermelon", "water"};
SalesRecord[] allRecords = new SalesRecord[1000];
//创建盒装商品类
for (; i < 5; i++) {
goods[i] = new Goods(randomGoodsName[i], "" + i, i * 10 + 10);
//System.out.println(goods[i].getGoodInfomation());
}
//创建散装商品类
for (; i < 10; i++) {
goods[i] = new Goods(randomGoodsName[i], i * 10 + 10);
//System.out.println(goods[i].getGoodInfomation());
}
for (int j = 0; j < 1000; j++) {
int goodsNumber = (int)(Math.random()*10);
if (goods[goodsNumber].isBoxPacked() == true) {//盒装
allRecords[j] = new SalesRecord(goods[goodsNumber], goods[goodsNumber].getBarCode(), goodsNumber);
}
else {
allRecords[j] = new SalesRecord(goods[goodsNumber], goodsNumber);
}
allInformation += allRecords[j].getEveryInformation() + "\n";
}
PrintWriter output = new PrintWriter(new File("fuck.txt"));
output.println(allInformation + SalesRecord.getAllInformationOfToday(goods, 10));
System.out.println(allInformation + SalesRecord.getAllInformationOfToday(goods, 10));
output.close();
}
}
|
[
"871049921@qq.com"
] |
871049921@qq.com
|
90499da48a1f243498fd435a76ddca1daf48fa85
|
e5150d7e230615498fb653b80a60185d64d2292d
|
/SBNotification/src/main/java/Notify/NotificationRestController.java
|
fd6497693449369aadb6f34219d637a5b6c0951f
|
[] |
no_license
|
NitinSingh01/NotificationServices
|
14c726d50df8f4a0670a14c950dacfc4802f5291
|
c4b6da00b23aefaa13702ffb0ce77d13957881bd
|
refs/heads/master
| 2022-11-18T18:12:24.076645
| 2020-07-07T14:53:25
| 2020-07-07T14:53:25
| 276,280,945
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,928
|
java
|
package Notify;
import java.net.URISyntaxException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailException;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import Notify.Transaction;
@RestController
public class NotificationRestController {
@Autowired
NotificationRepository notificationRepo;
@RequestMapping(method=RequestMethod.POST, value="/microbank/v1/notify/customer")
public void notify_msg1(@RequestBody String data) throws JsonMappingException, JsonProcessingException{
Object mapper = new ObjectMapper();
Customer c = ((ObjectMapper) mapper).readValue(data, Customer.class);
System.out.println(c.getEmail());
notificationRepo.sendSuccessfulRegistraionEmail(c);
}
@RequestMapping(method=RequestMethod.POST, value="/microbank/v1/notify/customer/account/transaction")
public void notify_msg2(@RequestBody String user)throws JsonMappingException, JsonProcessingException, MailException, URISyntaxException{
Object mapper = new ObjectMapper();
Transaction c = ((ObjectMapper) mapper).readValue(user, Transaction.class);
notificationRepo.sendTransactionEmail(c);
}
@RequestMapping(method=RequestMethod.POST, value="/microbank/v1/notify/customer/account")
public void notify_msg3(@RequestBody String data) throws JsonMappingException, JsonProcessingException, MailException, URISyntaxException{
Object mapper = new ObjectMapper();
Account c = ((ObjectMapper) mapper).readValue(data, Account.class);
notificationRepo.sendAccountCreatedEmail(c);
}
}
|
[
"nitin.singh01@ad.infosys.com"
] |
nitin.singh01@ad.infosys.com
|
430aeb1e3401e90fa0d64fe7f9ff735e4b7ba277
|
a5e6f27020c23b5755d64d661e24eaef2ca2220f
|
/main.1/java/com/openbravo/pos/forms/Payments.java
|
2e6de9cde0e76a7ae1f3aff177490e26f327060e
|
[] |
no_license
|
AXE2005/SmartPos
|
1681ad1133631ef13e170ca67020e02668d823b9
|
7f433b92ee458931093420d045ff996db3ef77bf
|
refs/heads/master
| 2020-03-18T09:45:49.034449
| 2018-05-23T14:07:07
| 2018-05-23T14:07:07
| 134,579,231
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,145
|
java
|
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2017 Alejandro Camargo
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS 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.
//
// uniCenta oPOS 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 uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.openbravo.pos.forms;
import java.util.HashMap;
/**
*
* @author Jack Gerrard
*/
public class Payments {
private Double amount;
private Double tendered;
private final HashMap paymentPaid;
private final HashMap paymentTendered;
private final HashMap rtnMessage;
private String name;
private final HashMap paymentVoucher;
/**
*
*/
public Payments() {
paymentPaid = new HashMap();
paymentTendered = new HashMap();
rtnMessage = new HashMap();
paymentVoucher = new HashMap();
}
/**
*
* @param pName
* @param pAmountPaid
* @param pTendered
* @param rtnMsg
*/
public void addPayment (String pName, Double pAmountPaid, Double pTendered, String rtnMsg){
if (paymentPaid.containsKey(pName)){
paymentPaid.put(pName,Double.parseDouble(paymentPaid.get(pName).toString()) + pAmountPaid);
paymentTendered.put(pName,Double.parseDouble(paymentTendered.get(pName).toString()) + pTendered);
rtnMessage.put(pName, rtnMsg);
}else {
paymentPaid.put(pName, pAmountPaid);
paymentTendered.put(pName,pTendered);
rtnMessage.put(pName, rtnMsg);
}
}
/**
*
* @param pName
* @param pAmountPaid
* @param pTendered
* @param rtnMsg
* @param pVoucher
*/
public void addPayment (String pName, Double pAmountPaid, Double pTendered, String rtnMsg, String pVoucher){
if (paymentPaid.containsKey(pName)){
paymentPaid.put(pName,Double.parseDouble(paymentPaid.get(pName).toString()) + pAmountPaid);
paymentTendered.put(pName,Double.parseDouble(paymentTendered.get(pName).toString()) + pTendered);
rtnMessage.put(pName, rtnMsg);
paymentVoucher.put(pName, pVoucher);
}else {
paymentPaid.put(pName, pAmountPaid);
paymentTendered.put(pName,pTendered);
rtnMessage.put(pName, rtnMsg);
paymentVoucher.put(pName, pVoucher);
}
}
/**
*
* @param pName
* @return
*/
public Double getTendered (String pName){
return(Double.parseDouble(paymentTendered.get(pName).toString()));
}
/**
*
* @param pName
* @return
*/
public Double getPaidAmount (String pName){
return(Double.parseDouble(paymentPaid.get(pName).toString()));
}
/**
*
* @return
*/
public Integer getSize(){
return (paymentPaid.size());
}
/**
*
* @param pName
* @return
*/
public String getRtnMessage(String pName){
return (rtnMessage.get(pName).toString());
}
public String getVoucher(String pName){
return (paymentVoucher.get(pName).toString());
}
public String getFirstElement(){
String rtnKey= paymentPaid.keySet().iterator().next().toString();
return(rtnKey);
}
/**
*
* @param pName
*/
public void removeFirst (String pName){
paymentPaid.remove(pName);
paymentTendered.remove(pName);
rtnMessage.remove(pName);
// paymentVoucher.remove(pName);
}
}
|
[
"josephcoelo@hotmail.com"
] |
josephcoelo@hotmail.com
|
7e1a2d98aadacdcbd6327b776a56e1a34ad262a4
|
c704787944c6be5b4264a67e0d5bd90113fd335d
|
/app/src/main/java/edu/smartgate/reza/smartgateta/ServerConfig.java
|
7aa2a61e6183968359fa501c55f45b97e8a6613b
|
[] |
no_license
|
ejakpratama/SmartGateTA
|
31575ad984d9da1af946ed4662e75c18f1330a86
|
315d165261068eb6d5b83af52da9c1b24344a74a
|
refs/heads/master
| 2020-03-06T18:06:25.917414
| 2018-04-01T09:48:42
| 2018-04-01T09:48:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 881
|
java
|
package edu.smartgate.reza.smartgateta;
/**
* Created by Reza on 16-Dec-17.
*/
class ServerConfig {
//labkom
//private static final String SERVER_URL = "http://192.168.1.123/smartgate/";
//rumah
//protected static final String SERVER_URL = "http://192.168.100.10/smartgate/";
//ruang dosen siskom
//protected static final String SERVER_URL = "http://192.168.0.115/smartgate/";
//hosting online
protected static final String SERVER_URL = "http://smartgateta.xyz/smartgate/";
//php
static final String URL_LOGIN = SERVER_URL+"LoginUser.php";
static final String URL_REGISTER = SERVER_URL+"RegisterUserLengkap.php";
static final String URL_RIWAYAT = SERVER_URL+"AmbilStatusGerbang.php";
static final String URL_UPDATE = SERVER_URL+"UpdateGbg.php";
static final String URL_CHECK = SERVER_URL+"CheckStatusGerbang.php";
}
|
[
"reza.blaze26@gmail.com"
] |
reza.blaze26@gmail.com
|
da88d4f373bf6a5ff43f5a65f997aaee6c642a40
|
b3ec06fab450ac371b78298bc9992f5b2f722638
|
/src/main/java/af/gov/anar/query/adhocquery/service/AdHocScheduledJobRunnerService.java
|
94339c7351bb0005c5bb9d96f60faaddbb1711a3
|
[] |
no_license
|
Anar-Framework/anar-adhocquery
|
ca349d97755dbb6322dd376afa53e33474c2d593
|
329d5d706cb03802a4ef69ad773ba184f00ded0d
|
refs/heads/master
| 2020-12-21T02:23:05.395941
| 2020-02-05T04:30:15
| 2020-02-05T04:30:15
| 236,278,110
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 135
|
java
|
package af.gov.anar.query.adhocquery.service;
public interface AdHocScheduledJobRunnerService {
void generateClientSchedule();
}
|
[
"mohammadbadarhashimi@gmail.com"
] |
mohammadbadarhashimi@gmail.com
|
8a6eb4635b7ca4f5663887d41b000c059c7c47ee
|
dec4a846475ca996df07d8d404a364f9fa9436a9
|
/src/main/java/me/minikuma/week5/Circle.java
|
4ad82d4700910c954c98fc660a323ff5440de3fe
|
[] |
no_license
|
minikuma/study-halle
|
7eeb56a93f4a4efc6a21e7247098ea5a247dd8bd
|
5c6b4d89d670b2038deadd36a29038641e7646f9
|
refs/heads/master
| 2023-07-17T04:28:05.269751
| 2021-08-30T07:18:19
| 2021-08-30T07:18:19
| 321,232,004
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 388
|
java
|
package me.minikuma.week5;
public class Circle {
// 인스턴스 필드
public double r;
// 생성자
public Circle(double r) {
this.r = r;
}
public static void main(String[] args) {
Circle circle = new Circle(100);
circle.r = 100;
System.out.println("객체 생성 후 인스턴스 필드에 값 적용 = " + circle.r);
}
}
|
[
"minikuma@naver.com"
] |
minikuma@naver.com
|
f5bd5a2c0ba5664c25d803b90e6001428ce56396
|
48fbd64287cb595bbe6d85d0849d1842674a7f46
|
/prog/java_revision/Example/Example.java
|
e118e2d4cf301e819f0be3f31ecfae82b4350657
|
[] |
no_license
|
stevenaeola/gitpitch
|
c89cf0bd2cc81bc38b42f0737af81894e5aea30b
|
0eca661e4cfb67bf060ae06852459cf248f58e2a
|
refs/heads/master
| 2021-11-11T12:06:59.258896
| 2021-11-08T17:24:57
| 2021-11-08T17:24:57
| 149,439,800
| 24
| 51
| null | 2019-04-01T17:18:36
| 2018-09-19T11:24:11
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 1,763
|
java
|
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
// concrete class
public class Example extends AbstractClassExample implements InterfaceExample, Comparable<Example>
{
// fields
// primitive type
private int field1;
// object type, type parameter
private ArrayList<String> field2;
// constructors
public Example(int field1){
super();
// field field1 is not visible
this.field1 = field1;
field2 = new ArrayList<String>();
}
// methods
// get method (accessor)
public int getField1(){
return field1;
}
// modifier method
public void addToField2(String toAdd){
field2.add(toAdd);
}
// overloaded method
public void addToField2(int toAdd){
// operator overloading
field2.add("Number " + toAdd);
}
// overriden method from Object
public String toString(){
String stuff = "A lovely object " + field1;
for(String thing: field2){
stuff += thing;
}
return stuff;
}
public int compareTo(Example other){
return this.getField1() - other.field1;
}
public static void main(String[] args){
// referring to static (class) variable
System.out.println(Example.numberOfObjects + " objects");
// polymorphism: dynamic type <> static type
List<Example> objects = new ArrayList<Example>();
for(int i = 0; i<args.length; i++ ){
objects.add(new Example(new Integer(args[i])));
}
// calling static (class) method
Collections.sort(objects);
System.out.println(objects);
System.out.println(Example.numberOfObjects + " objects");
}
}
|
[
"s.p.bradley@durham.ac.uk"
] |
s.p.bradley@durham.ac.uk
|
ac1cddce365670db6fdba7ee6d04bb62800c0ef5
|
619d7b729ef99bd2e782dfcb4d7f38ae55382061
|
/theDefault/src/main/java/theHeart/powers/HemorrhagePower.java
|
704e0b64a2d01870f85b0edc04e230a6a91a1b30
|
[
"MIT"
] |
permissive
|
Magicut101/theHeart
|
f6e6d32704d87772b8d99479291f909acff95062
|
43025bb36a479234ff4df06c757adf5630a190d3
|
refs/heads/master
| 2020-06-14T03:21:52.020673
| 2019-08-20T17:11:46
| 2019-08-20T17:11:46
| 194,478,121
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,151
|
java
|
package theHeart.powers;
import basemod.interfaces.CloneablePowerInterface;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInDrawPileAction;
import com.megacrit.cardcrawl.cards.status.Slimed;
import com.megacrit.cardcrawl.powers.DrawPower;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInDiscardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.status.Wound;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.PowerStrings;
import com.megacrit.cardcrawl.powers.AbstractPower;
import theHeart.DefaultMod;
import theHeart.util.TextureLoader;
public class HemorrhagePower extends AbstractPower implements CloneablePowerInterface {
public AbstractCreature source;
public static final String POWER_ID = DefaultMod.makeID("Hemorrhage");
private static final PowerStrings powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID);
public static final String NAME = powerStrings.NAME;
public static final String[] DESCRIPTIONS = powerStrings.DESCRIPTIONS;
// We create 2 new textures *Using This Specific Texture Loader* - an 84x84 image and a 32x32 one.
private static final Texture tex84 = TextureLoader.getTexture("Hemorrhage84.png");
private static final Texture tex32 = TextureLoader.getTexture("Hemorrhage32.png");
public HemorrhagePower(final AbstractCreature owner, final int amount) {
name = NAME;
ID = POWER_ID;
this.owner = owner;
this.amount = amount;
type = PowerType.BUFF;
isTurnBased = false;
// We load those textures here.
this.region128 = new TextureAtlas.AtlasRegion(tex84, 0, 0, 84, 84);
this.region48 = new TextureAtlas.AtlasRegion(tex32, 0, 0, 32, 32);
updateDescription();
}
public void atStartOfTurn() {
if (!AbstractDungeon.getMonsters().areMonstersBasicallyDead()) {
flash();
AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDiscardAction(new Wound(), amount));
}
}
/* */
/* */
/* */
/* */ public void stackPower(int stackAmount) {
/* 41 */ this.fontScale = 8.0F;
/* 42 */ this.amount += stackAmount;
/* */ }
/* */
public void updateDescription() {
if (amount == 1) {
description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[1];
} else if (amount > 1) {
description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[2];
}
}
/* */
public AbstractPower makeCopy() {
return new HemorrhagePower(owner, amount);
}
}
|
[
"garciaandy42@hotmail.com"
] |
garciaandy42@hotmail.com
|
a92381d9df6944c94eaaa0cb5fcc3972cd01608a
|
cd9b815162c7e3e711358d966ff480c98722985d
|
/src/main/java/com/home_vedio_pro/util/UUIDUtil.java
|
09168305245e994731a9d6cb99e3783b2fcb765f
|
[] |
no_license
|
wswangbo007/home_vedio
|
11bc63cd8d4590290013bef5dc8242f908eaf251
|
a888d0a41f48474feee31a6ddb31ed40ba514c88
|
refs/heads/master
| 2021-01-10T02:20:44.352985
| 2016-01-19T03:54:15
| 2016-01-19T03:54:15
| 49,924,668
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 272
|
java
|
package com.home_vedio_pro.util;
import java.util.UUID;
/**
* UUID
* @author wangB
*/
public class UUIDUtil {
/**
* 获取UUID
* @return string
*/
public static String getUUID() {
return UUID.randomUUID().toString().replace("-", "");
}
}
|
[
"527882238@qq.com"
] |
527882238@qq.com
|
638a5405b9c17512047ef97e6ac9b8554a9742f2
|
3b2a3adb9fa3826bd0ebd3c0500f27d61ecc61c6
|
/servlets/src/main/java/ru/itis/repositories/CrudRepository.java
|
6d385afa51045fa23739c59cb16edae25504ac92
|
[] |
no_license
|
FakDL/asulgaraev_inf
|
5b45053a29fe33de31c45427c6ae3a4d7a5d93a1
|
3d1c30bf71df1e998142597f317d47fd6a161236
|
refs/heads/master
| 2023-04-27T00:36:05.014008
| 2021-05-30T21:16:12
| 2021-05-30T21:16:12
| 293,893,606
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 288
|
java
|
package ru.itis.repositories;
import java.util.List;
import java.util.Optional;
public interface CrudRepository<T> {
Optional<T> findById(Long id);
List<T> findAll();
void save(T entity);
void update(T entity);
void delete(T entity);
void deleteById(Long id);
}
|
[
"43212319+FakDL@users.noreply.github.com"
] |
43212319+FakDL@users.noreply.github.com
|
ed8abbd7ce548972eeaac8529e94d5c8cb7d3ce2
|
bb4beb950c7b6f597b598536021d6c2c00514c66
|
/app/src/main/java/com/e/my_room/Nota.java
|
c5da9a398fafe09fb97c3087e5e15c9d1628d080
|
[] |
no_license
|
RojoF/Room_beta
|
92dc106b5639943772c4440596311756f3d04ee5
|
486b8f6536a05770bc465f73e0b7b83a00c21284
|
refs/heads/master
| 2022-11-24T22:13:00.348677
| 2020-08-04T07:21:17
| 2020-08-04T07:21:17
| 284,901,988
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 852
|
java
|
package com.e.my_room;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import java.util.UUID;
/**
* Esta clase contiene un objeto de tipo Nota, con un id y el texto de dicha Nota.
*
* @author Raúl Félez Jiménez
* @version 2020.07
*/
@Entity(tableName = "nota")
public class Nota {
@PrimaryKey
@NonNull
private String mId;
@ColumnInfo(name = "contenido")
private String mMensaje;
public Nota() {
mId = UUID.randomUUID().toString();
}
@NonNull
public String getId() {
return mId;
}
public void setId(@NonNull String id) {
mId = id;
}
public String getMensaje() {
return mMensaje;
}
public void setMensaje(String mensaje) {
mMensaje = mensaje;
}
}
|
[
"rojof83@gmail.com"
] |
rojof83@gmail.com
|
0ecec00f585912d5da2653294d62c4d07940edda
|
673a0acef3adad5479302565be2584482052c44b
|
/API/guillegramAPI/src/main/java/guille/guillegram/api/GuillegramApiApplication.java
|
2bb87bf4ad91938d06b3b5ba9b916ae344fee6c6
|
[] |
no_license
|
ekzGuille/Guillegram
|
c303a58a7243f94a7143a784261f88203829ff56
|
eb596d0e68427ead49626a9f3a39df394d2ad646
|
refs/heads/master
| 2020-04-23T18:02:03.837917
| 2019-04-19T11:35:29
| 2019-04-19T11:35:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 328
|
java
|
package guille.guillegram.api;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class GuillegramApiApplication {
public static void main(String[] args) {
SpringApplication.run(GuillegramApiApplication.class, args);
}
}
|
[
"guillermosesesantos@hotmail.com"
] |
guillermosesesantos@hotmail.com
|
57cb110e800dbf33958a758b9d8ce394947ba41b
|
f269c1d88eace07323e8c5c867e9c3ba3139edb5
|
/dk-impl-basic/dk-config-client/src/main/java/cn/laoshini/dk/config/client/DkConfigClientEnvironment.java
|
eacce051b18316b1fa90668acec924486137db5f
|
[
"Apache-2.0"
] |
permissive
|
BestJex/dangkang
|
6f693f636c13010dd631f150e28496d1ed7e4bc9
|
de48d5107172d61df8a37d5f597c1140ac0637e6
|
refs/heads/master
| 2022-04-17T23:12:06.406884
| 2020-04-21T14:42:57
| 2020-04-21T14:42:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,824
|
java
|
package cn.laoshini.dk.config.client;
import java.io.IOException;
import java.util.Properties;
import org.springframework.cloud.config.client.ConfigClientProperties;
import org.springframework.cloud.config.client.ConfigServicePropertySourceLocator;
import org.springframework.core.env.CompositePropertySource;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.ResourcePropertySource;
import cn.laoshini.dk.common.ResourcesHolder;
import cn.laoshini.dk.exception.BusinessException;
import cn.laoshini.dk.util.LogUtil;
import cn.laoshini.dk.util.StringUtil;
/**
* @author fagarine
*/
public class DkConfigClientEnvironment extends StandardEnvironment {
private static final String[] CONFIG_CLIENT_FILE = { "bootstrap", "config-client" };
private static final String[] FILE_SUFFIX = { ".properties", ".yml", ".yaml" };
@Override
protected void customizePropertySources(MutablePropertySources propertySources) {
super.customizePropertySources(propertySources);
loadConfigProperties(this);
}
private void loadConfigProperties(ConfigurableEnvironment environment) {
Resource resource = null;
ResourceLoader resourceLoader = new DefaultResourceLoader(this.getClass().getClassLoader());
String configFile = ResourcesHolder.getConfigClientFile();
if (StringUtil.isNotEmptyString(configFile)) {
resource = resourceLoader.getResource(configFile);
}
if (resource == null || !resource.exists() || !resource.isFile()) {
for (String prefix : CONFIG_CLIENT_FILE) {
for (String suffix : FILE_SUFFIX) {
configFile = prefix + suffix;
resource = resourceLoader.getResource(configFile);
if (resource.exists() && resource.isFile()) {
break;
}
}
}
}
if (!resource.exists() || !resource.isFile()) {
throw new BusinessException("config.client.file", "找不到有效的配置中心客户端配置文件");
}
MutablePropertySources propertySources = environment.getPropertySources();
try {
// 加载config client配置文件信息到environment中
LogUtil.start("config client file:" + resource.getFile());
ResourcePropertySource propertySource = new ResourcePropertySource(resource);
propertySources.addLast(propertySource);
} catch (IOException e) {
LogUtil.error(e, "读取config client配置信息出错");
}
// 初始化配置中心服务与数据
propertySources.addLast(initConfigServicePropertySourceLocator(environment));
}
/**
* 初始化配置中心服务与数据
*
* @param environment environment
* @return 返回从配置中心拉取到的配置信息
*/
private PropertySource<?> initConfigServicePropertySourceLocator(ConfigurableEnvironment environment) {
String uri = environment.getProperty("dk.config.server");
String name = environment.getProperty("dk.config.name");
String label = environment.getProperty("dk.config.label");
String profile = environment.getProperty("dk.config.profile");
LogUtil.start("application name:{}, uri:{}, profile:{}, label:{}", name, uri, profile, label);
// 创建配置中心客户端配置数据
ConfigClientProperties configClientProperties = new ConfigClientProperties(environment);
Properties properties = new Properties();
if (StringUtil.isEmptyString(uri)) {
throw new BusinessException("config.server.url", "配置中心URL未配置,配置项:dk.config.server");
}
configClientProperties.setUri(uri.split(","));
if (StringUtil.isEmptyString(name)) {
throw new BusinessException("config.client.name", "配置中心客户端name未配置,配置项:dk.config.name");
}
configClientProperties.setName(name);
properties.put("spring.cloud.config.name", name);
if (StringUtil.isEmptyString(profile)) {
throw new BusinessException("config.client.profile", "配置中心客户端profile未配置,配置项:dk.config.profile");
}
configClientProperties.setProfile(profile);
properties.put("spring.cloud.config.profile", profile);
if (StringUtil.isNotEmptyString(label)) {
configClientProperties.setLabel(label);
properties.put("spring.cloud.config.label", label);
}
environment.getPropertySources().addLast(new PropertiesPropertySource("springCloudConfigClient", properties));
// 定位Environment属性并拉取数据
ConfigServicePropertySourceLocator configServicePropertySourceLocator = new ConfigServicePropertySourceLocator(
configClientProperties);
PropertySource<?> propertySource = configServicePropertySourceLocator.locate(environment);
LogUtil.start("config propertySource:" + propertySource.getName());
for (PropertySource ps : ((CompositePropertySource) propertySource).getPropertySources()) {
LogUtil.start(ps.getName() + ":" + ((MapPropertySource) ps).getSource());
}
return propertySource;
}
}
|
[
"125767187@qq.com"
] |
125767187@qq.com
|
542d6e651dcc16f92112ac4d3072ad82aef2a677
|
c187d981fc6e697314c1fdcbdf0d9fa6bf83785c
|
/Adapter-Pattern/src/main/java/thridLogin/LoginForWechatAdapter.java
|
dbc88c4c97b07dd72cb52b1b86b38ff0a8f19367
|
[] |
no_license
|
zhengquan45/Play-with-DesignPattern
|
e18bbb70b1a2c3bb423062d71d4e67a50e113a9a
|
1737601a267c65489213ceb513eccef9f348c3ac
|
refs/heads/master
| 2022-10-07T22:47:32.655745
| 2020-06-10T01:05:27
| 2020-06-10T01:05:27
| 267,460,837
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 275
|
java
|
package thridLogin;
public class LoginForWechatAdapter implements LoginAdapter{
public boolean support(Object adapter) {
return adapter instanceof LoginForWechatAdapter;
}
public ResultMsg login(String id, Object adapter) {
return null;
}
}
|
[
"zheng_quan45@163.com"
] |
zheng_quan45@163.com
|
5db24c10c1bd4185dee3265c392559d80fad8f90
|
4ea6d93e27c800b09cc19cfca3be6a15b0075a9f
|
/src/main/java/huffman/TreeNode.java
|
8153b28beec59c8b4e46eeb11062c684f34fc5bf
|
[] |
no_license
|
cellargalaxy/JavaDataStructureCurriculumDesign
|
8f8f7112d2a7cc6fde37e9dc478a16e9fe057cfc
|
c5296e2eef9401cea168e987524268d3bfda51a1
|
refs/heads/master
| 2020-12-30T14:12:44.999694
| 2017-06-06T12:55:30
| 2017-06-06T12:55:30
| 91,289,596
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,142
|
java
|
package huffman;
/**
* Created by cellargalaxy on 2017/5/15.
*/
public class TreeNode<T> {
private TreeNode parent;
private TreeNode left;
private TreeNode right;
private T t;
private long count;
private String coding;
protected TreeNode(T t, long count) {
this.t = t;
this.count = count;
coding = "";
}
public TreeNode getParent() {
return parent;
}
public void setParent(TreeNode parent) {
this.parent = parent;
}
public TreeNode getLeft() {
return left;
}
public void setLeft(TreeNode left) {
this.left = left;
}
public TreeNode getRight() {
return right;
}
public void setRight(TreeNode right) {
this.right = right;
}
public long getCount() {
return count;
}
public void setCount(long count) {
this.count = count;
}
public T getT() {
return t;
}
public void setT(T t) {
this.t = t;
}
public String getCoding() {
return coding;
}
public void setCoding(String coding) {
this.coding = coding;
}
@Override
public String toString() {
return "TreeNode{" +
"t=" + t +
", count=" + count +
", coding='" + coding + '\'' +
'}';
}
}
|
[
"cellargalaxy@gmail.com"
] |
cellargalaxy@gmail.com
|
6a39bc72aed57e42bdc1ffb41d9934b3304d739f
|
102aa70d26d9a18fe9cad796e3f99af0859ca2e4
|
/photoview/src/main/java/cn/finalteam/rxgalleryfinal/interactor/impl/MediaBucketFactoryInteractorImpl.java
|
635b2c90d692ce37d4cdc7fe783c2a297cf32bf7
|
[] |
no_license
|
imyetse/TopWerewolf
|
cfad1bd3c73d9c08eec4e42cbd9da6e0ebb81537
|
f7118761dc8c65fd2d23fb5861906e6bad789484
|
refs/heads/master
| 2021-01-20T14:58:31.307478
| 2017-06-18T15:58:03
| 2017-06-18T15:58:03
| 90,696,233
| 34
| 13
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,009
|
java
|
package cn.finalteam.rxgalleryfinal.interactor.impl;
import android.content.Context;
import java.util.List;
import cn.finalteam.rxgalleryfinal.bean.BucketBean;
import cn.finalteam.rxgalleryfinal.interactor.MediaBucketFactoryInteractor;
import cn.finalteam.rxgalleryfinal.utils.MediaUtils;
import rx.Observable;
import rx.Observer;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/**
* Desction:
* Author:pengjianbo
* Date:16/7/4 下午8:29
*/
public class MediaBucketFactoryInteractorImpl implements MediaBucketFactoryInteractor {
private Context context;
private boolean isImage;
private OnGenerateBucketListener onGenerateBucketListener;
public MediaBucketFactoryInteractorImpl(Context context, boolean isImage, OnGenerateBucketListener onGenerateBucketListener) {
this.context = context;
this.isImage = isImage;
this.onGenerateBucketListener = onGenerateBucketListener;
}
@Override
public void generateBuckets() {
Observable.create((Observable.OnSubscribe<List<BucketBean>>) subscriber -> {
List<BucketBean> bucketBeanList = null;
if(isImage) {
bucketBeanList = MediaUtils.getAllBucketByImage(context);
} else {
bucketBeanList = MediaUtils.getAllBucketByVideo(context);
}
subscriber.onNext(bucketBeanList);
subscriber.onCompleted();
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<List<BucketBean>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
onGenerateBucketListener.onFinished(null);
}
@Override
public void onNext(List<BucketBean> bucketBeanList) {
onGenerateBucketListener.onFinished(bucketBeanList);
}
});
}
}
|
[
"imyetse@163.com"
] |
imyetse@163.com
|
e98c7bd8b145649fa509684dacfbee35607b388d
|
36f10d3acf2806a8711e075a10cdcf3a9b3f5481
|
/src/main/java/com/app/ildong/sys/controller/SysPopupMgmtController.java
|
36380810b8755f8e27177a8b52b6d3650d413ee7
|
[] |
no_license
|
Parkjongyong/DailyGit
|
c2668a9396fb2353354c94423f0697facdeb383f
|
feeae1937ef3e47347e93164c99d4b8bac2fd8eb
|
refs/heads/master
| 2023-08-10T09:00:59.149471
| 2021-09-14T05:52:37
| 2021-09-14T05:52:37
| 405,889,871
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 13,329
|
java
|
/**
* 알림팝업 조회/등록/수정 컨트롤러
* @author 길용덕
* @since 2020.06.17
*
* << 개정이력(Modification Information) >>
* -------------------------------------------------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2020.06.18 길용덕 최초생성
* -------------------------------------------------
*/
package com.app.ildong.sys.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.app.ildong.common.model.JsonData;
import com.app.ildong.common.model.mvc.BaseController;
import com.app.ildong.common.pagenation.PaginationInfo;
import com.app.ildong.common.service.CommonSelectService;
import com.app.ildong.common.service.FileManageService;
import com.app.ildong.common.util.FileUtil;
import com.app.ildong.common.util.PageUtil;
import com.app.ildong.common.util.StringUtil;
import com.app.ildong.sys.service.SysBoardService;
import com.app.ildong.sys.service.SysPopupMgmtService;
@Controller
public class SysPopupMgmtController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(SysPopupMgmtController.class);
@Autowired
private SysBoardService sysBoardService;
@Autowired
private SysPopupMgmtService sysPopupMgmtService;
@Autowired
private CommonSelectService commonSelectService;
@Autowired
private FileManageService fileManageService;
@RequestMapping("/com/sys/sysBoardViewPop.do")
public String sysBoardView(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) throws Exception {
//필요공통코드 목록
model.putAll(commonSelectService.selectCodeList(new String[]{"ADM002"}));
paramMap.put("COMP_CD", getCompCd());
sysBoardService.updateBoardHit(paramMap);
model.addAttribute("boardInfo", sysBoardService.selectBoardInfo(paramMap));
model.addAttribute("boardInfoAll", sysBoardService.selectBoardInfoAll(paramMap));
model.addAttribute("data", paramMap);
model.addAttribute("boardView", sysBoardService.selectBoard(paramMap));
return "com/sys/sysBoardViewPop";
}
@RequestMapping("/com/sys/sysBoardListPop.do")
public String sysBoardList(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) throws Exception {
String url = "com/sys/sysBoardListPop";
paramMap.put("COMP_CD", getCompCd());
Map<String, Object> boardInfo = sysBoardService.selectBoardInfo(paramMap);
if("FAQ".equals(boardInfo.get("BOARD_TYPE"))) {
//필요공통코드 목록
model.putAll(commonSelectService.selectCodeList(new String[]{"ADM003"}));
url = "com/sys/sysBoardListPopFaq";
}
model.addAttribute("boardInfo", boardInfo);
model.addAttribute("boardInfoAll", sysBoardService.selectBoardInfoAll(paramMap));
model.addAttribute("data", paramMap);
return url;
}
@RequestMapping("/com/sys/sysPopupMgmt.do")
public String sysPopupMgmt(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
return "com/sys/sysPopupMgmt";
}
@RequestMapping("/com/sys/selectSysPopupMgmtList.do")
@ResponseBody
public JsonData selectSysPopupMgmtList(@RequestBody Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
try {
List<Map<String,Object>> dataList = sysPopupMgmtService.selectSysPopupMgmtList(paramMap);
if (null!=dataList && 0<dataList.size()) {
Integer totalCnt = Integer.valueOf( ((Map<String,Object>)dataList.get(0)).get("TOT_CNT").toString() );
jsonData.setPageRows(paramMap, dataList, totalCnt);
} else {
jsonData.setPageRows(paramMap, null, 0);
}
} catch (Exception e) {
logger.error("팝업관리 조회 오류", e);
}
if( logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
@RequestMapping("/com/sys/sysPopupMgmtWrite.do")
public String sysPopupMgmtWrite(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
return "com/sys/sysPopupMgmtWrite";
}
@RequestMapping("/com/sys/insertPopupMgmt.do")
@ResponseBody
public JsonData insertPopupMgmt(@RequestBody Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
int result = 0;
String resultCd = "";
try {
result = sysPopupMgmtService.insertPopupMgmt(paramMap);
if(result > 0) {
resultCd = "S";
} else {
resultCd = "E";
}
jsonData.addFields("resultCd", resultCd);
} catch (Exception e) {
logger.error("팝업관리 새 팝업 작성 저장 오류", e);
jsonData.setErrMsg(e.getMessage());
}
if( logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
@RequestMapping("/com/sys/modifyPopupMgmt.do")
@ResponseBody
public JsonData modifyPopupMgmt(@RequestBody Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
int result = 0;
String resultCd = "";
try {
result = sysPopupMgmtService.updatePopupMgmt(paramMap);
if(result > 0) {
resultCd = "S";
} else {
resultCd = "E";
}
jsonData.addFields("resultCd", resultCd);
} catch (Exception e) {
logger.error("팝업관리 새 팝업 작성 수정 오류", e);
jsonData.setErrMsg(e.getMessage());
}
if( logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
@RequestMapping("/com/sys/sysPopupMgmtModify.do")
public String sysPopupMgmtModify(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
model.addAttribute("popupView", sysPopupMgmtService.selectPopupMgmt(paramMap));
return "com/sys/sysPopupMgmtModify";
}
@RequestMapping("/com/sys/sysPopupMgmtView.do")
public String sysPopupMgmtView(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
model.addAttribute("popupView", sysPopupMgmtService.selectPopupMgmt(paramMap));
return "com/sys/sysPopupMgmtView";
}
@RequestMapping("/com/sys/selectSysPopupMgmtListMain.do")
@ResponseBody
public JsonData selectSysPopupMgmtListMain(@RequestBody Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
try {
logger.debug("=============================================================================");
List<Map<String,Object>> dataList = sysPopupMgmtService.selectSysPopupMgmtListMain(paramMap);
if (null!=dataList && 0<dataList.size()) {
jsonData.setPageRows(paramMap, dataList, 0);
} else {
jsonData.setPageRows(paramMap, null, 0);
}
} catch (Exception e) {
e.printStackTrace();
jsonData.setErrMsg(e.getMessage());
}
if( logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
@RequestMapping("/com/sys/selectPopupMgmtMain.do")
public String selectPopupMgmtMain(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
model.addAttribute("popupView", sysPopupMgmtService.selectPopupMgmtMain(paramMap));
return "com/sys/sysPopupMgmtView";
}
@RequestMapping("/com/sys/sysBoardListPopup.do")
public String sysBoardListPopup(@RequestParam Map<String, Object> paramMap, HttpServletRequest request, ModelMap model) throws Exception {
// 공지사항
JsonData jsonData = new JsonData();
/*
* BP 공지사항
*/
List<Map<String, Object>> dataList = sysBoardService.selectNoticeList(paramMap);
if (null != dataList && 0 < dataList.size()) {
Integer totalCnt = Integer.valueOf(((Map<String, Object>) dataList.get(0)).get("TOT_CNT").toString());
jsonData.setPageRows(paramMap, dataList, totalCnt);
model.addAttribute("TOT_CNT", totalCnt);
model.addAttribute("page", jsonData.getPage());
} else {
jsonData.setPageRows(paramMap, null, 0);
model.addAttribute("TOT_CNT", "0");
model.addAttribute("page", jsonData.getPage());
}
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(jsonData.getPage());
paginationInfo.setRecordCountPerPage(jsonData.getPageUnit());
paginationInfo.setPageSize(jsonData.getPageSize());
paginationInfo.setTotalRecordCount(jsonData.getRecords());
/*
* BP 공지사항
*/
model.addAttribute("dataList", dataList);
model.addAttribute("paginationInfo", paginationInfo);
model.addAttribute("boardInfo", sysBoardService.selectBoardInfo(paramMap));
model.addAttribute("srchGrp", StringUtil.nvl(paramMap.get("srchGrp"), ""));
model.addAttribute("srchTxt", StringUtil.nvl(paramMap.get("srchTxt"), ""));
return "com/sys/sysBoardListPopup";
}
@RequestMapping(value = "/com/sys/sysBoardDetailPopup.do")
public String sysBoardDetailPopup(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) throws Exception {
sysBoardService.updateBoardHit(paramMap);
Map<String, Object> noticeInfo = sysBoardService.selectBoard(paramMap);
Map<String, Object> subNoticeInfo = sysBoardService.selectSubNotice(paramMap);
if(!"".equals(StringUtil.nvl(noticeInfo.get("ATTACHMENT"), "")) ){
paramMap.put("APP_SEQ", StringUtil.nvl(noticeInfo.get("ATTACHMENT"), ""));
List<Map<String, Object>> uploadedFiles = fileManageService.selectUploadedFileList(paramMap);
model.addAttribute("fileList", FileUtil.convertForFileView(uploadedFiles));
}
model.addAttribute("page", StringUtil.nvl(paramMap.get("page"), "1"));
model.addAttribute("noticeInfo", noticeInfo);
model.addAttribute("subNoticeInfo", subNoticeInfo);
model.addAttribute("boardInfo", sysBoardService.selectBoardInfo(paramMap));
model.addAttribute("srchGrp", StringUtil.nvl(paramMap.get("srchGrp"), ""));
model.addAttribute("srchTxt", StringUtil.nvl(paramMap.get("srchTxt"), ""));
model.addAttribute("BOARD_ID", StringUtil.nvl(paramMap.get("BOARD_ID"), ""));
return "com/sys/sysBoardDetailPopup";
}
@RequestMapping("/com/sys/selectcoNoticeList.do")
@ResponseBody
public JsonData selectcoNoticeList(@RequestBody Map<String, Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
try {
List<Map<String,Object>> dataList = sysBoardService.selectNoticeList(paramMap);
if (null != dataList && 0 < dataList.size()) {
Integer totalCnt = Integer.valueOf(((Map<String, Object>) dataList.get(0)).get("TOT_CNT").toString());
jsonData.setPageRows(paramMap, dataList, totalCnt);
} else {
jsonData.setPageRows(paramMap, null, 0);
}
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(jsonData.getPage()) ;
paginationInfo.setRecordCountPerPage(jsonData.getPageUnit());
paginationInfo.setPageSize(jsonData.getPageSize());
paginationInfo.setTotalRecordCount(jsonData.getRecords());
jsonData.addFields("pagingTag", PageUtil.renderPagination(paginationInfo, "linkPage"));
} catch (Exception e) {
e.printStackTrace();
jsonData.setErrMsg(e.getMessage());
}
if (logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
}
|
[
"zzhsazz@naver.com"
] |
zzhsazz@naver.com
|
f242db11c4ecda642be418c46b13e0c527541288
|
1294e95badd03a0a2b1d47c26bf58ba62b4c2693
|
/YoutubeFavorite/src/main/java/com/doheum/yf/client/ClientService.java
|
a9157229a4624b0724cd2c19fa340828c4099c31
|
[] |
no_license
|
ParkDoheum/YoutubeFavorite
|
775ed951641ebfa343a089cd25297389a1d697f8
|
2c45953ffdd64c67d06bb581e690b2ad564fb457
|
refs/heads/master
| 2020-04-08T15:05:38.043576
| 2018-11-30T08:13:03
| 2018-11-30T08:13:03
| 159,465,113
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 422
|
java
|
package com.doheum.yf.client;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.doheum.yf.client.dao.ClientMapper;
import com.doheum.yf.model.YoutubeVO;
@Service
public class ClientService {
@Autowired
private ClientMapper mapper;
public List<YoutubeVO> getList() {
return mapper.getList();
}
}
|
[
"USER@USER18-PC"
] |
USER@USER18-PC
|
83ced2bb88ae309706affb5a6d6ce942d4674b24
|
f741d0932cc199c4fc29e18e10e1d274e4d7ed5a
|
/src/gui/NewsAggregatorGUI.java
|
668f3541e1b1227b3250453f48d051421fe07b29
|
[] |
no_license
|
cchun319/Aggregator
|
6aa861b7d7bd015c471a47dff4026837d8920742
|
8720cbfc79849ad3ddfb72bdee889fb7d2c2aee1
|
refs/heads/master
| 2023-01-03T18:05:29.189064
| 2020-11-01T03:04:04
| 2020-11-01T03:04:04
| 290,331,237
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 9,834
|
java
|
package gui;
import java.awt.BorderLayout;
import java.awt.Desktop;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
import java.util.NavigableSet;
import java.util.Map.Entry;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import indexing.IIndexBuilder;
import indexing.IndexBuilder;
/**
* @author ericfouh
*/
public class NewsAggregatorGUI
{
private JFrame frame;
private AutocompletePanel searchBox;
private JComboBox rssBox;
private IIndexBuilder idxBuilder;
public static final String[] rssUrls =
{ "https://rss.nytimes.com/services/xml/rss/nyt/US.xml",
"http://feeds.washingtonpost.com/rss/rss_powerpost",
"http://rss.cnn.com/rss/cnn_us.rss",
"http://feeds.foxnews.com/foxnews/latest",
"http://feeds.bbci.co.uk/news/world/rss.xml",
"http://rss.cnn.com/rss/cnn_topstories.rss",
"http://localhost:8090/sample_rss_feed.xml" };
/**
*
*/
private Map<?, ?> invIdx;
private boolean autocomplete = false;
/**
* Launch the application.
*/
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable() {
public void run()
{
try
{
NewsAggregatorGUI window = new NewsAggregatorGUI();
window.frame.setVisible(true);
}
catch (Exception e)
{
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public NewsAggregatorGUI()
{
initialize();
}
private void initRSSList()
{
idxBuilder = new IndexBuilder();
rssBox = new JComboBox(rssUrls);
rssBox.setSelectedIndex(0);
}
/**
* Initialize the contents of the frame.
*/
private void initialize()
{
frame = new JFrame();
frame.setBounds(100, 100, 450, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JButton btnSearch = new JButton("Search");
btnSearch.setBounds(350, 135, 90, 30);
btnSearch.setEnabled(false);
frame.getContentPane().add(btnSearch);
DefaultListModel<String> articlesList = new DefaultListModel<String>();
JList results = new JList(articlesList);
// results.setBounds(0, 270, 450, 300);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(results);
results.setLayoutOrientation(JList.VERTICAL);
scrollPane.setVisible(true);
JPanel panel = new JPanel(new BorderLayout());
panel.add(scrollPane);
panel.setBounds(0, 270, 450, 300);
frame.add(panel);
initRSSList();
rssBox.setBounds(0, 0, 350, 27);
frame.getContentPane().add(rssBox);
JButton btnAddRSS = new JButton("Add RSS");
btnAddRSS.setBounds(350, 1, 90, 29);
frame.getContentPane().add(btnAddRSS);
JButton btnIndex = new JButton("Create Indexes");
btnIndex.setBounds(0, 32, 117, 29);
btnIndex.setEnabled(false);
frame.getContentPane().add(btnIndex);
JButton btnHome = new JButton("Home Page");
btnHome.setBounds(129, 32, 117, 29);
btnHome.setEnabled(false);
frame.getContentPane().add(btnHome);
JButton btnAutoCplt = new JButton("Autocomplete");
btnAutoCplt.setToolTipText("Update autocomplete file");
btnAutoCplt.setBounds(250, 32, 117, 29);
btnAutoCplt.setEnabled(false);
frame.getContentPane().add(btnAutoCplt);
searchBox = new AutocompletePanel("./src/autocomplete.txt");
searchBox.setBounds(0, 135, 350, 130);
searchBox.setVisible(true);
frame.getContentPane().add(searchBox);
DefaultListModel listModel = new DefaultListModel();
JList rssList = new JList(listModel);
rssList.setToolTipText("News Sources");
rssList.setEnabled(false);
rssList.setBounds(10, 59, 350, 75);
frame.getContentPane().add(rssList);
// add RSS
btnAddRSS.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
btnIndex.setEnabled(true);
String selected = (String)rssBox.getSelectedItem();
if (!listModel.contains(selected))
{
// limit 4 sources
if (listModel.size() == 4)
{
listModel.remove(0);
}
listModel.addElement(selected);
}
}
});
// index building
btnIndex.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
// Convert listmodel to a List
List<String> feeds = new ArrayList<>(listModel.size());
for (int i = 0; i < listModel.size(); i++)
feeds.add((String)listModel.get(i));
Map<String, List<String>> map = idxBuilder.parseFeed(feeds);
Map<String, Map<String, Double>> index =
idxBuilder.buildIndex(map);
invIdx = idxBuilder.buildInvertedIndex(index);
btnHome.setEnabled(true);
btnSearch.setEnabled(true);
btnAutoCplt.setEnabled(true);
}
});
// Home page
btnHome.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
Map<String, List<Entry<String, Double>>> articles =
(Map<String, List<Entry<String, Double>>>)invIdx;
Collection<Entry<String, List<String>>> home =
(Collection<Entry<String, List<String>>>)idxBuilder
.buildHomePage(invIdx);
if (home.size() > 0)
{
articlesList.clear();
}
Iterator<Entry<String, List<String>>> iter = home.iterator();
while (iter.hasNext())
{
Entry<String, List<String>> entry = iter.next();
articlesList.addElement(entry.getKey());
for (String url : entry.getValue())
articlesList.addElement("\t\t" + url);
}
}
});
// Autocomplete
btnAutoCplt.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
idxBuilder
.createAutocompleteFile(idxBuilder.buildHomePage(invIdx));
searchBox = new AutocompletePanel("./src/autocomplete.txt");
}
});
// search
btnSearch.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
String query = searchBox.getSearchText();
if (query.length() > 0)
{
List<String> articles =
idxBuilder.searchArticles(query, invIdx);
if (articles != null && articles.size() > 0)
{
articlesList.clear();
articlesList.addElement(query);
for (String url : articles)
articlesList.addElement("\t\t" + url);
}
}
}
});
// clickable results
results.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt)
{
JList list = (JList)evt.getSource();
if (evt.getClickCount() == 1)
{
// index of the article
int index = list.locationToIndex(evt.getPoint());
String url = articlesList.get(index);
URI uriAddress;
try
{
URI uri = new URI(url.trim());
if (url.contains("http://"))
Desktop.getDesktop().browse(uri);
}
catch (UnsupportedEncodingException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (URISyntaxException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
});
}
}
|
[
"chun3@seas.upenn.edu"
] |
chun3@seas.upenn.edu
|
db1c8cec8358ead427e355c1882411e0d6cfb760
|
de487688683fff63903753d9a57467e37e6fad6e
|
/springBootLearning/src/main/java/com/springbootlearning/config/MvcConfig.java
|
42014576bbcba545527b1357682654da79b2fb30
|
[] |
no_license
|
kindnessiliy/learningSSM
|
5d5b78037bfba1d2cf16d50736e230961289d514
|
429ac910429d12e1b2e6265ab2d0ab4774f1c90d
|
refs/heads/master
| 2023-01-30T03:52:27.097082
| 2020-12-07T14:49:31
| 2020-12-07T14:49:31
| 315,514,827
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 845
|
java
|
package com.springbootlearning.config;
import com.springbootlearning.interceptor.MyInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author:zyh
* @Time:2020-11-22-16:13
* @email:1269231889@qq.com
*/
@Configuration
public class MvcConfig implements WebMvcConfigurer {
//注册拦截器
@Bean
public MyInterceptor myInterceptor(){
return new MyInterceptor();
}
//添加拦截器到拦截连
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(myInterceptor()).addPathPatterns("/*");
}
}
|
[
"1269231889@qq,com"
] |
1269231889@qq,com
|
0d0c6e099c17ab70243d2851a21924afaa39d88b
|
09b178bbf6257a453c1e9283e9200b32e756ad11
|
/src/main/java/com/steven/tmt/domain/IsHeadOf.java
|
d32f566775b41b134b581c29e48f306494f8ae0d
|
[] |
no_license
|
VDSteven/tmt
|
e482524dae10e1dcf8e78b368dec0150681ed9b5
|
8fdc74405fa931b399aee0aa4856116a5464d5fb
|
refs/heads/master
| 2021-01-19T10:42:01.607381
| 2017-02-16T16:45:14
| 2017-02-16T16:45:14
| 82,201,022
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,959
|
java
|
package com.steven.tmt.domain;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
/**
* A IsHeadOf.
*/
@Entity
@Table(name = "is_head_of", uniqueConstraints = @UniqueConstraint(columnNames = {"head_id", "employee_id"}))
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class IsHeadOf implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(optional = false)
@NotNull
private User head;
@ManyToOne(optional = false)
@NotNull
private User employee;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public User getHead() {
return head;
}
public IsHeadOf head(User user) {
this.head = user;
return this;
}
public void setHead(User user) {
this.head = user;
}
public User getEmployee() {
return employee;
}
public IsHeadOf employee(User user) {
this.employee = user;
return this;
}
public void setEmployee(User user) {
this.employee = user;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
IsHeadOf isHeadOf = (IsHeadOf) o;
if (isHeadOf.id == null || id == null) {
return false;
}
return Objects.equals(id, isHeadOf.id);
}
@Override
public int hashCode() {
return Objects.hashCode(id);
}
@Override
public String toString() {
return "IsHeadOf{" +
"id=" + id +
'}';
}
}
|
[
"vsteven@student.ethz.ch"
] |
vsteven@student.ethz.ch
|
521d0a1c31635d2d06d54ff5f0a68fd015658d2e
|
acdb5af316a9ffe905c43fe1c06ecd2fd2959fad
|
/order/order-consumer/src/main/java/com/imooc/order/consumer/dataobject/OrderDetail.java
|
8e00bfa690c27b6b865103d922653fb3422efe48
|
[
"Apache-2.0"
] |
permissive
|
huluobo11/spring-cloud-demo
|
c3b9fbf3d69d2fce4347f775d6c5269c99968044
|
13d0929d09fc9265f97ebb77c8a4492dddb6f8f2
|
refs/heads/master
| 2020-04-04T23:00:05.391550
| 2019-04-05T10:15:41
| 2019-04-05T10:15:41
| 156,343,604
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 525
|
java
|
package com.imooc.order.consumer.dataobject;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Entity
public class OrderDetail {
@Id
private String detailId;
private String orderId;
private String productId;
private String productName;
private BigDecimal productPrice;
private Integer productQuantity;
private String productIcon;
private Date createTime;
private Date updateTime;
}
|
[
"15136129644@139.com"
] |
15136129644@139.com
|
581055ec218deed0d92a0c4c6ed3ef84ea3a75a7
|
7ca4bc1066d904fe8459126c942023482a5e642c
|
/WLanLocator/src/com/locator/wlan/WLanData.java
|
6c957f05f8fc302c9deb8c398bddc95989fa766c
|
[] |
no_license
|
NicoBleh/WLanLocator
|
aaa43d2da0221e4f7c227239fa710047050aba36
|
3734493b1d673dd474a77a07c5c33fa33c05419c
|
refs/heads/master
| 2021-01-19T06:26:05.440860
| 2012-12-12T14:15:23
| 2012-12-12T14:15:23
| 7,131,100
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,499
|
java
|
package com.locator.wlan;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.os.AsyncTask;
import com.locator.wlan.interfaces.Observer;
import com.locator.wlan.interfaces.Subject;
/**
* Class to pull ScanResults from the devices wifi and notify its observers.
* The Subject is started as a Async Task to no get in interference with the ui Thread.
*
* @author Nico Bleh
* @version 1.0
*
*/
public class WLanData extends AsyncTask<Void, Void, Void> implements Subject {
/**
* Fields
*/
private ArrayList<Observer> observerList; //List of registered observers
private ConnectivityManager conManager;
private boolean run; //Variable to control the lifecicle of the AsyncTask
private int updateintervall; //Time which the AsyncTask waits before pulling new scans
private WifiManager wifiService;
private List<ScanResult> scanlist; //Temporal list with found AccessPoints
private List<ScanResult> oldscanlist; //Temporal list with found AccessPoints
/**
* Constructor
*/
public WLanData(Context context, int updateintervall) {
this.updateintervall = updateintervall;
run = true;
conManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo;
netInfo = conManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
netInfo.getState();
wifiService = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); //Instanz des WifiManagers holen
oldscanlist = null;
observerList = new ArrayList<Observer>();
}
/**
* Registers a observer at the subject
*
* @return void
* @param Observer the observer to be notified
*/
@Override
public void registerObserver(Observer o) {
observerList.add(o);
}
/**
* Registers a observer at the subject
*
* @return void
* @param Observer the observer who not wants to be notified any more
*/
@Override
public void removeObserver(Observer o) {
observerList.remove(o);
}
/**
* Notifies all the observers registered by passing the latest List of Accesspoints
*/
@Override
public void notifyObservers() {
for(Observer o : observerList) {
o.update(scanlist);
}
}
public void endTask() {
this.run = false;
}
/**
* Gets the scan results and notifies his observers if results have changed
*/
@Override
protected Void doInBackground(Void... params) {
while(run) {
//WLan-Netze scannen
wifiService.startScan();
//Ergebnisse holen
scanlist = wifiService.getScanResults();
if(!equalLists(scanlist, oldscanlist) && scanlist != null) {
oldscanlist = scanlist;
this.notifyObservers();
}
try {
Thread.sleep(updateintervall);
} catch (InterruptedException e) {
}
}
return null;
}
/**
* Determines the equalness of two schan results
*
* @param list1
* @param list2
* @return true if the two scan results a equal. Else false
*/
private boolean equalLists(List<ScanResult> list1, List<ScanResult> list2) {
if(list1 == null || list2 == null) return false;
if(list1.size() != list2.size()) {
return false;
}
else {
for(int i=0; i < list1.size(); i++) {
if(!list1.get(i).BSSID.equals(list2.get(i).BSSID) || list1.get(i).level != list2.get(i).level)
return false;
}
return true;
}
}
}
|
[
"n_bleh@gmx.de"
] |
n_bleh@gmx.de
|
a387bb2942e6de3863e85eb8c3834d827b8e42d5
|
452af742b179d205239a8e6f4d20ae243674c97e
|
/Pokedex/src/SimuladorPkm.java
|
4ef304424574489014a5370b6c5dbd24a0a686ec
|
[
"Apache-2.0"
] |
permissive
|
RONALDPA/POO
|
ac7cce8c864be5fce6c2de5ff198140d46213d9c
|
55a91f836bdb9c2ee02c216d3e94d7034e0f166b
|
refs/heads/master
| 2020-04-06T03:51:22.046693
| 2016-08-09T23:52:39
| 2016-08-09T23:52:39
| 61,651,473
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 718
|
java
|
public class SimuladorPkm {
public static void main(String[] args) {
Pokemon poliwag = new PokemonAgua("Poliwag", "Agua", 10, 10, 300, 50);
Pokemon arcanine = new PokemonFuego("Arcanine", "Fuego", 20, 20, 300, 60);
Pokemon pikachu = new PokemonElectrico("Pikachu", "Electrico", 11, 6, 500, 49);
System.out.println(" *- ARCANINE VS POLIWAG -*");
System.out.println("\n ARCANINE ATACA: ");
arcanine.atacar(poliwag);
System.out.println("\n POLIWAG ATACA: ");
poliwag.atacar(arcanine);
System.out.println("\n POLIWAG ATACA: ");
poliwag.atacar(arcanine);
System.out.println("\n");
arcanine.evolucionar("ProArcanine");
}
}
|
[
"noreply@github.com"
] |
RONALDPA.noreply@github.com
|
646ea080aebc3fe34c80cb6a100ea2ec17cbc157
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/9/9_a8b6587748158ecc773602a60e4450d6996edf34/AbstractNPC/9_a8b6587748158ecc773602a60e4450d6996edf34_AbstractNPC_s.java
|
f1086b371b6fbd0ee339bb356c5ff29bb9b71084
|
[] |
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
| 11,342
|
java
|
package net.citizensnpcs.api.npc;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.ai.GoalController;
import net.citizensnpcs.api.ai.SimpleGoalController;
import net.citizensnpcs.api.ai.speech.SimpleSpeechController;
import net.citizensnpcs.api.ai.speech.SpeechController;
import net.citizensnpcs.api.event.DespawnReason;
import net.citizensnpcs.api.event.NPCAddTraitEvent;
import net.citizensnpcs.api.event.NPCRemoveEvent;
import net.citizensnpcs.api.event.NPCRemoveTraitEvent;
import net.citizensnpcs.api.persistence.PersistenceLoader;
import net.citizensnpcs.api.trait.Trait;
import net.citizensnpcs.api.trait.trait.MobType;
import net.citizensnpcs.api.trait.trait.Speech;
import net.citizensnpcs.api.util.DataKey;
import net.citizensnpcs.api.util.MemoryDataKey;
import net.citizensnpcs.api.util.Messaging;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.HandlerList;
import org.bukkit.metadata.FixedMetadataValue;
import com.google.common.base.Function;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
public abstract class AbstractNPC implements NPC {
private final GoalController goalController = new SimpleGoalController();
private final int id;
protected final MetadataStore metadata = new SimpleMetadataStore() {
@Override
public void remove(String key) {
super.remove(key);
if (getBukkitEntity() != null)
getBukkitEntity().removeMetadata(key, CitizensAPI.getPlugin());
}
@Override
public void set(String key, Object data) {
super.set(key, data);
if (getBukkitEntity() != null)
getBukkitEntity().setMetadata(key, new FixedMetadataValue(CitizensAPI.getPlugin(), data));
}
@Override
public void setPersistent(String key, Object data) {
super.setPersistent(key, data);
if (getBukkitEntity() != null)
getBukkitEntity().setMetadata(key, new FixedMetadataValue(CitizensAPI.getPlugin(), data));
}
};
private String name;
private final List<String> removedTraits = Lists.newArrayList();
protected final List<Runnable> runnables = Lists.newArrayList();
private final SpeechController speechController = new SimpleSpeechController(this);
protected final Map<Class<? extends Trait>, Trait> traits = Maps.newHashMap();
protected AbstractNPC(int id, String name) {
if (name.length() > 16) {
Messaging.severe("ID", id, "created with name length greater than 16, truncating", name, "to",
name.substring(0, 15));
name = name.substring(0, 15);
}
this.id = id;
this.name = name;
addTrait(MobType.class);
}
@Override
public void addTrait(Class<? extends Trait> clazz) {
addTrait(getTraitFor(clazz));
}
@Override
public void addTrait(Trait trait) {
if (trait == null) {
Messaging.severe("Cannot register a null trait. Was it registered properly?");
return;
}
if (trait.getNPC() == null) {
trait.linkToNPC(this);
}
// if an existing trait is being replaced, we need to remove the
// currently registered runnable to avoid conflicts
Trait replaced = traits.get(trait.getClass());
Bukkit.getPluginManager().registerEvents(trait, CitizensAPI.getPlugin());
traits.put(trait.getClass(), trait);
if (isSpawned())
trait.onSpawn();
if (trait.isRunImplemented()) {
if (replaced != null)
runnables.remove(replaced);
runnables.add(trait);
}
Bukkit.getPluginManager().callEvent(new NPCAddTraitEvent(this, trait));
}
@Override
public NPC clone() {
NPC copy = CitizensAPI.getNPCRegistry().createNPC(getTrait(MobType.class).getType(), getFullName());
DataKey key = new MemoryDataKey();
this.save(key);
copy.load(key);
for (Trait trait : copy.getTraits()) {
trait.onCopy();
}
return copy;
}
@Override
public MetadataStore data() {
return this.metadata;
}
@Override
public boolean despawn() {
return despawn(DespawnReason.PLUGIN);
}
@Override
public void destroy() {
Bukkit.getPluginManager().callEvent(new NPCRemoveEvent(this));
runnables.clear();
for (Trait trait : traits.values()) {
HandlerList.unregisterAll(trait);
trait.onRemove();
}
traits.clear();
CitizensAPI.getNPCRegistry().deregister(this);
}
@Override
public GoalController getDefaultGoalController() {
return goalController;
}
@Override
public SpeechController getDefaultSpeechController() {
// TODO: Remove in future versions.
// This is here to add the Speech trait to any existing NPCs
// that were created pre-SpeechController, if invoked.
if (!hasTrait(Speech.class))
addTrait(Speech.class);
return speechController;
}
@Override
public String getFullName() {
return name;
}
@Override
public int getId() {
return id;
}
@Override
public String getName() {
String parsed = name;
for (ChatColor color : ChatColor.values())
if (parsed.contains("<" + color.getChar() + ">"))
parsed = parsed.replace("<" + color.getChar() + ">", "");
return parsed;
}
@Override
public <T extends Trait> T getTrait(Class<T> clazz) {
Trait trait = traits.get(clazz);
if (trait == null) {
trait = getTraitFor(clazz);
addTrait(trait);
}
return trait != null ? clazz.cast(trait) : null;
}
protected Trait getTraitFor(Class<? extends Trait> clazz) {
return CitizensAPI.getTraitFactory().getTrait(clazz);
}
@Override
public Iterable<Trait> getTraits() {
return traits.values();
}
@Override
public boolean hasTrait(Class<? extends Trait> trait) {
return traits.containsKey(trait);
}
@Override
public boolean isProtected() {
return data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
}
@Override
public void load(final DataKey root) {
metadata.loadFrom(root.getRelative("metadata"));
// Load traits
String traitNames = root.getString("traitnames");
Set<DataKey> keys = Sets.newHashSet(root.getRelative("traits").getSubKeys());
Iterables.addAll(keys, Iterables.transform(Splitter.on(',').split(traitNames), new Function<String, DataKey>() {
@Override
public DataKey apply(@Nullable String input) {
return root.getRelative("traits." + input);
}
}));
for (DataKey traitKey : keys) {
if (traitKey.keyExists("enabled") && !traitKey.getBoolean("enabled")
&& traitKey.getRaw("enabled") instanceof Boolean) {
// avoid YAML coercing map existence to boolean
continue;
}
Class<? extends Trait> clazz = CitizensAPI.getTraitFactory().getTraitClass(traitKey.name());
Trait trait;
if (hasTrait(clazz)) {
trait = getTrait(clazz);
loadTrait(trait, traitKey);
} else {
trait = CitizensAPI.getTraitFactory().getTrait(clazz);
if (trait == null) {
Messaging.severeTr("citizens.notifications.trait-load-failed", traitKey.name(), getId());
continue;
}
loadTrait(trait, traitKey);
addTrait(trait);
}
}
}
private void loadTrait(Trait trait, DataKey traitKey) {
try {
trait.load(traitKey);
PersistenceLoader.load(trait, traitKey);
} catch (Throwable ex) {
Messaging.logTr("citizens.notifications.trait-load-failed", traitKey.name(), getId());
}
}
@Override
public void removeTrait(Class<? extends Trait> traitClass) {
Trait trait = traits.remove(traitClass);
if (trait != null) {
Bukkit.getPluginManager().callEvent(new NPCRemoveTraitEvent(this, trait));
removedTraits.add(trait.getName());
if (trait.isRunImplemented())
runnables.remove(trait);
HandlerList.unregisterAll(trait);
trait.onRemove();
}
}
@Override
public void save(DataKey root) {
metadata.saveTo(root.getRelative("metadata"));
root.setString("name", getFullName());
// Save all existing traits
StringBuilder traitNames = new StringBuilder();
for (Trait trait : traits.values()) {
DataKey traitKey = root.getRelative("traits." + trait.getName());
trait.save(traitKey);
PersistenceLoader.save(trait, traitKey);
removedTraits.remove(trait.getName());
traitNames.append(trait.getName() + ",");
}
if (traitNames.length() > 0) {
root.setString("traitnames", traitNames.substring(0, traitNames.length() - 1));
} else
root.setString("traitnames", "");
for (String name : removedTraits) {
root.removeKey("traits." + name);
}
removedTraits.clear();
}
@Override
public void setName(String name) {
this.name = name;
if (!isSpawned())
return;
LivingEntity bukkitEntity = getBukkitEntity();
bukkitEntity.setCustomName(getFullName());
if (bukkitEntity.getType() == EntityType.PLAYER) {
Location old = bukkitEntity.getLocation();
despawn(DespawnReason.PENDING_RESPAWN);
spawn(old);
}
}
@Override
public void setProtected(boolean isProtected) {
data().setPersistent(NPC.DEFAULT_PROTECTED_METADATA, isProtected);
}
public void update() {
for (int i = 0; i < runnables.size(); ++i) {
runnables.get(i).run();
}
if (isSpawned()) {
goalController.run();
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
490f2b0293b3bdd88a6724b2b9e58a193c415b0d
|
55f518a56976bdc2c84dc221874ed7dfc0eb04f5
|
/src/main/java/org/embulk/input/marketo/MarketoService.java
|
04da12f1a5080abc59a2ac2929e4a2e4ae41af68
|
[
"MIT"
] |
permissive
|
biyanna1985/embulk-input-marketo
|
8dfeee2eb52655e34eb2422e9636a317f0b69357
|
eefac2f80ae68d3fc3f482dd6c71a3c71164fe05
|
refs/heads/master
| 2020-03-25T19:15:28.901369
| 2018-05-28T15:59:33
| 2018-05-28T15:59:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 789
|
java
|
package org.embulk.input.marketo;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.embulk.input.marketo.model.MarketoField;
import java.io.File;
import java.util.Date;
import java.util.List;
/**
* Created by tai.khuu on 9/6/17.
*/
public interface MarketoService
{
List<MarketoField> describeLead();
File extractLead(Date startTime, Date endTime, List<String> extractedFields, String filterField, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond);
File extractAllActivity(Date startTime, Date endTime, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond);
Iterable<ObjectNode> getAllListLead(List<String> extractFields);
Iterable<ObjectNode> getAllProgramLead(List<String> extractFields);
Iterable<ObjectNode> getCampaign();
}
|
[
"khuutantai@gmail.com"
] |
khuutantai@gmail.com
|
b208a1682ded1d5b7c4a5a405daf19f0affe50e7
|
8552a3dee9193ceca22f83aca9655332a34adf56
|
/Cloud_Storage/src/index/Repo_Upload.java
|
be0126c36bb29988af06ec0f7583a42c48344874
|
[] |
no_license
|
sharmarahul25/Cloud_storage
|
e8e79efa2c1a6f2b87275325218d3b8d1ef6a469
|
74d9fbacbc4ef7abc3264650380aa6c024683b0e
|
refs/heads/master
| 2021-01-23T06:39:31.201691
| 2014-03-21T10:25:33
| 2014-03-21T10:25:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,740
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package index;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.Font;
import java.io.File;
import java.io.IOException;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.net.ftp.FTPClient;
/**
*
*
*/
public class Repo_Upload {
JFrame f1=new JFrame("Upload in Repesitory");
JLabel l1=new JLabel("Name");
JLabel l2=new JLabel("Type");
JLabel l3=new JLabel("Subject");
JLabel l4=new JLabel("Browse");
JLabel l5=new JLabel("Share with");
String sub[] = {"DAA","OS","ELE","DSA","OOM","OOT","NETWORKING","EWS","DBMS","CCS","DCO"};
String type[] = {"Codes","Assingments","Notes","PPTs","Others"};
JTextField t1=new JTextField();
JComboBox t2=new JComboBox(type);
JComboBox t3=new JComboBox(sub);
JTextField t4=new JTextField();
JComboBox t5=new JComboBox();
JButton b4=new JButton("Browse");
JButton bu=new JButton("Upload");
String path1,path2,str,ex=null,name=null;
String s1="ftp://172.16.1.1/Upload/";
String id,ss1,ss2,ss3,ss4,ss5,ss6,ss7;
int il,il1,cc=0;
String ad;
Statement stat;
ResultSet rs;
public Repo_Upload(String admin){
ad=admin;
Container content = f1.getContentPane();
content.setBackground(Color.WHITE);
f1.setIconImage(Toolkit.getDefaultToolkit().getImage("logo.jpg"));
f1.setBounds(100,100,800,600);
f1.setLayout(null);
l1.setBounds(20,20,100,30);
t1.setBounds(120,20,400,30);
l2.setBounds(20,60,100,30);
t2.setBounds(120,60,200,30);
l3.setBounds(20,110,100,30);
t3.setBounds(120,110,200,30);
l4.setBounds(20,150,100,30);
t4.setBounds(120,150,400,30);
l5.setBounds(20,200,100,30);
t5.setBounds(120,200,150,30);
b4.setBounds(540,150,100,30);
bu.setBounds(250,240,200,40);
//
connection con1=new connection();
con1.createconnectn();
String s;
try
{
stat = con1.con.createStatement();
//s=group.getText();
rs=stat.executeQuery("select grp_name from groupmem where(mem_id='"+ad+"')");
}
catch (SQLException fe)
{
System.err.println("actionpermd(): SQLException: " + fe.getMessage());
}
try
{
int c=0;
String pa=null;
t5.addItem("Public");
while(rs.next())
{
pa=rs.getString("grp_name");
if(pa!=null)
{
t5.addItem(pa);
}
}
}
catch (SQLException fe)
{
System.err.println("actionpermd(): SQLException: " + fe.getMessage());
}
//}
//
b4.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(null);
File f = chooser.getSelectedFile();
path1 = f.getPath();
t4.setText(path1);
}
});
bu.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
FTPClient f=new FTPClient();
FTPUtils u=new FTPUtils();
try {
u.ftpConnect(f,"172.16.1.1","anonymous","");
System.out.println("logged in");
} catch (IOException ex) {
Logger.getLogger(Movies_Upload.class.getName()).log(Level.SEVERE, null, ex);
}
id=ad+System.currentTimeMillis();
path1=t4.getText();
if(!"".equals(path1))
{ cc=0;
for(il=path1.length()-1;il>=0;il--)
{
if(path1.charAt(il)=='.')
break;
}
ex=path1.substring(il,path1.length());
}
else
{JOptionPane.showMessageDialog(null,"Select file");
cc=1;
}
ss5=t1.getText();
if("".equals(ss5))
{
cc=1;
JOptionPane.showMessageDialog(null,"Enter file Name");
}
try {
if(cc!=1)
{
u.uploadFile(f,path1,s1,id+ex);
JOptionPane.showMessageDialog(null,"File Uploaded");
}
//System.out.println("logged in");
} catch (IOException ex) {
Logger.getLogger(Movies_Upload.class.getName()).log(Level.SEVERE, null, ex);
}
connection con1=new connection();
con1.createconnectn();
try
{
stat = con1.con.createStatement();
ss1=t1.getText();
ss2=(String)t2.getSelectedItem();
ss3=(String)t3.getSelectedItem();
ss4=s1+id+ex;
ss5=(String)t5.getSelectedItem();
if(cc!=1)
rs=stat.executeQuery("insert into Repo values('"+id+"','"+ss1+"','"+ss2+"','"+ss3+"','"+ss4+"','"+ss5+"')");
}
catch (SQLException fe)
{
System.err.println("actionpermd(): SQLException: " + fe.getMessage());
}
id=null;
ss6=null;
ss7=null;
s1="ftp://172.16.1.1/Repository/";
}
});
//
f1.add(l1);
f1.add(l2);
f1.add(l3);
f1.add(l4);
f1.add(t1);
f1.add(t2);
f1.add(t3);
f1.add(l5);
f1.add(t5);
f1.add(t4);
f1.add(b4);
f1.add(bu);
f1.setVisible(true);
}
}
|
[
"sharma.rahul2509@gmail.com"
] |
sharma.rahul2509@gmail.com
|
6e8ecfe6cf2bed7cdcafd3534318a45e068184e3
|
c5b7ac300801614f5d6694f5973e0c5184e20f84
|
/ExJava/Frutas/src/Frutas.java
|
bc33fc8d4972bf013452df85ce984aef0b9a04cb
|
[] |
no_license
|
1234Vinicius/Java-Concept
|
b32e12e3f2d3aeda4c49afbcb0af876b6e891294
|
b69428e2dab11bf3998dd6742660fb0d54a77848
|
refs/heads/main
| 2023-08-18T19:36:30.808252
| 2021-10-06T15:31:18
| 2021-10-06T15:31:18
| 413,631,012
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 150
|
java
|
public class Frutas {
private String carro;
private String modelo;
private boolean anda;
}
}
|
[
"99887799vinicius@gmail.com"
] |
99887799vinicius@gmail.com
|
3c3eeb3e9e9ab6d9c75fab7ba1735e3ef1619fb0
|
37af4fa993a86b4cbc00486acc72adb4eff1225f
|
/iorx/src/main/java/ubiquisense/iorx/protocols/ableton/internal/impl/LiveReturnVolumeImpl.java
|
dd08c234cfb919325615285fdaf820e84c001874
|
[] |
no_license
|
lucascraft/iorx
|
3880a6cfb990d61bf4e506424f5ea1a59f3085e3
|
d94fcbe57677b420b49e968c859aa766c014e9b9
|
refs/heads/master
| 2021-07-22T18:58:13.396550
| 2019-12-02T22:42:35
| 2019-12-02T22:42:35
| 119,903,510
| 0
| 0
| null | 2021-06-04T01:01:22
| 2018-02-01T22:52:37
|
HTML
|
UTF-8
|
Java
| false
| false
| 606
|
java
|
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package ubiquisense.iorx.protocols.ableton.internal.impl;
import ubiquisense.iorx.protocols.ableton.internal.LiveReturnVolume;
public class LiveReturnVolumeImpl extends AbletonLiveSndCmdImpl implements LiveReturnVolume {
int trackID;
float level;
public LiveReturnVolumeImpl() {
super();
}
public int getTrackID() {
return trackID;
}
public void setTrackID(int newTrackID) {
trackID = newTrackID;
}
public float getLevel() {
return level;
}
public void setLevel(float newLevel) {
level = newLevel;
}
} //LiveReturnVolumeImpl
|
[
"lucas@LAPTOP-2SKH5AVA"
] |
lucas@LAPTOP-2SKH5AVA
|
1bab62ee60b8c54bb1e8b0ef39e9795aafef072e
|
61bb0909755750788322b41c7763bd06993e4add
|
/src/monitorizacionInversa/Services.java
|
1c1df94405b261e9f1c72554598d9e5a547e270f
|
[] |
no_license
|
rvipas/servidorXML-RCP
|
d657cae48a2a8e5339a587c14198a1008131440b
|
77d0a1a852000e766c189725cca1d94c93728264
|
refs/heads/master
| 2021-01-23T01:01:53.720796
| 2017-03-22T19:07:04
| 2017-03-22T19:07:04
| 85,865,871
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 183
|
java
|
package monitorizacionInversa;
import java.util.Date;
public interface Services {
public void notifica(String msg);
public boolean inserta(String ident, Date fecha);
}
|
[
"rvidal8.7@gmail.com"
] |
rvidal8.7@gmail.com
|
a794dbeb363b03b1a2699e5524a05e53356e0617
|
f2bd083ebc26faa924f563f3db5685e75ef93f71
|
/tddl-group/src/main/java/com/taobao/tddl/group/exception/TAtomDataSourceException.java
|
5f74e45ce4dd20806878d38fbdbd7a84d232202e
|
[
"Apache-2.0"
] |
permissive
|
hejianzxl/TDDL-1
|
bf942c10d8e42d4a8f3e3eadb0c262fcaa03f299
|
33ab99c37ae8b927f1cd3294d1ec8aa31b71c84b
|
refs/heads/master
| 2022-07-01T08:56:47.798878
| 2015-08-18T02:55:16
| 2015-08-18T02:55:16
| 144,922,536
| 0
| 0
|
Apache-2.0
| 2022-06-21T04:20:21
| 2018-08-16T01:48:15
|
Java
|
UTF-8
|
Java
| false
| false
| 657
|
java
|
package com.taobao.tddl.group.exception;
//jdk1.5 java.sql.SQLException没有带Throwable cause的构造函数
//public class TAtomDataSourceException extends java.sql.SQLException {
/**
* @author yangzhu
*/
public class TAtomDataSourceException extends RuntimeException {
private static final long serialVersionUID = -1L;
public TAtomDataSourceException(){
super();
}
public TAtomDataSourceException(String msg){
super(msg);
}
public TAtomDataSourceException(Throwable cause){
super(cause);
}
public TAtomDataSourceException(String msg, Throwable cause){
super(msg, cause);
}
}
|
[
"mengshi.sunmengshi@taobao.com"
] |
mengshi.sunmengshi@taobao.com
|
62e7cc6337d94be95de5e859317c2945f3a9dc1e
|
1bbd2e653317da390af5ba7eace7109bd52895fa
|
/src/com/company/ProductsInRow.java
|
82ddbd4680fbd084175ffc9bc2ba35e474e17823
|
[] |
no_license
|
xchoavagyan/Vending_Machine
|
5e4455545a29d9e1f7d7b4952a4638412a88a3a1
|
e9c1a8f231a98623fe466a543f67f7029ae129c6
|
refs/heads/master
| 2020-12-26T06:20:22.164116
| 2020-01-31T11:47:28
| 2020-01-31T11:47:28
| 237,415,270
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,823
|
java
|
package com.company;
import com.company.products.Product;
import java.util.ArrayList;
public class ProductsInRow {
//region Properties
private ArrayList<ProductList> productListsInRow;
//endregion
//region Constructors
public ProductsInRow(Product product1, Product product2, Product product3) {
makeProductsRow(product1, product2, product3);
}
//endregion
//region public Methods
private ArrayList<ProductList> makeProductsRow(Product product1, Product product2, Product product3) {
this.productListsInRow = new ArrayList<ProductList>();
this.productListsInRow.add(new ProductList(product1));
this.productListsInRow.add(new ProductList(product2));
this.productListsInRow.add(new ProductList(product3));
return productListsInRow;
}
//endregion
//region Getters and Setters
public ArrayList<ProductList> getProductListsInRow() {
return productListsInRow;
}
public void setProductListsInRow(ArrayList<ProductList> productListsInRow) {
this.productListsInRow = productListsInRow;
}
//endregion
//region Equals HashCode toString
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ProductsInRow that = (ProductsInRow) o;
return productListsInRow != null ? productListsInRow.equals(that.productListsInRow) : that.productListsInRow == null;
}
@Override
public int hashCode() {
return productListsInRow != null ? productListsInRow.hashCode() : 0;
}
@Override
public String toString() {
return "ProductsInRow{" +
"productListsInRow=" + productListsInRow +
'}';
}
//endregion
}
|
[
"khchoavagyan@gmail.com"
] |
khchoavagyan@gmail.com
|
52267103681e7c602f5609378cdb5e188acfb5ac
|
c45face9d2d8944110ab56ecaa14a80e84d448a1
|
/src/main/java/com/phei/netty/basic/TimeServerHandler.java
|
9fb3c3f61ce71a467f254126b8288d5b5761e723
|
[] |
no_license
|
nquanhao001/netty-in-action
|
7d7ea579c5a19be2270a659ad6b89d072dcb1380
|
2e497496ca5b5173763565c5386a490810160769
|
refs/heads/master
| 2021-01-01T03:39:24.656178
| 2016-09-19T07:37:59
| 2016-09-19T07:37:59
| 56,896,743
| 5
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,242
|
java
|
/*
* Copyright 2012 The Netty Project
*
* The Netty Project 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 com.phei.netty.basic;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
/**
* @author lilinfeng
* @version 1.0
* @date 2014年2月14日
*/
public class TimeServerHandler extends ChannelHandlerAdapter {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg)
throws Exception {
ByteBuf buf = (ByteBuf) msg;
int count = buf.readableBytes();//获取缓冲区可读的字节数
byte[] req = new byte[count];
buf.readBytes(req);//把缓冲区的字节数组复制到新建的req数组
String body = new String(req, "UTF-8");
System.out.println("The time server receive order : " + body);
String currentTime = "QUERY TIME ORDER".equalsIgnoreCase(body) ? new java.util.Date(
System.currentTimeMillis()).toString() : "BAD ORDER";
ByteBuf resp = Unpooled.copiedBuffer(currentTime.getBytes());
ctx.write(resp);//为了防止频繁唤醒Selector进行消息发送,write方法并不直接将消息写入SocketChannel中,调用write方法只是把待发送消息放到发送缓冲数组中,flus才会把缓冲区数据写到scoketChannel中
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
ctx.flush();//把消息发送队列中的消息写入到socketChannel中发送出去
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
ctx.close();
}
}
|
[
"407361943@qq.com"
] |
407361943@qq.com
|
3a6cc911fa5d2e2811a5faa2f984fa3dc2ec9fad
|
3c171b3e1a68fadc2883ca41a2d1083484a4f6f4
|
/GraphCaculor/src/yty.java
|
ea0e12049104f0ca44fe096d8af9485e9d8c5e89
|
[] |
no_license
|
1xwb/nihao
|
a35a4628351d8b6818d33555f3203fffdd1995e1
|
0042aaf044832f4f432fcfd4face7cfecebd526b
|
refs/heads/master
| 2020-05-15T22:13:08.290439
| 2019-04-21T11:12:47
| 2019-04-21T11:12:47
| 182,521,007
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 37
|
java
|
public class yty {
//你好
}
|
[
"1053968252@qq.com"
] |
1053968252@qq.com
|
83a4dd15a3c08450a26ff50fbcab01a0fc89425d
|
d43a62d1af37d378d9d88bed16568214a923f2cf
|
/portal/src/main/java/usi/dbdp/portal/sysmgr/controller/LogController.java
|
3d44461d7bc1deefbafe92e96bfe10245da202b2
|
[
"MIT"
] |
permissive
|
pyplzy/mylab
|
2a9d11763b483a7899152a336420a415cb6c570c
|
c3a897f217d871f3d66e15d0ebbc3325a4ec8910
|
refs/heads/master
| 2023-06-08T16:05:13.904405
| 2021-06-29T10:33:21
| 2021-06-29T10:33:21
| 290,156,687
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,051
|
java
|
package usi.dbdp.portal.sysmgr.controller;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import usi.dbdp.portal.dto.ChangeLogInfo;
import usi.dbdp.portal.entity.LoginLog;
import usi.dbdp.portal.sysmgr.service.LogService;
import usi.dbdp.portal.util.CommonUtil;
import usi.dbdp.uic.dto.PageObj;
/**
* 登录日志和信息变更日志查询
* @author lmwang
* 创建时间:2015-4-16 下午9:09:22
*/
@Controller
@RequestMapping("/log")
public class LogController {
@Resource
private LogService logService;
/**
* 到日志查询页面
* @param model
* @return
*/
@RequestMapping(value="/menu_to_toMenu.do", method = RequestMethod.GET)
public String toMenu(Model model){
//日期输入框默认今天
model.addAttribute("today", CommonUtil.format(new Date(), "yyyy-MM-dd"));
model.addAttribute("todayStart", CommonUtil.format(new Date(), "yyyy-MM-dd")+" 00:00:00");
model.addAttribute("todayEnd", CommonUtil.format(new Date(), "yyyy-MM-dd")+" 23:59:59");
return "portal/system/logQuery";
}
/**
* 查询登录日志
* @param loginLog 登录日志
* @param pageObj
* @return
*/
@RequestMapping(value="/menu_to_getLoginLogs.do", method = RequestMethod.POST)
@ResponseBody
public Map<String , Object > getLoginLog(LoginLog loginLog ,PageObj pageObj){
return logService.getUicLoginLogInfo(loginLog, pageObj);
}
/**
* 查询信息变更日志
* @param changeLogInfo 信息变更日志dto
* @param pageObj 分页对象
* @return
*/
@RequestMapping(value="/menu_to_getChgLogs.do", method = RequestMethod.POST)
@ResponseBody
public Map<String , Object > getChangeLog(ChangeLogInfo changeLogInfo, PageObj pageObj){
return logService.getUicChangeLogInfo(changeLogInfo, pageObj);
}
}
|
[
"peiyapengqinshuche@163.com"
] |
peiyapengqinshuche@163.com
|
f653574d868288835dbd21a90cf136183eef1e5d
|
6476f66243ec0d4259de3a2fde69e89c45c7f880
|
/src/day07nestedif/NestedIf01.java
|
aaaddcafbe9c533eca7d6d86b30a15d902cd8544
|
[] |
no_license
|
osaykan/dersler
|
94ddb286554fbbfd1d8ffc48bea3cf030041ed1b
|
90f5f306e0e58cb4b66468e2abf76169a42d980c
|
refs/heads/main
| 2023-04-05T05:06:44.608832
| 2021-04-17T12:17:55
| 2021-04-17T12:17:55
| 289,004,960
| 0
| 0
| null | null | null | null |
ISO-8859-3
|
Java
| false
| false
| 924
|
java
|
package day07nestedif;
import java.util.Scanner;
public class NestedIf01 {
public static void main(String[] args) {
// Kullanicidan bir sayi alin. Bu sayi pozitif ise 9 dan buyukmu diye kontrol rdin, 9 dan büyükse ekrana sayi yazdirin
// 9 dan kücükesit ve sifirdan büyük esitse ekrana rakam yazdirin.
// Bu sayi negatif ise ekrana Sayi yazdirin.
Scanner scan = new Scanner(System.in);
System.out.println("Bir Tamsayi giriniz");
int num = scan.nextInt();
if(num>=0){ // Outer if
if(num>9){ // Inner if
System.out.println("Sayi");
}
else if(num<=9 && num>=0){
System.out.println("Rakam");
}
}
else if(num<0){
System.out.println("Sayi");
}
scan.close();//Scanner class ini kullandiktan sonra en alta main metodunun icinde Scanner class ini kapatiniz. Bunun icin scan.close yazilir.
}
}
|
[
"osmanaykan34@gmail.com"
] |
osmanaykan34@gmail.com
|
e771270cbd142c44c64bf287323a9dc6c0f7235b
|
c3f860040de95cd91e9c5f54175a0eccc7d9a520
|
/Prova/app/src/main/java/simulado/jeansarlon/prova/tela2.java
|
598e33525e51d6fb282854f85730362167e68ccf
|
[] |
no_license
|
jeansarlon/Android
|
a1fedc7cc77b5dc4813f5455aee4dcbfc5092b18
|
fde99536a36d201be2c6a7dead65572343ba562d
|
refs/heads/master
| 2021-05-08T00:53:58.472856
| 2017-10-22T00:05:51
| 2017-10-22T00:05:51
| 107,824,722
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,226
|
java
|
package simulado.jeansarlon.prova;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
public class tela2 extends AppCompatActivity {
private static final String NOME_PREFS = "preferencias";
TextView tvNome;
TextView tvEmail;
ImageView ivTime;
Button btSalvar;
Button btFechar;
String nome;
String email;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tela2);
tvNome = (TextView) findViewById(R.id.tvNome);
tvEmail = (TextView) findViewById(R.id.tvEmail);
ivTime = (ImageView) findViewById(R.id.ivFoto);
btSalvar = (Button) findViewById(R.id.btSalvar);
btFechar = (Button) findViewById(R.id.btFechar);
final Bundle extras = getIntent().getExtras();
if (extras != null){
nome = extras.getString("nome", "Não veio");
email = extras.getString("email", "Não veio");
int time = extras.getInt("time", 0);
tvNome.setText(nome);
tvEmail.setText(email);
if (time == 1) {
ivTime.setImageResource(R.drawable.gremio);
}else{
ivTime.setImageResource(R.drawable.inter);
}
}
btSalvar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences prefs = getSharedPreferences(NOME_PREFS, 0);
SharedPreferences.Editor editor = (prefs).edit();
editor.putString("nome", nome);
editor.putString("email", email);
editor.commit();
Toast.makeText(tela2.this, "Salvo!!", Toast.LENGTH_SHORT).show();
}
});
btFechar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
|
[
"jean.sarlon@icloud.com"
] |
jean.sarlon@icloud.com
|
faf53a868c41cd0ccd630aaa292e1b05a9a8d6b4
|
5ec06dab1409d790496ce082dacb321392b32fe9
|
/clients/spring/generated/src/main/java/org/openapitools/model/ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.java
|
8ae8a2b0f7986254dc20af7221d187901eeaf6a0
|
[
"Apache-2.0"
] |
permissive
|
shinesolutions/swagger-aem-osgi
|
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
|
c2f6e076971d2592c1cbd3f70695c679e807396b
|
refs/heads/master
| 2022-10-29T13:07:40.422092
| 2021-04-09T07:46:03
| 2021-04-09T07:46:03
| 190,217,155
| 3
| 3
|
Apache-2.0
| 2022-10-05T03:26:20
| 2019-06-04T14:23:28
| null |
UTF-8
|
Java
| false
| false
| 4,336
|
java
|
package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-08-05T01:13:37.880Z[GMT]")
public class ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo {
@JsonProperty("pid")
private String pid = null;
@JsonProperty("title")
private String title = null;
@JsonProperty("description")
private String description = null;
@JsonProperty("properties")
private ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties properties = null;
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo pid(String pid) {
this.pid = pid;
return this;
}
/**
* Get pid
* @return pid
**/
@ApiModelProperty(value = "")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo title(String title) {
this.title = title;
return this;
}
/**
* Get title
* @return title
**/
@ApiModelProperty(value = "")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
**/
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo properties(ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties properties) {
this.properties = properties;
return this;
}
/**
* Get properties
* @return properties
**/
@ApiModelProperty(value = "")
@Valid
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties getProperties() {
return properties;
}
public void setProperties(ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo = (ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo) o;
return Objects.equals(this.pid, comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.pid) &&
Objects.equals(this.title, comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.title) &&
Objects.equals(this.description, comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.description) &&
Objects.equals(this.properties, comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"cliffano@gmail.com"
] |
cliffano@gmail.com
|
8bae1ef5102e3d64b3580d7a0edbb40971660f2e
|
9d6c509a96239a642d4893f7276a9b510cbd8d00
|
/src/main/java/com/github/onsdigital/index/enrichment/model/request/EnrichResourceRequest.java
|
c51f47fee24cdbb9bbab0238b6d3841f3b5b1f86
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] |
permissive
|
ONSdigital/dp-publish-enrich-search
|
8efe2171a3f8430a0f500493adad9d4d96f259bf
|
42211173b683d81eba4af77c5c0df31cf948d748
|
refs/heads/develop
| 2021-01-09T05:46:58.733548
| 2017-02-20T13:43:33
| 2017-02-20T13:43:33
| 80,831,753
| 2
| 1
| null | 2019-08-18T11:27:27
| 2017-02-03T13:32:59
|
Java
|
UTF-8
|
Java
| false
| false
| 1,504
|
java
|
package com.github.onsdigital.index.enrichment.model.request;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
* Request the enrichment of a document based on a file resource
*/
public class EnrichResourceRequest implements PipelineRequest {
private String s3Location;
private String fileLocation;
public String getS3Location() {
return s3Location;
}
public EnrichResourceRequest setS3Location(final String s3Location) {
this.s3Location = s3Location;
return this;
}
public String getFileLocation() {
return fileLocation;
}
public EnrichResourceRequest setFileLocation(final String fileLocation) {
this.fileLocation = fileLocation;
return this;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final EnrichResourceRequest that = (EnrichResourceRequest) o;
return new EqualsBuilder()
.append(getS3Location(), that.getS3Location())
.append(getFileLocation(), that.getFileLocation())
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(getS3Location())
.append(getFileLocation())
.toHashCode();
}
}
|
[
"james.fawke@g4pas.co.uk"
] |
james.fawke@g4pas.co.uk
|
e1467c641daf3d30a70263569185be558dc70b88
|
1275b896a8fece1603fee1556238fee870385fe4
|
/src/net/scapeemulator/game/msg/handler/item/GroundItemOptionMessageHandler.java
|
32ab5ba7fe2def610feb2a844fb2515de7286515
|
[
"ISC"
] |
permissive
|
Ashi/moparscape530
|
ca02dfa8f0a4c111fe086b22536129c99f8748df
|
b473826481b1fcf7e7f09aa3ad50ac8c48bf70ca
|
refs/heads/master
| 2021-01-21T18:50:41.512604
| 2014-10-05T20:57:39
| 2014-10-05T20:57:39
| 27,652,156
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,047
|
java
|
/**
* Copyright (c) 2012, Hadyn Richard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package net.scapeemulator.game.msg.handler.item;
import net.scapeemulator.game.dispatcher.grounditem.GroundItemDispatcher;
import net.scapeemulator.game.model.Position;
import net.scapeemulator.game.model.player.Player;
import net.scapeemulator.game.msg.MessageHandler;
import net.scapeemulator.game.msg.impl.grounditem.GroundItemOptionMessage;
/**
* Created by Hadyn Richard
*/
public final class GroundItemOptionMessageHandler extends MessageHandler<GroundItemOptionMessage> {
private final GroundItemDispatcher dispatcher;
public GroundItemOptionMessageHandler(GroundItemDispatcher dispatcher) {
this.dispatcher = dispatcher;
}
@Override
public void handle(Player player, GroundItemOptionMessage message) {
dispatcher.handle(player, message.getId(), new Position(message.getX(), message.getY()), message.getOption());
}
}
|
[
"davidtheinsley@comcast.net"
] |
davidtheinsley@comcast.net
|
d023f044bbc565276d15cdeff120ed687903f77b
|
5941aa98b0cb69dc6d8ec7cdff0fc86d96c7d213
|
/app/src/main/java/vision/genesis/ui/UiComponent.java
|
b3b537cf4f340b76b811d9a4a44bff4ddd3ce833
|
[] |
no_license
|
SergeiVasilenko/borrow-friend-android
|
e4a63c42d95a0697c30a081e04e9b55b2b0e1a22
|
68f0fe87fb9c1517d78417a408b2830285423879
|
refs/heads/master
| 2021-01-20T03:53:47.113647
| 2017-04-27T14:01:56
| 2017-04-27T14:01:56
| 89,603,812
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,054
|
java
|
package vision.genesis.ui;
import dagger.Subcomponent;
import vision.genesis.ui.auth.AuthActivity;
import vision.genesis.ui.common.BaseActivity;
import vision.genesis.ui.insert.InsertActivity;
import vision.genesis.ui.main.MainActivity;
import vision.genesis.ui.main.dashboard.DashboardPresenter;
import vision.genesis.ui.main.loan.AskListPresenter;
import vision.genesis.ui.main.loan.OfferListPresenter;
import vision.genesis.ui.order.DealActivity;
import vision.genesis.ui.order.HeaderPresenter;
@UiScope
@Subcomponent
public interface UiComponent {
void injectToBaseActivity(BaseActivity activity);
void inject(MainActivity activity);
void inject(AuthActivity authActivity);
void inject(OfferListPresenter offerListPresenter);
void inject(AskListPresenter askListPresenter);
void inject(InsertActivity insertActivity);
void inject(DealActivity dealActivity);
void inject(HeaderPresenter headerPresenter);
void inject(DashboardPresenter presenter);
@Subcomponent.Builder
interface UiComponentBuilder {
UiComponent build();
}
}
|
[
"vasilenko.sn@gmail.com"
] |
vasilenko.sn@gmail.com
|
4b256f8fe4ce51ee6dd888dcb13879de9a2b7b9f
|
e4964a40fa6880c3557a24cb6f0bcacd97a05a54
|
/src/main/java/hu/simplesoft/dualis/library/configuration/PersistenceJPAConfig.java
|
28f5cb19386af877aa53d73d65f3f3380591a73c
|
[] |
no_license
|
molnar75/Library
|
5c01dbc1a81eac634c08aceb970724f126540d64
|
99f2fdfa5534163e33ad54d7b627f11a07ec0402
|
refs/heads/master
| 2020-04-08T23:39:38.401463
| 2019-01-24T12:05:52
| 2019-01-24T12:05:52
| 159,794,962
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,901
|
java
|
package hu.simplesoft.dualis.library.configuration;
import java.util.Properties;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@EnableTransactionManagement
@EnableWebMvc
@ComponentScan ({"hu.simplesoft.dualis.library"})
public class PersistenceJPAConfig implements WebMvcConfigurer {
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em
= new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "hu.simplesoft.dualis.library.data.entity" });
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());
return em;
}
@Bean
public DataSource dataSource(){
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://localhost:3306/library?serverTimezone=Europe/Budapest");
dataSource.setUsername( "username" );
dataSource.setPassword( "password" );
return dataSource;
}
@Bean
public PlatformTransactionManager transactionManager(
EntityManagerFactory emf){
JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(emf);
return transactionManager;
}
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation(){
return new PersistenceExceptionTranslationPostProcessor();
}
Properties additionalProperties() {
Properties properties = new Properties();
properties.setProperty("hibernate.hbm2ddl.auto", "update");
properties.setProperty(
"hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect");
return properties;
}
}
|
[
"molnar.fanni@simplesoft.hu"
] |
molnar.fanni@simplesoft.hu
|
61dbada8c13d4e6832e081d2d37c965ac0e53b06
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/MATE-20_EMUI_11.0.0/src/main/java/com/huawei/displayengine/$$Lambda$ImageProcessor$59YsElCxg154HU41yvTk9RTfNFE.java
|
324a6c054ee654f91c5f9a787afc7e6d634839f8
|
[] |
no_license
|
morningblu/HWFramework
|
0ceb02cbe42585d0169d9b6c4964a41b436039f5
|
672bb34094b8780806a10ba9b1d21036fd808b8e
|
refs/heads/master
| 2023-07-29T05:26:14.603817
| 2021-09-03T05:23:34
| 2021-09-03T05:23:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 806
|
java
|
package com.huawei.displayengine;
import com.huawei.displayengine.ImageProcessor;
import java.util.function.Consumer;
/* renamed from: com.huawei.displayengine.-$$Lambda$ImageProcessor$59YsElCxg154HU41yvTk9RTfNFE reason: invalid class name */
/* compiled from: lambda */
public final /* synthetic */ class $$Lambda$ImageProcessor$59YsElCxg154HU41yvTk9RTfNFE implements Consumer {
public static final /* synthetic */ $$Lambda$ImageProcessor$59YsElCxg154HU41yvTk9RTfNFE INSTANCE = new $$Lambda$ImageProcessor$59YsElCxg154HU41yvTk9RTfNFE();
private /* synthetic */ $$Lambda$ImageProcessor$59YsElCxg154HU41yvTk9RTfNFE() {
}
@Override // java.util.function.Consumer
public final void accept(Object obj) {
((ImageProcessor.BitmapConfigTransformer) obj).doPreTransform();
}
}
|
[
"dstmath@163.com"
] |
dstmath@163.com
|
b4e2f208ad796af10b652e50cde84ef9af3ceec8
|
e2ebc0c49911288fb316c046976fdc17a0613714
|
/CSD201/CSDEquation/src/csdequation/Equation.java
|
73b5e00a29c6cd12020a4ce656c1b19910a40bd7
|
[] |
no_license
|
LuuPhuongUyen/Java
|
be4849777ccb1bf30c791376d9395fd99b954001
|
4603db2bc75d791b3d36cbb29c822172af164177
|
refs/heads/master
| 2023-01-30T16:50:04.534382
| 2020-12-17T17:07:55
| 2020-12-17T17:07:55
| 322,339,657
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,657
|
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 csdequation;
/**
*
* @author PC
*/
public class Equation {
public double quadracticEquation() {
while (true) {
System.out.print("\nEnter a = ");
double a = Validation.checkInputDouble();
System.out.print("Enter b = ");
double b = Validation.checkInputDouble();
System.out.print("Enter c = ");
double c = Validation.checkInputDouble();
if (a == 0) {
if (b == 0) {
if (c == 0) {
System.out.println("True with all x");
} else {
System.out.println("No root");
}
} else {
double x = -c / b;
System.out.println("One solution x = " + x);
}
} else {
double delta = b * b - 4 * a * c;
if (delta < 0) {
System.out.println("No root");
} else if (delta == 0) {
double x = -b / (2 * a);
System.out.println("Two roots x1 = x2 = " + x);
} else {
double x1 = (-b + Math.sqrt(delta)) / (2 * a);
double x2 = (-b - Math.sqrt(delta)) / (2 * a);
System.out.println("Two distinct roots x1 = " + x1 + ", x2 = " + x2);
}
return 0;
}
}
}
}
|
[
"luuphuonguyen1485@gmail.com"
] |
luuphuonguyen1485@gmail.com
|
dbf8b40f1029b59bf36b5b2434ba15a58ba1931b
|
fceee6b1c44fd20cc3157eee594daf6c47aa9e36
|
/src/BasicAlgorithm/Graph/BfsPractice.java
|
4a1820b18316f3e5da3aa41d9a17554c8c596e47
|
[] |
no_license
|
sysout-achieve/Algorithm
|
3ac5015d4f45e162826bdbba8305cbdd6ba17c7d
|
d36e7734c8bff3e767bd78baa4e0124581b2cdc7
|
refs/heads/master
| 2023-05-08T22:04:57.148039
| 2021-05-16T08:54:25
| 2021-05-16T08:54:25
| 299,278,622
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,161
|
java
|
package BasicAlgorithm.Graph;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;
public class BfsPractice {
static int n;
static int[] nx = {1, -1, 0, 0};
static int[] ny = {0, 0, 1, -1};
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int landNum = 0;
int result = Integer.MAX_VALUE;
n = sc.nextInt();
int[][] land = new int[n][n];
int[][] group = new int[n][n];
boolean[][] visited = new boolean[n][n];
Queue<int[]> q = new ArrayDeque<>();
for (int j = 0; j < n; j++) {
for (int i = 0; i < n; i++) {
int input = sc.nextInt();
land[i][j] = input;
if (input == 1) {
visited[i][j] = true;
q.offer(new int[]{i, j});
}
}
}
for (int j = 0; j < n; j++) {
for (int i = 0; i < n; i++) {
Queue<int[]> groupQ = new ArrayDeque<>();
if (land[i][j] == 1 && group[i][j] == 0) {
groupQ.offer(new int[]{i, j});
landNum++;
group[i][j] = landNum;
while (!groupQ.isEmpty()) {
int[] p = groupQ.remove();
for (int k = 0; k < 4; k++) {
int dx = p[0] + nx[k];
int dy = p[1] + ny[k];
if (dx >= 0 && dy >= 0 && dx < n && dy < n) {
if (land[dx][dy] == 1 && group[dx][dy] == 0) {
group[dx][dy] = landNum;
groupQ.offer(new int[]{dx, dy});
}
}
}
}
}
}
}
while (!q.isEmpty()) {
int[] p =q.remove();
for (int k = 0; k < 4; k++) {
int dx = p[0] + nx[k];
int dy = p[1] + ny[k];
if (dx >= 0 && dy >= 0 && dx < n && dy < n) {
if (!visited[dx][dy]) {
group[dx][dy]= group[p[0]][p[1]];
q.offer(new int[]{dx, dy});
visited[dx][dy] = true;
}
}
}
}
System.out.print(result);
System.out.print("\n");
System.out.print("\n");
System.out.print("\n");
for (int j = 0; j < n; j++) {
for (int i = 0; i < n; i++) {
System.out.print(land[i][j] + " ");
}
System.out.print("\n");
}
for (int j = 0; j < n; j++) {
for (int i = 0; i < n; i++) {
System.out.print(group[i][j] + " ");
}
System.out.print("\n");
}
// for (int j = 0; j < n; j++) {
// for (int i = 0; i < n; i++) {
// System.out.print(dist[i][j] + " ");
// }
// System.out.print("\n");
// }
}
}
|
[
"0408gun@gmail.com"
] |
0408gun@gmail.com
|
529ce30a2ce1811de05f14572830c8bd50ae501a
|
690ab1b4edc08bf2489fb8aa10e644f55d4ec6d1
|
/app/src/main/java/com/example/cxx/learnrecyclerview/MainActivity.java
|
3e1ea328372e2ead3d5105673dd38e7d5b77e10f
|
[] |
no_license
|
Simolf/LearnRecyclerView
|
7bf393d449605de9ed2945f49a3d5309cf45b79f
|
0ad61e365faaf6e396ceed52140b291534aac8be
|
refs/heads/master
| 2021-01-10T15:45:05.416727
| 2016-04-10T15:46:20
| 2016-04-10T15:46:20
| 55,907,849
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,605
|
java
|
package com.example.cxx.learnrecyclerview;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//获取RecyclerView对象
final RecyclerView recyclerView = (RecyclerView)findViewById(R.id.recycler);
//创建线性布局管理器(默认垂直布局)
final LinearLayoutManager layoutManager = new LinearLayoutManager(this);
//为RecyclerView指定布局管理对象
recyclerView.setLayoutManager(layoutManager);
//创建Adapter
MyAdapter myAdapter= new MyAdapter();
recyclerView.setAdapter(myAdapter);
//设置分割线
recyclerView.addItemDecoration(new DividerItemDecoration(this,
DividerItemDecoration.VERTICAL_LIST));
//设置自定义点击事件
myAdapter.setOnItemCliclListener(new MyAdapter.OnRecyclerViewItemClickListener() {
@Override
public void onItemClick(View view, String data) {
Toast.makeText(MainActivity.this,data,Toast.LENGTH_SHORT).show();
}
});
}
}
|
[
"964648168@qq.com"
] |
964648168@qq.com
|
6e94a0b6f80daabb13dc07e033de494166edf52c
|
7aadd1f4959512a4646e13e96b2193672dd9ad55
|
/MementoPattern/src/com/MementoPattern/Main.java
|
0603a5f8b0ad1567148714c7f45ef969d9621c5c
|
[] |
no_license
|
jungle8884/DesignPattern_Code
|
42c2c5d99c0750c0f59dec005b55c4d55ed8ba98
|
8d7533b55cc9bded62a02d95967faf7a463b2d52
|
refs/heads/master
| 2022-09-29T22:21:57.233188
| 2020-06-08T16:03:03
| 2020-06-08T16:03:03
| 263,634,520
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 598
|
java
|
package com.MementoPattern;
import com.MementoPattern.sample.Caretaker;
import com.MementoPattern.sample.Originator;
public class Main {
public static void main(String[] args) {
// sample code
{
Originator o = new Originator();
o.setState("On");
o.Show();
Caretaker c = new Caretaker();
c.setMemento(o.CreateMemento());//保存备忘录---状态
o.setState("Off");//状态改变
o.Show();
o.SetMemento(c.getMemento());//恢复原始状态
o.Show();
}
}
}
|
[
"jungle8884@163.com"
] |
jungle8884@163.com
|
8ffa37cde1dd4efe675f3124fb0861a61475534c
|
35c3bc23c4def46a836eace121fbce5e405cacea
|
/app/src/main/java/com/br/sweetmusic/pojos/Tracks.java
|
253c326ca2aa1fc664e295ebceb54f5e3675ff1f
|
[] |
no_license
|
sweetmusicapp/SweetMusic
|
759eaabc591d6c7ca6fb50b1debb8a0e9c1ce72b
|
7ea89c29742becbe96221ed403e4dfb69746679b
|
refs/heads/desenvolvimento
| 2020-07-19T03:45:14.135657
| 2019-12-06T01:34:18
| 2019-12-06T01:34:18
| 206,368,296
| 3
| 0
| null | 2019-12-06T01:09:56
| 2019-09-04T16:51:37
|
Java
|
UTF-8
|
Java
| false
| false
| 318
|
java
|
package com.br.sweetmusic.pojos;
import com.google.gson.annotations.Expose;
import java.util.List;
public class Tracks {
@Expose
private List<Track> track;
public List<Track> getTrack() {
return track;
}
public void setTrack(List<Track> track) {
this.track = track;
}
}
|
[
"limas.mayara@gmail.com"
] |
limas.mayara@gmail.com
|
80ed8166acb3a2ff883128991c48abdd921622d0
|
a937f69841aaeb884976e7280e0aa4724f6f1c9b
|
/web-api/src/test/java/marxo/test/local/TenantApiTests.java
|
2b2870dbdc0d34c009a3b9d842a2d2e5c90a6c31
|
[] |
no_license
|
yyfearth/marxo
|
89cc3f85b3e6bab6433ea5f413aa08d402e6f7a0
|
d8dbe0ac3417632bfda5ee0499273563aa6b8146
|
refs/heads/master
| 2021-01-22T06:58:14.573575
| 2013-12-20T01:13:37
| 2013-12-20T01:14:00
| 15,350,813
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,066
|
java
|
package marxo.test.local;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.net.MediaType;
import marxo.entity.user.Tenant;
import marxo.test.ApiTestConfiguration;
import marxo.test.ApiTester;
import marxo.test.BasicApiTests;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.List;
@SuppressWarnings("unchecked")
@ApiTestConfiguration
public class TenantApiTests extends BasicApiTests {
@Test
public void getTenants() throws Exception {
try (ApiTester apiTester = new ApiTester().basicAuth(email, password)) {
apiTester
.httpGet(baseUrl + "tenants")
.send();
apiTester
.isOk()
.matchContentType(MediaType.JSON_UTF_8);
List<Tenant> tenants = apiTester.getContent(new TypeReference<List<Tenant>>() {
});
Assert.assertNotNull(tenants);
boolean doesContainThisUser = false;
for (Tenant tenant : tenants) {
if (tenant.id.equals(reusedUser.tenantId)) {
doesContainThisUser = true;
break;
}
}
Assert.assertTrue(doesContainThisUser);
}
}
}
|
[
"masonwan@gmail.com"
] |
masonwan@gmail.com
|
99f880f7d37482737aa27db6e0279a8024123dcc
|
fb56bbda14e07ef7ae180bf61c109383b328a629
|
/app/src/main/java/com/example/news/bean/Note.java
|
b92f87ec0ca8f83e24ecb8bbb0302445197d5824
|
[] |
no_license
|
likeyewan/news
|
392d427f16acbe34405df623775be588928c2de4
|
ae035ca291145c4d4ec5b1639e4baaa21c23972d
|
refs/heads/master
| 2022-11-11T19:35:30.325964
| 2020-07-01T02:40:08
| 2020-07-01T02:40:08
| 276,264,326
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,022
|
java
|
package com.example.news.bean;
import org.litepal.crud.LitePalSupport;
import org.litepal.exceptions.DataSupportException;
import java.io.Serializable;
/**
* Created by ${WLX} on 2019/5/12.
*/
public class Note extends LitePalSupport implements Serializable{
private int id; //笔记ID
private String groupName;//笔记分组,便于管理
private String content; //笔记内容
private String title; //笔记标题,用于在RecyclerView中展示
private String previewContent; //笔记预览显示的内容,也是用于Recyclerview
private String createTime; //笔记日期
private int year;
private int month;
private int day;
private int hour;
private int minute;
private int isAlarm;//是否设置了闹铃
private int isRepeat;//是否每天重复
private String username;
private String password;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public int getIsRepeat() {
return isRepeat;
}
public void setIsRepeat(int isRepeat) {
this.isRepeat = isRepeat;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public int getMonth() {
return month;
}
public void setMonth(int month) {
this.month = month;
}
public int getDay() {
return day;
}
public void setDay(int day) {
this.day = day;
}
public int getHour() {
return hour;
}
public void setHour(int hour) {
this.hour = hour;
}
public int getMinute() {
return minute;
}
public void setMinute(int minute) {
this.minute = minute;
}
public int getIsAlarm() {
return isAlarm;
}
public void setIsAlarm(int isAlarm) {
this.isAlarm = isAlarm;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getPreviewContent() {
return previewContent;
}
public void setPreviewContent(String previewContent) {
this.previewContent = previewContent;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
}
|
[
"1581758352@qq.com"
] |
1581758352@qq.com
|
b3702fbb66f7354a5b2232365802216dd1d10810
|
769bb4fe63250c004f317356fbc91246851131be
|
/app/src/main/java/com/shuvo/usad/Asad.java
|
4bb8973a49736c515af5a0b078f36307b2006249
|
[] |
no_license
|
mahodiatik/USAD
|
7db5a3bcf1d0c21eb2be492ba1611c8eb9e85e41
|
cf426a2ff79962c2b38c2213c6ce80536c6571ce
|
refs/heads/master
| 2020-09-21T07:03:51.251039
| 2019-12-06T14:10:16
| 2019-12-06T14:10:16
| 224,718,675
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,293
|
java
|
package com.shuvo.usad;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.util.Linkify;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class Asad extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_asad);
Button call = (Button)findViewById(R.id.call);
call.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent calli=new Intent(Intent.ACTION_DIAL);
calli.setData(Uri.parse("tel:01758069434"));
startActivity(calli);
}
});
Button fb = (Button)findViewById(R.id.fb);
fb.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String url = "https://www.facebook.com/profile.php?id=100009241333640";
Intent i=new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
}
}
|
[
"mahodiatik@users.noreply.github.com"
] |
mahodiatik@users.noreply.github.com
|
b71af19f2d8abda90f52d7bded3b7a6da2d0ee09
|
b6ba1bea35dcaa6b72a8df96f51dfeb20c2fe14a
|
/src/study/序列化/SerializableDemo.java
|
5b7f07ca1c0579000b4d699010d0e1cbba927aaf
|
[] |
no_license
|
YinWangPing/algorithm-study
|
31896d7f488e261c18448f080fa3849d2ec94df8
|
4843b972fad06b5232836769e33e924520b69c94
|
refs/heads/master
| 2021-01-03T04:35:50.491579
| 2020-06-29T01:32:19
| 2020-06-29T01:32:19
| 239,924,456
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,546
|
java
|
package study.序列化;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
class Student implements Serializable{
private static final long serialVersionUID = 1L;
private String name;
transient private String address;
private Integer age;
private static String tel="177712333854";
private String tag;
public Student(){}
public Student(String name, String address, Integer age) {
this.name = name;
this.address = address;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public static String getTel() {
return tel;
}
public static void setTel(String tel) {
Student.tel = tel;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
@Override
public String toString() {
return "Student{" +
"name='" + name + '\'' +
", address='" + address + '\'' +
", age=" + age +
'}';
}
}
public class SerializableDemo {
public static void main(String[] args) throws IOException, ClassNotFoundException {
// Student student=new Student("张三","湖南省隆回县",20);
// ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream("C:\\Users\\cug125\\Desktop\\a.txt"));
// oos.writeObject(student);
// ObjectInputStream ooi=new ObjectInputStream(new FileInputStream("C:\\Users\\cug125\\Desktop\\a.txt"));
//// Student student1= (Student) ooi.readObject();
//// System.out.println(student1);
ArrayList<Integer> list1=new ArrayList<>(150);
for (int i = 0; i <100 ; i++) {
list1.add(i);
}
ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream("C:\\Users\\cug125\\Desktop\\a.txt"));
oos.writeObject(list1);
ObjectInputStream ooi=new ObjectInputStream(new FileInputStream("C:\\Users\\cug125\\Desktop\\a.txt"));
ArrayList<Integer>list2=(ArrayList<Integer>) ooi.readObject();
for (int x:list2) {
System.out.print(x+"\t");
}
}
}
|
[
"1648771485@qq.com"
] |
1648771485@qq.com
|
77a40354b308c0bfb8375c0f1025be7ef0379179
|
fea32f64a65f0c410c9300e5886b50835e8eb059
|
/SharedWhiteBoard/src/LineBreakSample.java
|
fd5d6c034dc39415f7dbbff9851456b2723ab882
|
[] |
no_license
|
acherking/DistributedSharedWhiteBoard
|
793f6abbf2db4cbf3f95d725a99018ec96b933a7
|
963b45ac5873908dfbfe8a915da10e16231128d4
|
refs/heads/master
| 2023-06-22T07:47:05.867589
| 2021-07-20T01:33:08
| 2021-07-20T01:33:08
| 208,952,305
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,154
|
java
|
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.font.FontRenderContext;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextLayout;
import java.text.AttributedCharacterIterator;
import java.awt.Color;
/**
* This class demonstrates how to line-break and draw a paragraph
* of text using LineBreakMeasurer and TextLayout.
*
* This class constructs a LineBreakMeasurer from an
* AttributedCharacterIterator. It uses the LineBreakMeasurer
* to create and draw TextLayouts (lines of text) which fit within
* the Component's width.
*/
public class LineBreakSample extends Component {
// The LineBreakMeasurer used to line-break the paragraph.
private LineBreakMeasurer lineMeasurer;
// The index in the LineBreakMeasurer of the first character
// in the paragraph.
private int paragraphStart;
// The index in the LineBreakMeasurer of the first character
// after the end of the paragraph.
private int paragraphEnd;
public LineBreakSample(AttributedCharacterIterator paragraph) {
FontRenderContext frc = SampleUtils.getDefaultFontRenderContext();
paragraphStart = paragraph.getBeginIndex();
paragraphEnd = paragraph.getEndIndex();
// Create a new LineBreakMeasurer from the paragraph.
lineMeasurer = new LineBreakMeasurer(paragraph, frc);
}
public void paint(Graphics g) {
Graphics2D graphics2D = (Graphics2D) g;
// Set formatting width to width of Component.
Dimension size = getSize();
float formatWidth = (float) size.width;
float drawPosY = 0;
lineMeasurer.setPosition(paragraphStart);
// Get lines from lineMeasurer until the entire
// paragraph has been displayed.
while (lineMeasurer.getPosition() < paragraphEnd) {
// Retrieve next layout.
TextLayout layout = lineMeasurer.nextLayout(formatWidth);
// Move y-coordinate by the ascent of the layout.
drawPosY += layout.getAscent();
// Compute pen x position. If the paragraph is
// right-to-left, we want to align the TextLayouts
// to the right edge of the panel.
float drawPosX;
if (layout.isLeftToRight()) {
drawPosX = 0;
}
else {
drawPosX = formatWidth - layout.getAdvance();
}
// Draw the TextLayout at (drawPosX, drawPosY).
layout.draw(graphics2D, drawPosX, drawPosY);
// Move y-coordinate in preparation for next layout.
drawPosY += layout.getDescent() + layout.getLeading();
}
}
public static void main(String[] args) {
// If no command-line arguments, use these:
if (args.length == 0) {
args = new String[] { "-text", "longenglish" };
}
AttributedCharacterIterator text = SampleUtils.getText(args);
Component sample = new LineBreakSample(text);
SampleUtils.showComponentInFrame(sample, "Line Break Sample");
}
}
|
[
"wzxfate@gmail.com"
] |
wzxfate@gmail.com
|
ceb535379e7c2737600f1f04d45137a7adf055a8
|
df81eb4063a09417000107ae494c156b174eb666
|
/src/br/com/sys/bean/Pedidos_comandasBean.java
|
94b4080c96a0ed836dd1d60bb101b72a47e21295
|
[] |
no_license
|
FtriL/tcc
|
fb4877d09d995b712a10a2e917740876b0ccb2b3
|
4283f31f2d1c809610ac3dd5dd245bf1b3697962
|
refs/heads/master
| 2020-03-25T12:27:09.133210
| 2018-08-13T16:55:58
| 2018-08-13T16:55:58
| 143,777,134
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 591
|
java
|
package br.com.sys.bean;
public class Pedidos_comandasBean {
private int idPedido_Comanda;
private int idPedido;
private int idComanda;
public int getIdPedido_Comanda() {
return idPedido_Comanda;
}
public void setIdPedido_Comanda(int idPedido_Comanda) {
this.idPedido_Comanda = idPedido_Comanda;
}
public int getIdPedido() {
return idPedido;
}
public void setIdPedido(int idPedido) {
this.idPedido = idPedido;
}
public int getIdComanda() {
return idComanda;
}
public void setIdComanda(int idComanda) {
this.idComanda = idComanda;
}
}
|
[
"100392@SALA119.proway.treina"
] |
100392@SALA119.proway.treina
|
41712a83dff9249e15ed541781f4cca71d083d89
|
65eb977a78ec2ade39e00658665f220cbd32a616
|
/src/test/java/chap07/section2/StubUserRepository.java
|
cb1da7fd3a0fce577d27423083c4ebc191cf585b
|
[] |
no_license
|
S1000f/learn-junit5
|
dd7eb95bace6b1b98c14dfb7226eb94ba8e21276
|
336af51913b8717939aec3fc1edf9799dc2bf020
|
refs/heads/master
| 2022-12-02T05:16:36.451862
| 2020-08-14T13:34:37
| 2020-08-14T13:34:37
| 272,065,286
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 382
|
java
|
package chap07.section2;
import java.util.HashMap;
import java.util.Map;
public class StubUserRepository implements UserRepository {
private Map<String, User> userMap = new HashMap<>();
@Override
public void save(User user) {
userMap.put(user.getId(), user);
}
@Override
public User findById(String id) {
return userMap.get(id);
}
}
|
[
"dohp.kim@gmail.com"
] |
dohp.kim@gmail.com
|
522d53613c96ff2dc6327ac0b7a59f99d67c01b2
|
356de93600e968abebd7efdfded0775c93a84230
|
/src/main/java/com/lijie/shopping/modules/service/UmsMemberRuleSettingService.java
|
aa1b1c646b7e6f9f72c5f58dbb0fded7da60a383
|
[] |
no_license
|
tianandli/shopping
|
511027f3bcbfc16a077beb2a4395edb3c250d1de
|
d441c4e802278078f9d3ce8cc8ca6d1d5931813f
|
refs/heads/master
| 2023-08-27T21:20:50.212623
| 2021-11-05T09:21:26
| 2021-11-05T09:21:26
| 370,205,574
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 362
|
java
|
package com.lijie.shopping.modules.service;
import com.lijie.shopping.modules.model.UmsMemberRuleSetting;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 会员积分成长规则表 服务类
* </p>
*
* @author lijie
* @since 2021-05-13
*/
public interface UmsMemberRuleSettingService extends IService<UmsMemberRuleSetting> {
}
|
[
"949620260@qq.com"
] |
949620260@qq.com
|
896ceb346210c0ad4d09fb5dcfb73875f1ec98ba
|
578b9174779d5bd62c4996a70efde0fe22c7982e
|
/library/passwordinput/src/main/java/com/ethanco/lib/PasswordInput.java
|
106edfb0785eb09e7ccdc7e5666ef0f060820b56
|
[] |
no_license
|
zhn2174/icebroken
|
b83bd951143d0fbc2152e1aa12bf291c0b24660b
|
c0c5699c7662ef37e284bf4f5f0c55d5dddf6db1
|
refs/heads/master
| 2020-04-25T07:31:26.275435
| 2019-03-08T14:51:47
| 2019-03-08T14:51:47
| 172,616,751
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 15,181
|
java
|
package com.ethanco.lib;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.v7.widget.AppCompatEditText;
import android.text.InputFilter;
import android.text.InputType;
import android.text.method.MovementMethod;
import android.util.AttributeSet;
import android.util.Log;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.OvershootInterpolator;
import static com.ethanco.lib.utils.Utils.dp2px;
import static com.ethanco.lib.utils.Utils.getColor;
/**
* Created by EthanCo on 2016/7/25.
*/
public class PasswordInput extends AppCompatEditText {
private static final String TAG = "Z-SimplePasswordInput";
//============================= Z-边框 ==============================/
@ColorInt
private int borderNotFocusedColor; //边框未选中时的颜色
@ColorInt
private int borderFocusedColor; //边框选中时的颜色
private int borderWidth; //边框宽度
//============================= Z-圆点 ==============================/
@ColorInt
private int dotNotFocusedColor; //圆点未选中时的颜色
@ColorInt
private int dotFocusedColor; //圆点选中时的颜色
private float dotRadius; //圆点半径
//============================= Z-背景 ==============================/
@ColorInt
private int backgroundColor = Color.WHITE; //背景色
//============================= Z-画笔 ==============================/
private Paint mBorderPaint; //边框画笔
private Paint mDotPaint; //圆点画笔
private Paint mBackgroundPaint; //背景画笔
//============================= Z-方块 ==============================/
private int boxCount = 4; //字符方块的数量
private float boxMarge; //字符方块的marge
private float boxRadius; //字符方块的边角圆弧
private float[] scans; //字符方块缩放比例数组
private int[] alphas; //字符方块透明度数组
//============================= Z-其他 ==============================/
private int currTextLen = 0; //现在输入Text长度
private boolean focusColorChangeEnable = true; //获得焦点时颜色是否改变
private static final InputFilter[] NO_FILTERS = new InputFilter[0];
private boolean isFinishInflate = false; //inflate layout 是否已结束
private RectF mBorderRect = new RectF();
public PasswordInput(Context context) {
this(context, null);
}
public PasswordInput(Context context, AttributeSet attrs) {
super(context, attrs);
//获取默认属性
getDefaultVar();
//初始化自定义属性
initAttrVar(context, attrs);
//初始化动画存储数组
initAnimArr();
//初始化画笔
initPaint();
//初始化EditText
initView();
}
private void getDefaultVar() {
borderNotFocusedColor = getColor(getContext(), R.color.password_input_border_not_focused);
borderFocusedColor = getColor(getContext(), R.color.password_input_border_focused);
}
private void initAttrVar(Context context, AttributeSet attrs) {
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.PasswordInput);
backgroundColor = ta.getColor(R.styleable.PasswordInput_backgroundColor, backgroundColor);
int focusedColor = ta.getColor(R.styleable.PasswordInput_focusedColor, borderFocusedColor);
int notFocusedColor = ta.getColor(R.styleable.PasswordInput_notFocusedColor, borderNotFocusedColor);
boxCount = ta.getInt(R.styleable.PasswordInput_boxCount, boxCount);
focusColorChangeEnable = ta.getBoolean(R.styleable.PasswordInput_focusColorChangeEnable, true);
dotRadius = ta.getDimension(R.styleable.PasswordInput_dotRaduis, dp2px(context, 11));
ta.recycle();
borderFocusedColor = focusedColor;
borderNotFocusedColor = notFocusedColor;
dotFocusedColor = focusedColor;
dotNotFocusedColor = notFocusedColor;
borderWidth = dp2px(context, 1);
boxRadius = dp2px(context, 3);
boxMarge = dp2px(context, 3);
}
private void initAnimArr() {
scans = new float[boxCount];
alphas = new int[boxCount];
for (int i = 0; i < alphas.length; i++) {
alphas[i] = 255;
}
}
private void initPaint() {
mBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBorderPaint.setStrokeWidth(borderWidth);
mBorderPaint.setColor(borderNotFocusedColor);
mBorderPaint.setStyle(Paint.Style.STROKE);
mDotPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mDotPaint.setColor(dotNotFocusedColor);
mDotPaint.setStyle(Paint.Style.FILL);
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(backgroundColor);
mBackgroundPaint.setStyle(Paint.Style.FILL);
}
private void initView() {
setCursorVisible(false); //光标不可见
setInputType(InputType.TYPE_CLASS_NUMBER); //设置输入的是数字
//设置输入最大长度
setMaxLen(boxCount);
setTextIsSelectable(false);//设置文字不可选中
}
private void setMaxLen(int maxLength) {
if (maxLength >= 0) {
setFilters(new InputFilter[]{new InputFilter.LengthFilter(maxLength)});
} else {
setFilters(NO_FILTERS);
}
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int height = getHeight();
int width = getWidth();
canvas.save();
//绘制背景
drawBackGround(canvas, height, width);
//绘制边框
drawBorder(canvas, height, width);
//绘制圆点
drawDot(canvas, height, width);
canvas.restore();
}
private void drawBackGround(Canvas canvas, int height, int width) {
canvas.drawRect(0, 0, width, height, mBackgroundPaint);
}
private void drawBorder(Canvas canvas, int height, int width) {
for (int i = 0; i < boxCount; i++) {
RectF rect = generationSquareBoxRectF(height, width, i);
canvas.drawRoundRect(rect, boxRadius, boxRadius, mBorderPaint);
}
}
private void drawDot(Canvas canvas, int height, int width) {
float cx, cy = height / 2;
float half = width / boxCount / 2;
for (int i = 0; i < boxCount; i++) {
mDotPaint.setAlpha(alphas[i]);
cx = width * i / boxCount + half;
Log.i(TAG, "onDraw scans[" + i + "]: " + scans[i]);
canvas.drawCircle(cx, cy, dotRadius * scans[i], mDotPaint);
}
}
@NonNull
private RectF generationSquareBoxRectF(int height, int width, int i) {
float boxWidth = (width / boxCount);
float boxHeight = height;
float left = boxMarge + boxWidth * i;
float right = boxWidth * (i + 1) - boxMarge;
float top = boxMarge;
float bottom = boxHeight - boxMarge;
float min = Math.min(boxWidth, boxHeight);
float dw = (boxWidth - min) / 2F;
float dh = (boxHeight - min) / 2F;
left += dw;
right -= dw;
top += dh;
bottom -= dh;
mBorderRect.set(left, top, right, bottom);
return mBorderRect;
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
isFinishInflate = true;
}
@Override
protected MovementMethod getDefaultMovementMethod() {
//关闭 copy/paste/cut 长按文字菜单,使文字不可长按选中
//Note: 需 setTextIsSelectable(false) 才会生效
return null;
}
@Override
protected void onTextChanged(CharSequence text, final int start, int lengthBefore, int lengthAfter) {
super.onTextChanged(text, start, lengthBefore, lengthAfter);
if (start != text.length()) {
moveCursorToTheEnd();
}
// Log.i(TAG, "onTextChanged currTextLen:" + currTextLen+" id:"+getId());
// if (null == scans) return;
// Log.i(TAG, "==>onTextChanged currTextLen:" + currTextLen+" id:"+getId());
// if (isFristChangeText) {
// isFristChangeText = false;
// return;
// }
if (!isFinishInflate) {
return;
}
this.currTextLen = text.toString().length();
final boolean isAdd = lengthAfter - lengthBefore > 0;
// new Thread() {
// @Override
// public void run() {
// Log.i(TAG, "currTextLen:" + currTextLen);
// for (int i = 0; i < currTextLen; i++) {
// scans[i] = 1;
// }
// postInvalidate();
// }
// }.start();
startTextChangedAnim(isAdd);
//通知TextChangeListen
notifyTextChangeListener(text);
}
/**
* 清除
*
*/
public void Clear(){
if (currTextLen>0){
for (int i = currTextLen-1; i > 0; i--) {
alphas[i] = 0;
postInvalidate();
}
setText("");
}
}
/**
* 开始TextChanged动画
*
* @param isAdd true:字符从小到大 (增加) false:字符从大到小 (删除)
*/
private void startTextChangedAnim(boolean isAdd) {
final ValueAnimator scanAnim;
final ValueAnimator alphaAnim;
final int index;
if (isAdd) {
index = currTextLen - 1;
scanAnim = ValueAnimator.ofFloat(0F, 1F);
alphaAnim = ValueAnimator.ofInt(0, 255);
} else {
index = currTextLen;
scanAnim = ValueAnimator.ofFloat(1F, 0F);
alphaAnim = ValueAnimator.ofInt(255, 0);
}
if (scans.length >= currTextLen) {
scanAnim.setDuration(750);
scanAnim.setRepeatCount(0);
scanAnim.setInterpolator(new OvershootInterpolator());
scanAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
float scale = (float) valueAnimator.getAnimatedValue();
scans[index] = scale;
postInvalidate();
}
});
alphaAnim.setDuration(750);
alphaAnim.setRepeatCount(0);
alphaAnim.setInterpolator(new LinearInterpolator());
alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
int alpha = (int) valueAnimator.getAnimatedValue();
alphas[index] = alpha;
postInvalidate();
}
});
scanAnim.start();
alphaAnim.start();
}
}
private void notifyTextChangeListener(CharSequence text) {
if (null != textLenChangeListener) {
textLenChangeListener.onTextLenChange(text, currTextLen);
}
}
@Override
protected void onFocusChanged(final boolean focused, int direction, Rect previouslyFocusedRect) {
super.onFocusChanged(focused, direction, previouslyFocusedRect);
if (focused) {
moveCursorToTheEnd();
}
if (focusColorChangeEnable) {
startFocusChangedAnim(focused);
}
}
/**
* 开始FocusChanged动画
*
* @param focused 是否获得焦点
*/
private void startFocusChangedAnim(final boolean focused) {
final ValueAnimator scanAnim;
scanAnim = ValueAnimator.ofFloat(1F, 0.1F, 1F);
scanAnim.setDuration(750);
scanAnim.setRepeatCount(0);
scanAnim.setInterpolator(new AccelerateDecelerateInterpolator());
scanAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
float scale = (float) valueAnimator.getAnimatedValue();
for (int i = 0; i < scans.length; i++) {
if (scans[i] != 0) {
scans[i] = scale;
}
}
if (scale <= 0.15) {
if (focused) {
mBorderPaint.setColor(borderFocusedColor);
mDotPaint.setColor(dotFocusedColor);
} else {
mBorderPaint.setColor(borderNotFocusedColor);
mDotPaint.setColor(dotNotFocusedColor);
}
}
postInvalidate();
}
});
scanAnim.start();
}
@Override
protected void onSelectionChanged(int selStart, int selEnd) {
super.onSelectionChanged(selStart, selEnd);
if (selEnd != getText().length()) {
moveCursorToTheEnd();
}
}
private void moveCursorToTheEnd() {
setSelection(getText().length());
}
public interface TextLenChangeListener {
void onTextLenChange(CharSequence text, int len);
}
private TextLenChangeListener textLenChangeListener;
/**
* 设置Text长度改变监听
*
* @param lenListener 监听
*/
public void setTextLenChangeListener(TextLenChangeListener lenListener) {
textLenChangeListener = lenListener;
}
public void setBorderNotFocusedColor(@ColorInt int borderNotFocusedColor) {
this.borderNotFocusedColor = borderNotFocusedColor;
}
public void setBorderFocusedColor(@ColorInt int borderFocusedColor) {
this.borderFocusedColor = borderFocusedColor;
}
public void setBorderWidth(int borderWidth) {
this.borderWidth = borderWidth;
}
public void setDotNotFocusedColor(@ColorInt int dotNotFocusedColor) {
this.dotNotFocusedColor = dotNotFocusedColor;
}
public void setDotFocusedColor(@ColorInt int dotFocusedColor) {
this.dotFocusedColor = dotFocusedColor;
}
public void setDotRadius(float dotRadius) {
this.dotRadius = dotRadius;
}
@Override
public void setBackgroundColor(@ColorInt int backgroundColor) {
this.backgroundColor = backgroundColor;
}
public void setBoxCount(int boxCount) {
this.boxCount = boxCount;
}
public void setBoxMarge(float boxMarge) {
this.boxMarge = boxMarge;
}
public void setBoxRadius(float boxRadius) {
this.boxRadius = boxRadius;
}
public void setFocusColorChangeEnable(boolean focusColorChangeEnable) {
this.focusColorChangeEnable = focusColorChangeEnable;
}
}
|
[
"zhn2174@gmail.com"
] |
zhn2174@gmail.com
|
5734064208ff887c9876372af14aa46d6296fe24
|
e32e34b8630d66b9025c55a654cacaec9dacbae1
|
/App1_Lab3/app/src/main/java/pl/pollub/app1_lab3/RecivedData.java
|
f727017eb4ee2f469ec57d0dc8dae8b2a141b2ba
|
[] |
no_license
|
BadWolfeee/testAndroid
|
202e92328ee327f460ceb2ab1ed0a34203d8c5a4
|
859a4449321850becbda83b4a6fe4178695029b9
|
refs/heads/master
| 2021-01-23T07:50:38.721708
| 2017-05-09T11:26:50
| 2017-05-09T11:26:50
| 86,456,330
| 0
| 0
| null | 2017-05-09T11:26:50
| 2017-03-28T12:17:45
|
Java
|
UTF-8
|
Java
| false
| false
| 1,450
|
java
|
package pl.pollub.app1_lab3;
import android.os.Bundle;
import android.app.Activity;
import android.widget.TextView;
import android.widget.EditText;
import android.content.Intent;
public class RecivedData extends Activity {
String inputString, inputString2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recived_data);
TextView view = (TextView) findViewById(R.id.displayintentextra);
Bundle extras = getIntent().getExtras();
inputString = extras.getString("key");
view.setText(inputString);
TextView view1 = (TextView) findViewById(R.id.displayintentextra2);
inputString2 = extras.getString("key2");
view1.setText(inputString2);
}
public void finish() {
Intent intent = new Intent();
float x= Float.parseFloat(inputString);
float y= Float.parseFloat(inputString2);
float ad, sub, mul, div;
ad=x+y;
sub=x-y;
mul=x*y;
div=x/y;
String a,s,m,d;
a= String.valueOf(ad);
s= String.valueOf(sub);
m= String.valueOf(mul);
d= String.valueOf(div);
intent.putExtra("returna", a);
intent.putExtra("returns", s);
intent.putExtra("returnm", m);
intent.putExtra("returnd", d);
setResult(RESULT_OK, intent);
super.finish();
}
}
|
[
"doseofmilka@gmail.com"
] |
doseofmilka@gmail.com
|
6afde2b4c0586667944a50d266d1a7832a66ebb8
|
04174ddb97f50a1d8292527d89e2716aff1593bb
|
/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSingleBeanDefinitionParser.java
|
1af76f6d90539f35f21a1298de1e7b30c105bdd4
|
[
"Apache-2.0"
] |
permissive
|
long-64/spring-framework-5.1.10.RELEASE
|
fef5eb5c00e829fde901183dd6b427a27c5622b3
|
ed259bb6baa04b6f8ff8cb4d8a55dc33b05ef100
|
refs/heads/master
| 2023-04-25T13:46:23.397297
| 2021-05-03T07:14:10
| 2021-05-03T07:14:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,371
|
java
|
/*
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.xml;
import org.w3c.dom.Element;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.lang.Nullable;
/**
* Base class for those {@link BeanDefinitionParser} implementations that
* need to parse and define just a <i>single</i> {@code BeanDefinition}.
*
* <p>Extend this parser class when you want to create a single bean definition
* from an arbitrarily complex XML element. You may wish to consider extending
* the {@link AbstractSimpleBeanDefinitionParser} when you want to create a
* single bean definition from a relatively simple custom XML element.
*
* <p>The resulting {@code BeanDefinition} will be automatically registered
* with the {@link org.springframework.beans.factory.support.BeanDefinitionRegistry}.
* Your job simply is to {@link #doParse parse} the custom XML {@link Element}
* into a single {@code BeanDefinition}.
*
* @author Rob Harrop
* @author Juergen Hoeller
* @author Rick Evans
* @since 2.0
* @see #getBeanClass
* @see #getBeanClassName
* @see #doParse
*/
public abstract class AbstractSingleBeanDefinitionParser extends AbstractBeanDefinitionParser {
/**
* Creates a {@link BeanDefinitionBuilder} instance for the
* {@link #getBeanClass bean Class} and passes it to the
* {@link #doParse} strategy method.
* @param element the element that is to be parsed into a single BeanDefinition
* @param parserContext the object encapsulating the current state of the parsing process
* @return the BeanDefinition resulting from the parsing of the supplied {@link Element}
* @throws IllegalStateException if the bean {@link Class} returned from
* {@link #getBeanClass(org.w3c.dom.Element)} is {@code null}
* @see #doParse
*
*
* 解析bean 定义的模板方法。
*/
@Override
protected final AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition();
String parentName = getParentName(element);
if (parentName != null) {
builder.getRawBeanDefinition().setParentName(parentName);
}
Class<?> beanClass = getBeanClass(element);
if (beanClass != null) {
builder.getRawBeanDefinition().setBeanClass(beanClass);
}
else {
String beanClassName = getBeanClassName(element);
if (beanClassName != null) {
builder.getRawBeanDefinition().setBeanClassName(beanClassName);
}
}
builder.getRawBeanDefinition().setSource(parserContext.extractSource(element));
BeanDefinition containingBd = parserContext.getContainingBeanDefinition();
if (containingBd != null) {
// Inner bean definition must receive same scope as containing bean.
builder.setScope(containingBd.getScope());
}
if (parserContext.isDefaultLazyInit()) {
// Default-lazy-init applies to custom bean definitions as well.
builder.setLazyInit(true);
}
doParse(element, parserContext, builder);
return builder.getBeanDefinition();
}
/**
* Determine the name for the parent of the currently parsed bean,
* in case of the current bean being defined as a child bean.
* <p>The default implementation returns {@code null},
* indicating a root bean definition.
* @param element the {@code Element} that is being parsed
* @return the name of the parent bean for the currently parsed bean,
* or {@code null} if none
*/
@Nullable
protected String getParentName(Element element) {
return null;
}
/**
* Determine the bean class corresponding to the supplied {@link Element}.
* <p>Note that, for application classes, it is generally preferable to
* override {@link #getBeanClassName} instead, in order to avoid a direct
* dependence on the bean implementation class. The BeanDefinitionParser
* and its NamespaceHandler can be used within an IDE plugin then, even
* if the application classes are not available on the plugin's classpath.
* @param element the {@code Element} that is being parsed
* @return the {@link Class} of the bean that is being defined via parsing
* the supplied {@code Element}, or {@code null} if none
* @see #getBeanClassName
*/
@Nullable
protected Class<?> getBeanClass(Element element) {
return null;
}
/**
* Determine the bean class name corresponding to the supplied {@link Element}.
* @param element the {@code Element} that is being parsed
* @return the class name of the bean that is being defined via parsing
* the supplied {@code Element}, or {@code null} if none
* @see #getBeanClass
*/
@Nullable
protected String getBeanClassName(Element element) {
return null;
}
/**
* Parse the supplied {@link Element} and populate the supplied
* {@link BeanDefinitionBuilder} as required.
* <p>The default implementation delegates to the {@code doParse}
* version without ParserContext argument.
* @param element the XML element being parsed
* @param parserContext the object encapsulating the current state of the parsing process
* @param builder used to define the {@code BeanDefinition}
* @see #doParse(Element, BeanDefinitionBuilder)
*/
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
doParse(element, builder);
}
/**
* Parse the supplied {@link Element} and populate the supplied
* {@link BeanDefinitionBuilder} as required.
* <p>The default implementation does nothing.
* @param element the XML element being parsed
* @param builder used to define the {@code BeanDefinition}
*/
protected void doParse(Element element, BeanDefinitionBuilder builder) {
}
}
|
[
"17037159+cat0927@users.noreply.github.com"
] |
17037159+cat0927@users.noreply.github.com
|
e1e4d50c74597cb0d7845c7f1decd4f99a212e98
|
7be475d8f2eeb30acfb63f5c034b464433e416ff
|
/zuihou-backend/zuihou-demo/zuihou-demo-server/src/main/java/com/github/zuihou/demo/config/ExceptionConfiguration.java
|
adc48e78def62b77e9f1368139d5d823080ead27
|
[
"Apache-2.0"
] |
permissive
|
jollroyer/zuihou-admin-cloud
|
34b7f7766ca6bd231b3b57e7eab5336e9b0439e0
|
673ea6a5d845c8cd5006c0cd0b570b08a3596be0
|
refs/heads/master
| 2020-12-03T22:19:27.334015
| 2020-01-03T03:23:20
| 2020-01-03T03:23:20
| 231,504,256
| 0
| 0
|
Apache-2.0
| 2020-01-03T03:21:51
| 2020-01-03T03:21:51
| null |
UTF-8
|
Java
| false
| false
| 679
|
java
|
package com.github.zuihou.demo.config;
import com.github.zuihou.common.handler.DefaultGlobalExceptionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
* 全局异常处理
*
* @author zuihou
* @date 2020年01月02日17:19:27
*/
@Configuration
@ControllerAdvice(annotations = {RestController.class, Controller.class})
@ResponseBody
public class ExceptionConfiguration extends DefaultGlobalExceptionHandler {
}
|
[
"244387066@qq.com"
] |
244387066@qq.com
|
5f52afaf7fc11c337028e48244d7e6cec6350060
|
21017a76c972c0d1220bba05a9ffeb75fa620403
|
/Cadastro/CAPESCadastroBOFachada/src/main/java/br/com/sicoob/capes/cadastro/fachada/bem/BemFachada.java
|
b1f805aa1481ca1dec745fa95aba8b32e568eee5
|
[] |
no_license
|
pabllo007/cpes
|
a1b3b8920c9b591b702156ae36663483cd62a880
|
f4fc8dce3d487df89ac8f88c41023bc8db91b0c2
|
refs/heads/master
| 2022-11-28T02:55:07.675359
| 2019-10-27T22:17:53
| 2019-10-27T22:17:53
| 217,923,554
| 0
| 0
| null | 2022-11-24T06:24:02
| 2019-10-27T22:13:09
|
Java
|
ISO-8859-1
|
Java
| false
| false
| 5,530
|
java
|
package br.com.sicoob.capes.cadastro.fachada.bem;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import javax.ejb.EJBTransactionRolledbackException;
import javax.persistence.EntityNotFoundException;
import javax.persistence.PersistenceException;
import br.com.bancoob.excecao.BancoobException;
import br.com.bancoob.negocio.dto.ConsultaDto;
import br.com.bancoob.persistencia.excecao.ViolacaoIntegridadeException;
import br.com.bancoob.sisbrweb.dto.RequisicaoReqDTO;
import br.com.bancoob.sisbrweb.dto.RetornoDTO;
import br.com.sicoob.capes.cadastro.fachada.EntidadeCadastroFachada;
import br.com.sicoob.capes.cadastro.negocio.delegates.AutorizacaoCadastroDelegate;
import br.com.sicoob.capes.cadastro.negocio.delegates.BemDelegate;
import br.com.sicoob.capes.cadastro.negocio.delegates.CAPESCadastroFabricaDelegates;
import br.com.sicoob.capes.cadastro.negocio.vo.DefinicoesComponenteGedVO;
import br.com.sicoob.capes.comum.util.Constantes;
import br.com.sicoob.capes.negocio.entidades.bem.Bem;
/**
* Fachada base para as classes que herdam de {@link Bem}
*
* @author bruno.carneiro
*
* @param <T>
* A classe que herda de {@link Bem}
*/
public abstract class BemFachada extends EntidadeCadastroFachada<Bem> {
protected static final String CHAVE_BEM = "bem";
/**
* Construtor padrão da fachada.
*
* @param chaveMapa
*/
public BemFachada(String chaveMapa) {
super(chaveMapa);
}
/**
* {@inheritDoc}
*/
@Override
protected Bem obterEntidade(RequisicaoReqDTO dto) {
return (Bem) dto.getDados().get(chaveMapa);
}
/**
* Método utilizado pelo componente de pesquisa de bens para recuperar o bem
* a partir do seu código.
*
* @param dto
* @return
* @throws BancoobException
*/
public RetornoDTO obterPorCodigo(RequisicaoReqDTO dto) throws BancoobException {
RetornoDTO retorno = new RetornoDTO();
try {
Bem entidade = obterEntidade(dto);
ConsultaDto<Bem> criterios = new ConsultaDto<Bem>();
criterios.setFiltro(entidade);
retorno.getDados().put(NOME_PADRAO_LISTA, obterDelegate().pesquisar(criterios).getResultado());
} catch (NullPointerException e) {
registrarLogNullPointerException(e, dto);
} catch (ViolacaoIntegridadeException e) {
registrarLogViolacaoIntegridadeException(e, dto);
} catch (EJBTransactionRolledbackException e) {
registrarLogTransactionRolledbackException(e, dto);
} catch (EntityNotFoundException e) {
registrarLogEntityNotFoundException(e, dto);
} catch (PersistenceException e) {
registrarLogPersistenceException(e, dto);
} catch (Exception e) {//nosonar
registrarLogException(e, dto);
}
return retorno;
}
/**
* {@inheritDoc}
*/
@Override
protected BemDelegate obterDelegate() {
return CAPESCadastroFabricaDelegates.getInstance().criarBemDelegate();
}
/**
* {@inheritDoc}
*/
@Override
public RetornoDTO obterDados(RequisicaoReqDTO dto) throws BancoobException {
try {
Bem entidade = obterEntidade(dto);
Bem entidadePersistente = consultarEntidade(entidade);
AutorizacaoCadastroDelegate autorizacaoCadastroDelegate = obterFabricaDelegates().criarAutorizacaoCadastroDelegate();
entidadePersistente.setDocumentosComprobatorios(autorizacaoCadastroDelegate.obterDocumentosComprobatorios(entidadePersistente));
return obterMapRetorno(this.chaveMapa, entidadePersistente);
} catch (NullPointerException e) {
registrarLogNullPointerException(e, dto);
} catch (ViolacaoIntegridadeException e) {
registrarLogViolacaoIntegridadeException(e, dto);
} catch (EJBTransactionRolledbackException e) {
registrarLogTransactionRolledbackException(e, dto);
} catch (EntityNotFoundException e) {
registrarLogEntityNotFoundException(e, dto);
} catch (PersistenceException e) {
registrarLogPersistenceException(e, dto);
} catch (Exception e) {//nosonar
registrarLogException(e, dto);
}
return null;
}
/**
* Obtém as definições do GED (Siglas das chaves de negócio).
*
* @param dto
* @return
*/
protected List<DefinicoesComponenteGedVO> obterDefinicoesGED(RequisicaoReqDTO dto) {
Integer codTipoPessoa = (Integer) dto.getDados().get("idTipoPessoa");
List<DefinicoesComponenteGedVO> listaDefinicoesGed = new ArrayList<DefinicoesComponenteGedVO>();
if(codTipoPessoa != null) {
Set<String> chavesNegocio = new LinkedHashSet<String>();
chavesNegocio.add(Constantes.Negocio.GED_SIGLA_CHAVE_DOCUMENTO_GRUPO_COMPARTILHAMENTO);
chavesNegocio.add(Constantes.Negocio.GED_CHAVE_TIPO_CLASSIFICACAO_BEM);
chavesNegocio.add(Constantes.Negocio.GED_CHAVE_TIPO_BEM);
List<String> listaSiglas = new ArrayList<String>();
listaSiglas.add(Constantes.Negocio.GED_SIGLA_TIPO_DOCUMENTO_BEM);
listaSiglas.add(Constantes.Negocio.GED_SIGLA_LAUDO_AVALIACAO_BEM);
listaSiglas.add(Constantes.Negocio.GED_SIGLA_CERTIFICADO_CADASTRO_IMOVEL_RURAL);
listaSiglas.add(Constantes.Negocio.GED_SIGLA_IMPOSTO_SOBRE_PROPRIEDADE_TERRITORIAL);
listaSiglas.add(Constantes.Negocio.GED_SIGLA_CONTRATO_POSSE_USO_IMOVEL_BENEFICIADO);
for (String sigla : listaSiglas) {
DefinicoesComponenteGedVO definicaoComponenteGedVO = new DefinicoesComponenteGedVO();
definicaoComponenteGedVO.setIdTipoPessoa(codTipoPessoa.shortValue());
definicaoComponenteGedVO.setSiglaTipoDocumento(sigla);
definicaoComponenteGedVO.setChavesNegocio(chavesNegocio);
listaDefinicoesGed.add(definicaoComponenteGedVO);
}
}
return listaDefinicoesGed;
}
}
|
[
"="
] |
=
|
187fd3acfdf7f5f636ecc361da3ad2001ddf71f0
|
f06944861fd088efb13bdf64f67ccc12b89d701c
|
/EnrollmentProject/src/com/glbajaj/enroll/contoller/AddTraining.java
|
50f8e4ee9edcd43bb1f5aac0a7e9c32ceb6eac92
|
[] |
no_license
|
utkarshraj27/Servlet_Assignment
|
ef5b1dde0b93208d48475dec98a45efca575dcda
|
f3fdd83d5fba19cd55c66926ecd3c973f82d94e1
|
refs/heads/master
| 2022-05-13T13:26:56.128470
| 2020-04-29T10:00:58
| 2020-04-29T10:00:58
| 259,857,536
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,782
|
java
|
package com.glbajaj.enroll.contoller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.glbajaj.enroll.service.OperationClass;
/**
* Servlet implementation class AddTraining
*/
public class AddTraining extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter out=resp.getWriter();
out.print("<h2>Add Training</h2>");
out.print("<form method='post' action='AddTraining'>");
out.print("<table>");
out.print("<tr>");
out.print("<td>Training Id</td><td><input type='number' name='tid' required></td>");
out.print("</tr>");
out.print("<tr>");
out.print("<td>Training Name</td><td><input type='text' name='tname' required></td>");
out.print("</tr>");
out.print("<tr>");
out.print("<td>Available Seats</td><td><input type='number' name='seats' required></td>");
out.print("</tr>");
out.print("<tr>");
out.print("<td><input type='submit' value='submit'></td>");
out.print("</tr>");
out.print("<table>");
out.print("</form>");
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter out = resp.getWriter();
int id=Integer.parseInt(req.getParameter("tid"));
String tname=req.getParameter("tname");
int seats=Integer.parseInt(req.getParameter("seats"));
String msg=OperationClass.doAdd(id, tname, seats);
out.print("<h2>"+msg+"</h2>");
out.print("</br></br><a href='index.html'>Check Training added</a>");
}
}
|
[
"noreply@github.com"
] |
utkarshraj27.noreply@github.com
|
906c740e4b0dd340f604cc7ef3c4c2ecf4519f9d
|
a99eadf1c1fcdbeb5b3d8b892fa10f6976e28b0c
|
/src/main/java/wang/yobbo/common/appengine/plugin/NtCacheConstants.java
|
9716c68020aa3eb9fa84f357b9874fb5f2934a22
|
[] |
no_license
|
yobbo-wang/Nextrobot
|
d525ffe283db6649cf148fb6a7aedaa2aeb671c4
|
48716d7e32ed1a2d4854f75ea30e11964c2d2ef0
|
refs/heads/master
| 2021-01-24T11:34:55.973873
| 2018-03-30T09:26:04
| 2018-03-30T09:26:04
| 123,086,784
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 294
|
java
|
package wang.yobbo.common.appengine.plugin;
public interface NtCacheConstants {
String CACHE_FILTER_CHAINMANAGER="CACHE_FILTER_CHAINMANAGER";
String CACHE_SYS="NT_SYS_CACHE";
String CACHE_URL_ROLE = "CACHE_URL_ROLE";
String CACHE_SHIRO_KICKOUT_SESSION="shiroKickoutSession";
}
|
[
"yobbo_wang@163.com"
] |
yobbo_wang@163.com
|
744acfd1e8693731cffa1a97794414ce8dd14a79
|
0fa775315b2f1c88a542cd18481355fc564f3a25
|
/englishWord/src/findPermutation/dictionary.java
|
4fecf1c565f6670aa0e952b04a4bc23a99f9f9ed
|
[] |
no_license
|
devaki18/DictionaryProject
|
5e0cf0980065e9c7a839e8b3d275f83f7b71dff3
|
1f375bb5896f267b26e97ae36a4c95e32b72ef84
|
refs/heads/master
| 2023-03-30T18:48:40.346463
| 2021-04-08T02:54:08
| 2021-04-08T02:54:08
| 355,666,399
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 442
|
java
|
package findPermutation;
public final class dictionary {
static boolean isEnglishWord(String checkWord)
{
String[] validWords = { "apple", "mango", "and", "is", "with", "work", "king", "ring", "row", "know", "or", "in", "wing", "for" };
for (int i = 0; i < validWords.length; i++)
{
if (validWords[i].toLowerCase().equals(checkWord.toLowerCase()))
{
return true;
}
}
return false;
}
}
|
[
"Administrator@MININT-VE1SM6K.hitronhub.home"
] |
Administrator@MININT-VE1SM6K.hitronhub.home
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.