blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 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 684M ⌀ | 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 132 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 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
864c463c2e1db9cd9026ac042603891c7b6df86c | cf3c46f8a6ea50d2ce743e55ba651891738a57e4 | /unalcol/optimization/src/unalcol/optimization/real/testbed/Ackley.java | 074a392f316a79986c622ee78c4bd0bc4e11fba0 | [] | no_license | jufcontrerasco/IA2018 | 170b491f18988534351c0f838d12fb723fd9c602 | 50ac18cd2bc743d0839b617d0d11ee5799366448 | refs/heads/master | 2020-03-29T15:07:21.500618 | 2018-10-03T05:50:33 | 2018-10-03T05:50:33 | 150,045,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 927 | java | package unalcol.optimization.real.testbed;
import unalcol.optimization.*;
/**
* <p>Title: Ackley</p>
* <p>Description: The Ackley function</p>
* <p>Copyright: Copyright (c) 2010</p>
* <p>Company: Kunsamu</p>
* @author Jonatan Gomez
* @version 1.0
*/
public class Ackley extends OptimizationFunction<double[]> {
/**
* Constructor: Creates a Ackley function
*/
public Ackley(){}
/**
* Evaluate the OptimizationFunction function over the real vector given
* @param x Real vector to be evaluated
* @return the OptimizationFunction function over the real vector
*/
public Double compute( double[] x ){
int n = x.length;
double sum1 = 0.0;
double sum2 = 0.0;
for( int i=0; i<n; i++ ){
sum1 += x[i]*x[i];
sum2 += Math.cos(2.0*Math.PI*x[i]);
}
sum1 /= n;
sum2 /= n;
return (20.0 + Math.exp(1.0) - 20.0*Math.exp(-0.2*Math.sqrt(sum1)) - Math.exp(sum2));
}
}
| [
"jufcontrerasco@unal.edu.co"
] | jufcontrerasco@unal.edu.co |
c94104fa70b975696e2a157de33f2837ebe304f3 | fc3d03a6de85b50d741f4646b6fc3c08a6b09c4a | /src/main/java/servlet/TestServlet.java | d80ff3a98cf26fa48cc1a3fdd6386693f2e5a696 | [] | no_license | RHRRD/CourseWorkRestart | dd5646c6411dd168fa8daf41984d658166a18599 | 15e682abfa499f3da01c10588ce7373cca5afbd7 | refs/heads/master | 2021-01-20T17:20:35.412145 | 2016-08-15T19:24:38 | 2016-08-15T19:24:38 | 65,757,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 755 | java | package servlet;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by Alex on 15.08.2016.
*/
@WebServlet(
name = "TestServlet",
urlPatterns = {"/test"}
)
public class TestServlet extends HttpServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
ServletOutputStream out = resp.getOutputStream();
out.write("test".getBytes());
out.flush();
out.close();
}
}
| [
"avlocr@gmail.com"
] | avlocr@gmail.com |
78a11a42f2b4093a311d29415aca31103ddc43bf | 2f768e1a547baac6d98bb335b5fde3cc33596ea9 | /src/main/java/com/test/test/Validation.java | 0c1cff60b7d9114c6073354679642c854d0d592f | [] | no_license | balukasik/AllegroTask | abdb79579ce82226c485c64666b20e624f0e54f7 | 31b8712fe18524d167a7ea68ec1df3a32c34fc80 | refs/heads/master | 2023-04-10T12:57:50.773808 | 2021-04-25T18:50:40 | 2021-04-25T18:50:40 | 360,695,663 | 1 | 0 | null | 2021-04-25T18:46:35 | 2021-04-22T22:17:49 | Java | UTF-8 | Java | false | false | 838 | java | package com.test.test;
import org.springframework.web.client.HttpClientErrorException;
public class Validation {
public static final String urlTemplate = "https://api.github.com/users/%s/repos?per_page=100&page=%d";
public static final String urlGithubApiLimit = "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting";
public static void validateUser(String user) {
if (user.length() == 0) {
throw new UserNotSpecifiedException(user);
} else if (user.length() > 40) {
throw new UserNotFoundException(user);
}
}
public static void githubError(HttpClientErrorException e, String user) {
if (e.getResponseBodyAsString()
.contains(urlGithubApiLimit)) {
throw new LimitExceededException("Too many request, check "+ urlGithubApiLimit);
}
throw new UserNotFoundException(user);
}
}
| [
"you@example.com"
] | you@example.com |
aed4223857f97e284804bf64de97667b1e4c9abe | 07aa2c9b78e64eef1b661805d44af5b2ab7578a4 | /app/src/main/java/cn/surine/schedulex/ui/splash/SplashFragment.java | 71f400c638fff8aff2e58720c79cace070fd9e5a | [] | no_license | mitokohaku/ScheduleX | b791599874e81b7f6687d23f93b7a383a5e33d4f | 176424460749c0e13d59a349ab4dcaf7019c7ae4 | refs/heads/master | 2021-01-07T09:00:48.660690 | 2020-02-19T07:56:17 | 2020-02-19T07:56:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,289 | java | package cn.surine.schedulex.ui.splash;
import android.os.Handler;
import android.view.View;
import cn.surine.schedulex.R;
import cn.surine.schedulex.base.Constants;
import cn.surine.schedulex.base.controller.BaseFragment;
import cn.surine.schedulex.base.utils.Navigations;
import cn.surine.schedulex.base.utils.Prefs;
/**
* Intro:
*
* @author sunliwei
* @date 2020-01-26 19:17
*/
public class SplashFragment extends BaseFragment {
private Handler mHandler = new Handler();
private Runnable runnable;
@Override
public int layoutId() {
return R.layout.fragment_splash;
}
@Override
public void onInit(View parent) {
runnable = () -> {
if(!Prefs.getBoolean(Constants.IS_FIRST, false)){
Navigations.open(SplashFragment.this,R.id.action_splashFragment_to_scheduleInitFragment);
}else{
Navigations.open(SplashFragment.this,R.id.action_splashFragment_to_scheduleFragment);
}
};
if(mHandler != null){
mHandler.postDelayed(runnable,1500);
}
}
@Override
public void onStop() {
super.onStop();
if(mHandler != null){
mHandler.removeCallbacks(runnable);
mHandler = null;
}
}
}
| [
"sunliwei@coohua.com"
] | sunliwei@coohua.com |
363d7d3df45990120bd0ac7e85c66eb95104003d | 481f067c5f6aa4a646fcfa54621faf556bd2b4a2 | /src/main/java/challenges/FourthChallenge.java | 9c51ad0fef47f6e2114fd79f1f3fe6d84d0fe7c6 | [] | no_license | rodrigoayalau-unosquare/workshop | f7a2889f57ddafd626d976bd40602ae34be19f02 | da26950943e7889310332773f8cd4783de02d660 | refs/heads/main | 2023-07-20T23:49:15.035548 | 2021-08-30T18:12:52 | 2021-08-30T18:12:52 | 401,441,661 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,494 | java | package challenges;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class FourthChallenge {
/*
Write a function:
class Solution { public int solution(int[] A); }
that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.
For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5.
Given A = [1, 2, 3], the function should return 4.
Given A = [−1, −3], the function should return 1.
Assume that:
N is an integer within the range [1..100,000];
each element of array A is an integer within the range [−1,000,000..1,000,000].
*/
@Test
public void fourthChallengeTest(){
Integer[] arrayNumbers = {1, 3, 6, 4, 1, 2};
solution(arrayNumbers);
}
public static void solution(Integer[] numbers) {
List<Integer> myList = new ArrayList<>(Arrays.asList(numbers));
Collections.sort(myList);
List<Integer> newList = new ArrayList<>();
myList.forEach(n -> {
if(!newList.contains(n)) {
newList.add(n);
}
});
for(int i=1; i<=newList.size(); i++) {
if(!newList.contains(i)) {
newList.add(i);
System.out.println(i);
}
}
Collections.sort(newList);
System.out.println(newList);
}
}
| [
"rodrigo.ayala@unosquare.com"
] | rodrigo.ayala@unosquare.com |
0274ca313f25b0c4872e7c8eaf7a9d29e01b21a0 | 7cdc272bc1284aef781fba2ee5e8eb59c0558982 | /src/main/java/com/kaffer/workshopmongo/domain/Comment.java | d012bf8406652eaff828571562fa62a611da93c2 | [] | no_license | yurikaffer/workshop-spring-boot-mongodb | 78fcf5c0322b6b86c8bb173bb0ebecf3b6e5a43f | f3c77890090602428836fee4ab53a56103433204 | refs/heads/main | 2023-04-21T22:09:58.775517 | 2021-05-09T21:46:33 | 2021-05-09T21:46:33 | 365,823,008 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,320 | java | package com.kaffer.workshopmongo.domain;
import java.io.Serializable;
import java.util.Date;
public class Comment implements Serializable{
static final long serialVersionUID = 1L;
private String id;
private String text;
private Date date;
public Comment() {
}
public Comment(String id, String text, Date date) {
super();
this.id = id;
this.text = text;
this.date = date;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Comment other = (Comment) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "Comment [id=" + id + ", text=" + text + ", date=" + date + "]";
}
}
| [
"yurikaffer@gmail.com"
] | yurikaffer@gmail.com |
67e58f878134d2291c8e69b003e152a0de71ed6a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_864082cf7de28f24f4aef60940f8ce8e9c2c5319/DateUtility/5_864082cf7de28f24f4aef60940f8ce8e9c2c5319_DateUtility_t.java | b31b52fb8d8e196b08143eb74d7f8dda8be39405 | [] | 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 | 4,931 | java | package fedora.server.utilities;
/**
* <p>Title: DateUtility.java</p>
* <p>Description: A collection of utility methods for performing</p>
* <p>frequently require tasks.</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author Ross Wayland
* @version 1.0
*/
import java.text.SimpleDateFormat;
import java.text.ParsePosition;
import java.util.Calendar;
import java.util.Date;
public abstract class DateUtility
{
private static final boolean debug = true; //Testing
private static final SimpleDateFormat formatter =
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
/**
* Converts a datetime string into and instance of java.util.Calendar using
* the date format: yyyy-MM-ddTHH:mm:ss
*
* @param dateTime A datetime string
* @return Corresponding instance of java.util.Calendar (returns null
* if dateTime string argument is empty string or null)
*/
public static Calendar convertStringToCalendar(String dateTime)
{
Calendar calendar = null;
if (!(dateTime == null) && !dateTime.equalsIgnoreCase(""))
{
calendar = Calendar.getInstance();
ParsePosition pos = new ParsePosition(0);
Date date = formatter.parse(dateTime, pos);
calendar.setTime(date);
}
return(calendar);
}
/**
* Converts a datetime string into and instance of java.util.Date using
* the date format: yyyy-MM-ddTHH:mm:ss
*
* @param dateTime A datetime string
* @return Corresponding instance of java.util.Date (returns null
* if dateTime string argument is empty string or null)
*/
public static Date convertStringToDate(String dateTime)
{
Date date = null;
if (!(dateTime == null) && !dateTime.equalsIgnoreCase(""))
{
ParsePosition pos = new ParsePosition(0);
date = formatter.parse(dateTime, pos);
}
return(date);
}
/**
* Converts an instance of java.util.Calendar into a string using
* the date format: yyyy-MM-ddTHH:mm:ss
*
* @param calendar An instance of java.util.Calendar
* @return Corresponding datetime string (returns null if Calendar
* argument is null)
*/
public static String convertCalendarToString(Calendar calendar)
{
String dateTime = null;
if (!(calendar == null))
{
Date date = calendar.getTime();
dateTime = formatter.format(date);
}
return(dateTime);
}
/**
* Converts an instance of java.util.Date into a String using
* the date format: yyyy-MM-ddTHH:mm:ss
*
* @param date Instance of java.util.Date
* @return Corresponding datetime string (returns null if Date argument
* is null)
*/
public static String convertDateToString(Date date)
{
String dateTime = null;
if (!(date == null))
{
dateTime = formatter.format(date);
}
return(dateTime);
}
/**
* Converts an instance of java.util.Calendar into and instance
* of java.util.Date.
*
* @param calendar Instance of java.util.Calendar
* @return Corresponding instance of java.util.Date (returns null
* if Calendar argument is null)
*/
public static Date convertCalendarToDate(Calendar calendar)
{
Date date = null;
if(!(calendar == null))
{
date = calendar.getTime();
}
return(date);
}
/**
* Converts an instance of java.util.Date into an instance
* of java.util.Calendar.
*
* @param date Instance of java.util.Date
* @return Corresponding instance of java.util.Calendar (returns null
* if Date argument is null)
*/
public static Calendar convertDateToCalendar(Date date)
{
Calendar calendar = null;
if (!(date == null))
{
calendar = Calendar.getInstance();
ParsePosition pos = new ParsePosition(0);
calendar.setTime(date);
}
return(calendar);
}
public static void main(String[] args)
{
String dateTimeString = "2002-08-22T13:58:06";
Calendar cal = convertStringToCalendar(dateTimeString);
System.out.println("DateString: "+dateTimeString+"\nConvertCalendarToString: "+cal);
Date date = convertStringToDate(dateTimeString);
System.out.println("\nDateString: "+dateTimeString+"\nConvertDateToString: "+
convertDateToString(date));
System.out.println("\nCalendar: "+cal+"\nConvertCalendarToString: "+
convertCalendarToString(cal));
System.out.println("\nDate: "+convertDateToString(date)+"\nConvertDateT0String: "+
convertDateToString(date));
System.out.println("\nCalendar: "+cal+"\nConvertCalendarToDate: "+
convertDateToString(convertCalendarToDate(cal)));
System.out.println("\nDate: "+convertDateToString(date)+
"\nConvertDateToCalendar: "+convertDateToCalendar(date));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
38c85620eada3157687aaf5f42b1537537af003d | 624117c40c6032a9a12c223d176518b7aec46f49 | /src/com/nationwide/chapter6/williams/AssignmentTwo.java | 23c8f9504a1be29934f3bff78c8bfed7c09553f3 | [] | no_license | Bravo2017/JavaForEveryone | dd8de35419e815334d0c7d857d7349f97b3b9f39 | aee14a0ce520f5e89084e2bad971811ec2448bf8 | refs/heads/master | 2021-05-05T23:08:38.393675 | 2016-08-05T01:09:03 | 2016-08-05T01:09:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,222 | java | package com.nationwide.chapter6.williams;
import java.util.Scanner;
/**
* This program reads a sequence of values and prints them, marking the largest
* value.
*/
public class AssignmentTwo {
public static void main(String[] args) {
final int LENGTH = 100;
double[] values = new double[LENGTH];
int currentSize = 0;
// Read inputs
System.out.println("Please enter values, Q to quit:");
Scanner in = new Scanner(System.in);
while (in.hasNextDouble() && currentSize < values.length) {
values[currentSize] = in.nextDouble();
currentSize++;
}
// Find the largest value
double largest = values[0];
for (int i = 1; i < currentSize; i++) {
if (values[i] > largest) {
largest = values[i];
}
}
// Find the smallest value
double smallest = values[0];
for (int i = 1; i < currentSize; i++) {
if (values[i] < smallest) {
smallest = values[i];
}
}
// Print all values, marking the largest
for (int i = 0; i < currentSize; i++) {
System.out.print(values[i]);
if (values[i] == largest) {
System.out.print(" <== largest value");
} else if (values[i] == smallest) {
System.out.print(" <== smallest value");
}
System.out.println();
}
}
}
| [
"tom.henricksen@zirous.com"
] | tom.henricksen@zirous.com |
d29d726f2eef48b4e642ee6397054cae3a2ff7c7 | eb469c539140000f061551e1c32cafd5dab0bb3c | /NewBank/newbank/server/Transaction.java | 69f85294045af027be9ab7cd3332fc2565fae5cd | [] | no_license | jo462/NewBank | 16f5fed1e3d325c2d2bd6ec2f083048e964c38c7 | bdfe04ac09ae164cfcf9ee36389962e069db2742 | refs/heads/master | 2022-04-15T07:14:44.827111 | 2020-04-12T19:00:15 | 2020-04-12T19:00:15 | 245,825,117 | 0 | 0 | null | 2020-04-11T15:34:06 | 2020-03-08T14:02:30 | Java | UTF-8 | Java | false | false | 2,224 | java | package newbank.server;
import java.time.LocalDate;
/*
* Author @Masi_Majange
*/
import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/*
* A transaction is a series of linked entries.
*/
public class Transaction {
private ArrayList<Entry> transaction = new ArrayList<Entry>();
/*
* A transaction is built from a number of entries. You'll need to build up the
* transaction list at source as an ArrayList<Entry> then you declare as type
* Transaction
*/
public Transaction (ArrayList<Entry> entries) {
this.transaction = entries;
}
/*
* Returns the entries in a transaction
*/
public String toString() {
String myTransactions ="" ;
for(Entry t : transaction) {
myTransactions = myTransactions + t.toString();
}
return myTransactions;
}
/*
* This method prints transactions linked to an account number at an <Entry> level.
* It can be called from the ledger as a sub method while it iterates over multiple
* transactions
*/
public void hasAccountNo(String accountNo) {
transaction
.stream()
.filter(x -> x.getAccountNo().contains(accountNo))
.forEach(System.out::print);
}
/*
* This method prints transactions linked to an account number and period (month and year)
* at an <Entry> level
*/
public Entry forPeriod(String accountNo, Integer month, Integer year) {
// Predicate<Entry> isPeriod = e-> ((month.equals(e.getDate().getMonth().getValue()) && (year.equals(e.getDate().getYear()))));
//Predicate<Entry> isAccount = e-> e.getAccountNo().equals(accountNo);
for(Entry e : transaction) {
if(e.getAccountNo().equals(accountNo)) {
if(e.getDate().getYear()==year&& e.getDate().getMonthValue()==month) {
return e;
}
}
}
return null;
}
public LocalDate getTransactionDate() {
return transaction.get(0).getDate();
}
/*
* Helper method sums up the total amounts relating to an account per transaction
*/
public Double getAmount (String accountNo) {
Double total = 0.00;
for(Entry e : transaction) {
if(e.getAccountNo().equals(accountNo)) {
total += e.getAmount();
}
}
return total;
}
}
| [
"masi.majange@volanteglobal.com"
] | masi.majange@volanteglobal.com |
72e7f1529f2027177bc96cc6d110694613328e6f | 7ed8be26752c069933b7157eb38e3c7965ee3987 | /gmall-ums/src/main/java/com/atguigu/gmall/ums/entity/MemberReceiveAddressEntity.java | db9545a5239de52fb3a0821d46e2b7c24c32e8d1 | [
"Apache-2.0"
] | permissive | admin-yjx/gmall | 2da143f8e5a4f63adffbb6c00318c57cbc59c8c0 | 0f7784e5e577307fbfc6d5db650b9d8088ae9426 | refs/heads/master | 2022-07-17T19:37:07.951471 | 2020-05-21T04:20:27 | 2020-05-21T04:20:27 | 237,971,752 | 0 | 0 | Apache-2.0 | 2022-07-06T20:47:10 | 2020-02-03T13:29:50 | JavaScript | UTF-8 | Java | false | false | 1,887 | java | package com.atguigu.gmall.ums.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 会员收货地址
*
* @author yaojiaxun
* @email 2624001338@qq.com
* @date 2020-02-04 14:58:13
*/
@ApiModel
@Data
@TableName("ums_member_receive_address")
public class MemberReceiveAddressEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
@ApiModelProperty(name = "id",value = "id")
private Long id;
/**
* member_id
*/
@ApiModelProperty(name = "memberId",value = "member_id")
private Long memberId;
/**
* 收货人姓名
*/
@ApiModelProperty(name = "name",value = "收货人姓名")
private String name;
/**
* 电话
*/
@ApiModelProperty(name = "phone",value = "电话")
private String phone;
/**
* 邮政编码
*/
@ApiModelProperty(name = "postCode",value = "邮政编码")
private String postCode;
/**
* 省份/直辖市
*/
@ApiModelProperty(name = "province",value = "省份/直辖市")
private String province;
/**
* 城市
*/
@ApiModelProperty(name = "city",value = "城市")
private String city;
/**
* 区
*/
@ApiModelProperty(name = "region",value = "区")
private String region;
/**
* 详细地址(街道)
*/
@ApiModelProperty(name = "detailAddress",value = "详细地址(街道)")
private String detailAddress;
/**
* 省市区代码
*/
@ApiModelProperty(name = "areacode",value = "省市区代码")
private String areacode;
/**
* 是否默认
*/
@ApiModelProperty(name = "defaultStatus",value = "是否默认")
private Integer defaultStatus;
}
| [
"5279003+yao_jiaxun@user.noreply.gitee.com"
] | 5279003+yao_jiaxun@user.noreply.gitee.com |
e90f42e91df11e80e3671ca51b7bda38ac93798c | 8b847255bbb0158f5952b51423a9dbab01874345 | /src/test/java/com/branstiterts/basic/utility/Constant.java | b710474b6b2d17e25432eb8d78db268f989bfa4d | [] | no_license | tbranstiter/basic_framework | 77b62897188c7b2eed969aaadedfe8b9c18ade05 | 05e68aacd7dee8930fcbacabb8ced3e723151d48 | refs/heads/master | 2021-01-09T05:19:15.249711 | 2017-02-07T15:18:21 | 2017-02-07T15:18:21 | 80,751,850 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package com.branstiterts.basic.utility;
/**
* Created by tbranstiter on 2/2/2017.
*/
public class Constant {
public static final String URL = "http://www.automationpractice.com";
// Data Provider Variables
public static final String ACCOUNT_DATA_CSV = System.getProperty("user.dir") + "/src/main/resources/data/accountData.csv";
public static final String DELIMITER = ",";
}
| [
"tbranstiter@KNY-LENOVO1558.XPX.intra"
] | tbranstiter@KNY-LENOVO1558.XPX.intra |
48d376f951641b8357775c01ae98c5d264c478a0 | 42b4b2000bfe0bb0dffa2a8d74f4d47916141dbe | /src/main/java/com/springmvc/controller/BankCategoryController.java | f74a290636414ceabcb0e61840fb5897ff4f1f54 | [] | no_license | hexingtong/Yuerfei | f84ab45e4b8522e72d5c92ba1d4edac4b2c1769b | 7a0fc24304451ae236f7b9cde24c2e242e0e4550 | refs/heads/master | 2020-04-25T09:00:48.366274 | 2019-05-17T01:25:48 | 2019-05-17T01:25:48 | 172,187,237 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,063 | java | package com.springmvc.controller;
import com.springmvc.pojo.ArticeSupper;
import com.springmvc.pojo.BankCard;
import com.springmvc.pojo.BankCategory;
import com.springmvc.pojo.PageResultInfo;
import com.springmvc.service.BankCardService;
import com.springmvc.service.BankCategoryService;
import com.util.JsonResult;
import com.util.StatusCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
@Api(value="银行类别页面controller",tags={"银行类别操作接口"})
@Controller
@RequestMapping("/bankCategory")
public class BankCategoryController {
@Autowired
BankCategoryService bankCategoryService;
@Autowired
BankCardService bankCardService;
// /**
// * @Author 苏俊杰
// * @Description //TODO 银行展示列表
// * @Date 11:24 2019/4/27
// * @Param
// * @return
// **/
// @ApiOperation(value = "获取银行展示列表", httpMethod = "POST", response = ArticeSupper.class, notes = "获取银行展示列表")
// @RequestMapping(value = "/selectAllList",method = RequestMethod.POST)
// @ResponseBody
// public JsonResult selectAllBankCategory(@RequestParam(value = "pageNo", defaultValue = "1",
// required = false)
// Integer pageNo,
// @RequestParam(value = "pageSize", defaultValue = "5", required = false)
// Integer pageSize, BankCategory bankCategory){
// JsonResult result=new JsonResult();
// PageResultInfo pageResultInfo=bankCategoryService.selectAllBankCategory(pageNo,pageSize,bankCategory);
// if(pageResultInfo.getTotal()==0){
// result.setCode(StatusCode.CODE_NULL);
// result.setMessage("is ok,but no result");
// }else {
// result.setCode(StatusCode.SUCCESSFULLY);
// result.setData(pageResultInfo);
// }
// return result;
//
// }
/**
* @Author 苏俊杰
* @Description //TODO 银行展示列表
* @Date 11:24 2019/4/27
* @Param
* @return
**/
@ApiOperation(value = "获取银行展示列表", httpMethod = "POST", response = BankCategory.class, notes = "name(银行名称) img(银行图片) welfare(银行福利) " +
"speed(发卡速度) banklimit(额度) passrate(通过率) shorturl(网址)")
@RequestMapping(value = "/selectAllList",method = RequestMethod.POST)
@ResponseBody
public JsonResult selectAllBankCategory(@RequestParam(value = "pageNo", defaultValue = "1",
required = false)
Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "5", required = false)
Integer pageSize, BankCategory bankCategory){
JsonResult result=new JsonResult();
PageResultInfo pageResultInfo=bankCategoryService.selectAllBankCategory(pageNo,pageSize,bankCategory);
if(pageResultInfo.getTotal()==0){
result.setCode(StatusCode.CODE_NULL);
result.setMessage("is success,but no result");
return result;
}else {
result.setCode(StatusCode.SUCCESSFULLY);
result.setMessage("is ok");
result.setData(pageResultInfo);
return result;
}
}
/**
* @Author 苏俊杰
* @Description //TODO 增加银行类别
* @Date 14:29 2019/4/27
* @Param [bankCategory]
* @return com.util.JsonResult
**/
@ApiOperation(value = "增加银行类别", httpMethod = "POST", response = BankCategory.class, notes = "name(银行名称) img(银行图片) welfare(银行福利) " +
"speed(发卡速度) banklimit(额度) passrate(通过率) shorturl(网址)")
@RequestMapping("/insertBankCategory")
@ResponseBody
public JsonResult insertBankCategory(BankCategory bankCategory) {
JsonResult result = new JsonResult();
bankCategory.setAddtime(new Date());
int i = bankCategoryService.insertBankCategory(bankCategory);
if (i>0) {
result.setMessage("is success");
result.setCode(StatusCode.SUCCESSFULLY);
return result;
} else {
result.setMessage("Maybe Parameter Exception");
result.setCode(StatusCode.FAILED);
return result;
}
}
/**
* @Author 苏俊杰
* @Description //TODO 删除银行分类
* @Date 15:00 2019/4/27
* @Param []
* @return com.util.JsonResult
**/
@ApiOperation(value = "删除银行类别", httpMethod = "POST", response = BankCategory.class, notes = "参数 id")
@RequestMapping("/deleteBankCategory")
@ResponseBody
public JsonResult deleteBankCategory(BankCategory bankCategory){
//删除银行卡之前 先查询有没有这个分类 有就不删除 没就删除
JsonResult result=new JsonResult();
BankCard bankCard=new BankCard();
bankCard.setCardcategoryid(bankCategory.getId());
long i=bankCardService.queryCountByWhere(bankCard);
if(i>0){
result.setCode(StatusCode.FAILED);
result.setMessage("不能删除,因为它下面有银行卡");
return result;
}else {
try {
bankCategoryService.deleteById(bankCategory.getId());
result.setCode(StatusCode.SUCCESSFULLY);
result.setMessage("is success");
return result;
}catch (Exception e){
result.setCode(StatusCode.FAILED);
result.setMessage("is Exception!");
return result;
}
}
}
@ApiOperation(value = "编辑银行类别", httpMethod = "POST", response = BankCategory.class, notes = "id name(银行名称) img(银行图片) welfare(银行福利) " +
"speed(发卡速度) banklimit(额度) passrate(通过率) shorturl(网址)")
@RequestMapping("/updateBankCategory")
@ResponseBody
public JsonResult updateBamkCategory(BankCategory bankCategory){
JsonResult result=new JsonResult();
try {
bankCategoryService.updateSelectiveById(bankCategory);
result.setMessage("is success");
result.setCode(StatusCode.SUCCESSFULLY);
return result;
}catch (Exception e){
result.setCode(StatusCode.FAILED);
e.printStackTrace();
result.setMessage("is Exception");
return result;
}
}
}
| [
"1029453447@qq.com"
] | 1029453447@qq.com |
e0a921ed0918cc2fe1643c0a683831044bb3cd59 | d9733d3e99053a9c073c3e842ad1794ed51eba4f | /src/main/java/view/managedBean/UserMBean.java | 8693ab5a7334676afd5800c1fbbb898f828c116b | [] | no_license | Mdidu/TP_GestionStock_JSF_Primefaces | 08af4c37b8591483b5c9bbb62f4be412272ac7cb | 42cd682c80caa9e51ce64f92e6958645de6be466 | refs/heads/main | 2023-04-18T13:41:07.147330 | 2021-04-19T13:55:46 | 2021-04-19T13:55:46 | 358,544,668 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,954 | java | package view.managedBean;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.servlet.http.HttpSession;
import persistence.dao.UserDao;
import persistence.dao.UserDaoImpl;
import persistence.entities.Role;
import persistence.entities.Stockuser;
@ManagedBean
@SessionScoped
public class UserMBean {
private Stockuser user = new Stockuser();
private Stockuser selectedUser = new Stockuser();
UserDao userDao = new UserDaoImpl();
private List<Stockuser> listUsers = new ArrayList<Stockuser>();
private String test = "test";
public String getTest() {
return test;
}
public void setTest(String test) {
this.test = test;
}
public Stockuser getUser() {
return user;
}
public void setUser(Stockuser user) {
this.user = user;
}
public Stockuser getSelectedUser() {
return selectedUser;
}
public void setSelectedUser(Stockuser selectedUser) {
this.selectedUser = selectedUser;
}
public List<Stockuser> getListUsers() {
listUsers = userDao.findAll();
return listUsers;
}
public void setListUsers(List<Stockuser> listUsers) {
this.listUsers = listUsers;
}
public void addUser(ActionEvent e) {
Role role = new Role();
role.setIdrole(new BigDecimal(1));
user.setRole(role);
userDao.add(user);
user = new Stockuser();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Ajout effectué avec succès"));
}
public void deleteUser(ActionEvent e) {
if(selectedUser == null || selectedUser.getIduser() == new BigDecimal(0)) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Attention" ,"Aucun utilisateur n'a été sélectionné !"));
} else {
userDao.delete(selectedUser);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Suppresion effectué avec succès"));
}
}
public String editUser() {
return "editUser.xhtml";
}
public void updateUser(ActionEvent e) {
userDao.update(selectedUser);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Modification effectué avec succès"));
}
public String login() {
Stockuser userLog = userDao.findUserByLoginAndPassword(user.getLogin(),user.getPassword());
if(userLog != null) {
HttpSession session = SessionUtils.getSession();
BigDecimal userLogId = userLog.getRole().getIdrole();
String userLogNom = userLog.getLogin();
session.setAttribute("id", userLogId);
session.setAttribute("nom", userLogNom);
return "accueil.xhtml";
} else {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Attention", "Utilisateur inexistant"));
return "login.xhtml";
}
}
}
| [
"alexandre.meddas@gmail.com"
] | alexandre.meddas@gmail.com |
59b5cb4dae27a81d796f3aee9feb7cf66945e586 | 4439825b9a0216cea035ba508785664df00b982b | /components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/EnrolmentDAOImpl.java | f6b22e07d6210951d324fd9001de5d25ce4eeb28 | [
"Apache-2.0"
] | permissive | charithag/carbon-device-mgt-framework | 63597d030c8a0b7b36e5c8ecf30980c2df9433e7 | a687530c9dd59a90fdb1b5770f45a854d4cf5eb5 | refs/heads/master | 2021-01-10T19:01:24.271335 | 2015-08-07T12:51:07 | 2015-08-07T12:51:07 | 38,679,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,310 | java | /*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.wso2.carbon.device.mgt.core.dao.impl;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.dao.EnrolmentDAO;
import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
import java.sql.*;
import java.util.Date;
public class EnrolmentDAOImpl implements EnrolmentDAO {
@Override
public int addEnrollment(int deviceId, EnrolmentInfo enrolmentInfo,
int tenantId) throws DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
int enrolmentId = -1;
try {
conn = this.getConnection();
String sql = "INSERT INTO DM_ENROLMENT(DEVICE_ID, OWNER, OWNERSHIP, STATUS, " +
"DATE_OF_ENROLMENT, DATE_OF_LAST_UPDATE, TENANT_ID) VALUES(?, ?, ?, ?, ?, ?, ?)";
stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
stmt.setInt(1, deviceId);
stmt.setString(2, enrolmentInfo.getOwner());
stmt.setString(3, enrolmentInfo.getOwnership().toString());
stmt.setString(4, enrolmentInfo.getStatus().toString());
stmt.setTimestamp(5, new Timestamp(new Date().getTime()));
stmt.setTimestamp(6, new Timestamp(new Date().getTime()));
stmt.setInt(7, tenantId);
stmt.execute();
rs = stmt.getGeneratedKeys();
if (rs.next()) {
enrolmentId = rs.getInt(1);
}
return enrolmentId;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while adding enrolment configuration", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
}
}
@Override
public int updateEnrollment(int deviceId, EnrolmentInfo enrolmentInfo,
int tenantId) throws DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
int enrolmentId = -1;
try {
conn = this.getConnection();
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, " +
"DATE_OF_ENROLMENT = ?, DATE_OF_LAST_UPDATE = ? WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?";
stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
stmt.setString(1, enrolmentInfo.getOwnership().toString());
stmt.setString(2, enrolmentInfo.getStatus().toString());
stmt.setTimestamp(3, new Timestamp(enrolmentInfo.getDateOfEnrolment()));
stmt.setTimestamp(4, new Timestamp(enrolmentInfo.getDateOfLastUpdate()));
stmt.setInt(5, deviceId);
stmt.setString(6, enrolmentInfo.getOwner());
stmt.setInt(7, tenantId);
stmt.executeUpdate();
rs = stmt.getGeneratedKeys();
if (rs.next()) {
enrolmentId = rs.getInt(1);
}
return enrolmentId;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while updating enrolment configuration", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
}
}
@Override
public int removeEnrollment(int deviceId, String currentOwner,
int tenantId) throws DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
int enrolmentId = -1;
try {
conn = this.getConnection();
String sql = "DELETE DM_ENROLMENT WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?";
stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
stmt.setInt(1, deviceId);
stmt.setString(2, currentOwner);
stmt.setInt(3, tenantId);
stmt.executeUpdate();
rs = stmt.getGeneratedKeys();
if (rs.next()) {
enrolmentId = rs.getInt(1);
}
return enrolmentId;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while removing device enrolment", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
}
}
@Override
public boolean setStatus(int deviceId, String currentOwner, EnrolmentInfo.Status status,
int tenantId) throws DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
try {
conn = this.getConnection();
String sql = "UPDATE DM_ENROLMENT SET STATUS = ? WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?";
stmt = conn.prepareStatement(sql);
stmt.setString(1, status.toString());
stmt.setInt(2, deviceId);
stmt.setString(3, currentOwner);
stmt.setInt(4, tenantId);
stmt.executeUpdate();
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while setting the status of device enrolment", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, null);
}
return true;
}
@Override
public EnrolmentInfo.Status getStatus(int deviceId, String currentOwner,
int tenantId) throws DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
EnrolmentInfo.Status status = null;
try {
conn = this.getConnection();
String sql = "SELECT STATUS FROM DM_ENROLMENT WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?";
stmt = conn.prepareStatement(sql);
stmt.setInt(2, deviceId);
stmt.setString(3, currentOwner);
stmt.setInt(4, tenantId);
rs = stmt.executeQuery();
if (rs.next()) {
status = EnrolmentInfo.Status.valueOf(rs.getString("STATUS"));
}
return status;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while setting the status of device enrolment", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
}
}
@Override
public EnrolmentInfo getEnrolment(int deviceId, String currentOwner,
int tenantId) throws DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
EnrolmentInfo enrolmentInfo = null;
try {
conn = this.getConnection();
String sql = "SELECT ID, DEVICE_ID, OWNER, OWNERSHIP, STATUS, DATE_OF_ENROLMENT, " +
"DATE_OF_LAST_UPDATE, TENANT_ID FROM DM_ENROLMENT WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?";
stmt = conn.prepareStatement(sql);
stmt.setInt(1, deviceId);
stmt.setString(2, currentOwner);
stmt.setInt(3, tenantId);
rs = stmt.executeQuery();
if (rs.next()) {
enrolmentInfo = this.loadEnrolment(rs);
}
return enrolmentInfo;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while retrieving the enrolment " +
"information of user '" + currentOwner + "' upon device '" + deviceId + "'", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
}
}
private Connection getConnection() throws DeviceManagementDAOException {
return DeviceManagementDAOFactory.getConnection();
}
private EnrolmentInfo loadEnrolment(ResultSet rs) throws SQLException {
EnrolmentInfo enrolmentInfo = new EnrolmentInfo();
enrolmentInfo.setOwner(rs.getString("OWNER"));
enrolmentInfo.setOwnership(EnrolmentInfo.OwnerShip.valueOf(rs.getString("OWNERSHIP")));
enrolmentInfo.setDateOfEnrolment(rs.getTimestamp("DATE_OF_ENROLMENT").getTime());
enrolmentInfo.setDateOfLastUpdate(rs.getTimestamp("DATE_OF_LAST_UPDATE").getTime());
enrolmentInfo.setStatus(EnrolmentInfo.Status.valueOf(rs.getString("STATUS")));
return enrolmentInfo;
}
}
| [
"charitha.ws@gmail.com"
] | charitha.ws@gmail.com |
08adca31de32bb87016be1d5769522a516bc1f83 | 61a8a308d9189870311c45de6d7bc540543f0119 | /app/src/main/java/com/wdpfm/mmkv/MainActivity.java | 34bebea37396fe3cad7d40891c7637ee4cf46783 | [] | no_license | wdpfm/MMKV | 2fdc0584341fb239ad0abab80396863995fd6f24 | 66b5211281805b04e4e35d553a56bfbe1ef80ca9 | refs/heads/master | 2022-06-11T12:06:35.757841 | 2020-05-01T00:37:27 | 2020-05-01T00:37:27 | 260,345,216 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,401 | java | package com.wdpfm.mmkv;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import com.tencent.mmkv.MMKV;
import java.util.Arrays;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MMKV.initialize(this);//初始化设定 MMKV 的根目录 这个必不可少
MMKV kv = MMKV.defaultMMKV();//获取默认MMKV对象
//给按钮加对象的省略方法 无需声明button对象 直接获取按钮
boolean bValue = kv.decodeBool("live");//decode解码 从数据里取出关键字bool的值 这个"bool"的值是上一行添加的
TextView t1=findViewById(R.id.edit1);
t1.setText(bValue?"活着":"死了");//条件?是:否
int iValue = kv.decodeInt("age");//decode解码 从数据里取出关键字bool的值 这个"bool"的值是上一行添加的
TextView t2=findViewById(R.id.edit2);
t2.setText(iValue+"");//条件?是:否
String sValue = kv.decodeString("name");//decode解码 从数据里取出关键字bool的值 这个"bool"的值是上一行添加的
TextView t3=findViewById(R.id.edit3);
t3.setText(sValue);//条件?是:否
findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MMKV kv = MMKV.defaultMMKV();//获取默认MMKV对象
kv.encode("live", true);//encode的意思是编码 这个就是把这对关键字-值 存储
}
});
findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MMKV kv = MMKV.defaultMMKV();//获取默认MMKV对象
kv.encode("age", 11);//encode的意思是编码 这个就是把这对关键字-值 存储
//这个出现的问题是不能setText为一个int 拼接一个空字符串进去就可以了
//现在的操作是存储指定数据并 读取MMKV显示到界面 那怎么让app启动的时候读取呢
}
});
findViewById(R.id.button3).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MMKV kv = MMKV.defaultMMKV();//获取默认MMKV对象
kv.encode("name", "pfm");//encode的意思是编码 这个就是把这对关键字-值 存
}
});
//删除单个
kv.removeValueForKey("bool");
System.out.println("bool: " + kv.decodeBool("bool"));
//删除多个
kv.removeValuesForKeys(new String[]{"int", "long"});
System.out.println("allKeys: " + Arrays.toString(kv.allKeys()));
//查询是否存在
boolean hasBool = kv.containsKey("bool");
//
// kv.encode("int", 1);//存int型
// int iValue = kv.decodeInt("int");//这样取出来int的值就是1
//
// kv.encode("string", "Hello from mmkv");//存字符串型
// String str = kv.decodeString("string");//这样取出来string的值就是Hello from mmkv
// //比sp简单 下面做个演示
}
}
| [
"pfm9866@126.com"
] | pfm9866@126.com |
302074d8c9508971d02d8e983ccb9373bc7effd6 | 9cbe2be1ca046faf555e91170f4ffce5e143b238 | /mom-api/src/main/java/com/github/alessandrocolantoni/mom/dao/Dao.java | 34be0ecd1c94db1e248a340fcc88f622667a62ba | [
"Apache-2.0"
] | permissive | alessandrocolantoni/mom | 703bcaf51a6aa59259fef3e2854fa87d51cd5fb8 | e4e1d73cf58141c3951a5853f3887194826e95d2 | refs/heads/master | 2021-01-16T21:21:30.810458 | 2016-07-30T10:56:25 | 2016-07-30T10:56:25 | 62,913,028 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,474 | java | package com.github.alessandrocolantoni.mom.dao;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.github.alessandrocolantoni.mom.query.LogicCondition;
public interface Dao extends Serializable {
public <E> E findByPrimaryKey(Class<E> realClass, Object pkValue) throws DataAccessException;
public <E> E findObjectByTemplate(E entity) throws DataAccessException;
public <E> Object findObjectByLogicCondition(Class<E> realClass, LogicCondition logicCondition) throws DataAccessException;
public <E,T> E findObjectByLogicCondition(String[]selectFields, Class<T> realClass, LogicCondition logicCondition, String orderBy) throws DataAccessException;
public <E,T> E findObjectByLogicCondition(String[]selectFields, Class<T> realClass, LogicCondition logicCondition) throws DataAccessException;
public <E> E findObjectByQueryString(String queryString) throws DataAccessException;
public <E> E findObjectByQueryString(String queryString, String parameterName, Object parameterValue) throws DataAccessException;
public <E> E findObjectByQueryString(String queryString, Map<String,Object> parameters) throws DataAccessException;
public <E> E findObjectByNativeQueryString(String queryString) throws DataAccessException;
public <E> E findObjectByNativeQueryString(String queryString, String parameterName, Object parameterValue) throws DataAccessException;
public <E> E findObjectByNativeQueryString(String queryString, Map<String,Object> parameters) throws DataAccessException;
/**
*
* @param entity
* @param firstResult
* @param maxResults
* @param orderBy string to concat to ORDER BY. For example field1 asc, field2 desc
* @return
* @throws DataAccessException
*/
public <E> Collection<E> findCollectionByTemplate(E entity,
Integer firstResult, Integer maxResults,
String orderBy) throws DataAccessException;
public <E> List<E> findCollectionByTemplate(E entity) throws DataAccessException;
public <E> List<E> findCollectionByTemplate(E entity, String orderBy) throws DataAccessException;
public <E> List<E> findCollectionByTemplate(E entity, Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByNullFields(Class<E> realClass, String[] nullFields) throws DataAccessException;
public <E> List<E> findCollectionByLogicCondition(Class<E> realClass, LogicCondition logicCondition) throws DataAccessException;
public <E,T> List<E> findCollectionByLogicCondition(String[]selectFields, Class<T> realClass, LogicCondition logicCondition) throws DataAccessException;
public <E,T> List<E> findCollectionByLogicCondition(String[]selectFields, Class<T> realClass, LogicCondition logicCondition, String orderBy) throws DataAccessException;
public <E> List<E> findCollectionByLogicCondition(Class<E> realClass, LogicCondition logicCondition, String orderBy) throws DataAccessException;
public <E,T> List<E> findCollectionByLogicCondition(Boolean distinct, String[]selectFields, Class<T> realClass, LogicCondition logicCondition, String orderBy) throws DataAccessException;
public <E,T> List<E> findCollectionByLogicCondition(Boolean distinct,String[] selectFields, Class<T> realClass, LogicCondition logicCondition, String orderBy,Integer firstResult, Integer maxResults) throws DataAccessException;
public <E,T> List<E> findCollectionByLogicCondition(String[] selectFields, Class<T> realClass, LogicCondition logicCondition, String orderBy,Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByLogicCondition(Class<E> realClass, LogicCondition logicCondition, String orderBy,Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByLogicCondition(Boolean distinct,Class<E> realClass, LogicCondition logicCondition, String orderBy) throws DataAccessException;
public <E> List<E> findCollectionByLogicCondition(Boolean distinct, Class<E> realClass, LogicCondition logicCondition) throws DataAccessException;
public <E,T> List<E> findCollectionByLogicCondition(Boolean distinct, String[]selectFields, Class<T> realClass, LogicCondition logicCondition) throws DataAccessException;
/**
*
* @param distinct
* @param selectFields
* @param realClass
* @param logicCondition
* @param orderBy orderBy string to concat to ORDER BY. For example field1 asc, field2 desc
* @param groupBy
* @param firstResult
* @param maxResults
* @return
* @throws DataAccessException
*/
public <E,T> List<E> findCollectionByLogicCondition(Boolean distinct,String[] selectFields, Class<T> realClass, LogicCondition logicCondition, String orderBy,String[] groupBy, Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByQueryString(String queryString) throws DataAccessException;
public <E> List<E> findCollectionByQueryString(String queryString, Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByQueryString(String queryString, String parameterName, Object parameterValue) throws DataAccessException;
public <E> List<E> findCollectionByQueryString(String queryString, Map<String,Object> parameters) throws DataAccessException;
public <E> List<E> findCollectionByQueryString(String queryString, String parameterName, Object parameterValue, Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByQueryString(String queryString, Map<String,Object> parameters, Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByNativeQueryString(String queryString) throws DataAccessException;
public <E> List<E> findCollectionByNativeQueryString(String queryString, Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByNativeQueryString(String queryString, String parameterName, Object parameterValue) throws DataAccessException;
public <E> List<E> findCollectionByNativeQueryString(String queryString, Map<String,Object> parameters) throws DataAccessException;
public <E> List<E> findCollectionByNativeQueryString(String queryString, String parameterName, Object parameterValue, Integer firstResult, Integer maxResults) throws DataAccessException;
public <E> List<E> findCollectionByNativeQueryString(String queryString, Map<String,Object> parameters,Integer firstResult, Integer maxResults) throws DataAccessException;
public <E,T> List<E> findCollectionByOrValues(Class<E> realClass,String pAttributeName,List<T> valuesCollection) throws DataAccessException;
public <E,T> List<E> findCollectionByFieldInCollection(Class<E> realClass,String pAttributeName, List<T> valuesCollection) throws DataAccessException;
public <E> List<E> searchValueInFields(Class<E> realClass, String[] pAttributeNames, Object value) throws DataAccessException;
public <E> List<E> getCollectionOfStoredItemsNotInBean(Object pInstance, String pAttributeName) throws DataAccessException;
public <E> List<E> getCollectionOfStoredItemsInBean(Object pInstance, String pAttributeName) throws DataAccessException;
public <E> List<E> getStoredCollection(Object pInstance, String pAttributeName) throws DataAccessException;
public <E> E getStoredSingleObject(Object pInstance, String pAttributeName) throws DataAccessException;
public Object refresh(Object refreshVO) throws DataAccessException;
public void refreshReference(Object pInstance, String pAttributeName) throws DataAccessException;
public void refreshAllReferences(Object pInstance) throws DataAccessException;
public void refreshAllReferencesInCollection(Collection<? extends Object> valueObjectsCollection) throws DataAccessException;
public <E> void retrieveReferenceInCollection(Collection<E> valueObjectsCollection, String pAttributeName) throws DataAccessException;
public void retrieveUninitializedReference(Object pInstance, String pAttributeName) throws DataAccessException;
public void retrieveAllUninitializedReferences(Object pInstance) throws DataAccessException;
public void retrievePathReference(Object valueobjectOrCollection, String path) throws DataAccessException;
public void retrieveUninitializedPathReference(Object valueobjectOrCollection, String path) throws DataAccessException;
public void remove(Object entity) throws DataAccessException;
public void removeCollection(Collection<? extends Object> entities) throws DataAccessException;
public void deleteItemsNotInCollectionsInPaths(Object parent, Collection<String> paths, boolean deleteManyToManyReference) throws DataAccessException;
public void deleteItemsNotInCollectionsInPaths(Object parent, Collection<String> paths) throws DataAccessException;
public void deletePathsCascade(Object parent, Collection<String> paths, boolean deleteManyToManyReference) throws DataAccessException;
public void deletePathsCascade(Object parent, Collection<String> paths) throws DataAccessException;
public Object merge(Object entity) throws DataAccessException;
public void mergeCollection(Collection<?> entities) throws DataAccessException;
public void persist(Object entity) throws DataAccessException;
public void persistCollection(Collection<?> entities) throws DataAccessException;
}
| [
"alessandro.colantoni@AKTPO011.aktios.lan"
] | alessandro.colantoni@AKTPO011.aktios.lan |
49343a623937b7dd0e14d8d6522882b6467954f2 | 34a2566a072fc6ed72e7db6e4abb5baa6de6cddf | /src/cn/controller/UserController.java | b6c3c14652ff8e0fa4b510d11bda473522fbbd49 | [] | no_license | xiaojunjie-hub/oes | b2e98d1fbcb4103e7c4f52249b64a07902d51d7d | 7efd6dc38c17fb5a48c9c969aa1536039aa9a633 | refs/heads/master | 2022-12-17T07:50:28.831836 | 2020-09-25T12:53:34 | 2020-09-25T12:53:34 | 296,344,721 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,845 | java | package cn.controller;
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import cn.entity.Kind;
import cn.entity.News;
import cn.entity.Record;
import cn.entity.User;
import cn.service.KindService;
import cn.service.NewsService;
import cn.service.RecordService;
import cn.service.UserService;
import com.github.pagehelper.PageInfo;
@Controller
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@Autowired
private RecordService recordService;
@Autowired
private NewsService newsService;
@Autowired
private KindService kindService;
//3
@RequestMapping("getUserlist")//查询学生
public String getUserlist(String username, Integer pageNum,
Model model) {
if (pageNum == null) {
pageNum = 1;
}
PageInfo<User> pageInfo = userService.getUserList(username,
pageNum);
model.addAttribute("pageInfo", pageInfo);
model.addAttribute("username", username);
return "user";
}
//3
@RequestMapping("getTeacherlist")//查询老师
public String getTeacherlist(String username, Integer pageNum,
Model model) {
if (pageNum == null) {
pageNum = 1;
}
PageInfo<User> pageInfo = userService.getTeacherList(username, pageNum);
model.addAttribute("pageInfo", pageInfo);
model.addAttribute("username", username);
return "teacher";
}
@RequestMapping("login")
public String login(String username, String password,
HttpSession session, Model model) {
System.out.println("login ============ ");
User user = userService.login(username, password);
if (null != user) {//登陆成功
session.setAttribute("userSession", user);
session.setAttribute("role", user.getRole());
List<News> nList=newsService.getgonggaolist();
model.addAttribute("gonggao",nList.get(0));
List<Kind> kinds=kindService.getAll();
session.setAttribute("kindList", kinds);
return "index";
}else{//登陆失败
model.addAttribute("wrong", "请输入正确的用户名或者登录密码");
return "login/login";
}
}
@RequestMapping("logout")
public String LoginOut(HttpSession session) {
session.removeAttribute("userSession");
session.removeAttribute("role");
return "index";
}
//3 添加用户
@RequestMapping("addUser")
public String adduser(User user,@RequestParam("file") MultipartFile file,Model model,HttpSession session,HttpServletRequest request) throws IllegalStateException, IOException{
if(!file.isEmpty()){
String path = request.getSession().getServletContext().getRealPath("/headpic");
String filename=file.getOriginalFilename();
File filepath=new File(path,filename);
if(!filepath.getParentFile().exists()){
filepath.getParentFile().mkdirs();
}
file.transferTo(new File(path+File.separator+filename));
user.setHeadpic(filename);
User user2=userService.selectByUserName(user.getUsername());
Integer i=(Integer)session.getAttribute("role");
if(i!=null){
if(user2!=null){
model.addAttribute("wrong","注册失败,用户名已存在");
}else{
userService.insert(user);
}
if(user.getRole()==2){
return "redirect:/user/getTeacherlist";
}
if(user.getRole()==3){
return "redirect:/user/getUserlist";
}
}else{
if(user2!=null){
model.addAttribute("wrong","注册失败,用户名已存在");
}else{
model.addAttribute("success","注册成功,请登录---");
userService.insert(user);
}
return "login/login";
}
}
return null;
}
//4
@RequestMapping("delGuanZhu")
public String delGuanZhu(int id) {
recordService.deleteByPrimaryKey(id);
return "redirect:/user/getMyGuanZhu";
}
//3
@RequestMapping("delUser")
public String delUser(int id) {
User user=userService.selectByPrimaryKey(id);
if(user.getRole()==3){
userService.deleteByPrimaryKey(id);
return "redirect:/user/getUserlist";
}else{
userService.deleteByPrimaryKey(id);
return "redirect:/user/getTeacherlist";
}
}
@RequestMapping("delUserT")
public String delUserT(int id) {
User user=userService.selectByPrimaryKey(id);
user.setRole(-1);
userService.updateByPrimaryKeySelective(user);
return "redirect:/user/getTeacherlist";
}
@RequestMapping("delUserJ")
public String delUserJ(int id) {
User user=userService.selectByPrimaryKey(id);
user.setRole(2);
userService.updateByPrimaryKey(user);
return "redirect:/user/getTeacherlist";
}
//3个人中心
@RequestMapping("toupdateMe")
public String toupdateMe(HttpSession session,Model model){
User user=(User) session.getAttribute("userSession");
model.addAttribute("item",user);
return "register";
}
@RequestMapping("updateMe")
public String updateMe(@RequestParam("file") MultipartFile file,HttpServletRequest request,User record,Model model,HttpSession session) throws IllegalStateException, IOException{
if(!file.isEmpty()){
String path = request.getSession().getServletContext().getRealPath("/headpic");
String filename=file.getOriginalFilename();
File filepath=new File(path,filename);
if(!filepath.getParentFile().exists()){
filepath.getParentFile().mkdirs();
}
file.transferTo(new File(path+File.separator+filename));
record.setHeadpic(filename);
}
userService.updateByPrimaryKeySelective(record);
session.removeAttribute("userSession");
session.removeAttribute("role");
session.setAttribute("userSession", record);
session.setAttribute("role", record.getRole());
return "index";
}
@RequestMapping("toupdateUser/{id}")
@ResponseBody
public User toupdateUser(@PathVariable("id") int id){
User user=userService.selectByPrimaryKey(id);
return user;
}
@RequestMapping("updateUser")
public String updateUser(@RequestParam("file") MultipartFile file,HttpServletRequest request,User user,HttpSession session) throws IllegalStateException, IOException {
if(!file.isEmpty()){
String path = request.getSession().getServletContext().getRealPath("/headpic");
String filename=file.getOriginalFilename();
File filepath=new File(path,filename);
if(!filepath.getParentFile().exists()){
filepath.getParentFile().mkdirs();
}
file.transferTo(new File(path+File.separator+filename));
user.setHeadpic(filename);
}
userService.updateByPrimaryKeySelective(user);
if(user.getRole()==3){
return "redirect:/user/getUserlist";
}else{
return "redirect:/user/getTeacherlist";
}
}
@RequestMapping("getMyGuanZhu")
public String getMyGuanZhu(HttpSession session,Model model, Integer pageNum){
if (pageNum == null) {
pageNum = 1;
}
User user=(User) session.getAttribute("userSession");
PageInfo<Record> pageInfo = recordService.getMyGuanZhu(user.getId(), pageNum);
model.addAttribute("pageInfo",pageInfo);
return "guanzhu";
}
// @RequestMapping("sixin")
// public String sixin(Integer nid,String content,HttpSession session,Model model){
// Message message=new Message();
// User user=(User) session.getAttribute("userSession");
// message.setNid(nid);
// message.setUid(user.getId());
// message.setContent(content);
// message.setIsread(0);
// messageService.insert(message);
// return "redirect:/user/getMyGuanZhu";
//
// }
// @RequestMapping("getMysixin")
// public String getMysixin(Integer nid,String content,HttpSession session,Model model){
// User user=(User) session.getAttribute("userSession");
// List<Message> mList=messageService.getMyMessageList(user.getId());
// model.addAttribute("list",mList);
// return "sixin";
// }
//
// @RequestMapping("tolooksixin/{id}")
// @ResponseBody
// public Message tolooksixin(@PathVariable("id") int id){
// Message user=messageService.selectByPrimaryKey(id);
// return user;
// }
}
| [
"1745696936@qq.com"
] | 1745696936@qq.com |
d2c0911e6bf139b18181b25539eae0277c3588e1 | e5fdec9df80b4958f49250f90fd05c13e3bda8b7 | /org.servicifi.gelato.language.cobol/src-gen/org/servicifi/gelato/language/cobol/water/RepositoryDescriptionInfo.java | e6ac5b5c55ace569af4e7df6aa97558280fd96e4 | [] | no_license | amirms/gelato | 9125e6ac3a56e5bcfd032db855a4c269bdfc5152 | 972d7309dc37c57d17d2b1486a49f00830983eb8 | refs/heads/master | 2021-06-03T22:07:12.010077 | 2019-03-10T11:54:27 | 2019-03-10T11:54:27 | 27,443,539 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,009 | java | /**
*/
package org.servicifi.gelato.language.cobol.water;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.util.Enumerator;
/**
* <!-- begin-user-doc -->
* A representation of the literals of the enumeration '<em><b>Repository Description Info</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see org.servicifi.gelato.language.cobol.water.WaterPackage#getRepositoryDescriptionInfo()
* @model
* @generated
*/
public enum RepositoryDescriptionInfo implements Enumerator {
/**
* The '<em><b>Class</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #CLASS_VALUE
* @generated
* @ordered
*/
CLASS(0, "class", "CLASS"),
/**
* The '<em><b>Is</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #IS_VALUE
* @generated
* @ordered
*/
IS(1, "is", "IS");
/**
* The '<em><b>Class</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Class</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #CLASS
* @model name="class" literal="CLASS"
* @generated
* @ordered
*/
public static final int CLASS_VALUE = 0;
/**
* The '<em><b>Is</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Is</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #IS
* @model name="is" literal="IS"
* @generated
* @ordered
*/
public static final int IS_VALUE = 1;
/**
* An array of all the '<em><b>Repository Description Info</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final RepositoryDescriptionInfo[] VALUES_ARRAY =
new RepositoryDescriptionInfo[] {
CLASS,
IS,
};
/**
* A public read-only list of all the '<em><b>Repository Description Info</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<RepositoryDescriptionInfo> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Repository Description Info</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param literal the literal.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static RepositoryDescriptionInfo get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
RepositoryDescriptionInfo result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Repository Description Info</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name the name.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static RepositoryDescriptionInfo getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
RepositoryDescriptionInfo result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Repository Description Info</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the integer value.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static RepositoryDescriptionInfo get(int value) {
switch (value) {
case CLASS_VALUE: return CLASS;
case IS_VALUE: return IS;
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final int value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String name;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String literal;
/**
* Only this class can construct instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private RepositoryDescriptionInfo(int value, String name, String literal) {
this.value = value;
this.name = name;
this.literal = literal;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLiteral() {
return literal;
}
/**
* Returns the literal value of the enumerator, which is its string representation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
return literal;
}
} //RepositoryDescriptionInfo
| [
"amir.iust@gmail.com"
] | amir.iust@gmail.com |
fbec3cf8527afcd54415e8add0f5516acccc1007 | 024fba4b19314c73efb4d69ad871d5dfcf3bd23a | /app/src/main/java/com/example/wagh/jsontest/MainActivity.java | 1da7d74a84ec88f9579beecbcbedfee074176f71 | [] | no_license | studymadara/JSONTest | feffaa935a0c152a514b277c556cba9128810f0d | 2cf8f04a2d80dc09eb97f83bd25c8075863729d0 | refs/heads/master | 2021-01-19T05:39:41.000529 | 2016-07-17T13:42:46 | 2016-07-17T13:42:46 | 63,533,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,008 | java | package com.example.wagh.jsontest;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import com.facebook.AccessToken;
import com.facebook.AccessTokenTracker;
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.Profile;
import com.facebook.ProfileTracker;
import com.facebook.login.LoginResult;
import com.facebook.login.widget.LoginButton;
import org.json.JSONException;
import org.json.JSONObject;
public class MainActivity extends AppCompatActivity {
TextView tv1;
String s1,s2,s3;
String s4="";
// Facebook Variables**********************************************************************
CallbackManager callbackManager;
AccessTokenTracker accessTokenTracker;
ProfileTracker profileTracker;
private FacebookCallback<LoginResult> callback=new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
Profile profile=Profile.getCurrentProfile();
nextActivity(profile);
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException error) {
}
};
//end of facebook variables part**********************************************************************
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv1=(TextView)findViewById(R.id.tv1);
//Facebook part 2**********************************************************************
FacebookSdk.sdkInitialize(getApplicationContext());
callbackManager = CallbackManager.Factory.create();
accessTokenTracker=new AccessTokenTracker() {
@Override
protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken currentAccessToken) {
}
};
accessTokenTracker.startTracking();
profileTracker.startTracking();
LoginButton loginButton=(LoginButton)findViewById(R.id.login);
callback=new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
AccessToken accessToken=loginResult.getAccessToken();
Profile profile=Profile.getCurrentProfile();
nextActivity(profile);
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException error) {
}
};
loginButton.setReadPermissions("user_friends");
loginButton.registerCallback(callbackManager, callback);
//end of facebook part 2**********************************************************************
JSONObject hello=new JSONObject();
try {
hello.put("Name","viraj");
hello.put("Time","3.07");
hello.put("Test","test");
s1=hello.getString("Name");
s2=hello.getString("Time");
s3=hello.getString("Test");
s4+=s1;
s4+="\n";
s4+=s2;
s4+="\n";
s4+=s3;
tv1.setText(s4);
} catch (JSONException e) {
e.printStackTrace();
}
}
//part 3 starts Facebook**********************************************************************
protected void onResume() {
super.onResume();
//Facebook login**********************************************************************
Profile profile = Profile.getCurrentProfile();
nextActivity(profile);
}
@Override
protected void onPause() {
super.onPause();
}
protected void onStop() {
super.onStop();
//Facebook login
accessTokenTracker.stopTracking();
profileTracker.stopTracking();
}
@Override
protected void onActivityResult(int requestCode, int responseCode, Intent intent) {
super.onActivityResult(requestCode, responseCode, intent);
//Facebook login
callbackManager.onActivityResult(requestCode, responseCode, intent);
}
private void nextActivity(Profile profile){
if(profile != null){
Intent main = new Intent(MainActivity.this, MainActivity.class);
main.putExtra("name", profile.getFirstName());
main.putExtra("surname", profile.getLastName());
main.putExtra("imageUrl", profile.getProfilePictureUri(200,200).toString());
startActivity(main);
}
}
}
| [
"virajwagh6@gmail.com"
] | virajwagh6@gmail.com |
2c3c509b19b2829163fa65d84d0682d7d2b03f70 | d8cc40718b7af0193479a233a21ea2f03c792764 | /aws-java-sdk-kms/src/test/java/com/amazonaws/services/kms/smoketests/AWSKMSModuleInjector.java | 87b540aae50dc82965b5159e2fc9431ce7911a1a | [
"Apache-2.0"
] | permissive | chaoweimt/aws-sdk-java | 1de8c0aeb9aa52931681268cd250ca2af59a83d9 | f11d648b62f2615858e2f0c2e5dd69e77a91abd3 | refs/heads/master | 2021-01-22T03:18:33.038352 | 2017-05-24T22:40:24 | 2017-05-24T22:40:24 | 92,371,194 | 1 | 0 | null | 2017-05-25T06:13:36 | 2017-05-25T06:13:35 | null | UTF-8 | Java | false | false | 1,587 | java | /*
* Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.kms.smoketests;
import javax.annotation.Generated;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Stage;
import cucumber.api.guice.CucumberModules;
import cucumber.runtime.java.guice.InjectorSource;
import com.amazonaws.AmazonWebServiceClient;
import com.amazonaws.services.kms.AWSKMSClient;
/**
* Injector that binds the AmazonWebServiceClient interface to the com.amazonaws.services.kms.AWSKMSClient
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSKMSModuleInjector implements InjectorSource {
@Override
public Injector getInjector() {
return Guice.createInjector(Stage.PRODUCTION, CucumberModules.SCENARIO, new AWSKMSModule());
}
static class AWSKMSModule extends AbstractModule {
@Override
protected void configure() {
bind(AmazonWebServiceClient.class).to(AWSKMSClient.class);
}
}
}
| [
""
] | |
9ed3723b4e9e329e507c4b98f57b900cb6d6ffd6 | 03cc1381e4b6621f46e3b3e2052b611335d8204c | /core/src/main/java/org/zstack/core/propertyvalidator/LengthValidator.java | 799fa8d49c32fb6da2f792561516ab9a7fb2727a | [
"Apache-2.0"
] | permissive | shaohan0228/zstack | 4592960aa98b8d9f25d885f98061adfc6ec7415d | 85200a1e2b14e3e34622214866404145c1721fbb | refs/heads/master | 2022-07-08T20:30:02.666082 | 2022-06-13T01:48:29 | 2022-06-13T01:48:29 | 239,920,158 | 0 | 0 | Apache-2.0 | 2020-02-12T03:38:57 | 2020-02-12T03:38:57 | null | UTF-8 | Java | false | false | 882 | java | package org.zstack.core.propertyvalidator;
import org.zstack.utils.DebugUtils;
@ValidateTarget(target = Length.class)
public class LengthValidator implements GlobalPropertyValidator {
@Override
public boolean validate(String name, String value, Object rule) throws GlobalPropertyValidatorExecption {
long[] lengthRange = (long[]) rule;
if (value != null && lengthRange.length > 0) {
DebugUtils.Assert(lengthRange.length == 2, String.format("invalid field [%s], Property.numberRange must have and only have 2 items", name));
if (value.length() > lengthRange[1] || value.length() < lengthRange[0]) {
throw new GlobalPropertyValidatorExecption("value " + value + " of property " + name + " must be in range of [ " + lengthRange[0] + " , " + lengthRange[1] + " ]");
}
}
return true;
}
}
| [
"yinghe.hu@zstack.io"
] | yinghe.hu@zstack.io |
6686333b673f390115593c3dd3e75303cd7c4732 | 303328efea97b5071895737ec8458e37af411d3d | /src/com/javarush/test/level13/lesson04/task01/Solution.java | 060b602026beecd2983f5a4fd959119fd310c009 | [] | no_license | glebfox/JavaRushHomeWork | 831cc55fcdabe29a571b103c5f95a47ab412cf20 | 53ca64cddd3d3db9a7943e09ad3626b9f31d13bb | refs/heads/master | 2020-06-03T00:26:09.468926 | 2015-02-17T10:01:31 | 2015-02-17T10:01:31 | 30,911,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,163 | java | package com.javarush.test.level13.lesson04.task01;
/* Переводчик с английского
1. Создать класс EnglishTranslator, который наследуется от Translator.
2. Реализовать все абстрактные методы.
3. Подумай, что должен возвращать метод getLanguage.
4. Программа должна выводить на экран "Я переводчик с английского".
5. Метод main менять нельзя.
*/
public class Solution
{
public static void main(String[] args) throws Exception
{
EnglishTranslator englishTranslator = new EnglishTranslator();
System.out.println(englishTranslator.translate());
}
public static abstract class Translator
{
public abstract String getLanguage();
public String translate()
{
return "Я переводчик с " + getLanguage();
}
}
public static class EnglishTranslator extends Translator {
@Override
public String getLanguage() {
return "английского";
}
}
}
| [
"glebfox@gmail.com"
] | glebfox@gmail.com |
ae1778f7b546cbc3a5cf2da8aaba3d75598d2c86 | 1b5ea6e926f721191b19f7ee545602a28804a98c | /app/src/main/java/com/example/maira/voicehelper/OneImageActivity.java | ec8073056b96186ca2d2120cc3165ce183d1813d | [] | no_license | Airatikuzzz/VoiceHelper | 9711f71cab5c8654526b219e8bb5c2ce58206ff2 | 63bd55fc5c7a0a6b77ec1b84e45556f42951f6d4 | refs/heads/master | 2020-06-16T10:02:27.907191 | 2019-07-06T11:25:48 | 2019-07-06T11:25:48 | 195,530,619 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,458 | java | package com.example.maira.voicehelper;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.speech.tts.TextToSpeech;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.transition.DrawableCrossFadeFactory;
import com.example.maira.voicehelper.components.DaggerAppComponent;
import com.example.maira.voicehelper.contractviews.IOneImageContractsView;
import com.example.maira.voicehelper.game.IOneImageGameEngine;
import com.example.maira.voicehelper.game.OneImageGameEngine;
import com.example.maira.voicehelper.models.Animal;
import com.example.maira.voicehelper.modules.AppModule;
import com.example.maira.voicehelper.repository.Repository;
import com.google.android.material.chip.Chip;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.LinearLayoutCompat;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.example.maira.voicehelper.voice.IVoiceEngine;
import java.util.ArrayList;
import java.util.Locale;
import javax.inject.Inject;
import androidx.swiperefreshlayout.widget.CircularProgressDrawable;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class OneImageActivity extends AppCompatActivity implements IOneImageContractsView, TextToSpeech.OnInitListener {
@BindView(R.id.one_activity_image_view)
ImageView oneImageView;
@BindView(R.id.fab)
FloatingActionButton fab;
@BindView(R.id.fab_next)
FloatingActionButton fab_next;
@BindView(R.id.chip1)
Chip chip1;
@BindView(R.id.chip2)
Chip chip2;
@BindView(R.id.content_one_image)
LinearLayoutCompat layout;
ProgressDialog dialog;
@Inject
IVoiceEngine voiceEngine;
@Inject
IOneImageGameEngine game;
private static final int VR_REQUEST = 999;
private static final int MY_DATA_CHECK_CODE = 9991;
private final String LOG_TAG = "SpeechRepeatActivity";
private String said = "";
private TextToSpeech repeatTTS;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_one_image);
App.getComponent().injectsOneImageActivity(this);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ButterKnife.bind(this);
chip1.setOnCloseIconClickListener(v->
game.onClickVoiceAnimal(chip1.getText().toString())
);
chip2.setOnCloseIconClickListener(v->
game.onClickVoiceAnimal(chip2.getText().toString())
);
voiceEngine.setView(this);
voiceEngine.init();
game.setView(this);
game.preStart();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == VR_REQUEST && resultCode == RESULT_OK) {
ArrayList<String> suggestedWords =
data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
said = suggestedWords.get(0);
game.answerFromUser(said);
Log.d(LOG_TAG, suggestedWords.toString());
}
if(requestCode== MY_DATA_CHECK_CODE)
{
if(resultCode== TextToSpeech.Engine.CHECK_VOICE_DATA_PASS)
repeatTTS=new TextToSpeech(this, this);
else
{
Intent installTTSIntent=new Intent();
installTTSIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installTTSIntent);
}
}
super.onActivityResult(requestCode, resultCode, data);
}
@OnClick(R.id.fab)
public void onClick() {
voiceEngine.listen();
}
@Override
public void setCurrent(Animal animal) {
CircularProgressDrawable circularProgressDrawable = new CircularProgressDrawable(this);
circularProgressDrawable.setStrokeWidth(5f);
circularProgressDrawable.setCenterRadius(30f);
circularProgressDrawable.start();
DrawableCrossFadeFactory factory =
new DrawableCrossFadeFactory.Builder().setCrossFadeEnabled(true).build();
Glide.with(this)
.load(game.getImageReferenceFor(animal))
.placeholder(circularProgressDrawable)
.transition(DrawableTransitionOptions.withCrossFade(factory))
.into(oneImageView);
}
@Override
public void speak(String text) {
if(repeatTTS!=null)
repeatTTS.speak(text,TextToSpeech.QUEUE_FLUSH, null);
}
@Override
public void showProgress() {
}
@Override
public void hideProgress() {
layout.setVisibility(View.VISIBLE);
}
@Override
public void showProgressDialog() {
dialog = new ProgressDialog(this);
dialog.setTitle("Пожалуйста, подождите");
dialog.setMessage("Загрузка аудиозвука...");
dialog.setCancelable(false);
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setIndeterminate(false);
if(!dialog.isShowing())
dialog.show();
}
@Override
public void hideProgressDialog() {
if(dialog.isShowing())
dialog.dismiss();
}
@Override
protected void onStop() {
super.onStop();
game.onStop();
}
@Override
public void setTitleOfChips(String[] chips) {
chip1.setText(chips[0]);
chip2.setText(chips[1]);
}
@OnClick({R.id.chip1,R.id.chip2})
public void OnChipClick(Chip chip){
game.answerFromUser(chip.getText().toString());
}
@OnClick(R.id.fab_next)
public void OnNext(){
game.next();
}
@Override
public void onInit(int i) {
if(i== TextToSpeech.SUCCESS)
repeatTTS.setLanguage(Locale.getDefault());//Язык
}
@Override
public boolean onSupportNavigateUp() {
finish();
return true;
}
}
| [
"m.airat1997@gmail.com"
] | m.airat1997@gmail.com |
8440101a201d80a12639960bf85745c51bc3036f | d586b47471a9b53c993517b025b630360f535869 | /src/main/java/net/mooncloud/moonbook/repository/book/BookFestivalDao.java | a1280a493daf8d44f2c243e227956b6260285142 | [] | no_license | DinnerClub/moonbook-spring | fc55915874cbba94e3f5581aca12bffa0c822a9b | 5319188401f40239282eb3476e6d823684f4b218 | refs/heads/master | 2016-09-08T02:05:44.264504 | 2015-05-14T10:20:52 | 2015-05-14T10:20:52 | 34,701,068 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 497 | java | package net.mooncloud.moonbook.repository.book;
import java.util.List;
import java.util.Map;
import net.mooncloud.moonbook.entity.book.BookFestival;
public interface BookFestivalDao
{
public void insertUpdate(BookFestival bookFestival);
public void insertIgnore(BookFestival bookFestival);
public void deleteDate(int thedate);
public void delete(int thedate, byte lunar);
public void update(BookFestival bookFestival);
public List<BookFestival> search(Map<String, Object> querys);
}
| [
"yangjd@asiainfo.com"
] | yangjd@asiainfo.com |
4f8bc7f1d84fc721aa8ad29a12da6ae125132aca | 89f77870e52def7765283b60f1da2db3cdfc095d | /gen/com/example/resume/R.java | afd327331c1edf3368868513ee0592c5cb6c88ff | [] | no_license | fiking/resume | 09b87b4fc751b346ea6f3d9491c492e966a191d0 | 7e9d939b2a2a4125c11fb50d8d7e64aa50f33297 | refs/heads/master | 2020-04-06T06:42:03.635828 | 2014-04-24T08:29:35 | 2014-04-24T08:29:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 42,666 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example.resume;
public final class R {
public static final class array {
public static final int abei_city_item=0x7f04011f;
public static final int akesu_city_item=0x7f04016e;
public static final int alaer_city_item=0x7f040176;
public static final int alashanmeng_city_item=0x7f040046;
public static final int aleitai_city_item=0x7f040174;
public static final int ali_city_item=0x7f040140;
public static final int anhui_province_item=0x7f04000c;
public static final int anhui_suzhou_city_item=0x7f04008f;
public static final int ankang_city_item=0x7f04014a;
public static final int anqing_city_item=0x7f04008b;
public static final int anshan_city_item=0x7f040049;
public static final int anshun_city_item=0x7f040125;
public static final int anyang_city_item=0x7f0400be;
public static final int aomen_city_item=0x7f04017d;
public static final int aomen_province_item=0x7f040021;
public static final int baicheng_city_item=0x7f04005c;
public static final int baise_city_item=0x7f040105;
public static final int baishan_city_item=0x7f04005a;
public static final int baiyin_city_item=0x7f04014f;
public static final int baoding_city_item=0x7f04002a;
public static final int baoji_city_item=0x7f040144;
public static final int baoshan_city_item=0x7f04012e;
public static final int baotou_city_item=0x7f04003c;
public static final int bayannaoer_city_item=0x7f040042;
public static final int bayinguolen_city_item=0x7f04016d;
public static final int bazhong_city_item=0x7f04011d;
public static final int beihai_city_item=0x7f040100;
/** 2000多个县
*/
public static final int beijin_city_item=0x7f040023;
/** 个地级市
*/
public static final int beijin_province_item=0x7f040001;
public static final int bengbu_city_item=0x7f040086;
public static final int benxi_city_item=0x7f04004b;
public static final int biji_city_item=0x7f040128;
public static final int boertala_city_item=0x7f04016c;
public static final int buyang_city_item=0x7f0400c2;
public static final int cangzhou_city_item=0x7f04002d;
public static final int changchun_city_item=0x7f040055;
public static final int changde_city_item=0x7f0400df;
public static final int changdu_city_item=0x7f04013c;
public static final int changji_city_item=0x7f04016b;
public static final int changsha_city_item=0x7f0400d9;
public static final int changzhi_city_item=0x7f040033;
public static final int changzhou_city_item=0x7f04006f;
public static final int chaohu_city_item=0x7f040090;
public static final int chaozhou_city_item=0x7f0400f9;
public static final int chengde_city_item=0x7f04002c;
public static final int chengdu_city_item=0x7f04010d;
public static final int chifeng_city_item=0x7f04003e;
public static final int chizhou_city_item=0x7f040093;
public static final int chongqing_city_item=0x7f04010c;
public static final int chongqing_province_item=0x7f040016;
public static final int chuangzuo_city_item=0x7f040109;
public static final int chuxiong_city_item=0x7f040133;
public static final int chuzhou_city_item=0x7f04008d;
public static final int dali_city_item=0x7f040137;
public static final int dalian_city_item=0x7f040048;
public static final int dandong_city_item=0x7f04004c;
public static final int daqing_city_item=0x7f040063;
public static final int datong_city_item=0x7f040031;
public static final int daxinganling_city_item=0x7f04006a;
public static final int dazhou_city_item=0x7f04011b;
public static final int degrees_arry=0x7f04017f;
public static final int dehuang_city_item=0x7f040138;
public static final int deyang_city_item=0x7f040111;
public static final int dezhou_city_item=0x7f0400b6;
public static final int dingxi_city_item=0x7f040156;
public static final int diqing_city_item=0x7f04013a;
public static final int dongguan_city_item=0x7f0400f7;
public static final int dongying_city_item=0x7f0400ad;
public static final int dutytime_arry=0x7f040185;
public static final int eerduosi_city_item=0x7f040040;
public static final int enshi_city_item=0x7f0400d7;
public static final int erzhou_city_item=0x7f0400d0;
public static final int fangchenggang_city_item=0x7f040101;
public static final int foshan_city_item=0x7f0400ec;
public static final int fujian_province_item=0x7f04000d;
public static final int fuxin_city_item=0x7f04004f;
public static final int fuyang_city_item=0x7f04008e;
public static final int ganmu_city_item=0x7f040120;
public static final int gannan_city_item=0x7f040159;
public static final int gansu_province_item=0x7f04001c;
public static final int ganzhou_city_item=0x7f0400a4;
public static final int geshen_city_item=0x7f040170;
public static final int guangan_city_item=0x7f04011a;
public static final int guangdong_province_item=0x7f040013;
public static final int guangxi_province_item=0x7f040014;
public static final int guangxi_wuzhou_city_item=0x7f0400ff;
public static final int guangyuan_city_item=0x7f040113;
public static final int guangzhou_city_item=0x7f0400e7;
public static final int guigang_city_item=0x7f040103;
public static final int guilin_city_item=0x7f0400fe;
public static final int guiyang_city_item=0x7f040122;
public static final int guizhou_province_item=0x7f040018;
public static final int guluo_city_item=0x7f04015f;
public static final int guyuan_city_item=0x7f040165;
public static final int haerbing_city_item=0x7f04005e;
public static final int haibai_city_item=0x7f04015c;
public static final int haidong_city_item=0x7f04015b;
public static final int haikou_city_item=0x7f04010a;
public static final int hainan_city_item=0x7f04015e;
public static final int hainan_province_item=0x7f040015;
public static final int haixi_city_item=0x7f040161;
public static final int hami_city_item=0x7f04016a;
public static final int handan_city_item=0x7f040028;
public static final int hangzhou_city_item=0x7f040079;
public static final int hanzhong_city_item=0x7f040148;
public static final int haozhou_city_item=0x7f040092;
public static final int hebi_city_item=0x7f0400bf;
public static final int hechi_city_item=0x7f040107;
public static final int hefei_city_item=0x7f040084;
public static final int hegang_city_item=0x7f040061;
public static final int heibei_province_item=0x7f040003;
public static final int heihe_city_item=0x7f040068;
public static final int heilongjiang_province_item=0x7f040008;
public static final int heilongjiang_yichun_city_item=0x7f040064;
public static final int henan_province_item=0x7f040010;
public static final int hengshui_city_item=0x7f04002f;
public static final int hengyang_city_item=0x7f0400dc;
public static final int hetian_city_item=0x7f040171;
public static final int heyuan_city_item=0x7f0400f4;
public static final int heze_city_item=0x7f0400b9;
public static final int hezhou_city_item=0x7f040106;
public static final int honghe_city_item=0x7f040134;
public static final int hongkong_island_item=0x7f040179;
public static final int hongkong_province_item=0x7f040020;
public static final int huaian_city_item=0x7f040073;
public static final int huaibei_city_item=0x7f040089;
public static final int huaihua_city_item=0x7f0400e4;
public static final int huainan_city_item=0x7f040087;
public static final int huanggang_city_item=0x7f0400d4;
public static final int huangnan_city_item=0x7f04015d;
public static final int huangshan_city_item=0x7f04008c;
public static final int huangshi_city_item=0x7f0400cc;
public static final int hubei_jinzhou_city_item=0x7f0400d3;
public static final int hubei_province_item=0x7f040011;
public static final int huhehaote_city_item=0x7f04003b;
public static final int huizhou_city_item=0x7f0400f1;
public static final int huludao_city_item=0x7f040054;
public static final int hulunbeier_city_item=0x7f040041;
public static final int hunan_bingzhou_city_item=0x7f0400e2;
public static final int hunan_province_item=0x7f040012;
public static final int huzhou_city_item=0x7f040095;
public static final int industry_arry=0x7f040183;
public static final int jiamusi_city_item=0x7f040065;
public static final int jian_city_item=0x7f0400a5;
public static final int jiangmen_city_item=0x7f0400ed;
public static final int jiangsu_province_item=0x7f04000a;
public static final int jiangsu_taizhou_city_item=0x7f040077;
public static final int jiangxi_province_item=0x7f04000e;
public static final int jiangxi_wuzhou_city_item=0x7f0400a7;
public static final int jiangxi_yichun_city_item=0x7f0400a6;
public static final int jiaozuo_city_item=0x7f0400c1;
public static final int jiaxing_city_item=0x7f04007c;
public static final int jiayuguan_city_item=0x7f04014d;
public static final int jilin_city_item=0x7f040056;
public static final int jilin_province_item=0x7f040007;
public static final int jinan_city_item=0x7f0400a9;
public static final int jinchang_city_item=0x7f04014e;
public static final int jincheng_city_item=0x7f040034;
public static final int jingdezhen_city_item=0x7f04009f;
public static final int jinhua_city_item=0x7f04007f;
public static final int jining_city_item=0x7f0400b0;
public static final int jinmen_city_item=0x7f0400d1;
public static final int jinzhong_city_item=0x7f040036;
public static final int jiujiang_city_item=0x7f0400a1;
public static final int jiulong_island_item=0x7f04017a;
public static final int jiuquan_city_item=0x7f040154;
public static final int jixi_city_item=0x7f040060;
public static final int jiyang_city_item=0x7f0400fa;
public static final int job_type_arry=0x7f040182;
public static final int kaifang_city_item=0x7f0400bb;
public static final int kaipingshan_city_item=0x7f0400bd;
public static final int kelamayi_city_item=0x7f040168;
public static final int kemuleisu_city_item=0x7f04016f;
public static final int kunming_city_item=0x7f04012b;
public static final int laibing_city_item=0x7f040108;
public static final int laiwu_city_item=0x7f0400b4;
public static final int langfang_city_item=0x7f04002e;
public static final int language_arry=0x7f040180;
public static final int lanzhou_city_item=0x7f04014c;
public static final int lasa_city_item=0x7f04013b;
public static final int leihe_city_item=0x7f0400c4;
public static final int leshan_city_item=0x7f040116;
public static final int li_island_item=0x7f04017c;
public static final int liangshan_city_item=0x7f040121;
public static final int lianyungang_city_item=0x7f040072;
public static final int liaocheng_city_item=0x7f0400b7;
public static final int liaoning_jinzhou_city_item=0x7f04004d;
public static final int liaoning_province_item=0x7f040006;
public static final int liaoyang_city_item=0x7f040050;
public static final int liaoyuan_city_item=0x7f040058;
public static final int lijiang_city_item=0x7f040130;
public static final int linfen_city_item=0x7f040039;
public static final int lingcang_city_item=0x7f040132;
public static final int linxi_city_item=0x7f0400b5;
public static final int linxia_city_item=0x7f040158;
public static final int linxia_province_item=0x7f04001e;
public static final int linzhi_city_item=0x7f040141;
public static final int lishui_city_item=0x7f040083;
public static final int liuzhou_city_item=0x7f0400fd;
public static final int longnan_city_item=0x7f040157;
public static final int longyan_city_item=0x7f04009c;
public static final int loudi_city_item=0x7f0400e5;
public static final int luan_city_item=0x7f040091;
public static final int luoyang_city_item=0x7f0400bc;
public static final int lupanshui_city_item=0x7f040123;
public static final int luzhou_city_item=0x7f040110;
public static final int lvliang_city_item=0x7f04003a;
public static final int maanshan_city_item=0x7f040088;
public static final int maoming_city_item=0x7f0400ef;
public static final int meishan_city_item=0x7f040118;
public static final int meizhou_city_item=0x7f0400f2;
public static final int mianyang_city_item=0x7f040112;
public static final int mudanjiang_city_item=0x7f040067;
public static final int nanchang_city_item=0x7f04009e;
public static final int nanchong_city_item=0x7f040117;
public static final int nanjing_city_item=0x7f04006c;
public static final int nanjing_suzhou_city_item=0x7f040070;
public static final int nanning_city_item=0x7f0400fc;
public static final int nanp_city_item=0x7f04009b;
public static final int nantong_city_item=0x7f040071;
public static final int nanyang_city_item=0x7f0400c6;
public static final int naqu_city_item=0x7f04013f;
public static final int neijiang_city_item=0x7f040115;
public static final int neimenggu_province_item=0x7f040005;
public static final int ningbo_city_item=0x7f04007a;
public static final int ningde_city_item=0x7f04009d;
public static final int nujiang_city_item=0x7f040139;
public static final int occupation_arry=0x7f040184;
public static final int panjin_city_item=0x7f040051;
public static final int panzhihua_city_item=0x7f04010f;
public static final int pingliang_city_item=0x7f040153;
public static final int pingxiang_city_item=0x7f0400a0;
/** 含个省、自治区、直辖市、特别行政区
*/
public static final int province_item=0x7f040000;
public static final int putian_city_item=0x7f040097;
public static final int qingdao_city_item=0x7f0400aa;
public static final int qingdongnan_city_item=0x7f040129;
public static final int qinghai_province_item=0x7f04001d;
public static final int qinghuangdao_city_item=0x7f040027;
public static final int qingnan_city_item=0x7f04012a;
public static final int qingxinan_city_item=0x7f040127;
public static final int qingyang_city_item=0x7f040155;
public static final int qingyuan_city_item=0x7f0400f6;
public static final int qinzhou_city_item=0x7f040102;
public static final int qiqihaer_city_item=0x7f04005f;
public static final int qitaihe_city_item=0x7f040066;
public static final int quanzhou_city_item=0x7f040099;
public static final int qujing_city_item=0x7f04012c;
public static final int quzhou_city_item=0x7f040080;
public static final int rgeze_city_item=0x7f04013e;
public static final int rizhao_city_item=0x7f0400b3;
public static final int salary_arry=0x7f040186;
public static final int sanmenxia_city_item=0x7f0400c5;
public static final int sanming_city_item=0x7f040098;
public static final int sanya_city_item=0x7f04010b;
public static final int shandong_bingzhou_city_item=0x7f0400b8;
public static final int shandong_province_item=0x7f04000f;
public static final int shanghai_city_item=0x7f04006b;
public static final int shanghai_province_item=0x7f040009;
public static final int shangluo_city_item=0x7f04014b;
public static final int shangqiu_city_item=0x7f0400c7;
public static final int shangrao_city_item=0x7f0400a8;
public static final int shannan_city_item=0x7f04013d;
public static final int shantou_city_item=0x7f0400eb;
public static final int shanwei_city_item=0x7f0400f3;
public static final int shanxi1_province_item=0x7f040004;
public static final int shanxi2_province_item=0x7f04001b;
public static final int shaoguan_city_item=0x7f0400e8;
public static final int shaoxing_city_item=0x7f04007e;
public static final int shaoyang_city_item=0x7f0400dd;
public static final int shenglongjia_city_item=0x7f0400d8;
public static final int shenyang_city_item=0x7f040047;
public static final int shenzhen_city_item=0x7f0400e9;
public static final int shihezi_city_item=0x7f040175;
public static final int shijiazhuang_city_item=0x7f040025;
public static final int shiyan_city_item=0x7f0400cd;
public static final int shizuishan_city_item=0x7f040163;
public static final int shuangyashan_city_item=0x7f040062;
public static final int shuozhou_city_item=0x7f040035;
public static final int sichuan_province_item=0x7f040017;
public static final int simao_city_item=0x7f040131;
public static final int siping_city_item=0x7f040057;
public static final int skill_arry=0x7f040181;
public static final int songyuan_city_item=0x7f04005b;
public static final int suihua_city_item=0x7f040069;
public static final int suining_city_item=0x7f040114;
public static final int suizhou_city_item=0x7f0400d6;
public static final int suqian_city_item=0x7f040078;
public static final int tacheng_city_item=0x7f040173;
public static final int taian_city_item=0x7f0400b1;
public static final int taiwan_city_item=0x7f04017e;
public static final int taiwan_province_item=0x7f040022;
public static final int taiyuan_city_item=0x7f040030;
public static final int tangshan_city_item=0x7f040026;
public static final int tianjin_city_item=0x7f040024;
public static final int tianjin_province_item=0x7f040002;
public static final int tianshui_city_item=0x7f040150;
public static final int tieling_city_item=0x7f040052;
public static final int tongchuan_city_item=0x7f040143;
public static final int tonghua_city_item=0x7f040059;
public static final int tongliao_city_item=0x7f04003f;
public static final int tongling_city_item=0x7f04008a;
public static final int tongren_city_item=0x7f040126;
public static final int tulyfan_city_item=0x7f040169;
public static final int tumushihe_city_item=0x7f040177;
public static final int weifang_city_item=0x7f0400af;
public static final int weihai_city_item=0x7f0400b2;
public static final int weinan_city_item=0x7f040146;
public static final int wenshan_city_item=0x7f040135;
public static final int wenzhou_city_item=0x7f04007b;
public static final int wuhai_city_item=0x7f04003d;
public static final int wuhan_city_item=0x7f0400cb;
public static final int wuhu_city_item=0x7f040085;
public static final int wujiaqu_city_item=0x7f040178;
public static final int wulanchabu_city_item=0x7f040043;
public static final int wulumuqi_city_item=0x7f040167;
public static final int wushun_city_item=0x7f04004a;
public static final int wuwei_city_item=0x7f040151;
public static final int wuxi_city_item=0x7f04006d;
public static final int wuzhong_city_item=0x7f040164;
public static final int xiamen_city_item=0x7f040096;
public static final int xian_city_item=0x7f040142;
public static final int xiangpan_city_item=0x7f0400cf;
public static final int xiangtan_city_item=0x7f0400db;
public static final int xiangxi_city_item=0x7f0400e6;
public static final int xianning_city_item=0x7f0400d5;
public static final int xianyang_city_item=0x7f040145;
public static final int xiaogan_city_item=0x7f0400d2;
public static final int xilinguolemeng_city_item=0x7f040045;
public static final int xinganmeng_city_item=0x7f040044;
public static final int xingtai_city_item=0x7f040029;
public static final int xining_city_item=0x7f04015a;
public static final int xinjiang_province_item=0x7f04001f;
public static final int xinjie_island_item=0x7f04017b;
public static final int xinxiang_city_item=0x7f0400c0;
public static final int xinyang_city_item=0x7f0400c8;
public static final int xinyu_city_item=0x7f0400a2;
public static final int xinzhou_city_item=0x7f040038;
public static final int xishuangbanna_city_item=0x7f040136;
public static final int xizang_province_item=0x7f04001a;
public static final int xuancheng_city_item=0x7f040094;
public static final int xuchang_city_item=0x7f0400c3;
public static final int xuzhou_city_item=0x7f04006e;
public static final int yaan_city_item=0x7f04011c;
public static final int yanan_city_item=0x7f040147;
public static final int yanbian_city_item=0x7f04005d;
public static final int yancheng_city_item=0x7f040074;
public static final int yangjiang_city_item=0x7f0400f5;
public static final int yangquan_city_item=0x7f040032;
public static final int yangzhou_city_item=0x7f040075;
public static final int yantai_city_item=0x7f0400ae;
public static final int yibing_city_item=0x7f040119;
public static final int yichang_city_item=0x7f0400ce;
public static final int yili_city_item=0x7f040172;
public static final int yinchuan_city_item=0x7f040162;
public static final int yingkou_city_item=0x7f04004e;
public static final int yingtan_city_item=0x7f0400a3;
public static final int yiyang_city_item=0x7f0400e1;
public static final int yongzhou_city_item=0x7f0400e3;
public static final int yuelin_city_item=0x7f040104;
public static final int yuexi_city_item=0x7f04012d;
public static final int yueyang_city_item=0x7f0400de;
public static final int yulin_city_item=0x7f040149;
public static final int yuncheng_city_item=0x7f040037;
public static final int yunfu_city_item=0x7f0400fb;
public static final int yunnan_province_item=0x7f040019;
public static final int yushu_city_item=0x7f040160;
public static final int zaobo_city_item=0x7f0400ab;
public static final int zaozhuang_city_item=0x7f0400ac;
public static final int zejiang_huzhou_city_item=0x7f04007d;
public static final int zejiang_taizhou_city_item=0x7f040082;
public static final int zhangjiajie_city_item=0x7f0400e0;
public static final int zhangjiakou_city_item=0x7f04002b;
public static final int zhangjiang_city_item=0x7f0400ee;
public static final int zhangyue_city_item=0x7f040152;
public static final int zhangzhou_city_item=0x7f04009a;
public static final int zhaoqing_city_item=0x7f0400f0;
public static final int zhaotong_city_item=0x7f04012f;
public static final int zhaoyang_city_item=0x7f040053;
public static final int zhejiang_province_item=0x7f04000b;
public static final int zhenjiang_city_item=0x7f040076;
public static final int zhenshou_city_item=0x7f0400ba;
public static final int zhongshan_city_item=0x7f0400f8;
public static final int zhongwei_city_item=0x7f040166;
public static final int zhoukou_city_item=0x7f0400c9;
public static final int zhoushan_city_item=0x7f040081;
public static final int zhuhai_city_item=0x7f0400ea;
public static final int zhumadian_city_item=0x7f0400ca;
public static final int zhunyi_city_item=0x7f040124;
public static final int zhuzhou_city_item=0x7f0400da;
public static final int zigong_city_item=0x7f04010e;
public static final int ziyang_city_item=0x7f04011e;
}
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f060000;
public static final int activity_vertical_margin=0x7f060001;
}
public static final class drawable {
public static final int activity_icon=0x7f020000;
public static final int add=0x7f020001;
public static final int avatar=0x7f020002;
public static final int ic_action_next_item=0x7f020003;
public static final int ic_action_person=0x7f020004;
public static final int ic_launcher=0x7f020005;
public static final int icon=0x7f020006;
public static final int modify=0x7f020007;
public static final int save=0x7f020008;
}
public static final class id {
public static final int ability=0x7f09003e;
public static final int abilityId=0x7f090000;
public static final int action_add=0x7f09006c;
public static final int action_modify=0x7f09006f;
public static final int action_save=0x7f090070;
public static final int action_settings=0x7f09006d;
public static final int address=0x7f090039;
public static final int avatar=0x7f09002d;
public static final int avatar_dialog=0x7f09006b;
public static final int birthday=0x7f090033;
public static final int city=0x7f090058;
public static final int city_spinner=0x7f090049;
public static final int city_text=0x7f090048;
public static final int company=0x7f090016;
public static final int companyText=0x7f09002a;
public static final int company_row=0x7f090015;
public static final int county_spinner=0x7f09004c;
public static final int county_text=0x7f09004b;
public static final int date_separator=0x7f090024;
public static final int degree=0x7f090010;
public static final int degree_row=0x7f09000f;
public static final int describtion=0x7f09001a;
public static final int describtionText=0x7f09002c;
public static final int describtion_row=0x7f090019;
public static final int duty=0x7f090022;
public static final int dutyText=0x7f09006a;
public static final int duty_row=0x7f090021;
public static final int dutytime=0x7f09005d;
public static final int dutytime_text=0x7f09005c;
public static final int eduId=0x7f090023;
public static final int education=0x7f09003f;
public static final int email=0x7f090037;
public static final int evaluation=0x7f090025;
public static final int experience=0x7f090040;
public static final int experienceId=0x7f090026;
public static final int from_date=0x7f09000a;
public static final int from_date_row=0x7f090009;
public static final int fromdate=0x7f090013;
public static final int fromdateText=0x7f090027;
public static final int gender=0x7f090031;
public static final int genderGroup=0x7f09004f;
public static final int industry=0x7f09005a;
public static final int industry_text=0x7f090059;
public static final int job_address=0x7f090061;
public static final int job_address_text=0x7f090056;
public static final int job_type=0x7f090055;
public static final int job_type_text=0x7f090054;
public static final int languageId=0x7f09003b;
public static final int languageRow=0x7f090002;
public static final int major=0x7f090012;
public static final int major_row=0x7f090011;
public static final int mobile=0x7f090035;
public static final int more=0x7f09003d;
public static final int myaddress=0x7f09003a;
public static final int myavatar=0x7f09002e;
public static final int mybirthday=0x7f090034;
public static final int mydutytime=0x7f090065;
public static final int myemail=0x7f090038;
public static final int mygender=0x7f090032;
public static final int myindustry=0x7f090063;
public static final int myjob_address=0x7f090062;
public static final int myjob_type=0x7f090060;
public static final int mymobile=0x7f090036;
public static final int myname=0x7f090030;
public static final int myoccupation=0x7f090064;
public static final int mysalary=0x7f090066;
public static final int name=0x7f09002f;
public static final int newEmail=0x7f09004d;
public static final int newEvalution=0x7f09004e;
public static final int newMobile=0x7f090052;
public static final int newName=0x7f090053;
public static final int objective=0x7f090042;
public static final int occupation=0x7f090018;
public static final int occupationText=0x7f09002b;
public static final int occupation_row=0x7f090017;
public static final int occupation_text=0x7f09005b;
public static final int over_date=0x7f09000c;
public static final int over_date_row=0x7f09000b;
public static final int overate=0x7f090029;
public static final int overateText=0x7f090028;
public static final int overdate=0x7f090014;
public static final int personalinfo=0x7f09003c;
public static final int project=0x7f090041;
public static final int projectId=0x7f090067;
public static final int project_describtion=0x7f090020;
public static final int project_describtion_row=0x7f09001f;
public static final int projectname=0x7f09001c;
public static final int projectnameText=0x7f090068;
public static final int projectname_row=0x7f09001b;
public static final int province=0x7f090057;
public static final int province_spinner=0x7f090046;
public static final int province_text=0x7f090045;
public static final int radioFemale=0x7f090051;
public static final int radioMale=0x7f090050;
public static final int readwrite=0x7f090006;
public static final int readwriteRow=0x7f090005;
public static final int salary=0x7f09005f;
public static final int salary_text=0x7f09005e;
public static final int school=0x7f09000e;
public static final int school_row=0x7f09000d;
public static final int skill=0x7f090001;
public static final int skillRow=0x7f090004;
public static final int speaklisten=0x7f090008;
public static final int speaklistenRow=0x7f090007;
public static final int tableLayout1=0x7f090043;
public static final int tableRow1=0x7f090044;
public static final int tableRow2=0x7f090047;
public static final int tableRow3=0x7f09004a;
public static final int test=0x7f09006e;
public static final int title=0x7f09001e;
public static final int titleText=0x7f090069;
public static final int title_row=0x7f09001d;
public static final int type=0x7f090003;
}
public static final class layout {
public static final int activity_ability=0x7f030000;
public static final int activity_add_ability=0x7f030001;
public static final int activity_add_language=0x7f030002;
public static final int activity_edit_education=0x7f030003;
public static final int activity_edit_experience=0x7f030004;
public static final int activity_edit_project=0x7f030005;
public static final int activity_education=0x7f030006;
public static final int activity_evaluation=0x7f030007;
public static final int activity_experiences=0x7f030008;
public static final int activity_info=0x7f030009;
public static final int activity_language=0x7f03000a;
public static final int activity_main=0x7f03000b;
public static final int activity_modify_address=0x7f03000c;
public static final int activity_modify_email=0x7f03000d;
public static final int activity_modify_evalution=0x7f03000e;
public static final int activity_modify_gender=0x7f03000f;
public static final int activity_modify_mobile=0x7f030010;
public static final int activity_modify_name=0x7f030011;
public static final int activity_modify_objective=0x7f030012;
public static final int activity_objective=0x7f030013;
public static final int activity_project=0x7f030014;
public static final int activity_show_avatar=0x7f030015;
}
public static final class menu {
public static final int add=0x7f080000;
public static final int main=0x7f080001;
public static final int modify=0x7f080002;
public static final int save=0x7f080003;
public static final int test=0x7f080004;
}
public static final class string {
public static final int ability=0x7f050011;
public static final int action_settings=0x7f050009;
public static final int add=0x7f05000b;
public static final int address=0x7f050027;
/** action bar
*/
public static final int app_name=0x7f050008;
/** 个人信息
*/
public static final int avatar=0x7f050018;
public static final int birthday=0x7f05001f;
public static final int city_prompt=0x7f050045;
public static final int city_text=0x7f05002a;
public static final int close=0x7f05002c;
public static final int company_hint=0x7f05004e;
public static final int company_text=0x7f05004d;
public static final int county_text=0x7f05002b;
/** 教育经历
*/
public static final int default_evalution=0x7f050046;
public static final int default_from_date=0x7f050033;
public static final int default_over_date=0x7f050034;
public static final int degree_hint=0x7f050036;
public static final int degree_prompt=0x7f050000;
public static final int degree_text=0x7f050031;
public static final int delete=0x7f05000c;
public static final int describtion_hint=0x7f050052;
public static final int describtion_text=0x7f050051;
public static final int duty_hint=0x7f05005a;
public static final int duty_text=0x7f050059;
public static final int dutytime=0x7f050040;
public static final int dutytime_prompt=0x7f050006;
public static final int education=0x7f050012;
public static final int email=0x7f050024;
public static final int emailhint=0x7f050026;
public static final int evaluation=0x7f050017;
public static final int evalutionhint=0x7f050047;
public static final int experience=0x7f050013;
public static final int female=0x7f05001e;
public static final int from_date_text=0x7f05002e;
public static final int gender=0x7f05001c;
public static final int hello_world=0x7f050060;
public static final int industry=0x7f05003c;
public static final int industry_prompt=0x7f050004;
/** 首页
*/
public static final int info=0x7f050010;
public static final int job_address=0x7f05003a;
/** 工作意向
*/
public static final int job_type=0x7f050038;
public static final int job_type_prompt=0x7f050003;
public static final int language=0x7f050015;
public static final int language_prompt=0x7f050001;
public static final int major_hint=0x7f050037;
public static final int major_text=0x7f050032;
public static final int male=0x7f05001d;
public static final int mobile=0x7f050021;
public static final int mobilehint=0x7f050023;
public static final int modify=0x7f05000d;
public static final int more=0x7f05000f;
public static final int myaddress=0x7f050028;
public static final int mybirthday=0x7f050020;
public static final int mydutytime=0x7f050041;
public static final int myemail=0x7f050025;
public static final int myindustry=0x7f05003d;
public static final int myjob_address=0x7f05003b;
public static final int myjob_type=0x7f050039;
public static final int mymobile=0x7f050022;
public static final int myname=0x7f05001a;
public static final int myoccupation=0x7f05003f;
public static final int mysalary=0x7f050043;
public static final int name=0x7f050019;
public static final int namehint=0x7f05001b;
/** 教育经历
*/
public static final int no_educations=0x7f05002d;
public static final int objective=0x7f050016;
public static final int occupation=0x7f05003e;
public static final int occupation_hint=0x7f050050;
public static final int occupation_prompt=0x7f050005;
public static final int occupation_text=0x7f05004f;
public static final int over_date_text=0x7f05002f;
public static final int project=0x7f050014;
public static final int project_describtion_hint=0x7f050058;
public static final int project_describtion_text=0x7f050057;
public static final int projectname_hint=0x7f050054;
public static final int projectname_text=0x7f050053;
public static final int province_prompt=0x7f050044;
public static final int province_text=0x7f050029;
public static final int readwrite=0x7f05004b;
public static final int salary=0x7f050042;
public static final int salary_prompt=0x7f050007;
public static final int save=0x7f05000e;
public static final int school_hint=0x7f050035;
public static final int school_text=0x7f050030;
public static final int skill=0x7f05004a;
public static final int skill_prompt=0x7f050002;
public static final int skills=0x7f050048;
public static final int speaklisten=0x7f05004c;
public static final int test=0x7f05000a;
public static final int title_activity_ability=0x7f050074;
public static final int title_activity_add_ability=0x7f050075;
public static final int title_activity_add_education=0x7f050064;
public static final int title_activity_add_evalution=0x7f050067;
public static final int title_activity_add_experience=0x7f05006f;
public static final int title_activity_add_language=0x7f05006c;
public static final int title_activity_add_project=0x7f050072;
public static final int title_activity_education=0x7f050062;
public static final int title_activity_evaluation=0x7f050066;
public static final int title_activity_experiences=0x7f05006e;
/** activity标题
*/
public static final int title_activity_info=0x7f05005b;
public static final int title_activity_language=0x7f05006b;
public static final int title_activity_modify_address=0x7f050061;
public static final int title_activity_modify_education=0x7f050065;
public static final int title_activity_modify_email=0x7f05005f;
public static final int title_activity_modify_evalution=0x7f050068;
public static final int title_activity_modify_experience=0x7f050070;
public static final int title_activity_modify_gender=0x7f05005d;
public static final int title_activity_modify_mobile=0x7f05005e;
public static final int title_activity_modify_name=0x7f05005c;
public static final int title_activity_modify_objective=0x7f05006a;
public static final int title_activity_modify_project=0x7f050073;
public static final int title_activity_objective=0x7f050069;
public static final int title_activity_projict=0x7f050071;
public static final int title_activity_show_avatar=0x7f05006d;
public static final int title_activity_test=0x7f050063;
public static final int title_hint=0x7f050056;
public static final int title_text=0x7f050055;
/** 语言
*/
public static final int type=0x7f050049;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f070001;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f070002;
/** 除去背景色
*/
public static final int myDialogTheme=0x7f070000;
}
}
| [
"liaolongfei1989@gmail.com"
] | liaolongfei1989@gmail.com |
6770760ac506033dfee180fbbb7a1f1266118d05 | 1930d97ebfc352f45b8c25ef715af406783aabe2 | /src/main/java/com/alipay/api/domain/ZhimaMerchantContractOnofferQueryModel.java | 48d2c31df06d97d74c8709650e37f1585e8e998d | [
"Apache-2.0"
] | permissive | WQmmm/alipay-sdk-java-all | 57974d199ee83518523e8d354dcdec0a9ce40a0c | 66af9219e5ca802cff963ab86b99aadc59cc09dd | refs/heads/master | 2023-06-28T03:54:17.577332 | 2021-08-02T10:05:10 | 2021-08-02T10:05:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 芝麻约定按发约单号查询合约接口
*
* @author auto create
* @since 1.0, 2021-05-17 10:39:20
*/
public class ZhimaMerchantContractOnofferQueryModel extends AlipayObject {
private static final long serialVersionUID = 5223496436729862131L;
/**
* 发约单单号
*/
@ApiField("offer_no")
private String offerNo;
/**
* 应约者id(淘宝id/支付宝user_id)
*/
@ApiField("sign_principal_id")
private String signPrincipalId;
/**
* 应约者类型:ZHIMA_ROLE:芝麻用户 ALIPAY_ROLE:支付宝用户 TAOBAO_ROLE:淘宝用户
*/
@ApiField("sign_principal_type")
private String signPrincipalType;
public String getOfferNo() {
return this.offerNo;
}
public void setOfferNo(String offerNo) {
this.offerNo = offerNo;
}
public String getSignPrincipalId() {
return this.signPrincipalId;
}
public void setSignPrincipalId(String signPrincipalId) {
this.signPrincipalId = signPrincipalId;
}
public String getSignPrincipalType() {
return this.signPrincipalType;
}
public void setSignPrincipalType(String signPrincipalType) {
this.signPrincipalType = signPrincipalType;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
6e129435a9ac00985165aa7a2578ff4e7d4d832f | f18a186c94d498db37c6526365762d0a4b02ce85 | /java_work/Step06_Constructor/src/test/mypac/Computer.java | 244153ef8cae8fd1aa1d98ecdde9badd86789605 | [] | no_license | javalmk/java_work | 05b5dc88c3ae76fdeb80b5f169a390916a01320e | c64498a897eb1a3c6847e14ad532a431ce7ff45b | refs/heads/master | 2020-03-19T04:52:23.424517 | 2018-06-04T01:45:50 | 2018-06-04T01:45:50 | 135,877,103 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,610 | java | package test.mypac;
public class Computer {
/*
* [ 필드(저장소) 정의하기 ]
*
* 1. 접근 지정자 ?
* 2. static or non static ?
* 3. 데이터 type ?
* 4. 필드 name ?
* 5. 초기값 ?
*/
// 필드에 출고 날짜를 담고 싶다.
public String productionDate=null;
// 필드에 Cpu 객체의 참조값을 담고 싶다.
public Cpu cpu=null;
/*
* [ Constructor(생성자) 정의하기 ]
*
* 1. 접근 지정자?
* 2. 생성자에 전달 받는 인자의 갯수와 데이터 type ?
* 3. 생성자를 몇개 정의할지?
*/
//생성자 (Constructor) 객체를 생성할때 호출되는 부분
public Computer() {
System.out.println("Computer() 호출됨");
}
// 인자로 String type 을 전달 받는 생성자
public Computer(String productionDate) {
System.out.println("Computer(String ..) 호출됨");
//생성자의 인자로 전달된 값을 맴버필드에 저장하기
this.productionDate=productionDate;
}
// 인자로 Cpu type 을 전달 받는 생성자
public Computer(Cpu cpu) {
this.cpu=cpu;
}
// 인자로 String type 과 Cpu type 을 전달 받는 생성자
public Computer(String productionDate, Cpu cpu) {
this.productionDate=productionDate;
this.cpu=cpu;
}
/*
* [ Method(기능) 정의하기 ]
*
* 1. 접근 지정자?
* 2. static or non static ?
* 3. 리턴 데이터 type ?
* 4. Method 명?
* 5. Method 에 전달 받는 인자의 갯수와 데이터 type ?
*/
public void doGame() {
System.out.println("게임을 해요!");
}
}
| [
"4187503@gmail.com"
] | 4187503@gmail.com |
30e4ae6d8ab9539b0457b021a961e83a7fc1cc98 | 785b92935b798c587b73a762552df3d996a29427 | /src/main/java/de/vstange/entity/VotesRepository.java | 452a038456fd62690e43c7494c4af5c474433652 | [
"Apache-2.0"
] | permissive | vstange/testdump | 591ac87cd11330e2adbbc3bcfa750bc835c18274 | 31af98985e221395cc7a8180bb20ce75768f2bb0 | refs/heads/master | 2021-01-20T02:04:19.890943 | 2017-07-26T12:07:23 | 2017-07-26T12:07:23 | 89,367,588 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package de.vstange.entity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Standard JPA repository for votes.
*
* @author Vincent Stange
*/
@Repository
public interface VotesRepository extends JpaRepository<Votes, String> {
} | [
"vinc.sohn@gmail.com"
] | vinc.sohn@gmail.com |
3c0512678b86a8c98eeea3bea7c218eb168310a5 | e480274cbcf3639454eccde17f99aeebdc7f321b | /src/test/java/TeamTest.java | e1d321fd73dcbf9f28c4e954b04d5daee2f8e720 | [] | no_license | danielconner/Week8-day5-SportTeamHW | e77e6eb255aad5f470a523499b74544000f5d86e | 142823976491b7335e0b7bd578cc33da28da0128 | refs/heads/master | 2021-04-09T11:22:04.146222 | 2018-03-19T08:59:26 | 2018-03-19T08:59:26 | 125,505,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,281 | java |
import models.*;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class TeamTest {
Team team;
Manager manager;
Director director;
Competition competition;
@Before
public void setUp() throws Exception {
competition = new Competition("Scottish Cup", "Big Trophy");
manager = new Manager("Brendan Rodgers", 48, 30000, FormationType.TIKITAKA);
director = new Director("Peter Lawell", 55, 50000, 20000000);
team = new Team("Celtic", manager, director, "Green/White",68 ,true, competition);
}
@Test
public void canGetName() {
assertEquals("Celtic", team.getName());
}
@Test
public void canGetManager() {
assertEquals("Brendan Rodgers", manager.getName());
}
@Test
public void canGetDirector() {
assertEquals("Peter Lawell", director.getName());
}
@Test
public void canGetColours() {
assertEquals("Green/White", team.getColours());
}
@Test
public void canCheckStillInComp(){
assertTrue("true", team.getInComp());
}
@Test
public void canGetLeaguePoints() {
assertEquals(68, team.getLeaguePoints());
}
}
| [
"dannyconner@hotmail.co.uk"
] | dannyconner@hotmail.co.uk |
0ebb34d09b658b76b4d974add70c98023ec270f5 | a0b98e9fa95246ac2f92a1b15473e0f5b352e11e | /web-busnet/src/main/java/com/iliashenko/account/model/BusLog.java | 04a148aeaea6603b4722b708cdb4a22ad957c67a | [] | no_license | iliashenkoa/bus_net | 83d67fb168502182ef121b17c9514dde54350071 | 822376b33368950cd04ab65e44c8bd52c15aaaf2 | refs/heads/master | 2020-04-28T23:31:00.709389 | 2019-04-21T14:33:01 | 2019-04-21T14:33:01 | 175,657,628 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,482 | java | package com.iliashenko.account.model;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonFormat;
@Entity
@Table(name = "bus_log")
public class BusLog {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Long id;
@Column(name = "time_moment")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy HH:mm", timezone = "Europe/Kiev")
private Timestamp timeMoment;
@Column(name = "bus_stop_id")
private Integer busStopId;
@Column(name = "route_num")
private Integer routeNum;
@Column(name = "bus_id")
private Integer busId;
@Column(name = "passengers_count_entry")
private Integer passengersCountEntry;
@Column(name = "passengers_count_exit")
private Integer passengersCountExit;
@Column(name = "passengers_count_in")
private Integer passengersCountIn;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Timestamp getTimeMoment() {
return timeMoment;
}
public void setTimeMoment(Timestamp timeMoment) {
this.timeMoment = timeMoment;
}
public Integer getBusStopId() {
return busStopId;
}
public void setBusStopId(Integer busStopId) {
this.busStopId = busStopId;
}
public Integer getRouteNum() {
return routeNum;
}
public void setRouteNum(Integer routeNum) {
this.routeNum = routeNum;
}
public Integer getBusId() {
return busId;
}
public void setBusId(Integer busId) {
this.busId = busId;
}
public Integer getPassengersCountEntry() {
return passengersCountEntry;
}
public void setPassengersCountEntry(Integer passengersCountEntry) {
this.passengersCountEntry = passengersCountEntry;
}
public Integer getPassengersCountExit() {
return passengersCountExit;
}
public void setPassengersCountExit(Integer passengersCountExit) {
this.passengersCountExit = passengersCountExit;
}
public Integer getPassengersCountIn() {
return passengersCountIn;
}
public void setPassengersCountIn(Integer passengersCountIn) {
this.passengersCountIn = passengersCountIn;
}
public int getHour() {
Date date = new Date(timeMoment.getTime());
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.HOUR_OF_DAY);
}
}
| [
"vafl9artek@gmail.com"
] | vafl9artek@gmail.com |
54d13f2d19cf0f504a8a54b01f511497fdfb7d11 | 0c39b468aab694abbc228a025c921418041926d7 | /Spring Lab15/src/com/jlcindia/spring/Lab15.java | dc4bfa6b8e114592fd697d8b7c6994630fa16e4e | [] | no_license | jitendrakr93/JLC_ALL_PROGRAMS | 17cfc903c8e5befe2fe50ae89d874b53cf6e748f | eb9748a94e4a70e2504a3007624b83ca2fcd7078 | refs/heads/master | 2023-07-02T17:38:27.603260 | 2021-08-05T05:34:22 | 2021-08-05T05:34:22 | 392,905,494 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 381 | java | package com.jlcindia.spring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class Lab15 {
public static void main(String[] args) {
ApplicationContext ctx=new AnnotationConfigApplicationContext(JlcConfig.class);
Hello hello=(Hello) ctx.getBean("hello");
hello.show();
}
}
| [
"jk93.161@gmail.com"
] | jk93.161@gmail.com |
c855562a8ec757ef636fac43ad2f1f2a5cc08d75 | b1970f236e04d503c4b9f7693d2bba623da57cc4 | /app/src/main/java/com/example/smarttechnology/StudentPaymentEntry/Payment_History_Adapter.java | 82360ac2e0fc41fbd9c9a9ae4ff608e95ab814b3 | [] | no_license | Md-Omar-Faruq/SmartTechnology | b2866c023232a87b1ab7d64332890f30f258b080 | 74b0d83803b55206c5a1754eb12939219f8160d6 | refs/heads/master | 2020-09-02T11:10:04.426569 | 2019-11-02T20:20:53 | 2019-11-02T20:20:53 | 219,208,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,245 | java | package com.example.smarttechnology.StudentPaymentEntry;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.example.smarttechnology.R;
import java.util.List;
public class Payment_History_Adapter extends ArrayAdapter<FeesPaymentEntryClass> {
private Activity context;
private List<FeesPaymentEntryClass> paymentHistoryList;
public Payment_History_Adapter(Activity context, List<FeesPaymentEntryClass> paymentHistoryList) {
super(context, R.layout.payment_history, paymentHistoryList);
this.context = context;
this.paymentHistoryList = paymentHistoryList;
}
@Override
public View getView(int position,View convertView,ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
View view = inflater.inflate(R.layout.payment_history,null,false);
FeesPaymentEntryClass paymentHistory = paymentHistoryList.get(position);
TextView id = view.findViewById(R.id.paymentHid);
TextView name = view.findViewById(R.id.paymentHname);
TextView number = view.findViewById(R.id.paymentHmobile);
TextView date = view.findViewById(R.id.paymentHpDate);
TextView total = view.findViewById(R.id.paymentHTotalFees);
TextView discount = view.findViewById(R.id.paymentHDiscount);
TextView after = view.findViewById(R.id.paymentHafterTotal);
TextView paid = view.findViewById(R.id.paymentHpaid);
TextView due = view.findViewById(R.id.paymentHdue);
id.setText(paymentHistory.getStudentPid());
name.setText(paymentHistory.getStudentPname());
number.setText(paymentHistory.getStudentPmobileNo());
date.setText(paymentHistory.getPaymentDate());
total.setText(paymentHistory.getStudentPcourseFees());
discount.setText(paymentHistory.getDiscountAmmount());
after.setText(paymentHistory.getAfterTotal());
paid.setText(paymentHistory.getPaidAmmount());
due.setText(paymentHistory.getDueAmmount());
return view;
}
}
| [
"omarfaruq284068@gmail.com"
] | omarfaruq284068@gmail.com |
954036aaf53d093483c8f658370681a96207bcb7 | b94397fa7462c5861f85facd575aae543749daf5 | /src/com/stanley/taiweidata/TaiWeiAllDataAction_QD.java | b3b78aa2ffc7f78adc6f44905f89764ec2d3172b | [] | no_license | sunmh207/TrainMap_JN | 4fcf0d6b705024774a2e38a4898734647f58e545 | 124afab9fae2a3264f10d5fb776862784fc2ae43 | refs/heads/master | 2020-04-14T10:20:35.836600 | 2014-03-22T13:50:37 | 2014-03-22T13:50:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,052 | java | package com.stanley.taiweidata;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import com.jitong.common.action.JITActionBase;
import com.jitong.common.exception.JTException;
import com.jitong.common.util.DateUtil;
import com.opensymphony.xwork2.Preparable;
import com.stanley.Gudao;
import com.stanley.JicheYunxingInfo;
import com.stanley.TaiWei;
import com.stanley.TaiWeiAll;
import com.stanley.TaiWeiManager;
import com.stanley.TaiWeiManager_QD;
import com.stanley.locomotivedict.LocomotiveService;
public class TaiWeiAllDataAction_QD extends JITActionBase implements Preparable {
private TaiWeiManager_QD svr_qd;
private TaiWeiManager svr;
private LocomotiveService locoSvr;
//private TaiWeiAll taiweiall;
private Gudao gudao;
private String gdName;
private String CH;
private JicheYunxingInfo jicheYunxingInfo;
private List<String> locoList;
private Map<String,String> locoWithoutTaiweiMap;
private Map<String,String> gdNameWithoutLocoMap;
private String newGDName;
private String qryGDName;
private String qryCH;
public void prepare() throws JTException {
if (svr_qd == null) {
svr_qd = new TaiWeiManager_QD();
}
if (svr == null) {
svr = new TaiWeiManager();
}
if (locoSvr == null) {
locoSvr = new LocomotiveService();
}
if (gdName != null&& !"".equals(gdName)) {
gudao = svr_qd.findGudaoByGDName(gdName);
}
}
public String forMove() {
try{
List<Object> emptyTaiweis= svr_qd.queryByHql("from TaiWeiAll where currentCH is null and didian='青岛' order by gdName");
gdNameWithoutLocoMap = new TreeMap<String,String>();
for(Object o:emptyTaiweis){
gdNameWithoutLocoMap.put(((TaiWeiAll)o).getGdName(), ((TaiWeiAll)o).getGdName());
}
}catch(Exception e){
this.logger.error(e.getClass());
}
return "move";
}
public String input(){
try{
//locoList=locoSvr.queryLocalLocoList("青岛");
locoList=locoSvr.queryLocalLocoList();
locoWithoutTaiweiMap = new TreeMap<String,String>();
for(String ch:locoList){
locoWithoutTaiweiMap.put(ch,ch);
}
Set<TaiWei> taiweialls=svr.queryTaiWeis();
Iterator<TaiWei> it =taiweialls.iterator();
while(it.hasNext()){
TaiWei t=it.next();
locoWithoutTaiweiMap.remove(t.getCurrentCH());
}
}catch(Exception e){
this.logger.error(e.getClass());
}
return INPUT;
}
public String save() throws Exception {
try {
if(gudao!=null){
gudao.setCH(CH);
gudao.setLastUpdate(DateUtil.getCurrentTime());
svr_qd.updateBo(gudao);
jicheYunxingInfo = svr_qd.findJicheYunxingInfoByCH(CH);
if(jicheYunxingInfo==null){
jicheYunxingInfo=new JicheYunxingInfo();
jicheYunxingInfo.setCH(CH);
svr_qd.createBo(jicheYunxingInfo);
}
}
} catch (Exception e) {
this.addActionError(e.getMessage());
return INPUT;
}
return SUCCESS;
}
public String move() throws Exception {
try {
Gudao oldGudao = svr_qd.findGudaoByGDName(gdName);
if(oldGudao!=null){
oldGudao.setCH(null);
oldGudao.setLastUpdate(DateUtil.getCurrentTime());
svr_qd.updateBo(oldGudao);
}
Gudao newGudao = svr_qd.findGudaoByGDName(newGDName);
if(newGudao!=null){
newGudao.setCH(CH);
newGudao.setLastUpdate(DateUtil.getCurrentTime());
svr_qd.updateBo(newGudao);
}else{
this.addActionError(newGudao+"股道不存在");
}
} catch (Exception e) {
this.addActionError(e.getMessage());
return INPUT;
}
return SUCCESS;
}
public String deleteLoco() throws Exception {
try {
if(gudao!=null){
gudao.setCH(null);
gudao.setLastUpdate(DateUtil.getCurrentTime());
svr_qd.updateBo(gudao);
/*jicheYunxingInfo = svr.findJicheYunxingInfoByCH(CH);
if(jicheYunxingInfo!=null){
svr.deleteBo(JicheYunxingInfo.class,jicheYunxingInfo.getId());
}*/
}
} catch (Exception e) {
this.addActionError(e.getMessage());
}
return list();
}
/*public String getListHQL(ArrayList<Object> params) throws JTException {
return "from TaiWeiAll where didian='青岛' order by gdName";
}*/
public String getListHQL(ArrayList<Object> params) throws JTException {
StringBuffer hqlb=new StringBuffer("from TaiWeiAll where didian='青岛'");
if(qryGDName!=null&&!qryGDName.trim().equals("")){
hqlb.append(" and gdName like '%"+qryGDName+"%'");
}
if(qryCH!=null&&!qryCH.trim().equals("")){
hqlb.append(" and currentCH like '%"+qryCH+"%'");
}
return hqlb.append(" order by gdName").toString();
}
public Gudao getGudao() {
return gudao;
}
public void setGudao(Gudao gudao) {
this.gudao = gudao;
}
public String getGdName() {
return gdName;
}
public void setGdName(String gdName) {
this.gdName = gdName;
}
public String getCH() {
return CH;
}
public void setCH(String cH) {
CH = cH;
}
public JicheYunxingInfo getJicheYunxingInfo() {
return jicheYunxingInfo;
}
public void setJicheYunxingInfo(JicheYunxingInfo jicheYunxingInfo) {
this.jicheYunxingInfo = jicheYunxingInfo;
}
public List<String> getLocoList() {
return locoList;
}
public void setLocoList(List<String> locoList) {
this.locoList = locoList;
}
public Map<String, String> getLocoWithoutTaiweiMap() {
return locoWithoutTaiweiMap;
}
public void setLocoWithoutTaiweiMap(Map<String, String> locoWithoutTaiweiMap) {
this.locoWithoutTaiweiMap = locoWithoutTaiweiMap;
}
public Map<String, String> getGdNameWithoutLocoMap() {
return gdNameWithoutLocoMap;
}
public void setGdNameWithoutLocoMap(Map<String, String> gdNameWithoutLocoMap) {
this.gdNameWithoutLocoMap = gdNameWithoutLocoMap;
}
public String getNewGDName() {
return newGDName;
}
public void setNewGDName(String newGDName) {
this.newGDName = newGDName;
}
public String getQryGDName() {
return qryGDName;
}
public void setQryGDName(String qryGDName) {
this.qryGDName = qryGDName;
}
public String getQryCH() {
return qryCH;
}
public void setQryCH(String qryCH) {
this.qryCH = qryCH;
}
}
| [
"stanley.java@gmail.com"
] | stanley.java@gmail.com |
b30bad4a0ebaea8e575a1b505ae86119599cc0cf | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project325/src/main/java/org/gradle/test/performance/largejavamultiproject/project325/p1626/Production32521.java | b0c9954ad6022b36b79dec4364ac82be4e2a2713 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,890 | java | package org.gradle.test.performance.largejavamultiproject.project325.p1626;
public class Production32521 {
private String property0;
public String getProperty0() {
return property0;
}
public void setProperty0(String value) {
property0 = value;
}
private String property1;
public String getProperty1() {
return property1;
}
public void setProperty1(String value) {
property1 = value;
}
private String property2;
public String getProperty2() {
return property2;
}
public void setProperty2(String value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
631dec88cec6d39b8735fa1047131f571f436500 | 970c6d0d321090a4f9aafe87db196bb912772aae | /src/main/java/com/coupons/rest/controller/ex/TaskMalformedException.java | 1a040ac040a13bca368498425eb6167b154e6ed5 | [] | no_license | yash449/coupon-system | 5a3333b24495541da3c2d7c219cef151582ccd5e | efc9e8258034589f9511fb2c0e086034ae851599 | refs/heads/master | 2023-03-18T12:00:14.435402 | 2020-03-30T09:06:31 | 2020-03-30T09:06:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 198 | java | package com.coupons.rest.controller.ex;
@SuppressWarnings("serial")
public class TaskMalformedException extends Exception {
public TaskMalformedException(String message) {
super(message);
}
}
| [
"naordj@gmail.com"
] | naordj@gmail.com |
64fdd72c912b7b7676ea8c9226624a7e8eb3e1d9 | 7f5c84191ce273ab6e2dda67755370a374b8ec12 | /src/com/stormdzh/listviewfuyong/MyAdapter.java | 150486fd751913aa14d303e0cc8f81572bfd83ac | [] | no_license | yeyinlin/listViewFuyong | 28afd692350eeea164e05a6a3bcdb34ed18f1717 | 5703815bd473c2594112478deb7d0b52bd100e9b | refs/heads/master | 2016-09-06T00:10:17.778934 | 2014-08-20T06:32:59 | 2014-08-20T06:32:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,304 | java | package com.stormdzh.listviewfuyong;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class MyAdapter extends BaseAdapter{
private ArrayList<String> list;
private LayoutInflater inflater;
private Context context;
public static Map<Integer, Boolean> isSelected;
public MyAdapter(Context context, ArrayList<String> list) {
// TODO Auto-generated constructor stub
this.list=list;
this.context=context;
inflater=LayoutInflater.from(context);
init();
}
private void init() {
//这儿定义isSelected这个map是记录每个listitem的状态,初始状态全部为false。
isSelected = new HashMap<Integer, Boolean>();
for (int i = 0; i < list.size(); i++) {
isSelected.put(i, false);
}
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return list.size();
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view;
ViewHolder holder;
if(convertView==null){
holder=new ViewHolder();
convertView=inflater.inflate(R.layout.item_person, null);
holder.tv_name=(TextView) convertView.findViewById(R.id.tv_name);
holder.ck_person=(CheckBox) convertView.findViewById(R.id.ck_person);
holder.ll_item=(RelativeLayout) convertView.findViewById(R.id.ll_item);
convertView.setTag(holder);
}else{
holder=(ViewHolder) convertView.getTag();
}
if(list.get(position)!=null){
holder.tv_name.setText(list.get(position));
holder.ck_person.setChecked(isSelected.get(position));
}
if(isSelected.get(position)){
holder.ll_item.setBackgroundColor(Color.RED);
}else{
holder.ll_item.setBackgroundColor(Color.WHITE);
}
return convertView;
}
}
| [
"yeyinlins@gmail.com"
] | yeyinlins@gmail.com |
2d35185fa6476f9ecfd98cb58c8d8e69c8e2c82f | b90c4d27dd0f354db8e3858eaff94e6a4b6f76ae | /src/com/metaisle/earlybird/twitter/TimelineTask.java | fed55e3f905bc25da896af18dc01bcd8aee4a12c | [] | no_license | yichuan1118/Earlybird | 099280c59fe42b19be144cde1ed41fa96ccb0ec8 | 0d76259041a4776fa8daf080ce27c57a9ec22308 | refs/heads/master | 2021-01-17T04:29:29.019293 | 2017-02-23T19:57:56 | 2017-02-23T19:57:56 | 82,966,118 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,350 | java | package com.metaisle.earlybird.twitter;
import java.util.List;
import twitter4j.Paging;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.User;
import twitter4j.conf.Configuration;
import twitter4j.conf.ConfigurationBuilder;
import twitter4j.json.DataObjectFactory;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.text.format.Time;
import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.metaisle.earlybird.app.OAuthActivity;
import com.metaisle.earlybird.caching.CachingTask;
import com.metaisle.earlybird.data.MessageTable;
import com.metaisle.earlybird.data.Prefs;
import com.metaisle.earlybird.data.Provider;
import com.metaisle.earlybird.data.TimelineTable;
import com.metaisle.earlybird.data.UserTable;
import com.metaisle.util.Util;
/*
* Timeline
*/
public class TimelineTask extends AsyncTask<Void, Void, Void> {
private Context mContext;
private SharedPreferences mPrefs;
private Paging[] mPagings;
private long mOtherUserId = 0;
public static final int MAX_TWEETS_IN_DB = 1000;
private PullToRefreshListView mPtr = null;
public TimelineTask(Context context, Paging[] paging) {
mContext = context;
mPrefs = context.getSharedPreferences(Prefs.PREFS_NAME,
Context.MODE_PRIVATE);
mPagings = paging;
}
public TimelineTask(Context context, long user_id) {
mContext = context;
mPrefs = context.getSharedPreferences(Prefs.PREFS_NAME,
Context.MODE_PRIVATE);
mPagings = new Paging[] { null, null, null, null, new Paging() };
mOtherUserId = user_id;
}
public TimelineTask(Context context, long user_id, Paging paging) {
this(context, user_id);
mPagings = new Paging[] { null, null, null, null, paging };
}
public TimelineTask(Context context, long user_id, Paging paging,
PullToRefreshListView ptr) {
this(context, user_id);
mPagings = new Paging[] { null, null, null, null, paging };
mPtr = ptr;
}
public TimelineTask(Context context, Paging[] paging,
PullToRefreshListView ptr) {
this(context, paging);
mPtr = ptr;
}
@Override
protected Void doInBackground(Void... nulls) {
String accessToken = mPrefs.getString(Prefs.KEY_OAUTH_TOKEN, null);
String accessTokenSecret = mPrefs.getString(
Prefs.KEY_OAUTH_TOKEN_SECRET, null);
Configuration conf = new ConfigurationBuilder()
.setOAuthConsumerKey(OAuthActivity.OAUTH_CONSUMER_KEY)
.setOAuthConsumerSecret(OAuthActivity.OAUTH_CONSUMER_SECRET)
.setOAuthAccessToken(accessToken).setJSONStoreEnabled(true)
.setOAuthAccessTokenSecret(accessTokenSecret).build();
Twitter t = new TwitterFactory(conf).getInstance();
List<twitter4j.Status> statuses = null;
try {
if (mPagings[0] != null) {
Util.log("Downlaod home");
statuses = t.getHomeTimeline(mPagings[0]);
String json = DataObjectFactory.getRawJSON(statuses);
Util.profile(mContext, "home_timeline.csv", json);
for (twitter4j.Status s : statuses) {
insertStatus(mContext, s, TimelineTable.IS_HOME, "1");
}
}
if (mPagings[1] != null) {
Util.log("Downlaod mention");
statuses = t.getMentions(mPagings[1]);
for (twitter4j.Status s : statuses) {
insertStatus(mContext, s, TimelineTable.IS_MENTION, "1");
}
}
if (mPagings[2] != null) {
Util.log("Downlaod favorite");
statuses = t.getFavorites(mPagings[2]);
for (twitter4j.Status s : statuses) {
insertStatus(mContext, s, TimelineTable.IS_FAVORITED, "1");
}
}
if (mPagings[3] != null) {
Util.log("Downlaod DM");
List<twitter4j.DirectMessage> msgs = t
.getDirectMessages(mPagings[3]);
for (twitter4j.DirectMessage m : msgs) {
insertMessage(mContext, m);
}
}
if (mOtherUserId != 0) {
Util.log("Downlaod User Timeline");
statuses = t.getUserTimeline(mOtherUserId, mPagings[4]);
for (twitter4j.Status s : statuses) {
insertStatus(mContext, s, TimelineTable.USER_TIMELINE,
String.valueOf(mOtherUserId));
}
}
} catch (TwitterException e) {
e.printStackTrace();
Activity a = (Activity) mContext;
a.runOnUiThread(mDownloadErrorToastRunnable);
}
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
Time now = new Time();
now.setToNow();
mPrefs.edit().putLong(Prefs.KEY_LAST_UPDATED_AT, now.toMillis(true))
.commit();
new CachingTask(mContext).execute();
if (mPtr != null) {
mPtr.onRefreshComplete();
}
}
/*
* Misc.
*/
public static void insertStatus(Context context, twitter4j.Status s,
String key, String value) {
// ----------------------------------------------------------
ContentValues values = new ContentValues();
values.put(key, value);
values.put(TimelineTable.CREATED_AT, s.getCreatedAt().getTime());
values.put(TimelineTable.IS_RETWEETED_BY_ME, s.isRetweetedByMe());
values.put(TimelineTable.IS_FAVORITED, s.isFavorited());
values.put(TimelineTable.IS_RETWEET, s.isRetweet());
if (s.isRetweet()) {
values.put(TimelineTable.STATUS_ID, s.getRetweetedStatus().getId());
values.put(TimelineTable.STATUS_TEXT, s.getRetweetedStatus()
.getText());
values.put(TimelineTable.STATUS_TEXT_EXP, s.getRetweetedStatus()
.getText());
values.put(TimelineTable.FROM_ID, s.getRetweetedStatus().getUser()
.getId());
values.put(TimelineTable.RT_STATUS_ID, s.getId());
values.put(TimelineTable.RT_USER_ID, s.getUser().getId());
values.put(TimelineTable.RT_USER_NAME, s.getUser().getName());
} else {
values.put(TimelineTable.STATUS_ID, s.getId());
values.put(TimelineTable.STATUS_TEXT, s.getText());
values.put(TimelineTable.STATUS_TEXT_EXP, s.getText());
values.put(TimelineTable.FROM_ID, s.getUser().getId());
}
context.getContentResolver().insert(Provider.TIMELINE_CONTENT_URI,
values);
// ----------------------------------------------------------
if (s.isRetweet()) {
insertUser(context, s.getRetweetedStatus().getUser());
}
// ----------------------------------------------------------
insertUser(context, s.getUser());
}
public static void insertUser(Context context, User u) {
ContentValues values = new ContentValues();
String bigger_url = getBiggerImageUrl(u.getProfileImageURL().toString());
values.put(UserTable.USER_ID, u.getId());
values.put(UserTable.CREATED_AT, u.getCreatedAt().getTime());
values.put(UserTable.DESCRIPTION, u.getDescription());
values.put(UserTable.FOLLOWERS_COUNT, u.getFollowersCount());
values.put(UserTable.FRIENDS_COUNT, u.getFriendsCount());
values.put(UserTable.USER_NAME, u.getName());
values.put(UserTable.SCREEN_NAME, "@" + u.getScreenName());
values.put(UserTable.PROFILE_IMAGE_URL, bigger_url);
values.put(UserTable.STATUS_COUNT, u.getStatusesCount());
context.getContentResolver().insert(Provider.USER_CONTENT_URI, values);
}
public static void insertMessage(Context context, twitter4j.DirectMessage s) {
ContentValues values = new ContentValues();
values.put(MessageTable.STATUS_ID, s.getId());
values.put(MessageTable.STATUS_TEXT, s.getText());
values.put(MessageTable.CREATED_AT, s.getCreatedAt().getTime());
values.put(MessageTable.RECIPIENT_NAME, s.getRecipient().getName());
values.put(MessageTable.RECIPIENT_ID, s.getRecipientId());
values.put(MessageTable.SENDER_NAME, s.getSender().getName());
values.put(MessageTable.SENDER_ID, s.getSenderId());
context.getContentResolver().insert(Provider.MESSAGE_CONTENT_URI,
values);
insertUser(context, s.getSender());
}
final Runnable mDownloadErrorToastRunnable = new Runnable() {
public void run() {
Toast.makeText(mContext, "Timeline fetch error, try again later",
Toast.LENGTH_SHORT).show();
}
};
public static String getBiggerImageUrl(String url) {
String value = url;
if ((url != null) && (url.length() > 0)) {
value = url.replaceFirst("normal", "bigger");
}
return value;
}
} | [
"yichuan.wang@snapchat.com"
] | yichuan.wang@snapchat.com |
ff35931195e07dc5bae76c4247cfc55b2a96327f | 86ad33a37d5a0b2a5784f6a89fef9476d352c1d2 | /app/src/main/java/com/lilinzhen/qduamapplication/Bean/User/User.java | f81d3a991350504e1465978a81e34d31cbee0adf | [] | no_license | chkinglee/qduam-app | 2c1d0795e914f1700013929450eef2731f5a1223 | bfd70f27e50199c8e380aad88b14cf030b543bcc | refs/heads/master | 2020-03-23T19:14:57.430687 | 2018-09-18T09:18:59 | 2018-09-18T09:18:59 | 141,962,983 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java | package com.lilinzhen.qduamapplication.Bean.User;
import android.databinding.BaseObservable;
import android.databinding.Bindable;
import java.io.Serializable;
/**
* 用户实体
* Created by lilinzhen on 2018/1/5.
*/
public class User extends BaseObservable implements Serializable {
private String id;
private String logname;
private String password;
private String name;
private String type;
private String pic;
private String exist_pic;
@Bindable
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Bindable
public String getLogname() {
return logname;
}
public void setLogname(String logname) {
this.logname = logname;
}
@Bindable
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Bindable
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Bindable
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Bindable
public String getPic() {
return pic;
}
public void setPic(String pic) {
this.pic = pic;
}
@Bindable
public String getExist_pic() {
return exist_pic;
}
public void setExist_pic(String exist_pic) {
this.exist_pic = exist_pic;
}
}
| [
"627021415@qq.com"
] | 627021415@qq.com |
3bd888c68d9ffe30d07934795e13daf303ab48e7 | 4d8fabbbff466e9e660082501f6b9492a1ce85c7 | /src/test/java/io/github/mghhrn/unit/ProductDaoTest.java | 9cf7fa5172bb6827373a5c34e85b2ecb8b2c8048 | [] | no_license | mghhrn/CuriousCrawler | c807dda4060bded7fee918b12f63946fc72bc6d1 | 55d4a9eea7ae7382c63ba8a672d99c22650df1e1 | refs/heads/main | 2022-12-30T18:49:52.006186 | 2020-10-22T12:46:18 | 2020-10-22T12:46:18 | 304,675,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,459 | java | package io.github.mghhrn.unit;
import io.github.mghhrn.database.DatabaseUtil;
import io.github.mghhrn.database.ProductDao;
import io.github.mghhrn.entity.Product;
import org.junit.Test;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import static org.assertj.core.api.Assertions.assertThat;
public class ProductDaoTest {
@Test
public void given_aProduct_when_insertToDB_then_recordCanBeRetrievedFromDB() throws IOException, SQLException {
DatabaseUtil.initializeDatabase();
Product product = new Product("FictionalProduct", "$1000", "Jaw-dropping details!", "For more information refer to elder scripts");
ProductDao.save(product);
String selectQuery = "SELECT rowid, name, price FROM product WHERE name = ?";
try (Connection connection = DatabaseUtil.getConnection();
PreparedStatement statement = connection.prepareStatement(selectQuery)) {
statement.setString(1, product.getName());
ResultSet rs = statement.executeQuery();
while (rs.next()) {
assertThat(rs.getInt("rowid")).isEqualTo(1);
assertThat(rs.getString("name")).isEqualTo(product.getName());
assertThat(rs.getString("price")).isEqualTo(product.getPrice());
}
} catch (SQLException e) {
throw e;
}
}
}
| [
"m.ghaharian@gmail.com"
] | m.ghaharian@gmail.com |
2b9977d2ce1a243c57fe0d4b987c8f9173a2d3fa | 23d234145e402c0b4fc0955c28f1dfc364333d55 | /demomysql/src/main/java/com/hungerfool/demomysql/dao/impl/BaseDaoImpl.java | d6ec2d5156a6720d083bb4f39131bd6ef6d5884e | [] | no_license | lasfil/spring-practice | 02e870ad62be3a7317f81cebc0721ad9912a451d | e345206d220ff3bcabe7cfb0c311eaed0b2f50c3 | refs/heads/master | 2021-09-09T10:35:54.269702 | 2018-03-15T08:18:47 | 2018-03-15T08:18:47 | 125,192,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,835 | java | package com.hungerfool.demomysql.dao.impl;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Optional;
import javax.persistence.EntityManager;
import javax.persistence.LockModeType;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.transaction.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import com.hungerfool.demomysql.dao.BaseDao;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
@Transactional
public class BaseDaoImpl<T, ID extends Serializable> implements JpaRepository<T, ID>, BaseDao<T, ID> {
private static final long serialVersionUID = 1L;
private Class<T> entityClass;
@PersistenceContext
protected EntityManager entityManager;
@SuppressWarnings("unchecked")
public BaseDaoImpl()
{
Type type = getClass().getGenericSuperclass();
Type[] parameterizedType = ((ParameterizedType) type).getActualTypeArguments();
entityClass = (Class<T>) parameterizedType[0];
}
@Override
public T find(ID id)
{
if (id != null)
{
return entityManager.find(entityClass, id);
}
return null;
}
@Override
public T find(ID id, LockModeType lockModeType)
{
if (id != null)
{
if (lockModeType != null)
{
return entityManager.find(entityClass, id, lockModeType);
}
else
{
return entityManager.find(entityClass, id);
}
}
return null;
}
@Override
public void persist(T entity)
{
Assert.notNull(entity);
entityManager.persist(entity);
}
@Override
public T merge(T entity)
{
Assert.notNull(entity);
return entityManager.merge(entity);
}
@Override
public void remove(T entity)
{
Assert.notNull(entity);
if (entity != null)
{
entityManager.remove(entity);
}
}
@Override
public Query createNativeQuery(String sql)
{
if (!StringUtils.isEmpty(sql))
{
return entityManager.createNativeQuery(sql);
}
return null;
}
@Override
public void refresh(T entity)
{
Assert.notNull(entity);
if (entity != null)
{
entityManager.refresh(entity);
}
}
@Override
public void refresh(T entity, LockModeType lockModeType)
{
Assert.notNull(entity);
if (entity != null)
{
if (lockModeType != null)
{
entityManager.refresh(entity, lockModeType);
}
else
{
entityManager.refresh(entity);
}
}
}
@SuppressWarnings("unchecked")
@Override
public ID getIdentifier(T entity)
{
Assert.notNull(entity);
if (entity != null)
{
return (ID) entityManager.getEntityManagerFactory().getPersistenceUnitUtil()
.getIdentifier(entity);
}
return null;
}
@Override
public boolean isManaged(T entity)
{
Assert.notNull(entity);
if (entity != null)
{
return entityManager.contains(entity);
}
return false;
}
@Override
public void detach(T entity)
{
Assert.notNull(entity);
if (entity != null)
{
entityManager.detach(entity);
}
}
@Override
public void lock(T entity, LockModeType lockModeType)
{
Assert.notNull(entity);
Assert.notNull(lockModeType);
if (entity != null && lockModeType != null)
{
entityManager.lock(entity, lockModeType);
}
}
@Override
public void clear()
{
entityManager.clear();
}
@Override
public void flush()
{
entityManager.flush();
}
@Override
public Page<T> findAll(Pageable pageable) {
// TODO Auto-generated method stub
return null;
}
@Override
public <S extends T> S save(S entity) {
// TODO Auto-generated method stub
return null;
}
@Override
public Optional<T> findById(ID id) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean existsById(ID id) {
// TODO Auto-generated method stub
return false;
}
@Override
public long count() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void deleteById(ID id) {
// TODO Auto-generated method stub
}
@Override
public void delete(T entity) {
// TODO Auto-generated method stub
}
@Override
public void deleteAll(Iterable<? extends T> entities) {
// TODO Auto-generated method stub
}
@Override
public void deleteAll() {
// TODO Auto-generated method stub
}
@Override
public <S extends T> Optional<S> findOne(Example<S> example) {
// TODO Auto-generated method stub
return null;
}
@Override
public <S extends T> Page<S> findAll(Example<S> example, Pageable pageable) {
// TODO Auto-generated method stub
return null;
}
@Override
public <S extends T> long count(Example<S> example) {
// TODO Auto-generated method stub
return 0;
}
@Override
public <S extends T> boolean exists(Example<S> example) {
// TODO Auto-generated method stub
return false;
}
@Override
public List<T> findAll() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<T> findAll(Sort sort) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<T> findAllById(Iterable<ID> ids) {
// TODO Auto-generated method stub
return null;
}
@Override
public <S extends T> List<S> saveAll(Iterable<S> entities) {
// TODO Auto-generated method stub
return null;
}
@Override
public <S extends T> S saveAndFlush(S entity) {
// TODO Auto-generated method stub
return null;
}
@Override
public void deleteInBatch(Iterable<T> entities) {
// TODO Auto-generated method stub
}
@Override
public void deleteAllInBatch() {
// TODO Auto-generated method stub
}
@Override
public T getOne(ID id) {
// TODO Auto-generated method stub
return null;
}
@Override
public <S extends T> List<S> findAll(Example<S> example) {
// TODO Auto-generated method stub
return null;
}
@Override
public <S extends T> List<S> findAll(Example<S> example, Sort sort) {
// TODO Auto-generated method stub
return null;
}
} | [
"iris.liu@sap.com"
] | iris.liu@sap.com |
427e80ad465fa5bd69c026bf39f4e4b087d340b6 | 170a1ef83a117829a068096b9a3b5395da690fc9 | /src/main/java/org/vsdata/market/collector/collect/CountBolt.java | c49e9d3c86e8e1698e680f321f607cca9f627d30 | [] | no_license | un-knower/market-collector | d5cb1e9446d86183ade2493b5b6e06ccee717a20 | b2ba525c077c268e7ef8dc3cfe244b919596bb8d | refs/heads/master | 2020-03-19T11:24:07.740302 | 2015-06-06T17:30:42 | 2015-06-06T17:30:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,386 | java | package org.vsdata.market.collector.collect;
import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichBolt;
import backtype.storm.tuple.Tuple;
import backtype.storm.tuple.Values;
import java.util.HashMap;
import java.util.Map;
/**
* Created by igorv on 06.06.15.
*/
public class CountBolt extends BaseRichBolt {
private OutputCollector _collector;
Map<String, Long> counts = new HashMap<String, Long>();
int DAY = 86400;
Thread thread = new Thread(){
@Override
public void run() {
try {
Thread.sleep(DAY*1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};
@Override
public void prepare(Map map, TopologyContext topologyContext, OutputCollector outputCollector) {
_collector = outputCollector;
}
@Override
public void execute(Tuple tuple) {
String word = tuple.getString(0);
Long count = counts.get(word);
if (count == null)
count = (long)0;
count++;
counts.put(word, count);
_collector.emit(new Values(word, count));
}
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
}
}
| [
"ivarga@maprtech.com"
] | ivarga@maprtech.com |
514418ec3e52bd750f2f43c734aad04a0159c06d | 78a89be8d35f06bd2de54d2a9ca307c67fb8c32e | /src/test/java/FantasyAdventure/Players/WizardTest.java | 0fab2ea6684b43aff1e5dc316ec75b09571fca8e | [] | no_license | matosca/lab_wk12_d4-Fantasy_Adventure | 27f9fd605664dc1b9b5843e5707995c8fcde242f | 54cf664e20fefe3ccd114fb52387f88c789bdedd | refs/heads/master | 2020-05-24T00:31:42.033855 | 2019-05-19T16:44:24 | 2019-05-19T16:44:24 | 187,018,073 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,235 | java | package FantasyAdventure.Players;
import FantasyAdventure.Enemies.Orc;
import FantasyAdventure.Enemies.Troll;
import FantasyAdventure.Enums.MythicalCreatures;
import FantasyAdventure.Enums.PreciousObjects;
import FantasyAdventure.Enums.Race;
import FantasyAdventure.Enums.Spells;
import FantasyAdventure.Players.Magic.Wizard;
import FantasyAdventure.Rooms.EnemyRoom;
import FantasyAdventure.Rooms.TreasureRoom;
import FantasyAdventure.Rooms.UltimateRoom;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class WizardTest {
Wizard wizard;
Orc orc;
Troll troll;
TreasureRoom treasureRoom;
EnemyRoom enemyRoom;
UltimateRoom ultimateRoom;
@Before
public void before(){
wizard = new Wizard("Potter", Race.HUMAN, 20, Spells.LIGHTNING, MythicalCreatures.HIPPOGRIFF);
orc = new Orc(40, 5, 7);
troll = new Troll(30, 6, 5);
treasureRoom = new TreasureRoom(1000);
enemyRoom = new EnemyRoom(140, orc);
ultimateRoom = new UltimateRoom(2000, PreciousObjects.GOLDENRING);
}
@Test
public void hasName(){
assertEquals("Potter", wizard.getName());
}
@Test
public void hasRace(){
assertEquals(Race.HUMAN, wizard.getRace());
}
@Test
public void hasWallet(){
assertEquals(20, wizard.getWallet());
}
@Test
public void hasSpells(){
assertEquals(Spells.LIGHTNING, wizard.getSpell());
}
@Test
public void canChooseADifferentSpell() {
wizard.changeSpell(Spells.DISINTEGRATE);
assertEquals(Spells.DISINTEGRATE, wizard.getSpell());
}
@Test
public void hasSpellDamage(){
assertEquals(13, wizard.getDamage());
}
@Test
public void hasAMythicalCreature(){
assertEquals(MythicalCreatures.HIPPOGRIFF, wizard.getCreature());
}
@Test
public void hasDefendPointsFromMythicalCreature(){
assertEquals(16, wizard.getDefendPoints());
}
@Test
public void canAttack(){
wizard.attack(orc);
assertEquals(100, wizard.getHealthPoints());
}
@Test
public void canDefend(){
wizard.defend(orc.getDamage());
assertEquals(91, wizard.getHealthPoints());
}
@Test
public void startsOffNullRoom(){
assertEquals(null, wizard.getCurrentRoom());
}
@Test
public void canEnterRoom(){
wizard.enterRoom(treasureRoom);
assertEquals(treasureRoom, wizard.getCurrentRoom());
}
@Test
public void cannotGetCoinsUnlessInRoom(){
assertEquals(20, wizard.getCoins());
}
@Test
public void canGetCoinsFromRoom(){
wizard.enterRoom(treasureRoom);
wizard.getCoins();
assertEquals(1020, wizard.getWallet());
}
@Test
public void cannotFightEnemyUnlessInRoom(){
assertEquals(100, wizard.getHealthPoints());
}
@Test
public void canFightEnemyInRoom(){
wizard.enterRoom(enemyRoom);
wizard.fight();
assertEquals(55, wizard.getHealthPoints());
assertEquals(0, orc.getHealthPoints());
}
@Test
public void hasABagOfObjectsEmpty(){
assertEquals(0, wizard.preciousObjectsCount());
}
@Test
public void cannotCollectPreciousObjectUnlessInRoom(){
assertEquals(0, wizard.preciousObjectsCount());
}
@Test
public void canCollectPreciousObjectFromRoom(){
wizard.enterRoom(ultimateRoom);
wizard.collectPreciousObject();
assertEquals(1, wizard.preciousObjectsCount());
}
@Test
public void getObjectFromBagWhenCollectedObjectFromRoom(){
wizard.enterRoom(ultimateRoom);
wizard.collectPreciousObject();
assertEquals(PreciousObjects.GOLDENRING, wizard.getObjectFromBag());
}
@Test
public void canFightAndDefeatMoreThanOneEnemyInRoom() {
wizard.enterRoom(ultimateRoom);
ultimateRoom.addEnemiesToRoom(troll);
ultimateRoom.addEnemiesToRoom(orc);
wizard.fightingMultipleEnemies();
assertEquals(0, troll.getHealthPoints());
assertEquals(0, orc.getHealthPoints());
assertEquals(0, wizard.getHealthPoints());
}
}
| [
"mtoscanor37@gmail.com"
] | mtoscanor37@gmail.com |
49bd7d331defbfec8ff24dd91bec5d52acd7e477 | a75f6902babebd04104417cd69bbbc1ad332b276 | /fibonacciSeries.java | c4f9eb9a396bb0e5224bee9e8ac876c05c57193a | [] | no_license | hardik632/Java-codes | 3e97a4585dd34d2479c18cc9144ad11b57c51fbc | 40d0988a559ddb8120e2318425234348f90e944f | refs/heads/master | 2021-05-18T10:09:20.507435 | 2020-04-05T05:33:18 | 2020-04-05T05:33:18 | 251,204,760 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 881 | java | import java.util.*;
public class fibonacciSeries {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[] a=new int[n+1];
System.out.println(fiboRecursion(n));
System.out.println(fiboMemoization(n,a));
System.out.println(fiboTabulation(n,a));
}
public static int fiboRecursion(int n)
{
if(n==0|| n==1)
{
return n;
}
return fiboRecursion(n-1)+fiboRecursion(n-2);
}
public static int fiboMemoization(int n,int[] dp)
{
if(n==0 || n==1)
{
return n;
}
if(dp[n]!=0)
{
return dp[n];
}
for(int i=2;i<n+1;i++)
{
dp[i]=fiboMemoization(i-1, dp)+fiboMemoization(i-2,dp);
}
return dp[n];
}
public static int fiboTabulation(int n , int[] dp)
{
dp[0]=0;
dp[1]=1;
for(int i=2;i<n+1;i++)
{
dp[i]=dp[i-1]+dp[i-2];
}
return dp[n];
}
}
| [
"hardikdhiman.hd6@gmail.com"
] | hardikdhiman.hd6@gmail.com |
e7e48d2d461f84c88f03e0d56396951c93e0dcad | 79d8e8803bd4e9406c8bbcafd8a896ecac509253 | /homebundle/src/test/java/tvtaobao/com/homebundle/ExampleUnitTest.java | fd74a6686dbd9879b771567416a2a38ab6032b06 | [] | no_license | chenjiajuan/AtlasDemo | 812866f4025a1a2eeabf3a7ce0a0d3cab743d59b | b500842f83ada2fa5f34ba31d6f59e2532edb7ae | refs/heads/master | 2021-01-20T07:27:49.180666 | 2017-08-27T08:52:31 | 2017-08-27T08:52:31 | 101,540,183 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package tvtaobao.com.homebundle;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"chenjiajuan@zhiping.tech"
] | chenjiajuan@zhiping.tech |
77f67e28fe30f2c16c154dad36fea806f901df4f | 75467931cfc8c57dfff3c9f6db6fea40bd30079a | /java/src/com.al/ValidPalindrome/ValidPalindrome.java | 8149e5a0eca9bd0e95ffd15ffa04b2f5b20c8bb1 | [] | no_license | LionCoder4ever/algorithm | f6970f635a13c2e02a73097136e34421dab2841e | 2c06f7eaa9100426d6c665645ad9f812885dc70e | refs/heads/master | 2022-07-29T15:38:38.460473 | 2022-07-21T15:17:43 | 2022-07-21T15:17:43 | 222,128,626 | 0 | 0 | null | 2022-06-27T11:38:29 | 2019-11-16T16:37:31 | Java | UTF-8 | Java | false | false | 1,110 | java | package com.al.ValidPalindrome;
public class ValidPalindrome {
class Solution {
public boolean isPalindrome(String s) {
if (s.isEmpty()) return true;
s = s.toLowerCase();
int pos = 0, endpos = s.length() - 1;
char posC, endposC;
while (pos <= endpos) {
posC = s.charAt(pos);
endposC = s.charAt(endpos);
if (!((posC >= '0' && posC <= '9') || (posC >= 'a' && posC <= 'z'))) {
pos++;
continue;
}
if (!((endposC >= '0' && endposC <= '9') || (endposC >= 'a' && endposC <= 'z'))) {
endpos--;
continue;
}
if (posC != endposC) {
return false;
}
pos++;
endpos--;
}
return true;
}
}
public static void main(String[] args) {
Solution sl = new ValidPalindrome().new Solution();
System.out.println(sl.isPalindrome("car ac"));
}
}
| [
"kzwcoder2015@163.com"
] | kzwcoder2015@163.com |
38be851b91b70003baad1cddf7e187deca85d3b4 | 9827aed39aa2648223cd928f824626e77808a32e | /app/src/main/java/com/myapplicationdev/android/p10_ndpsongs_clv/DBHelper.java | f19c6953790a82810aaba5328c0ceeb477fbb0b7 | [] | no_license | jialerrr/L11-NDPSongs-CustomLV | b9b98d18a0cd0b8b6821ae27f194de07cfb444c6 | 46e41f70f37926ccfef3ff495cd4a3a3691f22fb | refs/heads/master | 2023-06-28T10:20:41.206817 | 2021-08-03T05:03:20 | 2021-08-03T05:03:20 | 392,195,760 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,148 | java | package com.myapplicationdev.android.p10_ndpsongs_clv;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import java.util.ArrayList;
public class DBHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "ndpsongs.db";
private static final int DATABASE_VERSION = 1;
private static final String TABLE_SONG = "Song";
private static final String COLUMN_ID = "_id";
private static final String COLUMN_TITLE = "title";
private static final String COLUMN_SINGERS = "singers";
private static final String COLUMN_YEAR = "year";
private static final String COLUMN_STARS = "stars";
public DBHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
// CREATE TABLE Song
// (id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT,
// singers TEXT, stars INTEGER, year INTEGER );
String createSongTableSql = "CREATE TABLE " + TABLE_SONG + "("
+ COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ COLUMN_TITLE + " TEXT, "
+ COLUMN_SINGERS + " TEXT, "
+ COLUMN_YEAR + " INTEGER, "
+ COLUMN_STARS + " REAL )";
db.execSQL(createSongTableSql);
Log.i("info", createSongTableSql + "\ncreated tables");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_SONG);
onCreate(db);
}
public long insertSong(String title, String singers, int year, float stars) {
// Get an instance of the database for writing
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(COLUMN_TITLE, title);
values.put(COLUMN_SINGERS, singers);
values.put(COLUMN_YEAR, year);
values.put(COLUMN_STARS, stars);
// Insert the row into the TABLE_SONG
long result = db.insert(TABLE_SONG, null, values);
// Close the database connection
db.close();
Log.d("SQL Insert","" + result);
return result;
}
public ArrayList<Song> getAllSongs() {
ArrayList<Song> songslist = new ArrayList<Song>();
String selectQuery = "SELECT " + COLUMN_ID + ","
+ COLUMN_TITLE + "," + COLUMN_SINGERS + ","
+ COLUMN_YEAR + ","
+ COLUMN_STARS + " FROM " + TABLE_SONG;
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
if (cursor.moveToFirst()) {
do {
int id = cursor.getInt(0);
String title = cursor.getString(1);
String singers = cursor.getString(2);
int year = cursor.getInt(3);
float stars = cursor.getFloat(4);
Song newSong = new Song(id, title, singers, year, stars);
songslist.add(newSong);
} while (cursor.moveToNext());
}
cursor.close();
db.close();
return songslist;
}
public ArrayList<Song> getAllSongsByStars(int starsFilter) {
ArrayList<Song> songslist = new ArrayList<Song>();
SQLiteDatabase db = this.getReadableDatabase();
String[] columns= {COLUMN_ID, COLUMN_TITLE, COLUMN_SINGERS, COLUMN_YEAR, COLUMN_STARS};
String condition = COLUMN_STARS + ">= ?";
String[] args = {String.valueOf(starsFilter)};
//String selectQuery = "SELECT " + COLUMN_ID + ","
// + COLUMN_TITLE + ","
// + COLUMN_SINGERS + ","
// + COLUMN_YEAR + ","
// + COLUMN_STARS
// + " FROM " + TABLE_SONG;
Cursor cursor;
cursor = db.query(TABLE_SONG, columns, condition, args, null, null, null, null);
// Loop through all rows and add to ArrayList
if (cursor.moveToFirst()) {
do {
int id = cursor.getInt(0);
String title = cursor.getString(1);
String singers = cursor.getString(2);
int year = cursor.getInt(3);
float stars = cursor.getFloat(4);
Song newSong = new Song(id, title, singers, year, stars);
songslist.add(newSong);
} while (cursor.moveToNext());
}
// Close connection
cursor.close();
db.close();
return songslist;
}
public int updateSong(Song data){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(COLUMN_TITLE, data.getTitle());
values.put(COLUMN_SINGERS, data.getSingers());
values.put(COLUMN_YEAR, data.getYearReleased());
values.put(COLUMN_STARS, data.getStars());
String condition = COLUMN_ID + "= ?";
String[] args = {String.valueOf(data.getId())};
int result = db.update(TABLE_SONG, values, condition, args);
db.close();
return result;
}
public int deleteSong(int id){
SQLiteDatabase db = this.getWritableDatabase();
String condition = COLUMN_ID + "= ?";
String[] args = {String.valueOf(id)};
int result = db.delete(TABLE_SONG, condition, args);
db.close();
return result;
}
}
| [
"20021576@myrp.edu.sg"
] | 20021576@myrp.edu.sg |
384249c9e291f4b3632803f1c0b5a2f590128972 | bd244d8e5b58af2b44ab2f3415541bd47fe042df | /kaicomplatform/src/main/java/com/kaicom/api/broad/MachineCodeBroadcast.java | dd0faaea21402e792d5e9a669349a72194de1b80 | [] | no_license | zjchaoking/MyMvpTest | b602109def6d5f4f385f3fb00e377cd9112cab43 | 9d1edd886011f423b85d8f7be9cd3328e72ce048 | refs/heads/master | 2020-03-14T17:30:21.301136 | 2018-11-19T18:12:38 | 2018-11-19T18:12:38 | 131,721,623 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java | package com.kaicom.api.broad;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
* Created by cjb on 2016/4/12 0012.
*/
public class MachineCodeBroadcast extends BroadcastReceiver {
public static final String GET_MACHINE_CODE_ACTION = "com.android.receive_pda_sn";
public static final String REQUEST_MACHINE_CODE_ACTION = "com.android.receive_get_pda_sn";
static MachineCodeListener mMachineCodeListener;
public MachineCodeBroadcast(){
}
public MachineCodeBroadcast(MachineCodeListener machineCodeListener) {
mMachineCodeListener = machineCodeListener;
}
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals("com.android.receive_pda_sn")) {
String data = intent.getStringExtra("pda_sn");
if(mMachineCodeListener!=null){
mMachineCodeListener.onMachineCodeListener(data);
}
}
}
public interface MachineCodeListener {
void onMachineCodeListener(String code);
}
}
| [
"810910626@qq.com"
] | 810910626@qq.com |
9e15fe9cc7d67a519e888d94146bd192f9699448 | 8daae9a50372213e57c90b7f3ada4c279421113b | /recyclerview-swipe/src/main/java/com/recyclerview/swipe/SwipeMenu.java | 8ebf74ca6c5a7b415c484b9f2935c77083dee5e5 | [] | no_license | 308229387/RecyclerViewSwipe | 1471c017e04ce76b293b98ab1a6f2e296ce665b7 | 5486a830b007fd28eb92c6d3ed4aa664d21f8bf7 | refs/heads/master | 2021-01-19T15:40:41.428231 | 2017-04-14T10:58:46 | 2017-04-14T10:58:49 | 88,228,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,416 | java | /*
* Copyright 2016 Yan Zhenjie
*
* 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.recyclerview.swipe;
import android.content.Context;
import android.support.annotation.IntDef;
import android.widget.LinearLayout;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Yan Zhenjie on 2016/7/22.
*/
public class SwipeMenu {
@IntDef({HORIZONTAL, VERTICAL})
@Retention(RetentionPolicy.SOURCE)
public @interface OrientationMode {
}
public static final int HORIZONTAL = LinearLayout.HORIZONTAL;
public static final int VERTICAL = LinearLayout.VERTICAL;
private SwipeMenuLayout mSwipeMenuLayout;
private int mViewType;
private int orientation = HORIZONTAL;
private List<SwipeMenuItem> mSwipeMenuItems;
public SwipeMenu(SwipeMenuLayout swipeMenuLayout, int viewType) {
this.mSwipeMenuLayout = swipeMenuLayout;
this.mViewType = viewType;
this.mSwipeMenuItems = new ArrayList<>(2);
}
/**
* Set a percentage.
*
* @param openPercent such as 0.5F.
*/
public void setOpenPercent(float openPercent) {
if (openPercent != mSwipeMenuLayout.getOpenPercent()) {
openPercent = openPercent > 1 ? 1 : (openPercent < 0 ? 0 : openPercent);
mSwipeMenuLayout.setOpenPercent(openPercent);
}
}
/**
* The duration of the set.
*
* @param scrollerDuration such 500.
*/
public void setScrollerDuration(int scrollerDuration) {
this.mSwipeMenuLayout.setScrollerDuration(scrollerDuration);
}
/**
* Set the menu orientation.
*
* @param orientation use {@link SwipeMenu#HORIZONTAL} or {@link SwipeMenu#VERTICAL}.
* @see SwipeMenu#HORIZONTAL
* @see SwipeMenu#VERTICAL
*/
public void setOrientation(@OrientationMode int orientation) {
if (orientation != HORIZONTAL && orientation != VERTICAL)
throw new IllegalArgumentException("Use SwipeMenu#HORIZONTAL or SwipeMenu#VERTICAL.");
this.orientation = orientation;
}
/**
* Get the menu orientation.
*
* @return {@link SwipeMenu#HORIZONTAL} or {@link SwipeMenu#VERTICAL}.
*/
@OrientationMode
public int getOrientation() {
return orientation;
}
public void addMenuItem(SwipeMenuItem item) {
mSwipeMenuItems.add(item);
}
public void removeMenuItem(SwipeMenuItem item) {
mSwipeMenuItems.remove(item);
}
public List<SwipeMenuItem> getMenuItems() {
return mSwipeMenuItems;
}
public SwipeMenuItem getMenuItem(int index) {
return mSwipeMenuItems.get(index);
}
public Context getContext() {
return mSwipeMenuLayout.getContext();
}
public int getViewType() {
return mViewType;
}
}
| [
"songyongmeng@58ganjil.com"
] | songyongmeng@58ganjil.com |
f561df2c4c4f38f17f03ba2dcf0e8a598cf88399 | 0f1762f2d8816bcbf50ce69c54a254340cddc7cc | /app/src/main/java/com/example/torin/nfcapp/MainActivity.java | ecd245a7eb8d64159085d336716ef79b68aca58f | [] | no_license | utdesign-iot/NFCApp | ea75f3cc5908ebeff4b518d4d2a5e00910e52bbe | 69583d812388a0d5382b19216590744584dbec71 | refs/heads/master | 2020-04-17T11:18:41.780395 | 2016-08-26T00:00:10 | 2016-08-26T00:00:10 | 66,601,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,032 | java | package com.example.torin.nfcapp;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.IntentFilter;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.os.Parcelable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
import java.io.UnsupportedEncodingException;
import com.example.torin.nfcapp.R;
public class MainActivity extends AppCompatActivity
{
private NfcAdapter nfcAdapter;
public final static String URL = "http://ecs.utdallas.edu";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
nfcAdapter = NfcAdapter.getDefaultAdapter(this);
}
@Override
protected void onResume() {
super.onResume();
// if nfc adapter is null, then it means that the device does not have an nfc reader.
if(nfcAdapter != null && nfcAdapter.isEnabled())
{
Intent intent = new Intent(this, MainActivity.class).addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
IntentFilter[] intentFilters = new IntentFilter[]{};
nfcAdapter.enableForegroundDispatch(this, pendingIntent, intentFilters, null);
}
}
@Override
protected void onPause() {
super.onPause();
//disables nfc on pause if device supports nfc
if(nfcAdapter != null && nfcAdapter.isEnabled())
nfcAdapter.disableForegroundDispatch(this);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
//if new intent is nfc
if(intent.hasExtra(NfcAdapter.EXTRA_TAG))
{
Toast.makeText(this, "NfcIntent", Toast.LENGTH_SHORT).show();
//get ndef messages
Parcelable[] parcelables = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
// read messages if there are any on tag
if(parcelables != null && parcelables.length > 0)
readTextFromMessage((NdefMessage) parcelables[0]);
else
Toast.makeText(this, "No NDEF messages found", Toast.LENGTH_SHORT).show();
}
//else handle as a normal intent
else
setIntent(intent);
}
//This function extracts urls from ndef messages and sends them to the browser activity
private void readTextFromMessage (NdefMessage ndefMessage)
{
NdefRecord[] ndefRecords = ndefMessage.getRecords();
if(ndefRecords != null && ndefRecords.length > 0)
{
//first record has url
NdefRecord ndefRecord = ndefRecords[0];
//get text from first record
String tagContent = getTextFromNdefRecord(ndefRecord);
//create intent
Intent intent = new Intent(this, BrowserActivity.class);
intent.putExtra(URL, tagContent);
//send to browser activity
startActivity(intent);
}
else
Toast.makeText(this, "No NDEF records found", Toast.LENGTH_SHORT).show();
}
//This function extracts the text from an ndef record
public String getTextFromNdefRecord(NdefRecord ndefRecord)
{
String tagContent = null;
try
{
//decode ndef record based on ndef standards
byte[] payload = ndefRecord.getPayload();
String textEncoding = ((payload[0] & 128) == 0) ? "UTF-8" : "UTF-16";
int languageSize = payload[0] & 0063;
//store url in new string
tagContent = new String(payload, languageSize + 1, payload.length - languageSize - 1, textEncoding);
}
catch (UnsupportedEncodingException e)
{
e.printStackTrace();
}
//return url
return tagContent;
}
}
| [
"torin.list@gmail.com"
] | torin.list@gmail.com |
d5f6f99b135b3b8293ea99c86c3a5930af2df290 | fbcf89c286f56d93ea967b1a264262078e6e207e | /src/com/thread/test/extThread/LoginA.java | 5ef1f6b56f10eb7030338702eab986351578a35a | [] | no_license | qiangbrother/threadDemo | d0f27433f3eadda8a6bfa232c131060e5dd7fb31 | 27937a392e65973bfa171828b455043f83d33ba3 | refs/heads/master | 2020-05-16T08:12:27.227238 | 2019-04-29T06:41:29 | 2019-04-29T06:41:29 | 182,901,123 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | /**
* FileName: LoginA
* Author: 99552
* Date: 2018/5/11 14:36
* Description:
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package com.thread.test.extThread;
public class LoginA extends Thread{
@Override
public void run() {
LoginServlet.doPost("a","aaa");
}
}
| [
"995521405@qq.com"
] | 995521405@qq.com |
bd6b0196fae497bfcd47f3b77ce2b622a21557f7 | 9315548c51e85bd434dab963bb0f273e887db4f5 | /src/_09_Ternary/Advance_1_Harfler.java | 74b3d737fac62744e0fa078da26fd002482fc351 | [] | no_license | alicanbelli/all_java_questions_2021 | 4b7496488877339786ebb87448d3873779e72073 | afb175f6e69199e917f8756e7a1ffa8c97219040 | refs/heads/master | 2023-03-08T18:12:23.985970 | 2021-03-01T22:43:32 | 2021-03-01T22:43:32 | 334,950,462 | 0 | 1 | null | 2021-03-01T22:43:33 | 2021-02-01T12:57:36 | Java | UTF-8 | Java | false | false | 581 | java | package _09_Ternary;
public class Advance_1_Harfler {
public static void main(String[] args) {
char c='z';
System.out.println("c: "+ c);
char d=c--;
System.out.println("d : " + d);
System.out.println("c yeni : " + c);
char e=--c;
System.out.println("e : " + e);
System.out.println("c son : " + c);
char f=c-=2;
System.out.println("c son son : " + c);
System.out.println("f : " + f);
char result=(d>e)?(e>f)?f:(d<f)?e:d:f;
System.out.println(result);
}
}
| [
"acan.techproed@gmail.com"
] | acan.techproed@gmail.com |
60262841ddfa817c2a5fb92ed5cdbed18141e8c3 | b108b825ffdec76a6bd945e2911277959a33a6eb | /wyzsb/src/main/java/view/lcc/wyzsb/view/home/GildeImageView/GlideImageLoader.java | dba1c93ec9831977356b2f5b7a362d1c7ad132d0 | [] | no_license | liangchengcheng/ZSBPJ | 87ba63f589121821697e5c8c90e9820484aa5762 | 5e48b3bef2b88d8dec9bce605681c3336c9e46c3 | refs/heads/master | 2020-04-04T05:50:55.475814 | 2018-12-12T07:49:13 | 2018-12-12T07:49:13 | 48,907,404 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,181 | java | package view.lcc.wyzsb.view.home.GildeImageView;
import android.net.Uri;
import android.support.annotation.IdRes;
import android.text.TextUtils;
import android.widget.ImageView;
import com.bumptech.glide.DrawableRequestBuilder;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
/**
* Created by sunfusheng on 2017/1/23.
*/
public class GlideImageLoader {
public static final String ANDROID_RESOURCE = "android.resource://";
public static final String SEPARATOR = "/";
private ImageView mImageView;
public GlideImageLoader(ImageView view) {
mImageView = view;
}
// 将资源ID转为Uri
public Uri resIdToUri(int resourceId) {
return Uri.parse(ANDROID_RESOURCE + mImageView.getContext().getPackageName() + SEPARATOR + resourceId);
}
// 加载网络图片
public void loadNetImage(String url, int holderResId) {
urlBuilder(url, holderResId).into(mImageView);
}
// 加载drawable图片
public void loadResImage(@IdRes int resId, int holderResId) {
resBuilder(resId, holderResId).into(mImageView);
}
// 加载本地图片
public void loadLocalPathImage(String path, int holderResId) {
urlBuilder("file://" + path, holderResId).into(mImageView);
}
// 加载网络圆型图片
public void loadNetCircleImage(String url, int holderResId) {
urlBuilder(url, holderResId)
.transform(new GlideCircleTransform(mImageView.getContext()))
.into(mImageView);
}
// 加载drawable圆型图片
public void loadLocalResCircleImage(int resId, int holderResId) {
resBuilder(resId, holderResId)
.transform(new GlideCircleTransform(mImageView.getContext()))
.into(mImageView);
}
// 加载本地圆型图片
public void loadLocalPathCircleImage(String path, int holderResId) {
urlBuilder("file://" + path, holderResId)
.transform(new GlideCircleTransform(mImageView.getContext()))
.into(mImageView);
}
// 创建 Res DrawableRequestBuilder
public DrawableRequestBuilder resBuilder(int resId, int holderResId) {
return uriBuilder(resIdToUri(resId), holderResId);
}
// 创建 Uri DrawableRequestBuilder
public DrawableRequestBuilder uriBuilder(Uri uri, int holderResId) {
return Glide.with(mImageView.getContext())
.load(uri)
.crossFade()
.dontAnimate()
.fallback(holderResId)
.error(holderResId)
.diskCacheStrategy(DiskCacheStrategy.SOURCE);
}
// 创建 Url DrawableRequestBuilder
public DrawableRequestBuilder urlBuilder(final String url, int holderResId) {
if (GlideManager.getInstance().isFailedUrl(url)) {
return resBuilder(holderResId, holderResId);
}
return Glide.with(mImageView.getContext())
.load(url)
.crossFade()
.dontAnimate()
.fallback(holderResId)
.error(holderResId)
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
GlideManager.getInstance().putFailedUrl(url);
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
return false;
}
});
}
public boolean isGif(String url) {
if (TextUtils.isEmpty(url)) return false;
if (url.endsWith(".gif")) return true;
return false;
}
}
| [
"1038127753@qq.com"
] | 1038127753@qq.com |
b4c7fa5f6ae52f2247b48798f5f3424721b4f663 | f33263b264f0adacd08fa9c3fbb4122136b39528 | /src/Ejercicio4.java | 640d22c33f24a38279e91e940243d2bece7c1163 | [] | no_license | cescobar99/Ejercicio4 | 56862aed871f21c9b4ae246e179bb84be378f715 | 2c8a2c330bd51a8bda678df120aad45b292f4bf9 | refs/heads/master | 2020-12-07T18:53:08.488979 | 2016-08-21T23:56:35 | 2016-08-21T23:56:35 | 66,213,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,244 | java |
import javax.swing.JOptionPane;
/*
* 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.
*/
/**
*
* @author User
*/
public class Ejercicio4 extends javax.swing.JFrame {
/**
* Creates new form Ejercicio4
*/
public Ejercicio4() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
txtMetrosCuadrados = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
txtValorMetro = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
txtCuotaInicial = new javax.swing.JTextField();
txtCuotas = new javax.swing.JTextField();
cmdCalcular = new javax.swing.JButton();
cmdBorrar = new javax.swing.JButton();
jLabel6 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 0, 0));
jLabel1.setText("Immobiliaria");
jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(138, 11, 120, 20));
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel2.setForeground(new java.awt.Color(0, 0, 255));
jLabel2.setText("Metros cuadrados");
jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 60, -1, -1));
txtMetrosCuadrados.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtMetrosCuadradosActionPerformed(evt);
}
});
txtMetrosCuadrados.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
txtMetrosCuadradosKeyTyped(evt);
}
});
jPanel1.add(txtMetrosCuadrados, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 60, 210, -1));
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel3.setForeground(new java.awt.Color(51, 0, 255));
jLabel3.setText("Valor Metro Cuadrado");
jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 100, -1, -1));
txtValorMetro.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
txtValorMetroKeyTyped(evt);
}
});
jPanel1.add(txtValorMetro, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 100, 210, -1));
jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 140, -1, -1));
jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel5.setForeground(new java.awt.Color(51, 0, 255));
jLabel5.setText("Valor 12 cuotas");
jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 180, -1, -1));
txtCuotaInicial.setEditable(false);
txtCuotaInicial.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
txtCuotaInicialKeyTyped(evt);
}
});
jPanel1.add(txtCuotaInicial, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 140, 210, -1));
txtCuotas.setEditable(false);
txtCuotas.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
txtCuotasKeyTyped(evt);
}
});
jPanel1.add(txtCuotas, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 180, 210, -1));
cmdCalcular.setFont(new java.awt.Font("Tempus Sans ITC", 1, 12)); // NOI18N
cmdCalcular.setForeground(new java.awt.Color(0, 255, 102));
cmdCalcular.setText("CALCULAR");
cmdCalcular.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmdCalcularActionPerformed(evt);
}
});
jPanel1.add(cmdCalcular, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 230, -1, -1));
cmdBorrar.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
cmdBorrar.setForeground(new java.awt.Color(0, 255, 102));
cmdBorrar.setText("BORRAR");
cmdBorrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmdBorrarActionPerformed(evt);
}
});
jPanel1.add(cmdBorrar, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 230, -1, -1));
jLabel6.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel6.setForeground(new java.awt.Color(0, 0, 255));
jLabel6.setText("Cuota Inicial");
jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 140, -1, -1));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void txtMetrosCuadradosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMetrosCuadradosActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtMetrosCuadradosActionPerformed
private void cmdCalcularActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdCalcularActionPerformed
String CuotaI, Cuota12, ValorMC;
int metrosc;
double op3=0, op2=0, op1=0;
if(txtMetrosCuadrados.getText().trim().isEmpty()){
JOptionPane.showMessageDialog(this, "Digite los metros cuadrados", "Error", JOptionPane.ERROR_MESSAGE);
txtMetrosCuadrados.requestFocusInWindow();
}
else {
metrosc= Integer.parseInt(txtMetrosCuadrados.getText());
op3= 80000*metrosc;
op1=(op3*35)/100;
op2= op1/12;
}
CuotaI= String.valueOf(op1);
txtCuotaInicial.setText("$"+CuotaI);
Cuota12= String.valueOf(op2);
txtCuotas.setText("$"+Cuota12);
ValorMC= String.valueOf(op3);
txtValorMetro.setText("$"+ValorMC);
}//GEN-LAST:event_cmdCalcularActionPerformed
private void cmdBorrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdBorrarActionPerformed
txtMetrosCuadrados.setText("");
txtCuotaInicial.setText("");
txtCuotas.setText("");
txtMetrosCuadrados.requestFocusInWindow();
}//GEN-LAST:event_cmdBorrarActionPerformed
private void txtValorMetroKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtValorMetroKeyTyped
char c=evt.getKeyChar();
if(!Character.isDigit(c)){
getToolkit().beep();
evt.consume();
}
}//GEN-LAST:event_txtValorMetroKeyTyped
private void txtCuotaInicialKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtCuotaInicialKeyTyped
char c=evt.getKeyChar();
if(!Character.isDigit(c)){
getToolkit().beep();
evt.consume();
}
}//GEN-LAST:event_txtCuotaInicialKeyTyped
private void txtCuotasKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtCuotasKeyTyped
char c=evt.getKeyChar();
if(!Character.isDigit(c)){
getToolkit().beep();
evt.consume();
}
}//GEN-LAST:event_txtCuotasKeyTyped
private void txtMetrosCuadradosKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMetrosCuadradosKeyTyped
char c=evt.getKeyChar();
if(!Character.isDigit(c)){
getToolkit().beep();
evt.consume();
}
}//GEN-LAST:event_txtMetrosCuadradosKeyTyped
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Ejercicio4.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Ejercicio4.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Ejercicio4.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Ejercicio4.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Ejercicio4().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cmdBorrar;
private javax.swing.JButton cmdCalcular;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField txtCuotaInicial;
private javax.swing.JTextField txtCuotas;
private javax.swing.JTextField txtMetrosCuadrados;
private javax.swing.JTextField txtValorMetro;
// End of variables declaration//GEN-END:variables
}
| [
"“camiloelrey2014@gmail.com”"
] | “camiloelrey2014@gmail.com” |
16b87dda098c8d9289d2b1373dae60e197cff353 | b7c9b02725a85376bc8d0f6eeafc7929b4a7a4c3 | /src/main/java/com/anglesharp/app/core/User.java | ada0d3100e13a9b2e9aeb11e1009e196ac0ae033 | [
"MIT"
] | permissive | yokuze/dropwizard-backbone-app | 77753f6802e4d3e433a137ead4de33f4d807fd4f | 31ad2c899e5a9ce6ccf74aa9415488001b2bdccb | refs/heads/master | 2021-01-22T11:58:25.328550 | 2014-09-20T05:00:58 | 2014-09-20T05:00:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,230 | java | package com.anglesharp.app.core;
import java.util.Date;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.Index;
import com.anglesharp.app.core.Settings.Setting;
import com.anglesharp.app.roles.Roles;
import com.anglesharp.app.roles.Roles.Role;
import com.anglesharp.app.util.PasswordHash;
import com.anglesharp.app.util.UUIDUtil;
@Entity @Table(name = "user")
public class User {
@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
@Index(name = "user_email")
private String email;
private String password;
private Date created;
private Date lastLogin;
private String passwordResetCode;
private String emailVerificationCode;
private boolean emailVerified;
@ManyToOne
private Roles role;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = CascadeType.ALL)
private Set<Settings> settings;
@Transient
private String roleName;
private Date deleted;
public User() {
this.created = new Date();
}
public User(String email) {
this.passwordResetCode = UUIDUtil.code();
this.emailVerificationCode = UUIDUtil.code();
this.email = email;
this.created = new Date();
}
public User(String email, String password) {
this.passwordResetCode = UUIDUtil.code();
this.emailVerificationCode = UUIDUtil.code();
this.email = email;
this.password = PasswordHash.hash(password);
this.created = new Date();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getLastLogin() {
return lastLogin;
}
public void setLastLogin(Date lastLogin) {
this.lastLogin = lastLogin;
}
public String getPasswordResetCode() {
return passwordResetCode;
}
public void setPasswordResetCode(String passwordResetCode) {
this.passwordResetCode = passwordResetCode;
}
public String getEmailVerificationCode() {
return emailVerificationCode;
}
public void setEmailVerificationCode(String emailVerificationCode) {
this.emailVerificationCode = emailVerificationCode;
}
public boolean isEmailVerified() {
return emailVerified;
}
public void setEmailVerified(boolean emailVerified) {
this.emailVerified = emailVerified;
}
public Roles getRole() {
return role;
}
public void setRole(Roles role) {
this.role = role;
}
public Set<Settings> getSettings() {
return settings;
}
public void setSettings(Set<Settings> settings) {
this.settings = settings;
}
public String getSetting(Setting setting) {
for(Settings s: settings) {
if(s.getName() == setting)
return s.getValue();
}
return "";
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Date getDeleted() {
return deleted;
}
public void setDeleted(Date deleted) {
this.deleted = deleted;
}
public boolean authenticate(String plaintextPassword) {
return PasswordHash.check(plaintextPassword, password);
}
public boolean hasRole(Role name) {
if(this.role == null || name == null)
return false;
return containsRole(this.role, name);
}
private boolean containsRole(Roles role, Role name) {
if(role.getName() == name)
return true;
for(Roles r : role.getChildren()) {
if(containsRole(r, name))
return true;
}
return false;
}
}
| [
"iceice77@gmail.com"
] | iceice77@gmail.com |
6b91fae65b790bbf66bf085d6af7f2e5eef07b98 | 857d11b98915be485d8f040c506928f85f1dd695 | /StartDroidFull/src/com/lknuchel/android/startdroidfull/ui/widget/ActionBar.java | 2419f9799c7ba59c30e4bb099d5e982561f71193 | [
"Apache-2.0"
] | permissive | loicknuchel/StartDroid_old | 43d1bbbce1e7e63d57dc0bc81c51565aa894ea2e | b297ca5df4c8903805c6085ecd68aae56d2a9c3e | refs/heads/master | 2016-09-03T04:06:37.579997 | 2011-06-05T22:05:01 | 2011-06-05T22:05:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,858 | java | /*
* Copyright (C) 2010 Johan Nilsson <http://markupartist.com>
*
* 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.lknuchel.android.startdroidfull.ui.widget;
import java.util.LinkedList;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.lknuchel.android.startdroidfull.R;
public class ActionBar extends RelativeLayout implements OnClickListener {
private LayoutInflater mInflater;
private RelativeLayout mBarView;
private ImageView mLogoView;
private View mBackIndicator;
// private View mHomeView;
private TextView mTitleView;
private LinearLayout mActionsView;
private ImageButton mHomeBtn;
private RelativeLayout mHomeLayout;
private ProgressBar mProgress;
public ActionBar(Context context, AttributeSet attrs) {
super(context, attrs);
mInflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mBarView = (RelativeLayout) mInflater.inflate(R.layout.actionbar, null);
addView(mBarView);
mLogoView = (ImageView) mBarView.findViewById(R.id.actionbar_home_logo);
mHomeLayout = (RelativeLayout) mBarView
.findViewById(R.id.actionbar_home_bg);
mHomeBtn = (ImageButton) mBarView.findViewById(R.id.actionbar_home_btn);
mBackIndicator = mBarView.findViewById(R.id.actionbar_home_is_back);
mTitleView = (TextView) mBarView.findViewById(R.id.actionbar_title);
mActionsView = (LinearLayout) mBarView
.findViewById(R.id.actionbar_actions);
mProgress = (ProgressBar) mBarView
.findViewById(R.id.actionbar_progress);
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.ActionBar);
CharSequence title = a.getString(R.styleable.ActionBar_title);
if (title != null) {
setTitle(title);
}
a.recycle();
}
public void setHomeAction(Action action) {
mHomeBtn.setOnClickListener(this);
mHomeBtn.setTag(action);
mHomeBtn.setImageResource(action.getDrawable());
mHomeLayout.setVisibility(View.VISIBLE);
}
public void clearHomeAction() {
mHomeLayout.setVisibility(View.GONE);
}
/**
* Shows the provided logo to the left in the action bar.
*
* This is ment to be used instead of the setHomeAction and does not draw a
* divider to the left of the provided logo.
*
* @param resId
* The drawable resource id
*/
public void setHomeLogo(int resId) {
// TODO: Add possibility to add an IntentAction as well.
mLogoView.setImageResource(resId);
mLogoView.setVisibility(View.VISIBLE);
mHomeLayout.setVisibility(View.GONE);
}
/*
* Emulating Honeycomb, setdisplayHomeAsUpEnabled takes a boolean and
* toggles whether the "home" view should have a little triangle indicating
* "up"
*/
public void setDisplayHomeAsUpEnabled(boolean show) {
mBackIndicator.setVisibility(show ? View.VISIBLE : View.GONE);
}
public void setTitle(CharSequence title) {
mTitleView.setText(title);
}
public void setTitle(int resid) {
mTitleView.setText(resid);
}
/**
* Set the enabled state of the progress bar.
*
* @param One
* of {@link View#VISIBLE}, {@link View#INVISIBLE}, or
* {@link View#GONE}.
*/
public void setProgressBarVisibility(int visibility) {
mProgress.setVisibility(visibility);
}
/**
* Returns the visibility status for the progress bar.
*
* @param One
* of {@link View#VISIBLE}, {@link View#INVISIBLE}, or
* {@link View#GONE}.
*/
public int getProgressBarVisibility() {
return mProgress.getVisibility();
}
/**
* Function to set a click listener for Title TextView
*
* @param listener
* the onClickListener
*/
public void setOnTitleClickListener(OnClickListener listener) {
mTitleView.setOnClickListener(listener);
}
@Override
public void onClick(View view) {
final Object tag = view.getTag();
if (tag instanceof Action) {
final Action action = (Action) tag;
action.performAction(view);
}
}
/**
* Adds a list of {@link Action}s.
*
* @param actionList
* the actions to add
*/
public void addActions(ActionList actionList) {
int actions = actionList.size();
for (int i = 0; i < actions; i++) {
addAction(actionList.get(i));
}
}
/**
* Adds a new {@link Action}.
*
* @param action
* the action to add
*/
public void addAction(Action action) {
final int index = mActionsView.getChildCount();
addAction(action, index);
}
/**
* Adds a new {@link Action} at the specified index.
*
* @param action
* the action to add
* @param index
* the position at which to add the action
*/
public void addAction(Action action, int index) {
mActionsView.addView(inflateAction(action), index);
}
/**
* Removes all action views from this action bar
*/
public void removeAllActions() {
mActionsView.removeAllViews();
}
/**
* Remove a action from the action bar.
*
* @param index
* position of action to remove
*/
public void removeActionAt(int index) {
mActionsView.removeViewAt(index);
}
/**
* Remove a action from the action bar.
*
* @param action
* The action to remove
*/
public void removeAction(Action action) {
int childCount = mActionsView.getChildCount();
for (int i = 0; i < childCount; i++) {
View view = mActionsView.getChildAt(i);
if (view != null) {
final Object tag = view.getTag();
if (tag instanceof Action && tag.equals(action)) {
mActionsView.removeView(view);
}
}
}
}
/**
* Returns the number of actions currently registered with the action bar.
*
* @return action count
*/
public int getActionCount() {
return mActionsView.getChildCount();
}
/**
* Inflates a {@link View} with the given {@link Action}.
*
* @param action
* the action to inflate
* @return a view
*/
private View inflateAction(Action action) {
View view = mInflater.inflate(R.layout.actionbar_item, mActionsView,
false);
ImageButton labelView = (ImageButton) view
.findViewById(R.id.actionbar_item);
labelView.setImageResource(action.getDrawable());
view.setTag(action);
view.setOnClickListener(this);
return view;
}
/**
* A {@link LinkedList} that holds a list of {@link Action}s.
*/
public static class ActionList extends LinkedList<Action> {
private static final long serialVersionUID = -1102696731424757111L;
}
/**
* Definition of an action that could be performed, along with a icon to
* show.
*/
public interface Action {
public int getDrawable();
public void performAction(View view);
}
public static abstract class AbstractAction implements Action {
final private int mDrawable;
public AbstractAction(int drawable) {
mDrawable = drawable;
}
@Override
public int getDrawable() {
return mDrawable;
}
}
public static class IntentAction extends AbstractAction {
private Context mContext;
private Intent mIntent;
public IntentAction(Context context, Intent intent, int drawable) {
super(drawable);
mContext = context;
mIntent = intent;
}
@Override
public void performAction(View view) {
try {
mContext.startActivity(mIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(
mContext,
mContext.getText(R.string.actionbar_activity_not_found),
Toast.LENGTH_SHORT).show();
}
}
}
/*
* public static abstract class SearchAction extends AbstractAction { public
* SearchAction() { super(R.drawable.actionbar_search); } }
*/
}
| [
"loicknuchel@gmail.com"
] | loicknuchel@gmail.com |
ef2c664b901a8c448e5d10c348612f829cd0733b | e3af7d2ecd3cce423eb123d5ef5ebb64d4d0f989 | /android/src/main/java/app/eeui/screenshots/util/SDCard.java | 0b830680a1ee570a2d7bb572437e30d0f28d2da6 | [
"MIT"
] | permissive | aipaw/eeui-plugin-screenshots | df9b0e5e6a08c55976fef6749f2ddb00b39c5883 | a7c1a93305132cc8396e53ec94bd4e8380ebd6d0 | refs/heads/master | 2020-06-09T01:10:37.876708 | 2020-03-03T04:12:54 | 2020-03-03T04:12:54 | 193,340,504 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,198 | java | package app.eeui.screenshots.util;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;
import android.os.StatFs;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class SDCard {
public static String getBasePath(Context context)
{
// if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
// return Environment.getExternalStorageDirectory().getPath();
// else
// return context.getCacheDir()+"";
String path=context.getExternalFilesDir("Caches")+"";
return path;
}
public static String readStreamToString(InputStream inputStream) {
BufferedReader bufferedReader = null;
try {
StringBuilder builder = new StringBuilder(inputStream.available() + 10);
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
char[] data = new char[4096];
int len = -1;
while ((len = bufferedReader.read(data)) > 0) {
builder.append(data, 0, len);
}
return builder.toString();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (bufferedReader != null)
bufferedReader.close();
} catch (IOException e) {
}
try {
if (inputStream != null)
inputStream.close();
} catch (IOException e) {
}
}
return "";
}
public static Bitmap getBitMap(Context context,String path)
{
FileInputStream fs=getFileStream(context,path);
Bitmap bitmap = BitmapFactory.decodeStream(fs);
return bitmap;
}
public static String getString(Context context,String path)
{
FileInputStream fs=getFileStream(context,path);
if(fs==null)
return "";
return readStreamToString(fs);
}
public static FileInputStream getFileStream(Context context,String path)
{
// String p= context.getCacheDir()+"/"+path;
String p= context.getExternalFilesDir("Caches")+"/"+path;
try {
FileInputStream is = new FileInputStream(new File(p));
return is;
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public static boolean IsSDCardExist()
{
String en =Environment.getExternalStorageState();
String s=Environment.MEDIA_MOUNTED;
return en.equals(s);
}
public static boolean IsFileExist(String path)
{
File f_new = new File(path);
return f_new.exists();
}
public static boolean delete(String path)
{
if(!IsFileExist(path))
return true;
File f_new = new File(path);
return f_new.delete();
}
public static float getFreeMemorySize()
{
File path = Environment.getDataDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long availableBlocks = stat.getAvailableBlocks();
return (availableBlocks * blockSize)*1.0f/(1024);
}
}
| [
"aipaw@qq.com"
] | aipaw@qq.com |
5c1a47b943da0a6b0b6d42a4ce8303b672666bf5 | c7bdefcaa4b2c7d1a857bfd5253c556df0159cbc | /SLOTGAMES/src/test/java/stepDefinition_SeaMermaid/SeaMermaid_Gamble_GambleCount_For_BetType_1_And_Denomination_3.java | e33af36fb679faa5ac71657aaa1f3059978a8087 | [] | no_license | pavanysecit/SLOTGAMES_MOBILES | 62a97bded1f4d0df0f50fc2176e473ce3dac267b | 80bb25d81feda93b3f9137080bd2f0922e882da6 | refs/heads/master | 2021-02-15T04:56:59.388043 | 2021-01-07T09:36:44 | 2021-01-07T09:36:44 | 244,863,982 | 0 | 0 | null | 2020-10-13T20:03:05 | 2020-03-04T09:52:42 | Java | UTF-8 | Java | false | false | 6,235 | java | package stepDefinition_SeaMermaid;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
public class SeaMermaid_Gamble_GambleCount_For_BetType_1_And_Denomination_3 {
AppiumDriver<MobileElement> driver;
public SeaMermaid_Gamble_GambleCount_For_BetType_1_And_Denomination_3() throws InterruptedException {
this.driver = SeaMermaid_URL_Login.getDriver();
//this.driver = SeaMermaid_URL_TryNow.getDriver();
}
@Given("^Chrome browser, valid URL, valid login details, Sea Mermaid hot slot game, bet type as (\\d+)\\.(\\d+), denomination as ONE, balance, spin button, win amount, gamble button, gamble amount, game info page and gamble count in gamble page of slot game$")
public void chrome_browser_valid_URL_valid_login_details_Sea_Mermaid_hot_slot_game_bet_type_as_denomination_as_ONE_balance_spin_button_win_amount_gamble_button_gamble_amount_game_info_page_and_gamble_count_in_gamble_page_of_slot_game(int arg1, int arg2) throws Throwable {
WebDriverWait wait = new WebDriverWait(driver, 80);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("hud_Hud_txtBalance1")));
}
@When("^Open the Sea Mermaid slot game by entering the valid URL in browser, enter the valid login details, transfer the balance, click on Sea Mermaid slot game, select bet type as (\\d+)\\.(\\d+) & denomination as ONE, click on spin button till player wins, click on gamble button and check the gamble count in gamble page of slot game$")
public void open_the_Sea_Mermaid_slot_game_by_entering_the_valid_URL_in_browser_enter_the_valid_login_details_transfer_the_balance_click_on_Sea_Mermaid_slot_game_select_bet_type_as_denomination_as_ONE_click_on_spin_button_till_player_wins_click_on_gamble_button_and_check_the_gamble_count_in_gamble_page_of_slot_game(int arg1, int arg2) throws Throwable {
String balance = driver.findElement(By.id("hud_Hud_txtBalance1")).getText();
System.out.println("The current balance of the account :" +balance);
driver.findElement(By.id("hud_txtCredit")).click();
Thread.sleep(1000);
MobileElement cr1 = driver.findElement(By.id("hud_CreditPopup10.01"));
String credit1 =cr1.getText();
System.out.println(credit1);
String expectedA = "0.01";
Assert.assertEquals(expectedA, credit1);
cr1.click();
Thread.sleep(1000);
driver.findElement(By.id("hud_txtBetAmount")).click();
Thread.sleep(1000);
MobileElement bet1_3= driver.findElement(By.id("hud_BetPopup31"));
String Betval1_3 =bet1_3.getText();
System.out.println(Betval1_3);
String expectedB = "1";
Assert.assertEquals(expectedB, Betval1_3);
Thread.sleep(2000);
bet1_3.click();
MobileElement start = driver.findElement(By.id("hud_btnSpin"));
start.click();
Thread.sleep(8000);
MobileElement winE = driver.findElement(By.id("hud_Hud_txtWin1"));
String prewin = winE.getText();
//System.out.println("Balance before win is"+" "+prewin);
String winTex= winE.getText();
while(prewin.isEmpty()){
start.click();
Thread.sleep(8000);
winTex = winE.getText();
prewin= prewin+winTex;
System.out.println(winTex.isEmpty());
}
System.out.println("Win amount is: " +prewin);
System.out.println("Maximum gamble win amount for bet amount 1 and credit value 0.01 is : 35 SRD");
Double maxV = Double.parseDouble(prewin);
if(maxV < 35)
{
System.out.println("Win amount less than Gamble max value 35 i.e : "+" " +maxV +". Test Case Passed");
}
else
{
System.out.println("Win amount greater than Gamble max value 35 : i.e "+" " +maxV +". Test Case Failed");
driver.findElement(By.id("hud_btnGamble")).isDisplayed();
Thread.sleep(2000);
driver.quit();
}
Thread.sleep(2000);
driver.findElement(By.id("hud_btnGamble")).click();
Thread.sleep(3000);
Double monty = Double.parseDouble(prewin);
System.out.println("Gamble amount is equal to win amount & the amount is :"+" "+monty);
MobileElement attempts = driver.findElement(By.id("gamble_txtAttemptsLeft"));
System.out.println("No. of attempts left :"+" "+attempts.getText());
if(monty>=0.1 && monty<=2.17)
{
System.out.println("The no. of attempts should be : "+" "+"5"+" "+" & no. of actual attempts are :"+attempts.getText());
Assert.assertEquals("5",attempts.getText());
}
else if(monty>2.17 && monty<=4.35){
System.out.println("The no. of attempts should be : "+" "+"4"+" "+"& no. of actual attempts are :"+attempts.getText());
Assert.assertEquals("4", attempts.getText());
}
else if(monty>4.35 && monty<=8.72){
System.out.println("The no. of attempts should be :"+" "+"3"+" "+"& no. of actual attempts are :"+attempts.getText());
Assert.assertEquals("3",attempts.getText());
}
else if(monty>8.72 && monty<=17.45){
System.out.println("The no. of attempts should be :"+" "+"2"+" "+"& no. of actual attempts are :"+attempts.getText());
Assert.assertEquals("2",attempts.getText());
}
else if(monty>17.45 && monty<=35){
System.out.println("The no. of attempts should be :"+" "+"1"+" "+"& no. of actual attempts are:"+attempts.getText());
Assert.assertEquals("1", attempts.getText());
}
driver.findElement(By.id("gamble_btnCollect")).click();
System.out.println("The testcase has passed");
}
@Then("^Gamble count should be displayed on gamble page of slot game based on win amount and gamble max amount configured on the game info page for bet type (\\d+)\\.(\\d+) & denomination ONE in Sea Mermaid game$")
public void gamble_count_should_be_displayed_on_gamble_page_of_slot_game_based_on_win_amount_and_gamble_max_amount_configured_on_the_game_info_page_for_bet_type_denomination_ONE_in_Sea_Mermaid_game(int arg1, int arg2) throws Throwable {
Thread.sleep(2000);
driver.quit();
}
}
| [
"pavan.kumar@ysecit.com"
] | pavan.kumar@ysecit.com |
66a35bdbbfa7f08af07e5e3e116c37dd3af7c41d | f975dfdb57922c3aed67a137bff7cf6cbbd401df | /nfclib/src/androidTest/java/be/appfoundry/nfclibrary/utilities/sync/WritePhoneSucceedsTests.java | 4c2e5ba268b130c723c9199fc1ef0cdc31331c98 | [] | no_license | akardas16/NfcProject | 158a4b7ccc81151dc80690eb4c0c40886dbd4ee7 | fd464b8c3206a65db9cbe0314eb742d44bcdcd51 | refs/heads/master | 2023-06-29T10:27:02.040881 | 2021-07-18T20:58:04 | 2021-07-18T20:58:04 | 387,262,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,309 | java | /*
* WritePhoneSucceedsTests.java
* NfcLibrary project.
*
* Created by : Daneo van Overloop - 17/6/2014.
*
* The MIT License (MIT)
*
* Copyright (c) 2014 AppFoundry. All rights reserved.
*
* 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.
*/
package be.appfoundry.nfclibrary.utilities.sync;
import android.content.Intent;
import android.nfc.FormatException;
import android.nfc.NfcAdapter;
import android.nfc.Tag;
import android.test.AndroidTestCase;
import be.appfoundry.nfclibrary.constants.NfcPayloadHeader;
import be.appfoundry.nfclibrary.exceptions.InsufficientCapacityException;
import be.appfoundry.nfclibrary.exceptions.ReadOnlyTagException;
import be.appfoundry.nfclibrary.exceptions.TagNotPresentException;
import be.appfoundry.nfclibrary.utilities.TestUtilities;
import be.appfoundry.nfclibrary.utilities.interfaces.NfcWriteUtility;
/**
* NfcLibrary by daneo
* Created on 14/04/14.
*/
public class WritePhoneSucceedsTests extends AndroidTestCase {
private TestUtilities mTestUtilities = new TestUtilities();
// Telephone
public void testWriteTelephoneNdef() throws IllegalAccessException, NoSuchFieldException, ClassNotFoundException, InsufficientCapacityException, FormatException, ReadOnlyTagException, TagNotPresentException {
String phoneNumber = "0123456789";
final String ndef = TestUtilities.NDEF;
performWriteAndChecks(phoneNumber, ndef, false);
}
public void testWriteTelephoneReadOnlyNdef() throws IllegalAccessException, FormatException, ClassNotFoundException, ReadOnlyTagException, InsufficientCapacityException, NoSuchFieldException, TagNotPresentException {
String phoneNumber = "0123456789";
final String ndef = TestUtilities.NDEF;
performWriteAndChecks(phoneNumber, ndef,true);
}
public void testWriteTelephoneNdefFormatable() throws IllegalAccessException, NoSuchFieldException, ClassNotFoundException, InsufficientCapacityException, FormatException, ReadOnlyTagException, TagNotPresentException {
String phoneNumber = "0123456789";
final String ndefFormatable = TestUtilities.NDEF_FORMATABLE;
performWriteAndChecks(phoneNumber, ndefFormatable, false);
}
public void testWriteTelephoneReadOnlyNdefFormatable() throws IllegalAccessException, FormatException, ClassNotFoundException, ReadOnlyTagException, InsufficientCapacityException, NoSuchFieldException, TagNotPresentException {
String phoneNumber = "0123456789";
final String ndefFormatable = TestUtilities.NDEF_FORMATABLE;
performWriteAndChecks(phoneNumber, ndefFormatable,true);
}
private void performWriteAndChecks(String phoneNumber, String ndefFormatable,boolean readonly) throws IllegalAccessException, NoSuchFieldException, ClassNotFoundException, InsufficientCapacityException, FormatException, ReadOnlyTagException, TagNotPresentException {
assertTrue(writePhoneNumber(phoneNumber, ndefFormatable, readonly));
assertTrue(mTestUtilities.checkPayloadHeader(NfcPayloadHeader.TEL));
}
boolean writePhoneNumber(String phoneNumber, String technology, boolean readonly) throws IllegalAccessException, NoSuchFieldException, ClassNotFoundException, InsufficientCapacityException, FormatException, ReadOnlyTagException, TagNotPresentException {
final Tag mockTag = mTestUtilities.mockTag(technology);
final Intent intent = new Intent().putExtra(NfcAdapter.EXTRA_TAG,mockTag);
NfcWriteUtility nfcMessageUtility = mTestUtilities.determineMockType(technology);
return nfcMessageUtility != null && (readonly ? nfcMessageUtility.makeOperationReadOnly().writeTelToTagFromIntent(phoneNumber, intent) : nfcMessageUtility.writeTelToTagFromIntent(phoneNumber, intent));
}
}
| [
"akardas16@ku.edu.tr"
] | akardas16@ku.edu.tr |
af7ca86a25fe14e42543bedec0676c82691ba05b | fb879d86b508fb758c984d95daf572adcd807fbf | /src/main/java/com/kamtar/transport/api/repository/UtilisateurClientPersonnelRepository.java | 306c312ef9aaee1486699d593fd4ed3013a0164f | [] | no_license | TANFOLO/tanfolo_test_api_ci_cd | 52881d6c7f7e552141331eb7cef27e6ba1f03f29 | fc643455d4c59c8d559e78c9fa9d42d34c8205f3 | refs/heads/master | 2023-06-21T20:08:08.254508 | 2021-07-16T12:37:19 | 2021-07-16T12:37:19 | 386,631,626 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,934 | java | package com.kamtar.transport.api.repository;
import com.kamtar.transport.api.model.Client;
import com.kamtar.transport.api.model.UtilisateurClient;
import com.kamtar.transport.api.model.UtilisateurClientPersonnel;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.UUID;
@Repository
public interface UtilisateurClientPersonnelRepository extends CrudRepository<UtilisateurClientPersonnel, String>, JpaSpecificationExecutor<UtilisateurClientPersonnel> {
/**
* Recherche par UUID
* @param uuid
* @return
*/
@Query("SELECT b FROM UtilisateurClientPersonnel b WHERE b.uuid= :uuid AND b.codePays = :pays")
UtilisateurClientPersonnel findByUUID(@Param("uuid") UUID uuid, @Param("pays") String pays);
/**
* Chargement d'un user par son adresse email
*/
@Query("SELECT b FROM UtilisateurClientPersonnel b WHERE b.email = :email AND b.codePays = :pays")
UtilisateurClientPersonnel findByEmail(@Param("email") String email, @Param("pays") String pays);
/**
* Chargement d'un user par son téléphone
*/
@Query("SELECT b FROM UtilisateurClientPersonnel b WHERE b.numeroTelephone1 = :numeroTelephone1 AND b.codePays = :pays")
UtilisateurClientPersonnel findByTelephone1(@Param("numeroTelephone1") String numeroTelephone1, @Param("pays") String pays);
/**
* Est ce que le login est déjà utilisé ?
*/
@Query("SELECT CASE WHEN count(id)> 0 THEN true ELSE false END FROM UtilisateurClientPersonnel b WHERE b.numeroTelephone1 = :numeroTelephone1 AND b.codePays = :pays")
Boolean telephone1Exist(@Param("numeroTelephone1") String numeroTelephone1, @Param("pays") String pays);
/**
* Est ce que l'email est déjà utilisé ?
*/
@Query("SELECT CASE WHEN count(id)> 0 THEN true ELSE false END FROM UtilisateurClientPersonnel b WHERE b.email = :email AND b.codePays = :pays")
Boolean existEmail(@Param("email") String email, @Param("pays") String pays);
/**
* Est ce que le numéro de téléphone est déjà utilisé ?
*/
@Query("SELECT CASE WHEN count(id)> 0 THEN true ELSE false END FROM UtilisateurClientPersonnel b WHERE b.numeroTelephone1 = :numero_de_telephone AND b.codePays = :pays")
Boolean numeroDeTelephoneEmail(@Param("numero_de_telephone") String numero_de_telephone, @Param("pays") String pays);
/**
* Chargement des clients personnels d'un client
*/
@Query("SELECT b FROM UtilisateurClientPersonnel b WHERE b.client = :client AND b.codePays = :pays")
List<UtilisateurClientPersonnel> getClientsPersonnels(@Param("client") Client client, @Param("pays") String pays);
/**
* Est ce que l'email est déjà utilisé ?
*/
@Query("SELECT CASE WHEN count(id)> 0 THEN true ELSE false END FROM UtilisateurClientPersonnel b WHERE b.email = :email AND b != :user AND b.codePays = :pays")
Boolean existEmailForotherUser(@Param("email") String email, @Param("user") UtilisateurClientPersonnel user, @Param("pays") String pays);
/**
* Est ce que le login est déjà utilisé ?
*/
@Query("SELECT CASE WHEN count(id)> 0 THEN true ELSE false END FROM UtilisateurClientPersonnel b WHERE b.numeroTelephone1 = :numeroTelephone1 AND b != :user AND b.codePays = :pays")
Boolean telephone1ExistForOtherUser(@Param("numeroTelephone1") String numeroTelephone1, @Param("user") UtilisateurClientPersonnel user, @Param("pays") String pays);
/**
* Chargement des clients personnels qui recoivent les notifications
*/
@Query("SELECT b FROM UtilisateurClientPersonnel b WHERE b.client = :client AND b.codePays = :pays AND substring(b.liste_droits, 6,1) = '1'")
List<UtilisateurClientPersonnel> getClientsPersonnelsNotifications(@Param("client") Client client, @Param("pays") String pays);
}
| [
"joel.coulibaly@kamtar-ci.com"
] | joel.coulibaly@kamtar-ci.com |
57a6a346f37c4afd4c160b565ade67fd8a8ad65b | e5145d5267e91c1d3c64b1f72db27573d18ad872 | /JHipster/sample/src/main/java/com/netapp/samples/domain/Task.java | 12f1caa812721d30c90bf035613ce61a153eac5e | [
"MIT"
] | permissive | NetAppJpTechTeam/DTLSamples | 96cb8209965127ed5b26539568e46d592744bd79 | 01f33c69e2ebcd4055736073ce68bbcb4715aa08 | refs/heads/master | 2022-06-24T22:11:45.880048 | 2020-11-11T01:15:48 | 2020-11-11T01:15:48 | 129,193,659 | 0 | 2 | MIT | 2022-06-20T23:13:35 | 2018-04-12T04:38:18 | Java | UTF-8 | Java | false | false | 2,933 | java | package com.netapp.samples.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import javax.persistence.*;
import org.springframework.data.elasticsearch.annotations.Document;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
/**
* Task entity.
* @author The JHipster team.
*/
@ApiModel(description = "Task entity. @author The JHipster team.")
@Entity
@Table(name = "task")
@Document(indexName = "task")
public class Task implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "title")
private String title;
@Column(name = "description")
private String description;
@ManyToMany(mappedBy = "tasks")
@JsonIgnore
private Set<Job> jobs = new HashSet<>();
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public Task title(String title) {
this.title = title;
return this;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public Task description(String description) {
this.description = description;
return this;
}
public void setDescription(String description) {
this.description = description;
}
public Set<Job> getJobs() {
return jobs;
}
public Task jobs(Set<Job> jobs) {
this.jobs = jobs;
return this;
}
public Task addJob(Job job) {
this.jobs.add(job);
job.getTasks().add(this);
return this;
}
public Task removeJob(Job job) {
this.jobs.remove(job);
job.getTasks().remove(this);
return this;
}
public void setJobs(Set<Job> jobs) {
this.jobs = jobs;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Task task = (Task) o;
if (task.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), task.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Task{" +
"id=" + getId() +
", title='" + getTitle() + "'" +
", description='" + getDescription() + "'" +
"}";
}
}
| [
"makoto.wata@gmail.com"
] | makoto.wata@gmail.com |
28232759b0fd3bf9960865e501d15b216c29c353 | 793c62c2034119829bf18e801ee1912a8b7905a7 | /pattern/src/main/java/com/luolei/pattern/adapter/ch1/OperationAdapter.java | 8269548ca7d682e3ec83762400a23f7c2321eee1 | [] | no_license | askluolei/practice | 5b087a40535b5fb038fb9aa25831d884476d27c9 | 044b13781bc876fd2472d7dfc3e709544d26c546 | refs/heads/master | 2021-09-10T15:15:58.199101 | 2018-03-28T09:17:57 | 2018-03-28T09:17:57 | 108,428,724 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 719 | java | package com.luolei.pattern.adapter.ch1;
/**
* 操作适配器:适配器
*
* @author luolei
* @date 2017-03-30 10:25
*/
public class OperationAdapter implements ScoreOperation {
private QuickSort sortObj; //定义适配者QuickSort对象
private BinarySearch searchObj; //定义适配者BinarySearch对象
public OperationAdapter() {
sortObj = new QuickSort();
searchObj = new BinarySearch();
}
public int[] sort(int array[]) {
return sortObj.quickSort(array); //调用适配者类QuickSort的排序方法
}
public int search(int array[], int key) {
return searchObj.binarySearch(array, key); //调用适配者类BinarySearch的查找方法
}
}
| [
"askluolei@gmail.com"
] | askluolei@gmail.com |
5bee450828eb1e04c155fee95d11a0ca6c3c1f9d | 6d495f1e8b4682230c5fd1f8edd2beaacc67c47b | /src/main/java/com/selectica/RCFdev3/definitions/CFR1BO/actions/ComputeAssembleElapsedTimeActionScript.java | ef43e50232d7148c780aa71d567bfe9eee181868 | [] | no_license | ikrysenko-selectica/rcfdev3 | 3eab3b9f63cb59685fbd3bf6b53c17fc4ca6d784 | 4d44c53af1d956e6f68039a1e959abab31cc92c3 | refs/heads/master | 2021-01-21T11:14:58.060052 | 2015-06-17T13:29:46 | 2015-06-17T13:29:46 | 37,593,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package com.selectica.RCFdev3.definitions.CFR1BO.actions;
import com.selectica.RCFdev3.eclm.definitions.shared.actions.ComputeAssembleElapsedTimeAction;
import com.selectica.rcfscripts.AbstractBOWriteScript;
/**#ComputeAssembleElapsedTime*/
public class ComputeAssembleElapsedTimeActionScript extends ComputeAssembleElapsedTimeAction {
}
| [
"user@rcfproj.aws.selectica.net"
] | user@rcfproj.aws.selectica.net |
45265db952414516de98a1de803664de2eaa8ffb | 8327e4ae8dd73c8509a7bfe1237dc6d7afee6b19 | /src/by/nc/shpakovskaya/dao/hospital/HospitalDAO.java | 4849ef2e268c73b58b5f26ffd7e496aa3380274c | [] | no_license | 1Valeria/NC | 6765306f07523ee40a42337e791c5f7dd0bab0c6 | 4c0b7dcc92e65d87b1269375a6db7151361cb023 | refs/heads/master | 2021-05-03T20:58:44.585703 | 2017-01-03T00:12:33 | 2017-01-03T00:12:33 | 71,464,663 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,684 | java | package by.nc.shpakovskaya.dao.hospital;
import by.nc.shpakovskaya.beans.Hospital;
import by.nc.shpakovskaya.dao.CommonDAO;
import by.nc.shpakovskaya.web.connectionPool.ConnectionPoolSing;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Valeria on 21.11.2016.
*/
public class HospitalDAO implements CommonDAO<Hospital> {
static final String SQL_QUERY_ADD_HOSPITALS = "INSERT INTO hospitals (name)"+
" VALUES (?)";
static final String SQL_QUERY_GET_HOSPITALS = "SELECT * FROM hospitals";
public void add(Hospital hospital) {
Connection connection = null;
PreparedStatement preparedStatement = null;
try {
Class.forName("com.mysql.jdbc.Driver");
connection = ConnectionPoolSing.retrieve();
preparedStatement = connection.prepareStatement(SQL_QUERY_ADD_HOSPITALS);
preparedStatement.setString(1, hospital.getName());
preparedStatement.executeUpdate();
} catch (ClassNotFoundException e) {
System.out.println("Class driver not found");
System.out.println(e.getMessage());
} catch (SQLException e) {
System.out.println("SQL exception occurred during add hospital");
System.out.println(e.getMessage());
} finally {
ConnectionPoolSing.putBack(connection);
}
}
@Override
public List<Hospital> get() {
Connection connection = null;
Statement statement = null;
ResultSet resultSet = null;
List<Hospital> hospitals = null;
try {
Class.forName("com.mysql.jdbc.Driver");
connection = ConnectionPoolSing.retrieve();
statement = connection.createStatement();
resultSet = statement.executeQuery(SQL_QUERY_GET_HOSPITALS);
hospitals = init(resultSet);
} catch (ClassNotFoundException e) {
System.out.println("Class driver not found");
} catch (SQLException e) {
System.out.println("SQL exception occurred during add hospital");
System.out.println(e.getMessage());
} finally {
ConnectionPoolSing.putBack(connection);
}
return hospitals;
}
@Override
public List<Hospital> init(ResultSet resultSet) throws SQLException {
List<Hospital> hospitals = new ArrayList<>();
while (resultSet.next()) {
Hospital hospital = new Hospital();
hospital.setId(resultSet.getInt(1));
hospital.setName(resultSet.getString(2));
hospitals.add(hospital);
}
return hospitals;
}
}
| [
"shpakovskaya.valeriya.14@gmail.com"
] | shpakovskaya.valeriya.14@gmail.com |
92160d587e5864348eeb1f97938c42777d666190 | 49799d678c0a2fccbbea9687ba5ca3da6b5540db | /app/src/main/java/com/comodin/tool/DatabaseContext.java | 3f73a74ece94a8f8d1e7fb003903b9a0b6fcda1d | [] | no_license | kunlinzhong/SQLiteDemo | cc79bec4835e1332295222691b0fcb95a9ff463e | 3d40143bccdbc9c3e9c14c5016bfed2a266ec05d | refs/heads/master | 2021-01-22T07:52:39.378560 | 2017-05-27T08:24:05 | 2017-05-27T08:24:05 | 92,583,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,503 | java | package com.comodin.tool;
import java.io.File;
import java.io.IOException;
import android.content.Context;
import android.content.ContextWrapper;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.Log;
/**
* 用于支持对存储在SD卡上的数据库的访问
**/
public class DatabaseContext extends ContextWrapper {
/**
* 构造函数
* @param base 上下文环境
*/
public DatabaseContext(Context base){
super(base);
}
/**
* 获得数据库路径,如果不存在,则创建对象对象
* @param name
*/
@Override
public File getDatabasePath(String name) {
String dbDir="/storage/emulated/0/comodin/";
// dbDir += "/scexam";//数据库所在目录
String dbPath = dbDir+"/"+name;//数据库路径
//判断目录是否存在,不存在则创建该目录
File dirFile = new File(dbDir);
if(!dirFile.exists())
dirFile.mkdirs();
//数据库文件是否创建成功
boolean isFileCreateSuccess = false;
//判断文件是否存在,不存在则创建该文件
File dbFile = new File(dbPath);
if(!dbFile.exists()){
try {
isFileCreateSuccess = dbFile.createNewFile();//创建文件
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else
isFileCreateSuccess = true;
//返回数据库文件对象
if(isFileCreateSuccess)
return dbFile;
else
return null;
// //判断是否存在sd卡
// boolean sdExist = android.os.Environment.MEDIA_MOUNTED.equals(android.os.Environment.getExternalStorageState());
// if(!sdExist){//如果不存在,
// Log.e("SD卡管理:", "SD卡不存在,请加载SD卡");
// return null;
// } else{//如果存在
// //获取sd卡路径
// String dbDir=android.os.Environment.getExternalStorageDirectory().toString();
// dbDir += "/scexam";//数据库所在目录
// String dbPath = dbDir+"/"+name;//数据库路径
// //判断目录是否存在,不存在则创建该目录
// File dirFile = new File(dbDir);
// if(!dirFile.exists())
// dirFile.mkdirs();
//
// //数据库文件是否创建成功
// boolean isFileCreateSuccess = false;
// //判断文件是否存在,不存在则创建该文件
// File dbFile = new File(dbPath);
// if(!dbFile.exists()){
// try {
// isFileCreateSuccess = dbFile.createNewFile();//创建文件
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// } else
// isFileCreateSuccess = true;
//
// //返回数据库文件对象
// if(isFileCreateSuccess)
// return dbFile;
// else
// return null;
// }
}
/**
* 重载这个方法,是用来打开SD卡上的数据库的,android 2.3及以下会调用这个方法。
*
* @param name
* @param mode
* @param factory
*/
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode,SQLiteDatabase.CursorFactory factory) {
SQLiteDatabase result = SQLiteDatabase.openOrCreateDatabase(getDatabasePath(name), null);
return result;
}
/**
* Android 4.0会调用此方法获取数据库。
*
* @see android.content.ContextWrapper#openOrCreateDatabase(java.lang.String, int,
* android.database.sqlite.SQLiteDatabase.CursorFactory,
* android.database.DatabaseErrorHandler)
* @param name
* @param mode
* @param factory
* @param errorHandler
*/
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory, DatabaseErrorHandler errorHandler) {
SQLiteDatabase result = SQLiteDatabase.openOrCreateDatabase(getDatabasePath(name), null);
return result;
}
}
///**
// * Created by zhong on 2017/5/27.
// */
//
//public class DatabaseContext {
//}
| [
"zhongkunlin@comodin.cn"
] | zhongkunlin@comodin.cn |
2455beb244c8003311cc6f259551d11bc18b9a8a | e6956a557542622a983526a8a9dca8831824ae95 | /src/main/java/com/xellitix/commons/semver/metadata/MetadataModule.java | 593c08456cf90e877697e3caaeb2d2b7f66e96db | [] | no_license | xellitix/commons-semver | 22fec798602fba9bc5038710df28ab6650ff283f | f8fa4de3154c4b857fd09a7155047837bb1b03bf | refs/heads/master | 2023-01-07T14:45:20.532151 | 2019-01-31T17:38:21 | 2019-01-31T17:38:21 | 125,057,891 | 1 | 2 | null | 2020-11-06T00:22:17 | 2018-03-13T13:42:31 | Java | UTF-8 | Java | false | false | 717 | java | package com.xellitix.commons.semver.metadata;
import com.google.inject.AbstractModule;
import com.google.inject.assistedinject.FactoryModuleBuilder;
/**
* {@link Metadata} Google Guice module.
*
* @author Grayson Kuhns
*/
public class MetadataModule extends AbstractModule {
/**
* Configures the module.
*/
@Override
protected void configure() {
// Identifier factory
bind(IdentifierFactory.class).to(DefaultIdentifierFactory.class);
// Metadata factory
install(new FactoryModuleBuilder()
.implement(Metadata.class, DefaultMetadata.class)
.build(MetadataFactory.class));
// Metadata parser
bind(MetadataParser.class).to(DefaultMetadataParser.class);
}
}
| [
"grayson.kuhns@xellitix.com"
] | grayson.kuhns@xellitix.com |
e11316704d75daa1e577deb9a29d58fa416b4bfe | e63363389e72c0822a171e450a41c094c0c1a49c | /Mate20_9_0_0/src/main/java/com/android/server/om/-$$Lambda$OverlayManagerSettings$sx0Nyvq91kCH_A-4Ctf09G_0u9M.java | d408947b5d173200d8d444e3ca45c5adef9895b0 | [] | no_license | solartcc/HwFrameWorkSource | fc23ca63bcf17865e99b607cc85d89e16ec1b177 | 5b92ed0f1ccb4bafc0fdb08b6fc4d98447b754ad | refs/heads/master | 2022-12-04T21:14:37.581438 | 2020-08-25T04:30:43 | 2020-08-25T04:30:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | package com.android.server.om;
import android.content.om.OverlayInfo;
import java.util.function.Function;
/* compiled from: lambda */
public final /* synthetic */ class -$$Lambda$OverlayManagerSettings$sx0Nyvq91kCH_A-4Ctf09G_0u9M implements Function {
public static final /* synthetic */ -$$Lambda$OverlayManagerSettings$sx0Nyvq91kCH_A-4Ctf09G_0u9M INSTANCE = new -$$Lambda$OverlayManagerSettings$sx0Nyvq91kCH_A-4Ctf09G_0u9M();
private /* synthetic */ -$$Lambda$OverlayManagerSettings$sx0Nyvq91kCH_A-4Ctf09G_0u9M() {
}
public final Object apply(Object obj) {
return ((OverlayInfo) obj).targetPackageName;
}
}
| [
"lygforbs0@mail.com"
] | lygforbs0@mail.com |
af6aada07050b00883b5c7d2a1d18cf23df9f7fe | 402b2aa649e5fdbce4810fd6aef3b0fa8400ca40 | /core/src/main/java/com/hui/core/widget/HorizontalScrollIndicatorView.java | 2a17c7cd39c250bd386f1fe59a26696904f4f6fc | [] | no_license | MhuiHugh/Android-Hexagon | 62ddff71c97e150bcc6643d3f404cae861b5853b | 050a4c37bc8c12f746e25b50e47a82aebd207ad4 | refs/heads/master | 2022-05-27T19:09:56.882014 | 2022-05-17T10:41:33 | 2022-05-17T10:41:33 | 35,680,583 | 23 | 11 | null | null | null | null | UTF-8 | Java | false | false | 8,895 | java | package com.hui.core.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import com.hui.core.R;
import java.util.HashMap;
import java.util.Map;
/**
* 横向滚动下标指示适配器
* Created by Hugh on 6/8/2015.
*/
public class HorizontalScrollIndicatorView extends HorizontalScrollView implements
View.OnClickListener {
private final String TAG=this.getClass().getSimpleName();
private Context mContext;
/**
* 视图改变监听
*/
private CurrentViewChangeListener mCurrentViewChangeListener;
/**
* Item单击监听
*/
private OnItemClickListener mOnClickListener;
/**
* HorizontalListView中的LinearLayout
*/
private LinearLayout mContainer;
/**
* 子元素的宽度
*/
private int mChildWidth;
/**
* 子元素的高度
*/
private int mChildHeight;
/**
* 当前最后一张图片的index
*/
private int mCurrentIndex;
/**
* 当前第一张图片的下标
*/
private int mFristIndex;
/**
* 数据适配器
*/
private HorizontalScrollIndicatorAdapter mAdapter;
/**
* 每屏幕最多显示的个数
*/
private int mCountOneScreen;
/**
* 屏幕的宽度
*/
private int mScreenWitdh;
/**
* 保存View与位置的键值对
*/
private Map<View, Integer> mViewPos = new HashMap<View, Integer>();
public HorizontalScrollIndicatorView(Context context, AttributeSet attrs) {
super(context, attrs);
Log.v(TAG,"HorizontalScrollIndicatorView()");
mContext=context;
// 获得屏幕宽度
WindowManager wm = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics outMetrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(outMetrics);
mScreenWitdh = outMetrics.widthPixels;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
mContainer = (LinearLayout) getChildAt(0);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
switch (ev.getAction()) {
case MotionEvent.ACTION_MOVE:
int scrollX = getScrollX();
// 如果当前scrollX为view的宽度,加载下一张,移除第一张
if (scrollX >= mChildWidth) {
loadNextImg();
}
// 如果当前scrollX = 0, 往前设置一张,移除最后一张
if (scrollX == 0) {
loadPreImg();
}
break;
}
return super.onTouchEvent(ev);
}
@Override
public void onClick(View view) {
if (mOnClickListener != null) {
for (int i = 0; i < mContainer.getChildCount(); i++) {
mContainer.getChildAt(i).findViewById(R.id.collage_item_colorselect).setBackgroundColor(mContext.getResources().getColor(R.color.transparent));
}
mAdapter.setCurrentIndex(mViewPos.get(view));
view.findViewById(R.id.collage_item_colorselect).setBackgroundColor(mContext.getResources().getColor(R.color.color_999));
mOnClickListener.onClick(view, mViewPos.get(view));
}
}
//-----------------------------------------------
/**
* 加载下一个视图
*/
protected void loadNextImg() {
if(null==mAdapter){
return;
}
// 数组边界值计算
if (mCurrentIndex == mAdapter.getCount() - 1) {
return;
}
// 移除第一张图片,且将水平滚动位置置0
scrollTo(0, 0);
mViewPos.remove(mContainer.getChildAt(0));
mContainer.removeViewAt(0);
// 获取下一张图片,并且设置onclick事件,且加入容器中
View view = mAdapter.getView(++mCurrentIndex, null, mContainer);
view.setOnClickListener(this);
mContainer.addView(view);
mViewPos.put(view, mCurrentIndex);
// 当前第一张图片小标
mFristIndex++;
// 如果设置了滚动监听则触发
if (mCurrentViewChangeListener != null) {
notifyCurrentImgChanged();
}
}
/**
* 加载上个视图
*/
protected void loadPreImg() {
// 如果当前已经是第一张,则返回
if (mFristIndex == 0)
return;
// 获得当前应该显示为第一张图片的下标
int index = mCurrentIndex - mCountOneScreen;
if (index >= 0) {
// mContainer = (LinearLayout) getChildAt(0);
// 移除最后一张
int oldViewPos = mContainer.getChildCount() - 1;
mViewPos.remove(mContainer.getChildAt(oldViewPos));
mContainer.removeViewAt(oldViewPos);
// 将此View放入第一个位置
View view = mAdapter.getView(index, null, mContainer);
mViewPos.put(view, index);
mContainer.addView(view, 0);
view.setOnClickListener(this);
// 水平滚动位置向左移动view的宽度个像素
scrollTo(mChildWidth, 0);
// 当前位置--,当前第一个显示的下标--
mCurrentIndex--;
mFristIndex--;
// 回调
if (mCurrentViewChangeListener != null) {
notifyCurrentImgChanged();
}
}
}
/**
* 滑动时的回调
*/
public void notifyCurrentImgChanged() {
/**
* 空接口方法在这里使用时,只需要传必要的参数,而在外面调用时才告诉这个view要如何操作
*/
mCurrentViewChangeListener.onCurrentImgChanged(mFristIndex, mContainer.getChildAt(0));
}
/**
* 加载第一屏的View
* @param mCountOneScreen
*/
public void initFirstScreenChildren(int mCountOneScreen) {
Log.v(TAG,"initFirstScreenChildren()");
mContainer = (LinearLayout) getChildAt(0);
mContainer.removeAllViews();
mViewPos.clear();
for (int i = 0; i < mCountOneScreen; i++) {
View view = mAdapter.getView(i, null, mContainer);
view.setOnClickListener(this);
mContainer.addView(view);
mViewPos.put(view, i);
mCurrentIndex = i;
}
if (mCurrentViewChangeListener != null) {
notifyCurrentImgChanged();
}
}
//-------------------
/**
* 初始化数据,设置数据适配器
*
* @param mAdapter
*/
public void setAdapter(HorizontalScrollIndicatorAdapter mAdapter) {
this.mAdapter = mAdapter;
mContainer = (LinearLayout) getChildAt(0);
// 获得适配器中第一个View
final View view = mAdapter.getView(0, null, mContainer);
mContainer.addView(view);
// 强制计算当前View的宽和高
if (mChildWidth == 0 && mChildHeight == 0) {
int w = MeasureSpec.makeMeasureSpec(0,
MeasureSpec.UNSPECIFIED);
int h = MeasureSpec.makeMeasureSpec(0,
MeasureSpec.UNSPECIFIED);
view.measure(w, h);
mChildHeight = view.getMeasuredHeight();
mChildWidth = view.getMeasuredWidth();
mChildHeight = view.getMeasuredHeight();
// 计算每次加载多少个View
mCountOneScreen = (mScreenWitdh / mChildWidth == 0) ? mScreenWitdh
/ mChildWidth + 1 : mScreenWitdh / mChildWidth + 2;
}
// 初始化第一屏幕的元素
initFirstScreenChildren(mCountOneScreen);
}
public void setOnItemClickListener(OnItemClickListener mOnClickListener) {
this.mOnClickListener = mOnClickListener;
}
public void setCurrentImageChangeListener(
CurrentViewChangeListener mCurrentViewChangeListener) {
this.mCurrentViewChangeListener = mCurrentViewChangeListener;
}
//--------------------------------------------
/**
* 滚动时的回调接口
*
* 这个接口是自己定义的,先定义好,在调用处再实例化重写它,这里定好一个是位置参数,一个是操作哪处view控件
*/
public interface CurrentViewChangeListener {
void onCurrentImgChanged(int position, View viewIndicator);
}
/**
* 条目点击时的回调
*
*/
public interface OnItemClickListener {
void onClick(View view, int pos);
}
}
| [
"hughmhui@gmail.com"
] | hughmhui@gmail.com |
417b61fa7d916881e67f90583c681265d115a4ed | 07860225a486b1bac1beb208860dada67b4f1d1b | /src/main/java/it/prova/gestioneautomobili/web/servlet/LoginServlet.java | 2f78cf0abdf90640c71ec136f72e60a8e99213b8 | [] | no_license | cosimopolito/gestioneAutomobili | c8ac5c96b8aba2aa1633f526c376a3099a2c557d | 672bcfdf27f5ada162165b0407fcbbba3c9b737d | refs/heads/master | 2023-04-12T19:29:45.248078 | 2021-04-23T00:02:18 | 2021-04-23T00:02:18 | 360,713,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,561 | java | package it.prova.gestioneautomobili.web.servlet;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import it.prova.gestioneautomobili.model.Utente;
import it.prova.gestioneautomobili.service.MyServiceFactory;
import it.prova.gestioneautomobili.service.UtenteService;
/**
* Servlet implementation class LoginExecuteServlet
*/
@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String usernameInput = request.getParameter("inputUsername");
String passwordInput = request.getParameter("inputPassword");
UtenteService utenteService = MyServiceFactory.getUtenteServiceInstance();
Utente utenteDaCercare = utenteService.cercaPerUsernameEpassword(usernameInput, passwordInput);
RequestDispatcher rd = null;
if (utenteDaCercare == null) {
rd = request.getRequestDispatcher("/login.jsp");
request.setAttribute("errorMessage","L'account specificato non esiste");
rd.forward(request, response);
}
request.getSession().setAttribute("username", utenteDaCercare.getUsername());
utenteDaCercare.setPassword("xxxxxxxxx");
rd = request.getRequestDispatcher("/index.jsp");
rd.forward(request, response);
}
}
| [
"cpolito07@gmail.com"
] | cpolito07@gmail.com |
0600e3201882d2b859eb1e04f7ad5079498eb7c4 | b7e41141f5f8ce17a2c2f8308532d09abba8fdc4 | /src/main/java/egovframework/example/sample/service/impl/UserDAO.java | 4a8a550f5021a0f7b5106a937267e13a681fedb1 | [] | no_license | kanozo12/eGov-Proejct | 49631494b923e7dbced7c5eac82ed467cb6fde6e | 5f98c5a7d6f7e2230f8ac238a2bec80102fcf45c | refs/heads/master | 2022-12-25T13:48:34.886400 | 2020-10-07T05:52:50 | 2020-10-07T05:52:50 | 294,309,631 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | package egovframework.example.sample.service.impl;
import org.springframework.stereotype.Repository;
import egovframework.example.domain.UserVO;
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
@Repository("userDAO")
public class UserDAO extends EgovAbstractDAO {
public UserVO loginUser(UserVO vo) throws Exception {
return (UserVO) select("userDAO.loginUser", vo);
}
public void insertUser(UserVO user) {
insert("userDAO.insertUser", user);
}
}
| [
"kanozo12@naver.com"
] | kanozo12@naver.com |
884fe066fbacc839061fa2e80e16c0eb54a7dbb1 | 7f68d13e28a5965688f4ab960754b7f88f8bcb09 | /app/src/main/java/com/grability/appstore/utils/preferences/StringPreference.java | af910c1a1c3a841b1bd7f00e4e5b868827f89ddb | [
"CC-BY-3.0",
"Apache-2.0"
] | permissive | wilsoncastiblanco/appstore | a8780da12b8a19df0c40b83a4284d80bac7bfb23 | 7ac721fa79db8deba494e45752df57066a7295c2 | refs/heads/master | 2021-01-10T02:18:37.245976 | 2016-04-11T19:05:29 | 2016-04-11T19:05:29 | 55,615,208 | 1 | 0 | null | 2016-04-11T07:20:53 | 2016-04-06T14:57:31 | Java | UTF-8 | Java | false | false | 1,705 | java | package com.grability.appstore.utils.preferences;
import android.content.SharedPreferences;
/**
* A wrapper class for a String preference.
*/
public class StringPreference {
protected final SharedPreferences mPreferences;
protected final String mKey;
protected final String mDefaultValue;
public static final String DEFAULT_VALUE_VALUE = "";
/**
* Constructs a {@code String} preference for the given key
* having the default value set to an empty string available.
*/
public StringPreference(final SharedPreferences preferences, final String key) {
this(preferences, key, DEFAULT_VALUE_VALUE);
}
/**
* Constructs a {@code String} preference for the given key
* having the default value available.
*/
public StringPreference(final SharedPreferences preferences, final String key, final String defaultValue) {
mPreferences = preferences;
mKey = key;
mDefaultValue = defaultValue;
}
/**
* Returns the stored {@code String} value if it exists
* or the default value.
*/
public String get() {
return mPreferences.getString(mKey, mDefaultValue);
}
/**
* Returns {@code true} if some value is stored for
* this preference, otherwise {@code false}.
*/
public boolean isSet() {
return mPreferences.contains(mKey);
}
/**
* Stores the given {@code String} value.
*/
public void set(final String value) {
mPreferences.edit().putString(mKey, value).commit();
}
/**
* Removes this preference setting.
*/
public void delete() {
mPreferences.edit().remove(mKey).commit();
}
}
| [
"wcastiblancoq@gmail.com"
] | wcastiblancoq@gmail.com |
c97fef79b87d41a970f28c6d5cfe234cad6c3590 | 53ba908cfe9561f0b0f7d4d6060fd984f980ad40 | /src/observer_mode/Subject.java | 876155a2f1afd3537f5a5ece868f604035ec500f | [] | no_license | DongWendaoGitHub/Design_Pattern | 91d70e29d5e85b3c9a07a660ddd63c387a7135c1 | 6f6bf5b1916b77ad26050ce375853458fc31f330 | refs/heads/master | 2023-05-02T00:09:11.519974 | 2021-04-21T02:58:34 | 2021-04-21T02:58:34 | 360,007,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package observer_mode;
public interface Subject {
//观察者用于注册和删除
public void registerObserver(Observer o);
public void removeObserver(Observer o);
//用于通知所有的观察者
public void notifyObservers();
}
| [
"2521632021@qq.com"
] | 2521632021@qq.com |
3cb8a0017e8057ae66a99e1b2fa2e730d5c84da3 | 54eb1e895c1e34832b3aeb7c1c80fbf8602c97b7 | /src/main/java/hello/servlet/web/frontcontroller/v2/controller/MemberListControllerV2.java | 865b724cd04bd32e6cca1800a3d9e041cb025f6e | [] | no_license | GRIFFITHH/SpringMVC_Study | efc099f711b683703a97cba2ec190e64eee2b765 | 7122e5b795028014ffe03173fe8317957f2b1788 | refs/heads/master | 2023-08-23T01:02:59.527734 | 2021-09-15T07:37:53 | 2021-09-15T07:37:53 | 402,067,271 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 901 | java | package hello.servlet.web.frontcontroller.v2.controller;
import hello.servlet.domain.member.Member;
import hello.servlet.domain.member.MemberRepository;
import hello.servlet.web.frontcontroller.MyView;
import hello.servlet.web.frontcontroller.v2.ControllerV2;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
public class MemberListControllerV2 implements ControllerV2 {
private MemberRepository memberRepository = MemberRepository.getInstance();
@Override
public MyView process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
List<Member> members = memberRepository.findAll();
request.setAttribute("members", members);
return new MyView("/WEB-INF/views/members.jsp");
}
}
| [
"glqglq032@gmail.com"
] | glqglq032@gmail.com |
d44fed4c7d3ba04a35f5a8f5c8275f962a6319d7 | f71a7ec87f7e90f8025a3079daced5dbf41aca9c | /sf-pay/src/main/java/com/alipay/api/response/AlipayMobileBeaconDeviceModifyResponse.java | 02e3902f2d778446e551d88224b608c9a359d517 | [] | no_license | luotianwen/yy | 5ff456507e9ee3dc1a890c9bead4491d350f393d | 083a05aac4271689419ee7457cd0727eb10a5847 | refs/heads/master | 2021-01-23T10:34:24.402548 | 2017-10-08T05:03:10 | 2017-10-08T05:03:10 | 102,618,007 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.mobile.beacon.device.modify response.
*
* @author auto create
* @since 1.0, 2015-02-03 19:48:29
*/
public class AlipayMobileBeaconDeviceModifyResponse extends AlipayResponse {
private static final long serialVersionUID = 1575493654924159366L;
/**
* 返回的操作码
*/
@ApiField("code")
private String code;
/**
* 操作结果说明
*/
@ApiField("msg")
private String msg;
public void setCode(String code) {
this.code = code;
}
public String getCode( ) {
return this.code;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getMsg( ) {
return this.msg;
}
}
| [
"tw l"
] | tw l |
df0a58d751fd215913e041d6a3ccdd103ae6d2c0 | 0874d515fb8c23ae10bf140ee5336853bceafe0b | /l2j-universe/dist/gameserver/data/scripts/ai/Mammons.java | e784b8ac28b4b0b4848c35416cb0ad96c06a9bf7 | [] | no_license | NotorionN/l2j-universe | 8dfe529c4c1ecf0010faead9e74a07d0bc7fa380 | 4d05cbd54f5586bf13e248e9c853068d941f8e57 | refs/heads/master | 2020-12-24T16:15:10.425510 | 2013-11-23T19:35:35 | 2013-11-23T19:35:35 | 37,354,291 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,240 | java | /*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai;
import java.util.concurrent.ScheduledFuture;
import lineage2.commons.util.Rnd;
import lineage2.gameserver.ThreadPoolManager;
import lineage2.gameserver.data.xml.holder.NpcHolder;
import lineage2.gameserver.model.SimpleSpawner;
import lineage2.gameserver.model.instances.NpcInstance;
import lineage2.gameserver.network.serverpackets.components.NpcString;
import lineage2.gameserver.scripts.Functions;
import lineage2.gameserver.scripts.ScriptFile;
import lineage2.gameserver.templates.npc.NpcTemplate;
import lineage2.gameserver.utils.Location;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Mobius
* @version $Revision: 1.0 $
*/
public class Mammons extends Functions implements ScriptFile
{
/**
* Field _log.
*/
private static final Logger _log = LoggerFactory.getLogger(Mammons.class);
/**
* Field MAMMON_PRIEST_ID. (value is 33511)
*/
private static final int MAMMON_PRIEST_ID = 33511;
/**
* Field MAMMON_MERCHANT_ID. (value is 31113)
*/
private static final int MAMMON_MERCHANT_ID = 31113;
/**
* Field MAMMON_BLACKSMITH_ID. (value is 31126)
*/
private static final int MAMMON_BLACKSMITH_ID = 31126;
/**
* Field PORT_TIME.
*/
private static final int PORT_TIME = 10 * 60 * 1000;
/**
* Field PriestNpc.
*/
static NpcInstance PriestNpc;
/**
* Field MerchantNpc.
*/
static NpcInstance MerchantNpc;
/**
* Field BlacksmithNpc.
*/
static NpcInstance BlacksmithNpc;
/**
* Field _mammonTeleportTask.
*/
private static ScheduledFuture<?> _mammonTeleportTask;
/**
* Field mammonText.
*/
static final NpcString[] mammonText =
{
NpcString.RULERS_OF_THE_SEAL_I_BRING_YOU_WONDROUS_GIFTS,
NpcString.RULERS_OF_THE_SEAL_I_HAVE_SOME_EXCELLENT_WEAPONS_TO_SHOW_YOU,
NpcString.IVE_BEEN_SO_BUSY_LATELY_IN_ADDITION_TO_PLANNING_MY_TRIP
};
/**
* Field MAMMON_PRIEST_POINTS.
*/
static final Location[] MAMMON_PRIEST_POINTS =
{
new Location(16403, 144843, -3016, 27931),
new Location(81284, 150155, -3528),
new Location(114478, 217596, -3624, 0),
new Location(79992, 56808, -1585),
new Location(-84744, 151688, -3154, 0),
new Location(-12344, 121736, -3014, 0),
new Location(120392, 76488, -2167, 0),
new Location(146984, 29624, -2294, 0),
new Location(42856, -41432, -2212, 0),
new Location(144632, -54136, -3006, 0),
new Location(90024, -143672, -1565, 0),
};
/**
* Field MAMMON_MERCHANT_POINTS.
*/
static final Location[] MAMMON_MERCHANT_POINTS =
{
new Location(16380, 144784, -3016, 27931),
new Location(81272, 150041, -3528),
new Location(114482, 217538, -3624, 0),
new Location(79992, 56856, -1585),
new Location(-84744, 151656, -3154, 0),
new Location(-12344, 121784, -3014, 0),
new Location(120344, 76520, -2167, 0),
new Location(146984, 29672, -2294, 0),
new Location(42968, -41384, -2213, 0),
new Location(144552, -54104, -3006, 0),
new Location(89944, -143688, -1565, 0),
};
/**
* Field MAMMON_BLACKSMITH_POINTS.
*/
static final Location[] MAMMON_BLACKSMITH_POINTS =
{
new Location(16335, 144696, -3024, 27931),
new Location(81266, 150091, -3528),
new Location(114484, 217462, -3624, 0),
new Location(79992, 56920, -1585),
new Location(-84744, 151608, -3154, 0),
new Location(-12344, 121640, -3014, 0),
new Location(120296, 76536, -2167, 0),
new Location(146984, 29736, -2294, 0),
new Location(43032, -41336, -2214, 0),
new Location(144472, -54088, -3006, 0),
new Location(89912, -143752, -1566, 0),
};
/**
* Method SpawnMammons.
*/
public void SpawnMammons()
{
final int firstTown = Rnd.get(MAMMON_PRIEST_POINTS.length);
NpcTemplate template = NpcHolder.getInstance().getTemplate(MAMMON_PRIEST_ID);
SimpleSpawner sp = new SimpleSpawner(template);
sp.setLoc(MAMMON_PRIEST_POINTS[firstTown]);
sp.setAmount(1);
sp.setRespawnDelay(0);
PriestNpc = sp.doSpawn(true);
template = NpcHolder.getInstance().getTemplate(MAMMON_MERCHANT_ID);
sp = new SimpleSpawner(template);
sp.setLoc(MAMMON_MERCHANT_POINTS[firstTown]);
sp.setAmount(1);
sp.setRespawnDelay(0);
MerchantNpc = sp.doSpawn(true);
template = NpcHolder.getInstance().getTemplate(MAMMON_BLACKSMITH_ID);
sp = new SimpleSpawner(template);
sp.setLoc(MAMMON_BLACKSMITH_POINTS[firstTown]);
sp.setAmount(1);
sp.setRespawnDelay(0);
BlacksmithNpc = sp.doSpawn(true);
}
/**
* @author Mobius
*/
public static class TeleportMammons implements Runnable
{
/**
* Method run.
* @see java.lang.Runnable#run()
*/
@Override
public void run()
{
Functions.npcShout(BlacksmithNpc, mammonText[Rnd.get(mammonText.length)]);
final int nextTown = Rnd.get(MAMMON_PRIEST_POINTS.length);
PriestNpc.teleToLocation(MAMMON_PRIEST_POINTS[nextTown]);
MerchantNpc.teleToLocation(MAMMON_MERCHANT_POINTS[nextTown]);
BlacksmithNpc.teleToLocation(MAMMON_BLACKSMITH_POINTS[nextTown]);
}
}
/**
* Method onLoad.
* @see lineage2.gameserver.scripts.ScriptFile#onLoad()
*/
@Override
public void onLoad()
{
SpawnMammons();
_mammonTeleportTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new TeleportMammons(), PORT_TIME, PORT_TIME);
_log.info("Loaded AI: Mammons Teleporter");
}
/**
* Method onReload.
* @see lineage2.gameserver.scripts.ScriptFile#onReload()
*/
@Override
public void onReload()
{
// empty method
}
/**
* Method onShutdown.
* @see lineage2.gameserver.scripts.ScriptFile#onShutdown()
*/
@Override
public void onShutdown()
{
if (_mammonTeleportTask != null)
{
_mammonTeleportTask.cancel(true);
_mammonTeleportTask = null;
}
}
}
| [
"jmendezsr@gmail.com"
] | jmendezsr@gmail.com |
956a4bd3265dc992a00eb9b98fc58213fe752f36 | a87e93f52511fa39906b6c9f7b8ca1eae8eda8aa | /modules/web/test/com/haulmont/demo/jpawebapi/RestUtils.java | 048052392e3bf26302d44b8cc179bc31fdf6073b | [] | no_license | cuba-labs/jpawebapi-demo | 58a1e6a1db0cf12990c65c741b9b0ba107573851 | d265c51bab4cb8e5d6bdcf5b7d7bdf8176f45432 | refs/heads/master | 2020-04-28T23:04:40.246337 | 2019-10-02T18:34:06 | 2019-10-02T18:34:06 | 175,641,579 | 0 | 0 | null | 2019-10-02T18:34:08 | 2019-03-14T14:45:13 | Java | UTF-8 | Java | false | false | 3,542 | java | /*
* Copyright (c) 2008-2019 Haulmont.
*
* 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.haulmont.demo.jpawebapi;
import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.PostMethodWebRequest;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebResponse;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.xml.sax.SAXException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import static org.junit.Assert.*;
public class RestUtils {
protected static WebConversation webConversation;
protected String sessionId;
protected void service(String url) throws IOException, SAXException {
JSONObject content = new JSONObject();
content.put("service", "demo_PortalTestService");
content.put("method", "finAllUsers");
WebResponse response = POST(url, content.toString(), "application/json;charset=UTF-8");
JSONObject responseObject = new JSONObject(response.getText());
JSONArray resultObject = responseObject.getJSONArray("result");
assertNotNull(resultObject);
assertEquals(2, resultObject.length());
}
protected void query(String url) throws IOException, SAXException {
JSONObject content = new JSONObject();
content.put("entity", "sec$User");
content.put("query", "select c from sec$User c");
WebResponse response = POST(url, content.toString(), "application/json;charset=UTF-8");
JSONArray responseObject = new JSONArray(response.getText());
assertEquals(2, responseObject.length());
}
protected void logoutTest(String urlBase) throws IOException, SAXException, JSONException {
String session = login(urlBase + "/login?u=admin&p=admin&l=ru");
GET(urlBase + "/logout?session=" + session);
try {
query(urlBase + "/query?s=" + session);
} catch (Exception e) {
session = null;
}
assertNull(session);
}
protected WebResponse GET(String url) throws IOException, SAXException {
GetMethodWebRequest request = new GetMethodWebRequest(url);
request.setHeaderField("Accept", "charset=UTF-8");
return webConversation.sendRequest(request);
}
protected WebResponse POST(String url, String s, String contentType) throws IOException, SAXException {
ByteArrayInputStream is = new ByteArrayInputStream(s.getBytes());
return webConversation.sendRequest(new PostMethodWebRequest(url, is, contentType));
}
protected String login(String url) throws JSONException, IOException, SAXException {
WebResponse response = GET(url);
return response.getText();
}
protected void logout(String url) throws JSONException {
if (sessionId == null)
return;
try {
GET(url);
} catch (Exception e) {
System.out.println("Error on logout: " + e);
}
}
}
| [
"6183810+dtsaryov@users.noreply.github.com"
] | 6183810+dtsaryov@users.noreply.github.com |
8fbbcdb017c499a83cf6965ffe499e7066e3bcb2 | 16faafc7c0f7141148737982aea0725bbb2d42c8 | /src/textures/TerrainTexture.java | e94595037630e6e90bfad872329e5a4bf1ba4d1c | [] | no_license | aaronfrazer/GameEngine | 61277ce679d52d89f19d318f00a78affcd983af2 | 2e5660af501fb8a8256e7da252a0285e7ed44720 | refs/heads/master | 2021-01-20T00:03:25.029470 | 2018-01-31T04:27:00 | 2018-01-31T04:27:00 | 88,347,206 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 558 | java | package textures;
/**
* A class that represents a terrain texture.
*
* @author Aaron Frazer
*/
public class TerrainTexture
{
/**
* ID of terrain texture
*/
private int textureID;
/**
* Constructs a terrain texture.
*
* @param textureID terrain texture ID
*/
public TerrainTexture(int textureID)
{
this.textureID = textureID;
}
/**
* Returns this terrain texture's ID.
*
* @return texture ID
*/
public int getTextureID()
{
return textureID;
}
}
| [
"aarfrazer@gmail.com"
] | aarfrazer@gmail.com |
4987a349375a0ba761137d14df97654ba3797270 | a200795c94a7f2f54afe6786ee608501a9b8d2a4 | /Lab2/src/wpzi/Exercise2.java | ed0864bd85efa6257d573593b335976f06418cd3 | [] | no_license | S-Maciejewski/WPZI | 7781bf7ab87822e33b827ff838186b1d2fd436cf | 8ef6d538a8312631efa095aace369d3525d57d78 | refs/heads/master | 2020-04-25T12:04:07.690098 | 2019-04-09T20:15:35 | 2019-04-09T20:15:35 | 172,766,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,345 | java | package wpzi;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.tika.Tika;
import org.apache.tika.config.TikaConfig;
import org.apache.tika.detect.Detector;
import org.apache.tika.exception.TikaException;
import org.apache.tika.langdetect.OptimaizeLangDetector;
import org.apache.tika.language.detect.LanguageDetector;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.metadata.TikaCoreProperties;
import org.apache.tika.mime.MediaType;
import org.apache.tika.parser.AutoDetectParser;
import org.apache.tika.sax.BodyContentHandler;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
public class Exercise2 {
private static final String DATE_FORMAT = "yyyy-MM-dd";
private OptimaizeLangDetector langDetector;
public static void main(String[] args) {
Exercise2 exercise = new Exercise2();
exercise.run();
}
private void run() {
try {
if (!new File("./outputDocuments").exists()) {
Files.createDirectory(Paths.get("./outputDocuments"));
}
initLangDetector();
File directory = new File("./documents");
File[] files = directory.listFiles();
for (File file : files) {
processFile(file);
}
} catch (IOException | SAXException | TikaException | ParseException e) {
e.printStackTrace();
}
}
private void initLangDetector() throws IOException {
// TODO initialize language detector (langDetector)
this.langDetector = new OptimaizeLangDetector();
this.langDetector.loadModels();
}
private void processFile(File file) throws IOException, SAXException, TikaException, ParseException {
// TODO: extract content, metadata and language from given file
InputStream stream = new FileInputStream(file);
AutoDetectParser parser = new AutoDetectParser();
Metadata metadata = new Metadata();
ContentHandler handler = new BodyContentHandler(Integer.MAX_VALUE);
parser.parse(stream, handler, metadata);
String language = langDetector.detect(handler.toString()).getLanguage();
String creator = metadata.get(TikaCoreProperties.CREATOR);
String created = metadata.get(TikaCoreProperties.CREATED);
Date cretionDate = null;
if (created != null) {
cretionDate = new SimpleDateFormat("yyyy-mm-dd'T'hh:mm:ss'Z'").parse(created);
}
String lastMod = metadata.get(TikaCoreProperties.MODIFIED);
Date modifiedDate= null;
if (lastMod != null) {
modifiedDate = new SimpleDateFormat("yyyy-mm-dd'T'hh:mm:ss'Z'").parse(lastMod);
}
Detector mimeDetector = parser.getDetector();
BufferedInputStream bufferedInputStream = new BufferedInputStream(stream);
metadata.add(Metadata.RESOURCE_NAME_KEY, file.getName());
MediaType mediaType = mimeDetector.detect(bufferedInputStream, metadata);
// System.out.println("\nName: " + file.getName());
// System.out.println("Language: " + language);
// System.out.println("Creator: " + creator);
// System.out.println("Creation date: " + cretionDate);
// System.out.println("Last modification: " + modifiedDate);
// System.out.println("Mime type: " + mediaType);
// System.out.println("File content:\n" + bodyContentHandler.toString());
// call saveResult method to save the data
saveResult(file.getName(), language, creator, cretionDate, modifiedDate, mediaType.toString(), handler.toString()); //TODO: fill with proper values
}
private void saveResult(String fileName, String language, String creatorName, Date creationDate,
Date lastModification, String mimeType, String content) {
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
int index = fileName.lastIndexOf(".");
String outName = fileName.substring(0, index) + ".txt";
try {
PrintWriter printWriter = new PrintWriter("./outputDocuments/" + outName);
printWriter.write("Name: " + fileName + "\n");
printWriter.write("Language: " + (language != null ? language : "") + "\n");
printWriter.write("Creator: " + (creatorName != null ? creatorName : "") + "\n");
String creationDateStr = creationDate == null ? "" : dateFormat.format(creationDate);
printWriter.write("Creation date: " + creationDateStr + "\n");
String lastModificationStr = lastModification == null ? "" : dateFormat.format(lastModification);
printWriter.write("Last modification: " + lastModificationStr + "\n");
printWriter.write("MIME type: " + (mimeType != null ? mimeType : "") + "\n");
printWriter.write("\n");
printWriter.write(content + "\n");
printWriter.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
| [
"sebastian_maciejewski@yahoo.com"
] | sebastian_maciejewski@yahoo.com |
fc08209389274f6fb317e0ebfac93c05c53d9b25 | 1638da89582e51d48a2a840663710a0258351362 | /src/main/java/com/openlibin/util/FileKit.java | 1f57d87412c352e0888b61ba9637c84eda078b27 | [] | no_license | a610569731/RedisProxy | 99ae2afc3d694f86dba1826014b75b4a3c355051 | cdf0e0795b40469e4c1a0714c82c0bc952f281f4 | refs/heads/master | 2020-05-23T11:19:58.613684 | 2018-09-26T13:30:42 | 2018-09-26T13:30:42 | 80,385,171 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,428 | java | /**
* The MIT License (MIT)
* Copyright (c) 2009-2015 HONG LEIMING
*
* 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 com.openlibin.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.lang.reflect.Method;
import java.net.URL;
public class FileKit {
public static InputStream loadFile(String resource, Class<?> clazz) {
ClassLoader classLoader = null;
try {
Method method = Thread.class.getMethod("getContextClassLoader");
classLoader = (ClassLoader) method.invoke(Thread.currentThread());
} catch (Exception e) {
System.out.println("loadConfigFile error: ");
e.printStackTrace();
}
if (classLoader == null) {
classLoader = clazz.getClassLoader();
}
try {
if (classLoader != null) {
URL url = classLoader.getResource(resource);
if (url == null) {
System.out.println("Can not find resource:" + resource);
return null;
}
if (url.toString().startsWith("jar:file:")) {
return clazz.getResourceAsStream(resource.startsWith("/") ? resource : "/" + resource);
} else {
return new FileInputStream(new File(url.toURI()));
}
}
} catch (Exception e) {
System.out.println("loadConfigFile error: ");
e.printStackTrace();
}
return null;
}
public static InputStream loadFile(String resource) {
ClassLoader classLoader = null;
try {
Method method = Thread.class.getMethod("getContextClassLoader");
classLoader = (ClassLoader) method.invoke(Thread.currentThread());
} catch (Exception e) {
System.out.println("loadConfigFile error: ");
e.printStackTrace();
}
if (classLoader == null) {
classLoader = FileKit.class.getClassLoader();
}
try {
if (classLoader != null) {
URL url = classLoader.getResource(resource);
if (url == null) {
System.out.println("Can not find resource:" + resource);
return null;
}
if (url.toString().startsWith("jar:file:")) {
return FileKit.class.getResourceAsStream(resource.startsWith("/") ? resource : "/" + resource);
} else {
return new FileInputStream(new File(url.toURI()));
}
}
} catch (Exception e) {
System.out.println("loadConfigFile error: ");
e.printStackTrace();
}
return null;
}
public static String loadFileContent(String resource) {
InputStream in = FileKit.class.getClassLoader().getResourceAsStream(resource);
if (in == null)
return "";
Writer writer = new StringWriter();
char[] buffer = new char[1024];
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
int n;
while ((n = reader.read(buffer)) != -1) {
writer.write(buffer, 0, n);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return writer.toString();
}
public static void deleteFile(File file) {
if (file.exists()) {
if (file.isDirectory()) {
File[] files = file.listFiles();
if(files == null) return;
for (int i = 0; i < files.length; i++) {
deleteFile(files[i]);
}
}
file.delete();
}
}
}
| [
"610569731@qq.com"
] | 610569731@qq.com |
d0329c79444a042801a0173869a4c6abbd75efe9 | 8f13eaea11d13aac5650959620903c98fbb9775e | /src/main/java/JavaDatastructure.java | 08720ef41f610d4b982fc5d0abc3263012386b67 | [] | no_license | amrkhaledccd/Java-Data-Structure | 674b4032bd4c0cf58d06aeefbe5892022716c262 | bb16d116798c615381aeeea8528d0435ac589b6c | refs/heads/master | 2020-03-07T19:21:19.062913 | 2018-09-28T01:02:33 | 2018-09-28T01:02:33 | 127,668,334 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,091 | java | import datastructure.immutable.list.LinkedList;
import datastructure.immutable.tree.BinarySearchTree;
import datastructure.mutable.graph.UndirectedGraph;
import datastructure.mutable.tree.BinaryTree;
import datastructure.mutable.tree.balanced.AVLTree;
import java.util.Arrays;
import java.util.List;
public class JavaDatastructure {
public static void main(String[] args){
// Initialize linkedList
LinkedList<Integer> linkedList = LinkedList.of(5, 12, 14, 3);
// traverse the linkedList and print element to console
linkedList.traverse(x -> System.out.print(x + " "));
System.out.println();
// get element at index
System.out.println(linkedList.get(1).orElse(-1));
System.out.println(linkedList.getRecursive(2).orElse(-1));
// reverse linkedList
LinkedList<Integer> reversedList = linkedList.reverse();
//traverse the reversed linkedList
reversedList.traverse(x -> System.out.print(x + " "));
System.out.println();
//drop 2 elements
reversedList.drop(2).traverse(x -> System.out.print(x + " "));
System.out.println();
//drop while condition evaluates to true
linkedList.dropWhile(x -> x > 4).traverse(x -> System.out.print(x + " "));
System.out.println();
//prepend the reverse of the list to the list
LinkedList<Integer> prependedList = linkedList.prependAll(reversedList);
prependedList.traverse(x -> System.out.print(x + " "));
System.out.println();
//append an element to list
prependedList.append(100).traverse(x -> System.out.print(x +" "));
System.out.println();
//append list to list
prependedList.appendAll(LinkedList.of(200, 300, 400)).traverse(x -> System.out.print(x +" "));
System.out.println();
//delete element at index
prependedList.delete(2).traverse(x -> System.out.print(x + " "));
System.out.println();
BinaryTree bTree = BinaryTree.of(1, 2, 4, 5, 6, 7);
System.out.println(bTree.depth());
BinaryTree bTree2 = BinaryTree.of(1, 2, 4, 5, 6, 7);
System.out.println(bTree.compare(bTree2));
BinaryTree fliped = BinaryTree.of(4, 12, 15);
System.out.println(fliped);
fliped.flip();
System.out.println(fliped);
BinaryTree bTree3 = BinaryTree.of(4, 12, 15, 1, 6, 13);
BinaryTree bTree4 = BinaryTree.of(4, 12, 15, 1, 6, 13);
bTree4.flip();
System.out.println(bTree3.flipEqual(bTree4));
datastructure.immutable.tree.BinaryTree imTree = datastructure.immutable.tree.BinaryTree.of(1, 2 , 3);
System.out.println(imTree);
datastructure.immutable.tree.BinaryTree flipedImTree = imTree.flip();
System.out.println(flipedImTree);
BinarySearchTree<Integer> bst = BinarySearchTree.of(3, 1, 2, 6, 4, 8);
System.out.println(bst);
BinarySearchTree mappedTree = bst.map(elem -> elem * 2);
System.out.println(mappedTree);
BinarySearchTree bst1 = BinarySearchTree.of();
BinarySearchTree bst2 = bst1.insert(10).insert(5).insert(15).insert(7).insert(12);
System.out.println(bst2.find(20).orElse("Not found"));
bst2.postOrderTraversal(x -> System.out.print(x +" "));
System.out.println();
List<Integer> orderedList = Arrays.asList(2, 3, 4, 5);
AVLTree avlTree = new AVLTree();
orderedList.forEach(key -> avlTree.insert(key));
System.out.println(avlTree.root());
avlTree.delete(2);
System.out.println(avlTree.root());
UndirectedGraph graph = new UndirectedGraph(5);
graph.addEdge(0, 1);
graph.addEdge(0, 4);
graph.addEdge(1, 2);
graph.addEdge(1, 3);
graph.addEdge(1, 4);
graph.addEdge(2, 3);
graph.addEdge(3, 4);
graph.print();
int[] testA = new int []{1, 2, 3, 4, 5};
testA = Arrays.copyOf(testA, 3);
Arrays.stream(testA).forEach(System.out::println);
}
}
| [
"amr.khaled@commercetools.de"
] | amr.khaled@commercetools.de |
2e67f13c0271b87705402587c88ca18c879b230b | 3f6fa3f05df82e87328f6efa7a35b1c11883f142 | /wake/sdk_asr_baidu_speech_ASR_V3_20191210_81acdf5_3.1.6/core/src/main/java/com/baidu/aip/asrwakeup3/core/inputstream/InFileStream.java | d97f1b3cd9834a7429be38d812e9071ba67b5332 | [] | no_license | lulihuang/baidu_yuyin | 6d16094f0248243a98c90e25bfdb104fb6e86426 | 0646cffe498caab249c02c17abaa6badee1335ec | refs/heads/main | 2023-02-10T12:11:12.801278 | 2021-01-11T07:40:45 | 2021-01-11T07:40:45 | 328,584,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,916 | java | package com.baidu.aip.asrwakeup3.core.inputstream;
import android.app.Activity;
import android.content.Context;
import com.baidu.aip.asrwakeup3.core.util.MyLogger;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by fujiayi on 2017/6/20.
*/
public class InFileStream {
private static Context context;
private static final String TAG = "InFileStream";
private static volatile String filename;
private static volatile InputStream is;
// 以下3个setContext
/**
* 必须要先调用这个方法
* 如之后调用create16kStream,使用默认的app/src/main/assets/outfile.pcm作为输入
* 如之后调用createMyPipedInputStream, 见 InPipedStream
* @param context
*/
public static void setContext(Context context) {
InFileStream.context = context;
}
/**
* 使用pcm文件作为输入
* @param context
* @param filename
*/
public static void setContext(Context context,String filename) {
InFileStream.context = context;
InFileStream.filename = filename;
}
public static void setContext(Context context,InputStream is) {
InFileStream.context = context;
InFileStream.is = is;
}
public static Context getContext(){
return context;
}
public static void reset() {
filename = null;
is = null;
}
public static InputStream createMyPipedInputStream(){
return InPipedStream.createAndStart(context);
}
/**
* 默认使用必须要先调用setContext
* 默认从createFileStream中读取InputStream
* @return
*/
public static InputStream create16kStream() {
if (is == null && filename == null){
// 没有任何设置的话,从createFileStream中读取
return new FileAudioInputStream(createFileStream());
}
if (is != null) { // 默认为null,setInputStream调用后走这个逻辑
return new FileAudioInputStream(is);
} else if (filename != null) { // 默认为null, setFileName调用后走这个逻辑
try {
return new FileAudioInputStream(filename);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
return null;
}
private static InputStream createFileStream() {
try {
// 这里抛异常表示没有调用 setContext方法
InputStream is = context.getAssets().open("outfile1157.pcm");
MyLogger.info(TAG, "create input stream ok " + is.available());
return is;
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
} | [
"727445285@qq.com"
] | 727445285@qq.com |
c5e7595e4c56b3b0a46a57bb785d4cae61c73f64 | ae3eed50287914d7d897d89c9eb5a8c7f5046ba9 | /src/main/java/cn/edu/sdst/mwrdph/admin/mapper/AdminUserMapper.java | 0b368decdc27839e90a818749dd0554aa29b65e3 | [] | no_license | ZeminJiang1926/mwrdph-backend | f957ebe848900ccb1ad320148a4e013b4ff338ed | 4c7d3f394cf9e4f0f403a94157f76cd8eb3fbe90 | refs/heads/master | 2020-05-01T08:07:48.806719 | 2019-03-30T06:48:25 | 2019-03-30T06:48:25 | 177,370,862 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 959 | java | package cn.edu.sdst.mwrdph.admin.mapper;
import cn.edu.sdst.mwrdph.entity.UserPO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@org.apache.ibatis.annotations.Mapper
public interface AdminUserMapper extends tk.mybatis.mapper.common.Mapper<UserPO> {
/**
* 查询前50条用户信息
*
* @return
*/
List<UserPO> queryTopUser();
/**
* 根据工号和姓名模糊查询用户信息
*
* @param name
* @param id
* @return
*/
List<UserPO> queryUserByItems(@Param("name") String name, @Param("id") Integer id);
/**
* 根据工号删除用户信息
*
* @param id
*/
void delUser(@Param("id") Integer id);
/**
* 根据工号更新用户信息
*
* @param user
*/
void updateUser(@Param("user") UserPO user);
/**
* 添加用户
*
* @param user
*/
void addUser(@Param("user") UserPO user);
}
| [
"yvzhang1997@163.com"
] | yvzhang1997@163.com |
5fd9198597d6ed412a921b2f09e973e99743ec44 | 2751cb6b261d557d3849a7f7035a7bc18eb60493 | /rating-service/src/main/java/com/example/ratingservice/modeli/Rating.java | 3cd2c92fe3ab0163ef00954243f75ee9c01d0f70 | [] | no_license | aserdarevic/NWT-Team-Storm | 5f1a03ea2521b4b1f366e34d3a8edae6fbd91765 | 0ec41127c0c0842026899978642114842f512fe9 | refs/heads/master | 2023-03-08T11:06:29.689294 | 2020-06-07T13:22:47 | 2020-06-07T13:22:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,880 | java | package com.example.ratingservice.modeli;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.annotations.Proxy;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@Entity
@Table(name="rating")
@Proxy(lazy = false)
public class Rating {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
@JsonProperty(value = "korisnik")
@JoinColumn(name="korisnik_id")
private User korisnik;
@ManyToOne
@JsonProperty(value = "strip")
@JoinColumn(name="strip_id")
private Strip strip;
@Min(value =1)
@Max(value =5)
@NotNull
private int ocjena;
@NotNull
private String komentar;
public Rating(User korisnik, Strip strip, int ocjena, String komentar) {
this.korisnik = korisnik;
this.strip = strip;
this.ocjena = ocjena;
this.komentar = komentar;
}
public Rating() {}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public User getKorisnik() {
return korisnik;
}
public void setKorisnik(User korisnik) {
this.korisnik = korisnik;
}
public Strip getStrip() {
return strip;
}
public void setStrip(Strip strip) {
this.strip = strip;
}
public int getOcjena() {
return ocjena;
}
public void setOcjena(int ocjena) {
this.ocjena = ocjena;
}
public String getKomentar() {
return komentar;
}
public void setKomentar(String komentar) {
this.komentar = komentar;
}
}
| [
"mbuturovic1@etf.unsa.ba"
] | mbuturovic1@etf.unsa.ba |
c14385260b61b02f42d788125f3ea95cd9232a1f | f87600d7812a95908858ec21bc370a30151312fa | /src/main/java/org/launchcode/cheesemvc/models/data/CheeseDao.java | 36e3908ff4bcd60f68fd62b02174a55d13c9135f | [] | no_license | krispykate17/cheese-mvc | dc2caadc54a9bad618e64b688200acf00686fd9c | a7f1aa8117649227f35349244b50aa2305e063d0 | refs/heads/master | 2021-01-25T04:37:35.628298 | 2017-06-19T23:54:24 | 2017-06-19T23:54:24 | 93,458,536 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package org.launchcode.cheesemvc.models.data;
import org.launchcode.cheesemvc.models.Cheese;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import javax.transaction.Transactional;
/**
* Created by kajuh_000 on 6/18/2017.
*/
@Repository
@Transactional
public interface CheeseDao extends CrudRepository<Cheese, Integer> {
}
| [
"kajuhala@gmail.com"
] | kajuhala@gmail.com |
0c212e91878e281a2cef8b711768b3c58643c7ee | 32cdf68363ee7189a6fa761d623f47275cccfcc5 | /src/main/java/dip/before/documents/ExportableDocument.java | c28f6a82c97a1167d2e891ed95c370cb16e58422 | [] | no_license | Augusto11CB/HR-Framework-Solid-Principles-Java | 3d6a513e38efe371ea0995d81a2df156888da4d8 | d91822eb6d78e6adf55814c208af0255cc4fbc4d | refs/heads/master | 2023-07-08T04:18:26.615760 | 2020-04-14T01:48:49 | 2020-04-14T01:48:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | package dip.before.documents;
/*
Common interface used in application when there is
a need for document exports
*/
// [aug-isp] in order to adhere to the isp this interface was split into smaller interfaces
// [ExportableJson, ExportablePdf, ExportableText]
//public interface ExportableDocument {
// byte[] toPdf();
// String toJson();
// String toTxt();
//}
| [
"17462762+AugustoCalado@users.noreply.github.com"
] | 17462762+AugustoCalado@users.noreply.github.com |
627cc78c9548f9004646e66ad57119a334d59d57 | 6f4b5d7bf14f157e3c6a9c304ec45e5d9fe48834 | /src/main/java/clikmng/nanet/go/kr/cmm/service/impl/EgovUserDetailsSessionServiceImpl.java | 190742328173f9bdced80cfed08b6fc5f869c760 | [] | no_license | kimyongyeon/clik_mng | f5411a7191e30c3c6ae0f7d88eec016d90432aff | 1f8d7bf3c8facd3f8365440dcca2308e1e3fae42 | refs/heads/master | 2021-01-01T05:19:33.391175 | 2016-04-29T06:41:16 | 2016-04-29T06:41:16 | 57,361,010 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,377 | java | package clikmng.nanet.go.kr.cmm.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import clikmng.nanet.go.kr.cmm.service.EgovUserDetailsService;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
/**
*
* @author
* @since
* @version
* @see
*
* <pre>
* 개정이력(Modification Information)
*
* 수정일 수정자 수정내용
* ------- -------- ---------------------------
*
* </pre>
*/
public class EgovUserDetailsSessionServiceImpl extends AbstractServiceImpl implements
EgovUserDetailsService {
public Object getAuthenticatedUser() {
return RequestContextHolder.getRequestAttributes().getAttribute("loginVO", RequestAttributes.SCOPE_SESSION);
}
public List<String> getAuthorities() {
// 권한 설정을 리턴한다.
List<String> listAuth = new ArrayList<String>();
return listAuth;
}
public Boolean isAuthenticated() {
// 인증된 유저인지 확인한다.
if (RequestContextHolder.getRequestAttributes() == null) {
return false;
} else {
if (RequestContextHolder.getRequestAttributes().getAttribute(
"loginVO", RequestAttributes.SCOPE_SESSION) == null) {
return false;
} else {
return true;
}
}
}
}
| [
"toyongyeon@gmail.com"
] | toyongyeon@gmail.com |
8a6ada6916ec85dcf054a6c1d9e2538c2526e6a2 | ec2c4350cc21a5a8dc7d49d0f86f916ad0ef5588 | /src/TiedostonKasittelija.java | f9c1fee35a32cb3ae790c0948e1d84a179e6539d | [
"MIT"
] | permissive | essirosalinda/Puhelinmuistio | 11439a8a58a103b843d1549e6f6f11726e9e06e7 | 8087366740de96e6c01d1a876ffa56a6cf8a3471 | refs/heads/master | 2020-05-26T01:42:07.708660 | 2019-05-22T15:08:50 | 2019-05-22T15:08:50 | 188,063,862 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,427 | java | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class TiedostonKasittelija {
public static void tallenna(Muistio tallennetutNumerot) {
// Esitellään tiedosto, johon kirjoitetaan sekä kirjoittaja-olio
FileOutputStream tiedosto;
try {
tiedosto = new FileOutputStream("PuhelinMuistio.ser");
ObjectOutputStream olionKirjoittaja = new ObjectOutputStream(tiedosto);
olionKirjoittaja.writeObject(tallennetutNumerot);
// Lopputoimet, suljetaan tiedosto ja tyhjennetään kirjoittaja-olio
olionKirjoittaja.flush();
tiedosto.close();
} catch (Exception e) {
System.out.println("Tiedoston tallennuksessa tapahtui virhe!");
}
}
public static Muistio lataaTallennettu() {
FileInputStream tiedosto;
Muistio tallennetutNumerot = null;
try {
tiedosto = new FileInputStream("PuhelinMuistio.ser");
ObjectInputStream tallesta = new ObjectInputStream(tiedosto);
tallennetutNumerot = (Muistio) tallesta.readObject();
tiedosto.close();
} catch (FileNotFoundException e) {
System.out.println("Tiedostoa ei ollut olemassa, luodaan tyhjä muistio!");
tallennetutNumerot = new Muistio();
} catch (Exception e) {
System.out.println("Tiedoston lataamisessa tapahtui virhe!");
}
return tallennetutNumerot;
}
}
| [
"essi.hauhau@hotmail.com"
] | essi.hauhau@hotmail.com |
d7882fa2ed82f73aef7c9c2bc57feb840701d6e9 | d3827a485408940acabfd9e09d1fb4c68581af51 | /springbootrest/src/main/java/com/example/bootrest/repository/EmpRepository.java | efa30e1d9d7c58a3d9ecae359b1f700eb11f44cd | [] | no_license | nageom/springbootrest | 96630086e4f2a44ee2d874d4f856d7187cf37c4f | 53cec68032a17012a18449dbb0b3d1bc51ae1528 | refs/heads/master | 2023-05-31T01:59:53.486184 | 2021-06-12T14:16:19 | 2021-06-12T14:16:19 | 376,034,014 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | package com.example.bootrest.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import com.example.bootrest.model.Emp;
//모델클래스 타입, 모델클래스 키
public interface EmpRepository extends JpaRepository<Emp, Integer> {
// 쿼리 메서드
//메서드 이름으로 스프링 데이터 jpa에서 자동으로 sql쿼리문을 만들어주는것
List<Emp> findBySalBetween(int sal1, int sal2);
// 메서드 이름으로 자동으로 select 쿼리 새엇ㅇ
// JPA에서 자동으로 생성하는 쿼리는 다음과 같다.
/*
* select
* emp0_.empno as empno1_0_,
* emp0_.ename as ename2_0),
* emp0_.sal as sal3_0_,
* from
* emp emp0_
* where
* emp0_.sal between ? and ?
*
*
*
* */
}
| [
"nageom1123@naver.com"
] | nageom1123@naver.com |
d99d12895c92f32166394c5fd43b153dfbc2b3e1 | 9526559011b76abb514602b43b7e47231114b45a | /random-beans/src/test/java/io/github/benas/randombeans/randomizers/UrlRandomizerTest.java | 3ce93e79753545c33be91dfbeb8814f0249c8de1 | [
"MIT"
] | permissive | nate-sonicbottle/random-beans | 02a182ecb38099b7a72e3e666ed8e4eb8d58068c | c77d8fdf7477b747889688e431baac4702f27b43 | refs/heads/master | 2021-01-15T20:47:48.804953 | 2016-02-22T20:39:24 | 2016-02-22T20:39:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,888 | java | /*
* The MIT License
*
* Copyright (c) 2016, Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
*
* 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 io.github.benas.randombeans.randomizers;
import org.junit.Before;
import org.junit.Test;
import java.net.MalformedURLException;
import java.net.URL;
import static org.assertj.core.api.Assertions.assertThat;
public class UrlRandomizerTest extends AbstractRandomizerTest<URL> {
@Before
public void setUp() throws Exception {
randomizer = UrlRandomizer.aNewUrlRandomizer(SEED);
}
@Test
public void shouldGenerateTheSameValueForTheSameSeed() throws MalformedURLException {
URL actual = randomizer.getRandomValue();
URL expected = new URL("http://www.google.com");
assertThat(actual).isEqualTo(expected);
}
}
| [
"mahmoud.benhassine@icloud.com"
] | mahmoud.benhassine@icloud.com |
239767001a1196e718ce9ee5dab2a94e85123eca | 4a6e0b5a9b4f233b4574cec71b4bad8058e8d9e5 | /erp-model/erp-model-service/src/main/java/com/berrontech/erp/modal/service/general/impl/PartCategoryServiceImpl.java | b7231d386f327785b76000d5f5a8ecd253522ad9 | [] | no_license | levent8421/agile-erp | 38e3c00ac6a97a1fce05b79d344c8f99704aca13 | e21ae39bb730e040d6921871991a69d614632670 | refs/heads/master | 2023-03-15T05:33:23.572085 | 2021-03-10T13:34:39 | 2021-03-10T13:34:39 | 345,548,155 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,930 | java | package com.berrontech.erp.modal.service.general.impl;
import com.berrontech.erp.commons.entity.PartCategory;
import com.berrontech.erp.commons.entity.PartType;
import com.berrontech.erp.modal.service.basic.impl.AbstractServiceImpl;
import com.berrontech.erp.modal.service.general.PartCategoryService;
import com.berrontech.erp.modal.service.vo.PartTypeVo;
import com.berrontech.erp.model.repository.general.PartCategoryMapper;
import lombok.val;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* Create By Levent8421
* Create Time: 2020/2/12 0:23
* Class Name: PartCategoryServiceImpl
* Author: Levent8421
* Description:
* 库存类别相关业务行为实现
*
* @author Levent8421
*/
@Service
public class PartCategoryServiceImpl extends AbstractServiceImpl<PartCategory> implements PartCategoryService {
private final PartCategoryMapper partCategoryMapper;
public PartCategoryServiceImpl(PartCategoryMapper partCategoryMapper) {
super(partCategoryMapper);
this.partCategoryMapper = partCategoryMapper;
}
@Override
public List<PartCategory> findByTypeId(Integer typeId) {
return partCategoryMapper.selectByTypeId(typeId);
}
@Override
public List<PartTypeVo> asTree(List<PartType> types, List<PartCategory> categories) {
val categoriesMap = new HashMap<Integer, List<PartCategory>>(16);
for (val category : categories) {
val list = categoriesMap.computeIfAbsent(category.getPartTypeId(), k -> new ArrayList<>());
list.add(category);
}
val res = new ArrayList<PartTypeVo>();
for (val type : types) {
val list = categoriesMap.get(type.getId());
val typeVo = new PartTypeVo(type);
typeVo.setPartCategories(list);
res.add(typeVo);
}
return res;
}
}
| [
"levent8421@outlook.com"
] | levent8421@outlook.com |
91bc35891ae2df5273cb374bc31f706d444a85a3 | 681419eca4b358ed81db144f7a62641859dc31ae | /src/eclipsesource/json/JsonWriter.java | f5f652d4015e2d207308fc3dff47a8bb884a7496 | [] | no_license | reece-bennett/thaumcraft-helper | c68259b11e7ec8f10890163d23cb19b58151ad2a | 1ad237b612662777f196733af3456c5c0ad49232 | refs/heads/master | 2021-06-02T17:37:07.890661 | 2016-09-18T22:41:03 | 2016-09-18T22:41:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,735 | java | /*******************************************************************************
* Copyright (c) 2013, 2015 EclipseSource.
*
* 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 eclipsesource.json;
import java.io.IOException;
import java.io.Writer;
class JsonWriter {
private static final int CONTROL_CHARACTERS_END = 0x001f;
private static final char[] QUOT_CHARS = {'\\', '"'};
private static final char[] BS_CHARS = {'\\', '\\'};
private static final char[] LF_CHARS = {'\\', 'n'};
private static final char[] CR_CHARS = {'\\', 'r'};
private static final char[] TAB_CHARS = {'\\', 't'};
// In JavaScript, U+2028 and U+2029 characters count as line endings and must be encoded.
// http://stackoverflow.com/questions/2965293/javascript-parse-error-on-u2028-unicode-character
private static final char[] UNICODE_2028_CHARS = {'\\', 'u', '2', '0', '2', '8'};
private static final char[] UNICODE_2029_CHARS = {'\\', 'u', '2', '0', '2', '9'};
private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f'};
protected final Writer writer;
JsonWriter(Writer writer) {
this.writer = writer;
}
protected void writeLiteral(String value) throws IOException {
writer.write(value);
}
protected void writeNumber(String string) throws IOException {
writer.write(string);
}
protected void writeString(String string) throws IOException {
writer.write('"');
writeJsonString(string);
writer.write('"');
}
protected void writeArrayOpen() throws IOException {
writer.write('[');
}
protected void writeArrayClose() throws IOException {
writer.write(']');
}
protected void writeArraySeparator() throws IOException {
writer.write(',');
}
protected void writeObjectOpen() throws IOException {
writer.write('{');
}
protected void writeObjectClose() throws IOException {
writer.write('}');
}
protected void writeMemberName(String name) throws IOException {
writer.write('"');
writeJsonString(name);
writer.write('"');
}
protected void writeMemberSeparator() throws IOException {
writer.write(':');
}
protected void writeObjectSeparator() throws IOException {
writer.write(',');
}
protected void writeJsonString(String string) throws IOException {
int length = string.length();
int start = 0;
for (int index = 0; index < length; index++) {
char[] replacement = getReplacementChars(string.charAt(index));
if (replacement != null) {
writer.write(string, start, index - start);
writer.write(replacement);
start = index + 1;
}
}
writer.write(string, start, length - start);
}
private static char[] getReplacementChars(char ch) {
if (ch > '\\') {
if (ch < '\u2028' || ch > '\u2029') {
// The lower range contains 'a' .. 'z'. Only 2 checks required.
return null;
}
return ch == '\u2028' ? UNICODE_2028_CHARS : UNICODE_2029_CHARS;
}
if (ch == '\\') {
return BS_CHARS;
}
if (ch > '"') {
// This range contains '0' .. '9' and 'A' .. 'Z'. Need 3 checks to get here.
return null;
}
if (ch == '"') {
return QUOT_CHARS;
}
if (ch > CONTROL_CHARACTERS_END) {
return null;
}
if (ch == '\n') {
return LF_CHARS;
}
if (ch == '\r') {
return CR_CHARS;
}
if (ch == '\t') {
return TAB_CHARS;
}
return new char[] {'\\', 'u', '0', '0', HEX_DIGITS[ch >> 4 & 0x000f], HEX_DIGITS[ch & 0x000f]};
}
}
| [
"reece.bennett1@gmail.com"
] | reece.bennett1@gmail.com |
e30dd3342f95d085b53729d4a6339f3fb057b8e4 | aa301d205b91939fd6e3593826dc07a2f5f574ce | /HW2/Assignment2.java | 77d8584f5f36ba6b9613fc37adfa764e02b7d7bd | [] | no_license | mbaldwin2015/CSE205-Object-Oriented-All-Homework | 788df666ba4638e2946c5c307a19896246ba9416 | badd14830b95d3dead9e34758fde5b04b92eb105 | refs/heads/master | 2021-04-15T06:51:54.719309 | 2018-03-24T01:21:29 | 2018-03-24T01:21:29 | 126,554,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,143 | java | // Assignment #: 2
// Name: Michael Baldwin
// StudentID: 1208386656
// Lecture: MW 12:00-1:15
// Description: This class reads an any number of integers until 0 is entered
// and performs calculations on the integers
import java.util.Scanner; // import scanner class
public class Assignment2 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in); // create 'in' Scanner object
// initialize all variables
int sum = 0;
int count = 0;
int min = 0;
int current = -1;
while (current != 0) { // will keep looping until a 0 is entered
current = in.nextInt(); // take input
if (current != 0) { // if the int from the input is not 0
if (current % 2 == 0) // if even, add to sum
sum += current;
if (current < min) // if less than min, change min
min = current;
if (current > 0) // if positive, increase count by 1
count++;
}
}
// show output
System.out.println("The minimum integer is " + min);
System.out.println("The sum of even integers is " + sum);
System.out.println("The count of positive integers in the sequence is " + count);
}
} | [
"mbaldwin08@gmail.com"
] | mbaldwin08@gmail.com |
2b7885b83a3cdf6be4b078a6f7c7a5c4f40bc2d2 | f36e6ed88d852231862733fe63a5db679bd2a166 | /src/main/java/entity/Employee.java | 64829ec8a7148192d6353df8a377e0ba802ed6e6 | [] | no_license | muShangG/layuiMini_demo | 175d4621c23b0e6966b683fb26b59321b84f6aa5 | 622da10e4560ca52bc67757517634dfa1bb06014 | refs/heads/master | 2022-07-15T13:41:06.984566 | 2020-04-01T14:52:30 | 2020-04-01T14:52:30 | 252,208,004 | 0 | 0 | null | 2022-06-21T03:06:58 | 2020-04-01T15:03:47 | Java | UTF-8 | Java | false | false | 1,089 | java | package entity;
import java.io.Serializable;
/**
* (Employee)实体类
*
* @author makejava
* @since 2020-02-13 17:01:03
*/
public class Employee implements Serializable {
private static final long serialVersionUID = -69162850881556684L;
private Integer id;
private String lastname;
private String email;
private Integer gender;
private Integer dId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public Integer getDId() {
return dId;
}
public void setDId(Integer dId) {
this.dId = dId;
}
} | [
"1317190298@qq.com"
] | 1317190298@qq.com |
fc01951c8ac5091fc950722f6c54d821a260f619 | dc004108524cc3326276f3fbc4eac6f9aa88e1db | /controller/CommentsController.java | 3389e7c02bd9ca41fd6d151101f186bcedaf21b4 | [] | no_license | elisematos/reddit-clone | ccf6798f3c3c7aae71d628a1ecbeda8126c84549 | 55395bb8b8ea6b09555c8b001d1b8fd406bfcfa6 | refs/heads/master | 2023-07-28T02:28:44.060330 | 2021-09-16T09:03:08 | 2021-09-16T09:03:08 | 407,095,450 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,484 | java | package com.redditclone.project.controller;
import com.redditclone.project.dto.CommentDto;
import com.redditclone.project.exception.PostNotFoundException;
import com.redditclone.project.exception.SpringRedditException;
import com.redditclone.project.service.CommentService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/comments/")
@AllArgsConstructor
@Api
public class CommentsController {
private final CommentService commentService;
@PostMapping
public ResponseEntity<Void> createComment(@RequestBody CommentDto commentDto)
throws SpringRedditException, PostNotFoundException {
commentService.save(commentDto);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@GetMapping("/by-post/{postId}")
public ResponseEntity<List<CommentDto>> getAllCommentsForPost(@PathVariable Long postId)
throws PostNotFoundException {
return ResponseEntity.status(HttpStatus.OK).body(commentService.getAllcommentsForPost(postId));
}
@GetMapping("/by-user/{userName}")
public ResponseEntity<List<CommentDto>> getAllCommentsForUser(@PathVariable String userName) {
return ResponseEntity.status(HttpStatus.OK).body(commentService.getAllCommentsForUser(userName));
}
}
| [
"elise.matos@hotmail.fr"
] | elise.matos@hotmail.fr |
95a2eff902258967b6df3b8891f5ff51565b18b8 | 143bc53a7b67e574c542d9be0e7e68be45062137 | /src/main/java/com/ssh/nio/ScatteringAndGatheringTest.java | a458e4d23334ffec646665d688f79b3502529126 | [] | no_license | ssh3519/netty-study | f9fa1c376889ecef2b18ca8703e2de94e1c6c9f1 | 2290b35f355fd36e067e2cf2ac1744b185580a6b | refs/heads/master | 2023-08-22T10:27:20.074514 | 2021-10-21T06:59:02 | 2021-10-21T06:59:02 | 416,206,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,454 | java | package com.ssh.nio;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Arrays;
/**
* @author ssh
* @description Scattering:将数据写入到 buffer 时,可以采用 buffer 数组,依次写入 [分散]
* Gathering:从 buffer 读取数据时,可以采用 buffer 数组,依次读
* @date 2021/10/13 14:10
*/
public class ScatteringAndGatheringTest {
public static void main(String[] args) throws Exception {
//使用 ServerSocketChannel 和 SocketChannel 网络
ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
InetSocketAddress inetSocketAddress = new InetSocketAddress(7000);
//绑定端口到 socket,并启动
serverSocketChannel.socket().bind(inetSocketAddress);
//创建 buffer 数组
ByteBuffer[] byteBuffers = new ByteBuffer[2];
byteBuffers[0] = ByteBuffer.allocate(5);
byteBuffers[1] = ByteBuffer.allocate(3);
//等客户端连接 (telnet)
SocketChannel socketChannel = serverSocketChannel.accept();
int messageLength = 8; //假定从客户端接收 8 个字节
//循环的读取
while (true) {
int byteRead = 0;
while (byteRead < messageLength) {
long l = socketChannel.read(byteBuffers);
byteRead += l; //累计读取的字节数
System.out.println("byteRead = " + byteRead);
//使用流打印,看看当前的这个 buffer 的 position 和 limit
Arrays.asList(byteBuffers).stream().map(buffer -> "position = " + buffer.position() + ", limit = " + buffer.limit()).forEach(System.out::println);
}
//将所有的 buffer 进行 flip
Arrays.asList(byteBuffers).forEach(buffer -> buffer.flip());
//将数据读出显示到客户端
long byteWirte = 0;
while (byteWirte < messageLength) {
long l = socketChannel.write(byteBuffers);//
byteWirte += l;
}
//将所有的buffer进行clear
Arrays.asList(byteBuffers).forEach(buffer -> {
buffer.clear();
});
System.out.println("byteRead = " + byteRead + ", byteWrite = " + byteWirte + ", messagelength = " + messageLength);
}
}
}
| [
"shensh"
] | shensh |
f4e3571390bf25f5e7062a92822d993608d3c4fb | 816010b1a6316a6f046f4b2875620ea81a532d8e | /src/main/java/io/github/bonigarcia/DockerBrowser.java | c1a7771b56211ca1692b175cfe7097c193c9a806 | [
"Apache-2.0"
] | permissive | based2/selenium-jupiter | 731957fc67ea796197d7fc339a7a5225d331c83e | 1a4dbdaacad01dd9d666918f69e007f4bc711b46 | refs/heads/master | 2020-03-18T01:44:11.684579 | 2018-05-03T07:42:29 | 2018-05-03T07:42:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,148 | java | /*
* (C) Copyright 2017 Boni Garcia (http://bonigarcia.github.io/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.github.bonigarcia;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Annotation for browsers in Docker.
*
* @author Boni Garcia (boni.gg@gmail.com)
* @since 2.0.0
*/
@Retention(RUNTIME)
@Target(PARAMETER)
public @interface DockerBrowser {
public BrowserType type();
public String version() default "";
public int size() default 0;
}
| [
"bgarcia@gsyc.es"
] | bgarcia@gsyc.es |
1fc80449237f52a314b762bc61b6d29249eea0cb | a2aa0d649ff84cd1d8c824bda900efb8f3260591 | /hibernate-database/hibernate/src/com/ntdat/hibernateproject/entities/MonHocEntity.java | b380eb02b73091b75b4c1c1c8d3584b520d7408b | [] | no_license | itdat/student-management-java | 74279ca0a2e0d0a32d9d4847069650bd4d30d121 | a3ec1ab7d3e1759d91c92c9b45ea7304b680b3f6 | refs/heads/master | 2022-11-17T07:53:32.777093 | 2020-07-05T16:36:29 | 2020-07-05T16:36:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,022 | java | package com.ntdat.hibernateproject.entities;
import javax.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "mon_hoc", schema = "hibernate-database", catalog = "")
public class MonHocEntity {
private String maMon;
private String tenMon;
@Id
@Column(name = "MaMon")
public String getMaMon() {
return maMon;
}
public void setMaMon(String maMon) {
this.maMon = maMon;
}
@Basic
@Column(name = "TenMon")
public String getTenMon() {
return tenMon;
}
public void setTenMon(String tenMon) {
this.tenMon = tenMon;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MonHocEntity that = (MonHocEntity) o;
return Objects.equals(maMon, that.maMon) &&
Objects.equals(tenMon, that.tenMon);
}
@Override
public int hashCode() {
return Objects.hash(maMon, tenMon);
}
}
| [
"53074785+itdat@users.noreply.github.com"
] | 53074785+itdat@users.noreply.github.com |
e3e6a4186606480aa05cd3f810712c21fc641061 | 76fa1a893278d8de876b374d56523e10ca10d11b | /src/java/org/infoglue/cms/applications/structuretool/actions/ViewSiteNodeAction.java | 3d96d21f3c675a91bb32efaf2c92faeccf3cd0e9 | [] | no_license | vrossello/infoglue | b8ac3b9fa3363878188fd89d8593c248ae054d1d | 9a1a128399196cd6111c6346e6fc8f5bbdb42b4d | refs/heads/master | 2021-01-18T08:15:54.399287 | 2012-11-06T16:17:09 | 2012-11-06T16:17:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 44,415 | java | /* ===============================================================================
*
* Part of the InfoGlue Content Management Platform (www.infoglue.org)
*
* ===============================================================================
*
* Copyright (C)
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2, as published by the
* Free Software Foundation. See the file LICENSE.html for more information.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
* Place, Suite 330 / Boston, MA 02111-1307 / USA.
*
* ===============================================================================
*/
package org.infoglue.cms.applications.structuretool.actions;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.exolab.castor.jdo.Database;
import org.infoglue.cms.applications.common.VisualFormatter;
import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
import org.infoglue.cms.controllers.kernel.impl.simple.AccessRightController;
import org.infoglue.cms.controllers.kernel.impl.simple.AvailableServiceBindingController;
import org.infoglue.cms.controllers.kernel.impl.simple.CastorDatabaseService;
import org.infoglue.cms.controllers.kernel.impl.simple.ContentController;
import org.infoglue.cms.controllers.kernel.impl.simple.ContentControllerProxy;
import org.infoglue.cms.controllers.kernel.impl.simple.ContentStateController;
import org.infoglue.cms.controllers.kernel.impl.simple.ContentVersionController;
import org.infoglue.cms.controllers.kernel.impl.simple.EventController;
import org.infoglue.cms.controllers.kernel.impl.simple.InterceptionPointController;
import org.infoglue.cms.controllers.kernel.impl.simple.LanguageController;
import org.infoglue.cms.controllers.kernel.impl.simple.RegistryController;
import org.infoglue.cms.controllers.kernel.impl.simple.ServiceBindingController;
import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeController;
import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeTypeDefinitionController;
import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeVersionController;
import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeVersionControllerProxy;
import org.infoglue.cms.entities.content.ContentVO;
import org.infoglue.cms.entities.content.ContentVersionVO;
import org.infoglue.cms.entities.management.AvailableServiceBindingVO;
import org.infoglue.cms.entities.management.InterceptionPointVO;
import org.infoglue.cms.entities.management.LanguageVO;
import org.infoglue.cms.entities.management.SiteNodeTypeDefinitionVO;
import org.infoglue.cms.entities.structure.QualifyerVO;
import org.infoglue.cms.entities.structure.ServiceBinding;
import org.infoglue.cms.entities.structure.ServiceBindingVO;
import org.infoglue.cms.entities.structure.SiteNode;
import org.infoglue.cms.entities.structure.SiteNodeVO;
import org.infoglue.cms.entities.structure.SiteNodeVersion;
import org.infoglue.cms.entities.structure.SiteNodeVersionVO;
import org.infoglue.cms.entities.workflow.EventVO;
import org.infoglue.cms.exception.Bug;
import org.infoglue.cms.exception.ConstraintException;
import org.infoglue.cms.exception.SystemException;
import org.infoglue.cms.util.CmsPropertyHandler;
import com.opensymphony.module.propertyset.PropertySet;
import com.opensymphony.module.propertyset.PropertySetManager;
/**
* This class represents the view of a siteNode to the user. In fact - it presents the
* view of the siteNode as well as the view of the latest siteNodeVersion as well.
*/
public class ViewSiteNodeAction extends InfoGlueAbstractAction
{
private final static Logger logger = Logger.getLogger(ViewSiteNodeAction.class.getName());
private static final long serialVersionUID = 1L;
private Integer unrefreshedSiteNodeId = new Integer(0);
private Integer changeTypeId = new Integer(0);
private Integer repositoryId = null;
private SiteNodeTypeDefinitionVO siteNodeTypeDefinitionVO;
private List availableServiceBindings = null;
private List serviceBindings = null;
private List referenceBeanList = new ArrayList();
private List availableLanguages = new ArrayList();
private List disabledLanguages = new ArrayList();
private List enabledLanguages = new ArrayList();
private List referencingBeanList = new ArrayList();
private SiteNodeVO siteNodeVO;
private SiteNodeVersionVO siteNodeVersionVO;
private String stay = null;
private String dest = "";
private VisualFormatter formatter = new VisualFormatter();
public ViewSiteNodeAction()
{
this(new SiteNodeVO(), new SiteNodeVersionVO());
}
public ViewSiteNodeAction(SiteNodeVO siteNodeVO, SiteNodeVersionVO siteNodeVersionVO)
{
logger.info("Construction ViewSiteNodeAction");
this.siteNodeVO = siteNodeVO;
this.siteNodeVersionVO = siteNodeVersionVO;
}
protected void initialize(Integer siteNodeId) throws Exception
{
this.siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId);
LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(this.siteNodeVO.getRepositoryId());
this.siteNodeVersionVO = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getACLatestActiveSiteNodeVersionVO(this.getInfoGluePrincipal(), siteNodeId);
ContentVersionVO latestActiveMetaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId());
logger.info("siteNodeVersionVO:" + siteNodeVersionVO);
logger.info("latestActiveMetaInfoContentVersionVO:" + latestActiveMetaInfoContentVersionVO);
if(this.siteNodeVersionVO == null || latestActiveMetaInfoContentVersionVO == null)
{
SiteNodeVersionVO latestSiteNodeVersion = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getLatestActiveSiteNodeVersionVO(siteNodeId);
logger.info("latestSiteNodeVersion:" + latestSiteNodeVersion);
if(latestSiteNodeVersion == null)
this.siteNodeVersionVO = SiteNodeVersionController.getController().getAndRepairLatestSiteNodeVersionVO(siteNodeId);
ContentVersionVO latestMetaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestContentVersionVO(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId());
logger.info("latestMetaInfoContentVersionVO:" + latestMetaInfoContentVersionVO);
if(latestMetaInfoContentVersionVO == null)
SiteNodeVersionController.getController().getAndRepairLatestContentVersionVO(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId());
}
logger.info("siteNodeVersionVO:" + siteNodeVersionVO);
this.repositoryId = this.siteNodeVO.getRepositoryId();
//SiteNodeControllerProxy.getController().getACSiteNodeVOWithId(this.getInfoGluePrincipal(), siteNodeId);
if(siteNodeVO.getSiteNodeTypeDefinitionId() != null)
{
this.siteNodeTypeDefinitionVO = SiteNodeTypeDefinitionController.getController().getSiteNodeTypeDefinitionVOWithId(siteNodeVO.getSiteNodeTypeDefinitionId());
if(siteNodeTypeDefinitionVO.getName().equalsIgnoreCase("HTMLPage"))
{
this.availableServiceBindings = SiteNodeTypeDefinitionController.getController().getAvailableServiceBindingVOList(siteNodeVO.getSiteNodeTypeDefinitionId());
this.serviceBindings = SiteNodeVersionController.getServiceBindningVOList(siteNodeVersionVO.getSiteNodeVersionId());
}
}
}
protected void initialize(Integer siteNodeId, Database db) throws Exception
{
this.siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId, db);
LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(this.siteNodeVO.getRepositoryId());
this.siteNodeVersionVO = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getACLatestActiveSiteNodeVersionVO(this.getInfoGluePrincipal(), siteNodeId, db);
ContentVersionVO latestActiveMetaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId());
logger.info("siteNodeVersionVO:" + siteNodeVersionVO);
logger.info("latestActiveMetaInfoContentVersionVO:" + latestActiveMetaInfoContentVersionVO);
if(this.siteNodeVersionVO == null || latestActiveMetaInfoContentVersionVO == null)
{
SiteNodeVersionVO latestSiteNodeVersion = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getLatestActiveSiteNodeVersionVO(db, siteNodeId);
logger.info("latestSiteNodeVersion:" + latestSiteNodeVersion);
if(latestSiteNodeVersion == null)
this.siteNodeVersionVO = SiteNodeVersionController.getController().getAndRepairLatestSiteNodeVersion(db, siteNodeId).getValueObject();
ContentVersionVO latestMetaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId());
logger.info("latestMetaInfoContentVersionVO:" + latestMetaInfoContentVersionVO);
if(latestMetaInfoContentVersionVO == null)
SiteNodeVersionController.getController().getAndRepairLatestContentVersionVO(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId());
}
repairBrokenProtection(db);
if(this.siteNodeVO.getMetaInfoContentId() == null || this.siteNodeVO.getMetaInfoContentId().intValue() == -1)
{
boolean hadMetaInfo = false;
AvailableServiceBindingVO availableServiceBindingVO = AvailableServiceBindingController.getController().getAvailableServiceBindingVOWithName("Meta information", db);
Collection serviceBindings = SiteNodeVersionController.getServiceBindningList(this.siteNodeVersionVO.getId(), db, true);
Iterator serviceBindingIterator = serviceBindings.iterator();
while(serviceBindingIterator.hasNext())
{
ServiceBinding serviceBinding = (ServiceBinding)serviceBindingIterator.next();
if(serviceBinding.getValueObject().getAvailableServiceBindingId().intValue() == availableServiceBindingVO.getAvailableServiceBindingId().intValue())
{
List boundContents = ContentController.getBoundContents(db, serviceBinding.getServiceBindingId());
if(boundContents.size() > 0)
{
ContentVO contentVO = (ContentVO)boundContents.get(0);
hadMetaInfo = true;
if(siteNodeVO.getMetaInfoContentId() == null || siteNodeVO.getMetaInfoContentId().intValue() == -1)
SiteNodeController.getController().setMetaInfoContentId(siteNodeVO.getId(), contentVO.getContentId(), db);
break;
}
}
}
if(!hadMetaInfo)
{
SiteNode siteNode = SiteNodeController.getController().getSiteNodeWithId(this.siteNodeVO.getId(), db);
SiteNodeController.getController().createSiteNodeMetaInfoContent(db, siteNode, siteNode.getRepository().getId(), this.getInfoGluePrincipal(), null).getValueObject();
}
}
this.repositoryId = this.siteNodeVO.getRepositoryId();
//SiteNodeControllerProxy.getController().getACSiteNodeVOWithId(this.getInfoGluePrincipal(), siteNodeId);
if(siteNodeVO.getSiteNodeTypeDefinitionId() != null)
{
this.siteNodeTypeDefinitionVO = SiteNodeTypeDefinitionController.getController().getSiteNodeTypeDefinitionVOWithId(siteNodeVO.getSiteNodeTypeDefinitionId(), db);
if(siteNodeTypeDefinitionVO.getName().equalsIgnoreCase("HTMLPage"))
{
this.availableServiceBindings = SiteNodeTypeDefinitionController.getController().getAvailableServiceBindingVOList(siteNodeVO.getSiteNodeTypeDefinitionId(), db);
if(siteNodeVersionVO != null)
this.serviceBindings = SiteNodeVersionController.getServiceBindningVOList(siteNodeVersionVO.getSiteNodeVersionId(), db);
}
}
}
public void repairBrokenProtection(Database db) throws SystemException, Bug
{
if(this.siteNodeVersionVO != null && this.siteNodeVersionVO.getIsProtected().intValue() == 1)
{
InterceptionPointVO ipReadVO = InterceptionPointController.getController().getInterceptionPointVOWithName("SiteNodeVersion.Read", db);
InterceptionPointVO ipWriteVO = InterceptionPointController.getController().getInterceptionPointVOWithName("SiteNodeVersion.Write", db);
if(ipReadVO != null && ipWriteVO != null)
{
List accessRightListRead = AccessRightController.getController().getAccessRightListOnlyReadOnly(ipReadVO.getId(), "" + this.siteNodeVersionVO.getId(), db);
List accessRightListWrite = AccessRightController.getController().getAccessRightListOnlyReadOnly(ipWriteVO.getId(), "" + this.siteNodeVersionVO.getId(), db);
if((accessRightListRead == null || accessRightListRead.size() == 0) && (accessRightListWrite == null || accessRightListWrite.size() == 0))
{
SiteNodeVersion sn = SiteNodeVersionController.getController().getSiteNodeVersionWithId(this.siteNodeVersionVO.getId(), db);
if(sn != null)
sn.setIsProtected(SiteNodeVersionVO.INHERITED);
}
}
}
}
protected void initializeSiteNodeCover(Integer siteNodeId) throws Exception
{
try
{
this.referenceBeanList = RegistryController.getController().getReferencingObjectsForSiteNode(siteNodeId, 100);
this.referencingBeanList = RegistryController.getController().getReferencedObjects(SiteNodeVersion.class.getName(), siteNodeVersionVO.getSiteNodeVersionId().toString());
logger.info("referenceBeanList:" + referenceBeanList.size());
logger.info("referencingBeanList:" + referencingBeanList.size());
}
catch(Exception e)
{
e.printStackTrace();
}
this.availableLanguages = LanguageController.getController().getLanguageVOList(this.repositoryId);
Map args = new HashMap();
args.put("globalKey", "infoglue");
PropertySet ps = PropertySetManager.getInstance("jdbc", args);
String disabledLanguagesString = ps.getString("siteNode_" + siteNodeId + "_disabledLanguages");
logger.info("disabledLanguagesString:" + disabledLanguagesString);
if(disabledLanguagesString != null && !disabledLanguagesString.equalsIgnoreCase(""))
{
String[] disabledLanguagesStringArray = disabledLanguagesString.split(",");
for(int i=0; i<disabledLanguagesStringArray.length; i++)
{
try
{
LanguageVO languageVO = LanguageController.getController().getLanguageVOWithId(new Integer(disabledLanguagesStringArray[i]));
logger.info("Adding languageVO to disabledLanguages:" + languageVO.getName());
this.disabledLanguages.add(languageVO);
}
catch(Exception e)
{
logger.warn("An error occurred when we tried to get disabled language:" + e.getMessage(), e);
}
}
}
String enabledLanguagesString = ps.getString("siteNode_" + siteNodeId + "_enabledLanguages");
logger.info("enabledLanguagesString:" + enabledLanguagesString);
if(enabledLanguagesString != null && !enabledLanguagesString.equalsIgnoreCase(""))
{
String[] enabledLanguagesStringArray = enabledLanguagesString.split(",");
for(int i=0; i<enabledLanguagesStringArray.length; i++)
{
try
{
LanguageVO languageVO = LanguageController.getController().getLanguageVOWithId(new Integer(enabledLanguagesStringArray[i]));
logger.info("Adding languageVO to enabledLanguages:" + languageVO.getName());
this.enabledLanguages.add(languageVO);
}
catch(Exception e)
{
logger.warn("An error occurred when we tried to get enabled language:" + e.getMessage(), e);
}
}
}
}
protected void initializeSiteNodeCover(Integer siteNodeId, Database db) throws Exception
{
try
{
this.referenceBeanList = RegistryController.getController().getReferencingObjectsForSiteNode(siteNodeId, 100, db);
this.referencingBeanList = RegistryController.getController().getReferencedObjects(SiteNodeVersion.class.getName(), siteNodeVersionVO.getSiteNodeVersionId().toString(), db);
logger.info("referenceBeanList:" + referenceBeanList.size());
logger.info("referencingBeanList:" + referencingBeanList.size());
}
catch(Exception e)
{
logger.error("Error initializing page cover:" + e.getMessage(), e);
}
this.availableLanguages = LanguageController.getController().getLanguageVOList(this.repositoryId, db);
Map args = new HashMap();
args.put("globalKey", "infoglue");
PropertySet ps = PropertySetManager.getInstance("jdbc", args);
String disabledLanguagesString = ps.getString("siteNode_" + siteNodeId + "_disabledLanguages");
logger.info("disabledLanguagesString:" + disabledLanguagesString);
if(disabledLanguagesString != null && !disabledLanguagesString.equalsIgnoreCase(""))
{
String[] disabledLanguagesStringArray = disabledLanguagesString.split(",");
for(int i=0; i<disabledLanguagesStringArray.length; i++)
{
try
{
LanguageVO languageVO = LanguageController.getController().getLanguageVOWithId(new Integer(disabledLanguagesStringArray[i]), db);
logger.info("Adding languageVO to disabledLanguages:" + languageVO.getName());
this.disabledLanguages.add(languageVO);
}
catch(Exception e)
{
logger.warn("An error occurred when we tried to get disabled language:" + e.getMessage(), e);
}
}
}
String enabledLanguagesString = ps.getString("siteNode_" + siteNodeId + "_enabledLanguages");
logger.info("enabledLanguagesString:" + enabledLanguagesString);
if(enabledLanguagesString != null && !enabledLanguagesString.equalsIgnoreCase(""))
{
String[] enabledLanguagesStringArray = enabledLanguagesString.split(",");
for(int i=0; i<enabledLanguagesStringArray.length; i++)
{
try
{
LanguageVO languageVO = LanguageController.getController().getLanguageVOWithId(new Integer(enabledLanguagesStringArray[i]), db);
logger.info("Adding languageVO to enabledLanguages:" + languageVO.getName());
this.enabledLanguages.add(languageVO);
}
catch(Exception e)
{
logger.warn("An error occurred when we tried to get enabled language:" + e.getMessage(), e);
}
}
}
}
/*
protected void initialize(Integer siteNodeId) throws Exception
{
this.siteNodeVO = SiteNodeController.getSiteNodeVOWithId(siteNodeId);
this.siteNodeVersionVO = SiteNodeVersionController.getLatestSiteNodeVersionVO(siteNodeId);
if(siteNodeVO.getSiteNodeTypeDefinitionId() != null)
{
this.siteNodeTypeDefinitionVO = SiteNodeTypeDefinitionController.getSiteNodeTypeDefinitionVOWithId(siteNodeVO.getSiteNodeTypeDefinitionId());
this.availableServiceBindings = SiteNodeTypeDefinitionController.getAvailableServiceBindingVOList(siteNodeVO.getSiteNodeTypeDefinitionId());
this.serviceBindings = SiteNodeVersionController.getServiceBindningVOList(siteNodeVersionVO.getSiteNodeVersionId());
}
}
*/
public String doExecute() throws Exception
{
String result = "success";
Database db = CastorDatabaseService.getDatabase();
beginTransaction(db);
try
{
if(getSiteNodeId() != null)
{
this.initialize(getSiteNodeId(), db);
//if((this.stay == null || !this.stay.equalsIgnoreCase("true")) && this.siteNodeVO.getSiteNodeTypeDefinitionId() != null && this.siteNodeVersionVO.getStateId().intValue() == SiteNodeVersionVO.WORKING_STATE.intValue() && getShowComponentsFirst().equalsIgnoreCase("true"))
if((this.stay == null || !this.stay.equalsIgnoreCase("true")) && this.siteNodeVO.getSiteNodeTypeDefinitionId() != null && getShowComponentsFirst().equalsIgnoreCase("true"))
{
boolean isMetaInfoInWorkingState = false;
LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(this.repositoryId, db);
Integer languageId = masterLanguageVO.getLanguageId();
AvailableServiceBindingVO availableServiceBindingVO = AvailableServiceBindingController.getController().getAvailableServiceBindingVOWithName("Meta information");
Integer metaInfoAvailableServiceBindingId = null;
if(availableServiceBindingVO != null)
metaInfoAvailableServiceBindingId = availableServiceBindingVO.getAvailableServiceBindingId();
Integer metaInfoContentId = null;
ContentVersionVO metaInfoContentVersionVO = null;
if(this.siteNodeVersionVO != null)
{
if(this.siteNodeVO != null && this.siteNodeVO.getMetaInfoContentId() != null)
{
metaInfoContentId = this.siteNodeVO.getMetaInfoContentId();
metaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(metaInfoContentId, languageId, db);
if(metaInfoContentVersionVO != null && metaInfoContentVersionVO.getStateId().equals(ContentVersionVO.WORKING_STATE))
isMetaInfoInWorkingState = true;
}
else
{
List serviceBindings = SiteNodeVersionController.getServiceBindningVOList(this.siteNodeVersionVO.getId(), db);
Iterator serviceBindingIterator = serviceBindings.iterator();
while(serviceBindingIterator.hasNext())
{
ServiceBindingVO serviceBindingVO = (ServiceBindingVO)serviceBindingIterator.next();
if(serviceBindingVO.getAvailableServiceBindingId().intValue() == metaInfoAvailableServiceBindingId.intValue())
{
List boundContents = ContentController.getInTransactionBoundContents(db, serviceBindingVO.getServiceBindingId());
if(boundContents.size() > 0)
{
ContentVO contentVO = (ContentVO)boundContents.get(0);
metaInfoContentId = contentVO.getId();
metaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), languageId, db);
if(metaInfoContentVersionVO != null && metaInfoContentVersionVO.getStateId().equals(ContentVersionVO.WORKING_STATE))
isMetaInfoInWorkingState = true;
break;
}
}
}
}
}
if(this.siteNodeVO.getMetaInfoContentId() == null || this.siteNodeVO.getMetaInfoContentId().intValue() == -1)
SiteNodeController.getController().setMetaInfoContentId(this.siteNodeVO.getId(), metaInfoContentId, db);
if(this.siteNodeVersionVO != null && this.siteNodeVersionVO.getStateId().equals(SiteNodeVersionVO.WORKING_STATE) && !isMetaInfoInWorkingState)
{
if(metaInfoContentVersionVO != null)
metaInfoContentVersionVO = ContentStateController.changeState(metaInfoContentVersionVO.getId(), ContentVersionVO.WORKING_STATE, "Automatic", true, null, this.getInfoGluePrincipal(), null, db, new ArrayList()).getValueObject();
isMetaInfoInWorkingState = true;
}
//if(isMetaInfoInWorkingState)
if(true)
{
String url = getComponentRendererUrl() + getComponentRendererAction() + "?siteNodeId=" + getSiteNodeId() + "&languageId=" + masterLanguageVO.getId() + "&contentId=-1&cmsUserName=" + formatter.encodeURI(this.getInfoGluePrincipal().getName());
url = this.getResponse().encodeURL(url);
this.getResponse().sendRedirect(url);
result = NONE;
}
else
result = "success";
//if(this.repositoryId == null)
// this.repositoryId = contentVO.getRepositoryId();
//this.languageId = getMasterLanguageVO().getId();
//return "viewVersion";
}
else
{
this.initializeSiteNodeCover(getSiteNodeId(), db);
result = "success";
}
}
else
{
result = "blank";
}
commitTransaction(db);
}
catch(ConstraintException ce)
{
logger.info("An error occurred so we should not complete the transaction:" + ce, ce);
rollbackTransaction(db);
throw ce;
}
catch(Exception e)
{
logger.error("An error occurred so we should not complete the transaction:" + e, e);
rollbackTransaction(db);
throw new SystemException(e.getMessage());
}
return result;
}
public String doV3() throws Exception
{
String result = "successV3";
Database db = CastorDatabaseService.getDatabase();
beginTransaction(db);
try
{
if(getSiteNodeId() != null)
{
this.initialize(getSiteNodeId(), db);
if((this.stay == null || !this.stay.equalsIgnoreCase("true")) && this.siteNodeVO.getSiteNodeTypeDefinitionId() != null && getShowComponentsFirst().equalsIgnoreCase("true"))
{
boolean isMetaInfoInWorkingState = false;
LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(this.repositoryId, db);
Integer languageId = masterLanguageVO.getLanguageId();
AvailableServiceBindingVO availableServiceBindingVO = AvailableServiceBindingController.getController().getAvailableServiceBindingVOWithName("Meta information");
Integer metaInfoAvailableServiceBindingId = null;
if(availableServiceBindingVO != null)
metaInfoAvailableServiceBindingId = availableServiceBindingVO.getAvailableServiceBindingId();
Integer metaInfoContentId = null;
ContentVersionVO metaInfoContentVersionVO = null;
if(this.siteNodeVersionVO != null)
{
if(this.siteNodeVO != null && this.siteNodeVO.getMetaInfoContentId() != null)
{
metaInfoContentId = this.siteNodeVO.getMetaInfoContentId();
metaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(metaInfoContentId, languageId, db);
if(metaInfoContentVersionVO != null && metaInfoContentVersionVO.getStateId().equals(ContentVersionVO.WORKING_STATE))
isMetaInfoInWorkingState = true;
}
else
{
List serviceBindings = SiteNodeVersionController.getServiceBindningVOList(this.siteNodeVersionVO.getId(), db);
Iterator serviceBindingIterator = serviceBindings.iterator();
while(serviceBindingIterator.hasNext())
{
ServiceBindingVO serviceBindingVO = (ServiceBindingVO)serviceBindingIterator.next();
if(serviceBindingVO.getAvailableServiceBindingId().intValue() == metaInfoAvailableServiceBindingId.intValue())
{
List boundContents = ContentController.getInTransactionBoundContents(db, serviceBindingVO.getServiceBindingId());
if(boundContents.size() > 0)
{
ContentVO contentVO = (ContentVO)boundContents.get(0);
metaInfoContentId = contentVO.getId();
metaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), languageId, db);
if(metaInfoContentVersionVO != null && metaInfoContentVersionVO.getStateId().equals(ContentVersionVO.WORKING_STATE))
isMetaInfoInWorkingState = true;
break;
}
}
}
}
}
if(this.siteNodeVO.getMetaInfoContentId() == null || this.siteNodeVO.getMetaInfoContentId().intValue() == -1)
SiteNodeController.getController().setMetaInfoContentId(this.siteNodeVO.getId(), metaInfoContentId, db);
if(this.siteNodeVersionVO != null && this.siteNodeVersionVO.getStateId().equals(SiteNodeVersionVO.WORKING_STATE) && !isMetaInfoInWorkingState)
{
if(metaInfoContentVersionVO != null)
metaInfoContentVersionVO = ContentStateController.changeState(metaInfoContentVersionVO.getId(), ContentVersionVO.WORKING_STATE, "Automatic", true, null, this.getInfoGluePrincipal(), null, db, new ArrayList()).getValueObject();
isMetaInfoInWorkingState = true;
}
//if(isMetaInfoInWorkingState)
if(true)
{
String url = getComponentRendererUrl() + getComponentRendererAction() + "?siteNodeId=" + getSiteNodeId() + "&languageId=" + masterLanguageVO.getId() + "&contentId=-1&cmsUserName=" + formatter.encodeURI(this.getInfoGluePrincipal().getName());
url = this.getResponse().encodeURL(url);
this.getResponse().sendRedirect(url);
result = NONE;
}
else
result = "successV3";
//if(this.repositoryId == null)
// this.repositoryId = contentVO.getRepositoryId();
//this.languageId = getMasterLanguageVO().getId();
//return "viewVersion";
}
else
{
this.initializeSiteNodeCover(getSiteNodeId(), db);
if(this.siteNodeVO.getSiteNodeTypeDefinitionId() == null)
result = "inputSiteNodeTypeDefinition";
else
result = "successV3";
}
}
else
{
result = "blank";
}
commitTransaction(db);
}
catch(ConstraintException ce)
{
logger.info("An error occurred so we should not complete the transaction:" + ce, ce);
rollbackTransaction(db);
throw ce;
}
catch(Exception e)
{
logger.error("An error occurred so we should not complete the transaction:" + e, e);
rollbackTransaction(db);
throw new SystemException(e.getMessage());
}
catch (Throwable e)
{
logger.error("Throwable:" + e);
}
return result;
}
public String doRefreshAndRedirect() throws Exception
{
String result = "successRefreshAndRedirect";
Database db = CastorDatabaseService.getDatabase();
beginTransaction(db);
try
{
if(getSiteNodeId() != null)
{
this.initialize(getSiteNodeId(), db);
this.initializeSiteNodeCover(getSiteNodeId(), db);
result = "successRefreshAndRedirect";
}
else
{
result = "blank";
}
commitTransaction(db);
}
catch(ConstraintException ce)
{
logger.info("An error occurred so we should not complete the transaction:" + ce, ce);
rollbackTransaction(db);
throw ce;
}
catch(Exception e)
{
logger.error("An error occurred so we should not complete the transaction:" + e, e);
rollbackTransaction(db);
throw new SystemException(e.getMessage());
}
return result;
}
public String doChangeState() throws Exception
{
logger.info("Gonna change state with comment:" + this.siteNodeVersionVO.getVersionComment());
Database db = CastorDatabaseService.getDatabase();
beginTransaction(db);
try
{
SiteNodeVersionController.getController().updateStateId(this.siteNodeVersionVO.getSiteNodeVersionId(), getStateId(), this.siteNodeVersionVO.getVersionComment(), this.getInfoGluePrincipal(), this.getSiteNodeId());
this.initialize(getSiteNodeId(), db);
commitTransaction(db);
}
catch(Exception e)
{
logger.error("An error occurred so we should not complete the transaction:" + e, e);
rollbackTransaction(db);
throw new SystemException(e.getMessage());
}
return "success";
}
public String doCommentVersion() throws Exception
{
return "commentVersion";
}
public String doChooseSiteNodeTypeDefinition() throws Exception
{
this.siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(getSiteNodeId());
return "chooseSiteNodeTypeDefinition";
}
public java.lang.Integer getSiteNodeId()
{
return this.siteNodeVO.getSiteNodeId();
}
public boolean getIsSiteNodeTypeDefinitionAssigned()
{
return (this.siteNodeVO.getSiteNodeTypeDefinitionId() != null) ? true : false;
}
public void setSiteNodeId(java.lang.Integer siteNodeId)
{
this.siteNodeVO.setSiteNodeId(siteNodeId);
}
public java.lang.Integer getRepositoryId()
{
if(this.repositoryId != null)
return this.repositoryId;
else
return this.siteNodeVO.getRepositoryId();
}
public void setRepositoryId(java.lang.Integer repositoryId)
{
this.repositoryId = repositoryId;
}
public java.lang.Integer getUnrefreshedSiteNodeId()
{
return this.unrefreshedSiteNodeId;
}
public void setUnrefreshedSiteNodeId(java.lang.Integer unrefreshedSiteNodeId)
{
this.unrefreshedSiteNodeId = unrefreshedSiteNodeId;
}
public java.lang.Integer getChangeTypeId()
{
return this.changeTypeId;
}
public void setChangeTypeId(java.lang.Integer changeTypeId)
{
this.changeTypeId = changeTypeId;
}
public String getName()
{
return this.siteNodeVO.getName();
}
public String getPublishDateTime()
{
return new VisualFormatter().formatDate(this.siteNodeVO.getPublishDateTime(), "yyyy-MM-dd HH:mm");
}
public String getExpireDateTime()
{
return new VisualFormatter().formatDate(this.siteNodeVO.getExpireDateTime(), "yyyy-MM-dd HH:mm");
}
public long getPublishDateTimeAsLong()
{
return this.siteNodeVO.getPublishDateTime().getTime();
}
public long getExpireDateTimeAsLong()
{
return this.siteNodeVO.getExpireDateTime().getTime();
}
public Boolean getIsBranch()
{
return this.siteNodeVO.getIsBranch();
}
public String getContentType()
{
return this.siteNodeVersionVO.getContentType();
}
public void setContentType(String contentType)
{
this.siteNodeVersionVO.setContentType(contentType);
}
public String getPageCacheKey()
{
return this.siteNodeVersionVO.getPageCacheKey();
}
public void setPageCacheKey(String pageCacheKey)
{
this.siteNodeVersionVO.setPageCacheKey(pageCacheKey);
}
public String getPageCacheTimeout()
{
return this.siteNodeVersionVO.getPageCacheTimeout();
}
public void setPageCacheTimeout(String pageCacheTimeout)
{
this.siteNodeVersionVO.setPageCacheTimeout(pageCacheTimeout);
}
public Integer getDisableEditOnSight()
{
return this.siteNodeVersionVO.getDisableEditOnSight();
}
public void setDisableEditOnSight(Integer disableEditOnSight)
{
this.siteNodeVersionVO.setDisableEditOnSight(disableEditOnSight);
}
public Integer getDisableForceIdentityCheck()
{
return this.siteNodeVersionVO.getDisableForceIdentityCheck();
}
public void setDisableForceIdentityCheck(Integer disableForceIdentityCheck)
{
this.siteNodeVersionVO.setDisableForceIdentityCheck(disableForceIdentityCheck);
}
public Integer getForceProtocolChange()
{
return this.siteNodeVersionVO.getForceProtocolChange();
}
public void setForceProtocolChange(Integer forceProtocolChange)
{
this.siteNodeVersionVO.setForceProtocolChange(forceProtocolChange);
}
public Integer getDisableLanguages()
{
return this.siteNodeVersionVO.getDisableLanguages();
}
public void setDisableLanguages(Integer disableLanguages)
{
this.siteNodeVersionVO.setDisableLanguages(disableLanguages);
}
public Integer getDisablePageCache()
{
return this.siteNodeVersionVO.getDisablePageCache();
}
public void setDisablePageCache(Integer disablePageCache)
{
this.siteNodeVersionVO.setDisablePageCache(disablePageCache);
}
public Integer getIsProtected()
{
return this.siteNodeVersionVO.getIsProtected();
}
public void setIsProtected(Integer isProtected)
{
this.siteNodeVersionVO.setIsProtected(isProtected);
}
public void setStateId(Integer stateId)
{
this.siteNodeVersionVO.setStateId(stateId);
}
public Integer getStateId()
{
return this.siteNodeVersionVO.getStateId();
}
public SiteNodeVersionVO getSiteNodeVersion()
{
return this.siteNodeVersionVO;
}
public Integer getSiteNodeVersionId()
{
return this.siteNodeVersionVO.getSiteNodeVersionId();
}
public void setSiteNodeVersionId(Integer siteNodeVersionId)
{
this.siteNodeVersionVO.setSiteNodeVersionId(siteNodeVersionId);
}
public void setVersionComment(String versionComment)
{
this.siteNodeVersionVO.setVersionComment(versionComment);
}
public String getVersionComment()
{
return this.siteNodeVersionVO.getVersionComment();
}
public SiteNodeTypeDefinitionVO getSiteNodeTypeDefinition()
{
return this.siteNodeTypeDefinitionVO;
}
public List getAvailableServiceBindings()
{
return this.availableServiceBindings;
}
public String getShowComponentsFirst()
{
return CmsPropertyHandler.getShowComponentsFirst();
}
/**
* This method sorts a list of available service bindings on the name of the binding.
*/
public List getSortedAvailableServiceBindings()
{
List sortedAvailableServiceBindings = new ArrayList();
Iterator iterator = this.availableServiceBindings.iterator();
while(iterator.hasNext())
{
AvailableServiceBindingVO availableServiceBinding = (AvailableServiceBindingVO)iterator.next();
int index = 0;
Iterator sortedListIterator = sortedAvailableServiceBindings.iterator();
while(sortedListIterator.hasNext())
{
AvailableServiceBindingVO sortedAvailableServiceBinding = (AvailableServiceBindingVO)sortedListIterator.next();
String currentAttribute = availableServiceBinding.getName();
String sortedAttribute = sortedAvailableServiceBinding.getName();
if(currentAttribute != null && sortedAttribute != null && currentAttribute.compareTo(sortedAttribute) < 0)
{
break;
}
index++;
}
sortedAvailableServiceBindings.add(index, availableServiceBinding);
}
return sortedAvailableServiceBindings;
}
/**
* This method sorts a list of available service bindings on the name of the binding.
*/
public List getSortedAvailableContentServiceBindings()
{
List sortedAvailableContentServiceBindings = new ArrayList();
Iterator sortedListIterator = getSortedAvailableServiceBindings().iterator();
while(sortedListIterator.hasNext())
{
AvailableServiceBindingVO sortedAvailableServiceBinding = (AvailableServiceBindingVO)sortedListIterator.next();
if(sortedAvailableServiceBinding.getVisualizationAction().indexOf("Structure") == -1)
sortedAvailableContentServiceBindings.add(sortedAvailableServiceBinding);
}
return sortedAvailableContentServiceBindings;
}
/**
* This method sorts a list of available service bindings on the name of the binding.
*/
public List getSortedAvailableStructureServiceBindings()
{
List sortedAvailableStructureServiceBindings = new ArrayList();
Iterator sortedListIterator = getSortedAvailableServiceBindings().iterator();
while(sortedListIterator.hasNext())
{
AvailableServiceBindingVO sortedAvailableServiceBinding = (AvailableServiceBindingVO)sortedListIterator.next();
if(sortedAvailableServiceBinding.getVisualizationAction().indexOf("Structure") > -1)
sortedAvailableStructureServiceBindings.add(sortedAvailableServiceBinding);
}
return sortedAvailableStructureServiceBindings;
}
public List getServiceBindings()
{
return this.serviceBindings;
}
public String getStateDescription(Integer siteNodeId, Integer languageId)
{
String stateDescription = "Not created";
/*
try
{
SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getLatestSiteNodeVersionVO(siteNodeId, languageId);
Integer stateId = siteNodeVersionVO.getStateId();
if(stateId.intValue() == 0)
stateDescription = "Working";
else if(stateId.intValue() == 2)
stateDescription = "Publish";
}
catch(Exception e)
{
//e.printStackTrace();
}
*/
return stateDescription;
}
/**
* This method fetches a description of the qualifyer.
*/
public String getQualifyerDescription(Integer serviceBindingId) throws Exception
{
String qualifyerDescription = "";
List qualifyers = ServiceBindingController.getQualifyerVOList(serviceBindingId);
Iterator i = qualifyers.iterator();
while(i.hasNext())
{
QualifyerVO qualifyerVO = (QualifyerVO)i.next();
if(!qualifyerDescription.equalsIgnoreCase(""))
qualifyerDescription += ",";
qualifyerDescription += qualifyerVO.getName() + "=" + qualifyerVO.getValue();
}
return qualifyerDescription;
}
public List getListPreparedQualifyers(Integer serviceBindingId) throws Exception
{
List qualifyers = ServiceBindingController.getQualifyerVOList(serviceBindingId);
Iterator i = qualifyers.iterator();
while(i.hasNext())
{
QualifyerVO qualifyerVO = (QualifyerVO)i.next();
if(qualifyerVO.getName().equalsIgnoreCase("contentid"))
{
try {
ContentVO contentVO = ContentControllerProxy.getController().getACContentVOWithId(this.getInfoGluePrincipal(), new Integer(qualifyerVO.getValue()));
qualifyerVO.setPath(contentVO.getName());
}
catch(Exception e)
{
}
}
}
return qualifyers;
}
/**
* This method fetches the list of SiteNodeTypeDefinitions
*/
public List getSiteNodeTypeDefinitions() throws Exception
{
return SiteNodeTypeDefinitionController.getController().getSortedSiteNodeTypeDefinitionVOList();
}
public EventVO getSiteNodeVersionEvent(Integer siteNodeVersionId)
{
EventVO eventVO = null;
try
{
List events = EventController.getEventVOListForEntity(SiteNodeVersion.class.getName(), siteNodeVersionId);
if(events != null && events.size() > 0)
eventVO = (EventVO)events.get(0);
}
catch(Exception e)
{
logger.error("An error occurred when we tried to get any events for this version:" + e.getMessage(), e);
}
return eventVO;
}
public EventVO getSiteNodeEvent(Integer siteNodeId)
{
EventVO eventVO = null;
try
{
List events = EventController.getEventVOListForEntity(SiteNode.class.getName(), siteNodeId);
if(events != null && events.size() > 0)
eventVO = (EventVO)events.get(0);
}
catch(Exception e)
{
logger.error("An error occurred when we tried to get any events for this siteNode:" + e.getMessage(), e);
}
return eventVO;
}
public Boolean getUseAccessBasedProtocolRedirects()
{
String useAccessBasedProtocolRedirects = CmsPropertyHandler.getUseAccessBasedProtocolRedirects();
if(useAccessBasedProtocolRedirects.equalsIgnoreCase("true"))
return true;
else
return false;
}
public SiteNodeVersionVO getSiteNodeVersionVO()
{
return siteNodeVersionVO;
}
public String getStay()
{
return stay;
}
public void setStay(String stay)
{
this.stay = stay;
}
public String getDest()
{
return dest;
}
public List getReferenceBeanList()
{
return referenceBeanList;
}
public List getAvailableLanguages()
{
return availableLanguages;
}
public List getDisabledLanguages()
{
return disabledLanguages;
}
public List getEnabledLanguages()
{
return enabledLanguages;
}
public List getReferencingBeanList()
{
return referencingBeanList;
}
}
| [
"mattias.bogeblad@gmail.com"
] | mattias.bogeblad@gmail.com |
118302c5c02e622f6d3f6ea53abc19a5d8056213 | ef3632a70d37cfa967dffb3ddfda37ec556d731c | /aws-java-sdk-resiliencehub/src/main/java/com/amazonaws/services/resiliencehub/model/transform/AppComponentJsonUnmarshaller.java | 691a952be056f903b185a2dc35da35c1ad22df55 | [
"Apache-2.0"
] | permissive | ShermanMarshall/aws-sdk-java | 5f564b45523d7f71948599e8e19b5119f9a0c464 | 482e4efb50586e72190f1de4e495d0fc69d9816a | refs/heads/master | 2023-01-23T16:35:51.543774 | 2023-01-19T03:21:46 | 2023-01-19T03:21:46 | 134,658,521 | 0 | 0 | Apache-2.0 | 2019-06-12T21:46:58 | 2018-05-24T03:54:38 | Java | UTF-8 | Java | false | false | 2,931 | java | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.resiliencehub.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.resiliencehub.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* AppComponent JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AppComponentJsonUnmarshaller implements Unmarshaller<AppComponent, JsonUnmarshallerContext> {
public AppComponent unmarshall(JsonUnmarshallerContext context) throws Exception {
AppComponent appComponent = new AppComponent();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("name", targetDepth)) {
context.nextToken();
appComponent.setName(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("type", targetDepth)) {
context.nextToken();
appComponent.setType(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return appComponent;
}
private static AppComponentJsonUnmarshaller instance;
public static AppComponentJsonUnmarshaller getInstance() {
if (instance == null)
instance = new AppComponentJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
7a42586fae5bcf2887f108347a4ea0e23140d5b2 | 132f2a39200f11e07bbbac779fc70515403b2f20 | /src/main/java/com/casper/reactive/model/EmployeeEvents.java | 5b675ed73b5e81d0d1c21a0e558680ddf7b181a3 | [] | no_license | kulkarni2u/reactive-demo | 6bbaba114e5cacc7888b2359eea1eb4973802c2d | 20ab0af30ae6c9fdc9eabffdf481d6083f8943ff | refs/heads/master | 2021-04-12T08:29:23.364090 | 2018-03-18T06:54:37 | 2018-03-18T06:54:37 | 126,291,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package com.casper.reactive.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.Date;
@Data
@AllArgsConstructor
public class EmployeeEvents {
private Employee employee;
private Date date;
}
| [
"kulkarni2u@gmail.com"
] | kulkarni2u@gmail.com |
e6d09cf4ce8754568be83232fd68b68ba2b50e4a | 58db8aefc97cd28898f2c2fbbfca446da33cd74f | /GST/app/src/main/java/com/example/addy/gst/Goods5.java | e31a4a6042d654a29295db1e63f870c22b07caf5 | [] | no_license | AdityaKadam1994/GST-App | da7ec1bb42db652182f29b6cc9dd366cdf8052ae | ede153d8f3df49071d3b16538ad46b63cfd1d492 | refs/heads/master | 2021-05-07T16:32:24.279808 | 2017-11-05T16:29:39 | 2017-11-05T16:29:39 | 108,576,888 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,807 | java | package com.example.addy.gst;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;
/**
* Created by Aditya on 11/5/2017.
*/
public class Goods5 extends AppCompatActivity {
private ListView goodlv;
String [] type ={"goods","goods","goods","goods","goods","goods","goods","goods","good","good","good","good","good","good","good","goods","goods","goods","goods","goods","goods","goods"};
String [] description={"Fish, frozen, excluding fish fillets and other fish meat of heading 0304","Fish fillets and other fish meat (whether or not minced), frozen","Fish, dried, salted or in brine; smoked fish, whether or not cooked before or during the smoking process; flours, meals and pellets of fish, fit for human consumption",
"Crustaceans, whether in shell or not, frozen, dried, salted or in brine; crustaceans, in shell, cooked by steaming or by boiling in water, frozen, dried, salted or in brine; flours, meals and pellets of crustaceans, fit for human consumption","Molluscs, whether in shell or not, frozen, dried, salted or in brine; aquatic invertebrates" +
" other than crustaceans and molluscs, frozen, dried, salted or in brine; flours, meals and pellets of aquatic invertebra other than crustaceans, fit for human consumption","Aquatic invertebrates other than crustaceans and molluscs, frozen, dried, salted or in brine; smoked aquatic invertebrates other than crustaceans and molluscs," +
" whether or not cooked before or during the smoking process: flours, meals and pellets of aquatic invertebrates other than crustaceans and molluscs, fit for human consumption","Ultra High Temperature (UHT) milk","Milk and cream, concentrated or containing added sugar or other sweetening matter, including skimmed milk powder, milk food for babies [other than condensed milk]",
"Cream, yogurt, kephir and other fermented or acidified milk and cream, whether or not concentrated or containing added sugar or other sweetening matter or flavoured or containing added fruit, nuts or cocoa","Whey, whether or not concentrated or containing added sugar or other sweetening matter; products consisting of natural milk constituents, whether or not containing added sugar" +
" or other sweetening matter, not elsewhere specified or included","Chena or paneer put up in unit container and bearing a registered brand name","Birds' eggs, not in shell, and egg yolks, fresh, dried, cooked by steaming or by boiling in water, moulded, frozen or otherwise preserved, whether or not containing added sugar or other sweetening matter.",
"Natural honey, put up in unit container and bearing a registered brand name","Edible products of animal origin, not elsewhere specified or included","Pigs', hogs' or boars' bristles and hair; badger hair and other brush making hair; waste of such bristles or hair.","Guts, bladders and stomachs of animals (other than fish), whole and pieces thereof, fresh, chilled, frozen, salted, in brine, dried or smoked.",
"Skins and other parts of birds, with their feathers or down, feathers and parts of feathers (whether or not with trimmed edges) and down, not further worked than cleaned, disinfected or treated for preservation; powder and waste of feathers or parts of feathers","Ivory, tortoise-shell, whalebone and whalebone hair, horns, unworked or simply prepared but not cut to shape; powder and waste of these products.",
"Coral and similar materials, unworked or simply prepared but not otherwise worked; shells of molluscs, crustaceans or echinoderms and cuttle-bone, unworked or simply prepared but not cut to shape, powder and waste thereof.","Ambergris, castoreum, civet and musk; cantharides; bile, whether or not dried; glands and other animal products used in the preparation of pharmaceutical products, fresh, chilled, frozen or otherwise provisionally preserved.",
"Animal products not elsewhere specified or included; dead animals of Chapter 1 or 3, unfit for human consumption, other than semen including frozen semen.","Herb, bark, dry plant, dry root, commonly known as jaribooti and dry flower"};
String[] rate={"5","5","5","5","5","5","5","5","5","5","5","5","5","5","5","5","5","5","5","5","5","5"};
String[]hsn={"303","304","305","306","307","308","401","402","403","404","406","408","409","410","502","504","505","0507[Except 050790]","508","510","511","7"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_goods0);
goodlv=(ListView)findViewById(R.id.goods0lv);
final MyAdapter3 myAdapter3= new MyAdapter3(Goods5.this,type,description,rate,hsn);
goodlv.setAdapter(myAdapter3);
}
}
| [
"addy.7kad@gmail.com"
] | addy.7kad@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.