blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
be051ba37e5026487d6b100345b83abc5b868d3d
|
7ac2410746428cee3cc754664c7f940ce5ab1dd5
|
/Protein_Annotation_Base/src/org/yeastrc/paws/base/client_server_shared_objects/GetDataForTrackingIdServerResponse.java
|
7bfe51229173b74c81c9598ce9b57e66d50035fd
|
[
"Apache-2.0"
] |
permissive
|
yeastrc/paws_Protein_Annotation_Web_Services
|
9e5b506d8d06db33834c59c0aafaf1c92bf9cfc9
|
de36eb2df5dcadc06b697f73384cc8d114aeffe3
|
refs/heads/master
| 2021-01-01T15:51:18.982809 | 2017-05-25T21:53:33 | 2017-05-25T21:53:33 | 42,256,356 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,004 |
java
|
package org.yeastrc.paws.base.client_server_shared_objects;
/**
* Used for transfering Data from server to Jobcenter modules for processing a request
*
*/
public class GetDataForTrackingIdServerResponse {
private boolean success;
private boolean noRecordForTrackingId;
private boolean dataAlreadyProcessed;
private String sequence;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public boolean isNoRecordForTrackingId() {
return noRecordForTrackingId;
}
public void setNoRecordForTrackingId(boolean noRecordForTrackingId) {
this.noRecordForTrackingId = noRecordForTrackingId;
}
public boolean isDataAlreadyProcessed() {
return dataAlreadyProcessed;
}
public void setDataAlreadyProcessed(boolean dataAlreadyProcessed) {
this.dataAlreadyProcessed = dataAlreadyProcessed;
}
public String getSequence() {
return sequence;
}
public void setSequence(String sequence) {
this.sequence = sequence;
}
}
|
[
"[email protected]"
] | |
e9bb40997690ca32e52b01ea305df3098aa4370a
|
f0d0631e221382c8a7d48c8bed6acc4efe0bfd2d
|
/JavaSource/org/unitime/timetable/model/UserData.java
|
302b57f5c2cd7003a6a086ca9682f50581b34909
|
[
"CC-BY-3.0",
"EPL-1.0",
"CC0-1.0",
"CDDL-1.0",
"MIT",
"LGPL-2.1-or-later",
"LGPL-3.0-only",
"BSD-3-Clause",
"LGPL-2.1-only",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-freemarker",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
tomas-muller/unitime
|
8c7097003b955053f32fe5891f1d29b554c4dd45
|
de307a63552128b75ae9a83d7e1d44c71b3dc266
|
refs/heads/master
| 2021-12-29T04:57:46.000745 | 2021-12-09T19:02:43 | 2021-12-09T19:02:43 | 30,605,965 | 4 | 0 |
Apache-2.0
| 2021-02-17T15:14:49 | 2015-02-10T18:01:29 |
Java
|
UTF-8
|
Java
| false | false | 4,044 |
java
|
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* The Apereo Foundation 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.unitime.timetable.model;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.unitime.commons.Debug;
import org.unitime.timetable.model.base.BaseUserData;
import org.unitime.timetable.model.dao.UserDataDAO;
/**
* @author Tomas Muller
*/
public class UserData extends BaseUserData {
private static final long serialVersionUID = 1L;
/*[CONSTRUCTOR MARKER BEGIN]*/
public UserData () {
super();
}
/*[CONSTRUCTOR MARKER END]*/
public UserData(String externalUniqueId, String name) {
setExternalUniqueId(externalUniqueId);
setName(name);
initialize();
}
public static void setProperty(String externalUniqueId, String name, String value) {
try {
UserDataDAO dao = new UserDataDAO();
UserData userData = dao.get(new UserData(externalUniqueId, name));
if (value!=null && value.length()==0) value=null;
if (userData==null && value==null) return;
if (userData!=null && value!=null && value.equals(userData.getValue())) return;
if (userData==null) {
userData = new UserData(externalUniqueId, name);
}
userData.setValue(value);
if (value==null)
dao.delete(userData);
else
dao.saveOrUpdate(userData);
} catch (Exception e) {
Debug.warning("Failed to set user property " + name + ":=" + value + " (" + e.getMessage() + ")");
}
}
public static String getProperty(String externalUniqueId, String name) {
UserDataDAO dao = new UserDataDAO();
UserData userData = dao.get(new UserData(externalUniqueId, name));
return (userData==null?null:userData.getValue());
}
public static String getProperty(String externalUniqueId, String name, String defaultValue) {
String value = getProperty(externalUniqueId, name);
return (value!=null?value:defaultValue);
}
public static void removeProperty(String externalUniqueId, String name) {
setProperty(externalUniqueId, name, null);
}
public static HashMap<String,String> getProperties(String externalUniqueId, Collection<String> names) {
String q = "select u from UserData u where u.externalUniqueId = :externalUniqueId and u.name in (";
for (Iterator<String> i = names.iterator(); i.hasNext(); ) {
q += "'" + i.next() + "'";
if (i.hasNext()) q += ",";
}
q += ")";
HashMap<String,String> ret = new HashMap<String, String>();
for (UserData u: (List<UserData>)UserDataDAO.getInstance().getSession().createQuery(q).setString("externalUniqueId", externalUniqueId).setCacheable(true).list()) {
ret.put(u.getName(), u.getValue());
}
return ret;
}
public static HashMap<String,String> getProperties(String externalUniqueId) {
String q = "select u from UserData u where u.externalUniqueId = :externalUniqueId";
HashMap<String,String> ret = new HashMap<String, String>();
for (UserData u: (List<UserData>)UserDataDAO.getInstance().getSession().createQuery(q).setString("externalUniqueId", externalUniqueId).setCacheable(true).list()) {
ret.put(u.getName(), u.getValue());
}
return ret;
}
public static boolean getPropertyBoolean(String externalUniqueId, String name, boolean defaultValue) {
String value = getProperty(externalUniqueId, name);
return (value!=null?"1".equals(value):defaultValue);
}
}
|
[
"[email protected]"
] | |
2d3c473eab06e7a7d58691a8897abd70984b77d1
|
6c169aa627ee59a6da9cbad0978682db99b1bf55
|
/JCParse/src/com/jcsa/jcparse/lang/ptoken/PNewlineToken.java
|
da2d51cd657aac91236f6a19ff549748d66f6266
|
[] |
no_license
|
mahmoudimus/jcsa
|
88e0143fdcd36f50c72b53701490b3616fab27b7
|
30ec7d3e67607eeccaa6fba188473fc4e973e32c
|
refs/heads/master
| 2022-12-28T11:57:12.297760 | 2020-10-17T18:01:56 | 2020-10-17T18:01:56 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 167 |
java
|
package com.jcsa.jcparse.lang.ptoken;
/**
* token as newline in preprocessing
*
* @author yukimula
*/
public interface PNewlineToken extends PToken {
}
|
[
"[email protected]"
] | |
7bf4e84ffbdb39991cc916f99ca406f2673a9d8d
|
9f474f951304afbc92bd3058b769817148a64013
|
/kafka-postgres-writer/src/main/java/io/arenadata/kafka/postgres/writer/service/kafka/KafkaConsumerService.java
|
f4fc07338a9b748ae79a71c4058555115c677968
|
[
"Apache-2.0"
] |
permissive
|
arenadata/kafka-postgres-connector
|
8833c40be4a15413b515e00ea7caacebc3c15054
|
dfd03288f6b62f21fa06a943c18ced8c8831a790
|
refs/heads/master
| 2023-08-28T01:15:01.907630 | 2021-10-25T08:04:28 | 2021-10-25T08:04:28 | 385,180,289 | 1 | 2 |
NOASSERTION
| 2021-10-01T10:30:32 | 2021-07-12T08:39:27 |
Java
|
UTF-8
|
Java
| false | false | 5,524 |
java
|
/*
* Copyright © 2021 Arenadata Software LLC
*
* 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.arenadata.kafka.postgres.writer.service.kafka;
import io.arenadata.kafka.postgres.writer.configuration.properties.kafka.KafkaProperties;
import io.arenadata.kafka.postgres.writer.factory.VertxKafkaConsumerFactory;
import io.arenadata.kafka.postgres.writer.model.InsertDataContext;
import io.arenadata.kafka.postgres.writer.model.kafka.KafkaBrokerInfo;
import io.arenadata.kafka.postgres.writer.model.kafka.TopicPartitionConsumer;
import io.vertx.core.Future;
import io.vertx.core.Promise;
import io.vertx.kafka.client.common.PartitionInfo;
import io.vertx.kafka.client.common.TopicPartition;
import io.vertx.kafka.client.consumer.KafkaConsumer;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.util.stream.Collectors.toList;
@Slf4j
@Service
@AllArgsConstructor
public class KafkaConsumerService {
private static final String BOOTSTRAP_SERVERS_KEY = "bootstrap.servers";
private final VertxKafkaConsumerFactory<byte[], byte[]> consumerFactory;
private final KafkaProperties kafkaProperties;
public Future<List<PartitionInfo>> getTopicPartitions(InsertDataContext context) {
return Future.future(p -> {
val consumerProperty = getConsumerProperty(context);
val topicName = context.getRequest().getKafkaTopic();
val partitionInfoConsumer = createConsumer(consumerProperty, topicName);
partitionInfoConsumer.partitionsFor(topicName)
.onComplete(ar -> {
partitionInfoConsumer.close();
if (ar.succeeded()) {
p.complete(ar.result());
} else {
val errMsg = String.format("Can't get partition info by topic [%s]", topicName);
log.error(errMsg, ar.cause());
p.fail(ar.cause());
}
});
});
}
private KafkaConsumer<byte[], byte[]> createConsumer(Map<String, String> consumerProperty,
String topicName) {
val consumer = consumerFactory.create(consumerProperty);
consumer.subscribe(topicName, it -> {
if (it.succeeded()) {
log.debug("Successful topic subscription {}", topicName);
} else {
log.error("Topic Subscription Error {}: {}", topicName, it.cause());
}
});
consumer.exceptionHandler(it -> log.error("Error reading message from topic {}", topicName, it));
return consumer;
}
public Future<TopicPartitionConsumer> createTopicPartitionConsumer(InsertDataContext context, PartitionInfo partitionInfo) {
return createTopicPartitionConsumer(getConsumerProperty(context), partitionInfo);
}
private Future<TopicPartitionConsumer> createTopicPartitionConsumer(Map<String, String> consumerProperty,
PartitionInfo partitionInfo) {
val consumer = consumerFactory.create(consumerProperty);
consumer.exceptionHandler(it -> log.error("Error reading message from TopicPartition {}", partitionInfo, it));
val topicPartition = new TopicPartition(partitionInfo.getTopic(), partitionInfo.getPartition());
return assign(consumer, topicPartition)
.compose(v -> getPosition(consumer, topicPartition))
.map(beginningOffset -> new TopicPartitionConsumer(consumer, topicPartition, beginningOffset))
.onSuccess(topicPartitionConsumer -> log.info("created consumer[{}] by topicPartition [{}]", topicPartitionConsumer, topicPartition));
}
private Future<Void> assign(KafkaConsumer<byte[], byte[]> consumer, TopicPartition topicPartition) {
return Future.future((Promise<Void> p) -> consumer.assign(topicPartition, p));
}
private Future<Long> getPosition(KafkaConsumer<byte[], byte[]> consumer, TopicPartition topicPartition) {
return Future.future((Promise<Long> p) -> consumer.position(topicPartition, p));
}
private HashMap<String, String> getConsumerProperty(InsertDataContext context) {
val props = new HashMap<>(kafkaProperties.getConsumer().getProperty());
updateGroupId(context, props);
List<String> brokerAddresses = context.getRequest().getKafkaBrokers().stream()
.map(KafkaBrokerInfo::getAddress).collect(toList());
props.put(BOOTSTRAP_SERVERS_KEY, String.join(",", brokerAddresses));
return props;
}
private void updateGroupId(InsertDataContext context, Map<String, String> props) {
props.put("group.id", context.getRequest().getConsumerGroup());
}
}
|
[
"[email protected]"
] | |
918721ef5fe68c0d57d3cca6ea0fd939f6e0fe53
|
da9026baca9e976e92cc3099b8950fd0edb81451
|
/src/main/java/com/marcin/java/dietApp/comonent/AddSurname.java
|
66a6f7f94f9355010cdeef6db8db9e2b8bc69c7c
|
[] |
no_license
|
marcin22216/dietApp
|
3fed3104070fcef69ebce52489ce16a2ffb4485d
|
7091cd028b5e0f14cd3a750291af44dd785f05bf
|
refs/heads/master
| 2020-04-20T03:28:10.573353 | 2019-02-25T18:21:15 | 2019-02-25T18:21:15 | 168,599,126 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 428 |
java
|
package com.marcin.java.dietApp.comonent;
import com.marcin.java.dietApp.bean.User;
import org.springframework.stereotype.Component;
@Component
public class AddSurname {
public void addSurname(DataBase dataBase, User user)
{
for (User user1 : dataBase.getUserList())
{
if (user1.isLogged())
{
user1.setSurname(user.getSurname());
}
}
}
}
|
[
"[email protected]"
] | |
94be46286c96258e35071c54e34c2e5b62d8b2e6
|
4461d7177934ecffe58369756621d7da91f33bde
|
/collector-server/src/main/java/com/heliosapm/streams/collector/ssh/Authenticationator.java
|
4913274b15fc1ca1bcad9db87233385bf5704910
|
[
"Apache-2.0"
] |
permissive
|
nickman/HeliosStreams
|
acaa1ff427f00d2e80e9e8ee88b0c5f728ab95b3
|
9152a7bba7198fef3122360f6b3ed0ffa5048824
|
refs/heads/master
| 2020-04-10T11:57:20.404389 | 2017-03-31T00:52:43 | 2017-03-31T00:52:43 | 61,433,602 | 7 | 4 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,418 |
java
|
/*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.heliosapm.streams.collector.ssh;
import java.io.IOException;
/**
* <p>Title: Authenticationator</p>
* <p>Description: </p>
* <p>Company: Helios Development Group LLC</p>
* @author Whitehead (nwhitehead AT heliosdev DOT org)
* <p><code>com.heliosapm.streams.collector.ssh.Authenticationator</code></p>
*/
public interface Authenticationator {
/**
* Attempts an authentication against the passed connection
* If the connection is already fully authenticated, immediately returns true
* @param conn The connection to authenticate against
* @return true the connection is now authenticated, false otherwise
* @throws IOException Thrown on any IO error
*/
public boolean authenticate(final SSHConnection conn) throws IOException;
}
|
[
"[email protected]"
] | |
f5fba02af6fe2e9b3125303fd476ca0147015675
|
bf2904e2be38bc2b3673add37d46158b62cf0aae
|
/cloud-cusumerconsul-order80/src/main/java/com/miao/springcloud/config/ApplicationContextConfig.java
|
ef4893a589f7e161df0d4a1943c6005db4e64f57
|
[] |
no_license
|
sdauuse/springcloud
|
92453a082fc0f015c66f52454ba5aac936554ace
|
4d3fe75467a863099cac44d979d606826ff5bba7
|
refs/heads/master
| 2023-03-12T05:34:04.436997 | 2021-03-08T07:58:04 | 2021-03-08T07:58:04 | 327,306,915 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 524 |
java
|
package com.miao.springcloud.config;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
/**
* @author miaoyin
* @date 2021/3/5 - 14:38
* @commet:
*/
@Configuration
public class ApplicationContextConfig {
@Bean
//负载均衡
@LoadBalanced
public RestTemplate getRestTemplate(){
return new RestTemplate();
}
}
|
[
"[email protected]"
] | |
30a497f7bb26d7a67d29ed738ed55f978a78c980
|
cbb89aabe66e5eb5655569af6095374080d34ea8
|
/HM326Project/pinyougou_parent/pinyougou_interface/src/main/java/cn/itcast/core/service/seckill/SeckillOrderService.java
|
f02fbd0f2aa100cdcc43992beb9fbf9589964a02
|
[] |
no_license
|
hubSteve/E-Commerce-Pro
|
c199bd334b94f27ac606dfb312b1aa4b9fa6c01b
|
0d79c761aab62b9b6d4ade3e8fb2989dc5f61310
|
refs/heads/master
| 2020-04-13T18:00:04.006259 | 2018-11-29T08:08:02 | 2018-11-29T08:08:02 | 163,361,938 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 379 |
java
|
package cn.itcast.core.service.seckill;
import cn.itcast.core.pojo.seckill.SeckillOrder;
public interface SeckillOrderService {
void submitOrder(Long seckillId,String userId);
SeckillOrder searchOrderFromRedis(String userId);
void saveOrderFromRedis(String userId,Long orderId,String transactionId);
void deleteOrderFromRedis(String userId,Long orderId);
}
|
[
"[email protected]"
] | |
367c75de3b52730757411489e256c9aaa011ed14
|
34c51758793fa64d084eca49ef6f11d709e120cc
|
/app/src/main/java/com/example/review/ui/fragment/UserRecyclerFragment.java
|
53ffbef6ccd26a255c62a8c11c5ba1da7fbfbfbe
|
[] |
no_license
|
wuzehua/githubAndroid
|
691865515c5526864713f6585d439338d3fac12d
|
3aa73306296e023c8a7425023dd3102c05d52cda
|
refs/heads/master
| 2022-12-08T21:33:45.556612 | 2020-03-20T14:34:22 | 2020-03-20T14:34:22 | 236,331,950 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,473 |
java
|
package com.example.review.ui.fragment;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.review.R;
import com.example.review.api.model.UserInfo;
import com.example.review.ui.rv.UserViewAdapter;
import com.example.review.utils.GithubServiceUtils;
import java.util.List;
public class UserRecyclerFragment extends Fragment {
private String name;
private String getType;
private String accessToken;
private SwipeRefreshLayout mRefreshLayout;
private UserViewAdapter mAdapter;
private boolean hasLoaded;
public enum Type{
FOLLOWER,FOLLOWING
}
public UserRecyclerFragment(){
}
public static UserRecyclerFragment newInstance(Type type) {
Bundle args = new Bundle();
if(type == Type.FOLLOWER){
args.putString("userType","followers");
}else{
args.putString("userType","following");
}
args.putString("userName", "user");
UserRecyclerFragment fragment = new UserRecyclerFragment();
fragment.setArguments(args);
return fragment;
}
public static UserRecyclerFragment newInstance(Type type,@NonNull String name) {
Bundle args = new Bundle();
if(type == Type.FOLLOWER){
args.putString("userType","followers");
}else {
args.putString("userType","following");
}
args.putString("userName", "users/" + name);
UserRecyclerFragment fragment = new UserRecyclerFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
name = getArguments().getString("userName");
hasLoaded = false;
getType = getArguments().getString("userType");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.recycler_fragment, container, false);
RecyclerView mRecyclerView = view.findViewById(R.id.mainRecyclerView);
mRefreshLayout = view.findViewById(R.id.swipeLayout);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
//recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
accessToken = getActivity().getSharedPreferences("loginStat", Context.MODE_PRIVATE).getString("accessToken","");
mRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
fetchData();
}
});
mAdapter = new UserViewAdapter();
mRecyclerView.setAdapter(mAdapter);
// if(!hasLoaded){
// mRefreshLayout.setRefreshing(true);
// fetchData();
// }
return view;
}
@Override
public void onResume() {
super.onResume();
if(!hasLoaded){
mRefreshLayout.setRefreshing(true);
fetchData();
}
}
private void fetchData(){
Call<List<UserInfo>> call = GithubServiceUtils.getGithubApiService().getUsers(name, getType, accessToken);
call.enqueue(new Callback<List<UserInfo>>() {
@Override
public void onResponse(Call<List<UserInfo>> call, Response<List<UserInfo>> response) {
if(response.isSuccessful() && response.body() != null){
mAdapter.setUsers(response.body());
mAdapter.notifyDataSetChanged();
hasLoaded = true;
}
mRefreshLayout.setRefreshing(false);
}
@Override
public void onFailure(Call<List<UserInfo>> call, Throwable t) {
mRefreshLayout.setRefreshing(false);
}
});
}
}
|
[
"[email protected]"
] | |
3b6a1f0c4dc39df4481f21ebf051dbb4be29a8ee
|
842a0d4219a4984bd922cc10cedec1d374709ada
|
/src/main/java/se/slide/maven/wmb/BuildBarMojo.java
|
9b7e802d73c7a65d9eb1d74f2106e7fed52f3b33
|
[] |
no_license
|
havertyf/wmb-maven-plugin
|
eaafc496acb0d5f4fe604bfe3e43ad3193966a5b
|
e5249901f31f9488caa1b155ec3608ca70c1ef70
|
refs/heads/master
| 2016-09-03T06:47:25.211789 | 2009-01-08T15:13:43 | 2009-01-08T15:13:43 | 41,020,974 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,576 |
java
|
package se.slide.maven.wmb;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
/**
*
* @author www.slide.se
* @goal buildbar
*/
public class BuildBarMojo extends AbstractMojo {
/**
* @parameter expression="${project}"
* @required
* @readonly
*/
private org.apache.maven.project.MavenProject project;
/**
* Base directory of the project.
*
* @parameter expression="${basedir}"
*/
private File baseDirectory;
/**
* Base directory of the project.
*
* @parameter expression="${wmbSourceFolder}" default-value="src\\wmb"
*/
private String wmbSourceFolder;
final static String TARGET_FOLDER = "target";
final static String WORKSPACE_NAME = "workspace";
File workspaceFolder = null;
public void execute() throws MojoExecutionException, MojoFailureException {
/*
* TODO Make setting work for absolute pathnames as well
*/
String wmbSrcFolder = "." + File.separator + wmbSourceFolder;
// Set up the temporary workspace
setupWorkspace();
// All folders in the workspace could be a project folder
Collection<File> projects = new ArrayList<File>();
for (File child : new File(wmbSrcFolder).listFiles()) {
if (child.isDirectory()) {
projects.add(child);
}
}
// For every WMB project folder (we assume this to be true for every
// project with a msgflow/mset
// TODO What about ESQL-only projects?
Collection<WmbProject> wmbProjects = new ArrayList<WmbProject>();
for (File project : projects) {
WmbProject wmbProject = new WmbProject();
wmbProject.setProjectName(project.getName());
for (File file : project.listFiles()) {
if (file.getName().endsWith("msgflow")
|| file.getName().endsWith("mset")) {
wmbProject.addProjectFile(file.getName());
}
}
if (!wmbProject.getProjectFiles().isEmpty()) {
getLog().info(
"Adding WMB project: " + wmbProject.getProjectName());
// Add project
wmbProjects.add(wmbProject);
// Copy project to our temp workspace
try {
copyDirectory(project, new File(workspaceFolder, wmbProject.getProjectName()));
}
catch (IOException e) {
throw new MojoFailureException("Cannot copy " + project.getAbsolutePath() + " to destination " + workspaceFolder.getAbsolutePath());
}
}
}
try {
StringBuffer command = new StringBuffer();
command.append("mqsicreatebar");
command.append(" -data");
command.append(" ");
command.append(workspaceFolder.getAbsolutePath());
command.append(" -cleanBuild");
command.append(" -b ");
command.append(TARGET_FOLDER);
command.append(File.separator);
command.append(project.getArtifactId());
command.append(".bar");
//command += " -b " + TARGET_FOLDER + File.separator + project.getArtifactId() + ".bar";
StringBuffer paramProjects = new StringBuffer();
StringBuffer paramFiles = new StringBuffer();
for (WmbProject wmbProject : wmbProjects) {
//command += " -p " + wmbProject.getProjectName();
paramProjects.append(" ");
paramProjects.append(wmbProject.getProjectName());
for (String filename : wmbProject.getProjectFiles()) {
paramFiles.append(" ");
paramFiles.append(wmbProject.getProjectName());
paramFiles.append("\\");
paramFiles.append(filename);
//command += " -o " + wmbProject.getProjectName() + "\\" + filename;
}
}
command.append(" -p");
command.append(paramProjects.toString());
command.append(" -o");
command.append(paramFiles.toString());
getLog().info("Executing command: " + command.toString());
Runtime rt = Runtime.getRuntime();
Process process = rt.exec(command.toString());
int exitVal = process.waitFor();
if (exitVal > 0) {
// Output error
String error = "Reported error: " + getOutAndErrStream(process);
getLog().error(error);
throw new MojoFailureException(error);
}
}
// For exec
catch (IOException e) {
getLog().info("Error executing process: " + e.getMessage());
}
// For waitFor
catch (InterruptedException e) {
getLog().info("Error executing mqsicreatebar: " + e.getMessage());
}
}
private String getOutAndErrStream(Process p) {
StringBuffer cmd_out = new StringBuffer("");
if (p != null) {
BufferedReader is = new BufferedReader(new InputStreamReader(p
.getInputStream()));
String buf = "";
try {
while ((buf = is.readLine()) != null) {
cmd_out.append(buf);
cmd_out.append(System.getProperty("line.separator"));
}
is.close();
is = new BufferedReader(new InputStreamReader(p
.getErrorStream()));
while ((buf = is.readLine()) != null) {
cmd_out.append(buf);
cmd_out.append("\n");
}
is.close();
} catch (Exception e) {
e.printStackTrace();
}
}
return cmd_out.toString();
}
protected void setupWorkspace() {
File workspaceFolder = new File(project.getBasedir().getAbsolutePath()
+ File.separator + TARGET_FOLDER + File.separator
+ WORKSPACE_NAME);
if (!workspaceFolder.exists()) {
workspaceFolder.mkdirs();
getLog().info(
"Workspace folder not found, created folder "
+ workspaceFolder.getAbsolutePath());
}
this.workspaceFolder = workspaceFolder;
}
public void copyDirectory(File sourceLocation, File targetLocation)
throws IOException {
if (sourceLocation.isDirectory()) {
if (!targetLocation.exists()) {
targetLocation.mkdir();
}
String[] children = sourceLocation.list();
for (int i = 0; i < children.length; i++) {
copyDirectory(new File(sourceLocation, children[i]), new File(
targetLocation, children[i]));
}
} else {
InputStream in = new FileInputStream(sourceLocation);
OutputStream out = new FileOutputStream(targetLocation);
// Copy the bits from instream to outstream
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
}
}
|
[
"www.slide.se@62e47626-7e4f-0410-85cf-45cdbdd072e8"
] |
www.slide.se@62e47626-7e4f-0410-85cf-45cdbdd072e8
|
1824599380846b769cc6d4f47c28e8253716864b
|
be442b6a93639d745959165506c558eb00a374eb
|
/project/src/com/test/mystruts/util/CommonUtil.java
|
d14fa7cb8ee2daa857144ccfe805c4e64cfdbbbe
|
[] |
no_license
|
horacn/mystruts
|
410450bfa2b2ebab7fd5368a0f63e018f44c8c51
|
655a7dcfc51e797f032f3158fcc6f94e4cf4fbe2
|
refs/heads/master
| 2020-03-11T02:40:34.864301 | 2018-04-16T16:20:43 | 2018-04-16T16:20:43 | null | 0 | 0 | null | null | null | null |
GB18030
|
Java
| false | false | 4,679 |
java
|
package com.test.mystruts.util;
import java.awt.Color;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 通用工具类
*
* @author hezhao
*
*/
public final class CommonUtil {
private static final List<String> patterns = new ArrayList<String>();
private static final List<TypeConverter> converters = new ArrayList<TypeConverter>();
static {
patterns.add("yyyy-MM-dd");
patterns.add("yyyy-MM-dd HH:mm:ss");
}
private CommonUtil() {
throw new AssertionError();
}
/**
* 将字符串的首字母大写
*/
public static String capitalize(String str) {
StringBuilder sb = new StringBuilder();
if (str != null && str.length() > 0) {
sb.append(str.substring(0, 1).toUpperCase());
if (str.length() > 1) {
sb.append(str.substring(1));
}
return sb.toString();
}
return str;
}
/**
* 生成随机颜色
*/
public static Color getRandomColor() {
int r = (int) (Math.random() * 256);
int g = (int) (Math.random() * 256);
int b = (int) (Math.random() * 256);
return new Color(r, g, b);
}
/**
* 添加时间日期样式
*
* @param pattern
* 时间日期样式
*/
public static void registerDateTimePattern(String pattern) {
patterns.add(pattern);
}
/**
* 取消时间日期样式
*
* @param pattern
* 时间日期样式
*/
public static void unRegisterDateTimePattern(String pattern) {
patterns.remove(pattern);
}
/**
* 添加类型转换器
*
* @param converter
* 类型转换器对象
*/
public static void registerTypeConverter(TypeConverter converter) {
converters.add(converter);
}
/**
* 取消类型转换器
*
* @param converter
* 类型转换器对象
*/
public static void unRegisterTypeConverter(TypeConverter converter) {
converters.remove(converter);
}
/**
* 将字符串转换成时间日期类型
*
* @param str
* 时间日期字符串
*/
public static Date convertStringToDateTime(String str) {
if (str != null) {
for (String pattern : patterns) {
Date date = tryConvertStringToDate(str, pattern);
if (date != null) {
return date;
}
}
}
return null;
}
/**
* 按照指定样式将时间日期转换成字符串
*
* @param date
* 时间日期对象
* @param pattern
* 样式字符串
* @return 时间日期的字符串形式
*/
public static String convertDateTimeToString(Date date, String pattern) {
return new SimpleDateFormat(pattern).format(date);
}
private static Date tryConvertStringToDate(String str, String pattern) {
DateFormat dateFormat = new SimpleDateFormat(pattern);
dateFormat.setLenient(false); // 不允许将不符合样式的字符串转换成时间日期
try {
return dateFormat.parse(str);
} catch (ParseException ex) {
}
return null;
}
/**
* 将字符串值按指定的类型转换成转换成对象
*
* @param elemType
* 类型
* @param value
* 字符串值
*/
public static Object changeStringToObject(Class<?> elemType, String value) {
Object tempObj = null;
if (elemType == byte.class || elemType == Byte.class) {
tempObj = Byte.parseByte(value);
} else if (elemType == short.class || elemType == Short.class) {
tempObj = Short.parseShort(value);
} else if (elemType == int.class || elemType == Integer.class) {
tempObj = Integer.parseInt(value);
} else if (elemType == long.class || elemType == Long.class) {
tempObj = Long.parseLong(value);
} else if (elemType == double.class || elemType == Double.class) {
tempObj = Double.parseDouble(value);
} else if (elemType == float.class || elemType == Float.class) {
tempObj = Float.parseFloat(value);
} else if (elemType == boolean.class || elemType == Boolean.class) {
tempObj = Boolean.parseBoolean(value);
} else if (elemType == java.util.Date.class) {
tempObj = convertStringToDateTime(value);
} else if (elemType == java.lang.String.class) {
tempObj = value;
} else {
for (TypeConverter converter : converters) {
try {
tempObj = converter.convert(elemType, value);
if (tempObj != null) {
return tempObj;
}
} catch (Exception e) {
}
}
}
return tempObj;
}
/**
* 获取文件后缀名
*
* @param filename
* 文件名
* @return 文件的后缀名以.开头
*/
public static String getFileSuffix(String filename) {
int index = filename.lastIndexOf(".");
return index > 0 ? filename.substring(index) : "";
}
}
|
[
"[email protected]"
] | |
e7549624e00ee82338c8b1e849de0517ec74e84d
|
17213b0955d0a1b23df62ee7fed71f1fb8068376
|
/src/main/java/com/lzp/interceptor/WebConfig.java
|
a054ffa600ef03a7729f7937be0f356731f3985d
|
[] |
no_license
|
1471591945/blog
|
a1239adf80cecfde9156bfeaaba52dd9ee589aea
|
1d4deecb5dc5652a837814e40bdc1a08209bf055
|
refs/heads/master
| 2023-05-05T19:30:31.978168 | 2021-05-14T00:59:44 | 2021-05-14T00:59:44 | 367,073,941 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,095 |
java
|
package com.lzp.interceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @Author LZP
* @Date 2021/5/3 10:51
* @Version 1.0
*
* 配置类
* 加上@Configuration,SpringBoot才会认为该类是一个配置类,才会去加载它
*/
@Configuration
public class WebConfig implements WebMvcConfigurer {
/**
* 配置视图解析器
* @param registry
*/
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/admin/main").setViewName("/admin/index");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LoginInterceptor())
.addPathPatterns("/admin/**")
.excludePathPatterns("/admin")
.excludePathPatterns("/admin/login");
}
}
|
[
"[email protected]"
] | |
888bb33c2e762e9f2fff018db6216ebfd01ebdd4
|
0bd202e32882ad0766c0ad975492608fc69ea393
|
/freeapis-service-airplayauth/src/main/java/net/freeapis/airplayauth/service/CompanyServiceImpl.java
|
f187ba4adbf24a940e6aa010555827460a93d76c
|
[] |
no_license
|
wq409813230/airplay-auth-api
|
ab0cb2d44b2092d9f6d5b286b421cb5a09d6ccb3
|
f32eff76cb3c5b44c0dfcee6e73b94c047e4f6bd
|
refs/heads/master
| 2020-04-25T03:42:03.769847 | 2019-05-20T01:48:12 | 2019-05-20T01:48:12 | 172,486,060 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,397 |
java
|
package net.freeapis.airplayauth.service;
import org.springframework.stereotype.Service;
import net.freeapis.airplayauth.dao.CompanyDAO;
import net.freeapis.airplayauth.face.entity.Company;
import net.freeapis.core.mysql.BaseServiceImpl;
import net.freeapis.airplayauth.face.CompanyService;
import net.freeapis.airplayauth.face.model.CompanyModel;
import net.freeapis.core.foundation.model.Page;
import org.springframework.beans.factory.annotation.Autowired;
/**
*
* <pre>
*
* freeapis
* File: CompanyServiceImpl.java
*
* Freeapis, Inc.
* Copyright (C): 2015
*
* Description:
* TODO
*
* Notes:
* $Id: CompanyServiceImpl.java 31101200-9 2014-10-14 16:43:51Z freeapis $
*
* Revision History
* <Date>, <Who>, <What>
* - 2019-02-26 11:49:38 freeapis Initial.
*
* </pre>
*/
@Service(value="companyService")
public class CompanyServiceImpl extends BaseServiceImpl<CompanyModel, Company> implements CompanyService
{
@Autowired
private CompanyDAO companyDAO;
@Override
public CompanyModel createCompany(CompanyModel companyModel) throws Exception {
return super.create(companyModel);
}
@Override
public CompanyModel updateCompany(CompanyModel companyModel) throws Exception {
return null;
}
@Override
public Page getByPage(Page page) throws Exception {
return page;
}
}
|
[
"[email protected]"
] | |
4e49e3f88b9969ed9eca5d209d424706c01211d4
|
23f42b163c0a58ad61c38498befa1219f53a2c10
|
/src/main/java/weldstartup/d/AppScopedBean3555.java
|
40b97590977bd25e6344604a90ecc42cfb7142a5
|
[] |
no_license
|
99sono/wls-jsf-2-2-12-jersey-weldstartup-bottleneck
|
9637d2f14a1053159c6fc3c5898a91057a65db9d
|
b81697634cceca79f1b9a999002a1a02c70b8648
|
refs/heads/master
| 2021-05-15T17:54:39.040635 | 2017-10-24T07:27:23 | 2017-10-24T07:27:23 | 107,673,776 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,630 |
java
|
package weldstartup.d;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
import javax.transaction.TransactionSynchronizationRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import weldstartup.nondynamicclasses.AppScopedNonDynamicBean;
import weldstartup.nondynamicclasses.DependentScopedNonDynamicBean;
import weldstartup.nondynamicclasses.RequestScopedNonDynamicBean;
/**
* A dynamically created CDI bean meant to demonstrate meant to demonstrate that the WeldStartup performance on weblogic
* is really under-performing.
*
*/
@ApplicationScoped
// appScopedName will be turned into a name like AppScopedBean0001
public class AppScopedBean3555 {
private static final Logger LOGGER = LoggerFactory.getLogger(AppScopedBean3555.class);
@Inject
AppScopedNonDynamicBean appScopedNonDynamicBean;
@Inject
DependentScopedNonDynamicBean rependentScopedNonDynamicBean;
@Inject
RequestScopedNonDynamicBean requestScopedNonDynamicBean;
@Inject
BeanManager beanManager;
@Resource
TransactionSynchronizationRegistry tsr;
@PostConstruct
public void postConstruct() {
LOGGER.info("Post construct method invoked. AppScopedBean3555");
}
@PreDestroy
public void preDestroy() {
LOGGER.info("Pre-destroy method invoked. AppScopedBean3555");
}
public void dummyLogic() {
LOGGER.info("Dummy logic invoked. AppScopedBean3555");
}
}
|
[
"[email protected]"
] | |
b24443b4c10d02cd41bb20514eaf1cfd4665d825
|
d640a547edbf24746318965aa6b51b87819a9cab
|
/src/main/java/com/manage/config/shiro/SpringContextHolder.java
|
2ad622763948dcc1f03f3703b6b7fdcf317cb5e1
|
[] |
no_license
|
star-lmh/forever
|
5b8372c0d89e515aa7424ceb16b21b613dca32eb
|
85bc5b4c13cb78538220a84ed1e01e8c8dc94435
|
refs/heads/master
| 2022-12-19T09:12:41.425415 | 2020-09-23T14:29:10 | 2020-09-23T14:29:10 | 299,556,756 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,428 |
java
|
package com.manage.config.shiro;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* Spring的ApplicationContext的持有者,可以用静态方法的方式获取spring容器中的bean
*/
@Component
public class SpringContextHolder implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
SpringContextHolder.applicationContext = applicationContext;
}
public static ApplicationContext getApplicationContext() {
assertApplicationContext();
return applicationContext;
}
@SuppressWarnings("unchecked")
public static <T> T getBean(String beanName) {
assertApplicationContext();
return (T) applicationContext.getBean(beanName);
}
public static <T> T getBean(Class<T> requiredType) {
assertApplicationContext();
return applicationContext.getBean(requiredType);
}
private static void assertApplicationContext() {
if (SpringContextHolder.applicationContext == null) {
throw new RuntimeException("applicaitonContext属性为null,请检查是否注入了SpringContextHolder!");
}
}
}
|
[
"[email protected]"
] | |
855ab1000553c530abaf68207db62de79d823511
|
ce4819f065e7d95fcdf45346bd1b4b9b6a86c256
|
/java/com/flamez/app/PaintView.java
|
359733ef0e97816341040bd79ca6f1861338e3cc
|
[] |
no_license
|
AneekRahman/Flamez-v7
|
7046f978ca8c40460aa67a62e269c4d27de1ab24
|
faf9a3f2d0993b2d41c362ab597b22266c4ff7b5
|
refs/heads/main
| 2023-01-05T22:35:08.248455 | 2020-11-07T18:36:50 | 2020-11-07T18:36:50 | 310,908,794 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,326 |
java
|
package com.flamez.app;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.EmbossMaskFilter;
import android.graphics.MaskFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.View;
import java.util.ArrayList;
public class PaintView extends View {
public Bitmap bitmap = null;
public static int BRUSH_SIZE = 20;
public static final int DEFAULT_COLOR = Color.RED;
public static final int DEFAULT_BG_COLOR = Color.WHITE;
private static final float TOUCH_TOLERANCE = 4;
private float mX, mY;
private Path mPath;
private Paint mPaint;
private ArrayList<FingerPath> paths = new ArrayList<>();
private int currentColor;
private int strokeWidth;
private boolean emboss;
private boolean blur;
private MaskFilter mEmboss;
private MaskFilter mBlur;
private Bitmap mBitmap;
private Canvas mCanvas;
private Paint mBitmapPaint = new Paint(Paint.DITHER_FLAG);
public PaintView(Context context) {
this(context, null);
}
public PaintView(Context context, AttributeSet attrs) {
super(context, attrs);
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setColor(DEFAULT_COLOR);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setXfermode(null);
mPaint.setAlpha(0xff);
mEmboss = new EmbossMaskFilter(new float[] {1, 1, 1}, 0.4f, 6, 3.5f);
mBlur = new BlurMaskFilter(5, BlurMaskFilter.Blur.NORMAL);
}
public void init(DisplayMetrics metrics, Bitmap bitmap) {
int height = metrics.heightPixels;
int width = metrics.widthPixels;
mCanvas = new Canvas(bitmap);
this.bitmap = bitmap;
currentColor = DEFAULT_COLOR;
strokeWidth = BRUSH_SIZE;
}
public void normal() {
emboss = false;
blur = false;
}
public void emboss() {
emboss = true;
blur = false;
}
public void blur() {
emboss = false;
blur = true;
}
public void clear() {
paths.clear();
normal();
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
canvas.save();
mCanvas.drawBitmap(this.bitmap, 0f, 0f, null);
for (FingerPath fp : paths) {
mPaint.setColor(fp.color);
mPaint.setStrokeWidth(fp.strokeWidth);
mPaint.setMaskFilter(null);
if (fp.emboss)
mPaint.setMaskFilter(mEmboss);
else if (fp.blur)
mPaint.setMaskFilter(mBlur);
mCanvas.drawPath(fp.path, mPaint);
}
canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);
canvas.restore();
}
private void touchStart(float x, float y) {
mPath = new Path();
FingerPath fp = new FingerPath(currentColor, emboss, blur, strokeWidth, mPath);
paths.add(fp);
mPath.reset();
mPath.moveTo(x, y);
mX = x;
mY = y;
}
private void touchMove(float x, float y) {
float dx = Math.abs(x - mX);
float dy = Math.abs(y - mY);
if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) {
mPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);
mX = x;
mY = y;
}
}
private void touchUp() {
mPath.lineTo(mX, mY);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
float x = event.getX();
float y = event.getY();
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN :
touchStart(x, y);
invalidate();
break;
case MotionEvent.ACTION_MOVE :
touchMove(x, y);
invalidate();
break;
case MotionEvent.ACTION_UP :
touchUp();
invalidate();
break;
}
return true;
}
}
|
[
"[email protected]"
] | |
d0fad6e524c818bc17fa7fb3bca9cbfe6939abb2
|
c885ef92397be9d54b87741f01557f61d3f794f3
|
/results/Codec-9/org.apache.commons.codec.binary.Base64/BBC-F0-opt-10/tests/11/org/apache/commons/codec/binary/Base64_ESTest.java
|
f707b8e17f3fd6194b44202c22145a177a5c02ab
|
[
"CC-BY-4.0",
"MIT"
] |
permissive
|
pderakhshanfar/EMSE-BBC-experiment
|
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
|
fea1a92c2e7ba7080b8529e2052259c9b697bbda
|
refs/heads/main
| 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null |
UTF-8
|
Java
| false | false | 48,072 |
java
|
/*
* This file was automatically generated by EvoSuite
* Wed Oct 20 10:55:29 GMT 2021
*/
package org.apache.commons.codec.binary;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.math.BigInteger;
import org.apache.commons.codec.binary.Base64;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.util.MockRandom;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class Base64_ESTest extends Base64_ESTest_scaffolding {
@Test(timeout = 4000)
public void test00() throws Throwable {
MockRandom mockRandom0 = new MockRandom();
BigInteger bigInteger0 = new BigInteger(8268, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test01() throws Throwable {
MockRandom mockRandom0 = new MockRandom();
mockRandom0.nextDouble();
BigInteger bigInteger0 = new BigInteger(8284, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test02() throws Throwable {
MockRandom mockRandom0 = new MockRandom();
int int0 = 8284;
BigInteger bigInteger0 = new BigInteger(8284, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test03() throws Throwable {
MockRandom mockRandom0 = new MockRandom();
BigInteger bigInteger0 = new BigInteger(2069, mockRandom0);
byte[] byteArray0 = Base64.toIntegerBytes(bigInteger0);
// Undeclared exception!
try {
Base64.encodeBase64Chunked(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test04() throws Throwable {
MockRandom mockRandom0 = new MockRandom();
mockRandom0.doubles((long) 92);
BigInteger bigInteger0 = new BigInteger(8284, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test05() throws Throwable {
MockRandom mockRandom0 = new MockRandom();
BigInteger bigInteger0 = new BigInteger(8284, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test06() throws Throwable {
MockRandom mockRandom0 = new MockRandom();
BigInteger bigInteger0 = new BigInteger(2034, mockRandom0);
byte[] byteArray0 = Base64.toIntegerBytes(bigInteger0);
// Undeclared exception!
try {
Base64.encodeBase64Chunked(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test07() throws Throwable {
MockRandom mockRandom0 = new MockRandom(3666);
BigInteger bigInteger0 = new BigInteger(8245, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test08() throws Throwable {
byte[] byteArray0 = new byte[4];
byte byte0 = (byte)9;
byteArray0[0] = (byte)9;
byteArray0[1] = (byte)32;
byte byte1 = (byte)3;
byteArray0[2] = (byte)3;
byte byte2 = (byte)89;
byteArray0[3] = (byte)89;
Base64.isBase64(byteArray0);
byte[] byteArray1 = Base64.discardWhitespace(byteArray0);
BigInteger bigInteger0 = BigInteger.ZERO;
byte[] byteArray2 = Base64.toIntegerBytes(bigInteger0);
Base64 base64_0 = new Base64((byte)89, byteArray2);
int int0 = (-953);
BigInteger bigInteger1 = BigInteger.TEN;
bigInteger0.compareTo(bigInteger1);
base64_0.readResults(byteArray1, (-953), 61);
int int1 = 71;
// Undeclared exception!
try {
base64_0.encode(byteArray0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// -1
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test09() throws Throwable {
byte[] byteArray0 = new byte[9];
Base64.isBase64(byteArray0);
Base64.isBase64((byte)123);
Base64 base64_0 = null;
try {
base64_0 = new Base64((byte)123);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test10() throws Throwable {
byte[] byteArray0 = Base64.CHUNK_SEPARATOR;
MockRandom mockRandom0 = new MockRandom((-2320L));
BigInteger bigInteger0 = new BigInteger(1717986918, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test11() throws Throwable {
byte[] byteArray0 = Base64.CHUNK_SEPARATOR;
BigInteger bigInteger0 = new BigInteger(byteArray0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test12() throws Throwable {
MockRandom mockRandom0 = new MockRandom(38L);
BigInteger bigInteger0 = new BigInteger(4474, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test13() throws Throwable {
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test14() throws Throwable {
MockRandom mockRandom0 = new MockRandom(4474);
BigInteger bigInteger0 = new BigInteger(4474, mockRandom0);
// Undeclared exception!
try {
Base64.encodeInteger(bigInteger0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test15() throws Throwable {
byte[] byteArray0 = new byte[2];
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test16() throws Throwable {
byte[] byteArray0 = Base64.CHUNK_SEPARATOR;
Base64.isBase64(byteArray0);
Base64 base64_0 = null;
try {
base64_0 = new Base64(59, byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test17() throws Throwable {
byte[] byteArray0 = new byte[9];
// Undeclared exception!
try {
Base64.encodeBase64URLSafeString(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test18() throws Throwable {
byte[] byteArray0 = Base64.CHUNK_SEPARATOR;
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test19() throws Throwable {
byte[] byteArray0 = new byte[2];
// Undeclared exception!
try {
Base64.encodeBase64(byteArray0, true, true, 14);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test20() throws Throwable {
BigInteger bigInteger0 = BigInteger.TEN;
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test21() throws Throwable {
byte[] byteArray0 = new byte[2];
Base64 base64_0 = null;
try {
base64_0 = new Base64(false);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test22() throws Throwable {
byte[] byteArray0 = new byte[7];
// Undeclared exception!
try {
Base64.decodeInteger(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test23() throws Throwable {
byte[] byteArray0 = new byte[3];
byteArray0[0] = (byte) (-39);
byte byte0 = (byte)1;
byteArray0[1] = (byte)1;
byteArray0[2] = (byte)60;
Base64 base64_0 = new Base64((-743), byteArray0, false);
base64_0.avail();
// Undeclared exception!
try {
Base64.encodeBase64(byteArray0, false, false);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test24() throws Throwable {
byte[] byteArray0 = new byte[6];
byteArray0[0] = (byte)0;
byte[] byteArray1 = null;
Base64.encodeBase64String((byte[]) null);
Base64.encodeBase64((byte[]) null, true);
byte[] byteArray2 = new byte[5];
byteArray2[0] = (byte)34;
byteArray2[1] = (byte)34;
byteArray2[2] = (byte)34;
byteArray2[3] = (byte)0;
byteArray2[4] = (byte)0;
Base64 base64_0 = new Base64((byte)0, byteArray2, false);
try {
base64_0.decode((Object) null);
fail("Expecting exception: Exception");
} catch(Exception e) {
//
// Parameter supplied to Base64 decode is not a byte[] or a String
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test25() throws Throwable {
byte[] byteArray0 = new byte[9];
byteArray0[0] = (byte)39;
byteArray0[1] = (byte)103;
byteArray0[2] = (byte)39;
byteArray0[3] = (byte)13;
byteArray0[4] = (byte)103;
byteArray0[5] = (byte)39;
byteArray0[7] = (byte)39;
byteArray0[8] = (byte)103;
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test26() throws Throwable {
byte[] byteArray0 = new byte[8];
// Undeclared exception!
try {
Base64.encodeBase64(byteArray0, true, true, 14);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test27() throws Throwable {
byte[] byteArray0 = new byte[9];
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test28() throws Throwable {
BigInteger bigInteger0 = BigInteger.ZERO;
byte[] byteArray0 = Base64.encodeInteger(bigInteger0);
Base64.encodeBase64String(byteArray0);
Base64 base64_0 = null;
try {
base64_0 = new Base64((-4371));
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test29() throws Throwable {
byte[] byteArray0 = new byte[9];
byteArray0[0] = (byte) (-96);
byteArray0[1] = (byte)0;
byteArray0[2] = (byte) (-23);
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test30() throws Throwable {
byte[] byteArray0 = new byte[7];
byteArray0[0] = (byte) (-96);
byteArray0[1] = (byte)0;
byteArray0[2] = (byte) (-23);
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test31() throws Throwable {
byte[] byteArray0 = new byte[6];
byteArray0[0] = (byte)0;
byteArray0[1] = (byte)34;
byteArray0[2] = (byte)101;
byteArray0[3] = (byte)0;
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test32() throws Throwable {
byte[] byteArray0 = new byte[6];
byteArray0[0] = (byte)7;
byteArray0[1] = (byte)103;
byteArray0[2] = (byte) (-1);
byteArray0[3] = (byte) (-54);
byteArray0[4] = (byte) (-114);
byteArray0[5] = (byte) (-19);
boolean boolean0 = Base64.isArrayByteBase64(byteArray0);
boolean boolean1 = Base64.isBase64((byte)7);
// // Unstable assertion: assertTrue(boolean1 == boolean0);
Base64 base64_0 = null;
try {
base64_0 = new Base64(false);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test33() throws Throwable {
BigInteger bigInteger0 = BigInteger.TEN;
byte[] byteArray0 = new byte[9];
byteArray0[0] = (byte)47;
byteArray0[1] = (byte)6;
byteArray0[2] = (byte)59;
byteArray0[3] = (byte) (-1);
byteArray0[4] = (byte) (-1);
byteArray0[4] = (byte) (-104);
byteArray0[6] = (byte) (-1);
byteArray0[7] = (byte)12;
byteArray0[8] = (byte)112;
Base64.isArrayByteBase64(byteArray0);
// Undeclared exception!
try {
Base64.decodeInteger(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test34() throws Throwable {
BigInteger bigInteger0 = BigInteger.TEN;
Base64 base64_0 = null;
try {
base64_0 = new Base64(false);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test35() throws Throwable {
byte[] byteArray0 = new byte[5];
byteArray0[0] = (byte) (-1);
byteArray0[1] = (byte)39;
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test36() throws Throwable {
byte[] byteArray0 = new byte[11];
byte byte0 = (byte) (-96);
byteArray0[0] = (byte) (-96);
byteArray0[1] = (byte)0;
byteArray0[2] = (byte) (-23);
byteArray0[4] = (byte)0;
byteArray0[5] = (byte)4;
byteArray0[6] = (byte)0;
Base64.isBase64((byte)0);
Base64 base64_0 = null;
try {
base64_0 = new Base64(false);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test37() throws Throwable {
byte[] byteArray0 = new byte[5];
byteArray0[0] = (byte) (-1);
Base64 base64_0 = new Base64((-1350), byteArray0, true);
int int0 = (-547);
base64_0.encode(byteArray0, (-547), (-547));
// Undeclared exception!
try {
Base64.encodeBase64(byteArray0, true, false, 117);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test38() throws Throwable {
byte[] byteArray0 = new byte[0];
byte[] byteArray1 = Base64.encodeBase64(byteArray0, false, false);
// Undeclared exception!
try {
Base64.decodeInteger(byteArray1);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test39() throws Throwable {
byte[] byteArray0 = null;
Base64.encodeBase64((byte[]) null);
Base64.isBase64((byte) (-62));
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test40() throws Throwable {
byte[] byteArray0 = new byte[9];
byteArray0[0] = (byte) (-96);
byteArray0[1] = (byte)0;
byteArray0[2] = (byte) (-23);
byteArray0[3] = (byte) (-98);
byteArray0[4] = (byte)0;
byteArray0[5] = (byte)4;
byteArray0[6] = (byte)0;
byteArray0[7] = (byte) (-15);
byteArray0[8] = (byte) (-98);
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test41() throws Throwable {
byte[] byteArray0 = new byte[5];
byteArray0[0] = (byte) (-6);
byteArray0[1] = (byte)39;
byteArray0[2] = (byte) (-1);
// Undeclared exception!
try {
Base64.decodeInteger(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test42() throws Throwable {
byte[] byteArray0 = new byte[5];
byteArray0[0] = (byte) (-1);
byteArray0[1] = (byte)39;
byteArray0[2] = (byte) (-1);
Base64 base64_0 = null;
try {
base64_0 = new Base64(false);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test43() throws Throwable {
byte[] byteArray0 = new byte[3];
byteArray0[0] = (byte)0;
byteArray0[1] = (byte) (-54);
byteArray0[2] = (byte)26;
// Undeclared exception!
try {
Base64.decodeInteger(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test44() throws Throwable {
byte[] byteArray0 = new byte[6];
byteArray0[0] = (byte)7;
byteArray0[1] = (byte)103;
byteArray0[2] = (byte) (-1);
byteArray0[3] = (byte) (-54);
byteArray0[4] = (byte) (-114);
Base64.isArrayByteBase64(byteArray0);
Base64.isBase64((byte) (-1));
Base64 base64_0 = null;
try {
base64_0 = new Base64(false);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test45() throws Throwable {
byte[] byteArray0 = new byte[3];
byte byte0 = (byte)0;
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test46() throws Throwable {
byte[] byteArray0 = new byte[1];
byteArray0[0] = (byte)0;
boolean boolean0 = Base64.isArrayByteBase64(byteArray0);
// // Unstable assertion: assertFalse(boolean0);
// Undeclared exception!
try {
Base64.decodeInteger(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test47() throws Throwable {
byte[] byteArray0 = new byte[9];
// Undeclared exception!
try {
Base64.decodeInteger(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test48() throws Throwable {
byte[] byteArray0 = new byte[1];
byte byte0 = (byte)0;
byteArray0[0] = (byte)0;
Base64.isArrayByteBase64(byteArray0);
byte byte1 = (byte)0;
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test49() throws Throwable {
byte[] byteArray0 = new byte[6];
byteArray0[0] = (byte)7;
byteArray0[1] = (byte)103;
byteArray0[2] = (byte) (-1);
byteArray0[3] = (byte) (-54);
byteArray0[4] = (byte) (-114);
// Undeclared exception!
try {
Base64.decodeBase64(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test50() throws Throwable {
Base64 base64_0 = null;
try {
base64_0 = new Base64(true);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test51() throws Throwable {
byte[] byteArray0 = new byte[7];
byteArray0[0] = (byte)7;
byteArray0[1] = (byte)103;
// Undeclared exception!
try {
Base64.decodeBase64(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test52() throws Throwable {
byte[] byteArray0 = new byte[5];
byte byte0 = (byte) (-1);
byteArray0[0] = (byte) (-1);
byteArray0[1] = (byte)39;
byteArray0[2] = (byte) (-1);
byteArray0[3] = (byte)0;
byteArray0[4] = (byte)0;
Base64 base64_0 = new Base64((-1), byteArray0);
Base64 base64_1 = null;
try {
base64_1 = new Base64(true);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test53() throws Throwable {
byte[] byteArray0 = new byte[9];
byteArray0[0] = (byte) (-96);
byteArray0[1] = (byte)0;
byteArray0[2] = (byte) (-23);
byteArray0[3] = (byte) (-98);
byteArray0[4] = (byte)0;
byteArray0[5] = (byte)4;
byteArray0[6] = (byte)0;
byteArray0[7] = (byte) (-15);
byteArray0[8] = (byte)0;
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test54() throws Throwable {
Base64 base64_0 = null;
try {
base64_0 = new Base64(528);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test55() throws Throwable {
byte[] byteArray0 = null;
// Undeclared exception!
try {
Base64.discardWhitespace((byte[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test56() throws Throwable {
byte[] byteArray0 = new byte[8];
byteArray0[0] = (byte)12;
byteArray0[1] = (byte)76;
byteArray0[2] = (byte) (-1);
byteArray0[3] = (byte)46;
byteArray0[4] = (byte)80;
byteArray0[5] = (byte)36;
byteArray0[6] = (byte)0;
byteArray0[7] = (byte)0;
// Undeclared exception!
try {
Base64.decodeBase64(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test57() throws Throwable {
byte[] byteArray0 = new byte[1];
byteArray0[0] = (byte) (-119);
// Undeclared exception!
try {
Base64.encodeBase64String(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test58() throws Throwable {
byte[] byteArray0 = new byte[5];
byteArray0[0] = (byte)0;
byte byte0 = (byte) (-73);
byteArray0[1] = (byte) (-73);
byte byte1 = (byte)0;
byteArray0[2] = (byte)0;
byteArray0[3] = (byte)66;
byteArray0[4] = (byte)126;
// Undeclared exception!
try {
Base64.decodeInteger(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test59() throws Throwable {
Base64.encodeBase64((byte[]) null);
byte byte0 = (byte) (-62);
Base64.isBase64((byte) (-62));
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test60() throws Throwable {
byte[] byteArray0 = new byte[5];
byteArray0[0] = (byte)89;
byteArray0[1] = (byte)0;
byteArray0[2] = (byte)44;
byteArray0[3] = (byte) (-43);
byteArray0[4] = (byte)76;
// Undeclared exception!
try {
Base64.encodeBase64URLSafeString(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test61() throws Throwable {
byte[] byteArray0 = new byte[6];
byteArray0[0] = (byte)0;
byteArray0[1] = (byte)34;
byteArray0[2] = (byte)101;
byteArray0[3] = (byte)0;
byteArray0[4] = (byte) (-21);
byteArray0[5] = (byte)79;
Base64.discardWhitespace(byteArray0);
Base64 base64_0 = null;
try {
base64_0 = new Base64(0, byteArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [\u0000\"e\u0000\uFFFDO]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test62() throws Throwable {
BigInteger bigInteger0 = BigInteger.ZERO;
byte[] byteArray0 = Base64.encodeInteger(bigInteger0);
assertEquals(0, byteArray0.length);
boolean boolean0 = Base64.isBase64((byte) (-90));
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test63() throws Throwable {
Base64 base64_0 = null;
try {
base64_0 = new Base64(83);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test64() throws Throwable {
Base64.encodeBase64((byte[]) null);
Base64 base64_0 = null;
try {
base64_0 = new Base64(0, (byte[]) null, true);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test65() throws Throwable {
Base64.isBase64("");
Base64 base64_0 = null;
try {
base64_0 = new Base64(11);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test66() throws Throwable {
Base64 base64_0 = null;
try {
base64_0 = new Base64(false);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test67() throws Throwable {
byte[] byteArray0 = null;
// Undeclared exception!
try {
Base64.isArrayByteBase64((byte[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test68() throws Throwable {
byte[] byteArray0 = new byte[0];
// Undeclared exception!
try {
Base64.decodeInteger(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test69() throws Throwable {
byte[] byteArray0 = new byte[9];
byteArray0[0] = (byte) (-17);
byteArray0[1] = (byte)5;
byteArray0[2] = (byte)36;
byteArray0[3] = (byte)26;
byteArray0[4] = (byte)34;
byteArray0[5] = (byte) (-1);
byteArray0[6] = (byte)65;
byteArray0[7] = (byte) (-117);
byteArray0[8] = (byte)0;
Base64 base64_0 = null;
try {
base64_0 = new Base64(0, byteArray0, true);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [\uFFFD\u0005$\u001A\"\uFFFDA\uFFFD\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test70() throws Throwable {
byte[] byteArray0 = new byte[5];
byteArray0[0] = (byte) (-1);
byteArray0[1] = (byte)39;
byteArray0[2] = (byte) (-1);
byteArray0[3] = (byte)0;
byteArray0[4] = (byte)0;
Base64 base64_0 = new Base64((-1), byteArray0);
Base64 base64_1 = null;
try {
base64_1 = new Base64(true);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test71() throws Throwable {
Base64 base64_0 = null;
try {
base64_0 = new Base64(879);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test72() throws Throwable {
byte[] byteArray0 = new byte[1];
byteArray0[0] = (byte)14;
// Undeclared exception!
try {
Base64.encodeBase64URLSafe(byteArray0);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test73() throws Throwable {
boolean boolean0 = true;
Base64 base64_0 = null;
try {
base64_0 = new Base64(true);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test74() throws Throwable {
byte[] byteArray0 = null;
Base64.encodeBase64String((byte[]) null);
Base64 base64_0 = null;
try {
base64_0 = new Base64();
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test75() throws Throwable {
byte[] byteArray0 = new byte[0];
Base64.encodeBase64(byteArray0, true);
byte[] byteArray1 = new byte[3];
byteArray1[0] = (byte)0;
byteArray1[1] = (byte)0;
byteArray1[2] = (byte)14;
Base64 base64_0 = new Base64(3483, byteArray1);
base64_0.decode(byteArray1);
base64_0.avail();
// Undeclared exception!
try {
Base64.encodeBase64(byteArray1, true, true, 3483);
// fail("Expecting exception: IllegalArgumentException");
// Unstable assertion
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [P\u0000]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
@Test(timeout = 4000)
public void test76() throws Throwable {
byte[] byteArray0 = new byte[1];
byte byte0 = (byte)57;
byteArray0[0] = (byte)57;
Base64 base64_0 = null;
try {
base64_0 = new Base64((-1), byteArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// lineSeperator must not contain base64 characters: [9]
//
verifyException("org.apache.commons.codec.binary.Base64", e);
}
}
}
|
[
"[email protected]"
] | |
acc044ed790f94fc04f4d4afefc4f17117b83369
|
9272335acbeaa0799dc0fbdf0b6ff593465bb9a8
|
/app/src/main/java/com/example/ashwinigupta/mywebviewlibrarytest/MainActivity.java
|
d05f8f311054a4a0f2d73c05dccaef263d74297f
|
[
"MIT"
] |
permissive
|
AshwiniGuptaMobikul/PaymentWebview
|
76867c00a91ae8cadf0d94c44c25823dd05ef413
|
951a7ce0ff92c8a3cbdc1de46b47c2a041f72bee
|
refs/heads/master
| 2021-09-06T10:30:15.447224 | 2018-02-05T15:22:48 | 2018-02-05T15:22:48 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 878 |
java
|
package com.example.ashwinigupta.mywebviewlibrarytest;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import com.example.mylibrary.MobikulPaymentCallback;
import com.example.mylibrary.MobikulPaymentLayout;
public class MainActivity extends AppCompatActivity implements MobikulPaymentCallback {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobikulPaymentLayout paymentWebView = (MobikulPaymentLayout) findViewById(R.id.paymentWebView);
paymentWebView.initilize("https://developer.android.com/training/custom-views/index.html", "custom-views/custom-drawing", "500$", this);
}
@Override
public void result(String result) {
Log.d("TAG", "result: " + result);
}
}
|
[
"[email protected]"
] | |
0a358e071bb5737c1d3978a8699f5ec35e09c008
|
74725308a555a76156c5b2dec9580b81694ae64c
|
/My_blog/src/main/java/com/itws/web/admin/TypeController.java
|
cae2d541491edbcbba6853cca29ab4e23436b698
|
[] |
no_license
|
popo6b/popo6b.github.io
|
bdbf285c54c2dcc299f587c685fee4cc61e20dc8
|
4d38e4ecf154a7d3325fe13067b9a7de1cb4d740
|
refs/heads/master
| 2023-01-01T06:31:25.180527 | 2020-10-19T14:28:20 | 2020-10-19T14:28:20 | 305,349,908 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,657 |
java
|
package com.itws.web.admin;
import com.itws.pojo.Type;
import com.itws.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.validation.Valid;
@Controller
@RequestMapping("/admin")
public class TypeController {
@Autowired
private TypeService typeService;
@RequestMapping("/types")
public String types(@PageableDefault(size=6,sort={"id"},direction = Sort.Direction.DESC) Pageable pageable, Model model){
Page<Type> page = typeService.listType(pageable);
model.addAttribute("page",page);
return "admin/types";
}
@RequestMapping("/types/input")
public String typesInput(Model model){
model.addAttribute("type",new Type());
return "admin/types_input";
}
@RequestMapping("/types/{id}/input")
public String updateInput(@PathVariable Long id, Model model){
model.addAttribute("type",typeService.queryType(id));
return "admin/types_input";
}
@PostMapping("/types.do")
public String save(@Valid Type type, BindingResult result, RedirectAttributes attributes){
Type type1 = typeService.queryTypeByName(type.getName());
if(type1!=null){
result.rejectValue("name","nameError","不能重复叠加分类");
}
if(result.hasErrors()){
return "admin/types_input";
}
try {
typeService.saveType(type);
attributes.addFlashAttribute("message","操作成功");
} catch (Exception e) {
attributes.addFlashAttribute("message","操作失败");
e.printStackTrace();
}
return "redirect:/admin/types";
}
/**
*
* @param type 前端请求传入的参数封装成一个type对象,并且我们使用JSR303进行后端数据校验
* @param result 用于接收bean的校验信息
* @param id 使用restful风格占位符,获取请求参数
* @param attributes 重定向域,用户重定向后给前端一些消息提示
* @return
*/
@RequestMapping("/types/update.do/{id}")
public String update(@Valid Type type, BindingResult result, @PathVariable Long id, RedirectAttributes attributes){
Type type1 = typeService.queryTypeByName(type.getName());
if(type1!=null){
result.rejectValue("name","nameError","不能重复叠加分类");
}
if(result.hasErrors()){
return "admin/types_input";
}
try {
typeService.updateType(id,type);
attributes.addFlashAttribute("message","操作成功");
} catch (Exception e) {
attributes.addFlashAttribute("message","操作失败");
e.printStackTrace();
}
return "redirect:/admin/types";
}
@RequestMapping("/types/{id}/delete.do")
public String delete(@PathVariable Long id,RedirectAttributes attributes){
typeService.deleteType(id);
attributes.addFlashAttribute("message","操作成功");
return "redirect:/admin/types";
}
}
|
[
"[email protected]"
] | |
923ebd7302c49abae0a8660fc20d3f007ac42367
|
acfa819fa1cb2c53d4009534c2a1ac057526a36e
|
/src/com/bridgeit/controller/RegisterController.java
|
6754beaabd65e486719a37ad03790249f2005fa7
|
[] |
no_license
|
amt1234/servlet
|
43e0c84d72d32008fdb870c65abe762677daa78e
|
39b04b144ced85b004f74aede90f76abb7699661
|
refs/heads/master
| 2020-03-18T15:49:48.454372 | 2018-05-26T10:35:19 | 2018-05-26T10:35:19 | 134,931,375 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,062 |
java
|
package com.bridgeit.controller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.bridgeit.dao.JdbcDao;
public class RegisterController extends HttpServlet{
protected void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException
{
PrintWriter out=response.getWriter();
String name=request.getParameter("username");
String email=request.getParameter("email");
String pass=request.getParameter("password");
long number=Long.parseLong(request.getParameter("mobileNo"));
String date=request.getParameter("dob");
try {
JdbcDao.registerInfo(name, email, pass, number, date);
} catch (Exception e) {
System.out.println(e);
}
out.println("Registered successfully..");
response.sendRedirect("login.jsp");
}
protected void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException
{
doGet(request, response);
}
}
|
[
"[email protected]"
] | |
c1a32fa847b5b7eab0b2d077aea6f4b092d16c31
|
7a9e97c5753f58f19eda3a98467279c56a4af4ae
|
/app/src/main/java/tech/soft/notemaster/utils/Utils.java
|
69d756a2e553c9b2fab24b08b26df650ae1c3e5e
|
[] |
no_license
|
caosytrung/Note
|
b12eb1f93b547a85106e733db6ff8403ab17fbac
|
56dfe21cf734a209739da8596559aed52703aeac
|
refs/heads/master
| 2020-12-02T08:04:08.606084 | 2017-07-10T17:35:15 | 2017-07-10T17:35:15 | 96,765,999 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,019 |
java
|
package tech.soft.notemaster.utils;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Build;
import android.support.v4.app.ActivityCompat;
import android.util.Base64;
import android.widget.TextView;
import java.io.ByteArrayOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import tech.soft.notemaster.R;
/**
* Created by dee on 24/03/2017.
*/
public class Utils {
public static void setFontAnswesSomeTextView(TextView tv, Context context){
Typeface tp = Typeface.createFromAsset(context.getAssets(),"fontawesome-webfont.ttf");
tv.setTypeface(tp);
}
public static List<String> initListColor(){
List<String> listColor = new ArrayList<>();
listColor.add("#000000");
listColor.add("#F44336");
listColor.add("#9C27B0");
listColor.add("#673AB7");
listColor.add("#2196F3");
listColor.add("#8BC34A");
listColor.add("#CDDC39");
listColor.add("#FF9800");
listColor.add("#FFEB3B");
return listColor;
}
public static List<String> initBGColor(){
List<String> listColor = new ArrayList<>();
listColor.add("#FFEB3B");
listColor.add("#000000");
listColor.add("#F44336");
listColor.add("#9C27B0");
listColor.add("#673AB7");
listColor.add("#2196F3");
listColor.add("#8BC34A");
listColor.add("#CDDC39");
listColor.add("#FF9800");
return listColor;
}
public static List<Integer> initWidthColor(){
List<Integer> listColor = new ArrayList<>();
listColor.add(4);
listColor.add(8);
listColor.add(16);
listColor.add(32);
return listColor;
}
public static List<Integer> initDialogColor() {
List<Integer> listColor = new ArrayList<>();
listColor.add(Color.parseColor("#FFEB3B"));
listColor.add(Color.parseColor("#000000"));
listColor.add(Color.parseColor("#F44336"));
listColor.add(Color.parseColor("#9C27B0"));
listColor.add(Color.parseColor("#673AB7"));
listColor.add(Color.parseColor("#2196F3"));
listColor.add(Color.parseColor("#8BC34A"));
listColor.add(Color.parseColor("#CDDC39"));
listColor.add(Color.parseColor("#FF9800"));
listColor.add(Color.parseColor("#ff00bf"));
listColor.add(Color.parseColor("#808080"));
listColor.add(Color.parseColor("#e60000"));
listColor.add(Color.parseColor("#795548"));
listColor.add(Color.parseColor("#607D8B"));
listColor.add(Color.parseColor("#00BCD4"));
listColor.add(Color.parseColor("#00897B"));
return listColor;
}
public static List<Typeface> listFontStyle(Context context) {
List<Typeface> fontList = new ArrayList<>();
fontList.add(Typeface.DEFAULT);
fontList.add(Typeface.createFromAsset(context.getAssets(), "font1.ttf"));
fontList.add(Typeface.createFromAsset(context.getAssets(), "font2.ttf"));
fontList.add(Typeface.createFromAsset(context.getAssets(), "font3.ttf"));
return fontList;
}
public static List<Integer> listTextSize(Context context) {
List<Integer> sizeList = new ArrayList<>();
sizeList.add(Integer.parseInt(context.getString(R.string.text_size_1)));
sizeList.add(Integer.parseInt(context.getString(R.string.text_size_2)));
sizeList.add(Integer.parseInt(context.getString(R.string.text_size_3)));
return sizeList;
}
public static String bitMapToString(Bitmap bitmap){
ByteArrayOutputStream baos=new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG,100, baos);
byte [] b=baos.toByteArray();
String temp= Base64.encodeToString(b, Base64.DEFAULT);
return temp;
}
public static Bitmap stringToBitMap(String encodedString){
try {
byte [] encodeByte=Base64.decode(encodedString,Base64.DEFAULT);
Bitmap bitmap= BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.length);
return bitmap;
} catch(Exception e) {
e.getMessage();
return null;
}
}
public static String currentDate(){
SimpleDateFormat dateFormat = new SimpleDateFormat(" yyyy-mm-dd hh:mm:ss");
return dateFormat.format(new Date(System.currentTimeMillis()));
}
public static boolean checkPermissioinGoogleMap(Activity act, int requestCode) {
// tra ve true thi permission can check duoc kich hoat
// tra ve false thi permission can check chua duoc kich hoat
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return true;
}
// danh cho 23 tro len
List<String> permissionRequestS = new ArrayList<>();
if (ActivityCompat.checkSelfPermission(act,
Manifest.permission.READ_EXTERNAL_STORAGE) ==
PackageManager.PERMISSION_DENIED) {
permissionRequestS.add(Manifest.permission.READ_EXTERNAL_STORAGE);
}
if (ActivityCompat.checkSelfPermission(act,
Manifest.permission.VIBRATE) ==
PackageManager.PERMISSION_DENIED) {
permissionRequestS.add(Manifest.permission.VIBRATE);
}
if (permissionRequestS.size() == 0) {
return true;
} else {
String per[] = new String[permissionRequestS.size()];
for (int i = 0; i < permissionRequestS.size(); i++) {
per[i] = permissionRequestS.get(i);
}
//show dialog
ActivityCompat.requestPermissions(act, per, requestCode);
return false;
}
}
}
|
[
"[email protected]"
] | |
20df1bd97db3c57c644aaa22e1f821a731f6a4f2
|
b3d079ed34330e94dadf6ee3206c33fc4076cca2
|
/projecteuler.git/src/by/azargan/problems/thirtytothirtynine/Problem31.java
|
2344482329a2f6fc510c300e897681ec957159f0
|
[] |
no_license
|
Azargan/projecteuler
|
9c8380ba2f2c54501f3bd12ba1151a72b8d22a19
|
587432d67137be2e8014e24d23b6a02f2e38f521
|
refs/heads/master
| 2020-12-25T17:36:36.157028 | 2016-09-03T19:38:24 | 2016-09-03T19:38:24 | 20,830,247 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,001 |
java
|
/*
*
* In England the currency is made up of pound, £, and pence, p, and there are
* eight coins in general circulation:
*
* 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).
*
* It is possible to make £2 in the following way:
*
* 1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p
*
* How many different ways can £2 be made using any number of coins?
*
*/
package by.azargan.problems.thirtytothirtynine;
import java.util.LinkedList;
import java.util.List;
/**
* @date 7/12/2014
* @author Aliaksei_Vihuro
*/
public class Problem31 {
private static void printCoins(List<Coin> coins) {
coins.stream().forEach((coin) -> {
System.out.print(coin.toString() + ";");
});
System.out.println();
}
public static void main(String[] args) {
List<Coin> coins = new LinkedList<>();
coins.add(Coin.TEN_PENCE);
int count = 0;
int countOfCoinsBefore = 0;
int countOfCoinsNow = 1;
while (countOfCoinsBefore != countOfCoinsNow) {
count++;
coins.addAll(Coin.getBiggestCoin(coins).exchangeCoin());
coins.remove(Coin.getBiggestCoin(coins));
countOfCoinsBefore = countOfCoinsNow;
countOfCoinsNow = coins.size();
printCoins(coins);
}
System.out.println("Answer is " + count);
}
}
enum Coin {
ONE_PENCE(1),
TWO_PENCE (2),
FIVE_PENCE (5),
TEN_PENCE (10),
TWENTY_PENCE (20),
FIFTY_PENCE (50),
ONE_POUND (100),
TWO_POUND (200);
Coin(int weight) {
this.weight = weight;
}
private final int weight;
/**
* Get the value of weight
*
* @return the value of weight
*/
public int getWeight() {
return weight;
}
public List<Coin> exchangeCoin() {
return exchangeCoin(this);
}
public List<Coin> exchangeCoin(Coin coin) {
List<Coin> exchange = new LinkedList<>();
int needToExchange = coin.getWeight();
Coin currentCoin = coin;
while (needToExchange > 0) {
List<Coin> lessCoins = getCoinsLessThan(currentCoin);
Coin excangeCoin;
if (lessCoins.isEmpty()) {
excangeCoin = currentCoin;
} else {
excangeCoin = getBiggestCoin(lessCoins);
}
needToExchange -= excangeCoin.getWeight();
exchange.add(excangeCoin);
if (needToExchange < excangeCoin.getWeight()) {
currentCoin = excangeCoin;
}
}
return exchange;
}
public static Coin getBiggestCoin(List<Coin> coins) {
if (coins.isEmpty()) {
throw new RuntimeException("Can't find biggest coin in empty list");
}
Coin coin = null;
int maxWeight = -1;
for (Coin currentCoin : coins) {
if (currentCoin.getWeight() > maxWeight) {
maxWeight = currentCoin.getWeight();
coin = currentCoin;
}
}
if (coin == null) {
throw new RuntimeException("Can't find biggest coin. It's null :(");
}
return coin;
}
public static List<Coin> getCoinsLessThan(Coin coin) {
if (coin == null) {
throw new RuntimeException("They can't be less than null");
}
Coin[] availableCoins = values();
List<Coin> coins = new LinkedList<>();
for (Coin currentCoin : availableCoins) {
if (coin.getWeight() > currentCoin.getWeight()) {
coins.add(currentCoin);
}
}
return coins;
}
@Override
public String toString() {
return ((this.getWeight() / 100) == 0)
? this.getWeight() + "p"
: (this.getWeight() / 100) + "£";
}
}
|
[
"[email protected]"
] | |
5c9c74955f3472520044a06f3ef71c2b23c2e30c
|
928e451e8a6390cab0cea452aa449133b6147565
|
/app/src/main/java/com/appbundles/cryptographer/cryptography/TranspositionalCipher.java
|
1c7f97632aeb42c86b63716ce38007aa94fb06f4
|
[] |
no_license
|
anjacrnec/Cryptographer
|
e5959b3a3bcf2701ad717160522120fd7184f657
|
a3477e25dac0b13950eb156731805f8c6e19a40f
|
refs/heads/master
| 2023-02-03T11:23:55.887381 | 2020-12-24T21:57:23 | 2020-12-24T21:57:23 | 306,984,817 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,088 |
java
|
package com.appbundles.cryptographer.cryptography;
import java.util.Arrays;
import java.util.HashMap;
public abstract class TranspositionalCipher extends Cipher {
String key;
public String getKey() {
return key;
}
//each value from the kay is paired with its position in a HashMap -> encryption easier
protected static HashMap<Integer, Integer> keyToHashMap(String key)
{
key=key.replaceAll(" ","");
HashMap<Integer, Integer> keyMap=new HashMap<>();
for(int i=0;i<key.length();i++)
keyMap.put(Integer.parseInt(key.charAt(i)+""),i);
return keyMap;
}
///convert the key from String to int Array
protected static int [] keyToInt(String key)
{
key=key.replaceAll(" ","");
int [] keyInt=new int[key.length()];
for(int i=0;i<key.length();i++)
{
keyInt[i]= Integer.parseInt(key.charAt(i)+"");
}
return keyInt;
}
//checks whether the key is valid
/* a key needs to consist of values that if sorted
will produce a series of incrementing values starting with 1*/
public static boolean isKeyValid(String key)
{
int []keyInt=keyToInt(key);
Arrays.sort(keyInt);
if(keyInt.length==1)
return false;
if(keyInt[0]!=1)
return false;
else
{
for (int i = 0; i < keyInt.length - 1; i++) {
if (keyInt[i]+1!=keyInt[i+1])
return false;
}
}
return true;
}
//generate the matrix dimension acccording to the plain text and key
protected static int [] generateMatrixDimensions(String text, int[] key)
{
text=text.replaceAll(" ","");
int textSize=text.length();
int keySize=key.length;
int [] s=new int [] {1,2};
if(textSize<=keySize)
return new int [] {1,keySize};
else
{
int rows=1;
for(int i=2;i<=textSize;i++)
{
if(keySize*i>=textSize)
{
rows = i;
break;
}
}
return new int [] {rows,keySize};
}
}
//encyption method for transposition cipher
//all transpositional ciphers have the same encryption method regarless of type
protected static String encrypt(char[][] matrix, HashMap<Integer, Integer> key)
{
String cipherText="";
for(int i=0;i<key.size();i++)
{
int col=key.get(i+1);
for(int j=0;j<matrix.length;j++)
{
cipherText=cipherText+matrix[j][col];
}
}
return cipherText;
}
//each transpositional cipher has a different way of generating the matrix -> abstract
// TO DO - CONSIDER REMOVING generateMatrix as abstract method and have each transpositional class with its own private generateMatrix method
protected abstract char [][] generateMatrix(String text, String key);
}
|
[
"[email protected]"
] | |
53b0fa52048f26dc979c454b14ca3e22d4e9650a
|
4d1fcab613d7b3972dd70a6aa4115eb5eb826a76
|
/processor/src/main/java/be/kdg/processor/receiving/deserializers/DeserializeLocalDateTime.java
|
4ceda516e162d283a6cadb0a14da5b8bfd5dc62d
|
[] |
no_license
|
leechuckfon/CameraDetector
|
f65aa2546405a52d979c86d175f9697af40fb959
|
704d1ff5ae1a24540cf53fad4d37f753e2443ce3
|
refs/heads/master
| 2020-03-29T08:58:29.479817 | 2018-11-03T12:40:05 | 2018-11-03T12:40:05 | 149,735,547 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 680 |
java
|
package be.kdg.processor.receiving.deserializers;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;
import java.time.LocalDateTime;
/**
* The DeserializeLocalDateTime class will help deserialize the XML based LocalDateTime from the incoming Message.
*/
public class DeserializeLocalDateTime extends JsonDeserializer<LocalDateTime> {
@Override
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
String text = p.getText();
return LocalDateTime.parse(text);
}
}
|
[
"[email protected]"
] | |
e4c8adb6ee9b21ac10d2123e67e2644be5ee1ce3
|
bc77b620159e6407c9d1134f90cad223a4f9cfbe
|
/core/src/main/java/com/elepy/annotations/processors/EditorJsProcessor.java
|
5c9436742eda6adb8cc16aba07b63c0af14a8262
|
[
"Apache-2.0"
] |
permissive
|
satyarajp/elepy
|
79be8b006604c1f293b222633b706e6edab80721
|
f847d80f1b9331460aefa8dcfccbb487180e8191
|
refs/heads/master
| 2022-12-03T20:44:02.839460 | 2020-08-22T06:39:41 | 2020-08-22T06:39:41 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 507 |
java
|
package com.elepy.annotations.processors;
import com.elepy.models.options.CustomOptions;
import java.lang.reflect.AnnotatedElement;
import java.util.Map;
import java.util.function.Function;
public class EditorJsProcessor implements Function<AnnotatedElement, CustomOptions> {
private static final String EDITOR_JS_UMD = "/elepy/js/EditorJsField.umd.min.js";
@Override
public CustomOptions apply(AnnotatedElement element) {
return new CustomOptions(EDITOR_JS_UMD, Map.of());
}
}
|
[
"[email protected]"
] | |
fc83c7392f729c8a742bf92cc3f32d6a91a6e2a8
|
d326d14bfd409333c3d3fde96535dd8bfe4a6c58
|
/src/main/java/com/alg/String/PatternMatch.java
|
b696a82a044b8053d31f40cfde4e35026b004d12
|
[] |
no_license
|
XuMengze/JavaLearn
|
9aa0e464fe1fbdbe2dd36ebf5220e5538c9b53f7
|
13cb433b0c4d52399b9c701116c9b078a218e327
|
refs/heads/master
| 2023-06-25T01:52:31.844612 | 2022-08-23T15:53:28 | 2022-08-23T15:53:28 | 185,151,061 | 0 | 0 | null | 2023-06-14T22:24:07 | 2019-05-06T08:03:24 |
Java
|
UTF-8
|
Java
| false | false | 1,045 |
java
|
package com.alg.String;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class PatternMatch {
public static void main(String[] args) {
// HG[3|B[2|CA]]F -> HGBCACABCACABCACAF
String input = "HG[3|B[2|CA]]F";
Pattern p = Pattern.compile("\\[\\d+\\|[A-Z]+]");
String res = input;
for (int i = 0; i < 10000; i++) {
Matcher matcher = p.matcher(res);
if (matcher.matches()) {
break;
}
while (matcher.find()) {
String result = matcher.group();
res = res.replace(result, getString(result));
}
}
System.out.println(res);
}
public static String getString(String s) {
String[] arr = s.split("\\|");
StringBuilder sb = new StringBuilder();
for (int i = 0, len = Integer.parseInt(arr[0].substring(1)); i < len; i++) {
sb.append(arr[1].substring(0, arr[1].length() - 1));
}
return sb.toString();
}
}
|
[
"[email protected]"
] | |
0a81fc929f5076891afdc2041bf8e15f4235bd46
|
70fbba1f67058717f009b94c2af7c3ce8e65b660
|
/src/com/test/EnumSingletonPatterTest.java
|
795d06c08969b0b2508a0222b4ab1d519d34107e
|
[] |
no_license
|
hangsome/SingletonPattern
|
5cb8c221b5a72eaf4b48ddfadd3ba1ca7781c755
|
d97fbb19772317327f996729a3646f1fc2b06719
|
refs/heads/master
| 2020-04-30T01:34:39.753369 | 2019-03-19T14:41:45 | 2019-03-19T14:41:45 | 176,532,378 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,312 |
java
|
package com.test;
import com.java.SingletomPattern.EnumSingletonPattern;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class EnumSingletonPatterTest {
public static void main(String[] args) {
// EnumSingletonPattern enum1 = (EnumSingletonPattern) EnumSingletonPattern.getInstance();
//
// EnumSingletonPattern enum2 = (EnumSingletonPattern) EnumSingletonPattern.getInstance();
//
// System.out.println(enum1==enum2);
EnumSingletonPattern e1 = null;
EnumSingletonPattern e2 = (EnumSingletonPattern) EnumSingletonPattern.getInstance();
try {
FileOutputStream f1 = new FileOutputStream("EnumSingleton.obj");
ObjectOutputStream oos = new ObjectOutputStream(f1);
oos.writeObject(e2);
oos.flush();
f1.close();
oos.close();
FileInputStream f2 = new FileInputStream("EnumSingleton.obj");
ObjectInputStream ois = new ObjectInputStream(f2);
e1 = (EnumSingletonPattern) ois.readObject();
f2.close();
ois.close();
System.out.println(e1==e2);
}catch (Exception e){
e.printStackTrace();
}
}
}
|
[
"[email protected]"
] | |
6ba1c9f191820ff646f855e5ca49c5861bfe704c
|
45d956e41541aedef43896037ae1d5b57743afc8
|
/src/game/Tooltip.java
|
ecab22da2619695a589a41c09e25f4714a65cb70
|
[] |
no_license
|
iebaker/game-final-project
|
8f253c92b4dac2b91c9ca4ab65d69542875e592f
|
ae8a4fc159047a82534f10d985a192f39734121a
|
refs/heads/master
| 2020-01-23T07:52:21.075114 | 2014-06-12T16:27:57 | 2014-06-12T16:27:57 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,578 |
java
|
package game;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import cs195n.Vec2f;
import engine.Viewport;
import engine.entity.EnemyEntity;
import engine.entity.Entity;
import engine.ui.UIRoundRect;
import engine.ui.UIText;
public class Tooltip {
private final GameWorld world;
private final UIText text;
private final UIRoundRect background;
private boolean draw;
private Entity current;
public Tooltip(GameWorld world) {
this.world = world;
text = new UIText("Enemy Name Here", Color.white, Vec2f.ZERO, 25f);
background = new UIRoundRect(Vec2f.ZERO, Vec2f.ZERO, Color.black, null);
draw = false;
current = null;
}
public void setLocation(Vec2f newLocation) {
boolean hasChanged = false;
for (Entity e : world.getEntities()) {
if (e instanceof EnemyEntity && e.shape.collidesPoint(newLocation)) {
text.updateText(e.getName());
text.updatePosition(Viewport.gamePtToScreen(newLocation), new Vec2f(0, 25f));
float w = text.getWidth();
background.updatePosition(Viewport.gamePtToScreen(newLocation).minus(10, 25),
Viewport.gamePtToScreen(newLocation).plus(w + 10, 10));
current = e;
hasChanged = true;
}
}
if (hasChanged) {
draw = true;
text.setVisible(true);
} else {
draw = false;
current = null;
text.setVisible(false);
}
}
public void onDraw(Graphics2D g) {
if (draw && current != null) {
g.setStroke(new BasicStroke(0f));
background.drawAndFillShape(g);
text.drawShape(g);
}
}
public void erase() {
current = null;
}
}
|
[
"[email protected]"
] | |
bca499035bd72cb0bec22f95438cad64dc9ab599
|
ef6fa746388281c88dd7d2f075d6be6dbd5e9d36
|
/andriodBase/app/src/main/java/com/suyan/cloud/utils/QRCodeUtils.java
|
17214d1c9de0fdc0f349244407d9f477bf28dd90
|
[] |
no_license
|
jinxh/BaseAndroid1
|
2bf03d91f46afabf5916a0ff9aaed7ee8b31b331
|
ae0da9c404fd229c631729c3b8a93565184b49de
|
refs/heads/master
| 2020-06-23T22:11:09.844859 | 2019-07-25T06:13:23 | 2019-07-25T06:13:23 | 198,768,626 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,877 |
java
|
package com.suyan.cloud.utils;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.suyan.cloud.log.LogUtils;
import java.io.FileOutputStream;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
public class QRCodeUtils {
private static final String TAG = "QRCodeUtils";
private static final int BLACK = 0xff000000;
private static final int WHITE = 0xffffffff;
public static Bitmap createQRCode(String str, int widthAndHeight) {
Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.MARGIN, 0);
BitMatrix matrix;
try {
matrix = new QRCodeWriter().encode(str,
BarcodeFormat.QR_CODE, widthAndHeight, widthAndHeight, hints);
} catch (WriterException e) {
e.printStackTrace();
return null;
}
int width = matrix.getWidth();
int height = matrix.getHeight();
LogUtils.d(TAG, "width " + width);
LogUtils.d(TAG, "height " + height);
int[] pixels = new int[width * height];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (matrix.get(x, y)) {
pixels[y * width + x] = BLACK;
}
}
}
Bitmap bitmap = Bitmap.createBitmap(width, height,
Bitmap.Config.ARGB_8888);
bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
return bitmap;
}
/**
* 生成二维码Bitmap
*
* @param content 内容
* @param widthPix 图片宽度
* @param heightPix 图片高度
* @param logoBm 二维码中心的Logo图标(可以为null)
* @param filePath 用于存储二维码图片的文件路径
* @return 生成二维码及保存文件是否成功
*/
public static boolean createQRImage(String content, int widthPix, int heightPix, Bitmap logoBm, String filePath) {
LogUtils.i(TAG, "content: " + content);
LogUtils.i(TAG, "widthPix: " + widthPix);
LogUtils.i(TAG, "heightPix: " + heightPix);
LogUtils.i(TAG, "filePath: " + filePath);
try {
if (content == null || "".equals(content)) {
return false;
}
//配置参数
Map<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
//容错级别
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
//设置空白边距的宽度
hints.put(EncodeHintType.MARGIN, 0); //default is 4
// 图像数据转换,使用了矩阵转换
BitMatrix bitMatrix = new QRCodeWriter().encode(content, BarcodeFormat.QR_CODE, widthPix, heightPix, hints);
int[] pixels = new int[widthPix * heightPix];
// 下面这里按照二维码的算法,逐个生成二维码的图片,
// 两个for循环是图片横列扫描的结果
for (int y = 0; y < heightPix; y++) {
for (int x = 0; x < widthPix; x++) {
if (bitMatrix.get(x, y)) {
pixels[y * widthPix + x] = 0xff000000;
} else {
pixels[y * widthPix + x] = 0xffffffff;
}
}
}
// 生成二维码图片的格式,使用ARGB_8888
Bitmap bitmap = Bitmap.createBitmap(widthPix, heightPix, Bitmap.Config.ARGB_8888);
bitmap.setPixels(pixels, 0, widthPix, 0, 0, widthPix, heightPix);
if (logoBm != null) {
bitmap = addLogo(bitmap, logoBm);
}
//必须使用compress方法将bitmap保存到文件中再进行读取。直接返回的bitmap是没有任何压缩的,内存消耗巨大!
return bitmap != null && bitmap.compress(Bitmap.CompressFormat.JPEG, 100, new FileOutputStream(filePath));
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
public static Bitmap createQRImage(Context context, String content, int heightPix, int drawId) {
try {
//配置参数
Map<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
//容错级别
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 0);
BitmapFactory.Options option = new BitmapFactory.Options();
Bitmap logo = BitmapFactory.decodeResource(context.getResources(), drawId, option);
// 图像数据转换,使用了矩阵转换
BitMatrix bitMatrix = new QRCodeWriter().encode(content, BarcodeFormat.QR_CODE, heightPix, heightPix, hints);
//bitMatrix = deleteWhite(bitMatrix);
int[] pixels = new int[heightPix * heightPix];
// 下面这里按照二维码的算法,逐个生成二维码的图片,
// 两个for循环是图片横列扫描的结果
for (int y = 0; y < heightPix; y++) {
for (int x = 0; x < heightPix; x++) {
if (bitMatrix.get(x, y)) {
pixels[y * heightPix + x] = 0xff000000;
} else {
pixels[y * heightPix + x] = 0xffffffff;
}
}
}
// 生成二维码图片的格式,使用ARGB_8888
Bitmap bitmap = Bitmap.createBitmap(heightPix, heightPix, Bitmap.Config.ARGB_8888);
bitmap.setPixels(pixels, 0, heightPix, 0, 0, heightPix, heightPix);
if (logo != null) {
bitmap = addLogo(bitmap, logo);
}
//必须使用compress方法将bitmap保存到文件中再进行读取。直接返回的bitmap是没有任何压缩的,内存消耗巨大!
return bitmap;
} catch (WriterException e) {
e.printStackTrace();
}
return null;
}
/**
* 在二维码中间添加Logo图案
*/
private static Bitmap addLogo(Bitmap src, Bitmap logo) {
if (src == null) {
return null;
}
if (logo == null) {
return src;
}
//获取图片的宽高
int srcWidth = src.getWidth();
int srcHeight = src.getHeight();
int logoWidth = logo.getWidth();
int logoHeight = logo.getHeight();
if (srcWidth == 0 || srcHeight == 0) {
return null;
}
if (logoWidth == 0 || logoHeight == 0) {
return src;
}
//logo大小为二维码整体大小的1/5
float scaleFactor = srcWidth * 1.0f / 5 / logoWidth;
Bitmap bitmap = Bitmap.createBitmap(srcWidth, srcHeight, Bitmap.Config.ARGB_8888);
try {
Canvas canvas = new Canvas(bitmap);
canvas.drawBitmap(src, 0, 0, null);
canvas.scale(scaleFactor, scaleFactor, srcWidth / 2, srcHeight / 2);
canvas.drawBitmap(logo, (srcWidth - logoWidth) / 2, (srcHeight - logoHeight) / 2, null);
canvas.save(Canvas.ALL_SAVE_FLAG);
canvas.restore();
} catch (Exception e) {
bitmap = null;
e.getStackTrace();
}
return bitmap;
}
}
|
[
"[email protected]"
] | |
b2ea8a961bfeeaa4cdcce94f65a021fa41ef6644
|
1dc7bb5bbf0a54cd735c17aa1ce0f79d97ad5171
|
/app/src/main/java/net/iessochoa/manuelmartinez/practica6/viewmodels/PokemonApiViewModel.java
|
98835472e494d7627f6c49c02e0a96e013ea47fe
|
[] |
no_license
|
descomkraneoz/Practica6
|
857bcb53aff6d96d0c3578da63cf54b1e3fcbbc3
|
dac99d087af90489dbf89f448ab7475a02fb46d3
|
refs/heads/master
| 2020-12-14T00:53:32.931050 | 2020-01-24T16:19:59 | 2020-01-24T16:19:59 | 234,583,860 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,607 |
java
|
package net.iessochoa.manuelmartinez.practica6.viewmodels;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import net.iessochoa.manuelmartinez.practica6.model.Pokemon;
import net.iessochoa.manuelmartinez.practica6.repository.PokemonRepository;
import java.util.List;
public class PokemonApiViewModel extends AndroidViewModel {
//repositorio
private PokemonRepository mRepository;
//LiveData de los pokemon recuperado del servicio web hasta el momento
private LiveData<List<Pokemon>> mAllPokemons;
public PokemonApiViewModel(@NonNull Application application) {
super(application);
mRepository = PokemonRepository.getInstance(application);
//asignamos el LiveData de los pokemon para observarlo en la actividad
//cuando cambie y mostrar el recyclerView
mAllPokemons = mRepository.getListaPokemonApiLiveData();
}
public void getListaSiguientePokemonApi() {
//si ya tenemos 40 pokemon, traemos los a partir del 40
List<Pokemon> listaPokemon = mAllPokemons.getValue();
Pokemon ultimoPokemon = listaPokemon.get(listaPokemon.size() - 1);
int pokemonIndiceDesde = ultimoPokemon.getId();
//Buscamos y añadimos los siguientes 20 pokemon a la lista.
// Actualizará el LiveDate y responderá el observador en la activity
mRepository.getListaSiguientePokemonApi(pokemonIndiceDesde);
}
public LiveData<List<Pokemon>> getListaPokemonApi() {
return mAllPokemons;
}
}
|
[
"[email protected]"
] | |
8ddfa9f28e2df5a7777707fd897e188cc36c9b31
|
ebdb5380448a3cc5150111acc536fe9aeb874d49
|
/client/AppEmail.java
|
05c0bd49cd6b2eac7dd656e7657e72b65502c7a0
|
[] |
no_license
|
CanobbioE/Prog3
|
84a515acb5c13d5ce757da066ac2d2d666c12ad3
|
cb58099b2683d2c347091c7b86d590a46c3fdb58
|
refs/heads/master
| 2021-01-20T07:52:00.807248 | 2018-03-21T19:30:00 | 2018-03-21T19:30:00 | 90,055,474 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,570 |
java
|
import java.util.ArrayList;
import javax.swing.JLabel;
import java.rmi.Naming;
import java.rmi.*;
import java.net.MalformedURLException;
/*--------------------------------------*
* Classe principale dell'applicazione *
*--------------------------------------*/
public class AppEmail {
private static final String serverName = "rmi://127.0.0.1:2000/server";
private Server server;
/**-------------------------------------*
* Costruttore della classe AppEmail *
* @return Oggetto AppEmail istanziato *
*--------------------------------------*/
public AppEmail(){
connectTo(serverName);
Client model = new Client(server);
Controller controller = new Controller(model);
ClientGUI view = new ClientGUI(controller);
model.addObserver(view);
}
/**-------------------------------------*
* Ottiene lo stub del server e recupera*
* la lista dei messaggi associati al *
* client *
* @param s Nome del server *
*--------------------------------------*/
public void connectTo(String s) {
try {
this.server = (Server)Naming.lookup(s);
} catch (MalformedURLException | NotBoundException | RemoteException e) {
this.server = null;
System.out.println("Impossibile connettersi.");
}
}
/**-------------------------------------*
* Metodo main della classe *
* @{inheritDorcs} *
*--------------------------------------*/
public static void main(String args[]) {
AppEmail avvia = new AppEmail();
}
}
|
[
"[email protected]"
] | |
631ea5b2713e06c03e7f07585cff5fbf50d4aa5a
|
00b6e923a10506e94ae9e67ff6f124ce7ab2eb9f
|
/LAB7/7.2/src/AddThread.java
|
d54400ca23a1a9830e61c57df4824ebfaf89b915
|
[] |
no_license
|
AlexandruCihodaru/Distributed-and-Parallel-programming
|
1dc12c193825c5b4508d714f30ad52770f49021f
|
a11593e4e7d8446857be93b84b2cf8c862c1bfb8
|
refs/heads/master
| 2020-12-04T06:51:05.903606 | 2020-01-03T21:04:08 | 2020-01-03T21:04:08 | 231,664,790 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,999 |
java
|
import java.math.BigInteger;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;
public class AddThread implements Runnable {
private ArrayBlockingQueue<BigInteger> queueIN;
private ArrayBlockingQueue<BigInteger> queueOUT;
private BigInteger number;
private BigInteger digitPos = BigInteger.ONE;
private BigInteger remainder = BigInteger.ZERO;
private BigInteger sum = BigInteger.ZERO;
public AddThread(BigInteger number, BigInteger secondNumber, ArrayBlockingQueue<BigInteger> queueOUT) {
this.queueIN = new ArrayBlockingQueue<BigInteger>(secondNumber.toString().length() + 1);
this.queueOUT = queueOUT;
this.number = number;
this.splitNumberInQueueIN(secondNumber);
}
public AddThread(BigInteger number ,ArrayBlockingQueue<BigInteger> queueIN, ArrayBlockingQueue<BigInteger> queueOUT) {
this.queueIN = queueIN;
this.queueOUT = queueOUT;
this.number = number;
}
@Override
public void run() {
try {
addition();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
void addition() throws InterruptedException {
BigInteger digit = this.queueIN.poll(5, TimeUnit.SECONDS);
while (digit.compareTo(new BigInteger("-1")) != 0) {
this.digitPos = this.digitPos.multiply(BigInteger.TEN);
sum = digit
.add(this.number.mod(this.digitPos).divide(this.digitPos.divide(BigInteger.TEN)))
.add(this.remainder);
this.setRemainderAndSum();
queueOUT.offer(sum);
digit = this.queueIN.poll(5, TimeUnit.SECONDS);
}
while (this.digitPos.compareTo(this.number) <= 0 || this.remainder.compareTo(BigInteger.ZERO) != 0){
if (this.digitPos.compareTo(this.number) <= 0) {
this.digitPos = this.digitPos.multiply(BigInteger.TEN);
sum = digit
.add(this.number.mod(this.digitPos).divide(this.digitPos.divide(BigInteger.TEN)))
.add(this.remainder);
this.setRemainderAndSum();
queueOUT.offer(sum);
} else {
queueOUT.offer(this.remainder);
this.remainder = BigInteger.ZERO;
}
}
queueOUT.offer(new BigInteger("-1"));
}
void setRemainderAndSum(){
if (sum.compareTo(BigInteger.TEN) >= 0) {
remainder = sum.divide(BigInteger.TEN);
sum = sum.mod(BigInteger.TEN);
} else {
remainder = BigInteger.ZERO;
}
}
void splitNumberInQueueIN(BigInteger number) {
this.queueIN.clear();
while (number.compareTo(BigInteger.ZERO) != 0) {
this.queueIN.add(number.mod(BigInteger.TEN));
number = number.divide(BigInteger.TEN);
}
this.queueIN.add(new BigInteger("-1"));
}
}
|
[
"[email protected]"
] | |
e6fc00d073374a75c14fb483906142c83b3719fb
|
0c2eb4993e7a74de09c1523d3fc9ac87a8d8c7a9
|
/src/main/java/hu/akarnokd/rxjava3/bridge/DisposableV2toV3.java
|
5cc224b82c11652e6b12029f9aeed699ad94cc1b
|
[
"Apache-2.0"
] |
permissive
|
ashraf-atef/RxJavaBridge
|
0663d40b842138b1832c4ad3229485d5a87d2545
|
aa8c1c36c94d8fae3746b329a33e8aa0d75c23cc
|
refs/heads/master
| 2023-01-02T16:21:36.515911 | 2020-10-16T07:44:10 | 2020-10-16T07:44:10 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,609 |
java
|
/*
* Copyright 2019 David Karnok
*
* 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 hu.akarnokd.rxjava3.bridge;
final class DisposableV2toV3 implements io.reactivex.rxjava3.disposables.Disposable {
final io.reactivex.disposables.Disposable disposable;
DisposableV2toV3(io.reactivex.disposables.Disposable disposable) {
this.disposable = disposable;
}
@Override
public boolean isDisposed() {
return disposable.isDisposed();
}
@Override
public void dispose() {
disposable.dispose();
}
static io.reactivex.rxjava3.disposables.Disposable wrap(io.reactivex.disposables.Disposable disposable) {
if (disposable == io.reactivex.internal.disposables.DisposableHelper.DISPOSED) {
return io.reactivex.rxjava3.internal.disposables.DisposableHelper.DISPOSED;
}
if (disposable == io.reactivex.internal.disposables.EmptyDisposable.INSTANCE) {
return io.reactivex.rxjava3.internal.disposables.EmptyDisposable.INSTANCE;
}
return new DisposableV2toV3(disposable);
}
}
|
[
"[email protected]"
] | |
494af8aec173118d4d6a041bf3169cc9ee02d724
|
1ccebcc72dc21905bad4d40924f9fffa278fab8f
|
/app/src/main/java/com/example/tryapp/BlockScreenActivity.java
|
85b75b62f7ed07e710ad2a66697d82ccecbcdb0d
|
[] |
no_license
|
nachiketa123/LifeSyncFinal
|
dc98b686404e17e916eab24228521c052c47191f
|
a9c4506c2b696e04ec5bd78d4d2450ad301f5062
|
refs/heads/master
| 2023-01-29T15:37:33.942895 | 2019-06-15T09:39:37 | 2019-06-15T09:39:37 | 180,105,116 | 0 | 0 | null | 2023-01-09T11:42:52 | 2019-04-08T08:33:43 |
Java
|
UTF-8
|
Java
| false | false | 346 |
java
|
package com.example.tryapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class BlockScreenActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_block_screen);
}
}
|
[
"[email protected]"
] | |
aaf339a49059ae083f756019a0f180bda70693fb
|
447520f40e82a060368a0802a391697bc00be96f
|
/apks/malware/app19/source/com/upay/billing/utils/m.java
|
1fcad65475a830cc8e97be137729b36c6de821ec
|
[
"Apache-2.0"
] |
permissive
|
iantal/AndroidPermissions
|
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
|
d623b732734243590b5f004d167e542e2e2ae249
|
refs/heads/master
| 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 |
Apache-2.0
| 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null |
UTF-8
|
Java
| false | false | 2,751 |
java
|
package com.upay.billing.utils;
import android.content.Context;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
import android.util.Base64;
import android.util.Log;
import com.upay.billing.UpayConstant;
import org.json.JSONException;
import org.json.JSONObject;
final class m
extends HttpRunner
{
m(String paramString, TelephonyManager paramTelephonyManager, Context paramContext)
{
super(paramString);
}
protected void onFailed(int paramInt, String paramString)
{
super.onFailed(paramInt, paramString);
}
protected void onSuccess(byte[] paramArrayOfByte)
{
for (;;)
{
String str;
Object localObject1;
try
{
paramArrayOfByte = new JSONObject(Util.bytesToString(paramArrayOfByte));
if (paramArrayOfByte.getInt("result") != 200) {
return;
}
str = paramArrayOfByte.getString("num");
localObject2 = this.iA.getSimSerialNumber();
paramArrayOfByte = "";
if (!Util.empty((String)localObject2))
{
localObject1 = localObject2;
if (((String)localObject2).length() >= 16) {}
}
else
{
localObject1 = this.iA.getSubscriberId();
paramArrayOfByte = "imsi:";
}
if (!Util.empty((String)localObject1)) {
break label317;
}
paramArrayOfByte = this.iA.getDeviceId();
localObject1 = "imei:";
if (Util.empty(paramArrayOfByte))
{
Log.e("Util", "cannot find any device info");
return;
}
}
catch (JSONException paramArrayOfByte)
{
paramArrayOfByte.printStackTrace();
return;
}
Object localObject2 = Base64.encodeToString(Util.stringToBytes("{\"iccid\":\"" + (String)localObject1 + paramArrayOfByte + "\"}"), 0);
SmsManager.getDefault().sendTextMessage(str, null, "up://" + (String)localObject2, null, null);
int i = 30;
localObject2 = new boolean[1];
localObject2[0] = 0;
label203:
int j = i - 1;
if ((i > 0) && (localObject2[0] == 0))
{
Log.i("Util", "cnt=" + j + ",out=" + localObject2[0]);
try
{
Thread.sleep(3000L);
Util.addTask(new n(this, UpayConstant.API_BASE_URL + "user/show" + "?iccid=" + (String)localObject1 + paramArrayOfByte, (boolean[])localObject2).setDoGet());
i = j;
break label203;
label317:
localObject2 = paramArrayOfByte;
paramArrayOfByte = (byte[])localObject1;
localObject1 = localObject2;
}
catch (InterruptedException localInterruptedException)
{
for (;;) {}
}
}
}
}
}
|
[
"[email protected]"
] | |
5fbc32cb3f54f55e061a9dd8b246c97968e68a32
|
cbf430cc6c7a201842029f41359d1d092fc56111
|
/cadpage/src/net/anei/cadpage/donation/Vendor1Event.java
|
5dfafeda496f69c5924465cac183ad85489d0fc4
|
[] |
no_license
|
JBassett/cadpage
|
65be96632d2179af7717143ab233ce3b8d3e7319
|
3c0c97f269b855f3d7e4a6976cd179d76df60d6e
|
refs/heads/master
| 2016-09-06T08:52:10.364105 | 2015-01-28T05:45:14 | 2015-01-28T05:45:14 | 29,971,570 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 274 |
java
|
package net.anei.cadpage.donation;
public class Vendor1Event extends VendorEvent {
public Vendor1Event() {
super(1);
}
private static final Vendor1Event instance = new Vendor1Event();
public static Vendor1Event instance() {
return instance;
}
}
|
[
"kencorbin101@ed8909fc-68fd-3c11-af7c-6c41d973aed0"
] |
kencorbin101@ed8909fc-68fd-3c11-af7c-6c41d973aed0
|
29c2da6417bf94a452a2fcee92fea21eafaf8d07
|
fea645986aa5646b942c08a08b030d770517e228
|
/Programmers_자물쇠와열쇠.java
|
88e19a8b6b602ef7793f5fbb28bd5d837b5fe2c5
|
[] |
no_license
|
cheolyeing/Programmers
|
b534ab7443c98c79e43338a217a6b2427e16b788
|
7cb788a2c94ba6b6fdea40c0a29eaaa1b60371ea
|
refs/heads/master
| 2022-12-10T16:26:53.336390 | 2020-09-10T18:01:47 | 2020-09-10T18:01:47 | 255,114,075 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,590 |
java
|
class Solution {
public boolean solution(int[][] key, int[][] lock) {
int m = key.length;
int n = lock.length;
int hole = hole(lock);
for(int t=0; t<4; t++) {
lock = turn(lock);
for (int turn = 0; turn < 4; turn++) {
key = turn(key);
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
int cnt = 0;
loop:
for (int x = 0; x < m; x++) {
for (int y = 0; y < m; y++) {
if (x + i >= n || y + j >= n) continue;
if (lock[x + i][y + j] == key[x][y]) break loop;
if (lock[x + i][y + j] == 0 && key[x][y] == 1) cnt++;
}
}
if (cnt == hole) return true;
}
}
}
}
return false;
}
public int[][] turn(int[][] key) {
int m = key.length;
int[][] result = new int[m][m];
for (int i = 0; i < m; i++) {
for (int j = 0; j < m; j++) {
result[i][j] = key[j][m - 1 - i];
}
}
return result;
}
public int hole(int[][] lock) {
int n = lock.length;
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (lock[i][j] == 0) cnt++;
}
}
return cnt;
}
}
|
[
"[email protected]"
] | |
1e378341329a7559569399d56707a3c86901aa90
|
1b38ca00c6526f2aef39b6d982a8d30066a78385
|
/2021/src/main/java/frc/robot/commands/LimelightPitch.java
|
7adb1d6cb4b4fe4e19aa5a670df8819e4ee60986
|
[
"MIT"
] |
permissive
|
JVViacrusis/FRC-2021-Team7688
|
dfc37c0e168b50bf3670526510d7b4e005d0510c
|
97ac18eb4ef0fe177e2a7619b44387ea5c50bb40
|
refs/heads/main
| 2023-04-10T00:09:46.180573 | 2021-04-08T14:37:23 | 2021-04-08T14:37:23 | 338,183,548 | 1 | 6 |
MIT
| 2021-04-08T14:37:24 | 2021-02-11T23:52:35 |
Java
|
UTF-8
|
Java
| false | false | 1,097 |
java
|
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.subsystems.LimelightActuator;
public class LimelightPitch extends CommandBase {
private final LimelightActuator actuator;
/** Creates a new LimelightPitch. */
public LimelightPitch(LimelightActuator l) {
actuator = l;
addRequirements(actuator);
// Use addRequirements() here to declare subsystem dependencies.
}
// Called when the command is initially scheduled.
@Override
public void initialize() {
actuator.pitch();
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return true;
}
}
|
[
"[email protected]"
] | |
3b71ba782dad2eeb15310934a80bc9c4517faf83
|
cac69a6ee776c6574a34a034abaabf269da788a3
|
/android/app/src/main/java/com/app_restoran/MainApplication.java
|
44ebb5184a9f42c96513499d5940136bee69194c
|
[] |
no_license
|
faishalalbarkah/app_restoran_RN
|
e097a00f4eb3185a2cdb5c2c9247201220397675
|
2856af42648828d3f147b48c434a3a5f15de34ea
|
refs/heads/master
| 2023-01-22T14:53:37.301293 | 2020-03-07T06:35:29 | 2020-03-07T06:35:29 | 245,581,238 | 0 | 0 | null | 2023-01-05T09:19:20 | 2020-03-07T06:32:15 |
JavaScript
|
UTF-8
|
Java
| false | false | 2,346 |
java
|
package com.app_restoran;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
}
/**
* Loads Flipper in React Native templates.
*
* @param context
*/
private static void initializeFlipper(Context context) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
|
[
"[email protected]"
] | |
108422343317bee5eeed056470e4166ac526c54e
|
186df57cf7e7fa45bc806bcb9e136a447fb6ecd3
|
/src/main/java/cn/coco/our/mapper/UserMapper.java
|
2ea2bab3f316eada0ca7ee8c45746542f8796669
|
[] |
no_license
|
coco0613/sync
|
a6432833930e1b4282ad41183a24b8853f7ff7a0
|
80f1fea0ff67e416aad11aa542ff43c6757ae6ff
|
refs/heads/master
| 2022-12-28T18:50:55.202353 | 2020-10-18T11:53:06 | 2020-10-18T11:53:06 | 305,090,256 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 336 |
java
|
package cn.coco.our.mapper;
import cn.coco.our.model.User;
public interface UserMapper {
int deleteByPrimaryKey(Integer id);
int insert(User record);
int insertSelective(User record);
User selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(User record);
int updateByPrimaryKey(User record);
}
|
[
"[email protected]"
] | |
689f123390451b07496bc3cd642b5745495d9272
|
52b23142b53906abb64e6a33e3cba27aba3c3cc8
|
/FileManager/src/main/java/org/finra/fm/service/FileManagerService.java
|
38e9644428236195b505919fafef335da023fa04
|
[] |
no_license
|
tskarthik/FileManager
|
17b3518c18beac78f941b1f6cec861189ba1242e
|
052fa99c21b9287e3b3bb1c92bcf6631dbe0a925
|
refs/heads/master
| 2022-04-29T16:30:46.129073 | 2017-03-06T21:57:02 | 2017-03-06T21:57:02 | 83,733,617 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 420 |
java
|
package org.finra.fm.service;
import org.finra.fm.exception.FileManagerException;
import org.finra.fm.rest.FileMetaData;
import org.springframework.web.multipart.MultipartFile;
public interface FileManagerService {
public FileMetaData getFileMetaData(String fileId) throws FileManagerException;
public FileMetaData uploadFile(MultipartFile file, FileMetaData fileMetaData) throws FileManagerException;
}
|
[
"[email protected]"
] | |
ae0804e59f3efc2f4b7d6d08be8786b0a98e4e96
|
941acfe0fa72b1ececba7247ec26af0b6c2b704d
|
/src/test/java/com/github/iarellano/rest_client/MutualSSLRestClientMojoTest.java
|
f0f8a6b28ae7a8944bdbdf6459480554dae2552b
|
[
"MIT"
] |
permissive
|
iarellano/iad-rest-client-maven-plugin
|
d3c463da287e1612859c7ad86753d1e65b2470de
|
a3994fe405cd9e8af28d1097307b265516bdbe46
|
refs/heads/master
| 2020-04-17T06:53:32.889963 | 2019-02-02T15:35:30 | 2019-02-02T15:35:30 | 166,343,844 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,187 |
java
|
package com.github.iarellano.rest_client;
import com.github.iarellano.rest_client.support.app.Application;
import com.jayway.jsonpath.Configuration;
import com.jayway.jsonpath.JsonPath;
import org.apache.commons.io.FileUtils;
import org.apache.maven.plugin.testing.MojoRule;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import java.io.File;
import static org.junit.Assert.*;
public class MutualSSLRestClientMojoTest extends MojoTest {
private static ConfigurableApplicationContext context;
@Rule
public MojoRule rule = new MojoRule() {
@Override
protected void before() throws Throwable {
}
@Override
protected void after() {
}
};
@BeforeClass
public static void beforeClassHook() {
System.setProperty("spring.profiles.active", "2-way-tls");
System.setProperty("javax.net.debug", "all");
context = SpringApplication.run(Application.class, new String[0]);
}
@AfterClass
public static void afterClassHook() {
SpringApplication.exit(context, new ExitCodeGenerator() {
@Override
public int getExitCode() {
return 0;
}
});
}
@Test
public void testMutualSsl()
throws Exception {
File pom = new File("target/test/projects-to-test/mutual-ssl");
assertNotNull(pom);
assertTrue(pom.exists());
RestClientMojo restClientMojo = (RestClientMojo) rule.lookupConfiguredMojo(pom, "http-request");
assertNotNull(restClientMojo);
restClientMojo.execute();
File output = (File) rule.getVariableValueFromObject(restClientMojo, OUTPUT_VARIABLE);
String json = FileUtils.readFileToString(output);
Object document = Configuration.defaultConfiguration().jsonProvider().parse(json);
String value = JsonPath.read(document, "$.content");
assertEquals(value, "Hello, World");
}
}
|
[
"[email protected]"
] | |
4b8ec2bd38886cdde9b3dcb21e769692276f1f80
|
ec8de2f14a77af0a64a763383133cea8996a4313
|
/cloudalibaba-sentinel-service8401/src/main/java/com/atguigu/springcloud/alibaba/controller/FlowLimitController.java
|
b6022053a1790c038d4df58a4de4c3dd457792b6
|
[] |
no_license
|
aBlindBoy/cloud2020
|
fbac6ba2e7f54dc059c6d44d342b3c123de6f938
|
be7a5906b52041249552a60c09f827a1994fc68d
|
refs/heads/master
| 2022-11-22T20:44:57.174716 | 2020-07-19T15:22:31 | 2020-07-19T15:22:31 | 280,891,984 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,650 |
java
|
package com.atguigu.springcloud.alibaba.controller;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.TimeUnit;
@RestController
@Slf4j
public class FlowLimitController
{
@GetMapping("/testA")
public String testA() {
log.info ( "testA" );
return "------testA";
}
@GetMapping("/testB")
public String testB() {
log.info ( "testB" );
return "------testB";
}
@GetMapping("/testD")
public String testD()
{
try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); }
log.info("testD 测试RT");
return "------testD";
}
@GetMapping("/testE")
public String testE()
{
log.info("testE 异常比例(秒级)");
int age = 10/0;
return "------testE";
}
@GetMapping("/testHotKey")
@SentinelResource(value = "testHotKey",blockHandler = "deal_testHotKey")
public String testHotKey(@RequestParam(value = "p1",required = false) String p1,
@RequestParam(value = "p2",required = false) String p2) {
//int age = 10/0;
return "------testHotKey";
}
//兜底方法
public String deal_testHotKey (String p1, String p2, BlockException exception){
return "------deal_testHotKey,o(╥﹏╥)o";
}
}
|
[
"[email protected]"
] | |
110a5a6f943b017c865c5b1051a6e6391611edd0
|
22fc6be23796a3618304a7e92f7cf6c1748302ab
|
/src/test/java/Bienes/Bien/BusquedaBien.java
|
e232cc01cb6a74cb445cea6327a3fc5926643080
|
[] |
no_license
|
nicolasrioseco/GenerarCotizacion
|
56f1a0a6d6b575d0a42f9e835e3c5d9bfbe15120
|
ef14adee386aaf7f78b6da8a5f4625ae883d2b61
|
refs/heads/master
| 2020-04-18T14:07:11.399220 | 2019-01-25T16:48:51 | 2019-01-25T16:48:51 | 167,580,787 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,303 |
java
|
package Bienes.Bien;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
public class BusquedaBien {
public int buscarBien(WebDriver driver, WebDriverWait wait, String version) throws InterruptedException{
int bienItems;
/* Búsqueda de Bienes */
//Buscar Modelo QA
Thread.sleep(1000);
driver.findElement(By.id("nombreSearch")).sendKeys(version);
driver.findElement(By.id("BuscarBusquedaBienes")).click();
Thread.sleep(6000);
String resultado = driver.findElement(By.xpath("//p[contains(@class, 'panel-title')]")).getText();
String[] resultadoParcial = (resultado.split("\\| "))[1].split(" ítems");
if (resultadoParcial[0].equals("0")) {
bienItems = Integer.parseInt(resultadoParcial[0]);
System.out.println("No se encontraron resultados para la búsqueda realizada");
}else{
bienItems = Integer.parseInt((resultadoParcial[0].split("de "))[1]);
String estado = driver.findElement(By.xpath("//*[@id=\"rowColumn\"]/td[6]")).getText();
System.out.println("Se encontró " + bienItems + " ítems con la misma descripción buscada");
System.out.println("El estado del bien buscado es: " + estado);}
return bienItems;
}
}
|
[
"[email protected]"
] | |
4e67045af9959e4d6f8e9d36bbec4da69b60919c
|
841822579ac8da0475c8e4c8868efefe9d6a4e20
|
/src/DataStructure/Vector.java
|
cc2d23cd092fcea118d92042bf41a075f3f44963
|
[] |
no_license
|
xetqL/ICGL
|
26a5b36980e8fe366bd73d76dd7810e2659931a4
|
286f012e5be8cb1f0f434a4c36cb7c49d45005ba
|
refs/heads/master
| 2020-05-28T14:17:17.964027 | 2014-11-14T20:30:12 | 2014-11-14T20:30:12 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,857 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package DataStructure;
import FunctionProvider.VectorFunctionProvider;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
*
* @author antho
* @param <T>
*/
public class Vector<T extends Number> extends KObject<T> implements IVector{
public Vector(Dimension d, Class<? extends Number> c){
super(d, c, true, Vector.class);
}
public Vector(List<T> a, Class<? extends Number> c){
super(Dimension.getDimension(a.size()), c, false, Vector.class);
this.addAll(a);
}
public Vector(T[] a, Class<? extends Number> c){
super(Dimension.getDimension(a.length), c, false, Vector.class);
this.addAll(Arrays.asList(a));
}
private boolean valid(Number a, Number b){
return a.getClass() == b.getClass();
}
@Override
public Vector add(Vector k) {
return ((VectorFunctionProvider)f).add(new Couple(this,k));
}
@Override
public Vector mul(Number k) {
return ((VectorFunctionProvider)f).mul(this, k);
}
@Override
public Vector sub(Vector k) {
return ((VectorFunctionProvider)f).sub(new Couple(this,k));
}
@Override
public Number dotProduct(Vector k) {
return (T) ((VectorFunctionProvider)f).dotProduct(new Couple(this,k));
}
@Override
public String toString(){
StringBuilder s = new StringBuilder().append('(');
Iterator<T> it = this.iterator();
s.append(it.next().toString());
while(it.hasNext()) s.append(',').append(' ').append(((T) it.next()).toString());
s.append(')');
return s.toString();
}
}
|
[
"[email protected]"
] | |
34010b1f2ccd40a0298759c1e0b19918760e8692
|
106daf576fce8903e91f08ec0da5180084fffd2e
|
/Elevator/src/ElevatorDoor.java
|
81b4e8855a4907302cefbfa1a84904b63dd9f297
|
[] |
no_license
|
LubnaKhan/Repository2
|
f1a5c717005aa06c835bda68801c6926bfd9609a
|
548af056386b530e7b7fecc74206e7fd55563dea
|
refs/heads/master
| 2019-01-02T03:12:18.187408 | 2012-07-19T12:12:20 | 2012-07-19T12:12:20 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 328 |
java
|
public class ElevatorDoor
{
Elevator e;
int status; // 1=>Open , 0=>Close
ElevatorDoor(Elevator e)
{
this.e=e;
status=0;
}
public void displayStatus(int status)
{
if(status==1)
System.out.println("Elevator Door Opens...");
else
System.out.println("Elevator Door Closes...");
}
}
|
[
"Lubna@pc22"
] |
Lubna@pc22
|
224423cc29a4bffb53cca650640bcd52d94bf0bb
|
431adae869660cdd2615441c5d31b8204daab9eb
|
/src/main/java/tn/esprit/spring/entities/Mission.java
|
9ea63a43a174b9d368d825acb73bc92e36787629
|
[] |
no_license
|
Chamza97/timesheets
|
8c1d4f689e620e3d3250efd7dbdca9bdbb3b8fd6
|
032d0a3c1925aa1fe3501c16b480b2fc4ca19bbb
|
refs/heads/main
| 2023-01-23T00:41:36.233560 | 2020-11-25T19:52:59 | 2020-11-25T19:52:59 | 316,039,056 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,704 |
java
|
package tn.esprit.spring.entities;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name ="d_type")
public class Mission implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
private int id;
private String name;
private String description;
@ManyToOne
private Departement departement;
@OneToMany(mappedBy = "idMission")
private Set<Timesheet> timesheets;
public Mission(int id, String name, String description, Departement departement, Set<Timesheet> timesheets) {
super();
this.id = id;
this.name = name;
this.description = description;
this.departement = departement;
this.timesheets = timesheets;
}
public Mission() {
super();
}
protected String getName() {
return name;
}
protected void setName(String name) {
this.name = name;
}
protected String getDescription() {
return description;
}
protected void setDescription(String description) {
this.description = description;
}
protected Departement getDepartement() {
return departement;
}
protected void setDepartement(Departement departement) {
this.departement = departement;
}
protected Set<Timesheet> getTimesheets() {
return timesheets;
}
protected void setTimesheets(Set<Timesheet> timesheets) {
this.timesheets = timesheets;
}
protected int getId() {
return id;
}
}
|
[
"[email protected]"
] | |
f19872d8f6e3e42b2f4a485976e2b712da9d083b
|
fd0b41d779b8062d3720597af17a16fcb9601393
|
/src/main/java/com/smm/ctrm/util/Result/MT4Invoice.java
|
9ee9fb0b529a807ba46d3f06263b517017902f8a
|
[] |
no_license
|
pseudocodes/ctrm
|
a62bddc973b575d56e6ca874faa1be8e7c437387
|
02260333a1bb0c25e9d4799698c324cb5bceb6f6
|
refs/heads/master
| 2021-09-25T14:41:59.253752 | 2018-10-23T03:47:54 | 2018-10-23T03:47:54 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,241 |
java
|
package com.smm.ctrm.util.Result;
import org.apache.commons.lang3.StringUtils;
///#endregion
///#region 发票的方向
public class MT4Invoice
{
public static final String Make = "M";
public static final String Take = "T";
private String Name;
public final String getName()
{
return Name;
}
public final void setName(String value)
{
Name = value;
}
private String Value;
public final String getValue()
{
return Value;
}
public final void setValue(String value)
{
Value = value;
}
public static java.util.ArrayList<MT4Invoice> MTs4Invoice()
{
MT4Invoice tempVar = new MT4Invoice();
tempVar.setValue(Take);
tempVar.setName("收");
MT4Invoice tempVar2 = new MT4Invoice();
tempVar2.setValue(Make);
tempVar2.setName("开");
java.util.ArrayList<MT4Invoice> mTs = new java.util.ArrayList<MT4Invoice>(java.util.Arrays.asList(new MT4Invoice[]{ tempVar, tempVar2 }));
return mTs;
}
public static String GetName(String s)
{
if (StringUtils.isBlank(s))
{
return "Unknown";
}
// switch (s)
//ORIGINAL LINE: case Take:
if (Take.equals(s))
{
return "收";
}
//ORIGINAL LINE: case Make:
else if (Make.equals(s))
{
return "开";
}
else
{
return "Unknown";
}
}
}
|
[
"[email protected]"
] | |
6460a84463c9c44593d58114192a0ac8fd310935
|
ad071164326f349efb22ab0ba04373c13ab160cf
|
/app/src/main/java/shbd/customview/view/SearchView.java
|
ed4b1c7fb4c8149c793bd6adaab9db2591308046
|
[] |
no_license
|
yaoyoucai/CustomView2
|
6f0a2b085be017a7d4493a015914f8d8765bf27c
|
fed4a4089b93595392b924971f3966c0831a8c11
|
refs/heads/master
| 2021-01-11T19:08:24.812930 | 2017-01-20T07:46:51 | 2017-01-20T07:46:51 | 79,324,473 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,230 |
java
|
package shbd.customview.view;
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.RectF;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
/**
* 项目名称:CustomView2
* 类描述:
* 创建人:yh
* 创建时间:2017/1/19 15:42
* 修改人:yh
* 修改时间:2017/1/19 15:42
* 修改备注:
*/
public class SearchView extends View {
// 画笔
private Paint mPaint;
// View 宽高
private int mViewWidth;
private int mViewHeight;
public SearchView(Context context) {
this(context,null);
}
public SearchView(Context context, AttributeSet attrs) {
super(context, attrs);
initAll();
}
public void initAll() {
initPaint();
initPath();
initListener();
initHandler();
initAnimator();
// 进入开始动画
mCurrentState = State.STARTING;
mStartingAnimator.start();
}
// 这个视图拥有的状态
public static enum State {
NONE,
STARTING,
SEARCHING,
ENDING
}
// 当前的状态(非常重要)
private State mCurrentState = State.NONE;
// 放大镜与外部圆环
private Path path_srarch;
private Path path_circle;
// 测量Path 并截取部分的工具
private PathMeasure mMeasure;
// 默认的动效周期 2s
private int defaultDuration = 2000;
// 控制各个过程的动画
private ValueAnimator mStartingAnimator;
private ValueAnimator mSearchingAnimator;
private ValueAnimator mEndingAnimator;
// 动画数值(用于控制动画状态,因为同一时间内只允许有一种状态出现,具体数值处理取决于当前状态)
private float mAnimatorValue = 0;
// 动效过程监听器
private ValueAnimator.AnimatorUpdateListener mUpdateListener;
private Animator.AnimatorListener mAnimatorListener;
// 用于控制动画状态转换
private Handler mAnimatorHandler;
// 判断是否已经搜索结束
private boolean isOver = false;
private int count = 0;
private void initPaint() {
mPaint = new Paint();
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(Color.WHITE);
mPaint.setStrokeWidth(15);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setAntiAlias(true);
}
private void initPath() {
path_srarch = new Path();
path_circle = new Path();
mMeasure = new PathMeasure();
// 注意,不要到360度,否则内部会自动优化,测量不能取到需要的数值
RectF oval1 = new RectF(-50, -50, 50, 50); // 放大镜圆环
path_srarch.addArc(oval1, 45, 359.9f);
RectF oval2 = new RectF(-100, -100, 100, 100); // 外部圆环
path_circle.addArc(oval2, 45, -359.9f);
float[] pos = new float[2];
mMeasure.setPath(path_circle, false); // 放大镜把手的位置
mMeasure.getPosTan(0, pos, null);
path_srarch.lineTo(pos[0], pos[1]); // 放大镜把手
Log.i("TAG", "pos=" + pos[0] + ":" + pos[1]);
}
private void initListener() {
mUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mAnimatorValue = (float) animation.getAnimatedValue();
invalidate();
}
};
mAnimatorListener = new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
// getHandle发消息通知动画状态更新
mAnimatorHandler.sendEmptyMessage(0);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
};
}
private void initHandler() {
mAnimatorHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (mCurrentState) {
case STARTING:
// 从开始动画转换好搜索动画
isOver = false;
mCurrentState = State.SEARCHING;
mStartingAnimator.removeAllListeners();
mSearchingAnimator.start();
break;
case SEARCHING:
if (!isOver) { // 如果搜索未结束 则继续执行搜索动画
mSearchingAnimator.start();
Log.e("Update", "RESTART");
count++;
if (count>2){ // count大于2则进入结束状态
isOver = true;
}
} else { // 如果搜索已经结束 则进入结束动画
mCurrentState = State.ENDING;
mEndingAnimator.start();
}
break;
case ENDING:
// 从结束动画转变为无状态
mCurrentState = State.NONE;
break;
}
}
};
}
private void initAnimator() {
mStartingAnimator = ValueAnimator.ofFloat(0, 1).setDuration(defaultDuration);
mSearchingAnimator = ValueAnimator.ofFloat(0, 1).setDuration(defaultDuration);
mEndingAnimator = ValueAnimator.ofFloat(1, 0).setDuration(defaultDuration);
mStartingAnimator.addUpdateListener(mUpdateListener);
mSearchingAnimator.addUpdateListener(mUpdateListener);
mEndingAnimator.addUpdateListener(mUpdateListener);
mStartingAnimator.addListener(mAnimatorListener);
mSearchingAnimator.addListener(mAnimatorListener);
mEndingAnimator.addListener(mAnimatorListener);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mViewWidth = w;
mViewHeight = h;
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
drawSearch(canvas);
}
private void drawSearch(Canvas canvas) {
mPaint.setColor(Color.WHITE);
canvas.translate(mViewWidth / 2, mViewHeight / 2);
canvas.drawColor(Color.parseColor("#0082D7"));
switch (mCurrentState) {
case NONE:
canvas.drawPath(path_srarch, mPaint);
break;
case STARTING:
mMeasure.setPath(path_srarch, false);
Path dst = new Path();
mMeasure.getSegment(mMeasure.getLength() * mAnimatorValue, mMeasure.getLength(), dst, true);
canvas.drawPath(dst, mPaint);
break;
case SEARCHING:
mMeasure.setPath(path_circle, false);
Path dst2 = new Path();
float stop = mMeasure.getLength() * mAnimatorValue;
float start = (float) (stop - ((0.5 - Math.abs(mAnimatorValue - 0.5)) * 200f));
mMeasure.getSegment(start, stop, dst2, true);
canvas.drawPath(dst2, mPaint);
break;
case ENDING:
mMeasure.setPath(path_srarch, false);
Path dst3 = new Path();
mMeasure.getSegment(mMeasure.getLength() * mAnimatorValue, mMeasure.getLength(), dst3, true);
canvas.drawPath(dst3, mPaint);
break;
}
}
}
|
[
"[email protected]"
] | |
94abe73bb03ed7e98ceb45f0de134d16f3f3e690
|
5ff99db613e032f111cdd99f7d50ed8d55169110
|
/src/net/blackhack/warwalk/Syslog.java
|
705d3a18b5753eb1596464b7560a8ba32b99702c
|
[] |
no_license
|
vaginessa/WarWalk
|
4aec566c4c480171328bfd267cd8ef33edc8a39b
|
9c85f74b382b9f863e3fa7e2903dabab212111b2
|
refs/heads/master
| 2021-05-08T15:51:13.303486 | 2013-09-21T19:17:55 | 2013-09-21T19:17:55 | 120,129,829 | 0 | 0 | null | 2019-01-18T07:47:54 | 2018-02-03T21:08:32 |
Java
|
UTF-8
|
Java
| false | false | 1,808 |
java
|
package net.blackhack.warwalk;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.text.Html;
import android.widget.TextView;
public class Syslog extends Activity {
private TextView logtext;
protected static File logFile = new File(Environment.getDataDirectory(),
"/data/net.blackhack.warwalk/log.tmp");
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_syslog);
logtext = (TextView) this.findViewById(R.id.syslog);
logview();
}
protected void logview() {
File log = logFile;
try {
BufferedReader br = new BufferedReader(new FileReader(log));
String line;
while ((line = br.readLine()) != null) {
logtext.append(Html.fromHtml(line));
logtext.append("\n");
}
}
catch (Exception e) {
e.printStackTrace();
}
}
protected static void systemLog(int arg, String str) {
try {
if (!logFile.exists())
logFile.createNewFile();
BufferedWriter buffer = new BufferedWriter(new FileWriter(logFile, true));
if (arg == 0)
buffer.append("<font color='green'><b>[+]</b></font> " + str);
else if (arg == 1)
buffer.append("<font color='white'>[@]</font> " + str);
else if (arg == 2)
buffer.append("<font color='red'><b>[!!]</b> WARNING</font> " + str);
buffer.newLine();
buffer.flush();
buffer.close();
}
catch (IOException e){
e.printStackTrace();
}
}
@Override
public void onBackPressed(){
super.onBackPressed();
finishActivity(0);
}
}
|
[
"xeon@laptop.(none)"
] |
xeon@laptop.(none)
|
c7899fd789e57997286951e50c3aa13983069270
|
b175df2bc449ba188d8a159fe4d8e0cf478ee5d1
|
/src/main/java/com/blurengine/blur/modules/filters/serializer/FilterTypeSerializer.java
|
822178330701085ac8ca4d215b7dc85d49bd9939
|
[
"Apache-2.0"
] |
permissive
|
sgdc3/Blur
|
516672ce516a6d4dbac1f2efed9359285fd73fcb
|
1897fb6c912c2d605febd6cf63ee505a0f9e5bf6
|
refs/heads/master
| 2020-05-20T19:30:15.375860 | 2016-01-02T13:27:40 | 2016-01-02T13:27:40 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,514 |
java
|
/*
* Copyright 2016 Ali Moghnieh
*
* 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.blurengine.blur.modules.filters.serializer;
import com.google.common.base.Preconditions;
import com.blurengine.blur.modules.filters.Filter;
import com.blurengine.blur.modules.framework.BlurSerializer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import pluginbase.config.serializers.Serializer;
import pluginbase.config.serializers.SerializerSet;
/**
* Represents an abstract {@link Serializer} for serializing {@link Filter}s. After creating your serializer, be sure to register it at
* {@link FilterSerializer#registerSerializer(String, Class)}.
*/
public abstract class FilterTypeSerializer<T extends Filter> implements BlurSerializer<T> {
private final FilterSerializer parent;
public FilterTypeSerializer(FilterSerializer parent) {
this.parent = parent;
}
@Override // serialize(Object) already provided by PB Serializer interface
public Object serialize(T object) {
throw new UnsupportedOperationException("Not implemented yet.");
}
protected T deserialize(Object object) {
throw new UnsupportedOperationException("Not implemented yet.");
}
@Nullable
@Override
public Object serialize(@Nullable T object, @NotNull SerializerSet serializerSet) {
return object == null ? null : serialize(object);
}
@Nullable
@Override
public T deserialize(@Nullable Object serialized, @NotNull Class wantedType, @NotNull SerializerSet serializerSet) {
if (serialized == null) {
return null;
}
deserializedPreHandler(serialized);
return deserialize(serialized);
}
protected void deserializedPreHandler(Object o) {
Preconditions.checkArgument(o instanceof Map, "serialized object must be a map.");
}
public FilterSerializer getParentSerializer() {
return parent;
}
}
|
[
"[email protected]"
] | |
2008a7877b3eb85932477b42f8f3be3ee0fef7d2
|
6bfef338bb1b496a797b4d5967573d99d78e82c0
|
/src/com/vr/domain/EvaluationChildComment.java
|
50fd01cbc27c83b11bc385b1f1df3264623f8d3c
|
[] |
no_license
|
KODGV/VR
|
b4783d1b72bb6018aa85c86fe4f965929856f8f9
|
0b2e942f3dde400b7f6948dd7fd974b71f7cde25
|
refs/heads/master
| 2021-07-25T22:29:55.216928 | 2017-11-10T09:01:28 | 2017-11-10T09:01:28 | 106,112,921 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,717 |
java
|
package com.vr.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class EvaluationChildComment {
private Integer id;
private Integer commentId;
private Integer userId;
private String comment;
private Date postTime;
@JsonIgnore
private EvaluationParentComment parentComment;
public EvaluationChildComment(){
}
public EvaluationChildComment(Integer commentId, Integer userId, String content, Date date) {
this.userId=userId;
this.parentComment=new EvaluationParentComment();
parentComment.setId(commentId);
this.comment=content;
this.postTime=date;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCommentId() {
return commentId;
}
public void setCommentId(Integer commentId) {
this.commentId = commentId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Date getPostTime() {
return postTime;
}
public void setPostTime(Date postTime) {
this.postTime = postTime;
}
public EvaluationParentComment getParentComment() {
return parentComment;
}
public void setParentComment(EvaluationParentComment parentComment) {
this.parentComment = parentComment;
}
@Override
public String toString() {
return "EvaluationChildComment [id=" + id + ", commentId=" + commentId + ", userId=" + userId + ", comment="
+ comment + ", postTime=" + postTime + "]";
}
}
|
[
"[email protected]"
] | |
48aad8739cac9923366bbb0a96971ee3562eccef
|
121f380325634b28f9eae95a4b2c61736447a67e
|
/src/sample/Message.java
|
2538688e0c54dfb5cdf3b48e9d6731a85ec4de94
|
[] |
no_license
|
tarik-boumaza/taquin
|
824e5a11804bd6cccfa829ac8e23a887a6804dbd
|
dfdf0807ea95c263939518342242684d2c809988
|
refs/heads/master
| 2023-08-14T16:13:13.968204 | 2021-06-27T21:44:14 | 2021-06-27T21:44:14 | 413,797,483 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 970 |
java
|
package sample;
public class Message {
/**
* Identifiant de l'expéditeur.
*/
private long expediteur;
/**
* Identifiant du destinataire.
*/
private long destinataire;
/**
* Case à libérer.
*/
private int caseLibere;
/**
* Constructeur par défaut.
*/
public Message() {
}
/**
* Constructeur avec paramètre.
* @param expediteur Identifiant de l'expéditeur.
* @param destinataire Identifiant du destinataire.
* @param caseLibere Case à libérer.
*/
public Message(long expediteur, long destinataire, int caseLibere) {
this.expediteur = expediteur;
this.destinataire = destinataire;
this.caseLibere = caseLibere;
}
public long getExpediteur() {
return expediteur;
}
public long getDestinataire() {
return destinataire;
}
public int getCaseLibere() {
return caseLibere;
}
}
|
[
"[email protected]"
] | |
3fe2a29299815bb40a378ff241ac6326b07feb1a
|
3bc709a9d0aa99aea42a256ad91cf789731e52d0
|
/java_src/java05/src/반복문/ForTest2.java
|
f935aa6d900d753456f78ee88e8ac813f5e87517
|
[] |
no_license
|
yahlove7777/bigdatajava
|
df1ee250b6806990dfc63047b2d08d6e8ed26e28
|
bc6f7fffbf515780ba3ab57b852a07b083ec2d2b
|
refs/heads/master
| 2020-05-14T13:26:16.233193 | 2019-05-14T03:59:42 | 2019-05-14T03:59:42 | 181,812,623 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 268 |
java
|
package 반복문;
public class ForTest2 {
public static void main(String[] args) {
int start;
for(start = 1;start <= 10; start++) {
for(int j = 1;j <= 10;j++) {
System.out.print("★");
}
System.out.println("");
}
}
}
|
[
"[email protected]"
] | |
9b9708d5ea5e3d31ddcb4c51524e8e6d32fad4df
|
61fa6101d74bff27cd4f85be205e5f9bd9b1ae30
|
/权限管理系统/src/cn/itcast/domain/User.java
|
210659f8a769e81366ac2454982492de14c84532
|
[] |
no_license
|
LiHuaYang/college
|
93810c6f15aa213f8386a295b2c474dbd6c5c4bc
|
5648bbee3d2df252be0fb925d41dd8b158476e56
|
refs/heads/main
| 2023-02-22T09:49:04.944870 | 2021-01-20T07:15:00 | 2021-01-20T07:15:00 | 89,077,293 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 683 |
java
|
package cn.itcast.domain;
import java.util.HashSet;
import java.util.Set;
public class User {
private String id;
private String username;
private String password;
private Set<Role> roles = new HashSet();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Set<Role> getRoles() {
return roles;
}
public void setRoles(Set<Role> roles) {
this.roles = roles;
}
}
|
[
"[email protected]"
] | |
8e13e1b742a76fb35c0502790b15e9a7e76e48bb
|
e5b5eb7d97bbd5157ea5cd1a9b4495a71a5b1831
|
/javaClass/projects/project4_whynotd/src/PasswordVerify.java
|
a298c5658b5754882d7e7d9aeca7475ab7439223
|
[] |
no_license
|
davidmwhynot/practice
|
00725dc8c1354ad2b74bbfaf4e8c782317374b3d
|
c9be11a1e232fa2a9214a482f9d86feaae131fdf
|
refs/heads/master
| 2021-09-26T10:00:38.478759 | 2018-10-28T21:54:53 | 2018-10-28T21:54:53 | 119,072,237 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,576 |
java
|
/*
File Name:
PasswordVerify.java
Author:
David Whynot
Date Created:
3/23/18
Description:
this is an adaptation of code I wrote years ago for an app called HData. It used JDBC. This was the registration page I used, modified to meet the requirements for the project.
Type:
*/
// GUI BASED
// David Whynot 1.13.14 www.xdavesbanex.com
import javax.swing.JOptionPane.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.border.*;
public class PasswordVerify extends JFrame implements MouseListener {
JLabel user = new JLabel("---Username:");
JTextField enterUser = new JTextField(10); // username fields
JLabel pass = new JLabel("---Password:");
JTextField enterPass = new JTextField(10); // password fields
JLabel reTypePass = new JLabel("---Re-type Password:");
JTextField rePass = new JTextField(10); // retype password fields
JLabel doneText = new JLabel("Done");
JPanel done = new JPanel();
JLabel requirements0 = new JLabel("----Password must be:");
JLabel requirements1 = new JLabel("At least 6 chars.");
JLabel requirements2 = new JLabel("At least one digit.");
JLabel requirements3 = new JLabel("At least one lower and one upper alpha char.");
JLabel requirements4 = new JLabel("At least one special char (@#%$^ etc).--------");
BevelBorder borderUp = new BevelBorder(1, Color.darkGray, Color.lightGray);
BevelBorder borderDown = new BevelBorder(0, Color.darkGray, Color.lightGray); // done fields
public PasswordVerify() {
super("New Profile");
Container con = getContentPane();
con.setLayout(new FlowLayout());
con.add(user);
con.add(enterUser);
con.add(requirements0);
con.add(requirements1);
con.add(requirements2);
con.add(requirements3);
con.add(requirements4);
con.add(pass);
con.add(enterPass);
con.add(reTypePass);
con.add(rePass);
con.add(done);
done.add(doneText);
done.setBorder(borderUp);
done.addMouseListener(this);
}
public static void main(String[] args) {
PasswordVerify newP = new PasswordVerify(); // create NewProfileFrame from class NewProfileFrame
newP.setSize(315,220);
newP.setVisible(true);
newP.setLocationRelativeTo(null);
newP.setResizable(false);
}
public void mouseEntered(MouseEvent e) {
done.setBorder(borderDown);
}
public void mouseExited(MouseEvent e) {
done.setBorder(borderUp);
}
public void mouseClicked(MouseEvent e) {
Object source = e.getSource();
if(source == done) {
System.out.println("Done"); // here we will...
// 1 - check that passwords match
String passCheckOne = enterPass.getText();
String passCheckTwo = rePass.getText();
if(!(passCheckOne.equals(passCheckTwo)))
JOptionPane.showMessageDialog(null,"Passwords do not match!");
else {
// 2 - check that username and password are less than 20 chars and that password is greater than 6 characters
String ul = enterUser.getText();
String pl = enterPass.getText();
int x = ul.length();
int y = pl.length();
if(x > 20)
JOptionPane.showMessageDialog(null,"Username is too long! Please select a username that is less than or equal to 20 characters.");
else {
if(y > 20)
JOptionPane.showMessageDialog(null,"Password is too long! Please select a password that is less than or equal to 20 characters.");
else {
if(y < 6)
JOptionPane.showMessageDialog(null,"Password is too short! Please select a password that is greater than or equal to 6 characters.");
else {
// create the test regex
String regex = "^.*(?=.{6,})(?=..*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$";
if(pl.matches(regex)) { // test the password against the regex
JOptionPane.showMessageDialog(null,"Success! Password is valid!");
} else {
JOptionPane.showMessageDialog(null,"Invalid Password!");
}
// the below code is used in this app to check a database for an existing user with the same username
// 3 - checks that username is not already in use
// HSQL m = new HSQL();
// if(m.CheckIfUserExists(ul))
// JOptionPane.showMessageDialog(null,"Username already exists! Please choose a username that is not already in use.");
// else {
// // 4 - store username and password in the database
// HSQL n = new HSQL();
// n.StoreUsernamePassword(ul,pl);
// // 5 - hide the frame if successful
// this.setVisible(false);
// }
}
}
}
}
}
}
public void mousePressed(MouseEvent e) {
}
public void mouseReleased(MouseEvent e) {
}
}
|
[
"[email protected]"
] | |
13e99db2a287c8311b141ef9cb91c9ad3d2ee424
|
32700505b01d1a45ff25dfdc9528aef80a89252a
|
/rabbit-mq/src/main/java/com/jxbig/sharp/OTM/NewTask.java
|
57c82bf71be6fe3fcebc42b2168dbb9b788f2014
|
[] |
no_license
|
a807966224/sharp
|
4ff7c20239eced0f865cfa6f189c239ee3b8075c
|
88755f8f919ba2ff222655dc4cda8422a2289bd7
|
refs/heads/master
| 2020-05-04T07:10:39.573936 | 2019-05-14T00:45:31 | 2019-05-14T00:45:31 | 179,022,018 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,423 |
java
|
package com.jxbig.sharp.OTM;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.MessageProperties;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.LongStream;
public class NewTask {
private static final String TASK_QUEUE_NAME = "task_queue";
public static void main(String[] argv) throws Exception {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
try (Connection connection = factory.newConnection();
Channel channel = connection.createChannel()) {
channel.queueDeclare(TASK_QUEUE_NAME, true, false, false, null);
// String message = String.join(" ", argv);
String pointMsg = "";
int i = ThreadLocalRandom.current().nextInt(3);
long[] longs = LongStream.rangeClosed(0, i).toArray();
for (long l : longs) {
pointMsg += ".";
}
String message = UUID.randomUUID().toString() + pointMsg;
System.out.println("message: " + message);
channel.basicPublish("", TASK_QUEUE_NAME,
MessageProperties.PERSISTENT_TEXT_PLAIN,
message.getBytes("UTF-8"));
System.out.println(" [x] Sent '" + message + "'");
}
}
}
|
[
"[email protected]"
] | |
6ebacc3e2f8262c82ae2257432c746b4a6450c78
|
3fc7c3d4a697c418bad541b2ca0559b9fec03db7
|
/Decompile/javasource/com/google/android/gms/internal/zzij.java
|
e523719f2d5535da4e69540f22e60371aa4be21b
|
[] |
no_license
|
songxingzai/APKAnalyserModules
|
59a6014350341c186b7788366de076b14b8f5a7d
|
47cf6538bc563e311de3acd3ea0deed8cdede87b
|
refs/heads/master
| 2021-12-15T02:43:05.265839 | 2017-07-19T14:44:59 | 2017-07-19T14:44:59 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 363 |
java
|
package com.google.android.gms.internal;
public abstract interface zzij<T>
{
public static abstract interface zza
{
public abstract void run();
}
public static class zzb
implements zzij.zza
{
public zzb() {}
public void run() {}
}
public static abstract interface zzc<T>
{
public abstract void zzc(T paramT);
}
}
|
[
"[email protected]"
] | |
3be4689994ba99685614ed8a3f68274bd00a2836
|
79b61b9cd2035390793577d301c8f9ea8e17337b
|
/src/main/TaxiService/GUI/PassengerForm.java
|
28d4ad1015a5a20540546388ddf81f5d6ff2f080
|
[] |
no_license
|
Sergei-Smirnov-95/Taxi
|
71a7a0f4e025944e58b112fffb9f2145d107a1a9
|
bdae384c41f28f78e419923b166780ffe115dc8d
|
refs/heads/master
| 2021-04-28T09:23:28.470717 | 2018-10-01T19:50:23 | 2018-10-01T19:50:23 | 122,039,514 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,353 |
java
|
package GUI;
import BusinessLogic.Passenger;
import Exceptions.DBAccessException;
import Exceptions.DBConnectionException;
import Exceptions.HaveNotUserEx;
import FACADE.Facade;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.time.LocalDate;
public class PassengerForm extends JFrame {
private JButton newOrderButton;
private JTextField sourceAddresTextField;
private JTextField destinationAddresTextField;
private JButton exitButton;
private JPanel rootPanel;
private Facade facade;
public PassengerForm(String userLogin) {
super("Passenger workspace");
setContentPane(rootPanel);
Dimension size = new Dimension(400,300);
setSize(size);
setMinimumSize(size);
setLocationRelativeTo(null);
setMaximumSize(size);
setListeners(userLogin);
setVisible(true);
}
public void setListeners(String userLogin){
JFrame thisFrame = this;
try {
facade = Facade.getInstance();
} catch (DBAccessException | DBConnectionException e) {
JOptionPane.showMessageDialog(new JFrame(),
"Cant connect with DB", "Error",
JOptionPane.ERROR_MESSAGE);
return;
}
newOrderButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
String sourceAddr = sourceAddresTextField.getText();
String destAddr = destinationAddresTextField.getText();
if(sourceAddr.isEmpty() || destAddr.isEmpty() ||
sourceAddr.equals("Source Addres") || destAddr.equals("Destination Addres")){
JOptionPane.showMessageDialog(new JFrame(),
"Please, enter data about order", "Warning",
JOptionPane.WARNING_MESSAGE);
return;
}
try {
facade.addNewOrder(sourceAddr,destAddr, userLogin, LocalDate.now());
JOptionPane.showMessageDialog(new JFrame(),
"Order added for processing", "Thank you",
JOptionPane.INFORMATION_MESSAGE);
} catch (DBConnectionException e) {
JOptionPane.showMessageDialog(new JFrame(),
"Cant connect with DB", "Error",
JOptionPane.ERROR_MESSAGE);
return;
} catch (HaveNotUserEx haveNotUserEx) {
Container frame = exitButton.getParent();
do
frame = frame.getParent();
while (!(frame instanceof JFrame));
((JFrame) frame).dispose();
}
}
});
exitButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
thisFrame.dispose();
Login login = new Login();
login.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
}
});
}
}
|
[
"[email protected]"
] | |
382027e1e2246ea67278fe5afc616892db56cf14
|
74b47b895b2f739612371f871c7f940502e7165b
|
/aws-java-sdk-fis/src/main/java/com/amazonaws/services/fis/model/transform/CreateExperimentTemplateLogConfigurationInputJsonUnmarshaller.java
|
cbdabab4d96e5e4ce3b8f6cd55df486b053fae79
|
[
"Apache-2.0"
] |
permissive
|
baganda07/aws-sdk-java
|
fe1958ed679cd95b4c48f971393bf03eb5512799
|
f19bdb30177106b5d6394223a40a382b87adf742
|
refs/heads/master
| 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 |
Apache-2.0
| 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null |
UTF-8
|
Java
| false | false | 3,876 |
java
|
/*
* Copyright 2017-2022 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.fis.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.fis.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* CreateExperimentTemplateLogConfigurationInput JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateExperimentTemplateLogConfigurationInputJsonUnmarshaller implements
Unmarshaller<CreateExperimentTemplateLogConfigurationInput, JsonUnmarshallerContext> {
public CreateExperimentTemplateLogConfigurationInput unmarshall(JsonUnmarshallerContext context) throws Exception {
CreateExperimentTemplateLogConfigurationInput createExperimentTemplateLogConfigurationInput = new CreateExperimentTemplateLogConfigurationInput();
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("cloudWatchLogsConfiguration", targetDepth)) {
context.nextToken();
createExperimentTemplateLogConfigurationInput
.setCloudWatchLogsConfiguration(ExperimentTemplateCloudWatchLogsLogConfigurationInputJsonUnmarshaller.getInstance().unmarshall(
context));
}
if (context.testExpression("s3Configuration", targetDepth)) {
context.nextToken();
createExperimentTemplateLogConfigurationInput.setS3Configuration(ExperimentTemplateS3LogConfigurationInputJsonUnmarshaller.getInstance()
.unmarshall(context));
}
if (context.testExpression("logSchemaVersion", targetDepth)) {
context.nextToken();
createExperimentTemplateLogConfigurationInput.setLogSchemaVersion(context.getUnmarshaller(Integer.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 createExperimentTemplateLogConfigurationInput;
}
private static CreateExperimentTemplateLogConfigurationInputJsonUnmarshaller instance;
public static CreateExperimentTemplateLogConfigurationInputJsonUnmarshaller getInstance() {
if (instance == null)
instance = new CreateExperimentTemplateLogConfigurationInputJsonUnmarshaller();
return instance;
}
}
|
[
""
] | |
b80d27b2243cd52302ea9cd16d277c162d930465
|
87cb9c1d0268d0b4ee58d669c14bbc2ebc09a381
|
/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/AppLogAggregatorImpl.java
|
62703578320cf6f11fd3c7a55ac394ba02d7cb0a
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown",
"BSD-2-Clause",
"BSD-3-Clause"
] |
permissive
|
epfl-labos/kairos
|
03de725c6184c026b27778f3e41572b6fd43fe36
|
776f66f86f4ff3a63b5d186b85c196e660550562
|
refs/heads/master
| 2023-01-14T13:22:10.107086 | 2019-12-13T14:25:15 | 2019-12-13T14:25:15 | 211,498,674 | 4 | 1 |
Apache-2.0
| 2023-01-02T21:54:58 | 2019-09-28T12:42:01 |
Java
|
UTF-8
|
Java
| false | false | 22,748 |
java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation;
import java.io.IOException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileContext;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.UnsupportedFileSystemException;
import org.apache.hadoop.security.Credentials;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.LogAggregationContext;
import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.event.Dispatcher;
import org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat.LogKey;
import org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat.LogValue;
import org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat.LogWriter;
import org.apache.hadoop.yarn.logaggregation.ContainerLogsRetentionPolicy;
import org.apache.hadoop.yarn.logaggregation.LogAggregationUtils;
import org.apache.hadoop.yarn.server.nodemanager.Context;
import org.apache.hadoop.yarn.server.nodemanager.DeletionService;
import org.apache.hadoop.yarn.server.nodemanager.LocalDirsHandlerService;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationEvent;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationEventType;
import org.apache.hadoop.yarn.util.ConverterUtils;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
public class AppLogAggregatorImpl implements AppLogAggregator {
private static final Log LOG = LogFactory
.getLog(AppLogAggregatorImpl.class);
private static final int THREAD_SLEEP_TIME = 1000;
// This is temporary solution. The configuration will be deleted once
// we find a more scalable method to only write a single log file per LRS.
private static final String NM_LOG_AGGREGATION_NUM_LOG_FILES_SIZE_PER_APP
= YarnConfiguration.NM_PREFIX + "log-aggregation.num-log-files-per-app";
private static final int
DEFAULT_NM_LOG_AGGREGATION_NUM_LOG_FILES_SIZE_PER_APP = 30;
// This configuration is for debug and test purpose. By setting
// this configuration as true. We can break the lower bound of
// NM_LOG_AGGREGATION_ROLL_MONITORING_INTERVAL_SECONDS.
private static final String NM_LOG_AGGREGATION_DEBUG_ENABLED
= YarnConfiguration.NM_PREFIX + "log-aggregation.debug-enabled";
private static final boolean
DEFAULT_NM_LOG_AGGREGATION_DEBUG_ENABLED = false;
private static final long
NM_LOG_AGGREGATION_MIN_ROLL_MONITORING_INTERVAL_SECONDS = 3600;
private final LocalDirsHandlerService dirsHandler;
private final Dispatcher dispatcher;
private final ApplicationId appId;
private final String applicationId;
private boolean logAggregationDisabled = false;
private final Configuration conf;
private final DeletionService delService;
private final UserGroupInformation userUgi;
private final Path remoteNodeLogFileForApp;
private final Path remoteNodeTmpLogFileForApp;
private final ContainerLogsRetentionPolicy retentionPolicy;
private final BlockingQueue<ContainerId> pendingContainers;
private final AtomicBoolean appFinishing = new AtomicBoolean();
private final AtomicBoolean appAggregationFinished = new AtomicBoolean();
private final AtomicBoolean aborted = new AtomicBoolean();
private final Map<ApplicationAccessType, String> appAcls;
private final FileContext lfs;
private final LogAggregationContext logAggregationContext;
private final Context context;
private final int retentionSize;
private final long rollingMonitorInterval;
private final boolean logAggregationInRolling;
private final NodeId nodeId;
// This variable is only for testing
private final AtomicBoolean waiting = new AtomicBoolean(false);
private final Map<ContainerId, ContainerLogAggregator> containerLogAggregators =
new HashMap<ContainerId, ContainerLogAggregator>();
public AppLogAggregatorImpl(Dispatcher dispatcher,
DeletionService deletionService, Configuration conf,
ApplicationId appId, UserGroupInformation userUgi, NodeId nodeId,
LocalDirsHandlerService dirsHandler, Path remoteNodeLogFileForApp,
ContainerLogsRetentionPolicy retentionPolicy,
Map<ApplicationAccessType, String> appAcls,
LogAggregationContext logAggregationContext, Context context,
FileContext lfs) {
this.dispatcher = dispatcher;
this.conf = conf;
this.delService = deletionService;
this.appId = appId;
this.applicationId = ConverterUtils.toString(appId);
this.userUgi = userUgi;
this.dirsHandler = dirsHandler;
this.remoteNodeLogFileForApp = remoteNodeLogFileForApp;
this.remoteNodeTmpLogFileForApp = getRemoteNodeTmpLogFileForApp();
this.retentionPolicy = retentionPolicy;
this.pendingContainers = new LinkedBlockingQueue<ContainerId>();
this.appAcls = appAcls;
this.lfs = lfs;
this.logAggregationContext = logAggregationContext;
this.context = context;
this.nodeId = nodeId;
int configuredRentionSize =
conf.getInt(NM_LOG_AGGREGATION_NUM_LOG_FILES_SIZE_PER_APP,
DEFAULT_NM_LOG_AGGREGATION_NUM_LOG_FILES_SIZE_PER_APP);
if (configuredRentionSize <= 0) {
this.retentionSize =
DEFAULT_NM_LOG_AGGREGATION_NUM_LOG_FILES_SIZE_PER_APP;
} else {
this.retentionSize = configuredRentionSize;
}
long configuredRollingMonitorInterval = conf.getLong(
YarnConfiguration
.NM_LOG_AGGREGATION_ROLL_MONITORING_INTERVAL_SECONDS,
YarnConfiguration
.DEFAULT_NM_LOG_AGGREGATION_ROLL_MONITORING_INTERVAL_SECONDS);
boolean debug_mode =
conf.getBoolean(NM_LOG_AGGREGATION_DEBUG_ENABLED,
DEFAULT_NM_LOG_AGGREGATION_DEBUG_ENABLED);
if (configuredRollingMonitorInterval > 0
&& configuredRollingMonitorInterval <
NM_LOG_AGGREGATION_MIN_ROLL_MONITORING_INTERVAL_SECONDS) {
if (debug_mode) {
this.rollingMonitorInterval = configuredRollingMonitorInterval;
} else {
LOG.warn(
"rollingMonitorIntervall should be more than or equal to "
+ NM_LOG_AGGREGATION_MIN_ROLL_MONITORING_INTERVAL_SECONDS
+ " seconds. Using "
+ NM_LOG_AGGREGATION_MIN_ROLL_MONITORING_INTERVAL_SECONDS
+ " seconds instead.");
this.rollingMonitorInterval =
NM_LOG_AGGREGATION_MIN_ROLL_MONITORING_INTERVAL_SECONDS;
}
} else {
if (configuredRollingMonitorInterval <= 0) {
LOG.warn("rollingMonitorInterval is set as "
+ configuredRollingMonitorInterval + ". "
+ "The log rolling mornitoring interval is disabled. "
+ "The logs will be aggregated after this application is finished.");
} else {
LOG.warn("rollingMonitorInterval is set as "
+ configuredRollingMonitorInterval + ". "
+ "The logs will be aggregated every "
+ configuredRollingMonitorInterval + " seconds");
}
this.rollingMonitorInterval = configuredRollingMonitorInterval;
}
this.logAggregationInRolling =
this.rollingMonitorInterval <= 0 || this.logAggregationContext == null
|| this.logAggregationContext.getRolledLogsIncludePattern() == null
|| this.logAggregationContext.getRolledLogsIncludePattern()
.isEmpty() ? false : true;
}
private void uploadLogsForContainers(boolean appFinished) {
if (this.logAggregationDisabled) {
return;
}
if (UserGroupInformation.isSecurityEnabled()) {
Credentials systemCredentials =
context.getSystemCredentialsForApps().get(appId);
if (systemCredentials != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Adding new framework-token for " + appId
+ " for log-aggregation: " + systemCredentials.getAllTokens()
+ "; userUgi=" + userUgi);
}
// this will replace old token
userUgi.addCredentials(systemCredentials);
}
}
// Create a set of Containers whose logs will be uploaded in this cycle.
// It includes:
// a) all containers in pendingContainers: those containers are finished
// and satisfy the retentionPolicy.
// b) some set of running containers: For all the Running containers,
// we have ContainerLogsRetentionPolicy.AM_AND_FAILED_CONTAINERS_ONLY,
// so simply set wasContainerSuccessful as true to
// bypass FAILED_CONTAINERS check and find the running containers
// which satisfy the retentionPolicy.
Set<ContainerId> pendingContainerInThisCycle = new HashSet<ContainerId>();
this.pendingContainers.drainTo(pendingContainerInThisCycle);
Set<ContainerId> finishedContainers =
new HashSet<ContainerId>(pendingContainerInThisCycle);
if (this.context.getApplications().get(this.appId) != null) {
for (ContainerId container : this.context.getApplications()
.get(this.appId).getContainers().keySet()) {
if (shouldUploadLogs(container, true)) {
pendingContainerInThisCycle.add(container);
}
}
}
LogWriter writer = null;
try {
try {
writer =
new LogWriter(this.conf, this.remoteNodeTmpLogFileForApp,
this.userUgi);
// Write ACLs once when the writer is created.
writer.writeApplicationACLs(appAcls);
writer.writeApplicationOwner(this.userUgi.getShortUserName());
} catch (IOException e1) {
LOG.error("Cannot create writer for app " + this.applicationId
+ ". Skip log upload this time. ", e1);
return;
}
boolean uploadedLogsInThisCycle = false;
for (ContainerId container : pendingContainerInThisCycle) {
ContainerLogAggregator aggregator = null;
if (containerLogAggregators.containsKey(container)) {
aggregator = containerLogAggregators.get(container);
} else {
aggregator = new ContainerLogAggregator(container);
containerLogAggregators.put(container, aggregator);
}
Set<Path> uploadedFilePathsInThisCycle =
aggregator.doContainerLogAggregation(writer, appFinished);
if (uploadedFilePathsInThisCycle.size() > 0) {
uploadedLogsInThisCycle = true;
}
this.delService.delete(this.userUgi.getShortUserName(), null,
uploadedFilePathsInThisCycle
.toArray(new Path[uploadedFilePathsInThisCycle.size()]));
// This container is finished, and all its logs have been uploaded,
// remove it from containerLogAggregators.
if (finishedContainers.contains(container)) {
containerLogAggregators.remove(container);
}
}
// Before upload logs, make sure the number of existing logs
// is smaller than the configured NM log aggregation retention size.
if (uploadedLogsInThisCycle) {
cleanOldLogs();
}
if (writer != null) {
writer.close();
}
final Path renamedPath = this.rollingMonitorInterval <= 0
? remoteNodeLogFileForApp : new Path(
remoteNodeLogFileForApp.getParent(),
remoteNodeLogFileForApp.getName() + "_"
+ System.currentTimeMillis());
final boolean rename = uploadedLogsInThisCycle;
try {
userUgi.doAs(new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
FileSystem remoteFS = FileSystem.get(conf);
if (remoteFS.exists(remoteNodeTmpLogFileForApp)) {
if (rename) {
remoteFS.rename(remoteNodeTmpLogFileForApp, renamedPath);
} else {
remoteFS.delete(remoteNodeTmpLogFileForApp, false);
}
}
return null;
}
});
} catch (Exception e) {
LOG.error(
"Failed to move temporary log file to final location: ["
+ remoteNodeTmpLogFileForApp + "] to ["
+ renamedPath + "]", e);
}
} finally {
if (writer != null) {
writer.close();
}
}
}
private void cleanOldLogs() {
try {
final FileSystem remoteFS =
this.remoteNodeLogFileForApp.getFileSystem(conf);
Path appDir =
this.remoteNodeLogFileForApp.getParent().makeQualified(
remoteFS.getUri(), remoteFS.getWorkingDirectory());
Set<FileStatus> status =
new HashSet<FileStatus>(Arrays.asList(remoteFS.listStatus(appDir)));
Iterable<FileStatus> mask =
Iterables.filter(status, new Predicate<FileStatus>() {
@Override
public boolean apply(FileStatus next) {
return next.getPath().getName()
.contains(LogAggregationUtils.getNodeString(nodeId))
&& !next.getPath().getName().endsWith(
LogAggregationUtils.TMP_FILE_SUFFIX);
}
});
status = Sets.newHashSet(mask);
// Normally, we just need to delete one oldest log
// before we upload a new log.
// If we can not delete the older logs in this cycle,
// we will delete them in next cycle.
if (status.size() >= this.retentionSize) {
// sort by the lastModificationTime ascending
List<FileStatus> statusList = new ArrayList<FileStatus>(status);
Collections.sort(statusList, new Comparator<FileStatus>() {
public int compare(FileStatus s1, FileStatus s2) {
return s1.getModificationTime() < s2.getModificationTime() ? -1
: s1.getModificationTime() > s2.getModificationTime() ? 1 : 0;
}
});
for (int i = 0 ; i <= statusList.size() - this.retentionSize; i++) {
final FileStatus remove = statusList.get(i);
try {
userUgi.doAs(new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
remoteFS.delete(remove.getPath(), false);
return null;
}
});
} catch (Exception e) {
LOG.error("Failed to delete " + remove.getPath(), e);
}
}
}
} catch (Exception e) {
LOG.error("Failed to clean old logs", e);
}
}
@Override
public void run() {
try {
doAppLogAggregation();
} catch (Exception e) {
// do post clean up of log directories on any exception
LOG.error("Error occured while aggregating the log for the application "
+ appId, e);
doAppLogAggregationPostCleanUp();
} finally {
if (!this.appAggregationFinished.get()) {
LOG.warn("Aggregation did not complete for application " + appId);
}
this.appAggregationFinished.set(true);
}
}
@SuppressWarnings("unchecked")
private void doAppLogAggregation() {
while (!this.appFinishing.get() && !this.aborted.get()) {
synchronized(this) {
try {
waiting.set(true);
if (logAggregationInRolling) {
wait(this.rollingMonitorInterval * 1000);
if (this.appFinishing.get() || this.aborted.get()) {
break;
}
uploadLogsForContainers(false);
} else {
wait(THREAD_SLEEP_TIME);
}
} catch (InterruptedException e) {
LOG.warn("PendingContainers queue is interrupted");
this.appFinishing.set(true);
}
}
}
if (this.aborted.get()) {
return;
}
// App is finished, upload the container logs.
uploadLogsForContainers(true);
doAppLogAggregationPostCleanUp();
this.dispatcher.getEventHandler().handle(
new ApplicationEvent(this.appId,
ApplicationEventType.APPLICATION_LOG_HANDLING_FINISHED));
this.appAggregationFinished.set(true);
}
private void doAppLogAggregationPostCleanUp() {
// Remove the local app-log-dirs
List<Path> localAppLogDirs = new ArrayList<Path>();
for (String rootLogDir : dirsHandler.getLogDirsForCleanup()) {
Path logPath = new Path(rootLogDir, applicationId);
try {
// check if log dir exists
lfs.getFileStatus(logPath);
localAppLogDirs.add(logPath);
} catch (UnsupportedFileSystemException ue) {
LOG.warn("Log dir " + rootLogDir + "is an unsupported file system", ue);
continue;
} catch (IOException fe) {
continue;
}
}
if (localAppLogDirs.size() > 0) {
this.delService.delete(this.userUgi.getShortUserName(), null,
localAppLogDirs.toArray(new Path[localAppLogDirs.size()]));
}
}
private Path getRemoteNodeTmpLogFileForApp() {
return new Path(remoteNodeLogFileForApp.getParent(),
(remoteNodeLogFileForApp.getName() + LogAggregationUtils.TMP_FILE_SUFFIX));
}
// TODO: The condition: containerId.getId() == 1 to determine an AM container
// is not always true.
private boolean shouldUploadLogs(ContainerId containerId,
boolean wasContainerSuccessful) {
// All containers
if (this.retentionPolicy
.equals(ContainerLogsRetentionPolicy.ALL_CONTAINERS)) {
return true;
}
// AM Container only
if (this.retentionPolicy
.equals(ContainerLogsRetentionPolicy.APPLICATION_MASTER_ONLY)) {
if ((containerId.getContainerId()
& ContainerId.CONTAINER_ID_BITMASK)== 1) {
return true;
}
return false;
}
// AM + Failing containers
if (this.retentionPolicy
.equals(ContainerLogsRetentionPolicy.AM_AND_FAILED_CONTAINERS_ONLY)) {
if ((containerId.getContainerId()
& ContainerId.CONTAINER_ID_BITMASK) == 1) {
return true;
} else if(!wasContainerSuccessful) {
return true;
}
return false;
}
return false;
}
@Override
public void startContainerLogAggregation(ContainerId containerId,
boolean wasContainerSuccessful) {
if (shouldUploadLogs(containerId, wasContainerSuccessful)) {
LOG.info("Considering container " + containerId
+ " for log-aggregation");
this.pendingContainers.add(containerId);
}
}
@Override
public synchronized void finishLogAggregation() {
LOG.info("Application just finished : " + this.applicationId);
this.appFinishing.set(true);
this.notifyAll();
}
@Override
public synchronized void abortLogAggregation() {
LOG.info("Aborting log aggregation for " + this.applicationId);
this.aborted.set(true);
this.notifyAll();
}
@Private
@VisibleForTesting
// This is only used for testing.
// This will wake the log aggregation thread that is waiting for
// rollingMonitorInterval.
// To use this method, make sure the log aggregation thread is running
// and waiting for rollingMonitorInterval.
public synchronized void doLogAggregationOutOfBand() {
while(!waiting.get()) {
try {
wait(200);
} catch (InterruptedException e) {
// Do Nothing
}
}
LOG.info("Do OutOfBand log aggregation");
this.notifyAll();
}
private class ContainerLogAggregator {
private final ContainerId containerId;
private Set<String> uploadedFileMeta =
new HashSet<String>();
public ContainerLogAggregator(ContainerId containerId) {
this.containerId = containerId;
}
public Set<Path> doContainerLogAggregation(LogWriter writer,
boolean appFinished) {
LOG.info("Uploading logs for container " + containerId
+ ". Current good log dirs are "
+ StringUtils.join(",", dirsHandler.getLogDirsForRead()));
final LogKey logKey = new LogKey(containerId);
final LogValue logValue =
new LogValue(dirsHandler.getLogDirsForRead(), containerId,
userUgi.getShortUserName(), logAggregationContext,
this.uploadedFileMeta, appFinished);
try {
writer.append(logKey, logValue);
} catch (Exception e) {
LOG.error("Couldn't upload logs for " + containerId
+ ". Skipping this container.", e);
return new HashSet<Path>();
}
this.uploadedFileMeta.addAll(logValue
.getCurrentUpLoadedFileMeta());
// if any of the previous uploaded logs have been deleted,
// we need to remove them from alreadyUploadedLogs
Iterable<String> mask =
Iterables.filter(uploadedFileMeta, new Predicate<String>() {
@Override
public boolean apply(String next) {
return logValue.getAllExistingFilesMeta().contains(next);
}
});
this.uploadedFileMeta = Sets.newHashSet(mask);
return logValue.getCurrentUpLoadedFilesPath();
}
}
// only for test
@VisibleForTesting
public UserGroupInformation getUgi() {
return this.userUgi;
}
}
|
[
"[email protected]"
] | |
c8ef0cd0aed7fb465ea91d607abd2f859f96546e
|
6a1277355097b43e28bc125eab70fde63fdc431e
|
/src/main/java/com/example/repository/FileRepository.java
|
f0faa9bf8f35f90392c6294dfd9c4584473eabc0
|
[] |
no_license
|
AmhH/spring-file-upload
|
00c31779e0ed92bcdf436a2b08b513e33ef3377b
|
2ae403088e907c33aaa2641757e8c1bcfffc3322
|
refs/heads/master
| 2023-03-02T16:10:34.895131 | 2021-02-09T00:47:09 | 2021-02-09T00:47:09 | 320,688,699 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 199 |
java
|
package com.example.repository;
import com.example.model.File;
import org.springframework.data.jpa.repository.JpaRepository;
public interface FileRepository extends JpaRepository<File, String> {
}
|
[
"[email protected]"
] | |
9122c3990704f669f10c2b4a18e20249d031748b
|
9159c6f20fe08ad7992a4cd044fc3206398f7c58
|
/assignment/javaassignment/javafour/Pro4.java
|
6b7bca04bbd96d3b96d5e0ea68cc1242b8abdf96
|
[] |
no_license
|
bhavanar315/ELF-06June19-tyss-bhavani
|
91def5b909f567536d04e69c9bb6193503398a04
|
e2ee506ee99e0e958fb72e3bdaaf6e3315b84975
|
refs/heads/master
| 2020-07-21T07:45:19.944727 | 2019-09-06T07:43:42 | 2019-09-06T07:43:42 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 872 |
java
|
package com.tyss.assignment.javafour;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
/*
* wap to write the data in CSV file (name,age,designation,salary)
*/
public class Pro4 {
public static void main(String[] args) {
FileOutputStream fout=null;
ObjectOutputStream obj=null;
try {
Emp e=new Emp();
e.set("bhavani", 20, "IT", 20000);
fout =new FileOutputStream("person.csv");
obj=new ObjectOutputStream(fout);
obj.writeObject(e);
System.out.println("done");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
finally {
try {
if(fout!=null)
fout.close();
if(obj!=null)
obj.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
|
[
"[email protected]"
] | |
1b5929017fcb4b448ae635ec63d2d3f985e58c9d
|
00d7df3b55888c26d28fb0dafd21b4d6e126587b
|
/WebContent/Freelance1/UserSkillId.java
|
0eb091af5d021277ab1dbb1f24cd3ad31e5443cb
|
[] |
no_license
|
tncn1122/Freelance
|
4f1b7076b16294b860fe516691d7a168c706fb06
|
d030268ef4603264b216851ad89b5f7e642fe16e
|
refs/heads/main
| 2023-03-14T12:23:21.960314 | 2021-03-06T05:14:01 | 2021-03-06T05:14:01 | 344,505,243 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,512 |
java
|
package Freelance1;
// Generated Jan 11, 2021, 8:21:37 PM by Hibernate Tools 4.3.5.Final
import javax.persistence.Column;
import javax.persistence.Embeddable;
/**
* UserSkillId generated by hbm2java
*/
@Embeddable
public class UserSkillId implements java.io.Serializable {
private Integer id;
private Integer skillId;
public UserSkillId() {
}
public UserSkillId(Integer id, Integer skillId) {
this.id = id;
this.skillId = skillId;
}
@Column(name = "id")
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name = "skill_id")
public Integer getSkillId() {
return this.skillId;
}
public void setSkillId(Integer skillId) {
this.skillId = skillId;
}
public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof UserSkillId))
return false;
UserSkillId castOther = (UserSkillId) other;
return ((this.getId() == castOther.getId())
|| (this.getId() != null && castOther.getId() != null && this.getId().equals(castOther.getId())))
&& ((this.getSkillId() == castOther.getSkillId()) || (this.getSkillId() != null
&& castOther.getSkillId() != null && this.getSkillId().equals(castOther.getSkillId())));
}
public int hashCode() {
int result = 17;
result = 37 * result + (getId() == null ? 0 : this.getId().hashCode());
result = 37 * result + (getSkillId() == null ? 0 : this.getSkillId().hashCode());
return result;
}
}
|
[
"[email protected]"
] | |
64792e14ba95e5459b6245217b016db5a911b711
|
23a210a857e1d8cda630f3ad40830e2fc8bb2876
|
/emp_7.3/emp/ydwx/com/montnets/emp/netnews/table/TableLfWXUploadFile.java
|
db73674e4b9a645668c9f626fdf049c452a294d3
|
[] |
no_license
|
zengyijava/shaoguang
|
415a613b20f73cabf9ab171f3bf64a8233e994f8
|
5d8ad6fa54536e946a15b5e7e7a62eb2e110c6b0
|
refs/heads/main
| 2023-04-25T07:57:11.656001 | 2021-05-18T01:18:49 | 2021-05-18T01:18:49 | 368,159,409 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,593 |
java
|
package com.montnets.emp.netnews.table;
import java.util.HashMap;
import java.util.Map;
/**
* @project emp
* @author wuxiaotao <[email protected]>
* @company ShenZhen Montnets Technology CO.,LTD.
* @datetime 2011-1-19 上午09:31:22
* @description
*/
public class TableLfWXUploadFile
{
//表名:
public static final String TABLE_NAME = "LF_WX_UPLOADFILE";
public static final String ID = "ID";
public static final String NETID = "NETID";
public static final String FILENAME = "FILENAME";
public static final String FILEVER = "FILEVER";
public static final String FILEDESC = "FILEDESC";
public static final String UPLOADDATE = "UPLOADDATE";
public static final String UPLOADUSERID = "UPLOADUSERID";
public static final String WEBURL = "WEBURL";
public static final String STATUS = "STATUS";
public static final String MODIFYID = "MODIFYID";
public static final String MODIFYDATE = "MODIFYDATE";
public static final String CREATID = "CREATID";
public static final String CREATDATE = "CREATDATE";
public static final String NAMETEMP = "NAMETEMP";
public static final String SORTID = "SORTID";
public static final String DATE = "DATE";
public static final String TYPENAME = "TYPENAME";
public static final String FILETYPE = "FILETYPE";
public static final String USERTYPE = "USERTYPE";
public static final String TYPE = "TYPE";
public static final String FILESIZE = "FILESIZE";
public static final String CORP_CODE = "CORP_CODE";
//序列
public static final String SEQUENCE = "S_LF_WX_UPLOADFILE";
//映射集合
protected static final Map<String, String> columns = new HashMap<String, String>();
static
{
columns.put("LfWXUploadFile", TABLE_NAME);
columns.put("tableId", ID);
columns.put("ID", ID);
columns.put("NETID", NETID);
columns.put("FILENAME", FILENAME);
columns.put("FILEVER", FILEVER);
columns.put("FILEDESC", FILEDESC);
columns.put("UPLOADDATE", UPLOADDATE);
columns.put("UPLOADUSERID", UPLOADUSERID);
columns.put("WEBURL", WEBURL);
columns.put("STATUS", STATUS);
columns.put("MODIFYID", MODIFYID);
columns.put("MODIFYDATE", MODIFYDATE);
columns.put("CREATID", CREATID);
columns.put("CREATDATE", CREATDATE);
columns.put("NAMETEMP", NAMETEMP);
columns.put("SORTID", SORTID);
columns.put("type", TYPE);
columns.put("FILESIZE", FILESIZE);
columns.put("CORP_CODE", CORP_CODE);
columns.put("sequence", SEQUENCE);
};
/**
* 返回实体类字段与数据库字段实体类映射的map集合
*
* @return
*/
public static Map<String, String> getORM()
{
return columns;
}
}
|
[
"[email protected]"
] | |
82479ae83929f4e0370b13e1b5fb4ced7847640c
|
ebf3dfb3456cbd930138a635280d0bf8bf994175
|
/src/hhtsks/MainTsk2.java
|
20419a2456ec2dc2102791f67dced57f535ffbd7
|
[] |
no_license
|
GShabunin/hhtask
|
fa8a20f84db623e5d63324e5a6744604ecd42ef5
|
31c2109043f65c1caf58bb70bd2f6ffcac4745af
|
refs/heads/master
| 2021-01-13T08:00:46.432045 | 2016-10-02T09:17:21 | 2016-10-02T09:17:21 | 69,788,310 | 0 | 0 | null | null | null | null |
WINDOWS-1251
|
Java
| false | false | 7,342 |
java
|
package hhtsks;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class MainTsk2 {
//последовательности
public byte[] SEQ,//исходная
NSEQ, //рабочая
NSEQ0, //текущий кандидат для представления в качестве решения
RESSEQ; //текущее решение
//длины последовательностей.
//у последовательностей фиксированная физическая длина для простоты и скорости работы
//нижеприведенные переменные дают отсечку по длине.
public int N, NSEQLEN, NSEQLEN0, RESSEQLEN;
//сравнить новый вариант с уже существующим
//если новый вариант меньше, тогда TRUE
public boolean compareSeq() {
if (RESSEQLEN == 0) return true;
if (RESSEQLEN >= NSEQLEN0) {
if (RESSEQLEN > NSEQLEN0) return true;
for (int i = NSEQLEN0-1; i >=0; i--) {
if (RESSEQ[i] > NSEQ0[i])
return true; else
if (RESSEQ[i] < NSEQ0[i])
return false;
}
}
return false;
}
//записать в рабочую последовательность ряд цифр из исходной последовательности
//по двум смещениям o1, o2.
//SEQ
//---o1--|----o2----|
//1234567|8910111213|.....
//NSEQ
//7654321|3121110198|
public void seqToNum(int o1, int o2) {
byte v;
NSEQLEN = (o1 + o2 + 1);
NSEQLEN0 = NSEQLEN;
for (int k = 1; k <= NSEQLEN; k++) {
if (k <= o2) v = SEQ[o1 + k]; else v = SEQ[k - o2 - 1];
NSEQ[NSEQLEN - k] = v;
NSEQ0[NSEQLEN - k] = v;
}
}
//увеличит рабочую последовательность ++
public void incSeq() {
int k = 0;
while (true) {
int v = NSEQ[k];
if (v == 9) {
NSEQ[k] = 0;
if (k == (NSEQLEN - 1)) {
NSEQ[NSEQLEN] = 1;
NSEQLEN++;
return;
}
} else {
NSEQ[k]++;
return;
}
k++;
}
}
//проверить cnt цифр рабочей последовательности на совпадение
//с цифрами в исходной, начиная с позиции p1.
public boolean chkSeq(int p1, int cnt) {
int C = p1 + cnt;
if (N < C) C = N;
for (int i = p1; i < C; i++) {
if (SEQ[i] != NSEQ[NSEQLEN - 1 - i + p1]) {
return false;
}
}
return true;
}
public P256 Pos;
//генерация результатов
public void generateResult(int offs) {
//запись результирующей последовательности
RESSEQLEN = NSEQLEN0;
for (int i = 0; i < RESSEQLEN; i++) RESSEQ[i] = NSEQ0[i];
//вычисление позиции в "бесконечном" множестве
//используем для этого тип данных с макс длиной в 10^256
P256 s;
Pos = P256.SetNullP256();
for (int i = 0; i < NSEQLEN0-1; i++) {
s = P256.GenP256(9 * (i + 1));
Pos = P256.ADDP256(Pos, s, (byte)i);
}
s = P256.GenP256((NSEQ0[NSEQLEN0-1]-1) * (NSEQLEN0));
Pos = P256.ADDP256(Pos, s, (byte) (NSEQLEN0-1));
s = P256.SetNullP256();
s.len = (byte) (NSEQLEN0-1);
for (int i = 0; i < NSEQLEN0-1; i++) {
s.raw[i] = NSEQ0[i];
}
s = P256.MULP256(s, NSEQLEN0);
Pos = P256.ADDP256(Pos, s, (byte)0);
s = P256.GenP256(offs + 1);
Pos = P256.ADDP256(Pos, s, (byte)0);
}
//пишем результаты на экран
public void dropResult() {
String s = "";
/*for (int i = RESSEQLEN-1; i >= 0; i--) {
s += Integer.toString(RESSEQ[i]);
}
System.out.println(s);
s = "";*/
for (int i = Pos.len-1; i >= 0; i--) {
s += Integer.toString(Pos.raw[i]);
}
System.out.println(s);
}
// получить набор цифр из строки
public static byte[] bytesFromString(String s) {
if ((s.length() > 50) || (s.length() == 0)) {
return null;
}
byte[] v = new byte[s.length()];
for (int i = 0; i < s.length(); i++) {
if (Character.isDigit(s.charAt(i))) {
v[i] = Byte.parseByte(s.substring(i, i+1));
} else return null;
}
return v;
}
public static void main(String[] args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while (true) { //пока не введут пустое или неправильное множество
String array = "";
try {
array = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
return;
}
int v1, snum;
int minval;
boolean ok, ok2;
MainTsk2 Task2 = new MainTsk2();
Task2.SEQ = bytesFromString(array);
if (Task2.SEQ == null) {
System.err.println("Invalid Array of Digits. Halt");
return;
}
Task2.N = Task2.SEQ.length;
Task2.NSEQ = new byte[Task2.N + 1];
Task2.NSEQ0 = new byte[Task2.N + 1];
Task2.RESSEQ = new byte[Task2.N + 1];
Task2.RESSEQLEN = 0;
v1 = 0;
for (int c = 0; c < Task2.N; c++) v1 = v1 + Task2.SEQ[c];
if (v1 == 0) {
Task2.NSEQLEN = Task2.N + 1;
Task2.NSEQLEN0 = Task2.NSEQLEN;
//заданы нули. результат = [1][множество].
for (int c = 0; c < Task2.N; c++) {
Task2.NSEQ[c] = 0;
Task2.NSEQ0[c] = 0;
}
Task2.NSEQ[Task2.NSEQLEN-1] = 1;
Task2.NSEQ0[Task2.NSEQLEN-1] = 1;
Task2.generateResult(1);
Task2.dropResult();
//return;
} else {
minval = 9;
//перебор вариантов путем перестановок цифр во множестве.
for (int c = 1; c <= Task2.N; c++) {
ok2 = false;
for (int off1 = c - 1; off1 >= 0; off1--) {
int off2 = c - 1 - off1;
Task2.seqToNum(off1, off2);
v1 = Task2.NSEQ[Task2.NSEQLEN-1];
if (v1 == 0) {//выбран неверный вариант (с нулем в начале). игнорируем и идем дальше.
ok = false;
} else {
snum = (Task2.N - off1 - 1) / c + 1;
ok = true;
for (int sn = 1; sn <= snum; sn++) {
Task2.incSeq();
if (!Task2.chkSeq(off1 + (sn-1) * c + 1, c)) {
ok = false;
break;
}
}
}
if (ok) {
if (minval >= v1) {
if (Task2.compareSeq()) {
minval = v1;
Task2.generateResult(off2);
}
}
ok2 = true;
}
}
if (ok2) {
Task2.dropResult();
break;
}
}
}
}
}
}
|
[
"[email protected]"
] | |
0435bda337ea2ff3d515d56bf8f230d067aa4744
|
82e9fbaeb43a0ba210f324c30bde9a693e2a9a63
|
/src/java/accountbook/RevenueManager.java
|
c9b7bd6a78f46ed828184a7f41b5530b46a4735d
|
[] |
no_license
|
duza11/dev_D
|
248d942673d898e8f31f8b2d4916280313190648
|
66716964499af38bb6c7858b03dab2a96e2a187e
|
refs/heads/master
| 2023-08-08T03:42:14.032813 | 2017-02-14T00:27:40 | 2017-02-14T00:27:40 | 76,002,323 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 20,216 |
java
|
package accountbook;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class RevenueManager {
private Statement st = null;
private PreparedStatement ps = null;
private ResultSet rs = null;
private DatabaseConnector dc = null;
public RevenueManager(DatabaseConnector dc) {
this.dc = dc;
}
public void setDayListRevenue(User user, int year, int month, List<DailyData> dayList) throws Exception {
String sql = "select rb.date, sum(ri.price * ri.count) as sum "
+ "from users as u, revenue_block as rb, revenue_item as ri "
+ "where u.user_id = rb.user_id and rb.block_id = ri.block_id "
+ "and u.user_id = ? "
+ "and (date_format(date, '%Y-%m') = ? or date_format(date, '%Y-%c') = ?) "
+ "group by rb.date;";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, user.getUserId());
ps.setString(2, String.format("%d-%d", year, month));
ps.setString(3, String.format("%d-%d", year, month));
rs = ps.executeQuery();
if (!rs.next()) {
rs.close();
return;
}
for (DailyData dd : dayList) {
if (rs.getDate("date").compareTo(new SimpleDateFormat("yyyy-MM-dd")
.parse(String.format("%d-%d-%d", year, month, dd.getDay()))) == 0) {
dd.setRevenue(rs.getInt("sum"));
if (!rs.next()) {
break;
}
}
}
rs.close();
}
public void registerRevenueBlock(int userId, int blockId, RevenueBlock rb) throws Exception {
String sql = "insert into revenue_item(block_id, item_name, kind_id, price, count) "
+ "select auto_increment, ?, ?, ?, ? "
+ "from information_schema.tables where table_name = 'revenue_block' "
+ "and table_schema = 'account_book'";
if (blockId != 0) {
sql = "insert into revenue_item(block_id, item_name, kind_id, price, count) "
+ "values(?, ?, ?, ?, ?)";
}
dc.openConnection(sql);
for (RevenueItem ri : rb.getRevenueItemList()) {
ps = dc.getPreparedStatement();
if (blockId == 0) {
ps.setString(1, ri.getItemName());
ps.setInt(2, ri.getKindId());
ps.setInt(3, ri.getPrice());
ps.setInt(4, ri.getCount());
} else {
ps.setInt(1, blockId);
ps.setString(2, ri.getItemName());
ps.setInt(3, ri.getKindId());
ps.setInt(4, ri.getPrice());
ps.setInt(5, ri.getCount());
}
ps.addBatch();
}
ps.executeBatch();
sql = "insert into revenue_block values(" + ((blockId == 0) ? "null" : "?") + ", ?, ?, ?)";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
if (blockId == 0) {
ps.setInt(1, userId);
ps.setDate(2, new Date(rb.getDate().getTime()));
ps.setString(3, rb.getPlace());
} else {
ps.setInt(1, blockId);
ps.setInt(2, userId);
ps.setDate(3, new Date(rb.getDate().getTime()));
ps.setString(4, rb.getPlace());
}
ps.executeUpdate();
}
public Map<Integer, String> getRevenueKindMap() throws Exception {
Map<Integer, String> revenueKindMap = new LinkedHashMap<Integer, String>();
String sql = "select * from revenue_item_kind order by kind_id asc";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
rs = ps.executeQuery();
while (rs.next()) {
revenueKindMap.put(rs.getInt("kind_id"), rs.getString("kind_name"));
}
rs.close();
return revenueKindMap;
}
public List<BarChartItem> getBarChartItemList(User user, int kind, String date) throws Exception {
List<BarChartItem> barChartItemList = new ArrayList<BarChartItem>();
if (date == null) {
java.util.Date d = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
date = sdf.format(d);
}
String dateArray[] = date.split("-");
Calendar c = Calendar.getInstance();
c.set(Integer.parseInt(dateArray[0]), Integer.parseInt(dateArray[1]) - 1, 1);
int maxDate = c.getActualMaximum(Calendar.DATE);
String sql = "select kind_name from revenue_item_kind where kind_id = ?";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, kind);
rs = ps.executeQuery();
if (rs.next()) {
for (int i = 1; i <= maxDate; i++) {
BarChartItem bci = new BarChartItem(rs.getString("kind_name"), Integer.toString(i));
barChartItemList.add(bci);
}
}
sql = "select day(rb.date) as d, sum(ri.price * ri.count) as sum "
+ "from users as u, revenue_block as rb, revenue_item as ri, "
+ "revenue_item_kind as rk where u.user_id = rb.user_id "
+ "and rb.block_id = ri.block_id and ri.kind_id = rk.kind_id "
+ "and u.user_id = ? and (date_format(rb.date, '%Y-%m') = ? or date_format(rb.date, '%Y-%c') = ?)"
+ "and rk.kind_id = ? group by day(rb.date)";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, user.getUserId());
ps.setString(2, date);
ps.setString(3, date);
ps.setInt(4, kind);
rs = ps.executeQuery();
if (!rs.next()) {
rs.close();
return barChartItemList;
}
for (BarChartItem bci : barChartItemList) {
if (rs.getString("d").equals(bci.getDay())) {
bci.setPrice(rs.getInt("sum"));
if (!rs.next()) {
break;
}
}
}
rs.close();
return barChartItemList;
}
public List<BarChartItem> getStackedBarChartItemList(User user, int kind, String date) throws Exception {
List<BarChartItem> barChartItemList = new ArrayList<BarChartItem>();
if (date == null) {
java.util.Date d = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
date = sdf.format(d);
}
String dateArray[] = date.split("-");
Calendar c = Calendar.getInstance();
c.set(Integer.parseInt(dateArray[0]), Integer.parseInt(dateArray[1]) - 1, 1);
int maxDate = c.getActualMaximum(Calendar.DATE);
String sql = "select kind_id, kind_name from revenue_item_kind order by kind_id asc";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
for (int i = 1; i <= maxDate; i++) {
rs = ps.executeQuery();
while (rs.next()) {
BarChartItem bci = new BarChartItem(rs.getString("kind_name"), Integer.toString(i));
barChartItemList.add(bci);
}
}
sql = "select rk.kind_id, rk.kind_name, day(rb.date) day, sum(ri.price * ri.count) sum "
+ "from users u, revenue_block rb, revenue_item ri, revenue_item_kind rk "
+ "where u.user_id = rb.user_id and rb.block_id = ri.block_id "
+ "and ri.kind_id = rk.kind_id and u.user_id = ? "
+ "and (date_format(rb.date, '%Y-%m') = ? or date_format(rb.date, '%Y-%c') = ?) "
+ "group by day, rk.kind_id order by day, kind_id asc;";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, user.getUserId());
ps.setString(2, date);
ps.setString(3, date);
rs = ps.executeQuery();
if (!rs.next()) {
rs.close();
return barChartItemList;
}
for (BarChartItem bci : barChartItemList) {
if (rs.getString("day").equals(bci.getDay()) && rs.getString("kind_name").equals(bci.getKind())) {
bci.setPrice(rs.getInt("sum"));
if (!rs.next()) {
break;
}
}
}
rs.close();
return barChartItemList;
}
public List<BarChartItem> getYearlyBarChartItemList(User user, int kind, String date) throws Exception {
List<BarChartItem> barChartItemList = new ArrayList<BarChartItem>();
if (date == null) {
java.util.Date d = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
date = sdf.format(d);
}
String sql = "select kind_name from revenue_item_kind where kind_id = ?";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, kind);
rs = ps.executeQuery();
if (rs.next()) {
for (int i = 1; i < 13; i++) {
BarChartItem bci = new BarChartItem(rs.getString("kind_name"), Integer.toString(i));
barChartItemList.add(bci);
}
}
sql = "select month(rb.date) as month, sum(ri.price * ri.count) as sum "
+ "from users as u, revenue_block as rb, revenue_item as ri, "
+ "revenue_item_kind as rk where u.user_id = rb.user_id "
+ "and rb.block_id = ri.block_id and ri.kind_id = rk.kind_id "
+ "and u.user_id = ? and date_format(rb.date, '%Y') = ? "
+ "and rk.kind_id = ? group by month;";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, user.getUserId());
ps.setString(2, date);
ps.setInt(3, kind);
rs = ps.executeQuery();
if (!rs.next()) {
rs.close();
return barChartItemList;
}
for (BarChartItem bci : barChartItemList) {
if (rs.getString("month").equals(bci.getDay())) {
bci.setPrice(rs.getInt("sum"));
if (!rs.next()) {
break;
}
}
}
rs.close();
return barChartItemList;
}
public List<BarChartItem> getYearlyStackedBarChartItemList(User user, int kind, String date) throws Exception {
List<BarChartItem> barChartItemList = new ArrayList<BarChartItem>();
if (date == null) {
java.util.Date d = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
date = sdf.format(d);
}
String sql = "select kind_id, kind_name from revenue_item_kind order by kind_id asc";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
for (int i = 1; i < 13; i++) {
rs = ps.executeQuery();
while (rs.next()) {
BarChartItem bci = new BarChartItem(rs.getString("kind_name"), Integer.toString(i));
barChartItemList.add(bci);
}
}
sql = "select rk.kind_id, rk.kind_name, month(rb.date) month, sum(ri.price * ri.count) sum "
+ "from users u, revenue_block rb, revenue_item ri, revenue_item_kind rk "
+ "where u.user_id = rb.user_id and rb.block_id = ri.block_id "
+ "and ri.kind_id = rk.kind_id and u.user_id = ? "
+ "and date_format(rb.date, '%Y') = ? group by month, rk.kind_id order by month, kind_id asc";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, user.getUserId());
ps.setString(2, date);
rs = ps.executeQuery();
if (!rs.next()) {
rs.close();
return barChartItemList;
}
for (BarChartItem bci : barChartItemList) {
if (rs.getString("month").equals(bci.getDay()) && rs.getString("kind_name").equals(bci.getKind())) {
bci.setPrice(rs.getInt("sum"));
if (!rs.next()) {
break;
}
}
}
rs.close();
return barChartItemList;
}
public List<PieChartItem> getPieChartItemList(User user, String date) throws Exception {
List<PieChartItem> pieChartItemList = new ArrayList<PieChartItem>();
String sql = "select kind_id, kind_name from revenue_item_kind order by kind_id asc";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
rs = ps.executeQuery();
while (rs.next()) {
PieChartItem pci = new PieChartItem(rs.getInt("kind_id"), rs.getString("kind_name"));
pieChartItemList.add(pci);
}
if (date == null) {
java.util.Date d = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
date = sdf.format(d);
}
sql = "select rk.kind_id, rk.kind_name, sum(ri.price * ri.count) as sum "
+ "from users as u, revenue_block as rb, revenue_item as ri, "
+ "revenue_item_kind as rk where u.user_id = rb.user_id "
+ "and rb.block_id = ri.block_id and ri.kind_id = rk.kind_id "
+ "and u.user_id = ? and (date_format(rb.date, '%Y-%m') = ? "
+ "or date_format(rb.date, '%Y-%c') = ?) group by rk.kind_id";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, user.getUserId());
ps.setString(2, date);
ps.setString(3, date);
rs = ps.executeQuery();
if (!rs.next()) {
rs.close();
return pieChartItemList;
}
for (PieChartItem pci : pieChartItemList) {
if (pci.getKindId() == rs.getInt("kind_id")) {
pci.setPrice(rs.getInt("sum"));
if (!rs.next()) {
break;
}
}
}
rs.close();
return pieChartItemList;
}
public List<PieChartItem> getYearlyPieChartItemList(User user, String date) throws Exception {
List<PieChartItem> pieChartItemList = new ArrayList<PieChartItem>();
String sql = "select kind_id, kind_name from revenue_item_kind order by kind_id asc";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
rs = ps.executeQuery();
while (rs.next()) {
PieChartItem pci = new PieChartItem(rs.getInt("kind_id"), rs.getString("kind_name"));
pieChartItemList.add(pci);
}
if (date == null) {
java.util.Date d = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
date = sdf.format(d);
}
sql = "select rk.kind_id, rk.kind_name, sum(ri.price * ri.count) as sum "
+ "from users as u, revenue_block as rb, revenue_item as ri, "
+ "revenue_item_kind as rk where u.user_id = rb.user_id "
+ "and rb.block_id = ri.block_id and ri.kind_id = rk.kind_id "
+ "and u.user_id = ? and date_format(rb.date, '%Y') = ? "
+ "group by rk.kind_id";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, user.getUserId());
ps.setString(2, date);
rs = ps.executeQuery();
if (!rs.next()) {
rs.close();
return pieChartItemList;
}
for (PieChartItem pci : pieChartItemList) {
if (pci.getKindId() == rs.getInt("kind_id")) {
pci.setPrice(rs.getInt("sum"));
if (!rs.next()) {
break;
}
}
}
rs.close();
return pieChartItemList;
}
public List<RevenueBlock> setDailyDataSet(User user, String date) throws Exception {
List<RevenueBlock> revenueBlockList = new ArrayList<RevenueBlock>();
String sql = "select * from users as u, "
+ "revenue_block as rb, revenue_item as ri, revenue_item_kind as rk "
+ "where u.user_id = rb.user_id and rb.block_id = ri.block_id "
+ "and ri.kind_id = rk.kind_id and u.user_id = ? and rb.date = ? order by rb.block_id, ri.item_id asc";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, user.getUserId());
ps.setDate(2, new Date(new SimpleDateFormat("yyyy-MM-dd").parse(date).getTime()));
rs = ps.executeQuery();
if (!rs.next()) {
return revenueBlockList;
}
int counter = 0;
while (true) {
RevenueBlock rb = new RevenueBlock();
rb.setBlockId(rs.getInt("block_id"));
rb.setDate(rs.getString("date"));
rb.setPlace(rs.getString("place"));
List<RevenueItem> rIList = new ArrayList<RevenueItem>();
while (counter == rs.getInt("block_id")) {
RevenueItem ri = new RevenueItem();
ri.setItemName(rs.getString("item_name"));
ri.setKindName(rs.getString("kind_name"));
ri.setPrice(rs.getInt("price"));
ri.setCount(rs.getInt("count"));
rIList.add(ri);
if (!rs.next()) {
rb.setRevenueItemList(rIList);
revenueBlockList.add(rb);
return revenueBlockList;
}
}
counter = rs.getInt("block_id");
if (!rIList.isEmpty()) {
rb.setRevenueItemList(rIList);
revenueBlockList.add(rb);
}
}
}
public RevenueBlock getRevenueBlock(int userId, int blockId) throws Exception {
String sql = "select * from users u, revenue_block rb, revenue_item ri "
+ "where u.user_id = rb.user_id and rb.block_id = ri.block_id "
+ "and u.user_id = ? and rb.block_id = ?;";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, userId);
ps.setInt(2, blockId);
rs = ps.executeQuery();
RevenueBlock rb = new RevenueBlock();
List<RevenueItem> riList = new ArrayList<RevenueItem>();
while (rs.next()) {
rb.setBlockId(rs.getInt("rb.block_id"));
rb.setDate(rs.getString("date"));
rb.setPlace(rs.getString("place"));
RevenueItem ri = new RevenueItem();
ri.setItemName(rs.getString("item_name"));
ri.setKindId(rs.getInt("kind_id"));
ri.setPrice(rs.getInt("price"));
ri.setCount(rs.getInt("count"));
riList.add(ri);
}
if (riList.isEmpty()) {
return null;
}
rb.setRevenueItemList(riList);
return rb;
}
public boolean deleteRevenue(int userId, int blockId) throws Exception {
String sql = "delete rb, ri from "
+ "((users u left join revenue_block rb on u.user_id = rb.user_id) "
+ "left join revenue_item ri on rb.block_id = ri.block_id) "
+ "where u.user_id = ? and rb.block_id = ?";
dc.openConnection(sql);
ps = dc.getPreparedStatement();
ps.setInt(1, userId);
ps.setInt(2, blockId);
if (ps.executeUpdate() == 0) {
return false;
}
return true;
}
}
|
[
"[email protected]"
] | |
29453ca1f2b8b66cf43518eb75ec734f2c975f1d
|
18fe3bdf13471f81e0ee3831a485c7d5f9bfa3f4
|
/springmvc-mybatis01/src/com/java/junit/TestThis.java
|
b77701f6cbf6bdcc3cf6e4b3fa89e91d4e155c26
|
[] |
no_license
|
ChengCharming/spring-learn
|
2270a383fe3838734c4720e1b4105cf13633b6f0
|
5a2e0f6ee6ea6f9c3974be18c8fcf613a7c6e8f9
|
refs/heads/master
| 2020-03-27T20:41:36.398965 | 2018-10-07T02:42:19 | 2018-10-07T02:42:19 | 147,087,110 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 612 |
java
|
package com.java.junit;
import java.util.List;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.java.dao.mapper.ItemsMapper;
import com.java.pojo.Items;
public class TestThis {
@Test
public void fun() {
ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
ItemsMapper mapper = (ItemsMapper) ac.getBean("itemsMapper");
List<Items> list = mapper.selectAll();
for(Items i : list) {
System.out.println(i);
}
}
}
|
[
"[email protected]"
] | |
172825ebf670e8f63701341afb574dac713f478a
|
f3aef96ff99a3ccf16bb00bcfae897bf1ca07284
|
/app/src/main/java/com/tencent/liteav/videoediter/a/d.java
|
74e90602e6b89367bd439cc7ef0ac5147a5acc1f
|
[] |
no_license
|
hongye007/SimpleVideo
|
7880617dbba458f2ff518ed08041a52fa92ee27e
|
08a2a110bd0080d7e107354f99511519b43c70b1
|
refs/heads/master
| 2021-05-18T12:06:07.904900 | 2020-10-14T13:29:11 | 2020-10-14T13:29:11 | 251,237,458 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,131 |
java
|
package com.tencent.liteav.videoediter.a;
import com.tencent.liteav.basic.log.*;
import java.io.*;
import android.media.*;
import java.util.*;
import android.annotation.*;
public class d extends b
{
private ArrayList<String> a;
private int b;
private long c;
private long d;
public d() {
this.c = 0L;
this.d = 0L;
this.a = new ArrayList<String>();
this.b = -1;
}
public synchronized void a(final List<String> list) {
if (list != null && list.size() > 0) {
this.a.addAll(list);
}
}
@Override
public synchronized void a(final long n) {
if (n <= 0L) {
this.g();
return;
}
this.g();
final long c = 0L;
if (this.a.size() > 0) {
final b b = new b();
int i;
for (i = 0; i < this.a.size(); ++i) {
final String s = this.a.get(i);
try {
b.a(s);
}
catch (IOException ex) {
ex.printStackTrace();
TXCLog.e("TXMultiMediaExtractor", "setDataSource IOException: " + ex);
continue;
}
if (c + b.c() > n) {
break;
}
}
b.e();
if (i < this.a.size()) {
this.b = i;
this.c = c;
try {
super.a(this.a.get(this.b));
}
catch (IOException ex2) {
ex2.printStackTrace();
TXCLog.e("TXMultiMediaExtractor", "setDataSource IOException: " + ex2);
}
super.a(n - this.c);
this.d = super.d();
}
}
}
@TargetApi(16)
public int f() {
MediaFormat mediaFormat = null;
MediaFormat mediaFormat2 = null;
if (this.a.size() > 0) {
final b b = new b();
for (final String s : this.a) {
try {
b.a(s);
}
catch (IOException ex) {
ex.printStackTrace();
TXCLog.e("TXMultiMediaExtractor", "setDataSource IOException: " + ex);
continue;
}
final MediaFormat a = b.a();
final MediaFormat b2 = b.b();
if (mediaFormat == null && mediaFormat2 == null) {
mediaFormat = a;
mediaFormat2 = b2;
}
else {
if ((mediaFormat != null && a == null) || (mediaFormat == null && a != null) || (mediaFormat2 != null && b2 == null) || (mediaFormat2 == null && b2 != null)) {
return -2;
}
try {
if (mediaFormat != null && a != null) {
if (Math.abs(mediaFormat.getInteger("frame-rate") - a.getInteger("frame-rate")) > 3) {
return -4;
}
if (mediaFormat.getInteger("width") != a.getInteger("width")) {
return -5;
}
if (mediaFormat.getInteger("height") != a.getInteger("height")) {
return -6;
}
continue;
}
else {
if (mediaFormat2 == null || b2 == null) {
continue;
}
if (mediaFormat2.getInteger("sample-rate") != b2.getInteger("sample-rate")) {
return -7;
}
if (mediaFormat2.getInteger("channel-count") != b2.getInteger("channel-count")) {
return -8;
}
continue;
}
}
catch (NullPointerException ex2) {
return -3;
}
}
}
b.e();
return 0;
}
return -1;
}
@Override
public synchronized long c() {
long n = 0L;
if (this.a.size() > 0) {
final b b = new b();
for (int i = 0; i < this.a.size(); ++i) {
final String s = this.a.get(i);
try {
b.a(s);
}
catch (IOException ex) {
ex.printStackTrace();
TXCLog.e("TXMultiMediaExtractor", "setDataSource IOException: " + ex);
continue;
}
n += b.c();
}
b.e();
}
return n;
}
@Override
public synchronized int a(final e e) {
int n = super.a(e);
while (n < 0 && this.b < this.a.size() - 1) {
this.c = this.d + 1000L;
++this.b;
try {
this.a(this.a.get(this.b));
}
catch (IOException ex) {
TXCLog.e("TXMultiMediaExtractor", "setDataSource IOException: " + ex);
ex.printStackTrace();
continue;
}
n = super.a(e);
}
if (n >= 0) {
final long d = e.e() + this.c;
e.a(d);
if (this.d < d) {
this.d = d;
}
}
else {
TXCLog.d("TXMultiMediaExtractor", "readSampleData length = " + n);
}
return n;
}
private synchronized void g() {
super.e();
this.b = -1;
this.c = 0L;
this.d = 0L;
}
@Override
public synchronized void e() {
super.e();
this.a.clear();
this.b = -1;
this.c = 0L;
this.d = 0L;
}
}
|
[
"[email protected]"
] | |
d2ac13e514f1e9690f871bba6b136bf0909b265f
|
6802f6d27d346c71f4ff599e2ce5dc195a41e88b
|
/qinZhiJie/src/main/java/com/qzj/dao/UserDao.java
|
8b384521ebb386dd9d5b4db62f7af04b25695ee1
|
[] |
no_license
|
gongyuansong/qinzhijie
|
ad364168f19b970d578c283ab64b725493af35be
|
ffa7e061bf80bcb37fa62237c592c5009b4e9a0e
|
refs/heads/master
| 2022-11-04T17:28:07.198463 | 2019-02-24T06:33:03 | 2019-02-24T06:33:03 | 162,395,622 | 0 | 1 | null | 2022-10-05T19:52:51 | 2018-12-19T06:55:37 |
Java
|
UTF-8
|
Java
| false | false | 711 |
java
|
/*
* 文 件 名: UserDao.java
* 版 权: LeYouYou Technologies Co., Ltd. Copyright YYYY-YYYY, All rights reserved
* 描 述: <描述>
* 修 改 人: Muffler7
* 修改时间: 2018年10月27日
*/
package com.qzj.dao;
import java.util.HashMap;
import java.util.List;
import com.qzj.dto.User;
/**
* 用户登录
*
* @author Muffler7
* @version [版本号, 2018年10月27日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public interface UserDao {
void addUser(User user);
int deleteUser(Long id);
int updateUser(User user);
int countUser(HashMap<String, Object> map);
List<User> seletUserList(HashMap<String, Object> map);
User userInfo(String username);
}
|
[
"[email protected]"
] | |
c58892d3f76d30457daa6716b1b5ca2e9b6cc7b3
|
a56fc7aad827a1b485484cc27a0c7b8ceb422327
|
/java/String-2/getSandwich.java
|
2cbb5ea5685652adb66e52cef8d2bf181e8ce7ea
|
[] |
no_license
|
AutomationTestingD/codingbat-solutions
|
c02bef10302b8bd505884106060f5e41e6344321
|
de55a5e6c1f5f4a12d0b3d2215dffcc4d77b9085
|
refs/heads/master
| 2020-04-08T04:44:48.270647 | 2018-11-25T12:43:50 | 2018-11-25T12:43:50 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 555 |
java
|
public String getSandwich(String str) {
int len = str.length();
String tmpString = "";
String finalString = "";
int start = 0;
int finish = 0;
boolean found = false;
if (len <= 10)
return "";
for (int i = 0; i < len - 4; i++) {
tmpString = str.substring(i, i+5);
if (tmpString.equals("bread") && found == true)
finish = i;
if (tmpString.equals("bread") && found == false) {
start = i+5;
found = true;
}
}
finalString = str.substring(start,finish);
return finalString;
}
|
[
"[email protected]"
] | |
2597df17647ad0defbe930060d221b5ff6f91551
|
6491ad11c8ad21eeaeaeb03db3074c425ac60fe2
|
/xxpay4dubbo-service/src/main/java/org/xxpay/dubbo/model/WecharMapModel.java
|
9ae82b93a205ed78a74a598db1f60c6e02f30427
|
[] |
no_license
|
huoyan108/xxpay4dubbo
|
ca6f04aece4bf942e14f34ea2314955d75f8f10d
|
9a00e2be34982a416bc4ab1ce26f16bea8647d5c
|
refs/heads/master
| 2021-08-23T16:22:57.765128 | 2017-12-05T17:01:28 | 2017-12-05T17:01:28 | 113,188,678 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 686 |
java
|
package org.xxpay.dubbo.model;
import java.util.HashMap;
import java.util.Map;
import org.xxpay.common.util.IPUtility;
import com.hongsou.config.WecharConfig;
public class WecharMapModel {
static {
WecharConfig.init("shared/wechar.properties");
}
/**
* 简单的微信请求map
*
* @return
*/
public static Map getRequestMap() {
HashMap<String,String> request = new HashMap<>();
request.put("appid", WecharConfig.getWxAppid());
request.put("mch_id",WecharConfig.getWxMchId());
request.put("nonce_str",String.valueOf(System.currentTimeMillis()));
request.put("spbill_create_ip",IPUtility.getLocalIP());
return request;
}
}
|
[
"[email protected]"
] | |
9b510be40751bed61009573a62c78563769f835d
|
a6aba26a4f884b0e2ec16352dcda7f48fc8dcb36
|
/java4546/src/network/메신저B.java
|
6f975aed41c165a3aff10bb6886fc3e39f55ce67
|
[] |
no_license
|
teemo117/java_study
|
311accc6f42da4189d354dd82398025f64453a6f
|
a873b82253d41a1d3ca8bc12491e79842dc20ef6
|
refs/heads/master
| 2023-01-19T23:31:05.981948 | 2020-11-18T12:33:02 | 2020-11-18T12:33:02 | 288,131,277 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,497 |
java
|
package network;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.JTextField;
public class 메신저B extends JFrame {
private JTextField input;
private JTextArea list;
public 메신저B() {
setTitle("메신저B");
setSize(300, 500);
getContentPane().setLayout(new BorderLayout(0, 0));
list = new JTextArea();
list.setBackground(Color.WHITE);
list.setFont(new Font("맑은 고딕", Font.BOLD, 15));
getContentPane().add(list, BorderLayout.CENTER);
input = new JTextField();
input.setFont(new Font("맑은 고딕", Font.BOLD, 15));
input.setBackground(Color.CYAN);
getContentPane().add(input, BorderLayout.SOUTH);
input.setColumns(10);
list.setEditable(false);
input.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String data = input.getText();
// 입력한 값 가지고 와서, list up!
list.append("백수 : " + data + "\n");
input.setText("");
try {
// 상대방에게 네트워크 전송
DatagramSocket socket = new DatagramSocket();
byte[] data2 = data.getBytes();
InetAddress ip = InetAddress.getByName("127.0.0.1");
DatagramPacket packet = new DatagramPacket(data2, data2.length, ip, 5000);
socket.send(packet);
socket.close();
} catch (Exception e2) {
System.out.println("데이터 보내는 중 에러 발생");
}
}
});
setVisible(true);
}
public void process() {
while (true) {
try {
DatagramSocket socket;
socket = new DatagramSocket(6000);
System.out.println("받는 쪽 소켓 시작");
System.out.println("받을 준비 끝");
// 빈 패킷 필요
byte[] data = new byte[256];
DatagramPacket packet = new DatagramPacket(data, data.length);
socket.receive(packet);
System.out.println("받은 데이터 : " + new String(data));
list.append("정우 : " + new String(data) + "\n");
socket.close();
} catch (Exception e) {
System.out.println("받는 도중 에러발생");
}
}
}
public static void main(String[] args) {
메신저B m = new 메신저B();
m.process();
}
}
|
[
"[email protected]"
] | |
8fe9c71e3d03175559a311d6b670f240fe842627
|
b146999ae1b9629f9c0e680ba26ae605fe381230
|
/Uva/10976 - Fractions Again/Main.java
|
3057e88c95f9fccf7fecb9b6930dcf10eaff0546
|
[] |
no_license
|
Lufedi/competitive-programming
|
67be0d10efbdd24268f7b656525b4b426deff2b4
|
e18427b52777124477a79a938a80bc097779925a
|
refs/heads/master
| 2021-06-04T01:37:17.577378 | 2020-03-21T17:36:26 | 2020-03-21T17:36:26 | 122,895,243 | 0 | 0 | null | 2020-03-21T17:36:27 | 2018-02-26T01:21:00 |
Java
|
UTF-8
|
Java
| false | false | 280 |
java
|
import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//x = ( k*y)/(y - k)
int k = Integer.parseInt(br.readLine().trim());
}
}
|
[
"[email protected]"
] | |
00320d09d740cdce3dcf5e3bcdddd97e3630a652
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/single-large-project/src/main/java/org/gradle/test/performancenull_326/Productionnull_32595.java
|
20ca3ac3a3caccfd7cdbc360a7d924eb332a30e3
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null |
UTF-8
|
Java
| false | false | 588 |
java
|
package org.gradle.test.performancenull_326;
public class Productionnull_32595 {
private final String property;
public Productionnull_32595(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
|
[
"[email protected]"
] | |
ecc3a0e8f78bff4ee663f6f7302b0afd9bdc9fd5
|
32a9d0e2491046483dea4b44b16b60f4f0018f6c
|
/src/com/hopsun/tppas/api/acceptance/service/TacceptanceCompleteAService.java
|
8d1f22a5b2504e2c0e261892ac53b1591f5e475c
|
[] |
no_license
|
liyl10/tppass
|
b37b03d4ddd60ec853f8f166c42ade9509c6f260
|
441c5bf1a5d6aeb8e1b9c2c218fbf03331129842
|
refs/heads/master
| 2016-09-10T13:39:23.117494 | 2013-12-11T03:10:31 | 2013-12-11T03:10:31 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 267 |
java
|
package com.hopsun.tppas.api.acceptance.service;
import com.hopsun.tppas.entity.TacceptanceCompleteA;
import com.hopsun.framework.base.service.BaseService;
public interface TacceptanceCompleteAService extends BaseService<TacceptanceCompleteA, String> {
}
|
[
"[email protected]"
] | |
97e517dbbfe62f7fcdbb9007bf5347673b99b99b
|
53eed405b7c931031d5764ddd3cff589da7a0e3e
|
/app/src/main/java/com/benilde/queuemanagerlogin/EndQueue.java
|
67934568a765c842a9bd574fa18fa05bc64aa014
|
[] |
no_license
|
RoyChristianYabut/QueueManagerLogin
|
a8df6d51127b743248f80d4bf1ce9dea8d2ef49a
|
6c1db33b723e332ac62f7d1ce8315581a9f2a2bc
|
refs/heads/master
| 2022-12-25T20:16:18.547660 | 2020-10-06T16:21:51 | 2020-10-06T16:21:51 | 279,066,785 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,769 |
java
|
package com.benilde.queuemanagerlogin;
import androidx.appcompat.app.AppCompatActivity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
import java.sql.Connection;
import java.sql.Statement;
public class EndQueue extends AppCompatActivity {
private static String urlAddress="jdbc:mysql://192.168.64.2/queues.php";
private Spinner queueName;
private Button endQueue;
ConnectionClass connectionClass;
ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_end_queue);
// queueName = (Spinner)findViewById(R.id.spinnerEndQueue);
//
// Downloader d=new Downloader(EndQueue.this,urlAddress,queueName);
// d.execute();
// ArrayAdapter<String> endQueueAdapter = new ArrayAdapter<String>(EndQueue.this,
// android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.spinnerQueueNames));
// endQueueAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// queueName.setAdapter(endQueueAdapter);
//
// connectionClass = new ConnectionClass();
// progressDialog = new ProgressDialog(this);
//
// endQueue=(Button)findViewById(R.id.btnSubmitEnd);
//
// endQueue.setOnClickListener(new View.OnClickListener() {//
// @Override
// public void onClick(View v) {
//
//
//
// EndQueue.DoEndQueue doEndQueue = new EndQueue.DoEndQueue();
// doEndQueue.execute();
// }
// });
}
// private class DoEndQueue extends AsyncTask<String,String,String> {
//
//
//
// int queuenames=(int)queueName.getSelectedItemId()+1;
// boolean isSuccess=false;
// String z;
//
// @Override
// protected void onPreExecute() {
//
//
// progressDialog.setMessage("Loading...");
// progressDialog.show();
//
//
// super.onPreExecute();
// }
//
// @Override
// protected String doInBackground(String... params) {
// DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int which) {
// switch (which){
// case DialogInterface.BUTTON_POSITIVE:
// try {
// Connection con = connectionClass.CONN();
// if (con == null) {
// z = "Please check your internet connection";
// } else {
//
// String query="insert into queue(QueueName, TimeStamp, EndTime, Doctor_ID, Department_ID) values ('"+name+"', '"+timeStamp()+"', '"+timeS()+"', '"+doctorD+"', '"+departmentD+"')";
//
//
// Statement stmt = con.createStatement();
//
// stmt.execute(query);
//
// z="Sucessfully Added Queue";
//
//
// }
// }
// catch (Exception ex)
// {
// isSuccess = false;
// z = "Exceptions"+ex;
// }
// break;
//
// case DialogInterface.BUTTON_NEGATIVE:
// //No button clicked
// break;
// }
// }
// };
//
// AlertDialog.Builder builder = new AlertDialog.Builder(EndQueue.getActivity());
// builder.setMessage("Are you sure?").setPositiveButton("Yes", dialogClickListener)
// .setNegativeButton("No", dialogClickListener).show();
//
//
// return z;
// }
//
// @Override
// protected void onPostExecute(String s) {
// Toast.makeText(getBaseContext(),""+z,Toast.LENGTH_LONG).show();
//
//
// if(isSuccess) {
//
// Intent intent=new Intent(EndQueue.this,Dashboard.class);
//
// // intent.putExtra("name",usernam);
//
// startActivity(intent);
// }
//
//
// progressDialog.hide();
//
// }
// }
}
|
[
"[email protected]"
] | |
0cc153f0f65107edc61f9e61141afdd145735411
|
6f01c2cae11121ca39323412698c1f07238c5cfa
|
/src/main/java/com/zhaozhy/autorstore/dao/MaterialDAO.java
|
ed820278eb35c1aaef6c9e1ba877e8e9c1ea3bb1
|
[] |
no_license
|
istar1978/AutoRStore
|
f8a6214b68543a469ba30698e98ab166ada6a6eb
|
dc8950e9cad930b69f959d27e8501c9a3b4e0885
|
refs/heads/master
| 2021-04-03T04:03:56.759383 | 2017-09-27T13:20:13 | 2017-09-27T13:20:13 | 124,853,029 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,916 |
java
|
package com.zhaozhy.autorstore.dao;
import java.math.BigDecimal;
import java.util.List;
import com.zhaozhy.autorstore.entity.Material;
import com.zhaozhy.autorstore.entity.MaterialId;
/**
* @Title MaterialDAO.java
* @Package com.zhaozhy.autorstore.dao
* @Created zhaozhy ([email protected])
* @Date 2017-6-17 上午10:49:43
* @Desc TODO
* @Version V1.0
* @Modified
* @Date
* @Desc
*/
public interface MaterialDAO extends BaseDAO<Material>{
public abstract Material findById(MaterialId id);
public abstract List findByMatName(Object matName);
public abstract List findByRepId(Object repId);
public abstract List findByMatClassify(Object matClassify);
public abstract List findByMatPreprice(Object matPreprice);
public abstract List findByMatRealprice(Object matRealprice);
public abstract List findByMatFactory(Object matFactory);
public abstract List findByMatNum(Object matNum);
/**
* @param material
* @return
*/
public abstract List findAllByExample(Material material);
/**
* @param material
* @param intPage
* @param intPageSize
* @return
*/
public abstract List findAllByExamplePerPage(Material material,
int intPage, int intPageSize);
/**
* 取出药品表中状态为*的所有数据
*
* @return
*/
public abstract List findAllHas();
/**
*
* @CreateDate 2017-6-22 上午11:45:02
* @Author zhaozhy ([email protected])
* @Desc 根据所在机构ID和状态查询维修材料list
* @param braId
* @param stat
* @return
*/
public abstract List findByBraidStat(String braId, String stat);
/**
*
* @CreateDate 2017-6-22 下午04:18:28
* @Author zhaozhy ([email protected])
* @Desc 根据mat_id 查询维修材料销售单价
* @param matId
* @return
*/
public abstract BigDecimal getPerPriceByMatId(String matId);
}
|
[
"[email protected]"
] | |
4637317d89daa631892c9f9d135b74376b5cb1fd
|
93b5e34099b4977fb71d72b09c8dd65ebdac9b91
|
/Bike_Showroom_Management_System/app/src/main/java/com/example/bike_showroom_management_system/ui/share/ShareFragment.java
|
406d71bec115c9e34ee72f967add9e44508e0bd3
|
[] |
no_license
|
patoorusirisha/classwork
|
b985d3c8c7d2ee577978450e1467eab72c71d893
|
7717dcaafcdd3bf8c082fe91f410a0d7e8f93c67
|
refs/heads/master
| 2023-05-14T20:39:32.819026 | 2021-06-08T14:38:36 | 2021-06-08T14:38:36 | 352,970,086 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,186 |
java
|
package com.example.bike_showroom_management_system.ui.share;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.example.bike_showroom_management_system.R;
public class ShareFragment extends Fragment {
private ShareViewModel shareViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
shareViewModel =
ViewModelProviders.of(this).get(ShareViewModel.class);
View root = inflater.inflate(R.layout.fragment_share, container, false);
final TextView textView = root.findViewById(R.id.text_share);
shareViewModel.getText().observe(this, new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
}
|
[
"[email protected]"
] | |
1442a49ecb3ead84a05845751fe345df364ea882
|
71c945b12880ded044dd3f6ae45841bc984feb28
|
/FinanceIncome.java
|
1ee99c7068dd64cdf0eea1fdbca62f80fe55f183
|
[] |
no_license
|
mw23522/hsms
|
9c6f74eef98ec4065c394fe519f0251665f07110
|
8d12144dae2286c132ba5a61073b11603a0cadde
|
refs/heads/master
| 2021-01-22T20:39:18.700969 | 2013-11-20T12:28:06 | 2013-11-20T12:28:06 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,736 |
java
|
import java.util.Scanner;
public class FinanceIncome extends HSMS
{
private String donator;
private double amountOfDonation;
private String duration;
private int emplID_in_charge;
private String description;
public FinanceIncome(int emplID, String emplName, int dept, String donator_name, double amount, String duration)
{
super(emplID, emplName, dept);
donator = donator_name;
amountOfDonation = amount;
this.duration = duration;
}
//Form for donation
public void incomeMenu()
{
int user_input;
Scanner scan = new Scanner(System.in);
System.out.println("Homeless Shelter Management System Income Information");
Sysmte.out.println("1. View the list");
System.out.println("2. Create");
System.out.println("3. Modifiy");
System.out.println("4. Delete");
System.out.println("5. Exit");
System.out.println();
System.out.println();
System.out.print("Please choose a number for an operation: ");
user_input = scan.nextInt();
switch(user_input)
case(1):
displayInfo();
break;
case(2):
createInfo();
break;
case(3):
modifyInfo();
break;
case(4):
deleteInfo();
break;
case(5):
}
//
private void displayInfo()
{
}
private void createInfo()
{
}
private void modifyInfo()
{
}
private void deleteInfo()
{
}
}
|
[
"[email protected]"
] | |
9ce0b999da259dbcadd9a285d176d0343502f098
|
a1fad8ea8dd0debbc5194c89ef3707a5a57429a1
|
/app/src/main/java/com/jiyun/asmodeus/xyxy/model/biz/IPostUserInfoService.java
|
bfd6f5b08d4a284ba5fa8caa32fe61fc1ca55ebf
|
[] |
no_license
|
Asmodeus0p/XYXY
|
3e21a5fcdba9b68be3080cb770421c2d6026ce82
|
6f667edf4ddb8296b5ea248cdde721576cd60f31
|
refs/heads/master
| 2020-03-15T12:03:54.782417 | 2018-05-14T12:03:41 | 2018-05-14T12:03:41 | 131,949,819 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,109 |
java
|
package com.jiyun.asmodeus.xyxy.model.biz;
import com.jiyun.asmodeus.xyxy.model.entity.BasicSuccessBean;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
public interface IPostUserInfoService {
@FormUrlEncoded
@POST("/v1/m/user/info/edit")
Observable<BasicSuccessBean> postUserInfo(@Field("id") Integer id,
@Field("nickname") String nickname,
@Field("realname") String realname,
@Field("photo") String photo,
@Field("images") String images,
@Field("intro") String intro,
@Field("details") String details,
@Field("sex") int sex,
@Field("birthday") String birthday,
@Field("address") String address);
}
|
[
"[email protected]"
] | |
fdc2d65ff3c6389c5c6a6a0d06fbab837f78e8ae
|
aa6997aba1475b414c1688c9acb482ebf06511d9
|
/src/org/w3c/dom/DOMLocator.java
|
819c6c1a72ae69edea9a43b8e09a15026612b519
|
[] |
no_license
|
yueny/JDKSource1.8
|
eefb5bc88b80ae065db4bc63ac4697bd83f1383e
|
b88b99265ecf7a98777dd23bccaaff8846baaa98
|
refs/heads/master
| 2021-06-28T00:47:52.426412 | 2020-12-17T13:34:40 | 2020-12-17T13:34:40 | 196,523,101 | 4 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,004 |
java
|
/*
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
/*
*
*
*
*
*
* Copyright (c) 2004 World Wide Web Consortium,
*
* (Massachusetts Institute of Technology, European Research Consortium for
* Informatics and Mathematics, Keio University). All Rights Reserved. This
* work is distributed under the W3C(r) Software License [1] 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.
*
* [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
*/
package org.w3c.dom;
/**
* <code>DOMLocator</code> is an interface that describes a location (e.g. where an error occurred).
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object
* Model (DOM) Level 3 Core Specification</a>.
*
* @since DOM Level 3
*/
public interface DOMLocator {
/**
* The line number this locator is pointing to, or <code>-1</code> if
* there is no column number available.
*/
public int getLineNumber();
/**
* The column number this locator is pointing to, or <code>-1</code> if
* there is no column number available.
*/
public int getColumnNumber();
/**
* The byte offset into the input source this locator is pointing to or
* <code>-1</code> if there is no byte offset available.
*/
public int getByteOffset();
/**
* The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], offset into the input
* source this locator is pointing to or <code>-1</code> if there is no UTF-16 offset available.
*/
public int getUtf16Offset();
/**
* The node this locator is pointing to, or <code>null</code> if no node
* is available.
*/
public Node getRelatedNode();
/**
* The URI this locator is pointing to, or <code>null</code> if no URI is
* available.
*/
public String getUri();
}
|
[
"[email protected]"
] | |
2cf49908a7cbea2fecfbf09a12418125793c4970
|
92f2df2289eb55810bccb30ea0b29ca3fbc84e79
|
/BoosterCodeGenerator/src/test/java/com/hexacta/booster/codegeneration/metamodel/PersistableMetaModelBuilderTest.java
|
25f1a916d912676335ad2d9d5b9f93460128b64d
|
[] |
no_license
|
ltenconi/hexacta-booster
|
b47fb01bee57cbd9c2041fd50b83e915293d41b4
|
c130039f2b669c092ce97864b926916bce6e146d
|
refs/heads/master
| 2021-05-09T02:14:33.793234 | 2018-02-20T15:43:13 | 2018-02-20T15:43:13 | 119,201,384 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,703 |
java
|
package com.hexacta.booster.codegeneration.metamodel;
import junit.framework.TestCase;
import test.hexacta.booster.providers.MetaModelProvider;
import com.hexacta.booster.codegeneration.configuration.AttributesSubset;
import com.hexacta.booster.codegeneration.configuration.ClassList;
import com.hexacta.booster.codegeneration.configuration.PersistableMetaModelAttributes;
import com.hexacta.booster.exception.ModelClassNotFound;
/**
*
*/
public class PersistableMetaModelBuilderTest extends TestCase {
public void testPersistableMetaModelBuilder() {
Class metaModelClass = MetaModelProvider.getMetaModel(test.model.Room.class);
ClassList classList = new ClassList();
classList.addClass(metaModelClass);
PersistableMetaModelAttributes persistableMetaModelAttributes = new PersistableMetaModelAttributes();
AttributesSubset attributesSubset = new AttributesSubset();
attributesSubset.add("roomId");
persistableMetaModelAttributes.add(metaModelClass.getSimpleName(), attributesSubset);
ClassList persistableList = null;
try {
persistableList = PersistableMetaModelBuilder.build(classList, persistableMetaModelAttributes);
} catch (NotExistAttributeException e) {
fail(e.getMessage());
} catch (ModelClassNotFound e) {
fail(e.getMessage());
} catch (NotAnEntityClassException e) {
fail(e.getMessage());
}
assertEquals(1, persistableList.getClass(metaModelClass.getName()).getDeclaredFields().length);
assertEquals("roomId", persistableList.getClass(metaModelClass.getName()).getDeclaredFields()[0].getName());
}
}
|
[
"[email protected]"
] | |
98612b8f9db2caab93ce0b4010d4c0bfb110ab76
|
65f2aa8de45d8402ad00e6e944cfdbc71b27fe52
|
/src/main/java/com/jzli/netty/demo/chapter5_1/EchoClientHandler.java
|
a4861f9190e8bfafe052019f38230d23a9c2776b
|
[] |
no_license
|
litt58/NettyDemo
|
b1e821cd6d474e4f538f05fd0be99f0af3bb619d
|
beb959e30a277550de9b247af01a7df7c5884509
|
refs/heads/master
| 2021-01-23T09:40:10.648778 | 2018-01-02T03:03:04 | 2018-01-02T03:03:04 | 102,589,843 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,215 |
java
|
package com.jzli.netty.demo.chapter5_1;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* =======================================================
*
* @Company 产品技术部
* @Date :2017/10/16
* @Author :李金钊
* @Version :0.0.1
* @Description :
* ========================================================
*/
public class EchoClientHandler extends ChannelHandlerAdapter {
private Logger logger = LoggerFactory.getLogger(this.getClass());
private int counter = 1;
private String msg = "Hi 李金钊!$_";
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
for (int i = 0; i < 100; i++) {
ctx.writeAndFlush(Unpooled.copiedBuffer(msg.getBytes()));
}
}
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
logger.info("This is " + counter++ + " times receive server:[" + msg + "]");
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
ctx.flush();
}
}
|
[
"[email protected]"
] | |
e58421db6c8f28f7c0bc2cf50b1f1eb581f924b4
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/P9-8.0/src/main/java/android/hardware/wifi/V1_0/IfaceType.java
|
7d70c42cf1c7f5d568efad27ef17f3750cedd026
|
[] |
no_license
|
morningblu/HWFramework
|
0ceb02cbe42585d0169d9b6c4964a41b436039f5
|
672bb34094b8780806a10ba9b1d21036fd808b8e
|
refs/heads/master
| 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,229 |
java
|
package android.hardware.wifi.V1_0;
import java.util.ArrayList;
public final class IfaceType {
public static final int AP = 1;
public static final int NAN = 3;
public static final int P2P = 2;
public static final int STA = 0;
public static final String toString(int o) {
if (o == 0) {
return "STA";
}
if (o == 1) {
return "AP";
}
if (o == 2) {
return "P2P";
}
if (o == 3) {
return "NAN";
}
return "0x" + Integer.toHexString(o);
}
public static final String dumpBitfield(int o) {
ArrayList<String> list = new ArrayList();
int flipped = 0;
if ((o & 0) == 0) {
list.add("STA");
flipped = 0;
}
if ((o & 1) == 1) {
list.add("AP");
flipped |= 1;
}
if ((o & 2) == 2) {
list.add("P2P");
flipped |= 2;
}
if ((o & 3) == 3) {
list.add("NAN");
flipped |= 3;
}
if (o != flipped) {
list.add("0x" + Integer.toHexString((~flipped) & o));
}
return String.join(" | ", list);
}
}
|
[
"[email protected]"
] | |
65851894813eb8f13c6a5151860ff8fc700aa8a5
|
96ee93e72362947b75e0c39de0daf17aca14f5e8
|
/app/src/main/java/com/github/fengdai/hangman/data/api/requests/GetResultRequest.java
|
9194b9f00ce01c7118ab332f7bb50b82e2ac437e
|
[] |
no_license
|
fengdai/Hangman-Android
|
eb8b2bfdb55034737ec635aef461cfa9600ac473
|
b6d84891cb9f21ed386b83659838ab5341d5fbd2
|
refs/heads/master
| 2020-04-06T07:02:03.031834 | 2015-03-31T09:37:23 | 2015-03-31T09:37:23 | 33,176,847 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 212 |
java
|
package com.github.fengdai.hangman.data.api.requests;
public class GetResultRequest extends SessionActionRequest {
public GetResultRequest(String sessionId) {
super("getResult", sessionId);
}
}
|
[
"[email protected]"
] | |
43ede34266a138f3e47b13a5891f87bd37929b03
|
2f52870abfab54b4a300d3ae34349c27b58d28e2
|
/src/main/java/org/ec4j/maven/core/PathSet.java
|
7d43f350a42d1bc3d8419223b3515c254c2096ff
|
[] |
no_license
|
ppalaga/editorconfig-maven-plugin
|
676a03b810cbbb0a055b1bcff31a082049b3fa56
|
8a34cc3dace7127de5f5c6f4c090dee654cab325
|
refs/heads/master
| 2023-03-17T14:35:25.825390 | 2018-01-01T12:54:17 | 2018-01-01T12:54:17 | 39,347,559 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,551 |
java
|
/**
* Copyright (c) 2017 EditorConfig Maven Plugin
* project contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ec4j.maven.core;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* A set of {@link Path}s defined by include and exclude globs.
*
* @author <a href="https://github.com/ppalaga">Peter Palaga</a>
*/
public class PathSet {
/**
* A {@link PathSet} builder.
*/
public static class Builder {
private static final FileSystem fileSystem = FileSystems.getDefault();
private List<PathMatcher> excludes = new ArrayList<>();
private List<PathMatcher> includes = new ArrayList<>();
Builder() {
super();
}
/**
* @return a new {@link PathSet}
*/
public PathSet build() {
List<PathMatcher> useExcludes = this.excludes;
this.excludes = null;
List<PathMatcher> useIncludes = this.includes;
this.includes = null;
return new PathSet(Collections.unmodifiableList(useIncludes), Collections.unmodifiableList(useExcludes));
}
/**
* Adds an exclude glob
*
* @param glob
* the glob to add
* @return this {@link Builder}
*/
public Builder exclude(String glob) {
excludes.add(fileSystem.getPathMatcher("glob:" + glob));
return this;
}
/**
* Adds multiple exclude globs
*
* @param globs
* the globs to add
* @return this {@link Builder}
*/
public Builder excludes(List<String> globs) {
if (globs != null) {
for (String glob : globs) {
excludes.add(fileSystem.getPathMatcher("glob:" + glob));
}
}
return this;
}
/**
* Adds multiple exclude globs
*
* @param globs
* the globs to add
* @return this {@link Builder}
*/
public Builder excludes(String... globs) {
if (globs != null) {
for (String glob : globs) {
excludes.add(fileSystem.getPathMatcher("glob:" + glob));
}
}
return this;
}
/**
* Adds an include glob
*
* @param glob
* the glob to add
* @return this {@link Builder}
*/
public Builder include(String glob) {
includes.add(fileSystem.getPathMatcher("glob:" + glob));
return this;
}
/**
* Adds multiple include globs
*
* @param globs
* the globs to add
* @return this {@link Builder}
*/
public Builder includes(List<String> globs) {
for (String glob : globs) {
includes.add(fileSystem.getPathMatcher("glob:" + glob));
}
return this;
}
/**
* Adds multiple include globs
*
* @param globs
* the globs to add
* @return this {@link Builder}
*/
public Builder includes(String... globs) {
if (globs != null) {
for (String glob : globs) {
includes.add(fileSystem.getPathMatcher("glob:" + glob));
}
}
return this;
}
}
private static final Path CURRENT_DIR = Paths.get(".");
/**
* @return new {@link Builder}
*/
public static Builder builder() {
return new Builder();
}
/**
* @param includes
* the globs to define a new {@link PathSet}
* @return a {@link PathSet} defined by the given {@code includes}
*/
public static PathSet ofIncludes(String... includes) {
return builder().includes(includes).build();
}
private final List<PathMatcher> excludes;
private final List<PathMatcher> includes;
PathSet(List<PathMatcher> includes, List<PathMatcher> excludes) {
this.includes = includes;
this.excludes = excludes;
}
/**
* @param path
* the {@link Path} to check
* @return {@code true} if this {@link PathSet} contains the given {@link Path} or {@code false} otherwise
*/
public boolean contains(Path path) {
path = CURRENT_DIR.resolve(path);
for (PathMatcher exclude : excludes) {
if (exclude.matches(path)) {
return false;
}
}
for (PathMatcher include : includes) {
if (include.matches(path)) {
return true;
}
}
return false;
}
}
|
[
"[email protected]"
] | |
6747171f5bd51acfa6f7aed4910054d6c9be47fb
|
9b054f39c73c84172369901db8ec6d81aa7d1f66
|
/dzhava/lab3/src/main/java/app/Car/CarController.java
|
59152fa75b36ca6aedb7f075f9386a25095de791
|
[] |
no_license
|
aliceorlova/kopei
|
450c6883751d81c34e69df3b2343acb5a0ac7ed6
|
607a0cddf1d807f52ecc6aa9449786be97b39905
|
refs/heads/master
| 2022-12-15T23:36:16.497565 | 2020-02-24T17:57:31 | 2020-02-24T17:57:31 | 225,636,754 | 0 | 2 | null | 2022-12-13T18:39:08 | 2019-12-03T14:14:22 |
Java
|
UTF-8
|
Java
| false | false | 565 |
java
|
package app.Car;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.sql.SQLException;
@RestController
@RequestMapping(path = "/cars")
public class CarController {
@Autowired
CarService service;
@RequestMapping(path = "/{id}", method = RequestMethod.GET)
Car GetById(@PathVariable int id) throws SQLException {
return service.GetById(id);
}
@GetMapping("/")
public Iterable<Car> getAll() throws SQLException {
return service.GetAll();
}
}
|
[
"[email protected]"
] | |
8239a5502b52d104f75cbfe825b4af75c465c344
|
1cb12236f2034425b850b795db97796d0b628ec9
|
/test/src/mygame/Helper.java
|
48c523e154f340af62788060ea493f42f84fc3bd
|
[] |
no_license
|
Koneke/pluppolina
|
440b866a97f6d84e299eda9fc0ef432b3f43af21
|
27b2ee296000358e0cabc12b23c8a3c35cf61a24
|
refs/heads/master
| 2021-01-02T23:13:34.285826 | 2013-10-10T12:13:56 | 2013-10-10T12:13:56 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 335 |
java
|
package mygame;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
public class Helper {
public static Geometry createCube(float x, float y, float z, String name) {
Box b = new Box(Vector3f.ZERO, x, y, z);
Geometry g = new Geometry(name, b);
return g;
}
}
|
[
"[email protected]"
] | |
14bfcf8e861f8db7ed81ef02dbf8cd83dbd69856
|
c94b81d4ac8f5156c937bd35da1a77f24c043455
|
/MySuDuBomb/app/src/main/java/com/example/mysudubomb/adapter/FoodAdapter.java
|
00256a8d6c6245877b4ae26b018b2d5922a7f932
|
[] |
no_license
|
871924230jp/sudu
|
7ad03a6e79d25549ed00d5f465217db03bde6280
|
3f8f5dfd3d2ee044350c195114c4442e9454b079
|
refs/heads/master
| 2023-04-26T15:00:56.253978 | 2021-05-16T14:09:40 | 2021-05-16T14:09:40 | 367,899,109 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,683 |
java
|
package com.example.mysudubomb.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.mysudubomb.R;
import com.example.mysudubomb.bean.FoodInfo;
import java.util.List;
public class FoodAdapter extends BaseAdapter {
private Context context;
private List<FoodInfo> foodlist;
private int resLayout;
public FoodAdapter(Context context,List<FoodInfo>foodlist,int resLayout){
this.context=context;
this.foodlist=foodlist;
this.resLayout=resLayout;
}
@Override
public int getCount() {
return foodlist.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView== null){
convertView=View.inflate(context,resLayout,null);
holder = new ViewHolder();
holder.tv_it_shicai=convertView.findViewById(R.id.tv_it_shicai);
holder.tv_it_kcal=convertView.findViewById(R.id.tv_it_kcal);
convertView.setTag(holder);
}else {
holder=(ViewHolder) convertView.getTag();
}
holder.tv_it_shicai.setText(foodlist.get(position).getShicai());
holder.tv_it_kcal.setText(foodlist.get(position).getKcal());
return convertView;
}
private static class ViewHolder{
TextView tv_it_shicai;
TextView tv_it_kcal;
}
}
|
[
"[email protected]"
] | |
f69707f18f53e2bf7be8c677dfe7c8e3f242806b
|
3912e0aeea36294cfe6fdaeb296f1a171e447a86
|
/app/src/main/java/com/example/sumit/mysqlandroid/MySingleton.java
|
1ff0645acc87160a6aa6529fcdaba9ed351060c5
|
[] |
no_license
|
riyapathan/MySqlAndroid
|
bd935cb000a0fcb07df42bc4983eb937c15479ad
|
b590a87a1b17d927981e55ca2596140be6d95f18
|
refs/heads/master
| 2020-05-23T13:44:34.806473 | 2017-08-08T14:14:43 | 2017-08-08T14:14:43 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,781 |
java
|
package com.example.sumit.mysqlandroid;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v4.util.LruCache;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
public class MySingleton {
private static MySingleton mInstance;
private RequestQueue mRequestQueue;
private ImageLoader mImageLoader;
private static Context mCtx;
private MySingleton(Context context) {
mCtx = context;
mRequestQueue = getRequestQueue();
mImageLoader = new ImageLoader(mRequestQueue,
new ImageLoader.ImageCache() {
private final LruCache<String, Bitmap>
cache = new LruCache<String, Bitmap>(20);
@Override
public Bitmap getBitmap(String url) {
return cache.get(url);
}
@Override
public void putBitmap(String url, Bitmap bitmap) {
cache.put(url, bitmap);
}
});
}
public static synchronized MySingleton getInstance(Context context) {
if (mInstance == null) {
mInstance = new MySingleton(context);
}
return mInstance;
}
public RequestQueue getRequestQueue() {
if (mRequestQueue == null) {
mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());
}
return mRequestQueue;
}
public <T> void addToRequestQueue(Request<T> req) {
getRequestQueue().add(req);
}
public ImageLoader getImageLoader() {
return mImageLoader;
}
}
|
[
"[email protected]"
] | |
484d2b45c2ed2efde7402d8e5aee16bf888a6c08
|
72c47a38d1c9bdfbce85012744e85cf52b6295f7
|
/linkedin/linkedin-model/src/main/java/com/ra/course/linkedin/model/entity/other/Group.java
|
ef5cc9df351e13f64f6a1fcbf24362ade4b7ffa7
|
[] |
no_license
|
GaiverK/linkedin
|
728cfcd119cd4e7c12798c5d6feb174aba0dfb95
|
99dd5e3d049f74e173e3c85d6d9c8a702bee309b
|
refs/heads/main
| 2022-12-27T19:54:06.734944 | 2020-10-12T10:18:04 | 2020-10-12T10:18:04 | 303,353,763 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 752 |
java
|
package com.ra.course.linkedin.model.entity.other;
import com.ra.course.linkedin.model.entity.BaseEntity;
import com.ra.course.linkedin.model.entity.person.Member;
import lombok.*;
import java.util.ArrayList;
import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class Group extends BaseEntity {
private String name;
private String description;
private Member owner;
private List<Member> groupMembers = new ArrayList<>();
@Builder
public Group(Long id, String name, String description, Member owner, List<Member> groupMembers) {
super(id);
this.name = name;
this.description = description;
this.owner = owner;
this.groupMembers = groupMembers;
}
}
|
[
"[email protected]"
] | |
a5661c8f4d5a092a7f8dabd36e88dddf3f3a805c
|
e5df2a470a7302543b1fc78ff625520b63ac17f6
|
/src/main/java/org/cirdles/topsoil/builder/ChartCustomizationPanelBuilder.java
|
6d877a1fd2b09e863568887462639a19aef59da4
|
[] |
no_license
|
noahmclean/topsoil
|
7f22baf1d65b01e426c7bb3b81f77a6501afc94e
|
789656f7bc74dde241cb7488715080641059cec6
|
refs/heads/master
| 2020-12-25T11:16:22.520250 | 2014-05-30T20:55:16 | 2014-05-30T20:55:16 | 20,440,865 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,228 |
java
|
/*
* Copyright 2014 pfif.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cirdles.topsoil.builder;
import javafx.util.Builder;
import org.cirdles.topsoil.chart.concordia.ErrorEllipseChart;
import org.cirdles.topsoil.chart.concordia.panels.ChartCustomizationPanel;
/**
*
* @author pfif
*/
public class ChartCustomizationPanelBuilder implements Builder<ChartCustomizationPanel> {
private ErrorEllipseChart chart;
@Override
public ChartCustomizationPanel build() {
return new ChartCustomizationPanel(chart);
}
public ErrorEllipseChart getChart() {
return chart;
}
public void setChart(ErrorEllipseChart newChart) {
chart = newChart;
}
}
|
[
"[email protected]"
] | |
1a3d993e87dee81e4a9a5fba576a58ac5c7119ca
|
73fc1e3e3d33a03bab71020f2dd4dcb706b7f59b
|
/Ninja.java
|
a286a3557f4a2f74be801fcf39929339c97332fd
|
[] |
no_license
|
neumeye9/Human-Java-OOP
|
f435401d7a5a18e4a425cb5e9468f62666fc69c2
|
bd3f4ddab622575845017bcef9eedea829bc3fb8
|
refs/heads/master
| 2020-12-02T16:42:46.069210 | 2017-07-07T19:48:28 | 2017-07-07T19:48:28 | 96,571,663 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 388 |
java
|
import java.util.*;
class Ninja extends Human{
int stealth = 10;
public void steal(Human human){
human.health -= human.stealth;
System.out.println("Stole from another human, decreased their health to:" + human.stealth);
}
public void runAway(){
health -= 10;
System.out.println("Ran away, decreased your health to:" + health);
}
}
|
[
"[email protected]"
] | |
29be6e32492c708489dee380d0f03c393af75d19
|
779576c453e1696a2a6ea5fb342ccec795cc3ddc
|
/src/main/java/com/firstfurious/user/User.java
|
404962a629867d9231bde78e3550bf2b860258bd
|
[] |
no_license
|
kkchaudhary11/firstFurious
|
b433e2878ad019214984f676ddeb9baebf370919
|
bf9cbe416bb45846aa8ee8858742b39923594961
|
refs/heads/master
| 2020-07-03T02:29:03.375784 | 2017-02-14T20:09:38 | 2017-02-14T20:09:38 | 74,203,931 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,354 |
java
|
package com.firstfurious.user;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
@Entity
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id @GeneratedValue(strategy=GenerationType.SEQUENCE)
private long uId;
private String uName;
private String uEmail;
private String uPassword;
@Transient
private String uCPassword;
private String uAddress;
private String uPhone;
private int role = 1;
private boolean Active = true;
public long getuId() {
return uId;
}
public void setuId(long uId) {
this.uId = uId;
}
@NotEmpty(message="Username Field is Mandatory")
public String getuName() {
return uName;
}
public void setuName(String uName) {
this.uName = uName;
}
@NotEmpty(message="Email Field is Mandatory")
public String getuEmail() {
return uEmail;
}
public void setuEmail(String uEmail) {
this.uEmail = uEmail;
}
@NotEmpty(message="Password Field is Mandatory")
@Column(length = 60)
public String getuPassword() {
return uPassword;
}
public void setuPassword(String uPassword) {
this.uPassword = uPassword;
}
public String getuCPassword() {
return uCPassword;
}
public void setuCPassword(String uCPassword) {
this.uCPassword = uCPassword;
}
@NotEmpty(message="Address field is Mandatory")
public String getuAddress() {
return uAddress;
}
public void setuAddress(String uAddress) {
this.uAddress = uAddress;
}
@NotEmpty(message="Phone Number Field is Mandatory")
@Length(max= 10, min=10, message="Phone number is not valid. Should be lenght 10")
public String getuPhone() {
return uPhone;
}
public void setuPhone(String uPhone) {
this.uPhone = uPhone;
}
public int getRole() {
return role;
}
public void setRole(int role) {
this.role = role;
}
public boolean isActive() {
return Active;
}
public void setActive(boolean active) {
Active = active;
}
}
|
[
"[email protected]"
] | |
212a82c1e509a9c92dbfe197e691c33789eeccfa
|
c586fd24a1c093fa4ed8baf994ce9552e8313fd8
|
/src/main/java/com/arllain/backend/domain/enums/EstadoPagamento.java
|
a06918bf146f0f944fa2852b5d83fa052bc57240
|
[] |
no_license
|
arllain/backend-Spring-Boot
|
1a5ff37e109dc14077abeee3df34a1dbda796f99
|
49160d9f0de1589e05b6ca1fcd54853157c090aa
|
refs/heads/master
| 2020-03-13T10:02:31.016974 | 2018-06-29T11:17:11 | 2018-06-29T11:17:11 | 131,076,200 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,056 |
java
|
package com.arllain.backend.domain.enums;
public enum EstadoPagamento {
PENDENTE(1, "Pendente"),
QUITADO(2, "Quitado"),
CANCELADO(3, "Cancelado");
private int cod;
private String descricao;
/**
* @param cod
* @param descricao
*/
private EstadoPagamento(int cod, String descricao) {
this.cod = cod;
this.descricao = descricao;
}
/**
* @return the cod
*/
public int getCod() {
return cod;
}
/**
* @param cod the cod to set
*/
public void setCod(int cod) {
this.cod = cod;
}
/**
* @return the descricao
*/
public String getDescricao() {
return descricao;
}
/**
* @param descricao the descricao to set
*/
public void setDescricao(String descricao) {
this.descricao = descricao;
}
public static EstadoPagamento toEnum(Integer cod) {
if(cod == null) {
return null;
}
for(EstadoPagamento estadoPagamento: EstadoPagamento.values()) {
if(cod.equals(estadoPagamento.getCod())){
return estadoPagamento;
}
}
throw new IllegalArgumentException("código inválido: " + cod);
}
}
|
[
"[email protected]"
] | |
2c2214b816c5470370777d7950640814e1de83c9
|
d6f42199969619a34c8ff08c693d9576c8a9fafe
|
/pet-clinic-web/src/test/java/com/vinod/petclinic/PetClinicApplicationTests.java
|
d024ccec8af9326db3ba94047ed2ef44b4dce867
|
[] |
no_license
|
vinodhire/pet-clinic
|
aef1aabaeba8cb10e01b0784aadfd5bac29159d9
|
71052607076cdd90dc7c55fedcc78bf53afd89b2
|
refs/heads/master
| 2020-04-09T08:08:05.257343 | 2019-01-08T09:18:34 | 2019-01-08T09:18:34 | 160,183,514 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 394 |
java
|
package com.vinod.petclinic;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
@ExtendWith(SpringExtension.class)
@SpringBootTest
public class PetClinicApplicationTests {
@Test
public void contextLoads() {
}
}
|
[
"optus2018@123"
] |
optus2018@123
|
57c4ec9c154989cb1b7ec620889a3ccd8a3e5c27
|
fee813707ebfaac355f09f2604573f4900cf8cea
|
/src/main/java/com/ljy/java_practice/nowcoder/a/a2/a2_1/Main.java
|
7d1c0ec337f31f2d890c26dd0e2a78a074656180
|
[] |
no_license
|
ljyCompany1/java_match
|
bdb63bf3bc977b1bd8299402d4388cfac33db4e0
|
6b901b28cb79c4672ddc01ca97c88f703ba4cbed
|
refs/heads/master
| 2021-06-28T20:39:03.370279 | 2019-12-24T12:52:04 | 2019-12-24T12:52:04 | 180,297,797 | 0 | 0 | null | 2020-10-13T12:46:13 | 2019-04-09T06:15:19 |
Java
|
UTF-8
|
Java
| false | false | 1,789 |
java
|
package com.ljy.java_practice.nowcoder.a.a2.a2_1;
/**
* 1.题目地址:https://ac.nowcoder.com/acm/problem/21994
* (1)题目描述:给你一天里的两个时间(24小时制),求这两个时间内有多少分钟,保证第一个时间在第二个时间之前
* (2)输入描述:输入两行,每行包含两个整数表示小时与分钟
* (3)输出描述:输出分钟数
* (4)例如:
* a.示例1
* 输入:
* 10 10
* 11 05
* 输出:55
* 2.思路分析
* (1)如何从控制台拆分出两个时间
* (2)如何将控制台的字符串格式化为时间
* (3)如何计算时间差
* 3.运行结果
*通过
*
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader ir = new InputStreamReader(System.in);
BufferedReader bf = new BufferedReader(ir);
String date1String=bf.readLine();//根据题目输入要求:获取控制台输入的两个日期
String date2String=bf.readLine();//根据题目输入要求:获取控制台输入的两个日期
SimpleDateFormat dateFormat=new SimpleDateFormat("HH mm");//日期格式化
try {
Date date1=dateFormat.parse(date1String);
Date date2=dateFormat.parse(date2String);
if(!date1.after(date2)){//如果时间1不在时间2之后
long diff = (date2.getTime() - date1.getTime())/(1000 * 60);//计算相差的分钟
System.out.println(diff);
}
} catch (ParseException e) {
e.printStackTrace();
}
}
}
|
[
"[email protected]"
] | |
36644e92943cbbd113664220d369cf6bcf217ccf
|
dbd491859ac81fb6b4b2dc3e10bd1b0db58fc371
|
/app/src/main/java/com/park61/widget/imageview/Info.java
|
c444a0253ff41822eb760560f6ebc0b929dbb3fe
|
[] |
no_license
|
shushucn2012/park61
|
222dbaf728342c2c2895c1d284b3226480fc0c92
|
9fb6d0e60ac469ba729badbd98ca4809597fb43c
|
refs/heads/master
| 2020-06-18T20:02:11.728131 | 2019-07-14T01:03:56 | 2019-07-14T01:03:56 | 196,427,832 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 605 |
java
|
package com.park61.widget.imageview;
import android.graphics.RectF;
import android.widget.ImageView;
public class Info {
RectF mRect = new RectF();
RectF mLocalRect = new RectF();
RectF mImgRect = new RectF();
RectF mWidgetRect = new RectF();
float mScale;
float mDegrees;
ImageView.ScaleType mScaleType;
public Info(RectF rect, RectF local, RectF img, RectF widget, float scale,
float degrees, ImageView.ScaleType scaleType) {
mRect.set(rect);
mLocalRect.set(local);
mImgRect.set(img);
mWidgetRect.set(widget);
mScale = scale;
mScaleType = scaleType;
mDegrees = degrees;
}
}
|
[
"[email protected]"
] | |
9d3c2d6884727eba60134f9d2352c1ce4429eece
|
189685ef3593581c2c9fb1ad147075419ce0ed3e
|
/titus-cli/src/main/java/com/netflix/titus/cli/command/job/JobProcessesCommand.java
|
2f54b9bd62206c0fd741a8a849e4baacf8124a0e
|
[
"Apache-2.0"
] |
permissive
|
joshi-keyur/titus-control-plane
|
32af8c09a1a5d6e7a7f8da888ec3fafc3edca31f
|
52c752fbe1b58121a802388e40d68e93fe0f9466
|
refs/heads/master
| 2022-05-18T19:46:41.325021 | 2022-04-07T23:33:02 | 2022-04-07T23:33:02 | 217,126,269 | 0 | 0 |
Apache-2.0
| 2020-04-17T21:44:56 | 2019-10-23T18:27:39 |
Java
|
UTF-8
|
Java
| false | false | 2,841 |
java
|
/*
* Copyright 2018 Netflix, Inc.
*
* 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.netflix.titus.cli.command.job;
import java.time.Duration;
import com.netflix.titus.api.jobmanager.model.job.ServiceJobProcesses;
import com.netflix.titus.cli.CliCommand;
import com.netflix.titus.cli.CommandContext;
import com.netflix.titus.cli.command.ErrorReports;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JobProcessesCommand implements CliCommand {
private static final Logger logger = LoggerFactory.getLogger(JobProcessesCommand.class);
@Override
public String getDescription() {
return "Enable or disable scaling processes on a Job";
}
@Override
public boolean isRemote() {
return true;
}
@Override
public Options getOptions() {
Options options = new Options();
options.addOption(Option.builder("i").longOpt("job_id").hasArg().required()
.desc("Job id").build());
options.addOption(Option.builder("up").longOpt("enable-increase").hasArg(true).required()
.desc("If set to true, enable scaling up the job").build());
options.addOption(Option.builder("down").longOpt("enable-decrease").hasArg(true).required()
.desc("If set to true, enable scaling down the job").build());
return options;
}
@Override
public void execute(CommandContext context) throws Exception {
CommandLine cli = context.getCLI();
String id = cli.getOptionValue('i');
boolean up = "true".equalsIgnoreCase(cli.getOptionValue("up"));
boolean down = "true".equalsIgnoreCase(cli.getOptionValue("down"));
try {
context.getJobManagementClient().updateJobProcesses(id,
ServiceJobProcesses.newBuilder()
.withDisableIncreaseDesired(!up)
.withDisableDecreaseDesired(!down)
.build(),
context.getCallMetadata("Job process command")
).block(Duration.ofMinutes(1));
} catch (Exception e) {
ErrorReports.handleReplyError("Error status", e);
}
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.