blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5f51d65fb1eb7144f5cee84df440e5cd3c91156a | 876a25b5de847608e6f03051c24a8b0be47b7693 | /src/main/java/com/amayadream/webchat/dao/ILogDao.java | 34c342c0908d517dc6084355c3865beec339e7b3 | [] | no_license | ASkyOfCode/WebChatTest | c4c5b6f3b3246cdf03deec492f90fbeec5409e0a | 5d4bdb229d97c026095049b50acfde765b10d8ba | refs/heads/master | 2021-01-12T05:11:57.898969 | 2017-01-03T05:42:52 | 2017-01-03T05:42:52 | 77,887,431 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | package com.amayadream.webchat.dao;
import com.amayadream.webchat.pojo.Log;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* NAME : WebChat/com.amayadream.webchat.dao
* Author : Amayadream
* Date : 2016.01.09 16:39
* TODO :
*/
@Service(value = "logDao")
public interface ILogDao {
List<Log> selectAll(@Param("start") int start, @Param("end") int end);
List<Log> selectLogByUserid(@Param("userid") String userid, @Param("start") int start, @Param("end") int end);
Log selectCount();
Log selectCountByUserid(@Param("userid") String userid);
boolean insert(Log log);
boolean delete(String id);
boolean deleteThisUser(String userid);
boolean deleteAll();
}
| [
"1292749184@qq.com"
] | 1292749184@qq.com |
c5c2029eb09f623bf871b5f63c4afdbc28b1431e | f159a6165d3a0c7af2d0d05092b4d1d6b8854d93 | /StuffHub/app/src/main/java/com/example/stuffhub/Buyer/RegisterActivity.java | 4c8a610354e8145943eec048b78a471f39a4d2c3 | [] | no_license | Lalobeta/StuffHub | 10e3b8074cd40766b39143623f734b9f6446001c | cd3c68ea98e47b69530967fa8068e2741816c3b2 | refs/heads/master | 2020-09-05T07:48:14.503876 | 2019-11-26T17:38:06 | 2019-11-26T17:38:06 | 220,030,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,255 | java | package com.example.stuffhub.Buyer;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.stuffhub.R;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.HashMap;
public class RegisterActivity extends AppCompatActivity {
private Button CreateAccountButton;
private EditText InputName, InputPhoneNumber, InputPassword;
private ProgressDialog loadingBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
CreateAccountButton = (Button)findViewById(R.id.register_btn);
InputName = (EditText) findViewById(R.id.register_username_input);
InputPhoneNumber = (EditText) findViewById(R.id.register_phone_number_input);
InputPassword= (EditText) findViewById(R.id.register_password_input);
loadingBar= new ProgressDialog(this);
CreateAccountButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
CreateAccount();
}
});
}
private void CreateAccount()
{
String name = InputName.getText().toString();
String phone = InputPhoneNumber.getText().toString();
String password = InputPassword.getText().toString();
if(TextUtils.isEmpty(name) ){
Toast.makeText(this,"Please write your name...",Toast.LENGTH_SHORT).show();
}
else if(TextUtils.isEmpty(phone) ){
Toast.makeText(this,"Please write your phone number...",Toast.LENGTH_SHORT).show();
}
else if(TextUtils.isEmpty(password) ){
Toast.makeText(this,"Please write your password...",Toast.LENGTH_SHORT).show();
}
else {
loadingBar.setTitle("Create Account");
loadingBar.setMessage("Please wait, while we are checking the credentials.");
loadingBar.setCanceledOnTouchOutside(false);
loadingBar.show();
ValidatelephoneNumber(name, phone, password);
}
}
private void ValidatelephoneNumber(final String name, final String phone, final String password)
{
final DatabaseReference RootRef;
RootRef = FirebaseDatabase.getInstance().getReference();
RootRef.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot)
{
if(!(dataSnapshot.child("Users").child(phone).exists()))
{
HashMap<String, Object> userdataMap= new HashMap<>();
userdataMap.put("phone",phone);
userdataMap.put("password",password);
userdataMap.put("name",name);
RootRef.child("Users").child(phone).updateChildren(userdataMap)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if(task.isSuccessful())
{
Toast.makeText(RegisterActivity.this,"Congratulations, your account has been created. ", Toast.LENGTH_SHORT).show();
loadingBar.dismiss();
Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
startActivity(intent);
}
else
{
loadingBar.dismiss();
Toast.makeText(RegisterActivity.this,"Network Error: Please Try again... ", Toast.LENGTH_SHORT).show();
}
}
});
}
else
{
Toast.makeText(RegisterActivity.this,"This "+ phone + " already exists.",Toast.LENGTH_SHORT).show();
loadingBar.dismiss();
Toast.makeText(RegisterActivity.this,"Please try again using another phone number ", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(RegisterActivity.this, MainActivity.class);
startActivity(intent);
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
}
| [
"45637088+Lalobeta@users.noreply.github.com"
] | 45637088+Lalobeta@users.noreply.github.com |
2e20eafa988aa560c4142215d63e3f836d76ff0f | f9bcd89f3b7e2c0d4275c9b3de9582e616f77ddd | /organization-service/src/main/java/com/optimagrowth/organization/domain/event/publisher/impl/StreamBridgeOrganizationEventPublisher.java | 848ebd07250ed17ef806e99b742bc39ff2907f31 | [] | no_license | VitaliyDragun1990/optimagrowth | 0ba0240323e1e4e0654a5ad4a1b47473226adf5e | 4c2bdfa4ae84f0579b8cde78660c5c8d34519e1e | refs/heads/master | 2023-03-05T09:23:18.329117 | 2021-02-09T09:32:13 | 2021-02-09T09:32:13 | 333,136,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,296 | java | package com.optimagrowth.organization.domain.event.publisher.impl;
import com.optimagrowth.organization.domain.event.publisher.OrganizationEventPublisher;
import com.optimagrowth.organization.domain.event.model.EventType;
import com.optimagrowth.organization.domain.event.model.ResourceChangeEvent;
import com.optimagrowth.organization.domain.event.model.ResourceType;
import com.optimagrowth.organization.provider.date.DateTimeProvider;
import com.optimagrowth.organization.usercontext.UserContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.stereotype.Component;
/**
* Spring cloud sleuth can not instrument StreamBridge calls to add correct traceId/spanId
*/
@Slf4j
//@Component
public class StreamBridgeOrganizationEventPublisher implements OrganizationEventPublisher {
private final String outputBindingName;
private final StreamBridge stream;
private final DateTimeProvider dateTimeProvider;
public StreamBridgeOrganizationEventPublisher(
@Value("${spring.cloud.stream.source}") String outputBindingName,
StreamBridge stream,
DateTimeProvider dateTimeProvider) {
this.outputBindingName = outputBindingName;
this.stream = stream;
this.dateTimeProvider = dateTimeProvider;
}
@Override
public void publishOrganizationChange(EventType eventType, String organizationId) {
String correlationId = UserContextHolder.getContext().getCorrelationId();
LOG.debug("Sending event of type [{}] for Organization with id:[{}], Correlation Id:[{}]...",
eventType, organizationId, correlationId);
ResourceChangeEvent<String> event = new ResourceChangeEvent<>(
organizationId,
ResourceType.ORGANIZATION,
eventType,
correlationId,
dateTimeProvider.currentDateTime());
boolean success = stream.send(outputBindingName, event);
LOG.debug("Event of type [{}] for Organization with id:[{}], Correlation Id:[{}] was sent, status:{}",
eventType, organizationId, correlationId, success ? "success" : "failure");
}
}
| [
"vdrag00n90@gmail.com"
] | vdrag00n90@gmail.com |
c96d7d5c694229929a18b4072721b642aca9719c | 342a8d1e525bad81529b5097f584b68735e02487 | /src/main/java/ru/softwerke/practice/app2019/model/Color.java | 68d5cb8278a3d3a3a2e95c51bef9d49924cefebe | [] | no_license | softwerke-java-school-2019/ak | f85efc1b3a8a23e21bfc5e141fd85d1e5f8f1415 | 0df5794bd51b5a3092dcf4d09d9c73a1f99255a2 | refs/heads/master | 2022-11-24T12:04:56.145266 | 2019-05-27T14:43:34 | 2019-05-27T14:43:34 | 177,548,081 | 0 | 0 | null | 2022-11-16T11:42:47 | 2019-03-25T08:47:41 | Java | UTF-8 | Java | false | false | 1,613 | java | package ru.softwerke.practice.app2019.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import ru.softwerke.practice.app2019.storage.Unique;
import java.util.Objects;
public class Color implements Unique, Comparable<Color> {
private static final String ID_FIELD = "id";
private static final String NAME_FIELD = "name";
private static final String RGB_FIELD = "rgb";
@JsonProperty(ID_FIELD)
private long id;
@JsonProperty(NAME_FIELD)
private String name;
@JsonProperty(RGB_FIELD)
private Integer rgb;
@JsonCreator
public Color(@JsonProperty(value = NAME_FIELD) String name, @JsonProperty(value = RGB_FIELD) Integer rgb) {
this.name = name;
this.rgb = rgb;
}
@Override
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getRgb() {
return rgb;
}
public void setRgb(int rgb) {
this.rgb = rgb;
}
@Override
public int compareTo(Color o) {
return getRgb() - o.getRgb();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Color)) return false;
Color color = (Color) o;
return rgb == color.rgb &&
name.equals(color.name);
}
@Override
public int hashCode() {
return Objects.hash(name, rgb);
}
}
| [
"anastasia.kislyakova@gmail.com"
] | anastasia.kislyakova@gmail.com |
23e64d9484f6fa51ce62eccf8d92690355a53943 | b88b22dcd182eb6ad478a79cc64ab2831efd1d08 | /src/ewhine/service/ConfigService.java | bf1f88a65486a5e9f02e8769064946c69bd4cf81 | [
"Apache-2.0"
] | permissive | jimrok/web.framework | 7b4c233a838a8466c904806aa5bf9146e1eb71b6 | 0af4054f85f1eda7b687bbbfa1c277bf93ff6273 | refs/heads/master | 2020-06-03T23:34:36.336193 | 2019-06-13T14:30:30 | 2019-06-13T14:30:30 | 191,777,929 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,075 | java | package ewhine.service;
import tools.SU;
import java.io.File;
public class ConfigService {
String config_log_file_path = null;
private static boolean already_config = false;
public ConfigService() {
if (already_config) {
return;
}
already_config = true;
String serverRoot = System.getProperty("server.root", null);
File confDir = new File("config");
if (serverRoot != null) {
confDir = new File(serverRoot, "config");
}
if (confDir.exists() ) {
String pfile = confDir.getAbsolutePath();
serverRoot = new File(pfile).getParent();
System.setProperty("server.root", serverRoot);
}
config_log_file_path = SU.cat(
serverRoot, "/config/", "logback.xml");
System.setProperty("logback.configurationFile", config_log_file_path);
System.out.println("Start server from directory:" + serverRoot);
System.out.println("Load log config file:" + config_log_file_path);
}
public void start() {
// System.out.println("load config file in:" + Config.getServerRootDir() + "/config");
}
public void stop() {
}
}
| [
"jiang717@gmail.com"
] | jiang717@gmail.com |
f101b217021511e35d1665f38aa51998cc7702c9 | 0e485ac88c2db1a4388a367953f0ed1641b6023b | /gaia-tools/src/main/java/com/ptb/gaia/tool/command/WxArticleReload.java | c06ad6cf83396d0af08066ddfdb930239d88b06c | [] | no_license | xf20110925/gaia-parent | 0e1b61dba0c48f985581ccce60c7f143ae836b17 | d72886f62a55e6d2a33fe9f80cb8bca279186960 | refs/heads/master | 2021-08-24T15:32:01.660902 | 2017-12-10T07:45:07 | 2017-12-10T07:45:07 | 113,719,645 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,360 | java | package com.ptb.gaia.tool.command;
import com.alibaba.fastjson.JSON;
import com.mongodb.*;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.Filters;
import com.mongodb.client.model.InsertManyOptions;
import com.mongodb.client.result.DeleteResult;
import com.ptb.gaia.bus.kafka.KafkaBus;
import com.ptb.gaia.etl.flume.utils.GaiaConvertUtils;
import com.ptb.gaia.service.IGaia;
import com.ptb.gaia.service.IGaiaImpl;
import com.ptb.gaia.service.entity.article.GWxArticleBasic;
import com.ptb.uranus.common.entity.CollectType;
import com.ptb.uranus.schedule.model.Priority;
import com.ptb.uranus.schedule.model.SchedulableCollectCondition;
import com.ptb.uranus.schedule.model.ScheduleObject;
import com.ptb.uranus.schedule.trigger.JustOneTrigger;
import com.ptb.uranus.server.send.BusSender;
import com.ptb.uranus.server.send.Sender;
import com.ptb.uranus.server.send.entity.article.WeixinArticleStatic;
import com.ptb.uranus.server.send.entity.convert.SendObjectConvertUtil;
import com.ptb.uranus.spider.weixin.WeixinSpider;
import com.ptb.uranus.spider.weixin.bean.WxArticle;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.lang.StringUtils;
import org.bson.Document;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
/**
* @DESC:
* @VERSION:
* @author: xuefeng
* @Date: 2016/11/3
* @Time: 13:29
*/
public class WxArticleReload {
public enum MongoUtil {
INSTANCESHARD(getMongoClientV1("172.16.0.216", 27017)), INSTACENEWMONGO(getMongoClientV2("172.16.0.54|172.16.0.55|172.16.0.56", 27017));
// INSTANCESHARD(getMongoClientV1("192.168.40.18", 27017)), INSTACENEWMONGO(getMongoClientV2("192.168.40.18|192.168.40.19|192.168.40.20", 27017));
private MongoClient mongoClient;
MongoUtil(MongoClient mongoClient) {
this.mongoClient = mongoClient;
}
private static MongoClient getMongoClientV1(String host, int port) {
MongoClientOptions.Builder options = new MongoClientOptions.Builder();
options.connectionsPerHost(300);
options.connectTimeout(30000);
options.maxWaitTime(5000);
options.socketTimeout(0);
options.writeConcern(WriteConcern.SAFE);
return new MongoClient(new ServerAddress(host, port), options.build());
}
private static MongoClient getMongoClientV2(String host, int port) {
ReadPreference readPreference = ReadPreference.secondaryPreferred();
List<ServerAddress> addresses = Arrays.asList(host.split("\\|")).stream().map(x -> new ServerAddress(x, port)).collect(Collectors.toList());
MongoClientOptions.Builder options = new MongoClientOptions.Builder().readPreference(readPreference).connectionsPerHost(300).connectTimeout(30000).maxWaitTime(5000).socketTimeout(0).threadsAllowedToBlockForConnectionMultiplier(5000).writeConcern(WriteConcern.ACKNOWLEDGED);
return new MongoClient(addresses, options.build());
}
public MongoDatabase getDatabase(String dbName) {
if (StringUtils.isNotBlank(dbName)) {
MongoDatabase database = this.mongoClient.getDatabase(dbName);
return database;
}
throw new IllegalArgumentException("name can not be null!");
}
public MongoCollection<Document> getCollection(String dbName, String collName) {
return getDatabase(dbName).getCollection(collName);
}
public MongoClient getMongoClient() {
return mongoClient;
}
public void setMongoClient(MongoClient mongoClient) {
this.mongoClient = mongoClient;
}
}
public void handleArticles() throws IOException {
List<String> urls = Files.lines(Paths.get("./run.log")).collect(Collectors.toList());
FindIterable<Document> docs = MongoUtil.INSTANCESHARD.getDatabase("gaia2").getCollection("wxArticle").find(Filters.in("_id", urls));
LinkedList<Document> docList = new LinkedList<>();
for (Document doc : docs) {
docList.add(doc);
}
System.out.println(String.format("从分片mongo查询微信文章%s篇", docList.size()));
MongoUtil.INSTACENEWMONGO.getDatabase("gaia2").getCollection("wxArticle").insertMany(docList, new InsertManyOptions().ordered(false));
System.out.println("插入成功");
}
public void handleMedias() throws IOException {
List<String> pmids = Files.lines(Paths.get("./run.log")).collect(Collectors.toList());
FindIterable<Document> docs = MongoUtil.INSTANCESHARD.getDatabase("gaia2").getCollection("wxMedia").find(Filters.in("_id", pmids));
LinkedList<Document> docList = new LinkedList<>();
for (Document doc : docs) {
docList.add(doc);
}
System.out.println(String.format("从分片mongo查询微信媒体%s个", docList.size()));
MongoUtil.INSTACENEWMONGO.getDatabase("gaia2").getCollection("wxMedia").insertMany(docList, new InsertManyOptions().ordered(false));
System.out.println("插入成功");
}
public void wxArticleStaticsAdd(String fileName) throws IOException, ConfigurationException {
List<String> urls = Files.lines(Paths.get(fileName)).collect(Collectors.toList());
KafkaBus bus = new KafkaBus();
Sender sender = new BusSender(bus);
bus.start(false, 5);
WeixinSpider wxSpider = new WeixinSpider();
IGaia iGaia = new IGaiaImpl();
urls.stream().forEach(url -> {
Optional<WxArticle> wxArticleOpt = wxSpider.getArticleByUrl(url);
wxArticleOpt.ifPresent(wxArticle -> {
wxArticle.setArticleUrl(url);
WeixinArticleStatic wxArticleStatic = SendObjectConvertUtil.weixinArticleStaticConvert(wxArticle);
GWxArticleBasic gWxArticleBasic = GaiaConvertUtils.convertJSONObjectToGWxArticleBasic(JSON.parseObject(JSON.toJSONString(wxArticleStatic)));
iGaia.addWxArticleBasicBatch(Arrays.asList(gWxArticleBasic));
// System.out.println("发送微信文章" + JSON.toJSONString(wxArticleStatic));
// sender.sendArticleStatic(wxArticleStatic);
});
});
}
public void handleWbArticles() throws IOException {
List<String> urls = Files.lines(Paths.get("./run.log")).collect(Collectors.toList());
FindIterable<Document> docs = MongoUtil.INSTANCESHARD.getDatabase("gaia2").getCollection("wbArticleTest1").find(Filters.in("_id", urls));
LinkedList<Document> docList = new LinkedList<>();
for (Document doc : docs) {
docList.add(doc);
}
System.out.println(String.format("从分片mongo查询微博文章%s篇", docList.size()));
MongoUtil.INSTACENEWMONGO.getDatabase("gaia2").getCollection("wbArticle").insertMany(docList, new InsertManyOptions().ordered(false));
System.out.println("插入成功");
}
//cleanType -> C_WB_A_N, C_WX_A_N
public void scheduleClean(String cleanType, String mediaDB, String mediaColl) {
FindIterable<Document> scheduleDocs = MongoUtil.INSTACENEWMONGO.getDatabase("uranus").getCollection("schedule").find(Filters.eq("obj.collectType", cleanType));
Map<String, String> idConditionMap = new HashMap<>();
for (Document doc : scheduleDocs) {
idConditionMap.put(doc.getString("_id"), ((Document) doc.get("obj")).getString("conditon").split(":::")[0]);
}
FindIterable<Document> wbMDocs = MongoUtil.INSTACENEWMONGO.getDatabase(mediaDB).getCollection(mediaColl).find().projection(new Document("_id", 1));
Set<String> pmids = new HashSet<>();
for (Document doc : wbMDocs) {
pmids.add(doc.getString("_id"));
}
List<String> delSchedule = new LinkedList<>();
idConditionMap.forEach((k, v) -> {
if (!pmids.contains(v)) delSchedule.add(k);
});
System.out.println(String.format("清理%s个数%d,_ids->%s", cleanType, delSchedule.size(), delSchedule));
DeleteResult ret = MongoUtil.INSTACENEWMONGO.getDatabase("uranus").getCollection("schedule").deleteMany(Filters.in("_id", delSchedule));
System.out.println(String.format("清理完成,清理个数为%d", ret.getDeletedCount()));
}
//微信文章表动态数据加入调度重新爬取
public void wxA2Schedule(String url) {
AtomicLong counter = new AtomicLong(0);
ScheduleObject<SchedulableCollectCondition> scheduleObject = new ScheduleObject<>(new JustOneTrigger(), Priority.L1, new SchedulableCollectCondition(CollectType.C_WX_A_D, url));
Document doc = Document.parse(scheduleObject.toString());
Object id = doc.put("_id", scheduleObject.getId());
doc.remove(id);
MongoUtil.INSTACENEWMONGO.getDatabase("uranus").getCollection("schedule").insertOne(doc);
System.out.println(String.format("插入-》%d条调度任务", counter.addAndGet(1)));
}
public static void main(String[] args) throws IOException {
}
}
| [
"man875320545"
] | man875320545 |
c0f71458ab5ba36706401d0742e0803ecfe9f6a0 | 1f88342f4168a546ed942f7274eed5d854b405f9 | /Q13.java | b69e6fd5729748dfcfd7b92aaf8157d5ee6f4c67 | [] | no_license | rahul-191996/assignment | f2f7bf6172d101b5803d2c4ad67be782273425b1 | 3c99ec3178285da869c4acce95e4e7ca89ceb970 | refs/heads/master | 2020-12-15T11:37:05.873640 | 2020-01-22T16:04:09 | 2020-01-22T16:04:09 | 235,090,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | import java.util.ArrayList;
import java.util.Collections;
public class Q13 {
public static void main(String[] args) {
ArrayList<String> color=new ArrayList<>();
color.add("green");
color.add("red");
color.add("blue");
ArrayList<String> col=new ArrayList<>();
col.add("A");
col.add("B");
col.add("C");
col.add("green");
ArrayList<String> c=new ArrayList<>();
for(String a:color){
c.add(col.contains(a)?"Yes":"No");
}
System.out.println(c);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
83ce441065e573dca4526c4b23038d5144e3abfe | 0c987a01a224e87a46e735eb28734238b2620a73 | /src/main/java/com/example/webExample/service/AddressService.java | 4ed9d1420d55b01dfbe723ebcbe831a441edf590 | [] | no_license | tapokc/FirstPr | 85afffffd553f3e9f0e23b61bb201fff78b300d2 | b9b86d5d41be3ed7a856956ce3b7af450ae0c836 | refs/heads/master | 2022-12-08T02:00:14.026255 | 2020-09-08T20:24:58 | 2020-09-08T20:24:58 | 293,507,748 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 73 | java | package com.example.webExample.service;
public class AddressService {
}
| [
"artur31083@gmail.com"
] | artur31083@gmail.com |
f128e38f7e7fa8310821e619e85c4be91300a654 | 02dfa01cb9d34b5d63232e842e99d05ffb07daec | /src/main/java/it/academy/booking/tourist/model/NameRole.java | 179053420f610ba54ca9c38f849f66e51db55af4 | [] | no_license | Limpopoo93/it.academy.booking.tourist | 2b5f3ac9c011f2a006d1c6488e67e756dd85f8bc | f9f4a55c79c78e0902e652e1dffe8b5cb83de1d4 | refs/heads/master | 2022-11-08T22:01:21.108757 | 2020-06-28T18:09:00 | 2020-06-28T18:09:00 | 259,091,365 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 97 | java | package it.academy.booking.tourist.model;
public enum NameRole {
USER,ADMIN,EMPTY,COMPANY
}
| [
"marachckow2013@yandex.ru"
] | marachckow2013@yandex.ru |
e625d6d653c625d776ad52069ed5ec819fff0602 | 54202d57fc988ee4029cb7656f077b98d7abe92f | /api/src/main/java/com/kruzok/api/rest/activity/controllers/SearchActivityController.java | 1b0e670cda8b7062e0268e0ab40e2f933667542b | [] | no_license | istolga/kryzok | 67fe17d2904a050cbd25b3724c58c65e6d306b0e | 01a861a22c7e50f77b5222feb878ce13976772ee | refs/heads/master | 2021-05-31T09:59:36.871193 | 2015-07-13T04:45:44 | 2015-07-13T04:45:44 | 35,140,420 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,041 | java | package com.kruzok.api.rest.activity.controllers;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.kruzok.api.exposed.exception.ApiException;
import com.kruzok.api.rest.activity.beans.SearchActivityRequest;
import com.kruzok.api.rest.activity.beans.SearchActivityResponseWrapper;
import com.kruzok.api.rest.activity.managers.SearchActivityManager;
import com.kruzok.api.rest.activity.validators.SearchActivityRequestValidator;
@Controller
public class SearchActivityController {
@Resource
private SearchActivityManager manager;
@Resource
private SearchActivityRequestValidator validator;
private static final Log log = LogFactory
.getLog(SearchActivityController.class);
@RequestMapping(value = { "/rest/v{version:[\\d]*}/activity/search" }, method = { RequestMethod.GET })
@ResponseStatus(HttpStatus.OK)
public @ResponseBody SearchActivityResponseWrapper search(
SearchActivityRequest request) throws Exception {
try {
validator.validate(request);
return new SearchActivityResponseWrapper(manager.search(request));
} catch (ApiException e) {
log.info(getLogMessage(request));
throw e;
} catch (Exception e) {
log.error(getLogMessage(request));
throw new ApiException(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "SYS_ERROR",
"");
}
}
private String getLogMessage(SearchActivityRequest request) {
StringBuilder builder = new StringBuilder(
"We can't search activity by request('" + request.toString()
+ "').");
// TODO: KA we need to log user information here
return builder.toString();
}
}
| [
"alekseykolesnik@gmail.com"
] | alekseykolesnik@gmail.com |
22f570fa70c55be1c12696ff4f67d13e54bc4c2a | 05a3636b12829af0ba9c37cc9b6adb3a5990023e | /src/main/java/com/getui/platform/demo/template/PushStyle.java | 73965f065ecc2cb1a81592c5d4da6a980c62a1ed | [] | no_license | xuerunjia/getui-pushapi-java-demo | e92ac1a26965cd686346815cf137642111f575df | e9e6f0abd03375f21d5351601be38c608efdbf37 | refs/heads/master | 2023-02-01T01:01:39.636096 | 2020-12-21T08:01:09 | 2020-12-21T08:01:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,961 | java | package com.getui.platform.demo.template;
import com.gexin.rp.sdk.template.style.*;
/**
* 推送样式
*
* @author zhangwf
* @see
* @since 2019-07-09
*/
public class PushStyle {
public static void main(String[] args) {
getStyle0();
// getStyle6();
}
/**
* Style0 系统样式
* @link http://docs.getui.com/getui/server/java/template/ 查看效果
* @return
*/
public static AbstractNotifyStyle getStyle0() {
Style0 style = new Style0();
// 设置通知栏标题与内容
style.setTitle("请输入通知栏标题");
style.setText("请输入通知栏内容");
// 配置通知栏图标
style.setLogo("icon.png"); //配置通知栏图标,需要在客户端开发时嵌入,默认为push.png
// 配置通知栏网络图标
style.setLogoUrl("");
// 配置自定义铃声(文件名,不需要后缀名),需要在客户端开发时嵌入后缀名为.ogg的铃声文件
style.setRingName("sound");
// 角标, 必须大于0, 个推通道下发有效; 此属性目前仅针对华为 EMUI 4.1 及以上设备有效
style.setBadgeAddNum(1);
// 设置通知是否响铃,震动,或者可清除
style.setRing(true);
style.setVibrate(true);
style.setClearable(true);
style.setChannel("通知渠道id");
style.setChannelName("通知渠道名称");
style.setChannelLevel(3); //设置通知渠道重要性
return style;
}
/**
* Style6 展开式通知样式
* @link http://docs.getui.com/getui/server/java/template/ 查看效果
* @return
*/
public static AbstractNotifyStyle getStyle6() {
Style6 style = new Style6();
// 设置通知栏标题与内容
style.setTitle("请输入通知栏标题");
style.setText("请输入通知栏内容");
// 配置通知栏图标
style.setLogo("icon.png"); //配置通知栏图标,需要在客户端开发时嵌入
// 配置通知栏网络图标
style.setLogoUrl("");
// 三种方式选一种
style.setBigStyle1("bigImageUrl"); //设置大图+文本样式
// style.setBigStyle2("bigText"); //设置长文本+文本样式
// 配置自定义铃声(文件名,不需要后缀名),需要在客户端开发时嵌入后缀名为.ogg的铃声文件
style.setRingName("sound");
// 角标, 必须大于0, 个推通道下发有效; 此属性目前仅针对华为 EMUI 4.1 及以上设备有效
style.setBadgeAddNum(1);
// 设置通知是否响铃,震动,或者可清除
style.setRing(true);
style.setVibrate(true);
style.setClearable(true);
style.setChannel("通知渠道id");
style.setChannelName("通知渠道名称");
style.setChannelLevel(3); //设置通知渠道重要性
return style;
}
}
| [
"zwf1206@gmail.com"
] | zwf1206@gmail.com |
be9f346c0b8eb99419bbf736bf9c10736f1c7706 | 2fcffa77820c71967640039619e72b0be8aa878a | /src/com/bronzesoft/pxb/common/convert/JavaBean.java | b171b361347333084227736a551a52024868641c | [] | no_license | fengchangsheng/pxbTest | 47e3e0cef9d59e747b505776e7fad14465e8baf6 | b6074b806a4e2d990491c8d1a0c3d9989a1c8ef6 | refs/heads/master | 2021-01-23T12:45:54.643226 | 2015-07-27T06:38:43 | 2015-07-27T06:38:43 | 39,127,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,557 | java | package com.bronzesoft.pxb.common.convert;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
public class JavaBean {
private Integer primitive;
@DateTimeFormat(iso=ISO.DATE)
private Date date;
@MaskFormat("(###) ###-####")
private String masked;
// list will auto-grow as its dereferenced e.g. list[0]=value
private List<Integer> list;
// annotation type conversion rule will be applied to each list element
@DateTimeFormat(iso=ISO.DATE)
private List<Date> formattedList;
// map will auto-grow as its dereferenced e.g. map[key]=value
private Map<Integer, String> map;
// nested will be set when it is referenced e.g. nested.foo=value
private NestedBean nested;
public Integer getPrimitive() {
return primitive;
}
public void setPrimitive(Integer primitive) {
this.primitive = primitive;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getMasked() {
return masked;
}
public void setMasked(String masked) {
this.masked = masked;
}
public List<Integer> getList() {
return list;
}
public void setList(List<Integer> list) {
this.list = list;
}
public List<Date> getFormattedList() {
return formattedList;
}
public void setFormattedList(List<Date> formattedList) {
this.formattedList = formattedList;
}
public Map<Integer, String> getMap() {
return map;
}
public void setMap(Map<Integer, String> map) {
this.map = map;
}
public NestedBean getNested() {
return nested;
}
public void setNested(NestedBean nested) {
this.nested = nested;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("JavaBean");
if (primitive != null) {
sb.append(" primitive=").append(primitive);
}
if (date != null) {
sb.append(" date=").append(date);
}
if (masked != null) {
sb.append(" masked=").append(masked);
}
if (list != null) {
sb.append(" list=").append(list);
}
if (formattedList != null) {
sb.append(" formattedList=").append(formattedList);
}
if (map != null) {
sb.append(" map=").append(map);
}
if (nested != null) {
sb.append(" nested=").append(nested);
}
return sb.toString();
}
}
| [
"fengchangsheng123@qq.com"
] | fengchangsheng123@qq.com |
1bbddc1d3c34d6a3f950738fbc9067cd453befac | 57333bbc872c4d106f9241b3c2cfe8aa42eae12d | /projects/android/waterworks-mobile/src/main/java/com/rameses/waterworks/service/ServiceProxy.java | 2d8c6128a95aa0118871f1f0e13ea322e06056d2 | [] | no_license | ramesesinc/clfc2 | 2d102c565e0796a2f3a94216e3d2655cd34423b4 | 5eea700ab66313b70982721a0735e3b02680b6d3 | refs/heads/master | 2021-09-04T20:18:38.029132 | 2018-01-22T04:14:32 | 2018-01-22T04:14:32 | 82,512,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,254 | java | package com.rameses.waterworks.service;
import com.rameses.service.ScriptServiceContext;
import com.rameses.Main;
import java.util.HashMap;
import java.util.Map;
public class ServiceProxy {
public static ScriptServiceContext getContext(){
String setting_ip = Main.CONNECTION_SETTING.get("ip") != null ? Main.CONNECTION_SETTING.get("ip").toString() : "127.0.0.1";
String setting_port = Main.CONNECTION_SETTING.get("port") != null ? Main.CONNECTION_SETTING.get("port").toString() : "8070";
String setting_timeout = Main.CONNECTION_SETTING.get("timeout") != null ? Main.CONNECTION_SETTING.get("timeout").toString() : "30000";
String setting_context = Main.CONNECTION_SETTING.get("context") != null ? Main.CONNECTION_SETTING.get("context").toString() : "etracs25";
String setting_cluster = Main.CONNECTION_SETTING.get("cluster") != null ? Main.CONNECTION_SETTING.get("cluster").toString() : "osiris3";
Map env = new HashMap();
env.put("app.context", setting_context);
env.put("app.cluster", setting_cluster);
env.put("app.host", setting_ip+":"+setting_port);
env.put("readTimeout",setting_timeout);
return new ScriptServiceContext(env);
}
}
| [
"carlpernito@gmail.com"
] | carlpernito@gmail.com |
4844b9b92746192194e7df8bddbfc2289a147a52 | 598b6b427ce8c8a3fe118261358747cb4a318454 | /src/main/java/com/mycompany/fashionboutiqueapp2/services/Impl/GetProductQtyServiceImpl.java | 5ef3dd998ea4508df1d4917b7f6e94811c8fc648 | [] | no_license | muneebah/FashionBoutique | 64e84b3a261436b7b928e608840ef1b89098c689 | 35a6e2f89ca9b3353de422cba1d2a1357ce92b4e | refs/heads/master | 2020-04-17T18:41:30.351664 | 2014-05-13T06:16:16 | 2014-05-13T06:16:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,028 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.fashionboutiqueapp2.services.Impl;
import com.mycompany.fashionboutiqueapp2.domain.Product;
import com.mycompany.fashionboutiqueapp2.repository.ProductRepository;
import com.mycompany.fashionboutiqueapp2.services.GetProductQtyService;
import java.util.List;
/**
*
* @author muneebah
*/
public class GetProductQtyServiceImpl implements GetProductQtyService{
/*@Autowired*/
private ProductRepository productRepository;
private List<Product> product;
@Override
public List<Product> getQtyBelow(int prod_qty) {
List<Product> allProducts = productRepository.findAll();
for (Product product : allProducts) {
if (prod_qty > product.getProd_qty()) {
System.out.println("Warning! Not enough stock!");
}
}
return product;
}
}
| [
"elton.bucky@gmail.com"
] | elton.bucky@gmail.com |
c0e81a4cac04298733ab1473fcd1cebd7f2c05e1 | f5faaea2a565d69be257744860c13d52a3fe2b0e | /nerve/swap/src/main/java/network/nerve/swap/model/dto/LedgerAssetDTO.java | 872149690d9aeb298696363ea66c83cb044239f6 | [
"MIT"
] | permissive | NerveNetwork/nerve | 6e449bc329a649547af85b1e8fa8b104bf10f660 | 7379bdab28f62e1c7be6e9e72dcd55aa670b593a | refs/heads/master | 2023-08-03T14:47:18.894162 | 2023-07-29T11:17:32 | 2023-07-29T11:17:32 | 238,840,114 | 104 | 33 | MIT | 2022-06-02T09:51:11 | 2020-02-07T04:01:12 | Java | UTF-8 | Java | false | false | 3,475 | java | /**
* MIT License
* <p>
* Copyright (c) 2017-2018 nuls.io
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package network.nerve.swap.model.dto;
import java.math.BigInteger;
import java.util.Map;
/**
* @author: PierreLuo
* @date: 2021/3/31
*/
public class LedgerAssetDTO {
private int chainId;
private int assetId;
private String assetSymbol;
private String assetName;
private int assetType;
private BigInteger initNumber;
private int decimalPlace;
public LedgerAssetDTO(int chainId, Map<String, Object> map) {
this.chainId = chainId;
this.assetId = Integer.parseInt(map.get("assetId").toString());
this.assetSymbol = map.get("assetSymbol").toString();
this.assetName = map.get("assetName").toString();
this.assetType = Integer.parseInt(map.get("assetType").toString());
this.initNumber = new BigInteger(map.get("initNumber").toString());
this.decimalPlace = Integer.parseInt(map.get("decimalPlace").toString());
}
public LedgerAssetDTO(int chainId, int assetId, String assetSymbol, String assetName, int decimalPlace) {
this.chainId = chainId;
this.assetId = assetId;
this.assetSymbol = assetSymbol;
this.assetName = assetName;
this.decimalPlace = decimalPlace;
}
public int getChainId() {
return chainId;
}
public void setChainId(int chainId) {
this.chainId = chainId;
}
public int getAssetId() {
return assetId;
}
public void setAssetId(int assetId) {
this.assetId = assetId;
}
public String getAssetSymbol() {
return assetSymbol;
}
public void setAssetSymbol(String assetSymbol) {
this.assetSymbol = assetSymbol;
}
public String getAssetName() {
return assetName;
}
public void setAssetName(String assetName) {
this.assetName = assetName;
}
public int getAssetType() {
return assetType;
}
public void setAssetType(int assetType) {
this.assetType = assetType;
}
public BigInteger getInitNumber() {
return initNumber;
}
public void setInitNumber(BigInteger initNumber) {
this.initNumber = initNumber;
}
public int getDecimalPlace() {
return decimalPlace;
}
public void setDecimalPlace(int decimalPlace) {
this.decimalPlace = decimalPlace;
}
}
| [
"niels@nuls.io"
] | niels@nuls.io |
c63534424368c2a532005bc69cd84f157ca46cba | 87a2dc1e102e1d56994e36b75f76efd797c88f02 | /src/main/java/ru/atc/jadmin/domain/util/JSR310DateConverters.java | d3df916c27a2483c3d1ca1f3dcf33e20ab5612c7 | [] | no_license | isatimur/jadmin | 59ff5c1858a84516d9e1602058749ec10a1e1f1a | 6fbbc37b43f9dc46842dc7457f0363205823c2fe | refs/heads/master | 2021-01-12T12:02:01.983556 | 2016-09-26T06:54:19 | 2016-09-26T06:54:19 | 69,221,923 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,853 | java | package ru.atc.jadmin.domain.util;
import java.time.*;
import java.util.Date;
import org.springframework.core.convert.converter.Converter;
public final class JSR310DateConverters {
private JSR310DateConverters() {}
public static class LocalDateToDateConverter implements Converter<LocalDate, Date> {
public static final LocalDateToDateConverter INSTANCE = new LocalDateToDateConverter();
private LocalDateToDateConverter() {}
@Override
public Date convert(LocalDate source) {
return source == null ? null : Date.from(source.atStartOfDay(ZoneId.systemDefault()).toInstant());
}
}
public static class DateToLocalDateConverter implements Converter<Date, LocalDate> {
public static final DateToLocalDateConverter INSTANCE = new DateToLocalDateConverter();
private DateToLocalDateConverter() {}
@Override
public LocalDate convert(Date source) {
return source == null ? null : ZonedDateTime.ofInstant(source.toInstant(), ZoneId.systemDefault()).toLocalDate();
}
}
public static class ZonedDateTimeToDateConverter implements Converter<ZonedDateTime, Date> {
public static final ZonedDateTimeToDateConverter INSTANCE = new ZonedDateTimeToDateConverter();
private ZonedDateTimeToDateConverter() {}
@Override
public Date convert(ZonedDateTime source) {
return source == null ? null : Date.from(source.toInstant());
}
}
public static class DateToZonedDateTimeConverter implements Converter<Date, ZonedDateTime> {
public static final DateToZonedDateTimeConverter INSTANCE = new DateToZonedDateTimeConverter();
private DateToZonedDateTimeConverter() {}
@Override
public ZonedDateTime convert(Date source) {
return source == null ? null : ZonedDateTime.ofInstant(source.toInstant(), ZoneId.systemDefault());
}
}
public static class LocalDateTimeToDateConverter implements Converter<LocalDateTime, Date> {
public static final LocalDateTimeToDateConverter INSTANCE = new LocalDateTimeToDateConverter();
private LocalDateTimeToDateConverter() {}
@Override
public Date convert(LocalDateTime source) {
return source == null ? null : Date.from(source.atZone(ZoneId.systemDefault()).toInstant());
}
}
public static class DateToLocalDateTimeConverter implements Converter<Date, LocalDateTime> {
public static final DateToLocalDateTimeConverter INSTANCE = new DateToLocalDateTimeConverter();
private DateToLocalDateTimeConverter() {}
@Override
public LocalDateTime convert(Date source) {
return source == null ? null : LocalDateTime.ofInstant(source.toInstant(), ZoneId.systemDefault());
}
}
}
| [
"tisachenko@at-consulting.ru"
] | tisachenko@at-consulting.ru |
a32ed0ff70abb8d568fac8980a0bcff77c6f7031 | bac67feb33a4778c67ab6efeb820e4fe46382607 | /src/collections/hashtablemap/MapEntrySetDemo.java | 8ac37585cee178c4999215021d53501355d46c50 | [] | no_license | mithun3/JavaCollections | 0452e75005378dc60b25fedf3e23b985483bb48e | 69ad4d18df94cb021883e2d1b269790c08d5c284 | refs/heads/master | 2020-05-20T11:39:46.514615 | 2014-10-31T09:07:29 | 2014-10-31T09:07:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package collections.hashtablemap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
/**
* Demonstrate the HashMap class, and an Iterator.
*
* @see HashTableDemo, for the older Hashtable.
*/
public class MapEntrySetDemo {
public static void main(String[] argv) {
// Construct and load the hash. This simulates loading a
// database or reading from a file, or wherever the data is.
Map map = new HashMap();
// The hash maps from company name to address.
// In real life this might map to an Address object...
map.put("Adobe", "Mountain View, CA");
map.put("IBM", "White Plains, NY");
map.put("Learning Tree", "Los Angeles, CA");
map.put("Microsoft", "Redmond, WA");
map.put("Netscape", "Mountain View, CA");
map.put("O'Reilly", "Sebastopol, CA");
map.put("Sun", "Mountain View, CA");
// List the entries using entrySet()
Set entries = map.entrySet();
Iterator it = entries.iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
System.out.println(entry.getKey() + "-->" + entry.getValue());
}
}
} | [
"mithun3@gmail.com"
] | mithun3@gmail.com |
25ea4c1448e2b2f033231fdc9daa2dbd62b9f0d9 | 381990433427d3362ef9766e3a46eeefc7ef4065 | /crowdfunding-manager-impl/src/main/java/com/yuri/crowdfunding/bean/Data.java | e243df88101c0d038ab19e65cf3bb0f43a756a26 | [] | no_license | TlgYuri/Crowd-Funding-Test-Project | e7f80f073cd7b26d16274ea37bc9ca0f23ade37e | 3f17f541f7da11257db9ff3411bf215d9b3901d1 | refs/heads/master | 2023-02-23T12:50:28.225129 | 2021-01-15T07:17:45 | 2021-01-15T07:17:45 | 327,807,567 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package com.yuri.crowdfunding.bean;
import java.util.List;
public class Data {
private Integer roleId;
private List<Integer> permissionIds;
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public List<Integer> getPermissionIds() {
return permissionIds;
}
public void setPermissionIds(List<Integer> permissionIds) {
this.permissionIds = permissionIds;
}
}
| [
"t114514@qq.com"
] | t114514@qq.com |
eeb9faaa1d75828bfe367ce479e86673e55ea369 | 05ded47bbd3ccc5de4b2bdee4b703f79fb18f4b2 | /Aplicacion/src/presentacion/venta/GUIBuscarVenta.java | 87fde7979679b48495b4464ef921a3f17ddc0218 | [] | no_license | DanielCalle/FruteriaMrPressman | 32a2f81a64eebc2df78b7846e02ce2549b3b7ab6 | e9d2fcca214f69c8f525a2cabf985b6494d92f31 | refs/heads/master | 2020-03-23T00:02:11.817227 | 2018-07-13T11:47:24 | 2018-07-13T11:47:24 | 140,840,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,051 | java | /**
*
*/
package presentacion.venta;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.JToolBar;
import javax.swing.table.DefaultTableModel;
import main.Main;
import negocio.venta.LineaVenta;
import negocio.venta.TVenta;
import presentacion.Controlador;
import presentacion.Events;
@SuppressWarnings("serial")
public class GUIBuscarVenta extends JFrame {
private String[] labels = { "Id", "PrecioTotal", "Fecha", "ClienteId"};
private JTextField[] texts = new JTextField[labels.length];
private JTable table;
private DefaultTableModel tableModel;
public GUIBuscarVenta(){
super();
initGUI();
}
private void initGUI() {
this.setTitle("Fruteria Mr. Pressman");
JPanel mainPanel = new JPanel(new BorderLayout(10, 10));
JToolBar northPanel = new JToolBar();
northPanel.add(new JLabel("Buscar Venta"));
JPanel centerPanel = new JPanel(new BorderLayout());
JPanel centerLeftPanel = new JPanel(new GridLayout(labels.length, 2));
JLabel label;
for (int i = 0; i < labels.length; ++i){
label = new JLabel(labels[i] + ": ");
texts[i] = new JTextField();
if (!labels[i].equalsIgnoreCase("Id")) {
texts[i].setEditable(false);
texts[i].setEnabled(false);
}
centerLeftPanel.add(label);
centerLeftPanel.add(texts[i]);
}
table = new JTable();
table.setVisible(false);
tableModel = new DefaultTableModel(){
@Override
public boolean isCellEditable(int row, int column) {
//all cells false
return false;
}
};
JPanel centerRightPanel = new JPanel(new BorderLayout());
tableModel.setColumnCount(0);
tableModel.addColumn("#");
tableModel.addColumn("IdProducto");
tableModel.addColumn("Precio");
tableModel.addColumn("Unidades");
table.setModel(tableModel);
centerRightPanel.add(new JLabel("Linea Ventas: "), BorderLayout.NORTH);
centerRightPanel.add(new JScrollPane(table), BorderLayout.CENTER);
centerRightPanel.setBorder(BorderFactory.createEmptyBorder(0, 50, 0, 0));
centerPanel.add(centerLeftPanel, BorderLayout.CENTER);
centerPanel.add(centerRightPanel, BorderLayout.EAST);
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 50, 0, 50));
JPanel southPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
JButton button = new JButton("Buscar");
button.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
String text = "";
boolean create = true;
for (int i = 0; i < 1 && create; ++i){
if (texts[i].getText().equalsIgnoreCase("")) create = false;
text += texts[i].getText() + "\n";
}
if (create) {
String[] out = text.split("\\n");
try {
Controlador.getInstance().accion(Events.BUSCAR_VENTA, Integer.parseInt(out[0]));
} catch (Exception ex) {
JOptionPane.showMessageDialog(new JFrame(), "Informacion Erronea", "Error", JOptionPane.ERROR_MESSAGE);
}
}
toFront();
}
});
southPanel.add(button);
mainPanel.add(northPanel, BorderLayout.PAGE_START);
mainPanel.add(centerPanel, BorderLayout.CENTER);
mainPanel.add(southPanel, BorderLayout.PAGE_END);
mainPanel.setOpaque(true);
this.setContentPane(mainPanel);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
Dimension windowDim = new Dimension((int) (Main.WINDOW_DIM.getWidth()), (int) (Main.WINDOW_DIM.getHeight() * (labels.length + 2)));
this.setBounds(
(int) (dim.getWidth() / 2 - windowDim.getWidth() / 2),
(int) (dim.getHeight() / 2 - windowDim.getHeight() / 2),
(int) (windowDim.getWidth()),
(int) (windowDim.getHeight())
);
}
public void update (TVenta venta){
texts[0].setText("" + venta.getId());
texts[1].setText("" + venta.getPrecioTotal());
texts[2].setText("" + venta.getFecha().toString());
texts[3].setText("" + venta.getClienteID());
for (int i = 0; i < labels.length; ++i){
if (!labels[i].equalsIgnoreCase("Id"))
texts[i].setEnabled(true);
}
tableModel.setRowCount(0);
int i = 0;
for (LineaVenta v : venta.getLineaVentas().values()) {
tableModel.insertRow(i, new Object[]
{ i, v.getIdProducto(), v.getPrecio(), v.getUnidades() });
++i;
}
table.setModel(tableModel);
table.setVisible(true);
toFront();
}
public void clearData() {
for (int i = 0; i < labels.length; ++i)
texts[i].setText("");
table.setVisible(false);
}
} | [
"danielcallesanchez@gmail.com"
] | danielcallesanchez@gmail.com |
a919def956daaf84c7018afdb6137fd79cacf8a2 | 61f872b32352c9cfd544da569a9d4be0ff656631 | /src/main/java/com/quartz/qtrend/actions/CopyAction.java | c1db178dc292583bf4dd09bdc54a667e800453f7 | [] | no_license | cbfaucher/qtrend | 51a7aef603ee0adce95a98e4c33351cd525c8b3c | 5588e15b3c2f4f781d3fb4a36b0ab502f567890b | refs/heads/master | 2020-05-30T06:26:54.835451 | 2018-04-03T00:40:18 | 2018-04-03T00:40:18 | 17,099,197 | 2 | 5 | null | 2018-04-03T00:40:19 | 2014-02-23T01:37:50 | Java | UTF-8 | Java | false | false | 1,774 | java | /*
* Copyright (c) 2006 9095-2458 Quebec Inc. All Rights Reserved.
*
* Althought this code is consider of good quality and has been tested, it is
* provided to you WITHOUT guaranty of any kind.
*/
package com.quartz.qtrend.actions;
import com.quartz.qtrend.ui.QTrendFrame;
import com.quartz.qutilities.swing.events.JFrameAware;
import com.quartz.qutilities.swing.events.QEventHandler;
import com.quartz.qutilities.swing.events.QEventManager;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.util.EventObject;
/**
* The 'copy' action.
*
* @author Christian
* @since Quartz...
*/
public class CopyAction implements QEventHandler, JFrameAware<QTrendFrame>
{
///////////////////////////////////////
//// STATIC ATTRIBUTES
///////////////////////////////////////
//// STATIC METHODS
///////////////////////////////////////
//// INSTANCE ATTRIBUTES
private QTrendFrame frame = null;
///////////////////////////////////////
//// CONSTRUCTORS
public CopyAction()
{
}
///////////////////////////////////////
//// INSTANCE METHODS
public void setFrame(QTrendFrame pQTrendFrame)
{
frame = pQTrendFrame;
}
public void handleEvent(QEventManager pEventManager, EventObject pEvent, String pCommand)
{
final String selection = frame.getOutput().getSelectedText();
if (selection == null) return;
final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
final StringSelection contents = new StringSelection(selection);
clipboard.setContents(contents, contents);
}
///////////////////////////////////////
//// INNER CLASSES
}
| [
"cbfaucher@gmail.com"
] | cbfaucher@gmail.com |
8944e7c04cc3fe847bd0db0bbc2fadcbecea51ab | c9e342637f2d03ed3e1f13354f9da66e80ed8198 | /src/main/java/com/stxb/service/data/impl/SysApiOutArgInfoServiceImpl.java | 73cb9baa95ea899406cf9f1ad90ead34647fd787 | [] | no_license | minamiyakusoku/XianBaoApi | 7c90cfca8ad8833e2ca64b4d7618a89b66a18075 | bb59be0d0ec14e0218f8e66c1bccdd7c91240880 | refs/heads/master | 2021-01-22T07:58:21.328108 | 2017-09-04T05:23:39 | 2017-09-04T05:23:39 | 102,321,674 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,423 | java | package com.stxb.service.data.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.stxb.dao.SysApiInfoDao;
import com.stxb.dao.SysApiOutArgInfoDao;
import com.stxb.dao.SysEncodeDao;
import com.stxb.dao.SysFormatDao;
import com.stxb.database.DataSource;
import com.stxb.model.SysApiInfo;
import com.stxb.model.SysApiOutArgInfo;
import com.stxb.model.SysEncode;
import com.stxb.model.SysFormat;
import com.stxb.service.data.SysApiOutArgInfoService;
@Service
@DataSource(DataSource.GOODRABBIT)
public class SysApiOutArgInfoServiceImpl implements SysApiOutArgInfoService{
@Autowired
SysApiOutArgInfoDao dao;
@Autowired
SysApiInfoDao apiDao;
@Autowired
SysEncodeDao encodeDao;
@Autowired
SysFormatDao formatDao;
@Override
@Transactional(propagation=Propagation.REQUIRED)
public boolean save(SysApiOutArgInfo outArgsInfo ,SysEncode outencode) {
boolean flag = false;
SysApiInfo api = apiDao.getById(outArgsInfo.getApiId());
if(api==null)
return false;
api.setOutArgsCount(api.getOutArgsCount()+1);
try {
encodeDao.save(outencode);
outArgsInfo.setEncode(outencode.getId());
//保存出参
dao.save(outArgsInfo);
//更新该接口出参个数
apiDao.update(api);
flag = true;
} catch (Exception e) {
e.printStackTrace();
flag =false;
throw new RuntimeException("出参添加失败");
}
return flag;
}
@Override
public List<SysApiOutArgInfo> get(int apiId) {
return dao.get(apiId);
}
@Override
public SysApiOutArgInfo getById(int id) {
return dao.getById(id);
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
public boolean update(SysApiOutArgInfo outArgsInfo, SysEncode outencode) {
boolean flag = false;
try {
dao.update(outArgsInfo);
outencode.setId(outArgsInfo.getId());
encodeDao.update(outencode);
flag =true;
} catch (Exception e) {
e.printStackTrace();
flag =false;
throw new RuntimeException("出参修改失败");
}
return flag;
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
public boolean delete(int id) {
boolean flag = false;
try {
SysApiOutArgInfo i = dao.getById(id);
//更新接口出参格个数
SysApiInfo info = apiDao.getById(i.getApiId());
info.setOutArgsCount(info.getOutArgsCount() - 1);
dao.delete(id);
apiDao.update(info);
encodeDao.delete(i.getEncode());
flag = true;
} catch (Exception e) {
e.printStackTrace();
flag = false;
throw new RuntimeException("出参删除失败");
}
return flag;
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
public boolean insert(SysApiOutArgInfo outArgsInfo,SysEncode encode,SysFormat format) {
SysApiInfo info = apiDao.getById(outArgsInfo.getApiId());
info.setInArgsCount(info.getOutArgsCount()+1);
int re = 0;
re += encodeDao.save(encode);
outArgsInfo.setEncode(encode.getId());
outArgsInfo.setFormat(format.getId());
re += dao.save(outArgsInfo);
re += apiDao.update(info);
if(re == 3)
return true;
else
throw new RuntimeException("新增出参失败");
}
@Override
public List<SysApiOutArgInfo> getElseSamePyName(String pyName, int apiId) {
return dao.getByPyNameAndApiId(pyName,apiId);
}
}
| [
"akku@akku.moe"
] | akku@akku.moe |
ad5c8b565d58025a84c2eb0131f208c4bdf7d1ce | 34044d8a45b915c66cef5600ac2a9a7c3fcfd4e7 | /src/com/school/dao/DBConnection.java | 240a9ba944820d098ce040fbe536cace5e4efad1 | [] | no_license | arib7701/JEE-OnlineSchoolQuiz | 04588bb7430f5c4b730ecd66b8a8b3e1c3642e01 | 480f505ca896f9a3d29dda890659c5303bfde1eb | refs/heads/master | 2020-03-30T22:53:53.560584 | 2019-08-16T18:33:43 | 2019-08-16T18:33:43 | 151,682,223 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 942 | java | package com.school.dao;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBConnection {
public static Connection getConnectionToDatabase(){
Connection connection = null;
try {
Class.forName("com.mysql.jdbc.Driver");
System.out.println("MYSQL Driver registered");
connection = DriverManager.getConnection("jdbc:mysql://localhost/onlineschool?useUnicode=yes&characterEncoding=UTF-8&useSSL=false", "ama", "password");
} catch (ClassNotFoundException e){
System.out.println("Could not find a MySQL Driver");
e.printStackTrace();
} catch (SQLException e){
System.out.println("Connection Failed...");
e.printStackTrace();
}
if(connection != null){
System.out.println("Connection to DB made");
}
return connection;
}
}
| [
"amandineribot01@gmail.com"
] | amandineribot01@gmail.com |
8bc90cdc21da29d34b7afd7dd98bc8e6e7231ab7 | 89d91cae89f58486d238a8c4abe61793a7c6ed4e | /Panda/src/member/MemberDAO.java | 62eb5052b88c90fd8eab347d6f9fdf1764460d46 | [] | no_license | Flamecoding/panda | 07c33680ea7f7c01df3f7971c894ca264bd1c9d0 | 5064c01460be0c5cce583c596e25bed2a4cca7d6 | refs/heads/master | 2021-01-11T19:52:42.124290 | 2017-02-07T13:28:58 | 2017-02-07T13:28:58 | 79,414,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 298 | java | package member;
import util.db.ConnectionPoolBean;
public class MemberDAO {
public void join(){
ConnectionPoolBean bean;
try {
bean = new ConnectionPoolBean();
bean.getConnection();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"jello@218.38.137.28"
] | jello@218.38.137.28 |
594150e362cbdcffbac35b6e9f6643e4cf7d5131 | 99fd3fc6c5524964b701128732ea78fdc11c3186 | /app/src/main/java/com/lianer/core/market/bean/MarketContractResponse.java | 87072ad7d863d33d806dc7feae19ae4c8e3f493f | [] | no_license | jthug/IB_Core | 5d29834c52c1d6c9dbeb0eaacf17e81de321b903 | e19a1b36f63dada48fbe735a69191acc04eaeaf9 | refs/heads/master | 2020-07-18T17:46:55.358941 | 2019-09-04T09:49:49 | 2019-09-04T09:49:49 | 180,733,322 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | package com.lianer.core.market.bean;
import com.lianer.core.base.BaseBean;
import java.util.List;
/**
* 合约市场响应数据
*
* @author allison
*/
public class MarketContractResponse extends BaseBean {
private List<MarketContractBean> data;
public List<MarketContractBean> getData() {
return data;
}
public void setData(List<MarketContractBean> data) {
this.data = data;
}
}
| [
"1649369473@qq.com"
] | 1649369473@qq.com |
df36a5c197a6487633989ee6e97a477b134ca94e | 1067193e08987b0884395fdefcacfe86eb24284e | /recyclerview/src/main/java/mine/recyclerview/ListViewActivity.java | e357a03192703f595315dde1af277cd1de89b913 | [] | no_license | ipipip1735/API27 | 2801404edb17ed6073a15f6426b1354f9d99eb59 | 1f420555bc9f3075f2f17840b41d3440372cd369 | refs/heads/master | 2022-07-30T19:39:49.483709 | 2022-07-10T11:53:19 | 2022-07-10T11:53:19 | 146,048,836 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,131 | java | package mine.recyclerview;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewPropertyAnimator;
import android.widget.AbsListView;
import android.widget.Adapter;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
/**
* Created by Administrator on 2019/3/26.
*/
public class ListViewActivity extends AppCompatActivity {
ListView listView;
ArrayAdapter<String> nameAdapter;
String[] nameArray;
List<String> list;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
System.out.println("********* " + getClass().getSimpleName() + ".onCreate *********");
setContentView(R.layout.activity_listview);
listView = findViewById(R.id.lv);
System.out.println(listView);
int n = 500;
nameArray = new String[n];
for (int i = 0; i < n; i++) {
nameArray[i] = i+ "|chris" + new Random().nextInt(9999);
}
// nameArray = new String[]{
// "bob",
// "jack",
// "mack",
// "anna"
// };
nameAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, this.nameArray);
// list = new ArrayList<>();
// nameAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list);
listView.setAdapter(nameAdapter);
TextView textView = new TextView(this);
textView.setText("xxx");
listView.addHeaderView(textView);
//融合checkbox
// listView.setAdapter(new ArrayAdapter<String>(this, -1, this.nameArray){
// @NonNull
// @Override
// public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
// CheckBox checkBox = new CheckBox(ListViewActivity.this);
// return checkBox;
// }
// });
// listView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
}
@Override
protected void onStart() {
super.onStart();
System.out.println("********* " + getClass().getSimpleName() + ".onStart *********");
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
System.out.println("********* " + getClass().getSimpleName() + ".onRestoreInstanceState *********");
}
@Override
protected void onRestart() {
super.onRestart();
System.out.println("********* " + getClass().getSimpleName() + ".onRestart *********");
}
@Override
protected void onResume() {
super.onResume();
System.out.println("********* " + getClass().getSimpleName() + ".onResume *********");
}
@Override
protected void onPause() {
super.onPause();
System.out.println("********* " + getClass().getSimpleName() + ".onPause *********");
}
@Override
public void onBackPressed() {
super.onBackPressed();
System.out.println("********* " + getClass().getSimpleName() + ".onBackPressed *********");
}
@Override
protected void onStop() {
super.onStop();
System.out.println("********* " + getClass().getSimpleName() + ".onStop *********");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
System.out.println("********* " + getClass().getSimpleName() + ".onSaveInstanceState *********");
}
@Override
protected void onDestroy() {
super.onDestroy();
System.out.println("********* " + getClass().getSimpleName() + ".onDestroy *********");
}
public void start(View view) {
System.out.println("~~button.start~~");
// ViewGroup viewGroup = findViewById(R.id.lv);
// View v = viewGroup.getChildAt(0);
// v.animate().x(150f);
// ViewPropertyAnimator viewPropertyAnimator = v.animate();
// System.out.println(viewPropertyAnimator);
//
// ViewPropertyAnimator viewPropertyAnimator1 = v.animate();
// System.out.println(viewPropertyAnimator1);
//选定item
// listView.setSelector(R.color.colors);
// listView.setSelection(18);
// listView.setStackFromBottom(true);//跳转到底部
// listView.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);//设置滚动模式
//指定检查状态
listView.setItemChecked(2, true);
// listView.setTextFilterEnabled(boolean textFilterEnabled)
}
public void stop(View view) {
System.out.println("~~button.stop~~");
}
public void bind(View view) {
System.out.println("~~button.bind~~");
}
public void unbind(View view) {
System.out.println("~~button.unbind~~");
}
public void add(View view) {
System.out.println("~~button.add~~");
//方式一
// TextView textView = new TextView(this);
// textView.setText("aaaaa");
// listView.addHeaderView(textView);
//方式二
// for (int i = 0; i < 5; i++) {
// String s = "chris" + new Random().nextInt(999);
// list.add(s);
// }
// nameAdapter.addAll(list);
//方式三
list.add("chris");
nameAdapter.notifyDataSetChanged();
}
public void del(View view) {
System.out.println("~~button.del~~");
//方式一
// nameAdapter.remove(list.get(4));
//方式二
list.remove(0);
nameAdapter.notifyDataSetChanged();
}
public void query(View view) {
System.out.println("~~button.query~~");
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
System.out.println("~~" + getClass().getSimpleName() + ".onScrollStateChanged~~");
System.out.println("scrollState = " + scrollState + ", view = " + view);
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
System.out.println("~~" + getClass().getSimpleName() + ".onScroll~~");
System.out.println("firstVisibleItem = " + firstVisibleItem + ", visibleItemCount = " + visibleItemCount + ", totalItemCount = " + totalItemCount + ", view = " + view);
}
});
}
}
| [
"ipipip1735@163.com"
] | ipipip1735@163.com |
d21d09f260ff440b942ce2da68e890131c626dd3 | 9b27bd35d8d504c7642de6a10b7faa6550de7f0c | /Uebung02/src/Programm.java | d6abdcf979d1ccaf3b21df53cd24c7d0dd8f24be | [] | no_license | DavidKlant/SE02-bung | dc8fd94aef668b54e3faf950a815a84f4c081e4c | 7e018c7ba91832ffc0be3307167b798c7fbf6675 | refs/heads/master | 2021-07-14T13:44:59.587487 | 2017-10-20T09:01:41 | 2017-10-20T09:01:41 | 107,656,236 | 0 | 0 | null | 2017-10-20T09:03:48 | 2017-10-20T09:03:48 | null | UTF-8 | Java | false | false | 25 | java | public class Programm {
} | [
"keineahnunqq@web.de"
] | keineahnunqq@web.de |
b4d29817890bc9b40a8713181a50df73184dee68 | 28331d8f79881db159cbc985d9cdd04299615ba0 | /lab05/seleniumJBehave/src/test/java/com/example/webguidemo/Pages.java | 475abade92ad1191e7fa8720b49545f97cf3128f | [] | no_license | malinowiec/junitTest | 617c6cf3a96e1ebae0d9bccfdbcf6bcfa4f777ab | d123ba6cc7444b6a9af0603765ca68bc5e06ad2a | refs/heads/master | 2021-01-21T04:44:42.457116 | 2016-06-20T23:14:55 | 2016-06-20T23:14:55 | 52,866,782 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 618 | java | package com.example.webguidemo;
import org.jbehave.web.selenium.WebDriverProvider;
import com.example.webguidemo.pages.Login;
import com.example.webguidemo.pages.Home;
public class Pages {
private WebDriverProvider driverProvider;
//Pages
private Home home;
private Login login;
// ...
public Pages(WebDriverProvider
driverProvider) {
super();
this.driverProvider = driverProvider;
}
public Home home() {
if (home == null) {
home = new Home(driverProvider);
}
return home;
}
public Login login(){
if (login == null) {
login = new Login(driverProvider);
}
return login;
}
}
| [
"marta.malinka@gmail.com"
] | marta.malinka@gmail.com |
4e62c0095da963281ce75a353a202190db34fa9b | ab2678c3d33411507d639ff0b8fefb8c9a6c9316 | /jgralab/testit/de/uni_koblenz/jgralabtest/schemas/gretl/qvt/simplerdbms/impl/std/IsInImpl.java | 4e806b6c53d74cf0232c3de3e4121705329a733d | [] | no_license | dmosen/wiki-analysis | b58c731fa2d66e78fe9b71699bcfb228f4ab889e | e9c8d1a1242acfcb683aa01bfacd8680e1331f4f | refs/heads/master | 2021-01-13T01:15:10.625520 | 2013-10-28T13:27:16 | 2013-10-28T13:27:16 | 8,741,553 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,999 | java | /*
* This code was generated automatically.
* Do NOT edit this file, changes will be lost.
* Instead, change and commit the underlying schema.
*/
package de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.impl.std;
import de.uni_koblenz.jgralab.impl.std.EdgeImpl;
import de.uni_koblenz.jgralab.EdgeDirection;
import de.uni_koblenz.jgralab.GraphIO;
import de.uni_koblenz.jgralab.GraphIOException;
import de.uni_koblenz.jgralab.NoSuchAttributeException;
import de.uni_koblenz.jgralab.Vertex;
import de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.impl.std.ReversedIsInImpl;
import de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.Column;
import de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.ForeignKey;
import java.io.IOException;
/**
* FromVertexClass: ForeignKey
* FromRoleName : foreignKey
* ToVertexClass: Column
* ToRoleName : column
*/
public class IsInImpl extends EdgeImpl implements de.uni_koblenz.jgralab.Edge, de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn {
public IsInImpl(int id, de.uni_koblenz.jgralab.Graph g, Vertex alpha, Vertex omega) {
super(id, g, alpha, omega);
((de.uni_koblenz.jgralab.impl.InternalGraph) graph).addEdge(this, alpha, omega);
}
@Override
public final de.uni_koblenz.jgralab.schema.EdgeClass getAttributedElementClass() {
return de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn.EC;
}
@Override
public final java.lang.Class<? extends de.uni_koblenz.jgralab.Edge> getSchemaClass() {
return de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn.class;
}
public <T> T getAttribute(String attributeName) {
throw new NoSuchAttributeException("IsIn doesn't contain an attribute " + attributeName);
}
public <T> void setAttribute(String attributeName, T data) {
throw new NoSuchAttributeException("IsIn doesn't contain an attribute " + attributeName);
}
public void readAttributeValues(GraphIO io) throws GraphIOException {
}
public void readAttributeValueFromString(String attributeName, String value) throws GraphIOException {
throw new NoSuchAttributeException("IsIn doesn't contain an attribute " + attributeName);
}
public void writeAttributeValues(GraphIO io) throws GraphIOException, IOException {
}
public String writeAttributeValueToString(String attributeName) throws IOException, GraphIOException {
throw new NoSuchAttributeException("IsIn doesn't contain an attribute " + attributeName);
}
public de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn getNextIsInInGraph() {
return (de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn)getNextEdge(de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn.class);
}
public de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn getNextIsInIncidence() {
return (de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn)getNextIncidence(de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn.class);
}
public de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn getNextIsInIncidence(EdgeDirection orientation) {
return (de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn)getNextIncidence(de.uni_koblenz.jgralabtest.schemas.gretl.qvt.simplerdbms.IsIn.class, orientation);
}
public de.uni_koblenz.jgralab.schema.AggregationKind getAggregationKind() {
return de.uni_koblenz.jgralab.schema.AggregationKind.NONE;
}
@Override
public de.uni_koblenz.jgralab.schema.AggregationKind getAlphaAggregationKind() {
return de.uni_koblenz.jgralab.schema.AggregationKind.NONE;
}
@Override
public de.uni_koblenz.jgralab.schema.AggregationKind getOmegaAggregationKind() {
return de.uni_koblenz.jgralab.schema.AggregationKind.NONE;
}
protected de.uni_koblenz.jgralab.impl.ReversedEdgeBaseImpl createReversedEdge() {
return new ReversedIsInImpl(this, graph);
}
public ForeignKey getAlpha() {
return (ForeignKey) super.getAlpha();
}
public Column getOmega() {
return (Column) super.getOmega();
}
}
| [
"dmosen@uni-koblenz.de"
] | dmosen@uni-koblenz.de |
f875afc29c846e6e790d3acc4887b9c8d43d1cef | 9a61ec761cda78ca3e41138a3e5d7c35bc8d5520 | /app/src/main/java/com/phongbm/storagedemo/MainActivity.java | 2ce9a3439ac6550aecf57c713ec9989bf2cd2a78 | [] | no_license | PhanNgocHT/StorageDemo | c0422cd18835ec05cc388a9a79c21b250c1ab053 | 16fc80d0ec42aae7a4e53939df7725d7296d9a57 | refs/heads/master | 2020-03-21T13:20:54.024863 | 2018-06-25T13:48:33 | 2018-06-25T13:48:33 | 138,601,177 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,222 | java | package com.phongbm.storagedemo;
import android.Manifest;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private static final int REQUEST_CODE_PERMISSION = 1000;
private FileManager fileManager;
private SharedPreferences pref;
private SharedPreferences.OnSharedPreferenceChangeListener listener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
requestPermissions();
pref = PreferenceManager.getDefaultSharedPreferences(this);
listener = new SharedPreferences.OnSharedPreferenceChangeListener() {
@Override
public void onSharedPreferenceChanged(SharedPreferences pref, String key) {
if (key.equals("count")) {
Toast.makeText(MainActivity.this,
String.valueOf(pref.getInt(key, 0)),
Toast.LENGTH_SHORT
).show();
}
}
};
pref.registerOnSharedPreferenceChangeListener(listener);
/*
getDataFromAssets();
fileManager = new FileManager();
fileManager.showAllFile(fileManager.getRootPath());
fileManager.writeData();
*/
// saveDataToLocal();
getDataFromLocal();
}
@Override
protected void onDestroy() {
pref.unregisterOnSharedPreferenceChangeListener(listener);
super.onDestroy();
}
private void initializeComponents() {
findViewById(R.id.btn_count).setOnClickListener(this);
}
private void getDataFromAssets() {
try {
AssetManager manager = getAssets();
InputStream is = manager.open("numbers.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
int sum = 0;
String line;
while ((line = br.readLine()) != null) {
sum += Integer.parseInt(line);
}
Toast.makeText(this, "Result: " + sum, Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
}
}
private void requestPermissions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED
|| checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
},
REQUEST_CODE_PERMISSION
);
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults) {
if (requestCode == REQUEST_CODE_PERMISSION) {
if (grantResults[0] != PackageManager.PERMISSION_GRANTED
|| grantResults[1] != PackageManager.PERMISSION_GRANTED) {
finish();
}
}
}
private void saveDataToLocal() {
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
// pref = getSharedPreferences("settings", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putBoolean("has_sound", true);
String username = "t3h";
String password = "a@123456";
String username1 = "t3h";
String password2 = "a@123456";
editor.putString(username, password);
editor.putString(username1, password2);
editor.apply();
}
private void getDataFromLocal() {
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
boolean hasSound = pref.getBoolean("has_sound", false);
Toast.makeText(this, String.valueOf(hasSound), Toast.LENGTH_SHORT).show();
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.btn_count:
SharedPreferences.Editor editor = pref.edit();
editor.putInt("count", pref.getInt("count", 0) + 1);
editor.apply();
break;
default:
break;
}
}
} | [
"phanngocxv@gmail.com"
] | phanngocxv@gmail.com |
9c8c7dcccdaa29c9aa4361e0e70a02b1e58c1911 | c983e8001d0b55d85629b16664d830b1b7282b1f | /src/main/java/com/lwwale/spark/transformer/aggregation/AggregationEnum.java | 9f3b43b627cb7c2a184b42a017e4c0192692e1b4 | [] | no_license | jrishabh81/spark-transformer | ad4183035298c97d9ff06dd9d91ef680daed97b4 | dfcd6a8821d6e79938d63c0bc158da3bb9fb7eba | refs/heads/master | 2022-12-26T16:23:28.673218 | 2020-09-26T07:27:11 | 2020-09-26T07:27:11 | 298,760,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,068 | java |
package com.lwwale.spark.transformer.aggregation;
import com.lwwale.spark.transformer.helpers.ConvertorHelper;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import scala.collection.JavaConversions;
import java.util.LinkedList;
public enum AggregationEnum {
MEAN {
@Override
public Dataset<Row> compute(Dataset<Row> input, LinkedList<String> groupByColumns, String aggColumn) {
Dataset<Row> select = input
.groupBy(groupByColumns.get(0), groupByColumns.subList(1, groupByColumns.size()).toArray(new String[]{}))
.mean(aggColumn);
select = select.withColumnRenamed("mean(" + aggColumn + ")", "FMEAN_" + aggColumn);
return input.join(select, JavaConversions.asScalaBuffer(groupByColumns));
}
},
SUM {
@Override
public Dataset<Row> compute(Dataset<Row> input, LinkedList<String> groupByColumns, String aggColumn) {
Dataset<Row> select = input
.groupBy(groupByColumns.get(0), groupByColumns.subList(1, groupByColumns.size()).toArray(new String[]{}))
.sum(aggColumn);
select = select.withColumnRenamed("sum(" + aggColumn + ")", "FSUM_" + aggColumn);
return input.join(select, JavaConversions.asScalaBuffer(groupByColumns));
}
},
MAX {
@Override
public Dataset<Row> compute(Dataset<Row> input, LinkedList<String> groupByColumns, String aggColumn) {
Dataset<Row> select = input
.groupBy(ConvertorHelper.convertListToSeqColumn(input, groupByColumns))
.max(aggColumn);
select = select.withColumnRenamed("max(" + aggColumn + ")", "FMAX" + aggColumn);
return input.join(select, JavaConversions.asScalaBuffer(groupByColumns));
}
},
MIN {
@Override
public Dataset<Row> compute(Dataset<Row> input, LinkedList<String> groupByColumns, String aggColumn) {
Dataset<Row> select = input
.groupBy(groupByColumns.get(0), groupByColumns.subList(1, groupByColumns.size()).toArray(new String[]{}))
.min(aggColumn);
select = select.withColumnRenamed("min(" + aggColumn + ")", "FMIN_" + aggColumn);
return input.join(select, JavaConversions.asScalaBuffer(groupByColumns));
}
},
AVG {
@Override
public Dataset<Row> compute(Dataset<Row> input, LinkedList<String> groupByColumns, String aggColumn) {
Dataset<Row> select = input
.groupBy(groupByColumns.get(0), groupByColumns.subList(1, groupByColumns.size()).toArray(new String[]{}))
.avg(aggColumn);
select = select.withColumnRenamed("avg(" + aggColumn + ")", "FAVG_" + aggColumn);
return input.join(select, JavaConversions.asScalaBuffer(groupByColumns));
}
};
public abstract Dataset<Row> compute(Dataset<Row> input, LinkedList<String> groupByColumns, String aggColumn);
}
| [
"rishabh.jain2@walmartlabs.com"
] | rishabh.jain2@walmartlabs.com |
b0957cc2063fd0374040e7fcf15b96402717dc09 | 81b0761af3dd8043b7e0dff4e79e1017a07aa736 | /PipeThread.java | e03d0dc6859474579439b43472b0eaca4644ed2d | [] | no_license | divyanshu93/Java-Shell-Implementation | d46e822673535354f6813e3a56f1d7bfd4613240 | 160b93fa350f54ca1def6e311bcc0b23498131c3 | refs/heads/master | 2021-05-08T21:29:16.358853 | 2016-05-15T10:49:29 | 2016-05-15T10:49:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,226 | java | import java.io.*;
/**
* PipeThread clas developed to enable the pipe command implementation in Jsh.
* Allows output to be sent to the input piped commands.
* @author alan
*
*/
public class PipeThread implements Runnable{
private InputStream istream;
private OutputStream ostream;
public void run() {
try {
byte[] buffer = new byte[1024];
int read = 1;
//while istream hasn't reached end of file
while (read > -1)
{
//read input stream into buffer,
read = istream.read(buffer, 0, buffer.length);
if (read > -1)
{
//writes the buffer to output stream
ostream.write(buffer, 0, read);
}
}
}
catch (IOException e) {
// do nothing
} finally {
try {
//closes stream if it isn't the System input stream
if(istream != System.in)
{
istream.close();
}
} catch (Exception e) {
}
try {
//closes stream is it isn't the System output stream
if(ostream != System.out)
{
ostream.close();
}
} catch (Exception e) {
}
}
}
public PipeThread(InputStream istream, OutputStream ostream) {
this.istream = istream;
this.ostream = ostream;
}
/**
*
* @param proc - array of processes that will have one process' output be put into the buffered input stream
* of the next piped process.
* @return nothing.
* @throws InterruptedException
*/
public static InputStream pipe(Process[] proc) throws InterruptedException
{
Process p1;
Process p2;
for (int i = 0; i < proc.length; i++)
{
p1 = proc[i];
//checks if there's an available process to pipe to
if (i + 1 < proc.length)
{
p2 = proc[i+1];
Thread t = new Thread(new PipeThread(p1.getInputStream(), p2.getOutputStream()));
t.start();
}
}
//waits for final thread to finish before returning
Process last = proc[proc.length -1];
last.waitFor();
return last.getInputStream();
}
}
| [
"teetree89@gmail.com"
] | teetree89@gmail.com |
91782af75aae5fe8ee23ef82fd38f1e24aefc217 | a65d6cf4df044a8643e9e4ba1c683102d99605a6 | /src/main/java/com/ans2552/practice/springboot/domain/posts/Posts.java | 2cb887310c4f2d76097afc7d1e9c5b5f24a894fb | [] | no_license | ans2552/springboot-practice | d2373a0eb9b6891fed0a42802d0ae7c4d2643b56 | c14f531d0c1d3763b89768c496339ad487041f02 | refs/heads/master | 2023-08-21T17:35:05.818583 | 2021-10-13T11:33:25 | 2021-10-13T11:33:25 | 389,515,468 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 872 | java | package com.ans2552.practice.springboot.domain.posts;
import com.ans2552.practice.springboot.domain.BaseTimeEntity;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import javax.persistence.*;
@Getter
@NoArgsConstructor
@Entity
public class Posts extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(length = 500, nullable = false)
private String title;
@Column(columnDefinition = "Text", nullable = false)
private String content;
private String author;
@Builder
public Posts(String title, String content, String author) {
this.title = title;
this.content = content;
this.author = author;
}
public void update(String title, String content) {
this.title = title;
this.content = content;
}
}
| [
"hja5432@gmail.com"
] | hja5432@gmail.com |
4ddf3daededa827b3a1b77d700c070493f170445 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_fa6ed5604ab196feee0c0c80b98894fa931fe144/BaseRoiDialog/2_fa6ed5604ab196feee0c0c80b98894fa931fe144_BaseRoiDialog_t.java | 6305167ffb2102f7a07095bae0949b8d34d2bfc2 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,751 | java | /*-
* Copyright © 2013 Diamond Light Source Ltd.
*
* This file is part of GDA.
*
* GDA is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License version 3 as published by the Free
* Software Foundation.
*
* GDA is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with GDA. If not, see <http://www.gnu.org/licenses/>.
*/
package uk.ac.diamond.tomography.reconstruction.dialogs;
import java.util.Collections;
import org.dawnsci.plotting.api.IPlottingSystem;
import org.dawnsci.plotting.api.PlotType;
import org.dawnsci.plotting.api.PlottingFactory;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import uk.ac.diamond.scisoft.analysis.dataset.AbstractDataset;
public abstract class BaseRoiDialog extends Dialog {
private static final String SHELL_TITLE = "Define ROI";
private static final String DEFINE_ROI_PLOT = SHELL_TITLE;
protected IPlottingSystem plottingSystem;
protected final AbstractDataset image;
private final int dialogHeight;
private final int dialogWidth;
protected BaseRoiDialog(Shell parentShell, AbstractDataset image, int dialogWidth, int dialogHeight) {
super(parentShell);
this.image = image;
this.dialogWidth = dialogWidth;
this.dialogHeight = dialogHeight;
}
@SuppressWarnings("unchecked")
@Override
protected final Control createDialogArea(Composite parent) {
getShell().setText(SHELL_TITLE);
Composite plotComposite = new Composite(parent, SWT.None);
GridData layoutData = new GridData(GridData.FILL_BOTH);
layoutData.widthHint = dialogWidth;
layoutData.heightHint = dialogHeight;
plotComposite.setLayoutData(layoutData);
applyDialogFont(plotComposite);
plotComposite.setLayout(new FillLayout());
try {
plottingSystem = PlottingFactory.createPlottingSystem();
} catch (Exception e) {
}
plottingSystem.createPlotPart(plotComposite, DEFINE_ROI_PLOT, null, PlotType.IMAGE, null);
plottingSystem.createPlot2D(image, null, new NullProgressMonitor());
doCreateControl(plotComposite);
return plotComposite;
}
public abstract void doCreateControl(Composite plotComposite);
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1f9ec361f2bd76b4685192235ff8cc8ed6be59ed | 4e23286298ecb49228ff03890e7835b9fdf08e87 | /1.JavaSyntax/src/com/javarush/task/task01/task0111/Solution.java | b5505b9108bb0db03e77c19ea1137bb4fccce144 | [] | no_license | micredis/JRush-2-Vic | 45646bc20f37703d47ae6bbbaa4740709e8f0abf | 1417e0c1535cac4d14683e9b2f9b65d48dc32682 | refs/heads/master | 2020-03-08T17:12:34.301075 | 2018-08-08T20:52:02 | 2018-08-08T20:52:02 | 128,211,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | package com.javarush.task.task01.task0111;
/*
Одной переменной недостаточно
*/
public class Solution {
public static void main(String[] args) {
//напишите тут ваш код
int a = 1;
int b = -9;
String s = "Hi!";
}
}
| [
"micredis@gmail.com"
] | micredis@gmail.com |
d450147ed686fdb64a7f75493e8ed0c0e957ce53 | 8a0059408a04e4444e3e90531c48cd9f1571acb2 | /src/main/java/com/demo/services/InvoiceServiceImp.java | bba3081c3a48da4e2a8ec93eb937d775f34265e0 | [] | no_license | thong0605/SpringAPISecurity | 3cfff983e53cced2b780525f080a214942d118c2 | 541a0a0d409a543a2087294d32687a94f34114c1 | refs/heads/master | 2023-04-02T15:51:28.230717 | 2021-04-06T16:43:53 | 2021-04-06T16:43:53 | 355,260,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 968 | java | package com.demo.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.demo.entities.Category;
import com.demo.entities.Invoice;
import com.demo.repositories.AccountRepository;
import com.demo.repositories.InvoiceRepository;
@Service("invoiceService")
public class InvoiceServiceImp implements InvoiceService{
@Autowired
private InvoiceRepository invoiceRepository;
@Override
public Iterable<Invoice> findAll() {
return invoiceRepository.findAll();
}
@Override
public Invoice find(int id) {
// TODO Auto-generated method stub
return invoiceRepository.findById(id).get();
}
@Override
public Invoice save(Invoice invoice) {
// TODO Auto-generated method stub
return invoiceRepository.save(invoice);
}
@Override
public boolean delete(int id) {
try {
invoiceRepository.deleteById(id);
return true;
} catch (Exception e) {
return false;
}
}
}
| [
"thong0605@yahoo.com"
] | thong0605@yahoo.com |
8678201a27f125db4bce9503319b44eacc5c9d7a | b99a322994b2d7b88c37da1e9ad2736c49b9c1fa | /Average of three numbers/Main.java | 43f204ec49b45ebd735d2c5ee89f4e6cd4d19981 | [] | no_license | gracesinthiya/Playground | fd4b8dd4679fb7be52679d051fac33ad0f4fe147 | 842685ebc0b40e7d364dd22c4c94635dbe5b2348 | refs/heads/master | 2021-01-02T06:56:30.348881 | 2020-02-13T16:43:17 | 2020-02-13T16:43:17 | 239,537,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | import java.util.Scanner;
class Main {
public static void main (String[] args) {
Scanner in=new Scanner(System.in);
int n1=in.nextInt();
int n2=in.nextInt();
int n3=in.nextInt();
int average=(n1+n2+n3)/3;
System.out.println(average);
// Type your code here
}
} | [
"60886404+gracesinthiya@users.noreply.github.com"
] | 60886404+gracesinthiya@users.noreply.github.com |
37c280104feaef6198a66a784d5125d7a32a6816 | 1270f4d88fde867dbd8814aaf2bfa41d7afc3c42 | /src/main/java/HashTagBot.java | 3021243769623d21383914e7f0050d8bea79e0a9 | [
"Apache-2.0"
] | permissive | AlexMisha/hash-tag-bot | 93c3bfe4e94851239b2d25076c4cc5b2080f9006 | cb1a9a9cb9197e32b2c7455fa53adba6427d620a | refs/heads/master | 2020-06-10T20:38:23.041199 | 2016-12-07T22:31:07 | 2016-12-07T22:31:07 | 75,881,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,108 | java | import org.telegram.telegrambots.api.methods.send.SendMessage;
import org.telegram.telegrambots.api.objects.Message;
import org.telegram.telegrambots.api.objects.Update;
import org.telegram.telegrambots.bots.TelegramLongPollingBot;
import org.telegram.telegrambots.exceptions.TelegramApiException;
import twitter4j.*;
import twitter4j.api.SearchResource;
import java.util.ArrayList;
import java.util.Random;
public class HashTagBot extends TelegramLongPollingBot {
private final static String POPULAR = "/popular";
private int retwCount = 0;
@Override
public String getBotUsername() {
return "TwitterPopularHashtagsBot";
}
@Override
public String getBotToken() {
return "273178715:AAFtY8cWqg_9Szf3uEZ9nmz2Nujw1qbWySM";
}
@Override
public void onUpdateReceived(Update update) {
Message message = update.getMessage();
if (message != null && message.hasText()) {
if (message.getText().startsWith(POPULAR)) {
outputPopularHashTags(message);
}
}
}
private void outputPopularHashTags(Message message) {
Twitter twitter = TwitterApi.getTwitter();
try {
Trend[] trends = twitter.trends().getPlaceTrends(23424936).getTrends();
StringBuilder builder = new StringBuilder();
for (int i = 0; i < trends.length - 1; i++) {
String hashtag = getHashTag(trends[i].getName());
builder.append("<a href=\"").append(trends[i].getURL()).append("\">").append(hashtag).append("</a>");
builder.append(getUpDown());
builder.append(getTweetsCount(hashtag, message));
builder.append(getRetweetsCount(message));
builder.append("\n");
}
sendMessage(message, builder.toString());
} catch (TwitterException e) {
e.printStackTrace();
}
}
private String getUpDown() {
Random random = new Random();
int r = random.nextInt(2);
if (r == 0) {
return " \u2b06 ";
}
return " \u2b07 ";
}
// Implement this
private String getTweetsCount(String searchString, Message message) {
int m = 0;
int retweetCount = 0;
long lastID = Long.MAX_VALUE;
Query query = new Query(searchString);
QueryResult result = null;
Twitter twitter = TwitterApi.getTwitter();
ArrayList<Status> tweets = new ArrayList<Status>();
tweets = tweetsCountProc(tweets, query, result, twitter, lastID);
m = tweets.size();
if (m < 20) {
for (Status t: tweets)
if(t.getId() < lastID)
lastID = t.getId();
lastID -= 100000;
tweets = tweetsCountProc(tweets, query, result, twitter, lastID);
m = tweets.size();
}
for (Status t: tweets){
retweetCount += t.getRetweetCount();
}
retwCount = retweetCount;
if (message.getText().contains("15")) m /= 2;
else if (message.getText().contains("30")) m /= 4;
return " Твиты: " + m;
}
// Implement this
private String getRetweetsCount(Message message) {
int m = 0;
m = retwCount;
if (message.getText().contains("15")) m /= 2;
else if (message.getText().contains("30")) m /= 4;
return " Ретвиты: " + m;
}
private String getHashTag(String string) {
if (!string.startsWith("#")) {
return "#" + string;
}
return string;
}
private void sendMessage(Message message, String text) {
SendMessage sendMessage = new SendMessage();
sendMessage.enableHtml(true);
sendMessage.setChatId(message.getChatId().toString());
sendMessage.setReplyToMessageId(message.getMessageId());
sendMessage.setText(text);
try {
sendMessage(sendMessage);
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
private ArrayList<Status> tweetsCountProc(ArrayList<Status> tweets, Query query, QueryResult result, SearchResource twitter, long lastID) {
int i = 0;
int numberOfTweets = 4096;
do {
i++;
int tweetsSize = tweets.size();
if (tweetsSize != 0) query.setMaxId(lastID);
if (numberOfTweets - tweetsSize > 100){
query.count(100);
}
else {
query.count(numberOfTweets - tweetsSize);
}
try
{
result = twitter.search(query);
tweets.addAll(result.getTweets());
for (Status t: tweets)
if(t.getId() < lastID)
lastID = t.getId();
}
catch (TwitterException te)
{
te.printStackTrace();
}
query.setMaxId(lastID-1);
} while ((tweets.size() < numberOfTweets) && ((query = result.nextQuery()) != null) && (i < 10));
return tweets;
}
}
| [
"michaelalex600@gmail.com"
] | michaelalex600@gmail.com |
008b70ab4e6b2dbf5fc0e9b7843c2c5bc8dbaf90 | 183931eedd8ed7ff685e22cb055f86f12a54d707 | /test/miscCode/src/main/java/games/task3410/model/GameObject.java | a9cf23bbf147dcd3c61a190127e66696648ccf61 | [] | no_license | cynepCTAPuk/headFirstJava | 94a87be8f6958ab373cd1640a5bdb9c3cc3bf166 | 7cb45f6e2336bbc78852d297ad3474fd491e5870 | refs/heads/master | 2023-08-16T06:51:14.206516 | 2023-08-08T16:44:11 | 2023-08-08T16:44:11 | 154,661,091 | 0 | 1 | null | 2023-01-06T21:32:31 | 2018-10-25T11:40:54 | Java | UTF-8 | Java | false | false | 1,042 | java | package games.task3410.model;
import java.awt.*;
public abstract class GameObject {
private int x;
private int y;
private int width;
private int height;
public GameObject(int x, int y) {
this.x = x;
this.y = y;
this.width = Model.FIELD_CELL_SIZE;
this.height = Model.FIELD_CELL_SIZE;
}
public GameObject(int x, int y, int width, int height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public abstract void draw(Graphics graphics);
}
| [
"CTAPuk@gmail.com"
] | CTAPuk@gmail.com |
841b39f70759a0036c51ad125c7a23575570d2d7 | bd76dffb8ebd2e067e9be74556358292b8345908 | /android/app/src/main/java/com/sajjadamin/outgoings/AddBudgetActivity.java | bf7616052e82f2ce12caf5e55fb2f93889738d4a | [] | no_license | sajjad-amin/outgoings | 48616b46fe77878cc958aceccdda72846aafdf15 | 3d2c35c735d7ed00c44eb333d07ff33e7dfafdd0 | refs/heads/master | 2020-08-09T00:34:09.718842 | 2019-10-09T15:40:22 | 2019-10-09T15:40:22 | 209,760,230 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,054 | java | package com.sajjadamin.outgoings;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Toast;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Calendar;
import java.util.Objects;
public class AddBudgetActivity extends AppCompatActivity {
private EditText newDate,newTitle, newDescription, newAmount;
private Button newCancel,newAdd;
private DatePickerDialog datePickerDialog;
public int clickCount = 0;
String sendDate, sendTitle, sendDescription, sendAmount;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_budget);
newDate = findViewById(R.id.add_new_budget_date);
newTitle = findViewById(R.id.add_new_budget_title);
newDescription = findViewById(R.id.add_new_budget_description);
newAmount = findViewById(R.id.add_new_budget_amount);
newCancel = findViewById(R.id.cancel_new_budget_button);
newAdd = findViewById(R.id.add_new_budget_button);
newDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Calendar calendar = Calendar.getInstance();
final int year = calendar.get(Calendar.YEAR);
final int month = calendar.get(Calendar.MONTH);
final int date = calendar.get(Calendar.DAY_OF_MONTH);
datePickerDialog = new DatePickerDialog(AddBudgetActivity.this, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int i, int i1, int i2) {
String stringYear,stringMonth,stringDate,fulldate;
stringYear = Integer.toString(i);
if (i1 < 9){
stringMonth = Integer.toString(i1+1);
stringMonth = "0"+stringMonth;
}else {
stringMonth = Integer.toString(i1+1);
}
if (i2 < 9){
stringDate = Integer.toString(i2);
stringDate = "0"+stringDate;
}else {
stringDate = Integer.toString(i2);
}
fulldate = stringYear+"-"+stringMonth+"-"+stringDate;
newDate.setText(fulldate);
}
},year,month,date);
datePickerDialog.show();
}
});
newCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
newAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sendDate = newDate.getText().toString();
sendTitle = newTitle.getText().toString();
sendDescription = newDescription.getText().toString();
sendAmount = newAmount.getText().toString();
if (new Helper(AddBudgetActivity.this).connectionCheck()){
if (!sendDate.equals("") && !sendTitle.equals("") && !sendDescription.equals("") && !sendAmount.equals("") && clickCount == 0){
clickCount += 1;
new sendHttpRequest().execute();
}else {
Toast.makeText(AddBudgetActivity.this,"Fields must not be empty",Toast.LENGTH_SHORT).show();
}
}else {
clickCount = 0;
Toast.makeText(AddBudgetActivity.this,"You are currently offline, please turn on internet",Toast.LENGTH_SHORT).show();
}
}
});
}
private class sendHttpRequest extends AsyncTask<String, String, String> {
@Override
protected String doInBackground(String... strings) {
try {
URL url = new URL("http://outgoings.sajjadamin.com/api.php");
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setDoOutput(true);
Uri.Builder builder = new Uri.Builder()
.appendQueryParameter("action", "create_budget")
.appendQueryParameter("user_id", new Helper(AddBudgetActivity.this).getSessionData("user_id"))
.appendQueryParameter("password", new Helper(AddBudgetActivity.this).getSessionData("password"))
.appendQueryParameter("title", sendTitle)
.appendQueryParameter("description", sendDescription)
.appendQueryParameter("date", sendDate)
.appendQueryParameter("amount", sendAmount);
OutputStream outputStream = urlConnection.getOutputStream();
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8));
bufferedWriter.write(Objects.requireNonNull(builder.build().getEncodedQuery()));
bufferedWriter.flush();
bufferedWriter.close();
outputStream.close();
urlConnection.connect();
InputStream inputStream = urlConnection.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder stringBuilder = new StringBuilder();
String inputLine;
while ((inputLine = bufferedReader.readLine()) != null) {
stringBuilder.append(inputLine);
}
bufferedReader.close();
return stringBuilder.toString();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String s) {
if (s.equals("success")){
finish();
startActivity(new Intent(AddBudgetActivity.this,MainActivity.class));
}else {
clickCount = 0;
Toast.makeText(AddBudgetActivity.this,"Failed",Toast.LENGTH_SHORT).show();
}
super.onPostExecute(s);
}
}
}
| [
"sayem.1998.bd@gmail.com"
] | sayem.1998.bd@gmail.com |
3e673b1c677743e97949933dfb641146cc31fbda | 96dbd3a977496a6da9f3ded4aa1675cd32fd9cfd | /spring-web/src/test/java/org/springframework/http/server/reactive/ServerHttpResponseTests.java | 281b214618493bd9ec5b5fa7edd79a7fc738d51a | [
"Apache-2.0"
] | permissive | HappyDogYear/spring-framwrok-5.2 | 82b38686cb316c4516403a3afdb769a495f2700f | 3e291557b6436ea2e574a8fbf0e201ae2bf84925 | refs/heads/master | 2023-02-03T13:35:29.105995 | 2020-12-21T15:29:35 | 2020-12-21T15:29:35 | 323,370,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,586 | java | /*
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.http.server.reactive;
import org.junit.jupiter.api.Test;
import org.reactivestreams.Publisher;
import org.springframework.core.ResolvableType;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DefaultDataBuffer;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
import org.springframework.core.testfixture.io.buffer.LeakAwareDataBufferFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseCookie;
import org.springframework.http.codec.EncoderHttpMessageWriter;
import org.springframework.http.codec.HttpMessageWriter;
import org.springframework.http.codec.json.Jackson2JsonEncoder;
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.netty.channel.AbortedException;
import reactor.test.StepVerifier;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Supplier;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Unit tests for {@link AbstractServerHttpRequest}.
*
* @author Rossen Stoyanchev
* @author Sebastien Deleuze
* @author Brian Clozel
*/
public class ServerHttpResponseTests {
@Test
void writeWith() {
TestServerHttpResponse response = new TestServerHttpResponse();
response.writeWith(Flux.just(wrap("a"), wrap("b"), wrap("c"))).block();
assertThat(response.statusCodeWritten).isTrue();
assertThat(response.headersWritten).isTrue();
assertThat(response.cookiesWritten).isTrue();
assertThat(response.body.size()).isEqualTo(3);
assertThat(new String(response.body.get(0).asByteBuffer().array(), StandardCharsets.UTF_8)).isEqualTo("a");
assertThat(new String(response.body.get(1).asByteBuffer().array(), StandardCharsets.UTF_8)).isEqualTo("b");
assertThat(new String(response.body.get(2).asByteBuffer().array(), StandardCharsets.UTF_8)).isEqualTo("c");
}
@Test // SPR-14952
void writeAndFlushWithFluxOfDefaultDataBuffer() {
TestServerHttpResponse response = new TestServerHttpResponse();
Flux<Flux<DefaultDataBuffer>> flux = Flux.just(Flux.just(wrap("foo")));
response.writeAndFlushWith(flux).block();
assertThat(response.statusCodeWritten).isTrue();
assertThat(response.headersWritten).isTrue();
assertThat(response.cookiesWritten).isTrue();
assertThat(response.body.size()).isEqualTo(1);
assertThat(new String(response.body.get(0).asByteBuffer().array(), StandardCharsets.UTF_8)).isEqualTo("foo");
}
@Test
void writeWithFluxError() {
IllegalStateException error = new IllegalStateException("boo");
writeWithError(Flux.error(error));
}
@Test
void writeWithMonoError() {
IllegalStateException error = new IllegalStateException("boo");
writeWithError(Mono.error(error));
}
void writeWithError(Publisher<DataBuffer> body) {
TestServerHttpResponse response = new TestServerHttpResponse();
HttpHeaders headers = response.getHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set(HttpHeaders.CONTENT_ENCODING, "gzip");
headers.setContentLength(12);
response.writeWith(body).onErrorResume(ex -> Mono.empty()).block();
assertThat(response.statusCodeWritten).isFalse();
assertThat(response.headersWritten).isFalse();
assertThat(response.cookiesWritten).isFalse();
assertThat(headers).doesNotContainKeys(HttpHeaders.CONTENT_TYPE, HttpHeaders.CONTENT_LENGTH,
HttpHeaders.CONTENT_ENCODING);
assertThat(response.body.isEmpty()).isTrue();
}
@Test
void setComplete() {
TestServerHttpResponse response = new TestServerHttpResponse();
response.setComplete().block();
assertThat(response.statusCodeWritten).isTrue();
assertThat(response.headersWritten).isTrue();
assertThat(response.cookiesWritten).isTrue();
assertThat(response.body.isEmpty()).isTrue();
}
@Test
void beforeCommitWithComplete() {
ResponseCookie cookie = ResponseCookie.from("ID", "123").build();
TestServerHttpResponse response = new TestServerHttpResponse();
response.beforeCommit(() -> Mono.fromRunnable(() -> response.getCookies().add(cookie.getName(), cookie)));
response.writeWith(Flux.just(wrap("a"), wrap("b"), wrap("c"))).block();
assertThat(response.statusCodeWritten).isTrue();
assertThat(response.headersWritten).isTrue();
assertThat(response.cookiesWritten).isTrue();
assertThat(response.getCookies().getFirst("ID")).isSameAs(cookie);
assertThat(response.body.size()).isEqualTo(3);
assertThat(new String(response.body.get(0).asByteBuffer().array(), StandardCharsets.UTF_8)).isEqualTo("a");
assertThat(new String(response.body.get(1).asByteBuffer().array(), StandardCharsets.UTF_8)).isEqualTo("b");
assertThat(new String(response.body.get(2).asByteBuffer().array(), StandardCharsets.UTF_8)).isEqualTo("c");
}
@Test
void beforeCommitActionWithSetComplete() {
ResponseCookie cookie = ResponseCookie.from("ID", "123").build();
TestServerHttpResponse response = new TestServerHttpResponse();
response.beforeCommit(() -> {
response.getCookies().add(cookie.getName(), cookie);
return Mono.empty();
});
response.setComplete().block();
assertThat(response.statusCodeWritten).isTrue();
assertThat(response.headersWritten).isTrue();
assertThat(response.cookiesWritten).isTrue();
assertThat(response.body.isEmpty()).isTrue();
assertThat(response.getCookies().getFirst("ID")).isSameAs(cookie);
}
@Test // gh-24186
void beforeCommitErrorShouldLeaveResponseNotCommitted() {
Consumer<Supplier<Mono<Void>>> tester = preCommitAction -> {
TestServerHttpResponse response = new TestServerHttpResponse();
response.getHeaders().setContentType(MediaType.APPLICATION_JSON);
response.getHeaders().setContentLength(3);
response.beforeCommit(preCommitAction);
StepVerifier.create(response.writeWith(Flux.just(wrap("body"))))
.expectErrorMessage("Max sessions")
.verify();
assertThat(response.statusCodeWritten).isFalse();
assertThat(response.headersWritten).isFalse();
assertThat(response.cookiesWritten).isFalse();
assertThat(response.isCommitted()).isFalse();
assertThat(response.getHeaders()).isEmpty();
};
tester.accept(() -> Mono.error(new IllegalStateException("Max sessions")));
tester.accept(() -> {
throw new IllegalStateException("Max sessions");
});
}
@Test // gh-26232
void monoResponseShouldNotLeakIfCancelled() {
LeakAwareDataBufferFactory bufferFactory = new LeakAwareDataBufferFactory();
MockServerHttpRequest request = MockServerHttpRequest.get("/").build();
MockServerHttpResponse response = new MockServerHttpResponse(bufferFactory);
response.setWriteHandler(flux -> {
throw AbortedException.beforeSend();
});
HttpMessageWriter<Object> messageWriter = new EncoderHttpMessageWriter<>(new Jackson2JsonEncoder());
Mono<Void> result = messageWriter.write(Mono.just(Collections.singletonMap("foo", "bar")),
ResolvableType.forClass(Mono.class), ResolvableType.forClass(Map.class), null,
request, response, Collections.emptyMap());
StepVerifier.create(result).expectError(AbortedException.class).verify();
bufferFactory.checkForLeaks();
}
private DefaultDataBuffer wrap(String a) {
return new DefaultDataBufferFactory().wrap(ByteBuffer.wrap(a.getBytes(StandardCharsets.UTF_8)));
}
private static class TestServerHttpResponse extends AbstractServerHttpResponse {
private boolean statusCodeWritten;
private boolean headersWritten;
private boolean cookiesWritten;
private final List<DataBuffer> body = new ArrayList<>();
public TestServerHttpResponse() {
super(new DefaultDataBufferFactory());
}
@Override
public <T> T getNativeResponse() {
throw new IllegalStateException("This is a mock. No running server, no native response.");
}
@Override
public void applyStatusCode() {
assertThat(this.statusCodeWritten).isFalse();
this.statusCodeWritten = true;
}
@Override
protected void applyHeaders() {
assertThat(this.headersWritten).isFalse();
this.headersWritten = true;
}
@Override
protected void applyCookies() {
assertThat(this.cookiesWritten).isFalse();
this.cookiesWritten = true;
}
@Override
protected Mono<Void> writeWithInternal(Publisher<? extends DataBuffer> body) {
return Flux.from(body).map(b -> {
this.body.add(b);
return b;
}).then();
}
@Override
protected Mono<Void> writeAndFlushWithInternal(
Publisher<? extends Publisher<? extends DataBuffer>> bodyWithFlush) {
return Flux.from(bodyWithFlush).flatMap(body ->
Flux.from(body).map(b -> {
this.body.add(b);
return b;
})
).then();
}
}
}
| [
"mdzxzhao@163.com"
] | mdzxzhao@163.com |
d84cdbabac9e93af9f084c33bffa9005ba650245 | 0c4ad1e14e42eb6b5c85e56f10074f5033cb9ad1 | /cocos-java/proj.java/src/main/java/org/ccj/event/EventCustom.java | d7b23ee17dd3442a16fdb07df985fe7134a0e534 | [] | no_license | xubingyue/cocoseditor | 70288f3eb20e3ae8c92eddc6b0fa0cf8152a4e4a | 5d4011089c3f016a415e6c74fead7740b2f16f91 | refs/heads/master | 2021-01-13T03:32:31.534249 | 2015-07-31T09:01:02 | 2015-07-31T09:01:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,465 | java | /**
* Copyright(c) Shanghai YiJun Network Technologies Inc. All right reserved.
*/
package org.ccj.event;
import com.googlecode.javacpp.Pointer;
import com.googlecode.javacpp.annotation.Allocator;
import com.googlecode.javacpp.annotation.Const;
import com.googlecode.javacpp.annotation.Namespace;
import com.googlecode.javacpp.annotation.Platform;
import com.googlecode.javacpp.annotation.StdString;
import org.ccj.base.MapString;
import org.ccj.base.Ref;
/**
* @author <a href="mailto:yuanyou@makeapp.co">yuanyou</a>
* @version $Date:2014/4/27 13:23 $
* $Id$
*/
@Platform(include = "CCEventCustom.h")
@Namespace("cocos2d")
@com.googlecode.javacpp.annotation.Opaque
public class EventCustom extends Event
{
public EventCustom(long address) {
super(address);
}
public EventCustom(String name) {
allocate(name);
}
@Allocator
public native void allocate(@StdString String name);
@StdString
@Const
public native String getEventName();
/** Sets user data */
public native void setUserData(Pointer data);
/** Gets user data */
public native Pointer getUserData();
public void setMapString(MapString values){
setUserData(values);
}
public MapString getMapString(){
Pointer pointer = getUserData();
if(pointer!=null && pointer.address()>0){
return new MapString(pointer);
}else{
return null;
}
}
}
| [
"yuanyou@makeapp.co"
] | yuanyou@makeapp.co |
85d8254c5d61ed8a7e65af51473504d99c1f7d66 | c24a84f11b6725a591aa4642c49aee14c5632774 | /src/java/com/netflix/ice/reader/AggregateType.java | 473e2b7fc7b336b7cc954ef845e9fa85d30209b4 | [
"Apache-2.0"
] | permissive | jimroth/ice | b72555ff1df9d45b40b8a532691f26514cbb45fd | defd846926b9282ab67d8ab3e14c955487251e1d | refs/heads/master | 2022-02-28T13:25:07.013711 | 2022-01-19T22:00:42 | 2022-01-19T22:00:42 | 59,518,311 | 36 | 14 | null | 2022-02-09T05:24:24 | 2016-05-23T21:05:45 | Java | UTF-8 | Java | false | false | 743 | java | /*
*
* Copyright 2013 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.ice.reader;
public enum AggregateType {
none,
stats,
data,
both
}
| [
"fji@netflix.com"
] | fji@netflix.com |
1683f90604634e9d66ca9ea808e5feacea7eea57 | 4f7838ea40e3f3edb0a808fffb4535a719ef57e3 | /UnoRider/android/app/src/main/java/com/unorider/MainActivity.java | 26f78617b34a6e3225cd1d38dacf57aaaec11407 | [] | no_license | sidewapboss/mobileApp | 80edd5103cc25cc900adc6b004169aa6dfd7db81 | 5db7beb5b99e347867af3e7f5f7924f4b223a0b3 | refs/heads/master | 2022-12-03T15:46:02.121536 | 2020-08-14T23:13:49 | 2020-08-14T23:13:49 | 287,247,081 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.unorider;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "UnoRider";
}
}
| [
"sidewapinc@gmail.com"
] | sidewapinc@gmail.com |
cc03479adf61ec80b0d5f2062a39168d5174262a | 4df2b52d80f644eeb5c54b07ea1e3a8d13df0692 | /src/main/java/com/sunjray/osdma/SMmodel/QaqcItems.java | 3f6e16b4a0f6582b22c8f71013bb334a9dfae346 | [] | no_license | siba8908/osdmanew | 0a0cc0b1992642cad79482b22b648bae0e332580 | 38a2427baf0f6dc32c2bde6f64e0a8e25c30aa6a | refs/heads/master | 2020-07-18T13:00:48.470174 | 2019-11-05T16:30:43 | 2019-11-05T16:30:43 | 206,249,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,609 | java | package com.sunjray.osdma.SMmodel;
import static javax.persistence.GenerationType.IDENTITY;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* QaqcItems generated by Smruti
*/
@Entity
@Table(name = "t_os_qaqc_items", catalog = "osdma")
public class QaqcItems implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private Integer itemId;
private ConsignmentMaterialList consignmentMaterialList;
private String productCode;
private String barcode;
private String quality;
private Date createdDate;
private Integer createdBy;
private String remarks;
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "item_id", unique = true, nullable = false)
public Integer getItemId() {
return this.itemId;
}
public void setItemId(Integer itemId) {
this.itemId = itemId;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "material_id")
public ConsignmentMaterialList getConsignmentMaterialList() {
return this.consignmentMaterialList;
}
public void setConsignmentMaterialList(ConsignmentMaterialList consignmentMaterialList) {
this.consignmentMaterialList = consignmentMaterialList;
}
@Column(name = "product_code", length = 100)
public String getProductCode() {
return this.productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
@Column(name = "barcode", length = 100)
public String getBarcode() {
return this.barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
@Column(name = "quality", length = 6)
public String getQuality() {
return this.quality;
}
public void setQuality(String quality) {
this.quality = quality;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_date", length = 19)
public Date getCreatedDate() {
return this.createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
@Column(name = "created_by")
public Integer getCreatedBy() {
return this.createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
@Column(name = "remarks", length = 45)
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
}
| [
"smruti.rout@ekutirsb.com"
] | smruti.rout@ekutirsb.com |
21189b7895c5de8a3177c5a0731cffb3d615bd2f | 11878569c3700c31b5f85846e344e1ff1154512c | /CompositeDiscussion/src/compositediscussion/CompositeDiscussion.java | f65d23bb983fbcf7088d0cae264e4dd0f600e665 | [] | no_license | jeppeml/CS2018A-SDE-Examples | 2a63af2550568646fe4b5592bbe831432d5f583d | 04be4d127b0e1e757c22ab12a9901892e7664843 | refs/heads/master | 2021-07-05T14:48:42.991814 | 2019-04-01T11:58:56 | 2019-04-01T11:58:56 | 144,688,351 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 823 | 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 compositediscussion;
/**
*
* @author jeppjleemoritzled
*/
public class CompositeDiscussion {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Post post = new Post("Hej, min første besked");
Post sub = new Post("Underbesked til første besked");
post.addPost(sub);
Post subsub = new Post("under under besked 1");
Post subsubsub = new Post("under under under besked 42");
subsub.addPost(subsubsub);
sub.addPost(subsub);
sub.addPost(new Post("under under besked 2"));
subsub.print();
}
}
| [
"jeppeml@users.noreply.github.com"
] | jeppeml@users.noreply.github.com |
e1963bacfb1789e6fcc25dcbe3a15cba848272c6 | c801d1a5d4aa73b046600578e1fa89e9c22059e1 | /Topological sort.java | 32ba4987d2cc044e2cd3d181789742e8c5048104 | [] | no_license | KhairyMuhamed/Topological_sort | f9c0b6ab20b6e365ea0e790df87d95f3bfd0ac45 | 2d7c1d170972b7446fd46ba0b8cd626b5da78274 | refs/heads/main | 2023-07-13T22:40:18.772375 | 2021-08-22T17:19:22 | 2021-08-22T17:19:22 | 398,856,523 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,495 | java | Void main{
Read n (the number of islands) , m (the number of
one-way bridges), r (the index of the island you are
initially on);
Make an 2D array called “ graph_matrix ” in size of [
n+1 ] to store the connections between islands
(store the edge (bridges) between isalnds );
//Make for loop read x ( first island ) ,y( second
island ) to store the connections between islands in
2D array .
// for loop to store number of bridges in 2D array .
For (I = 0; I < m ; i++ ){
Read x ( first island ) ,y( second island );
// put 1 in the index where x and y intersect .
graph_matrix [ x ][ y ]=1;
}
Take an object (h) from class TopologicalSorting;
Make an array called “ a ” ;
Call method “ topological ” that take array “
graph_matrix ” and r “ the index of the island you
are initially on ” that method sort the array “
graph_matrix ” that method sort bridges ;
// Topological sorting “ if there depancy between
nodes we can write nodes in somehow While
maintaining dependency ” , it for Directed Acyclic
Graph “ DAG ” linear ordering of vertices such that
for every directed edge( u , v ) u must come before
v .
Read a = h.topological( graph_matrix , r );
// after sorting “ graph matrix “ in topological way
we store result from topological method in array “ a
” after sorting .
// for loop to print the island he will stuck on .
For (I = 0 ; I < a.length-1 ; i++ ){
If ( a[ i ] != 0 )
Print ( "the island he will stuck on : " + a[i] );
}
| [
"noreply@github.com"
] | noreply@github.com |
bd629a4be5d35523c29f8bb64012b719c281f067 | 9227d87e828eac7745da4fdeb6697b1ea8f5ec80 | /src/hib/Administrators.java | 50ffd2fe14c33e84e5b5441aaca604ff0fabd096 | [] | no_license | AlonZolfi/ADB-Ex2 | d88da7795e6bd55e1f5a06311a4a4df02f89ad13 | 65b1d10a6ebfab6a1e686fd404bea29f4aa17e74 | refs/heads/master | 2020-11-24T15:42:50.409996 | 2019-12-15T21:51:18 | 2019-12-15T21:51:18 | 228,222,776 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 971 | java | package hib;
// Generated Dec 14, 2019 11:35:03 AM by Hibernate Tools 4.3.5.Final
/**
* Administrators generated by hbm2java
*/
public class Administrators implements java.io.Serializable {
private int adminid;
private String username;
private String password;
public Administrators() {
}
public Administrators(int adminid) {
this.adminid = adminid;
}
public Administrators(int adminid, String username, String password) {
this.adminid = adminid;
this.username = username;
this.password = password;
}
public int getAdminid() {
return this.adminid;
}
public void setAdminid(int adminid) {
this.adminid = adminid;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"alonzolfi44@gmail.com"
] | alonzolfi44@gmail.com |
61ed5b624a74c3da00d2bf96c63feb32b26c3e37 | b797e3c7596e3d686baf2587f736aa06e51cdc1b | /src/controlador/ValidadorOpcao.java | 6f29338ebe7b59b52af3b46526fd22479ede8097 | [] | no_license | isabellefo/app-agropecuraria | c95374d6680162f6857b1c1cb20aa4d4753cd318 | f199753076bea63a92b86cdb2929e82b7a6d8183 | refs/heads/main | 2023-01-12T03:58:20.225774 | 2020-11-02T21:31:59 | 2020-11-02T21:31:59 | 305,721,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package controlador;
public class ValidadorOpcao implements Validador {
protected int max;
public ValidadorOpcao(int max) {
this.max = max;
}
@Override
public boolean validar(Object target) {
if(!(target instanceof Integer)) {
return false;
}
int x = (int) target;
return (x > 0) && (x <= max);
}
}
| [
"gabriel.borges@solucx.com.br"
] | gabriel.borges@solucx.com.br |
03d385b6c3c74fe5d5edbeafae13577a7b0cd635 | 380f5173eaa64f3892aff51fa8df728160a2e2af | /test/poi/src/main/java/com/liao/test/ListTest.java | c2bc7cf6a83c741bd2487fc3e27de0e28188ecea | [] | no_license | dotaliaokailin/project | fa1f35d21661d83c76694490f33df76bb7a328c7 | 1036264ec9be64d28362f087046a8b067e0ab8dd | refs/heads/master | 2023-04-05T10:08:29.465642 | 2021-03-31T02:48:47 | 2021-03-31T02:48:47 | 297,607,264 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,088 | java | package com.liao.test;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ListTest {
static List<Object> list1 = new ArrayList<Object>(){
{
add("a");
add("b");
add("c");
}
};
static List<Object> list2 = new ArrayList<Object>(){
{
add("e");
add("f");
add("c");
}
};
/**
* 交集
*/
@Test
public void inter(){
boolean b = list1.retainAll(list2);
System.out.println(list1); // c
System.out.println(list2); // e f c
}
/**
* 差集
*/
@Test
public void diff(){
boolean b = list1.removeAll(list2);
System.out.println(list1); // a b
System.out.println(list2); // e f c
}
/**
* 并集
*/
@Test
public void union(){
list1.removeAll(list2);
list1.addAll(list2);
System.out.println(list1); // a b e f c
list1.forEach(System.out::print); // a b e f c
}
}
| [
"719098033@qq.com"
] | 719098033@qq.com |
d3a6bdc94eed64ca218c6942f1058f71f8be55c8 | 2d4c2cecb5cda6cae43d7628784ace01df5eeed0 | /thinking-in-spring/configuration-metadata/src/main/java/com/wallfacers/spring/configuration/metadata/PropertiesLoadDemo.java | d27827818867ec3c853238b34b6bfaf671f8fe7e | [] | no_license | wallfacers/spring-framework-source-analyze | 59df8705bf38b0729811f0b35f13f22a700d31bd | c649f373eab6a144018ae035dc3726b6fd4ce08e | refs/heads/master | 2022-12-25T03:06:38.984039 | 2020-04-26T14:18:36 | 2020-04-26T14:18:36 | 245,839,195 | 0 | 0 | null | 2022-12-14T20:45:10 | 2020-03-08T15:28:41 | Java | UTF-8 | Java | false | false | 2,081 | java | package com.wallfacers.spring.configuration.metadata;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ResourceUtils;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Enumeration;
import java.util.Properties;
public class PropertiesLoadDemo {
public static void main(String[] args) throws IOException {
String resourceName = "META-INF/spring.handlers";
Assert.notNull(resourceName, "Resource name must not be null");
ClassLoader classLoaderToUse = Class.class.getClassLoader();
if (classLoaderToUse == null) {
classLoaderToUse = ClassUtils.getDefaultClassLoader();
}
Enumeration<URL> urls = (classLoaderToUse != null ? classLoaderToUse.getResources(resourceName) :
ClassLoader.getSystemResources(resourceName));
Properties props = new Properties();
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
URLConnection con = url.openConnection();
ResourceUtils.useCachesIfNecessary(con);
InputStream is = con.getInputStream();
try {
if (resourceName.endsWith(".xml")) {
props.loadFromXML(is);
}
else {
props.load(is);
}
}
finally {
is.close();
}
}
if (props != null) {
for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) {
String key = (String) en.nextElement();
Object value = props.get(key);
if (value == null) {
// Allow for defaults fallback or potentially overridden accessor...
value = props.getProperty(key);
}
System.out.println(key + "=" + value);
}
}
}
}
| [
"[wallfacerswu@gmail.com]"
] | [wallfacerswu@gmail.com] |
da1cd087929ef9fb26142f8e806bd9cebfa463a4 | 37c8df40527b5d58ea721eb37167a672a301847a | /CISC181.PS1/src/MainPackage/KhanS.java | a4391ad648733ac8f778240da82c3ddf8b7242c4 | [] | no_license | seharkhan/PS1 | 614ab69649aa729b953252e9de25938498619ef4 | 628e351d48755d02f0e59b5d6066e4073322410f | refs/heads/master | 2016-09-06T08:17:39.618926 | 2015-09-09T17:09:03 | 2015-09-09T17:14:14 | 42,192,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 123 | java | package MainPackage;
public class KhanS {
public static void HelloWorld(){
System.out.println("Hello World");
}
}
| [
"seharkhan@wifi-roaming-128-4-237-166.host.udel.edu"
] | seharkhan@wifi-roaming-128-4-237-166.host.udel.edu |
6cc6673c38d78f46d976ca5055aea30733a797c8 | 784f5daa2d4d4b376e3f84a7201b6676af3d086b | /robospice-sample-ormlite/src/com/octo/android/robospice/sample/ormlite/model/Weather.java | 45728d1cb26b36acf94b342420ebb95e1bb8288e | [] | no_license | amitav13/RoboSpice-samples | 69a30d6eda7170237009a6ab127ddd13472e6d12 | 63778866d7ee836ca6a8099fb8ebb9f6401cd3f8 | refs/heads/release | 2021-06-17T17:29:17.070336 | 2014-01-16T09:56:30 | 2014-01-16T09:56:30 | 37,940,854 | 0 | 0 | null | 2015-06-23T19:42:31 | 2015-06-23T19:42:30 | null | UTF-8 | Java | false | false | 3,894 | java | package com.octo.android.robospice.sample.ormlite.model;
import java.util.ArrayList;
import java.util.Collection;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.ForeignCollectionField;
@Root
public class Weather {
@DatabaseField(generatedId = true)
private int id;
@DatabaseField
private String emptyField;
@ForeignCollectionField(eager = false)
@ElementList(entry = "curren_weather", inline = true, required = false)
private Collection<CurrenWeather> listWeather;
@ForeignCollectionField(eager = false)
@ElementList(inline = true, required = false)
private Collection<Forecast> listForecast;
public Weather() {
}
public void setId(int id) {
this.id = id;
}
public int getId() {
return id;
}
public Collection<CurrenWeather> getListWeather() {
return this.listWeather;
}
public void setListWeather(Collection<CurrenWeather> currenWeather) {
this.listWeather = currenWeather;
}
public Collection<Forecast> getListForecast() {
return this.listForecast;
}
public void setListForecast(Collection<Forecast> forecast) {
this.listForecast = forecast;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ (emptyField == null ? 0 : emptyField.hashCode());
result = prime * result + id;
result = prime * result
+ (listForecast == null ? 0 : listForecast.hashCode());
result = prime * result
+ (listWeather == null ? 0 : listWeather.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Weather other = (Weather) obj;
if (emptyField == null) {
if (other.emptyField != null) {
return false;
}
} else if (!emptyField.equals(other.emptyField)) {
return false;
}
if (id != other.id) {
return false;
}
if (listForecast == null) {
if (other.listForecast != null) {
return false;
}
} else {
if (other.listForecast == null) {
return false;
}
Collection<Forecast> collectionForecast = new ArrayList<Forecast>(
listForecast);
Collection<Forecast> otherCollectionForecast = new ArrayList<Forecast>(
other.listForecast);
if (!collectionForecast.equals(otherCollectionForecast)) {
return false;
}
}
if (listWeather == null) {
if (other.listWeather != null) {
return false;
}
} else {
if (other.listWeather == null) {
return false;
}
Collection<CurrenWeather> collectionCurren_Weather = new ArrayList<CurrenWeather>(
listWeather);
Collection<CurrenWeather> otherCollectionCurren_Weather = new ArrayList<CurrenWeather>(
other.listWeather);
if (!collectionCurren_Weather.equals(otherCollectionCurren_Weather)) {
return false;
}
}
return true;
}
@Override
public String toString() {
return "Weather [curren_weather=" + listWeather + ", forecast="
+ listForecast + "]";
}
}
| [
"steff.nicolas@gmail.com"
] | steff.nicolas@gmail.com |
db8dc8ddd2a8ee67c0a1bb1874ba33eea687f182 | 14b5cf50df8ea4c408e0c30e121e6b13808c4aed | /src/creational/singleton/collection_singleton/ResourceManager.java | cfea7b0c87a40c6d22b7859c049a3d367e507791 | [] | no_license | maria22101/DesignPatterns | 99bf9a8c6ee6b2e5c2ec24b1067e471be4ea1dca | 4a6a2173ae263d08b56b2f3f5dcc8c30dabe3282 | refs/heads/master | 2023-08-16T08:34:53.172337 | 2021-10-24T12:42:04 | 2021-10-24T12:42:04 | 280,912,143 | 0 | 0 | null | 2020-07-31T20:14:09 | 2020-07-19T17:07:22 | Java | UTF-8 | Java | false | false | 780 | java | package creational.singleton.collection_singleton;
import java.util.Collections;
import java.util.List;
/**
* Class illustrates UnsupportedOperationException occurrence
*/
public class ResourceManager {
public static void main(String[] args) {
Resource resource = new Resource();
List<Resource> resourceList = Collections.singletonList(resource);
processResources(resourceList);
Resource resource2 = new Resource();
// UnsupportedOperationException exception will be generated as the only one collection element allowed
resourceList.add(resource2);
}
public static <Type> void processResources(List<Type> list) {
for (Type resource : list) {
// code to process resources
}
}
}
| [
"maria.bilous101@gmail.com"
] | maria.bilous101@gmail.com |
c51c0641992c0dacbed024b8fd609800a0da65b4 | edb8747b6064f49c87ea23720c9dd46ba8923dbf | /src/main/java/com/kkindom_blog/service/IEntertainmentService.java | b1d7986575426d5d61274a8d94fc65ce2b45922c | [] | no_license | KKindom/jee | 5d7ad610f3420f697b79205ec3fa542abbc9b416 | c7c64c95caad2e959a0484c8e1204d6555009ed6 | refs/heads/master | 2022-11-15T18:38:31.783470 | 2020-07-06T06:18:24 | 2020-07-06T06:18:24 | 272,436,625 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,907 | java | package com.kkindom_blog.service;
import com.github.pagehelper.PageInfo;
import com.kkindom_blog.model.domain.E_Video;
import com.kkindom_blog.model.domain.E_type;
import com.kkindom_blog.model.domain.Entertainment;
import java.util.List;
public interface IEntertainmentService {
// 分页查询我的娱乐基本信息列表
public PageInfo<Entertainment> selectEntertainmentWithPage(Integer page, Integer count);
//分页查询我的娱乐视频信息列表
public PageInfo<E_Video> selectE_vdieoWithPage(Integer page, Integer count);
//获取所有的视频信息
public List<E_Video> getAll_Video();
// 根据文章id查询单个娱乐详情
public Entertainment selectEntertainmentWithId(Integer id);
// 发布娱乐信息
public int publish_e(Entertainment entertainment);
// 发布娱乐视频信息
public void publish_v(E_Video e_video);
// 根据主键更新娱乐
public void updateEntertainmentWithId(Entertainment entertainment);
//根据主键更新视频信息
public void updateE_vWithId(E_Video e_video);
// 根据主键删除娱乐
public void deleteEntertainmentWithId(int id);
//根据id查询我的娱乐视频
public E_Video selecte_videowithId(Integer id);
//根据id删除我的娱乐视频
public void deleteE_videoWithId(int id);
//根据e_id删除我的娱乐视频多个
public void deleteE_videolistWithe_Id(int id);
//查找娱乐类型
public List<E_type> findtype();
//根据内容模糊查询娱乐并返回列表
public PageInfo<Entertainment> select_content_withAll_e(String con);
//根据娱乐内容查找相关视频并返回列表或单个值
public List<E_Video> select_e_v(List<Entertainment> entertainments);
//根据内容模糊查询娱乐视频并返回列表
public PageInfo<E_Video> select_content_withAll_v(String con);
}
| [
"1184045779@qq.com"
] | 1184045779@qq.com |
057c1fd2629e0a61b2289825df75f4d789ee9b47 | 0a06bf48e124005223804e6499ea681a1eb52d74 | /buildHuffmantree.java | 4e18b08d5153c2bab53b845288530954a961db8d | [] | no_license | ArtMalinowski/HuffmanEncoding | dbeb9261ae85d7be82412e50eca403ee81223220 | 7b5a347e1e920bd1f457610e30db68bf1b8dedb9 | refs/heads/master | 2020-06-10T06:34:39.033540 | 2016-12-09T16:44:58 | 2016-12-09T16:44:58 | 76,052,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,061 | java | import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;
public class buildHuffmantree {
static Scanner readText = new Scanner(System.in);
/**
* creating priorityQueue with my all nodes used HashMap with all characters and their quantity
* @param sorted_list
* @return
*/
public static PriorityQueue<MyHuffmanNode> creteQueue(HashMap<Character, Integer> Characters) {
// creating local comperator to compare all nodes in queue
PriorityQueue<MyHuffmanNode> priority_Queue = new PriorityQueue<MyHuffmanNode>(Characters.size(),
new Comparator<MyHuffmanNode>() {
@Override
public int compare(MyHuffmanNode n1, MyHuffmanNode n2) {
return n1.quantity - n2.quantity;
}
});
// add to my priority_Queue values by for each loop
for (Entry<Character, Integer> entry : Characters.entrySet()) {
// nodes children value are equal to null
MyHuffmanNode temp = new MyHuffmanNode((char) entry.getKey(), (int) entry.getValue(), null, null);
//adding to my priority_Queue
priority_Queue.add(temp);
}
// retrning priority_Queue with nodes
return priority_Queue;
}
/**
* create Hiffman tree whith all conection between parents and childrens
* @param priority_Queue
* @return
*/
public static MyHuffmanNode createHuffmanTree(PriorityQueue<MyHuffmanNode> priority_Queue) {
// check if priority_Queue is bigger than 1 because the last one we need to return as our root
while (priority_Queue.size() > 1) {
// taking from queue the smallest characters by poll from queue
MyHuffmanNode left = priority_Queue.poll();
MyHuffmanNode right = priority_Queue.poll();
// '\0' null in ASCII
// creating the parent node
MyHuffmanNode Huff_node = new MyHuffmanNode('\0', left.quantity + right.quantity, left, right);
priority_Queue.add(Huff_node);
}
// return root
return priority_Queue.poll();
}
/**
* ceate binnary code for my Huffman Coding and return it as a big Hashmap
* @param root
* @return
*/
private static HashMap<Character, String> madeCode(MyHuffmanNode root) {
HashMap<Character, String> decodedMessage = new HashMap<Character, String>();
findChar(root, decodedMessage, "");
return decodedMessage;
}
/**
* it find all nodes in my tree and add them 0 or 1 in deppendence of their possiton
* @param node
* @param decodedMessage
* @param huffCode
*/
private static void findChar(MyHuffmanNode node, HashMap<Character, String> decodedMessage, String huffCode) {
// check if it is leaf and if it is add to my hahMap as leaf
if (node.left == null & node.right == null)
decodedMessage.put(node.character, huffCode);
// check if left child node is not null and if he is not he will add 0 to the string of his code a
// and do again by recursive
if (node.left != null)
findChar(node.left, decodedMessage, huffCode + "0");
//the same as top one but for right chid node
if (node.right != null)
findChar(node.right, decodedMessage, huffCode + "1");
// if it is node parent it add it also to my tree
if ((node.left != null || node.right != null)) {
decodedMessage.put(node.character, huffCode);
// work in the same way as in leaf situatuion
if (node.left != null)
findChar(node.left, decodedMessage, huffCode + "0");
// work in the same way as in leaf situatuion
if (node.right != null)
findChar(node.right, decodedMessage, huffCode + "1");
}
}
/**
* count all nodes which we have in our tree also be revursive method
* @param tree
* @return
*/
public static int countNodes(MyHuffmanNode tree) {
int l, r;
if (tree == null)
return 0;
else
//add left nodes and right to calculate all nodes
l = countNodes(tree.left) + 1;
r = countNodes(tree.right) + 1;
// we minus 1 to have correct number of nodes
return (l + r)-1;
}
/**
* Calculate the height of my Hash Tree
* @param decodedMessage
* @return
*/
public static int heightOfTree(HashMap<Character, String> decodedMessage) {
int longest = 0;
for (Entry<Character, String> entryDecoded : decodedMessage.entrySet()) {
if (longest == 0)
longest = entryDecoded.getValue().length();
// check which in which way the tee is the longest
else if (entryDecoded.getValue().length() > longest)
longest = entryDecoded.getValue().length();
}
// add one because we need ad our root which is also part of height of tree
return longest;
}
/**
* this is my biggest fucntion which create all results for huffman coding system
* create Huffman code check how much memory we save, how many nodes , what is the height
* of tree and save file with result if you want
* @throws FileNotFoundException
* @throws UnsupportedEncodingException
*/
public static void compress() throws FileNotFoundException, UnsupportedEncodingException {
//create object which we will use to calucate things for Huffman Code
callcuation callcForHuff = new callcuation();
// calculate frequency of letter
HashMap<Character, Integer> char_freq_order = callcForHuff.frequencyOfLetter();
//create PQ whit our characters and their frequency
PriorityQueue<MyHuffmanNode> prioQ = creteQueue(char_freq_order);
// crete our tree
MyHuffmanNode root = createHuffmanTree(prioQ);
// claculate nubmer of characters to check if is the same as nubmer of vlaue of root
int numberOfCharacters = callcuation.numberOfCharacetrs(char_freq_order);
// check if is correct if not print error
if (root.quantity == numberOfCharacters) {
// Print the value of our root
System.out.println("the value of root at the end " + root.quantity);
HashMap<Character, String> decodedMessage = madeCode(root);
//Printing all results
System.out.println("Decoded Message in order by ASCII : ");
PrintWriter wrtieTextFile = new PrintWriter("decodedMessage", "ASCII");
int afterCompression = 0;
// print charcters coded by huffman also calculate size of new file
for (Entry<Character, String> entryDecoded : decodedMessage.entrySet()) {
for (Entry<Character, Integer> entryUncoded : char_freq_order.entrySet()) {
if (entryDecoded.getKey()==entryUncoded.getKey()){
afterCompression = afterCompression + (entryUncoded.getValue() * entryDecoded.getValue().length());
entryUncoded.setValue(0);
}
}
// there can be 2 coded character looking like space but they are new line carriage return
if (entryDecoded.getKey() != '\0') {
System.out.print("character = ");
wrtieTextFile.print("character = ");
System.out.println(entryDecoded.getKey());
wrtieTextFile.println(entryDecoded.getKey());
System.out.print("Coded Character = ");
wrtieTextFile.print("Coded Character = ");
System.out.println(entryDecoded.getValue());
wrtieTextFile.println(entryDecoded.getValue());
}
}
// calculate the huffman depth of tree
int y = 1;
for (Entry<Character, String> entryDecoded : decodedMessage.entrySet()) {
y += entryDecoded.getValue().length();
}
// printing more results need for project
System.out.println("\n\nBefore compression " + numberOfCharacters * 8);
System.out.println("After compression " + afterCompression);
// calculate how much we save memmory by using this method
float compression = ((float) numberOfCharacters * 8)/(float) afterCompression ;
System.out.println("We saved by compression " + compression);
System.out.println("The height of tree is " + heightOfTree(decodedMessage));
System.out.println("The nubmer of nodes " + countNodes(root));
System.out.println("The averge depth of nodes " + (float) y / countNodes(root));
// fucntion to save results in file
System.out.println("If you want to save result in file please enter s if not please enter anything");
String save = readText.nextLine();
if (save.toLowerCase().equals("s")) {
wrtieTextFile.println("The height of tree is " + heightOfTree(decodedMessage));
wrtieTextFile.println("The nubmer of nodes " + countNodes(root));
wrtieTextFile.println("The averge depth of nodes " + (float) y / countNodes(root));
wrtieTextFile.println("Before compression " + numberOfCharacters * 8);
wrtieTextFile.println("After compression " + afterCompression);
wrtieTextFile.println("We saved by compression " + compression + "%");
System.out.println("Save Done");
wrtieTextFile.close();
}
} else
System.out.println("Error nubmer Of character is not the same as the value of root");
}
}
| [
"noreply@github.com"
] | noreply@github.com |
b50e4ae87d6379cf882c5b99023f1619b11ee9f2 | 0459a7e4333d680a38c70d61997920212d78aff5 | /Other Platforms/3DR_Solo/3DRSoloHacks/3DRSoloHacks-master/src/com/MAVLink/enums/MAV_CMD_ACK.java | 83187332fd811245b666771b6876172043e6961f | [] | no_license | rcjetpilot/DJI-Hacking | 4c5b4936ca30d7542cbd440e99ef0401f8185ab9 | 316a8e92fdfbad685fe35216e1293d0a3b3067d8 | refs/heads/master | 2020-05-17T10:41:52.166389 | 2018-02-19T20:04:06 | 2018-02-19T20:04:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 198 | java | class
{
}
/* Location: /Users/kfinisterre/Desktop/Solo/3DRSoloHacks/unpacked_apk/classes_dex2jar.jar
* Qualified Name: com.MAVLink.enums.MAV_CMD_ACK
* JD-Core Version: 0.6.2
*/ | [
"jajunkmail32@gmail.com"
] | jajunkmail32@gmail.com |
bfb20a034c998aa091967e90b4e5cff5b55733be | 7e45baefe799a40afe9ca722beca278f30cfa7d9 | /src/com/fuel/advisor/ui/vehicle_info/VisuaFeedbackMap.java | 102c97ae45b59f267cd5128b02e4cdcd1d5e289b | [] | no_license | Lipegno/FuelConsumptionAdvisor | 181d48f8f152b1f391df3c1fb68bbead15cfe403 | ef5f77d399660af57a816591e12003b5abc048e7 | refs/heads/master | 2021-01-19T04:18:38.653147 | 2016-06-16T23:54:10 | 2016-06-16T23:54:10 | 61,333,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,071 | java | package com.fuel.advisor.ui.vehicle_info;
import java.util.Vector;
import android.app.Activity;
import android.graphics.BitmapFactory;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.Window;
import android.widget.Button;
import com.fuel.advisor.R;
import com.fuel.advisor.ui.vehicle_info.openGLStuff.OpenGLRenderer;
import com.fuel.advisor.ui.vehicle_info.openGLStuff.SimplePlane;
public class VisuaFeedbackMap extends Activity{
private static OpenGLRenderer _map_renderer;
private GLSurfaceView _map_view;
private Vector<SimplePlane> _backgroundElements;
private Button _zoomMinus;
private Button _zoomPlus;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
// this.setContentView(R.layout.visual_feedback_map);
SimplePlane map = new SimplePlane(4f,2f);
map.loadBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.trip_example2));
map.x=1.5f;
map.y=0.5f;
// _zoomMinus = (Button)findViewById(R.id.zoom_minus);
// _zoomPlus = (Button) findViewById(R.id.zoom_plus);
_zoomMinus.getBackground().setAlpha(160);
_zoomPlus.getBackground().setAlpha(160);
_map_renderer = new OpenGLRenderer();
_map_renderer._clearColor = new float[]{0.86f,0.86f,0.86f,1};
// _backgroundElements = buildBack();
for(int i=0;i<_backgroundElements.size();i++) // ads the background elements to the renderer
_map_renderer.addMesh(_backgroundElements.elementAt(i));
_map_renderer.addMesh(map); // ads the map to the renderer
_map_renderer._zoom = -1.5f;
// _map_view = (GLSurfaceView) findViewById(R.id.map_gl_view);
_map_view.setRenderer(_map_renderer);
_map_view.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
// _map_view.setOnTouchListener(this);
}
// /**
// * Builds the sprites to be used in the background of the map
// */
// public Vector<SimplePlane> buildBack(){
// Vector<SimplePlane> result = new Vector<SimplePlane>();
// float[] rgba= new float[]{0,0,0,0};
//
// SimplePlane temp = new SimplePlane(1,1);
// temp.x = -1.5f;
// temp.y =0.5f;
// rgba= calculatesColor(_sectionsCons[0]);
// temp.setColor(rgba[0],rgba[1],rgba[2],rgba[3]);
//
// SimplePlane temp2 = new SimplePlane(1,1);
// temp2.x = 1;
// temp2.y = 0;
// rgba= calculatesColor(_sectionsCons[1]);
// temp2.setColor(rgba[0],rgba[1],rgba[2],rgba[3]);
//
// SimplePlane temp3 = new SimplePlane(1,1);
// temp3.x = 1;
// temp3.y = 0;
// rgba= calculatesColor(_sectionsCons[2]);
// temp3.setColor(rgba[0],rgba[1],rgba[2],rgba[3]);
//
// SimplePlane temp4 = new SimplePlane(1,1);
// temp4.x = 1f;
// temp4.y = 0;
// rgba= calculatesColor(_sectionsCons[3]);
// temp4.setColor(rgba[0],rgba[1],rgba[2],rgba[3]);
//
// SimplePlane temp5 = new SimplePlane(1,1);
// temp5.x = 0;
// temp5.y = -1f;
// rgba= calculatesColor(_sectionsCons[4]);
// temp5.setColor(rgba[0],rgba[1],rgba[2],rgba[3]);
//
// SimplePlane temp6 = new SimplePlane(1,1);
// temp6.x = -1;
// temp6.y = 0;
// rgba= calculatesColor(_sectionsCons[5]);
// temp6.setColor(rgba[0],rgba[1],rgba[2],rgba[3]);
//
// SimplePlane temp7 = new SimplePlane(1,1);
// temp7.x = -1;
// temp7.y = 0;
// rgba= calculatesColor(_sectionsCons[6]);
// temp7.setColor(rgba[0],rgba[1],rgba[2],rgba[3]);
//
// SimplePlane temp8 = new SimplePlane(1,1);
// temp8.x = -1f;
// temp8.y = 0;
// rgba= calculatesColor(_sectionsCons[7]);
// temp8.setColor(rgba[0],rgba[1],rgba[2],rgba[3]);
//
// result.add(temp);
// result.add(temp2);
// result.add(temp3);
// result.add(temp4);
// result.add(temp5);
// result.add(temp6);
// result.add(temp7);
// result.add(temp8);
// populateLabels();
// return result;
// }
// /**
// * Build the presentation for the several information
// */
// public void populateLabels(){
// int val=0;
// for(int i=0;i<_sectionsCons.length;i++)
// val+=_sectionsCons[i];
// }
//
// public void handleButtonClick(View v){
//
// switch(v.getId()){
//
// case (R.id.finish_vehicle_info_aggregate):
// try {
// this.finalize();
// } catch (Throwable e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// this.finish();
// break;
//
// }
// }
// /**
// * Handles the click on the zoom buttons
// * @param v - the view that has been pressed
// */
// public void handleZoomClick(View v){
// float temp = _map_renderer._zoom;
// if(v.getId()==R.id.zoom_plus){
// _map_renderer._zoom= temp+.2f; // calls the zoom function of the renderer (performs a translation in the Z axis)
// _map_view.requestRender();
// }
// else{
// _map_renderer._zoom= temp-.2f; // calls the zoom function of the renderer (performs a translation in the Z axis)
// _map_view.requestRender();
// }
// float dz = 1.5f-(1.5f-_map_renderer._zoom);
// float var = (float) (dz*(Math.tan(Math.PI/4)));
// _pointRatio = Math.abs(2/var);
// Log.e(MODULE,""+_pointRatio);
// }
// /**
// * associates a click with a road section in the map to show info about it
// * @param screenX - x screen coordinates
// * @param screenY - y screen coordinates
// */
// public void handleMapClick(float screenX, float screenY, View v){
// int val=0;
// float ratio = 512f/_width;
// float x=((_width/2)+screenX-_glsViewOffset.x)*_pointRatio*ratio; // adjusts the points accordint to the transformation made to the map
// float y=(screenY+_glsViewOffset.y)*_pointRatio*ratio;
//
// Log.e(MODULE, "PointX"+x);
// Log.e(MODULE, "PointY"+y);
//
// if(x <( (1024/2)*_pointRatio)){
// if(x <( (1024/4)*_pointRatio)){
// if(y < ((1024/4)*_pointRatio))
// val=1;
// else
// val=5;
// }
// else{
// if(y < ((512/2)*_pointRatio))
// val=2;
// else
// val=6;
// }
// }
// else{
// if(x <( 3*(1024/4)*_pointRatio)){
// if(y<((1024/4)*_pointRatio))
// val=3;
// else
// val=7;
// }
// else{
// if(y < ((1024/4)*_pointRatio))
// val=4;
// else
// val=8;
// }
//
// }
// _clickedSection=val;
// }
//
// /**
// * Calcultes a color to display in the map according to the consumption of the vehicle
// * @param cons - consumption on the section
// * @return
// */
// public float[] calculatesColor(int cons){
//
// float[] rgba = new float[]{0,0,0,1};
// float max_cons = 40;
// if(cons >= max_cons*0.7){
// rgba[0] = (cons/max_cons);
// }
// if((max_cons*0.4 < cons) && (cons <max_cons*0.7)){
// rgba[0] = 1f;
// rgba[1] = 1.5f- (cons/max_cons);
// }
//
// if(cons<=max_cons*0.4) {
// rgba[0] = .4f;
// rgba[1] = 1-(cons/max_cons);
// }
// return rgba;
// }
//
//
// public void checkBorder(float x, float y){
// Log.e(MODULE,"ratio_ "+_pointRatio);
//
// if(_totalX<-1.3f*_pointRatio){
// _map_renderer.move(-(x - touchStart.x)/256,0);
// _totalX-=(x - touchStart.x)/256;
// _glsViewOffset.x-= x - touchStart.x;
// }
// if(_totalX>1.3f*_pointRatio){
// _map_renderer.move(-(x - touchStart.x)/256,0);
// _totalX-=(x - touchStart.x)/256;
// _glsViewOffset.x-= x - touchStart.x;
// }
// if(_totalY<-0.4f*_pointRatio){
// _map_renderer.move(0,-(touchStart.y-y)/256);
// _totalY-=(touchStart.y-y)/256;
// _glsViewOffset.y-= touchStart.y-y;
// }
// if(_totalY>0.4*_pointRatio){
// _map_renderer.move(0,-(touchStart.y-y)/256);
// _totalY-=(touchStart.y-y)/256;
// _glsViewOffset.y-= touchStart.y-y;
// }
//
// }
//
// /**
// * Handles the touches on the screen, its used to perform the scrolling of the map with the fingers
// */
// @Override
// public boolean onTouch(View v, MotionEvent event) {
// // TODO Auto-generated method stub
//
// switch (event.getAction()) {
// case MotionEvent.ACTION_MOVE:
// _map_renderer.move((event.getX() - touchStart.x)/256,(touchStart.y-event.getY())/256);
// _glsViewOffset.x+= event.getX() - touchStart.x;
// _glsViewOffset.y+= touchStart.y-event.getY();
// _totalX+=(event.getX() - touchStart.x)/256;
// _totalY+=(touchStart.y-event.getY())/256;
// checkBorder(event.getX(),event.getY());
// touchStart.set(event.getX(), event.getY());
// _map_view.requestRender();
// _lastTouchAction=MotionEvent.ACTION_MOVE;
// return true;
//
// case MotionEvent.ACTION_UP:
// if(_lastTouchAction==MotionEvent.ACTION_DOWN){
// new RoadSectionInfoPopup(v,"SECTION: "+_clickedSection,_sectionsCons[_clickedSection-1]+"","","");
// }
// return true;
//
// case MotionEvent.ACTION_DOWN:
// touchStart.set(event.getX(), event.getY());
// Log.e(MODULE,"aqui down "+event.getX()+" "+event.getY());
// handleMapClick(event.getX(),event.getY(),v);
// _lastTouchAction=MotionEvent.ACTION_DOWN;
// return true;
//
// default:
// return super.onTouchEvent(event);
// }
// }
}
| [
"filp3q@gmail.com"
] | filp3q@gmail.com |
99aeed274a71d9ba6b4e66f9c43d6518e8cbab64 | 5664354577e0aa8611121608040db57297a3d0ee | /src/test/java/com/edureka/ms/training/testing/MsTrainingTestingApplicationTests.java | e3fa90d09c50d924f63f09751274056bbf533215 | [] | no_license | sanjeevknex/ms-testing | 866fb9e2c89b08116a294697ec0f8ee2a733715a | 55fc9180830e9b765bd3c40e7077a1688f2a519a | refs/heads/master | 2020-03-22T15:04:42.922728 | 2018-07-09T03:45:30 | 2018-07-09T03:45:30 | 140,227,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 677 | java | package com.edureka.ms.training.testing;
import com.edureka.ms.training.testing.respository.BookingCommandRepository;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class MsTrainingTestingApplicationTests {
@Autowired
BookingCommandRepository bookingRepository;
@Test
public void contextLoads() {
Assertions.assertThat(bookingRepository).isNotNull();
}
}
| [
"sanjeev.singh1@olacabs.com"
] | sanjeev.singh1@olacabs.com |
ead2052083ff61e09ade7db93d286c05d09c31c4 | f3f1cfc361eb0b5880a26015819e29df4be9d04c | /atcrowdfunding07-member-parent/atcrowdfunding17-member-api/src/main/java/com/pdsu/wl/crowd/api/MySQLRemoteService.java | 9cf42f8e1104b1952c5c26f2b1df138445508171 | [] | no_license | weiliang1234/ShangChouWang | 66d02678983220c6fa10beea153f1ac8ec4bfda1 | e7d01def70482a0517b27503570d5440aea80885 | refs/heads/master | 2023-07-17T17:12:01.666120 | 2021-08-23T09:16:26 | 2021-08-23T09:16:26 | 395,512,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 769 | java | package com.pdsu.wl.crowd.api;
import com.pdsu.wl.crowd.entity.po.MemberPO;
import com.pdsu.wl.crowd.util.ResultEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author wl
* @Date 2021/8/15 15:38
*/
@FeignClient("ShangChouWang-crowd-mysql")
public interface MySQLRemoteService {
@RequestMapping("/get/memberPO/loginAcct/remote")
ResultEntity<MemberPO> getMemberPOLoginAcctRemote(@RequestParam("loginacct") String loginacct);
@RequestMapping("/save/member/remote")
public ResultEntity<String> saveMember(@RequestBody MemberPO memberPO);
}
| [
"2663107564@qq.com"
] | 2663107564@qq.com |
05197cc53214c6ed5673cfbdaff0c31c0c366f78 | dfaa6ce08c7e976a9e9c01eafc812b440180e69e | /src/main/java/net/chandol/study/mybatissample/repository/CityMapper.java | 710c9c7c8f8e4a1d618e14c2e192cd05c775af20 | [] | no_license | YeoHoonYun/mybatis-sample_mapper | 132a9da7301e2e50201b6a220bd236d43583d2de | 18e349b62d92c05c00126b1be01048276255c408 | refs/heads/master | 2020-05-21T05:22:05.059342 | 2019-05-10T04:53:17 | 2019-05-10T04:53:17 | 185,920,896 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 951 | java | package net.chandol.study.mybatissample.repository;
/**
* Created by cjswo9207u@gmail.com on 2019-02-22
* Github : https://github.com/YeoHoonYun
*/
import net.chandol.study.mybatissample.model.City;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import java.util.List;
@Mapper
@Component
public interface CityMapper {
@Select("SELECT ID,NAME, COUNTRY ,POPULATION FROM city WHERE ID = #{id}")
City selectCityById(@Param("id") Long id);
@Select("SELECT ID,NAME, COUNTRY ,POPULATION FROM city")
List<City> selectAllCity();
@Insert("INSERT INTO CITY (NAME, COUNTRY, POPULATION) VALUES (#{name}, #{country}, #{population})")
void insertCity(@Param("name") String name, @Param("country") String country, @Param("population") Long population);
}
| [
"cjswo9207@gmail.com"
] | cjswo9207@gmail.com |
54332b6fd607a587db27978262bd965d8d7c02ab | 7b17557651757fd5a2c6bfca6b1de5aa8e2c2d50 | /API/src/main/java/net/orekyuu/javatter/api/twitter/TweetBuilder.java | f0103a93c58461229357c02f3f50368d8e191691 | [] | no_license | orekyuu/JavaBeamStudio | fcba6bd45cc16dae4b91b7f6907844677eb767bf | a0f5ee2a8b3ae4719eba7d8c947060640b8de921 | refs/heads/master | 2021-01-18T22:30:16.941799 | 2015-07-03T11:20:17 | 2015-07-03T11:20:17 | 38,489,168 | 5 | 4 | null | 2016-06-23T03:13:23 | 2015-07-03T11:20:49 | Java | UTF-8 | Java | false | false | 1,329 | java | package net.orekyuu.javatter.api.twitter;
import net.orekyuu.javatter.api.twitter.model.Tweet;
import java.io.File;
/**
* ツイートを作成するためのビルダーです。
*
* @since 1.0.0
*/
public interface TweetBuilder {
/**
* 発言する内容を設定します。
*
* @param text 発現する文字列
* @return メソッドチェーンを行うためのthis
* @since 1.0.0
*/
TweetBuilder setText(String text);
/**
* ツイートにメディアを添付します。
*
* @param file 添付するファイル
* @return メソッドチェーンを行うためのthis
* @since 1.0.0
*/
TweetBuilder addFile(File file);
/**
* リプライ先を指定します。
*
* @param tweet リプライ先のツイート
* @return メソッドチェーンを行うためのthis
* @since 1.0.0
*/
TweetBuilder replyTo(Tweet tweet);
/**
* ツイートを非同期で行うTweetBuilderを返します。<br>
* 設定した内容は引き継がれます。
*
* @return ツイートを非同期で行うビルダー
* @since 1.0.0
*/
AsyncTweetBuilder setAsync();
/**
* ツイートを行います。<br>
*
* @since 1.0.0
*/
void tweet();
}
| [
"orekyuu@yahoo.co.jp"
] | orekyuu@yahoo.co.jp |
e6a172f797a325e8414b512fdaeab832f42e8747 | af43bdf53f77afa7ac40ebba51fded93fbaa637a | /src/main/java/com/efostach/hibernate/controller/SkillController.java | 1ff00146328cef33066c14abf0c38f2bc863469d | [] | no_license | efostach/hibernate-CRUD-app | 69a1cf6ca56609109b19e5db4de1a18924e68fc2 | 72c97c4175ee9292099a0b0c6b876fe9cc443202 | refs/heads/master | 2022-07-10T16:53:15.460433 | 2019-12-21T21:53:03 | 2019-12-21T21:53:03 | 225,570,201 | 1 | 0 | null | 2022-06-21T02:27:36 | 2019-12-03T08:38:16 | Java | UTF-8 | Java | false | false | 348 | java | package com.efostach.hibernate.controller;
import com.efostach.hibernate.model.Skill;
import com.efostach.hibernate.repository.hibernate.SkillRepoImpl;
import java.util.List;
public class SkillController {
private SkillRepoImpl ioSkill = new SkillRepoImpl();
public List<Skill> showSkills() {
return ioSkill.getAll();
}
}
| [
"elena.fostach@gmail.com"
] | elena.fostach@gmail.com |
5dc65bb3aa9113a28fb95971bdea494974972598 | a3d442d194ad759e3a9a0d6b1b4458c05737929c | /src/com/hibernate/demo/DeleteStudentDemo.java | b0a4ba5eec048b298819d98ceee3f2e093d11d90 | [] | no_license | avijit-ui/hibernate-crud-operation | f047dfda833199be5967f1ec1952b70b86e0e969 | 9be652dd12f322021020107035678ba6c29ba605 | refs/heads/master | 2023-03-29T11:21:56.230993 | 2021-04-08T01:45:29 | 2021-04-08T01:45:29 | 355,730,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,182 | java | package com.hibernate.demo;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.hibernate.demo.entity.Student;
import org.hibernate.HibernateException;
import org.hibernate.Session;
public class DeleteStudentDemo {
public static void main(String[] args) {
SessionFactory factory = new Configuration()
.configure("hibernate.cfg.xml")
.addAnnotatedClass(Student.class)
.buildSessionFactory();
Session session = factory.getCurrentSession();
try {
int studentId = 1;
session = factory.getCurrentSession();
session.beginTransaction();
System.out.println("\n Getting student with id:" + studentId);
Student mystudent = session.get(Student.class,studentId);
//System.out.println("Deleting student: " + mystudent);
//session.delete(mystudent);
System.out.println("Deleting student id=2");
session.createQuery("delete from Student where id=2").executeUpdate();
session.getTransaction().commit();
System.out.println("done");
}
finally {
factory.close();
}
}
}
| [
"avijit.batabyal@gmail.com"
] | avijit.batabyal@gmail.com |
263a53d9bf66ad19c0c7e73361a6be5a3e120625 | 7a08afcd0214c83e781b39d07efc91bc49236dc4 | /src/main/java/com/get/domain/InformationQuery.java | e8be110d89e071f486e78b1fd2506ccc73c99fd9 | [] | no_license | shanliangLS/WebCrawler | 804fd8fffb78027ca8fc5a1c24d6aa995fc9b9e6 | 9c5d6dddb7bdcaf60b30f2674868ed6f9e18d65a | refs/heads/master | 2023-01-31T16:35:52.849301 | 2020-12-30T07:13:29 | 2020-12-30T07:13:29 | 229,877,439 | 0 | 0 | null | 2023-01-05T03:36:12 | 2019-12-24T05:37:38 | JavaScript | UTF-8 | Java | false | false | 2,216 | java | //package com.get.domain;
//
//import java.util.List;
//
//public class InformationQuery {
// private Long id;
//
// private String title;
//
//
// private Long createTime;
//
//
// private String author;
//
//
// private String content;
//
//
// private String picture;
//
//
// private String url;
//
//
// private String time;
//
//
// private List<String> keyWords;
//
//
// private Long classes;
//
// //任务id
//
// private Long taskId;
//
// public Long getId() {
// return id;
// }
//
// public String getTitle() {
// return title;
// }
//
// public Long getCreateTime() {
// return createTime;
// }
//
// public String getAuthor() {
// return author;
// }
//
// public String getContent() {
// return content;
// }
//
// public String getPicture() {
// return picture;
// }
//
// public String getUrl() {
// return url;
// }
//
// public String getTime() {
// return time;
// }
//
// public List<String> getKeyWords() {
// return keyWords;
// }
//
// public Long getClasses() {
// return classes;
// }
//
// public Long getTaskId() {
// return taskId;
// }
//
//
// public void setId(Long id) {
// this.id = id;
// }
//
// public void setTitle(String title) {
// this.title = title;
// }
//
// public void setCreateTime(Long createTime) {
// this.createTime = createTime;
// }
//
// public void setAuthor(String author) {
// this.author = author;
// }
//
// public void setContent(String content) {
// this.content = content;
// }
//
// public void setPicture(String picture) {
// this.picture = picture;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public void setTime(String time) {
// this.time = time;
// }
//
// public void setKeyWords(List<String> keyWords) {
// this.keyWords = keyWords;
// }
//
// public void setClasses(Long classes) {
// this.classes = classes;
// }
//
// public void setTaskId(Long taskId) {
// this.taskId = taskId;
// }
//}
| [
"1187603543@qq.com"
] | 1187603543@qq.com |
87cc3e31502b2c82a78c75aa55f29733d3ab71d7 | 6a91c42e08844e91eb994d87aa838a9b27feab1e | /app/src/test/java/com/reige/bubbleview/ExampleUnitTest.java | 3db1559441abd816a3cb97b4b0b69d4cce84307c | [] | no_license | REIGE/BubbleView | 74ae37604020923b26552bb5b232b3b9abb54942 | 385ddf18b47bfc46b2f2b4a69923e488e729054b | refs/heads/master | 2021-01-22T22:57:54.143755 | 2017-03-20T15:35:04 | 2017-03-20T15:35:04 | 85,594,438 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package com.reige.bubbleview;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"407601459@qq.com"
] | 407601459@qq.com |
963c5e4523bc7fa9188d749d4cd0a2f9226d04c8 | d31e9bc9b78f6ec36ec23779276e9365aa2b52e1 | /zhy-frame-office/zhy-frame-office-word/src/main/java/com/zhy/frame/office/word/vo/WordTemplateVo.java | ef03db43c95f792c99898f4d53d776c2b14da887 | [] | no_license | radtek/zhy-frame-parent | f5f04b1392f1429a079281336d266692645aa2f5 | 05d5a0bb64fec915e027078313163822d849476c | refs/heads/master | 2022-12-27T22:27:12.682705 | 2020-07-27T02:58:46 | 2020-07-27T02:58:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,092 | java | package com.zhy.frame.office.word.vo;/**
* 描述:
* 包名:com.scltzhy.jwt.annotation
* 版本信息: 版本1.0
* 日期:2019/2/27
* Copyright 四川******科技有限公司
*/
import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.RenderData;
import com.deepoove.poi.data.TextRenderData;
import com.deepoove.poi.util.BytePictureUtils;
import com.zhy.frame.base.core.util.JsonUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @describe:
* @author: lvmoney /四川******科技有限公司
* @version:v1.0 2018年10月30日 下午3:29:38
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WordTemplateVo implements Serializable {
private static final long serialVersionUID = -2657163066871628154L;
private String source;
private String target;
private List<WordNumbericVo> numberic;
private List<WordPictureVo> picture;
private List<WordStringVo> str;
private List<WordTablesVo> table;
}
| [
"xmangl1990728"
] | xmangl1990728 |
a4598f0102b3fc9e88e605a026002545813842f0 | 0dc3d046f185c96522efd7a12c7ce624108fc87f | /core/src/main/java/vn/tnc/core/strictmode/PlatformImplementStrictMode.java | f52587a65b143415a50ad9a79cb6da48a0b4ea00 | [] | no_license | vudunguit/TNCFramework | db2fa7259b3391e371d468bbb2b6dd7a75af10f1 | 5d03361c0d49d95fe3dcc0f29753b1e9f1f3aa72 | refs/heads/master | 2021-05-29T02:48:12.051585 | 2015-06-17T05:34:16 | 2015-06-17T05:34:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package vn.tnc.core.strictmode;
/**
* Created by USER on 5/19/2015.
*/
public class PlatformImplementStrictMode {
public static IStrictMode getStrictMode(){
if(Platform.SUPPORTS_HONEYCOMB){
return new HoneycombStrictMode();
} else if(Platform.SUPPORTS_GINGERBREAD){
return new LegacyStrictMode();
} else{
return null;
}
}
}
| [
"loithe_1325@yahoo.com"
] | loithe_1325@yahoo.com |
37a679739cef2bccfe4d494603fd3d9c6e6a47b0 | 564bf77a866f40d748b1dc5e11f87140d7a8c9fb | /Effects/src/main/java/imagej/envisaje/effects/DimensionEditor.java | 5741246bf6b3905ddbe2b8ecfceed2a69703ce53 | [] | no_license | thediciman/envisaje | d64a886a6349cfb82d4a9985dfd167f0fc1560c4 | fc7a6903a964ae855dde05bacab1895e0f3545a9 | refs/heads/master | 2021-12-02T18:34:31.188349 | 2012-02-03T21:22:38 | 2012-02-03T21:23:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,493 | java | /*
* DimensionEditor.java
*
* Created on August 3, 2006, 10:53 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package imagej.envisaje.effects;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Insets;
import javax.swing.JComponent;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
/**
*
* @author Tim Boudreau
*/
public class DimensionEditor extends JComponent implements ChangeListener {
private JSpinner wid;
private JSpinner hi;
private ChangeListener listener;
public DimensionEditor() {
SpinnerNumberModel wmdl = new SpinnerNumberModel(3, 1, 120, 1);
SpinnerNumberModel hmdl = new SpinnerNumberModel(3, 1, 120, 1);
wid = new JSpinner (wmdl);
hi = new JSpinner (hmdl);
wid.addChangeListener(this);
hi.addChangeListener (this);
add (wid);
add (hi);
setOpaque(true);
setBackground (Color.YELLOW);
setMinimumSize (new Dimension(100, 20));
}
public void doLayout() {
Dimension hd = min (hi.getPreferredSize());
Dimension wd = min (hi.getPreferredSize());
int y = (getHeight() / 2) - (hd.width / 2);
int x = getInsets().left;
wid.setBounds (x, y, wd.width, wd.height);
hi.setBounds (x + hd.width + 5, y, hd.width, hd.height);
}
private Dimension min (Dimension d) {
d.width = Math.max (d.width, 40);
d.height = Math.max (d.height, 40);
return d;
}
public Dimension getPreferredSize() {
Insets ins = getInsets();
int woff = ins.left + ins.right;
int hoff = ins.top + ins.bottom;
Dimension hd = min (hi.getPreferredSize());
Dimension wd = min (hi.getPreferredSize());
Dimension result = new Dimension (
wd.width + woff + hd.width,
hd.height + hoff + wd.height);
return result;
}
public void stateChanged(ChangeEvent e) {
if (listener != null) {
listener.stateChanged(new ChangeEvent(this));
}
}
public Dimension getDimension() {
int w = ((Integer) wid.getValue()).intValue();
int h = ((Integer) hi.getValue()).intValue();
return new Dimension (w, h);
}
public void setChangeListener (ChangeListener l) {
this.listener = l;
}
}
| [
"gharris@mbl.edu"
] | gharris@mbl.edu |
7f3a4c773195b5ac778485e297a6503e554ebdcc | 64f0a73f1f35078d94b1bc229c1ce6e6de565a5f | /dataset/Top APKs Java Files/com.outfit7.gingersbirthdayfree-com-outfit7-talkingfriends-offers-OfferProvider.java | 7d5f2f6dfd6c4c8d261dfa23c79122d823376f52 | [
"MIT"
] | permissive | S2-group/mobilesoft-2020-iam-replication-package | 40d466184b995d7d0a9ae6e238f35ecfb249ccf0 | 600d790aaea7f1ca663d9c187df3c8760c63eacd | refs/heads/master | 2021-02-15T21:04:20.350121 | 2020-10-05T12:48:52 | 2020-10-05T12:48:52 | 244,930,541 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 55,439 | java | package com.outfit7.talkingfriends.offers;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.net.Uri.Builder;
import android.widget.Toast;
import com.outfit7.funnetworks.FunNetworks;
import com.outfit7.funnetworks.util.Log;
import com.outfit7.funnetworks.util.Logger;
import com.outfit7.funnetworks.util.NonObfuscatable;
import com.outfit7.funnetworks.util.Util;
import com.outfit7.repackaged.com.google.gson.Gson;
import com.outfit7.repackaged.com.google.gson.reflect.TypeToken;
import com.outfit7.talkingfriends.ad.AdManager;
import com.outfit7.talkingfriends.ad.BaseAdManager.AdManagerCallback;
import com.outfit7.talkingfriends.ad.O7AdInfo;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
public abstract class OfferProvider
{
public static final String BACKEND_SIGNATURE_KEY = "A7INQETRTPFDRG8QWQWA";
private static final int ICON_CACHE_SIZE = 100;
private static final String KEY_LAST_OFFER_CHECK = "lastOfferCheck";
private static final String KEY_LAST_OFFER_CLICK = "lastOfferClick";
private static final String LAST_INTERVAL_PASSED = "lastIntervalPassed";
private static final long MINIMAL_REWARD_CHECK_INTERVAL = 5000L;
private static final long OFFER_REQ_TIMEOUT_SECS = 30L;
private static final int[] REWARD_CHECK_INTERVALS = { 0, 1, 3, 5, 24, 48 };
private static final String TAG = "OfferProvider";
public static final String kEventOfferClicked = "offers_offerClicked";
public static final String kEventOffersNReceived = "offers_numOffersReceived";
public static final String kEventOffersProvider = "offers_offersProvider";
public static final String kEventOffersReceived = "offers_offersReceived";
public static final String kEventOffersReceivedNone = "offers_offersReceivedNone";
public static final String kEventOffersReceivedNoneTimeout = "offers_offersReceivedNoneTimeout";
public static final String kEventOffersRequested = "offers_offersRequested";
public static final String kEventRewardReceived = "offers_rewardReceived";
protected long CACHING_TIME = 120000L;
protected boolean canPreload;
protected int exchangeRateDenominator = 0;
protected boolean hasOwnUI;
private long lastRewardCheck;
protected Activity main = AdManager.getAdManagerCallback().getActivity();
protected int minPoints;
protected String providerID;
private Condition timeoutCond = this.timeoutLock.newCondition();
private Lock timeoutLock = new ReentrantLock();
private Toast toast;
public OfferProvider() {}
private List<Offer> checkOffers(String paramString)
{
return checkOffers(paramString, null);
}
/* Error */
private List<Offer> checkOffers(final String paramString, OfferListener paramOfferListener)
{
// Byte code:
// 0: new 8 com/outfit7/talkingfriends/offers/OfferProvider$1C
// 3: dup
// 4: aload_0
// 5: invokespecial 166 com/outfit7/talkingfriends/offers/OfferProvider$1C:<init> (Lcom/outfit7/talkingfriends/offers/OfferProvider;)V
// 8: astore_3
// 9: aload_0
// 10: getfield 114 com/outfit7/talkingfriends/offers/OfferProvider:timeoutLock Ljava/util/concurrent/locks/Lock;
// 13: invokeinterface 169 1 0
// 18: aload_2
// 19: ifnull +9 -> 28
// 22: aload_2
// 23: invokeinterface 172 1 0
// 28: new 11 com/outfit7/talkingfriends/offers/OfferProvider$2
// 31: dup
// 32: aload_0
// 33: aload_1
// 34: aload_3
// 35: invokespecial 175 com/outfit7/talkingfriends/offers/OfferProvider$2:<init> (Lcom/outfit7/talkingfriends/offers/OfferProvider;Ljava/lang/String;Lcom/outfit7/talkingfriends/offers/OfferProvider$1C;)V
// 38: invokevirtual 178 com/outfit7/talkingfriends/offers/OfferProvider$2:start ()V
// 41: aload_0
// 42: getfield 122 com/outfit7/talkingfriends/offers/OfferProvider:timeoutCond Ljava/util/concurrent/locks/Condition;
// 45: ldc2_w 51
// 48: getstatic 184 java/util/concurrent/TimeUnit:SECONDS Ljava/util/concurrent/TimeUnit;
// 51: invokeinterface 190 4 0
// 56: ifne +56 -> 112
// 59: aload_0
// 60: invokevirtual 194 com/outfit7/talkingfriends/offers/OfferProvider:getCountryCode ()Ljava/lang/String;
// 63: astore_1
// 64: invokestatic 130 com/outfit7/talkingfriends/ad/AdManager:getAdManagerCallback ()Lcom/outfit7/talkingfriends/ad/BaseAdManager$AdManagerCallback;
// 67: ldc 75
// 69: iconst_2
// 70: anewarray 4 java/lang/Object
// 73: dup
// 74: iconst_0
// 75: ldc 66
// 77: aastore
// 78: dup
// 79: iconst_1
// 80: new 196 java/lang/StringBuilder
// 83: dup
// 84: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 87: aload_0
// 88: getfield 199 com/outfit7/talkingfriends/offers/OfferProvider:providerID Ljava/lang/String;
// 91: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 94: ldc -51
// 96: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 99: aload_1
// 100: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 103: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 106: aastore
// 107: invokeinterface 212 3 0
// 112: aload_2
// 113: ifnull +13 -> 126
// 116: aload_2
// 117: aload_3
// 118: getfield 216 com/outfit7/talkingfriends/offers/OfferProvider$1C:offers Ljava/util/List;
// 121: invokeinterface 220 2 0
// 126: aload_0
// 127: getfield 114 com/outfit7/talkingfriends/offers/OfferProvider:timeoutLock Ljava/util/concurrent/locks/Lock;
// 130: invokeinterface 223 1 0
// 135: aload_3
// 136: getfield 216 com/outfit7/talkingfriends/offers/OfferProvider$1C:offers Ljava/util/List;
// 139: areturn
// 140: astore_1
// 141: aload_2
// 142: ifnull +13 -> 155
// 145: aload_2
// 146: aload_3
// 147: getfield 216 com/outfit7/talkingfriends/offers/OfferProvider$1C:offers Ljava/util/List;
// 150: invokeinterface 220 2 0
// 155: aload_0
// 156: getfield 114 com/outfit7/talkingfriends/offers/OfferProvider:timeoutLock Ljava/util/concurrent/locks/Lock;
// 159: invokeinterface 223 1 0
// 164: aload_1
// 165: athrow
// 166: astore_1
// 167: goto -55 -> 112
// Local variable table:
// start length slot name signature
// 0 170 0 this OfferProvider
// 0 170 1 paramString String
// 0 170 2 paramOfferListener OfferListener
// 8 139 3 local1C 1C
// Exception table:
// from to target type
// 22 28 140 finally
// 28 41 140 finally
// 41 112 140 finally
// 41 112 166 java/lang/InterruptedException
}
private void checkOffers010(String paramString, List<Offer> paramList)
{
if (this.providerID.equals("nooffers")) {
return;
}
long l1 = System.currentTimeMillis();
Object localObject1 = getSharedPreferences();
long l2 = ((SharedPreferences)localObject1).getLong("lastOfferUpdate", 0L);
Object localObject2 = ((SharedPreferences)localObject1).getString("lastProvider", "");
if ((l1 - l2 > this.CACHING_TIME) || (!((String)localObject2).equals(this.providerID)) || (AdManager.getAdManagerCallback().isInDebugMode()))
{
AdManager.getAdManagerCallback().logEvent("offers_offersRequested", new Object[] { "offers_offersProvider", this.providerID });
localObject2 = getCountryCode();
getOffers(paramString, paramList);
if (paramList.size() > 0)
{
AdManager.getAdManagerCallback().logEvent("offers_offersReceived", new Object[] { "offers_offersProvider", this.providerID, "offers_numOffersReceived", "" + paramList.size() });
try
{
cleanUpCache();
paramString = ((SharedPreferences)localObject1).edit();
paramString.putLong("lastOfferUpdate", l1);
paramString.putString("lastProvider", this.providerID);
paramString.putString("lastOffers", serialise(paramList));
paramString.commit();
return;
}
catch (Exception paramString)
{
Log.e("OfferProvider", "" + paramString, paramString);
return;
}
}
AdManager.getAdManagerCallback().logEvent("offers_offersReceivedNone", new Object[] { "offers_offersProvider", this.providerID + "-" + (String)localObject2 });
return;
}
localObject2 = deserialise(((SharedPreferences)localObject1).getString("lastOffers", ""));
if (localObject2 == null)
{
localObject1 = ((SharedPreferences)localObject1).edit();
((SharedPreferences.Editor)localObject1).putLong("lastOfferUpdate", 0L);
((SharedPreferences.Editor)localObject1).putString("lastProvider", this.providerID);
((SharedPreferences.Editor)localObject1).commit();
checkOffers010(paramString, paramList);
return;
}
paramList.addAll((Collection)localObject2);
}
private void cleanUpCache()
{
Object localObject = new File(this.main.getCacheDir(), ".offersImgCache");
if (!((File)localObject).exists()) {
break label25;
}
for (;;)
{
label25:
return;
if (((File)localObject).isDirectory())
{
localObject = ((File)localObject).listFiles();
if (localObject.length == 0) {
break;
}
Arrays.sort((Object[])localObject, new Comparator()
{
public int compare(File paramAnonymousFile1, File paramAnonymousFile2)
{
return (int)(paramAnonymousFile1.lastModified() - paramAnonymousFile2.lastModified());
}
public boolean equals(Object paramAnonymousObject)
{
return paramAnonymousObject == this;
}
});
int i = 0;
while (i < localObject.length - 100)
{
localObject[i].delete();
i += 1;
}
}
}
}
public static int getO7Points(String paramString1, String paramString2)
{
return getO7Points(paramString1, paramString2, null);
}
/* Error */
public static int getO7Points(String paramString1, String paramString2, String paramString3)
{
// Byte code:
// 0: invokestatic 130 com/outfit7/talkingfriends/ad/AdManager:getAdManagerCallback ()Lcom/outfit7/talkingfriends/ad/BaseAdManager$AdManagerCallback;
// 3: invokeinterface 136 1 0
// 8: astore 12
// 10: aload 12
// 12: invokestatic 363 com/outfit7/talkingfriends/ad/AdManager:getAdInfo (Landroid/content/Context;)Lcom/outfit7/talkingfriends/ad/O7AdInfo;
// 15: astore 11
// 17: aload 11
// 19: getfield 368 com/outfit7/talkingfriends/ad/O7AdInfo:canUse Z
// 22: ifne +5 -> 27
// 25: iconst_0
// 26: ireturn
// 27: new 370 org/apache/http/impl/client/DefaultHttpClient
// 30: dup
// 31: invokespecial 371 org/apache/http/impl/client/DefaultHttpClient:<init> ()V
// 34: astore 8
// 36: aload 12
// 38: invokestatic 377 com/outfit7/funnetworks/FunNetworks:getProperAuthorityURI (Landroid/content/Context;)Ljava/lang/String;
// 41: pop
// 42: new 379 android/net/Uri$Builder
// 45: dup
// 46: invokespecial 380 android/net/Uri$Builder:<init> ()V
// 49: astore 9
// 51: aload 9
// 53: ldc_w 382
// 56: invokevirtual 386 android/net/Uri$Builder:scheme (Ljava/lang/String;)Landroid/net/Uri$Builder;
// 59: pop
// 60: aload 9
// 62: aload 12
// 64: invokestatic 377 com/outfit7/funnetworks/FunNetworks:getProperAuthorityURI (Landroid/content/Context;)Ljava/lang/String;
// 67: invokevirtual 389 android/net/Uri$Builder:authority (Ljava/lang/String;)Landroid/net/Uri$Builder;
// 70: pop
// 71: aload 9
// 73: new 196 java/lang/StringBuilder
// 76: dup
// 77: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 80: ldc_w 391
// 83: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 86: aload_0
// 87: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 90: ldc_w 393
// 93: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 96: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 99: invokevirtual 396 android/net/Uri$Builder:path (Ljava/lang/String;)Landroid/net/Uri$Builder;
// 102: pop
// 103: new 398 java/util/ArrayList
// 106: dup
// 107: invokespecial 399 java/util/ArrayList:<init> ()V
// 110: astore 10
// 112: aload_2
// 113: astore 7
// 115: aload_2
// 116: ifnonnull +10 -> 126
// 119: aload 12
// 121: invokevirtual 402 android/app/Activity:getPackageName ()Ljava/lang/String;
// 124: astore 7
// 126: aload 10
// 128: iconst_2
// 129: anewarray 230 java/lang/String
// 132: dup
// 133: iconst_0
// 134: ldc_w 404
// 137: aastore
// 138: dup
// 139: iconst_1
// 140: aload 7
// 142: aastore
// 143: invokeinterface 407 2 0
// 148: pop
// 149: aload 10
// 151: iconst_2
// 152: anewarray 230 java/lang/String
// 155: dup
// 156: iconst_0
// 157: ldc_w 409
// 160: aastore
// 161: dup
// 162: iconst_1
// 163: aload_0
// 164: aastore
// 165: invokeinterface 407 2 0
// 170: pop
// 171: aload 11
// 173: getfield 412 com/outfit7/talkingfriends/ad/O7AdInfo:ID Ljava/lang/String;
// 176: ifnull +134 -> 310
// 179: iconst_2
// 180: anewarray 230 java/lang/String
// 183: astore_0
// 184: aload_0
// 185: iconst_0
// 186: ldc_w 414
// 189: aastore
// 190: aload_0
// 191: iconst_1
// 192: aload 11
// 194: getfield 412 com/outfit7/talkingfriends/ad/O7AdInfo:ID Ljava/lang/String;
// 197: aastore
// 198: aload 10
// 200: aload_0
// 201: invokeinterface 407 2 0
// 206: pop
// 207: new 196 java/lang/StringBuilder
// 210: dup
// 211: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 214: astore_0
// 215: aload 10
// 217: invokeinterface 418 1 0
// 222: astore_1
// 223: aload_1
// 224: invokeinterface 423 1 0
// 229: ifeq +99 -> 328
// 232: aload_1
// 233: invokeinterface 427 1 0
// 238: checkcast 429 [Ljava/lang/String;
// 241: astore_2
// 242: aload_0
// 243: aload_2
// 244: iconst_0
// 245: aaload
// 246: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 249: ldc_w 431
// 252: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 255: aload_2
// 256: iconst_1
// 257: aaload
// 258: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 261: ldc_w 433
// 264: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 267: pop
// 268: aload_2
// 269: iconst_0
// 270: aaload
// 271: ldc_w 409
// 274: invokevirtual 234 java/lang/String:equals (Ljava/lang/Object;)Z
// 277: ifne -54 -> 223
// 280: aload 9
// 282: aload_2
// 283: iconst_0
// 284: aaload
// 285: aload_2
// 286: iconst_1
// 287: aaload
// 288: invokevirtual 437 android/net/Uri$Builder:appendQueryParameter (Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri$Builder;
// 291: pop
// 292: goto -69 -> 223
// 295: astore_0
// 296: aload 8
// 298: invokeinterface 443 1 0
// 303: invokeinterface 448 1 0
// 308: aload_0
// 309: athrow
// 310: iconst_2
// 311: anewarray 230 java/lang/String
// 314: astore_0
// 315: aload_0
// 316: iconst_0
// 317: ldc_w 450
// 320: aastore
// 321: aload_0
// 322: iconst_1
// 323: aload_1
// 324: aastore
// 325: goto -127 -> 198
// 328: aload_0
// 329: ldc 33
// 331: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 334: pop
// 335: ldc_w 452
// 338: new 196 java/lang/StringBuilder
// 341: dup
// 342: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 345: ldc_w 454
// 348: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 351: aload_0
// 352: invokevirtual 305 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 355: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 358: invokestatic 460 com/outfit7/funnetworks/util/Logger:debug (Ljava/lang/String;Ljava/lang/String;)V
// 361: ldc_w 462
// 364: invokestatic 468 java/security/MessageDigest:getInstance (Ljava/lang/String;)Ljava/security/MessageDigest;
// 367: astore_1
// 368: aload_1
// 369: aload_0
// 370: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 373: invokevirtual 472 java/lang/String:getBytes ()[B
// 376: invokevirtual 476 java/security/MessageDigest:update ([B)V
// 379: aload 9
// 381: ldc_w 478
// 384: aload_1
// 385: invokevirtual 481 java/security/MessageDigest:digest ()[B
// 388: invokestatic 487 com/outfit7/funnetworks/util/Util:convToHex ([B)Ljava/lang/String;
// 391: invokevirtual 437 android/net/Uri$Builder:appendQueryParameter (Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri$Builder;
// 394: pop
// 395: iconst_0
// 396: istore 6
// 398: iconst_0
// 399: istore 5
// 401: new 489 org/apache/http/client/methods/HttpGet
// 404: dup
// 405: aload 9
// 407: invokevirtual 493 android/net/Uri$Builder:build ()Landroid/net/Uri;
// 410: invokevirtual 496 android/net/Uri:toString ()Ljava/lang/String;
// 413: invokespecial 499 org/apache/http/client/methods/HttpGet:<init> (Ljava/lang/String;)V
// 416: astore_0
// 417: ldc_w 452
// 420: new 196 java/lang/StringBuilder
// 423: dup
// 424: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 427: ldc_w 501
// 430: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 433: aload_0
// 434: invokeinterface 507 1 0
// 439: invokevirtual 305 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 442: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 445: invokestatic 460 com/outfit7/funnetworks/util/Logger:debug (Ljava/lang/String;Ljava/lang/String;)V
// 448: iload 6
// 450: istore_3
// 451: aload 8
// 453: aload_0
// 454: invokeinterface 511 2 0
// 459: astore_0
// 460: iload 6
// 462: istore_3
// 463: aload_0
// 464: invokeinterface 517 1 0
// 469: astore_1
// 470: iload 6
// 472: istore_3
// 473: ldc_w 452
// 476: new 196 java/lang/StringBuilder
// 479: dup
// 480: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 483: ldc_w 519
// 486: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 489: aload_1
// 490: invokevirtual 305 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 493: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 496: invokestatic 460 com/outfit7/funnetworks/util/Logger:debug (Ljava/lang/String;Ljava/lang/String;)V
// 499: iload 6
// 501: istore_3
// 502: aload_1
// 503: invokeinterface 524 1 0
// 508: istore 4
// 510: iload 4
// 512: sipush 200
// 515: if_icmpeq +47 -> 562
// 518: aload 8
// 520: invokeinterface 443 1 0
// 525: invokeinterface 448 1 0
// 530: iconst_0
// 531: ireturn
// 532: astore_0
// 533: ldc 57
// 535: new 196 java/lang/StringBuilder
// 538: dup
// 539: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 542: ldc_w 256
// 545: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 548: aload_0
// 549: invokevirtual 305 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 552: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 555: aload_0
// 556: invokestatic 311 com/outfit7/funnetworks/util/Log:e (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
// 559: goto -164 -> 395
// 562: iload 6
// 564: istore_3
// 565: aload_0
// 566: invokeinterface 528 1 0
// 571: astore_0
// 572: aload_0
// 573: ifnonnull +17 -> 590
// 576: aload 8
// 578: invokeinterface 443 1 0
// 583: invokeinterface 448 1 0
// 588: iconst_0
// 589: ireturn
// 590: aload_0
// 591: ldc_w 530
// 594: invokestatic 535 org/apache/http/util/EntityUtils:toString (Lorg/apache/http/HttpEntity;Ljava/lang/String;)Ljava/lang/String;
// 597: astore_1
// 598: ldc_w 452
// 601: new 196 java/lang/StringBuilder
// 604: dup
// 605: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 608: ldc_w 537
// 611: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 614: aload_1
// 615: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 618: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 621: invokestatic 460 com/outfit7/funnetworks/util/Logger:debug (Ljava/lang/String;Ljava/lang/String;)V
// 624: new 539 com/outfit7/repackaged/com/google/gson/Gson
// 627: dup
// 628: invokespecial 540 com/outfit7/repackaged/com/google/gson/Gson:<init> ()V
// 631: aload_1
// 632: ldc 22
// 634: invokevirtual 544 com/outfit7/repackaged/com/google/gson/Gson:fromJson (Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
// 637: checkcast 22 com/outfit7/talkingfriends/offers/OfferProvider$O7JSONResponse
// 640: getfield 547 com/outfit7/talkingfriends/offers/OfferProvider$O7JSONResponse:points I
// 643: istore 4
// 645: iload 4
// 647: istore_3
// 648: aload_0
// 649: invokeinterface 552 1 0
// 654: iload 4
// 656: istore_3
// 657: aload 8
// 659: invokeinterface 443 1 0
// 664: invokeinterface 448 1 0
// 669: iload_3
// 670: ireturn
// 671: astore_1
// 672: ldc 57
// 674: new 196 java/lang/StringBuilder
// 677: dup
// 678: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 681: ldc_w 256
// 684: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 687: aload_1
// 688: invokevirtual 305 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 691: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 694: aload_1
// 695: invokestatic 311 com/outfit7/funnetworks/util/Log:e (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
// 698: iload 6
// 700: istore_3
// 701: aload_0
// 702: invokeinterface 552 1 0
// 707: iload 5
// 709: istore_3
// 710: goto -53 -> 657
// 713: astore_0
// 714: ldc 57
// 716: new 196 java/lang/StringBuilder
// 719: dup
// 720: invokespecial 197 java/lang/StringBuilder:<init> ()V
// 723: ldc_w 256
// 726: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 729: aload_0
// 730: invokevirtual 305 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 733: invokevirtual 208 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 736: aload_0
// 737: invokestatic 311 com/outfit7/funnetworks/util/Log:e (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
// 740: goto -83 -> 657
// 743: astore_1
// 744: iload 6
// 746: istore_3
// 747: aload_0
// 748: invokeinterface 552 1 0
// 753: iload 6
// 755: istore_3
// 756: aload_1
// 757: athrow
// Local variable table:
// start length slot name signature
// 0 758 0 paramString1 String
// 0 758 1 paramString2 String
// 0 758 2 paramString3 String
// 450 306 3 i int
// 508 147 4 j int
// 399 309 5 k int
// 396 358 6 m int
// 113 28 7 str String
// 34 624 8 localDefaultHttpClient DefaultHttpClient
// 49 357 9 localBuilder Uri.Builder
// 110 106 10 localArrayList ArrayList
// 15 178 11 localO7AdInfo O7AdInfo
// 8 112 12 localActivity Activity
// Exception table:
// from to target type
// 36 112 295 finally
// 119 126 295 finally
// 126 184 295 finally
// 190 198 295 finally
// 198 223 295 finally
// 223 292 295 finally
// 310 315 295 finally
// 328 361 295 finally
// 361 395 295 finally
// 401 448 295 finally
// 451 460 295 finally
// 463 470 295 finally
// 473 499 295 finally
// 502 510 295 finally
// 533 559 295 finally
// 565 572 295 finally
// 648 654 295 finally
// 701 707 295 finally
// 714 740 295 finally
// 747 753 295 finally
// 756 758 295 finally
// 361 395 532 java/security/NoSuchAlgorithmException
// 590 645 671 java/lang/Exception
// 451 460 713 java/lang/Exception
// 463 470 713 java/lang/Exception
// 473 499 713 java/lang/Exception
// 502 510 713 java/lang/Exception
// 565 572 713 java/lang/Exception
// 648 654 713 java/lang/Exception
// 701 707 713 java/lang/Exception
// 747 753 713 java/lang/Exception
// 756 758 713 java/lang/Exception
// 590 645 743 finally
// 672 698 743 finally
}
private SharedPreferences getSharedPreferences()
{
return this.main.getSharedPreferences("offers", 0);
}
public static boolean isInTestMode()
{
return AdManager.getAdManagerCallback().getAdManager().runAdsInTestMode();
}
private void showMsg(final String paramString)
{
if (!AdManager.getAdManagerCallback().isInDebugMode()) {
return;
}
new StringBuilder().append("Offers: ").append(paramString).toString();
AdManager.getAdManagerCallback().getActivity().runOnUiThread(new Runnable()
{
public void run()
{
if (OfferProvider.this.toast == null)
{
OfferProvider.access$002(OfferProvider.this, Toast.makeText(OfferProvider.this.main.getApplicationContext(), "", 0));
OfferProvider.this.toast.setGravity(17, 0, 0);
}
OfferProvider.this.toast.setText(paramString);
OfferProvider.this.toast.show();
}
});
}
public static boolean spendO7Points(int paramInt, String paramString1, String paramString2)
{
return spendO7Points(paramInt, paramString1, paramString2, null);
}
public static boolean spendO7Points(int paramInt, String paramString1, String paramString2, String paramString3)
{
Activity localActivity = AdManager.getAdManagerCallback().getActivity();
O7AdInfo localO7AdInfo = AdManager.getAdInfo(localActivity);
if (!localO7AdInfo.canUse) {
return false;
}
DefaultHttpClient localDefaultHttpClient = new DefaultHttpClient();
int i;
if (paramInt == Integer.MAX_VALUE) {
i = 1;
}
Uri.Builder localBuilder;
for (;;)
{
try
{
FunNetworks.getProperAuthorityURI(localActivity);
localBuilder = new Uri.Builder();
localBuilder.scheme("http");
localBuilder.authority(FunNetworks.getProperAuthorityURI(localActivity));
if (i == 0) {
break label381;
}
str = "/clear-points";
localBuilder.path("rest/talkingFriends/v1/offers/" + paramString1 + str);
ArrayList localArrayList = new ArrayList();
str = paramString3;
if (paramString3 == null) {
str = localActivity.getPackageName();
}
localArrayList.add(new String[] { "app", str });
if (i == 0) {
localArrayList.add(new String[] { "points", "" + paramInt });
}
localArrayList.add(new String[] { "provider", paramString1 });
if (localO7AdInfo.ID == null) {
break label389;
}
paramString1 = new String[2];
paramString1[0] = "aaid";
paramString1[1] = localO7AdInfo.ID;
localArrayList.add(paramString1);
paramString1 = new StringBuilder();
paramString2 = localArrayList.iterator();
if (!paramString2.hasNext()) {
break;
}
paramString3 = (String[])paramString2.next();
paramString1.append(paramString3[0]).append("=").append(paramString3[1]).append("&");
if (paramString3[0].equals("provider")) {
continue;
}
localBuilder.appendQueryParameter(paramString3[0], paramString3[1]);
continue;
i = 0;
}
finally
{
localDefaultHttpClient.getConnectionManager().shutdown();
}
continue;
label381:
String str = "/spend-points";
continue;
label389:
paramString1 = new String[2];
paramString1[0] = "udid";
paramString1[1] = paramString2;
}
paramString1.append("A7INQETRTPFDRG8QWQWA");
Logger.debug("==500==", "sb = " + paramString1);
try
{
paramString2 = MessageDigest.getInstance("SHA1");
paramString2.update(paramString1.toString().getBytes());
localBuilder.appendQueryParameter("s", Util.convToHex(paramString2.digest()));
paramString1 = new HttpGet(localBuilder.build().toString());
Logger.debug("==500==", "request = " + paramString1.getURI());
}
catch (NoSuchAlgorithmException paramString1)
{
try
{
for (;;)
{
paramString1 = localDefaultHttpClient.execute(paramString1);
paramString2 = paramString1.getStatusLine();
Logger.debug("==500==", "statusLine = " + paramString2);
if (paramString2.getStatusCode() == 200) {
break;
}
Logger.error("OfferProvider", "Status code is not 200, returning");
localDefaultHttpClient.getConnectionManager().shutdown();
return false;
paramString1 = paramString1;
Logger.error("OfferProvider", "" + paramString1, paramString1);
}
paramString1 = paramString1.getEntity();
if (paramString1 == null)
{
localDefaultHttpClient.getConnectionManager().shutdown();
return true;
}
try
{
EntityUtils.toString(paramString1, "UTF-8");
paramString1.consumeContent();
localDefaultHttpClient.getConnectionManager().shutdown();
return true;
}
finally
{
paramString1.consumeContent();
}
return false;
}
catch (IOException paramString1)
{
Log.e("OfferProvider", "" + paramString1, paramString1);
localDefaultHttpClient.getConnectionManager().shutdown();
}
}
}
boolean canCheckReward()
{
Logger.debug("OfferProvider", "canCheckReward()");
long l2 = System.currentTimeMillis();
if (l2 - this.lastRewardCheck < 5000L) {
return false;
}
SharedPreferences localSharedPreferences = getSharedPreferences();
long l1 = localSharedPreferences.getLong("lastOfferClick", -1L);
int i = localSharedPreferences.getInt("lastIntervalPassed", 0);
StringBuilder localStringBuilder = new StringBuilder().append("lastOfferClickTime: ");
if (l1 == -1L) {}
for (Object localObject = " never";; localObject = new Date(l1))
{
Logger.debug("OfferProvider", localObject);
if (l1 != -1L) {
break;
}
return false;
}
Logger.debug("OfferProvider", "rewardCheckIntervalIndex: " + i);
Logger.debug("OfferProvider", " CurrentTime: " + new Date());
if (i >= REWARD_CHECK_INTERVALS.length)
{
Logger.debug("OfferProvider", "The reward was not received after " + REWARD_CHECK_INTERVALS[(REWARD_CHECK_INTERVALS.length - 1)] + " hours");
localSharedPreferences.edit().remove("lastOfferClick").commit();
return false;
}
Logger.debug("OfferProvider", "seconds: " + REWARD_CHECK_INTERVALS[i]);
if (l2 - l1 < 3600000 * REWARD_CHECK_INTERVALS[i])
{
Logger.debug("OfferProvider", "less than " + REWARD_CHECK_INTERVALS[i] + "hours have passed since the offer click, checking will take place again at " + new Date(3600000 * REWARD_CHECK_INTERVALS[i] + l1));
return false;
}
long l3 = localSharedPreferences.getLong("lastOfferCheck", l2);
if (i == 0) {}
for (l1 = 3600000L;; l1 = 900000L)
{
Logger.debug("OfferProvider", " lastCheckTime: " + new Date(l3) + " rewardCheckTime: " + l1 / 60000L);
if (l2 - l3 <= l1) {
break;
}
Logger.debug("OfferProvider", "more than " + l1 / 60000L + " minutes have passed, go to next waiting interval");
localSharedPreferences.edit().putInt("lastIntervalPassed", i + 1).commit();
localSharedPreferences.edit().remove("lastOfferCheck").commit();
return false;
}
Logger.debug("OfferProvider", "CHECK = TRUE");
if (!localSharedPreferences.contains("lastOfferCheck")) {
localSharedPreferences.edit().putLong("lastOfferCheck", l2).commit();
}
this.lastRewardCheck = l2;
return true;
}
public boolean canPreload()
{
return this.canPreload;
}
void checkRewards()
{
int i = getPoints();
AdManager.getAdManagerCallback().gotPoints(this, i);
if (i > 0)
{
Logger.debug("OfferProvider", "got reward, no longer checking BE for reward");
getSharedPreferences().edit().remove("lastOfferClick").commit();
}
}
public void clearCache()
{
SharedPreferences.Editor localEditor = getSharedPreferences().edit();
localEditor.putLong("lastOfferUpdate", 0L);
localEditor.commit();
}
protected List<Offer> deserialise(String paramString)
{
(List)new Gson().fromJson(paramString, new TypeToken() {}.getType());
}
public void finish() {}
protected String getCountryCode()
{
Object localObject1 = null;
try
{
localObject2 = (JSONResponse)Util.JSONToObj(AdManager.getAdManagerCallback().getActivity(), "jsonResponse", JSONResponse.class);
localObject1 = localObject2;
}
catch (IOException localIOException)
{
Object localObject2;
for (;;) {}
}
localObject2 = localObject1;
if (localObject1 == null) {
localObject2 = new JSONResponse();
}
return ((JSONResponse)localObject2).clientCountryCode;
}
public int getMinPoints()
{
return this.minPoints;
}
protected abstract void getOffers(String paramString, List<Offer> paramList);
protected int getPoints()
{
return getO7Points(getProviderID(), getUserID());
}
public String getProviderID()
{
return this.providerID;
}
protected String getUserID()
{
return Util.getUniqueUserID(this.main);
}
public boolean hasOwnUI()
{
return this.hasOwnUI;
}
protected boolean isPackageInstalled(String paramString)
{
boolean bool2 = false;
Iterator localIterator = AdManager.getAdManagerCallback().getActivity().getPackageManager().getInstalledPackages(0).iterator();
do
{
bool1 = bool2;
if (!localIterator.hasNext()) {
break;
}
} while (!((PackageInfo)localIterator.next()).packageName.equals(paramString));
boolean bool1 = true;
return bool1;
}
public List<Offer> loadOffers(String paramString, OfferListener paramOfferListener)
{
showMsg("Load offers for " + this.providerID);
paramString = checkOffers(paramString, paramOfferListener);
showMsg("Got " + paramString.size() + " offers for " + this.providerID);
return paramString;
}
public void onResume() {}
public void release() {}
protected String serialise(List<Offer> paramList)
{
new Gson().toJson(paramList, new TypeToken() {}.getType());
}
void setExchangeRateDenominator(int paramInt)
{
this.exchangeRateDenominator = paramInt;
}
public void setMinPoints(int paramInt)
{
this.minPoints = paramInt;
}
public boolean shouldCloseOffers()
{
return true;
}
public void spendPoints(int paramInt)
{
clearCache();
spendO7Points(paramInt, getProviderID(), getUserID());
}
public void startOffer(Offer paramOffer)
{
AdManager.getAdManagerCallback().logEvent("offers_offerClicked", new Object[] { "offers_offersProvider", this.providerID });
paramOffer = getSharedPreferences();
if (paramOffer.contains("lastOfferClick")) {
paramOffer.edit().remove("lastOfferClick").commit();
}
if (paramOffer.contains("lastIntervalPassed")) {
paramOffer.edit().remove("lastIntervalPassed").commit();
}
if (paramOffer.contains("lastOfferCheck")) {
paramOffer.edit().remove("lastOfferCheck").commit();
}
paramOffer.edit().putLong("lastOfferClick", System.currentTimeMillis()).commit();
this.lastRewardCheck = 0L;
}
public void startSession() {}
public boolean startUI()
{
return false;
}
public String toString()
{
return this.providerID;
}
public boolean usePointsDivisor()
{
return true;
}
public static class JSONResponse
{
public String clientCountryCode = "";
public JSONResponse() {}
}
private static class O7JSONResponse
implements NonObfuscatable
{
int points;
private O7JSONResponse() {}
}
public static class Offer
implements NonObfuscatable
{
private transient Object downloadMonitor = new Object();
public String link;
public int points;
public String requiredAction;
public String thumbFile;
public String thumbLink;
public String title;
public Offer() {}
/* Error */
private void cacheImg(byte[] paramArrayOfByte)
{
// Byte code:
// 0: aload_0
// 1: monitorenter
// 2: new 32 java/io/File
// 5: dup
// 6: invokestatic 38 com/outfit7/talkingfriends/ad/AdManager:getAdManagerCallback ()Lcom/outfit7/talkingfriends/ad/BaseAdManager$AdManagerCallback;
// 9: invokeinterface 44 1 0
// 14: invokevirtual 50 android/app/Activity:getCacheDir ()Ljava/io/File;
// 17: ldc 52
// 19: invokespecial 55 java/io/File:<init> (Ljava/io/File;Ljava/lang/String;)V
// 22: astore_3
// 23: aload_3
// 24: invokevirtual 59 java/io/File:exists ()Z
// 27: ifne +8 -> 35
// 30: aload_3
// 31: invokevirtual 62 java/io/File:mkdirs ()Z
// 34: pop
// 35: aload_3
// 36: invokevirtual 65 java/io/File:isDirectory ()Z
// 39: istore_2
// 40: iload_2
// 41: ifne +6 -> 47
// 44: aload_0
// 45: monitorexit
// 46: return
// 47: new 32 java/io/File
// 50: dup
// 51: aload_3
// 52: aload_0
// 53: aload_0
// 54: getfield 67 com/outfit7/talkingfriends/offers/OfferProvider$Offer:thumbLink Ljava/lang/String;
// 57: invokespecial 71 com/outfit7/talkingfriends/offers/OfferProvider$Offer:md5 (Ljava/lang/String;)Ljava/lang/String;
// 60: invokespecial 55 java/io/File:<init> (Ljava/io/File;Ljava/lang/String;)V
// 63: astore_3
// 64: new 73 java/io/BufferedOutputStream
// 67: dup
// 68: new 75 java/io/FileOutputStream
// 71: dup
// 72: aload_3
// 73: invokespecial 78 java/io/FileOutputStream:<init> (Ljava/io/File;)V
// 76: invokespecial 81 java/io/BufferedOutputStream:<init> (Ljava/io/OutputStream;)V
// 79: astore_3
// 80: aload_3
// 81: aload_1
// 82: invokevirtual 86 java/io/OutputStream:write ([B)V
// 85: aload_3
// 86: invokevirtual 89 java/io/OutputStream:close ()V
// 89: goto -45 -> 44
// 92: astore_1
// 93: ldc 91
// 95: new 93 java/lang/StringBuilder
// 98: dup
// 99: invokespecial 94 java/lang/StringBuilder:<init> ()V
// 102: ldc 96
// 104: invokevirtual 100 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 107: aload_1
// 108: invokevirtual 103 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 111: invokevirtual 107 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 114: aload_1
// 115: invokestatic 113 com/outfit7/funnetworks/util/Logger:error (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
// 118: goto -74 -> 44
// 121: astore_1
// 122: aload_0
// 123: monitorexit
// 124: aload_1
// 125: athrow
// 126: astore_1
// 127: ldc 91
// 129: new 93 java/lang/StringBuilder
// 132: dup
// 133: invokespecial 94 java/lang/StringBuilder:<init> ()V
// 136: ldc 96
// 138: invokevirtual 100 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 141: aload_1
// 142: invokevirtual 103 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 145: invokevirtual 107 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 148: aload_1
// 149: invokestatic 113 com/outfit7/funnetworks/util/Logger:error (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
// 152: aload_3
// 153: invokevirtual 89 java/io/OutputStream:close ()V
// 156: goto -112 -> 44
// 159: astore_1
// 160: aload_3
// 161: invokevirtual 89 java/io/OutputStream:close ()V
// 164: aload_1
// 165: athrow
// Local variable table:
// start length slot name signature
// 0 166 0 this Offer
// 0 166 1 paramArrayOfByte byte[]
// 39 2 2 bool boolean
// 22 139 3 localObject Object
// Exception table:
// from to target type
// 64 80 92 java/lang/Exception
// 85 89 92 java/lang/Exception
// 152 156 92 java/lang/Exception
// 160 166 92 java/lang/Exception
// 2 35 121 finally
// 35 40 121 finally
// 47 64 121 finally
// 64 80 121 finally
// 85 89 121 finally
// 93 118 121 finally
// 152 156 121 finally
// 160 166 121 finally
// 80 85 126 java/lang/Exception
// 80 85 159 finally
// 127 152 159 finally
}
private byte[] downloadBitmap()
{
DefaultHttpClient localDefaultHttpClient = new DefaultHttpClient();
try
{
localObject1 = new HttpGet(this.thumbLink);
}
catch (Exception localException1) {}finally
{
Object localObject1;
int i;
Object localObject2;
ByteArrayOutputStream localByteArrayOutputStream;
localDefaultHttpClient.getConnectionManager().shutdown();
}
}
/* Error */
private byte[] getCachedImg()
{
// Byte code:
// 0: aconst_null
// 1: astore 6
// 3: aload_0
// 4: monitorenter
// 5: new 32 java/io/File
// 8: dup
// 9: invokestatic 38 com/outfit7/talkingfriends/ad/AdManager:getAdManagerCallback ()Lcom/outfit7/talkingfriends/ad/BaseAdManager$AdManagerCallback;
// 12: invokeinterface 44 1 0
// 17: invokevirtual 50 android/app/Activity:getCacheDir ()Ljava/io/File;
// 20: ldc 52
// 22: invokespecial 55 java/io/File:<init> (Ljava/io/File;Ljava/lang/String;)V
// 25: astore 7
// 27: aload 7
// 29: invokevirtual 59 java/io/File:exists ()Z
// 32: istore 4
// 34: iload 4
// 36: ifne +12 -> 48
// 39: aload 6
// 41: astore 5
// 43: aload_0
// 44: monitorexit
// 45: aload 5
// 47: areturn
// 48: aload 6
// 50: astore 5
// 52: aload 7
// 54: invokevirtual 65 java/io/File:isDirectory ()Z
// 57: ifeq -14 -> 43
// 60: new 32 java/io/File
// 63: dup
// 64: aload 7
// 66: aload_0
// 67: aload_0
// 68: getfield 67 com/outfit7/talkingfriends/offers/OfferProvider$Offer:thumbLink Ljava/lang/String;
// 71: invokespecial 71 com/outfit7/talkingfriends/offers/OfferProvider$Offer:md5 (Ljava/lang/String;)Ljava/lang/String;
// 74: invokespecial 55 java/io/File:<init> (Ljava/io/File;Ljava/lang/String;)V
// 77: astore 8
// 79: aload 8
// 81: invokevirtual 59 java/io/File:exists ()Z
// 84: istore 4
// 86: aload 6
// 88: astore 5
// 90: iload 4
// 92: ifeq -49 -> 43
// 95: aconst_null
// 96: astore 6
// 98: aconst_null
// 99: astore 7
// 101: aconst_null
// 102: astore 5
// 104: new 196 java/io/BufferedInputStream
// 107: dup
// 108: new 198 java/io/FileInputStream
// 111: dup
// 112: aload 8
// 114: invokespecial 199 java/io/FileInputStream:<init> (Ljava/io/File;)V
// 117: invokespecial 202 java/io/BufferedInputStream:<init> (Ljava/io/InputStream;)V
// 120: astore 9
// 122: aload 8
// 124: invokevirtual 206 java/io/File:length ()J
// 127: l2i
// 128: newarray byte
// 130: astore 8
// 132: iconst_0
// 133: istore_2
// 134: aload 8
// 136: astore 6
// 138: aload 8
// 140: astore 7
// 142: aload 8
// 144: arraylength
// 145: istore_1
// 146: iload_1
// 147: ifne +58 -> 205
// 150: aload 8
// 152: astore 5
// 154: aload 9
// 156: invokevirtual 209 java/io/InputStream:close ()V
// 159: aload 8
// 161: astore 5
// 163: goto -120 -> 43
// 166: astore 6
// 168: ldc 91
// 170: new 93 java/lang/StringBuilder
// 173: dup
// 174: invokespecial 94 java/lang/StringBuilder:<init> ()V
// 177: ldc 96
// 179: invokevirtual 100 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 182: aload 6
// 184: invokevirtual 103 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 187: invokevirtual 107 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 190: aload 6
// 192: invokestatic 113 com/outfit7/funnetworks/util/Logger:error (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
// 195: goto -152 -> 43
// 198: astore 5
// 200: aload_0
// 201: monitorexit
// 202: aload 5
// 204: athrow
// 205: aload 8
// 207: astore 6
// 209: aload 8
// 211: astore 7
// 213: aload 9
// 215: aload 8
// 217: iload_2
// 218: iload_1
// 219: invokevirtual 213 java/io/InputStream:read ([BII)I
// 222: istore_3
// 223: iload_3
// 224: iconst_m1
// 225: if_icmpeq -75 -> 150
// 228: iload_2
// 229: iload_3
// 230: iadd
// 231: istore_2
// 232: iload_1
// 233: iload_3
// 234: isub
// 235: istore_1
// 236: goto -90 -> 146
// 239: astore 5
// 241: aload 6
// 243: astore 7
// 245: ldc 91
// 247: new 93 java/lang/StringBuilder
// 250: dup
// 251: invokespecial 94 java/lang/StringBuilder:<init> ()V
// 254: ldc 96
// 256: invokevirtual 100 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 259: aload 5
// 261: invokevirtual 103 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 264: invokevirtual 107 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 267: aload 5
// 269: invokestatic 113 com/outfit7/funnetworks/util/Logger:error (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
// 272: aload 6
// 274: astore 5
// 276: aload 9
// 278: invokevirtual 209 java/io/InputStream:close ()V
// 281: aload 6
// 283: astore 5
// 285: goto -242 -> 43
// 288: astore 6
// 290: aload 7
// 292: astore 5
// 294: aload 9
// 296: invokevirtual 209 java/io/InputStream:close ()V
// 299: aload 7
// 301: astore 5
// 303: aload 6
// 305: athrow
// Local variable table:
// start length slot name signature
// 0 306 0 this Offer
// 145 91 1 i int
// 133 99 2 j int
// 222 13 3 k int
// 32 59 4 bool boolean
// 41 121 5 localObject1 Object
// 198 5 5 localObject2 Object
// 239 29 5 localException1 Exception
// 274 28 5 localObject3 Object
// 1 136 6 localObject4 Object
// 166 25 6 localException2 Exception
// 207 75 6 localObject5 Object
// 288 16 6 localObject6 Object
// 25 275 7 localObject7 Object
// 77 139 8 localObject8 Object
// 120 175 9 localBufferedInputStream java.io.BufferedInputStream
// Exception table:
// from to target type
// 104 122 166 java/lang/Exception
// 154 159 166 java/lang/Exception
// 276 281 166 java/lang/Exception
// 294 299 166 java/lang/Exception
// 303 306 166 java/lang/Exception
// 5 34 198 finally
// 52 86 198 finally
// 104 122 198 finally
// 154 159 198 finally
// 168 195 198 finally
// 276 281 198 finally
// 294 299 198 finally
// 303 306 198 finally
// 122 132 239 java/lang/Exception
// 142 146 239 java/lang/Exception
// 213 223 239 java/lang/Exception
// 122 132 288 finally
// 142 146 288 finally
// 213 223 288 finally
// 245 272 288 finally
}
private String md5(String paramString)
{
try
{
Object localObject = MessageDigest.getInstance("MD5");
((MessageDigest)localObject).reset();
((MessageDigest)localObject).update(paramString.getBytes("UTF-8"));
paramString = ((MessageDigest)localObject).digest();
localObject = new StringBuffer();
int i = 0;
while (i < paramString.length)
{
String str = Integer.toHexString(paramString[i] & 0xFF);
if (str.length() == 1) {
((StringBuffer)localObject).append('0');
}
((StringBuffer)localObject).append(str);
i += 1;
}
paramString = ((StringBuffer)localObject).toString();
return paramString;
}
catch (Exception paramString)
{
throw new RuntimeException();
}
}
public Bitmap getThumb()
{
return getThumb(false);
}
public Bitmap getThumb(boolean paramBoolean)
{
if (this.thumbLink == null) {}
Object localObject1;
do
{
return null;
localObject1 = getCachedImg();
if (localObject1 != null) {
return BitmapFactory.decodeByteArray((byte[])localObject1, 0, localObject1.length);
}
} while (paramBoolean);
synchronized (this.downloadMonitor)
{
byte[] arrayOfByte2 = getCachedImg();
localObject1 = arrayOfByte2;
if (arrayOfByte2 != null) {
break label75;
}
localObject1 = downloadBitmap();
if (localObject1 == null) {
return null;
}
}
cacheImg(arrayOfByte1);
label75:
return BitmapFactory.decodeByteArray(arrayOfByte1, 0, arrayOfByte1.length);
}
public Offer setLink(String paramString)
{
this.link = paramString;
return this;
}
public Offer setPoints(int paramInt)
{
this.points = paramInt;
return this;
}
public Offer setRequiredAction(String paramString)
{
this.requiredAction = paramString;
return this;
}
public Offer setThumb(String paramString)
{
this.thumbLink = paramString;
return this;
}
public Offer setTitle(String paramString)
{
this.title = paramString;
return this;
}
public String toString()
{
StringBuilder localStringBuilder = new StringBuilder();
localStringBuilder.append("title: ").append(this.title).append(", ").append("requiredAction: ").append(this.requiredAction).append(", ").append("link: ").append(this.link).append(", ").append("thumbLink: ").append(this.thumbLink).append(", ").append("thumbFile: ").append(this.thumbFile).append(", ").append("points: ").append(this.points);
return localStringBuilder.toString();
}
}
public static abstract interface OfferListener
{
public abstract void offersLoaded(List<OfferProvider.Offer> paramList);
public abstract void startOffersLoading();
}
}
| [
"ibrahimkanj@outlook.com"
] | ibrahimkanj@outlook.com |
c0f34b4bff8fc677088c30ccf184b27d75ce1f54 | b6b44e6f84d424b145534f5e70d0b402ad897d52 | /mvp/src/test/java/com/pax/mvp/ExampleUnitTest.java | 115f13bb95212b436c9792d2c78662616924c3d9 | [] | no_license | ligqsz/mvx | cdd2bc81cbad81fec2d6e60f3bedef5aadad046c | 3a4775a6801b6144e8ca456eff3e92493e4be1bf | refs/heads/master | 2020-03-30T03:16:25.943196 | 2018-09-28T03:20:35 | 2018-09-28T03:20:35 | 150,679,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package com.pax.mvp;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"ligq@paxsz.local"
] | ligq@paxsz.local |
42aa255a9aad098d848d923283e8bfe361d1d33f | 4c254a9a7f368b2c8d187cee409b690f36c4fd28 | /SecretSanta/src/dbconnection/LocalDatabaseConnection.java | 0d3078756ac166af76259b4ebe55ef4e3fb4bc3a | [] | no_license | wpegg-dev/Small-Projects | 20cf19265a4f09f33be61ad6a48869afb9f5200f | af5d0c8c0c94bbdf56265df9b1f486c0807d4cea | refs/heads/master | 2020-04-06T07:02:02.399537 | 2018-03-31T13:08:58 | 2018-03-31T13:08:58 | 33,694,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 972 | java | package dbconnection;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class LocalDatabaseConnection {
Connection con;
public LocalDatabaseConnection()
{
try
{
String SQLDrive = "com.mysql.jdbc.Driver";
String SQLURL = "jdbc:mysql://localhost:3306/atlas";
String user = "";
String password = "";
Class.forName(SQLDrive).newInstance();
con = DriverManager.getConnection(SQLURL,user,password);
}
catch (SQLException e)
{
System.out.println("SQL Error:" + e);
}
catch (Exception e)
{
System.out.println("Failed to load MySQL Driver" + e);
}
}
public Connection getConnection()
{
return this.con;
}
public void closeConnection()
{
try
{
if(this.con != null)
{
this.con.close();
}
}
catch (SQLException e)
{
SQLException e1 = ((SQLException)e).getNextException();
if (e1 != null)
System.out.println("SQL Error:" + e1);
}
}
} | [
"william.pegg.dev@gmail.com"
] | william.pegg.dev@gmail.com |
344fb1c496557bb6ff410f0e3fe76246ef1a354e | c182158076d96105e8e901e930135b2cd695eebb | /Search.java | 135b4ca423b8dd0e56faf568f0d495207747e5e2 | [] | no_license | dkovigit/spring-boot-jwt-mongoDB | 177b1e40284dfbf5a4dd8e55f374c637351d825f | ba65f09a0f4c1498ea0efbb9a41529b5caee989a | refs/heads/master | 2020-05-31T04:30:50.707330 | 2019-06-26T18:18:47 | 2019-06-26T18:18:47 | 190,099,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.app.model;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "search")
public class Search {
@Id
private Integer userId;
private String searchTerm;
private Integer requestCount;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer id) {
this.userId = id;
}
public String getSearchTerm() {
return this.searchTerm;
}
public void setSearchTerm(String searchTerm) {
this.searchTerm = searchTerm;
}
public Integer getRequestCount() {
return this.requestCount;
}
public void setRequestCount(Integer requestCount) {
this.requestCount = requestCount;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
2095c5da9e0ea8d661d86b732ef4ab6f49a32908 | d69fdaed232c845752e2fc3551a405bce03efcf5 | /src/main/java/com/jacsonf/productms/controller/ProductController.java | ac12374a91f7dbe5cf8b8c690622dd86f45af1a3 | [] | no_license | JacsonF/ms-product | fef67845b5ba49a0ea7c57e9b096202a011a604d | 382ad02d3bd21c757a6cbf8e8a89b3861bed17bf | refs/heads/master | 2023-04-18T11:15:14.815658 | 2021-05-02T20:30:26 | 2021-05-02T20:30:26 | 354,184,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,434 | java | package com.jacsonf.productms.controller;
import java.math.BigDecimal;
import java.util.List;
import javax.validation.Valid;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.jacsonf.productms.controller.dto.request.Input;
import com.jacsonf.productms.domain.Product;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
public interface ProductController {
@Operation(summary = "Cria um novo produto")
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
Product save(@Valid @RequestBody Input dto);
@Operation(summary = "Retorna o produto correspondente ao identificador recuperado por parametro")
@ApiResponses(value = {
@ApiResponse(
responseCode = "404",
content = @Content(
mediaType = "application/json",
examples = @ExampleObject(
value = "{\n" +
" \"status_code\": 404,\n" +
" \"message\": \"product code 40288187789990c701789991c7340001 not found\"\n" +
"}"
)
)
)
})
@GetMapping("{id}")
Product one(@PathVariable("id") String id);
@Operation(summary = "Atualiza o produto correspondente ao identificador recuperado por parametro")
@ApiResponses(value = {
@ApiResponse(
responseCode = "404",
content = @Content(
mediaType = "application/json",
examples = @ExampleObject(
value = "{\n" +
" \"status_code\": 404,\n" +
" \"message\": \"product code 402881877899bc0c017899bc2bd10000 not found\"\n" +
"}"
)
)
)
})
@PutMapping(path = "/{id}")
@ResponseStatus(HttpStatus.CREATED)
Product update(@PathVariable("id") String id, @Valid @RequestBody Input dto);
@Operation(summary = "Retorna a lista atual de todos os produtos")
@GetMapping
@ResponseStatus(HttpStatus.OK)
List<Product> getAll();
@Operation(summary = "Deleta o produto correspondente ao identificador recuperado por parametro")
@ApiResponses(value = {
@ApiResponse(
responseCode = "404",
content = @Content(
mediaType = "application/json",
examples = @ExampleObject(
value = "{\n" +
" \"status_code\": 404,\n" +
" \"message\": \"product code 402881877897f4c9017897f6df560005 not found\"\n" +
"}"
)
)
)
})
@DeleteMapping("{id}")
@ResponseStatus(HttpStatus.OK)
void delete(@PathVariable("id") String id);
@Operation(summary = "Retorna a lista atual de todos os produtos filtrados de acordo com os parametros passados na Url")
@GetMapping(path = "/search")
List<Product> searchProductByFilter(@RequestParam(required = false, name = "min_price") BigDecimal minPrice,
@RequestParam(required = false, name = "max_price") BigDecimal maxPrice,
@RequestParam(required = false, name = "q", defaultValue = "") String nameOrDescription);
}
| [
"Jacson.Ferreira@unisys.com"
] | Jacson.Ferreira@unisys.com |
2aef693c7546d43eb32639be38c772bd3638be5c | 1f2a1dc8df526d48824730ab30b4a34bcbd42a73 | /parking-registry-web/src/main/java/hu/nutty/interview/ulyssys/parkingregistry/web/managedbeans/view/MBParking.java | 6b49d281956cc71a95f465f5a07d3b0e08de7358 | [] | no_license | nuttynb/parking-registry | f8556216b91446064f2defc6b949347a4d20e517 | 0ade1ab0aefa3959f2aa33831533fcdacb793eda | refs/heads/master | 2021-01-12T12:21:47.254763 | 2016-11-02T02:26:01 | 2016-11-02T02:26:01 | 72,459,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,034 | java | package hu.nutty.interview.ulyssys.parkingregistry.web.managedbeans.view;
import hu.nutty.interview.ulyssys.parkingregistry.vo.CarVo;
import hu.nutty.interview.ulyssys.parkingregistry.vo.ParkingVo;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import java.io.Serializable;
@ManagedBean(name = "parkingBean")
@ViewScoped
public class MBParking implements Serializable {
private static final long serialVersionUID = -2709877690191381830L;
private CarVo parkingCar;
private ParkingVo parking = new ParkingVo();
private String carId;
public CarVo getParkingCar() {
return parkingCar;
}
public void setParkingCar(CarVo parkingCar) {
this.parkingCar = parkingCar;
}
public ParkingVo getParking() {
return parking;
}
public void setParking(ParkingVo parking) {
this.parking = parking;
}
public String getCarId() {
return carId;
}
public void setCarId(String carId) {
this.carId = carId;
}
}
| [
"nuttyka@gmail.com"
] | nuttyka@gmail.com |
96a516d04f5dc7ab6a57aec674d54e4ce4878da0 | 8d4b8ac1ec6efb68e23b5d091d01fad09f3bdeac | /app/src/main/java/com/joeforbroke/sweaterweather/Weather/Hour.java | a99a492f32bca43c6739dc4b1ccb7fb598ca5a6b | [] | no_license | Th3HoopMan/Sweater_Weather | 8f2ef3a8b71fd291e55fab86f7df99a96e98070a | 54556bdc1a06021fe58d1aab43fd97d5dd95404c | refs/heads/master | 2016-09-07T18:29:04.716547 | 2015-07-18T02:43:21 | 2015-07-18T02:43:21 | 39,207,674 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,398 | java | package com.joeforbroke.sweaterweather.Weather;
import android.os.Parcel;
import android.os.Parcelable;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by Joseph on 7/15/2015.
*/
public class Hour implements Parcelable{
private long mTime;
private String mSummary;
private String mIcon;
private String mTimeZone;
private double mTemperature;
public Hour() {
}
public long getTime() {
return mTime;
}
public void setTime(long time) {
mTime = time;
}
public String getSummary() {
return mSummary;
}
public void setSummary(String summary) {
mSummary = summary;
}
public String getIcon() {
return mIcon;
}
//Gets icon resources int
public int getIconId() {
return Forecast.getIconId(mIcon);
}
public void setIcon(String icon) {
mIcon = icon;
}
public String getTimeZone() {
return mTimeZone;
}
public void setTimeZone(String timeZone) {
mTimeZone = timeZone;
}
public int getTemperature() {
return (int) Math.round(mTemperature);
}
public void setTemperature(double temperature) {
mTemperature = temperature;
}
//Convert time into seconds and format
public String getHour() {
SimpleDateFormat formatter = new SimpleDateFormat("h a");
Date date = new Date(mTime * 1000);
return formatter.format(date);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(mTime);
dest.writeString(mSummary);
dest.writeString(mIcon);
dest.writeString(mTimeZone);
dest.writeDouble(mTemperature);
}
private Hour(Parcel in) {
mTime = in.readLong();
mSummary = in.readString();
mIcon = in.readString();
mTimeZone = in.readString();
mTemperature = in.readDouble();
}
public static final Creator<Hour> CREATOR = new Creator<Hour>() {
//Pass in parcel into the private constructor we made
@Override
public Hour createFromParcel(Parcel source) {
return new Hour(source);
}
@Override
public Hour[] newArray(int size) {
return new Hour[size];
}
};
}
| [
"StayValiant94@gmail.com"
] | StayValiant94@gmail.com |
deefefd81d03ffeab2f249d401cb60b732acb21f | bbad06d47f4082ff2f469bdab3f0f84e1a3703d8 | /src/test/java/com/wzx/sword/No44ADigitInASequenceOfNumbersTest.java | 0e892ec218b8498ad2c9387f28988a16e31e0d3d | [] | no_license | wzx140/LeetCode | b6ac8e824676ea85f7d17a459bf86b83d4cbfeab | fdb3f45d3b9cdc161471c859af23fa8e44c3d1e7 | refs/heads/master | 2022-02-20T09:48:59.077744 | 2022-01-27T05:00:01 | 2022-01-27T05:00:01 | 170,458,336 | 1 | 0 | null | 2020-10-14T03:22:57 | 2019-02-13T07:05:27 | C++ | UTF-8 | Java | false | false | 413 | java | package com.wzx.sword;
import org.junit.Test;
import static org.junit.Assert.*;
public class No44ADigitInASequenceOfNumbersTest {
@Test
public void findNthDigit() {
No44ADigitInASequenceOfNumbers solution = new No44ADigitInASequenceOfNumbers();
assertEquals(3, solution.findNthDigit(3));
assertEquals(0, solution.findNthDigit(11));
assertEquals(1, solution.findNthDigit(1000000000));
}
} | [
"masterwangzx@gmail.com"
] | masterwangzx@gmail.com |
6be1b243779906db8d3e2fb1514948ebdcf556a9 | 640d53051dfadb291f01455f4602ed22f88de8a8 | /microboot-email/src/main/java/com/lxc/intro/microboot/email/service/IUserService.java | c19c55ac9dd23f20e12ccf30dc9f2b562326e955 | [] | no_license | liuxc1/microboot | 55bba150769046e9791e6e699ccb32f898856be3 | 703a41b1cd09293a7afc14a18035f3531b3ebfe5 | refs/heads/master | 2020-03-18T19:47:47.245573 | 2018-05-28T15:24:18 | 2018-05-28T15:24:18 | 135,178,085 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package com.lxc.intro.microboot.email.service;
public interface IUserService {
public void println();
public void println2();
}
| [
"921119098@qq.com"
] | 921119098@qq.com |
ccc2b883cef0581c4ac99116050c50b0f3bbaa34 | 3f6073cca62fb4204884c51e58dca9cadad97742 | /codes/py/src/features/ResourcePrice.java | 09fb1a410b16fe72627b8fd0dbcc6981e4e72828 | [] | no_license | yepyao/kddcup2014 | 2ca05543f9b61afb15e2caf591d2cdeb9127d1dc | 9b89b58d6a7b0c630fee4628c4e6dd44aedf53d3 | refs/heads/master | 2020-05-18T11:03:19.949842 | 2014-06-13T16:05:06 | 2014-06-13T16:05:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,591 | java | package features;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Hashtable;
import preprocessing.CSVFileUtil;
public class ResourcePrice {
public static void main(String[] args) throws Exception{
FileInputStream f = new FileInputStream(args[0]); //mapping
BufferedReader in = new BufferedReader(new InputStreamReader(f));
Hashtable<String, String> id = new Hashtable<String, String>();
String s = in.readLine();
while (s != null){
String[] temp = s.split(" ");
id.put(temp[1], temp[0]);
s = in.readLine();
}
in.close();
CSVFileUtil csv = new CSVFileUtil(args[1]);
Hashtable<String, Double> resourceNum = new Hashtable<String, Double>();
s = csv.readLine();
s = csv.readLine();
while (s != null){
ArrayList<String> splits = CSVFileUtil.fromCSVLinetoArray(s);
if (splits.size() > 8 && !splits.get(8).equals("") && !splits.get(7).equals(""))
if (resourceNum.get(splits.get(1)) == null) resourceNum.put(splits.get(1), Double.valueOf(splits.get(8))*Double.valueOf(splits.get(7)));
else resourceNum.put(splits.get(1), resourceNum.get(splits.get(1))+Double.valueOf(splits.get(8))*Double.valueOf(splits.get(7)));
s = csv.readLine();
}
in.close();
f = new FileInputStream(args[2]); //train.txt
in = new BufferedReader(new InputStreamReader(f));
FileOutputStream f2 = new FileOutputStream(args[3]);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(f2));
s = in.readLine();
out.write("1"+"\n");
while (s != null){
String[] temp = s.split(" ");
Double ans = Double.valueOf(0);
if (resourceNum.get(id.get(temp[1])) != null)
ans = Double.valueOf(resourceNum.get(id.get(temp[1])));
s = in.readLine();
out.write("1 0:"+String.valueOf(ans)+"\n");
}
in.close();
out.close();
f = new FileInputStream(args[4]); //test.txt
in = new BufferedReader(new InputStreamReader(f));
f2 = new FileOutputStream(args[5]);
out = new BufferedWriter(new OutputStreamWriter(f2));
s = in.readLine();
out.write("1"+"\n");
while (s != null){
String[] temp = s.split(" ");
Double ans = Double.valueOf(0);
if (resourceNum.get(id.get(temp[1])) != null)
ans = Double.valueOf(resourceNum.get(id.get(temp[1])));
out.write("1 0:"+String.valueOf(ans)+"\n");
s = in.readLine();
}
in.close();
out.close();
}
}
| [
"yepyao@gmail.com"
] | yepyao@gmail.com |
66bf487f629b4c1669322d94306cf1b388ab0b4f | 81719679e3d5945def9b7f3a6f638ee274f5d770 | /aws-java-sdk-mechanicalturkrequester/src/main/java/com/amazonaws/services/mturk/model/CreateAdditionalAssignmentsForHITRequest.java | 5080e8621a3733be9a15e863d58699ac866ea5af | [
"Apache-2.0"
] | permissive | ZeevHayat1/aws-sdk-java | 1e3351f2d3f44608fbd3ff987630b320b98dc55c | bd1a89e53384095bea869a4ea064ef0cf6ed7588 | refs/heads/master | 2022-04-10T14:18:43.276970 | 2020-03-07T12:15:44 | 2020-03-07T12:15:44 | 172,681,373 | 1 | 0 | Apache-2.0 | 2019-02-26T09:36:47 | 2019-02-26T09:36:47 | null | UTF-8 | Java | false | false | 10,340 | java | /*
* Copyright 2014-2019 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.mturk.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/mturk-requester-2017-01-17/CreateAdditionalAssignmentsForHIT"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateAdditionalAssignmentsForHITRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The ID of the HIT to extend.
* </p>
*/
private String hITId;
/**
* <p>
* The number of additional assignments to request for this HIT.
* </p>
*/
private Integer numberOfAdditionalAssignments;
/**
* <p>
* A unique identifier for this request, which allows you to retry the call on error without extending the HIT
* multiple times. This is useful in cases such as network timeouts where it is unclear whether or not the call
* succeeded on the server. If the extend HIT already exists in the system from a previous call using the same
* <code>UniqueRequestToken</code>, subsequent calls will return an error with a message containing the request ID.
* </p>
*/
private String uniqueRequestToken;
/**
* <p>
* The ID of the HIT to extend.
* </p>
*
* @param hITId
* The ID of the HIT to extend.
*/
public void setHITId(String hITId) {
this.hITId = hITId;
}
/**
* <p>
* The ID of the HIT to extend.
* </p>
*
* @return The ID of the HIT to extend.
*/
public String getHITId() {
return this.hITId;
}
/**
* <p>
* The ID of the HIT to extend.
* </p>
*
* @param hITId
* The ID of the HIT to extend.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAdditionalAssignmentsForHITRequest withHITId(String hITId) {
setHITId(hITId);
return this;
}
/**
* <p>
* The number of additional assignments to request for this HIT.
* </p>
*
* @param numberOfAdditionalAssignments
* The number of additional assignments to request for this HIT.
*/
public void setNumberOfAdditionalAssignments(Integer numberOfAdditionalAssignments) {
this.numberOfAdditionalAssignments = numberOfAdditionalAssignments;
}
/**
* <p>
* The number of additional assignments to request for this HIT.
* </p>
*
* @return The number of additional assignments to request for this HIT.
*/
public Integer getNumberOfAdditionalAssignments() {
return this.numberOfAdditionalAssignments;
}
/**
* <p>
* The number of additional assignments to request for this HIT.
* </p>
*
* @param numberOfAdditionalAssignments
* The number of additional assignments to request for this HIT.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAdditionalAssignmentsForHITRequest withNumberOfAdditionalAssignments(Integer numberOfAdditionalAssignments) {
setNumberOfAdditionalAssignments(numberOfAdditionalAssignments);
return this;
}
/**
* <p>
* A unique identifier for this request, which allows you to retry the call on error without extending the HIT
* multiple times. This is useful in cases such as network timeouts where it is unclear whether or not the call
* succeeded on the server. If the extend HIT already exists in the system from a previous call using the same
* <code>UniqueRequestToken</code>, subsequent calls will return an error with a message containing the request ID.
* </p>
*
* @param uniqueRequestToken
* A unique identifier for this request, which allows you to retry the call on error without extending the
* HIT multiple times. This is useful in cases such as network timeouts where it is unclear whether or not
* the call succeeded on the server. If the extend HIT already exists in the system from a previous call
* using the same <code>UniqueRequestToken</code>, subsequent calls will return an error with a message
* containing the request ID.
*/
public void setUniqueRequestToken(String uniqueRequestToken) {
this.uniqueRequestToken = uniqueRequestToken;
}
/**
* <p>
* A unique identifier for this request, which allows you to retry the call on error without extending the HIT
* multiple times. This is useful in cases such as network timeouts where it is unclear whether or not the call
* succeeded on the server. If the extend HIT already exists in the system from a previous call using the same
* <code>UniqueRequestToken</code>, subsequent calls will return an error with a message containing the request ID.
* </p>
*
* @return A unique identifier for this request, which allows you to retry the call on error without extending the
* HIT multiple times. This is useful in cases such as network timeouts where it is unclear whether or not
* the call succeeded on the server. If the extend HIT already exists in the system from a previous call
* using the same <code>UniqueRequestToken</code>, subsequent calls will return an error with a message
* containing the request ID.
*/
public String getUniqueRequestToken() {
return this.uniqueRequestToken;
}
/**
* <p>
* A unique identifier for this request, which allows you to retry the call on error without extending the HIT
* multiple times. This is useful in cases such as network timeouts where it is unclear whether or not the call
* succeeded on the server. If the extend HIT already exists in the system from a previous call using the same
* <code>UniqueRequestToken</code>, subsequent calls will return an error with a message containing the request ID.
* </p>
*
* @param uniqueRequestToken
* A unique identifier for this request, which allows you to retry the call on error without extending the
* HIT multiple times. This is useful in cases such as network timeouts where it is unclear whether or not
* the call succeeded on the server. If the extend HIT already exists in the system from a previous call
* using the same <code>UniqueRequestToken</code>, subsequent calls will return an error with a message
* containing the request ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAdditionalAssignmentsForHITRequest withUniqueRequestToken(String uniqueRequestToken) {
setUniqueRequestToken(uniqueRequestToken);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getHITId() != null)
sb.append("HITId: ").append(getHITId()).append(",");
if (getNumberOfAdditionalAssignments() != null)
sb.append("NumberOfAdditionalAssignments: ").append(getNumberOfAdditionalAssignments()).append(",");
if (getUniqueRequestToken() != null)
sb.append("UniqueRequestToken: ").append(getUniqueRequestToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateAdditionalAssignmentsForHITRequest == false)
return false;
CreateAdditionalAssignmentsForHITRequest other = (CreateAdditionalAssignmentsForHITRequest) obj;
if (other.getHITId() == null ^ this.getHITId() == null)
return false;
if (other.getHITId() != null && other.getHITId().equals(this.getHITId()) == false)
return false;
if (other.getNumberOfAdditionalAssignments() == null ^ this.getNumberOfAdditionalAssignments() == null)
return false;
if (other.getNumberOfAdditionalAssignments() != null
&& other.getNumberOfAdditionalAssignments().equals(this.getNumberOfAdditionalAssignments()) == false)
return false;
if (other.getUniqueRequestToken() == null ^ this.getUniqueRequestToken() == null)
return false;
if (other.getUniqueRequestToken() != null && other.getUniqueRequestToken().equals(this.getUniqueRequestToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getHITId() == null) ? 0 : getHITId().hashCode());
hashCode = prime * hashCode + ((getNumberOfAdditionalAssignments() == null) ? 0 : getNumberOfAdditionalAssignments().hashCode());
hashCode = prime * hashCode + ((getUniqueRequestToken() == null) ? 0 : getUniqueRequestToken().hashCode());
return hashCode;
}
@Override
public CreateAdditionalAssignmentsForHITRequest clone() {
return (CreateAdditionalAssignmentsForHITRequest) super.clone();
}
}
| [
""
] | |
dc353c1e4dbcc46b896d56860b79f868d232c2b7 | 7ff0c02a30e7985bde01eda604be7d956a1631a3 | /ddzs/src/main/java/com/mlongbo/jfinal/model/base/BaseFeedbackReply.java | e0fd0ed2cb4d511dc732dccfd6911724804d165e | [
"MIT"
] | permissive | funhours/cmm | 85e0e520ed079271af25e27b1874f3e1c990788d | eeffb01bc043bdf04464be3034e4ae59b832db84 | refs/heads/master | 2021-01-17T18:06:24.656889 | 2017-06-27T09:17:22 | 2017-06-27T09:17:22 | 95,538,641 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,303 | java | package com.mlongbo.jfinal.model.base;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.IBean;
/**
* Generated by JFinal, do not modify this file.
*/
@SuppressWarnings("serial")
public abstract class BaseFeedbackReply<M extends BaseFeedbackReply<M>> extends Model<M> implements IBean {
public void setId(java.lang.Integer id) {
set("id", id);
}
public java.lang.Integer getId() {
return get("id");
}
public void setFeedbackId(java.lang.Integer feedbackId) {
set("feedbackId", feedbackId);
}
public java.lang.Integer getFeedbackId() {
return get("feedbackId");
}
public void setAccountId(java.lang.Integer accountId) {
set("accountId", accountId);
}
public java.lang.Integer getAccountId() {
return get("accountId");
}
public void setContent(java.lang.String content) {
set("content", content);
}
public java.lang.String getContent() {
return get("content");
}
public void setCreateAt(java.util.Date createAt) {
set("createAt", createAt);
}
public java.util.Date getCreateAt() {
return get("createAt");
}
public void setReport(java.lang.Integer report) {
set("report", report);
}
public java.lang.Integer getReport() {
return get("report");
}
}
| [
"FunHours@windows10.microdone.cn"
] | FunHours@windows10.microdone.cn |
b6977852470d21985a00d9c18080a56f0cd5b49f | a0d6ac118b7cd4ead968b09e7266c0e1c7963eb6 | /AudioPlayDemo/src/com/handmark/pulltorefresh/library/LoadingLayoutProxy.java | 6129109f361a1a865145e8e092161ab699732533 | [] | no_license | wk2311/AndroidDemo | c9faff7037c93b4fbe700b5a0ed12b780d6c5b6b | 7d4ef7101cb8887d163cab6387c67797c9674d7d | refs/heads/master | 2020-12-24T14:27:01.353554 | 2014-02-21T14:15:46 | 2014-02-21T14:15:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package com.handmark.pulltorefresh.library;
import java.util.HashSet;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import com.handmark.pulltorefresh.library.internal.LoadingLayout;
public class LoadingLayoutProxy implements ILoadingLayout {
private final HashSet<LoadingLayout> mLoadingLayouts;
LoadingLayoutProxy() {
mLoadingLayouts = new HashSet<LoadingLayout>();
}
/**
* This allows you to add extra LoadingLayout instances to this proxy. This
* is only necessary if you keep your own instances, and want to have them
* included in any
* {@link PullToRefreshBase#createLoadingLayoutProxy(boolean, boolean)
* createLoadingLayoutProxy(...)} calls.
*
* @param layout - LoadingLayout to have included.
*/
public void addLayout(LoadingLayout layout) {
if (null != layout) {
mLoadingLayouts.add(layout);
}
}
public void setLastUpdatedLabel(CharSequence label) {
for (LoadingLayout layout : mLoadingLayouts) {
layout.setLastUpdatedLabel(label);
}
}
public void setLoadingDrawable(Drawable drawable) {
for (LoadingLayout layout : mLoadingLayouts) {
layout.setLoadingDrawable(drawable);
}
}
public void setRefreshingLabel(CharSequence refreshingLabel) {
for (LoadingLayout layout : mLoadingLayouts) {
layout.setRefreshingLabel(refreshingLabel);
}
}
public void setPullLabel(CharSequence label) {
for (LoadingLayout layout : mLoadingLayouts) {
layout.setPullLabel(label);
}
}
public void setReleaseLabel(CharSequence label) {
for (LoadingLayout layout : mLoadingLayouts) {
layout.setReleaseLabel(label);
}
}
public void setTextTypeface(Typeface tf) {
for (LoadingLayout layout : mLoadingLayouts) {
layout.setTextTypeface(tf);
}
}
}
| [
"wk2311007@gmail.com"
] | wk2311007@gmail.com |
e2885272907471ba1e6b10d1eff9c31a999d108e | 8c50bb05c8ed93619f7c9d45e5d1eac04fdf1fbb | /Chapter03/StringDemo.java | 1bba4eed234f84e7115cc39a58b1c6bed7f8f79b | [] | no_license | waldronmatt/object-oriented-application-development-using-java-student-source-code | c41f952f6a0ae01283e164e108273b4a481c33cc | b1925965839decc323749651b169ab8d82ffa188 | refs/heads/master | 2022-04-23T22:06:26.608612 | 2020-04-26T15:51:50 | 2020-04-26T15:51:50 | 258,862,883 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 575 | java | public class StringDemo
{
public static void main(String[] args)
{
// invoke an instance method: length
String s = new String("Hello Again");
System.out.println("length of s is " + s.length());
// convert primitive to String: valueOf class method
int i = 5;
String iString = String.valueOf(i);
System.out.println("value of iString is " + iString);
// illustrate additional String instance methods
System.out.println("character at index 6 is " + s.charAt(6));
System.out.println("uppercase is " + s.toUpperCase());
}
}
| [
"noreply@github.com"
] | noreply@github.com |
f2f28ffaa6fc5cb88ed2689560eb9b7371ba4318 | 959de12dbfaca0aac5a786247528eb71044a00ee | /src/main/java/com/pipegrid/model/Persist.java | 73f0fd9b60e225e637eaa54531508640d208f25c | [] | no_license | sakhan/pipegrid | df19c0eb9559d63980e694f9e019d7dc453372b5 | f2b6e491c14f6b9524c3bd29f8936a5dca0ca5b8 | refs/heads/master | 2020-05-30T05:26:47.976950 | 2012-10-15T21:16:25 | 2012-10-15T21:16:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,143 | java | package com.pipegrid.model;
import java.io.Serializable;
import org.apache.commons.lang3.builder.EqualsBuilder;
/**
* Base class for all Hibernate persistent objects.
*
* @author sheraz.khan
*/
public abstract class Persist implements Serializable
{
private static final long serialVersionUID = 1L;
protected Long _id = null;
public Persist() {}
public Persist(Long id)
{
setId(id);
}
public Long getId()
{
return _id;
}
public void setId(Long id)
{
_id = id;
}
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((_id == null) ? 0 : _id.hashCode());
return result;
}
public boolean equals(Object obj)
{
if (obj instanceof Persist == false)
{
return false;
}
if (this == obj)
{
return true;
}
Persist rhs = (Persist) obj;
return new EqualsBuilder()
.append(this.getId(), rhs.getId())
.isEquals();
}
}
| [
"skhan.sp@gmail.com"
] | skhan.sp@gmail.com |
b766f3c17988279f5272d1ed3615bfd8cdee8bb4 | 7fc66590a710e0312e37c33a4dfd31b05282e910 | /sign-core-system/src/main/java/com/iyin/sign/system/vo/req/SaveUkSealReqVO.java | 86b2b96fab92229b8f0948963f92893e762d2505 | [] | no_license | Kuangwei016/gitskills | 4a77798f998910f1d30eeffdef70cbe7d46f4d19 | e9ad1e9343c9b6a32c39b8fe4034f1501eb4c2b2 | refs/heads/master | 2022-12-16T14:39:39.056186 | 2019-11-19T01:19:56 | 2019-11-19T01:19:56 | 73,170,428 | 0 | 1 | null | 2022-12-06T00:33:34 | 2016-11-08T09:31:43 | Java | UTF-8 | Java | false | false | 2,336 | java | package com.iyin.sign.system.vo.req;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName: SaveUkSealReqVO
* @Description: 保存uk印章
* @Author: luwenxiong
* @CreateDate: 2019/7/22 15:31
* @UpdateUser: Administrator
* @UpdateDate: 2019/7/22 15:31
* @Version: 0.0.1
*/
@Data
public class SaveUkSealReqVO implements Serializable {
private static final long serialVersionUID = -7573350592765744101L;
@ApiModelProperty(value = "印章所属个人还是单位 01:单位 02 个人")
@NotBlank(message = "pictureUserType不能为空")
private String pictureUserType;
@ApiModelProperty(value = "企业表或个人表主键ID")
@NotBlank(message = "企业或个人id不能为空。")
private String enterpriseOrPersonalId;
@ApiModelProperty(value = "从ukey读取到的印章编码")
@NotBlank(message = "印章编码不能为空")
private String sealCode;
@ApiModelProperty(value = "数字证书厂商")
@NotBlank(message = "数字证书厂商不能为空")
private String issuer;
@ApiModelProperty(value = "证书标识")
@NotBlank(message = "证书标识不能为空")
private String oid;
@ApiModelProperty(value = "信任服务号")
// @NotBlank(message = "信任服务号不能为空")
private String trustId;
@ApiModelProperty(value = "证书有效期开始")
private Date validStart;
@ApiModelProperty(value = "证书有效期结束")
private Date validEnd;
@ApiModelProperty(value = "印章名称")
@NotBlank(message = "章模名称不能为空。")
@Length(max = 30,message = "章模名称不能超过20个字符")
private String pictureName;
@ApiModelProperty(value = " 章模业务类型:单位:01 行政章、02 财务章等 03 业务专用章 04 法定代表人名章 05 报关专用章 06 合同专用章 07 其他公章 08 电子杂章: 09 电子私章")
@NotBlank(message = "印章类型不能为空")
private String pictureBusinessType;
@ApiModelProperty(value = "印章图片base64")
@NotBlank(message = "印章图片base64不能为空")
private String pictureBase64;
}
| [
"root@localhost.localdomain"
] | root@localhost.localdomain |
7f94d1ddbde11c66c4c39a4cf60a9acd11608374 | 33fda66997407a5a0358a7d7cd0e7ff19745d565 | /BxmDftCcSmp/src-gen/bxm/dft/smp/com/onl/bc/dto/CustomerAccountCommonOut.java | a8472ffa3a44c10a11df2741ef56e026da8c95fa | [] | no_license | ikjin/git_test | 8c99bc2e68d0197f8b15998030de50fc0c3b70ae | 55c105542d2d2ffa7fcb4b7c4b2626791c296a2a | refs/heads/master | 2020-03-17T00:34:25.945229 | 2019-02-14T06:48:22 | 2019-02-14T06:48:22 | 133,122,059 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,774 | java | /******************************************************************************
* Bxm Object Message Mapping(OMM) - Source Generator V7
*
* 생성된 자바파일은 수정하지 마십시오.
* IO 파일 수정시 Java파일을 덮어쓰게 됩니다.
*
******************************************************************************/
package bxm.dft.smp.com.onl.bc.dto;
import bxm.omm.root.IOmmObject;
import com.fasterxml.jackson.annotation.JsonProperty;
import bxm.omm.predict.FieldInfo;
import javax.xml.bind.annotation.XmlType;
import bxm.omm.annotation.BxmOmm_Field;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonGetter;
import bxm.omm.predict.Predictable;
import java.util.Hashtable;
import com.fasterxml.jackson.annotation.JsonSetter;
/**
* @Description
*/
@XmlType(propOrder={"cusId", "opBrch", "accNum", "accPW", "amt", "cusNm"}, name="CustomerAccountCommonOut")
@XmlRootElement(name="CustomerAccountCommonOut")
@SuppressWarnings("all")
public class CustomerAccountCommonOut implements IOmmObject, Predictable, FieldInfo {
private static final long serialVersionUID = -105409865L;
@XmlTransient
public static final String OMM_DESCRIPTION = "";
@XmlTransient
public static final String OMM_VERSION = "";
/*******************************************************************************************************************************
* Property set << cusId >> [[ */
@XmlTransient
private boolean isSet_cusId = false;
protected boolean isSet_cusId()
{
return this.isSet_cusId;
}
protected void setIsSet_cusId(boolean value)
{
this.isSet_cusId = value;
}
@BxmOmm_Field(referenceType="reference", description="고객ID", formatType="", format="", align="left", length=10, decimal=0, arrayReference="", fill="", comment="", encrypt="", validationRule="")
private java.lang.String cusId = null;
/**
* @Description 고객ID
*/
public java.lang.String getCusId(){
return cusId;
}
/**
* @Description 고객ID
*/
@JsonProperty("cusId")
public void setCusId( java.lang.String cusId ) {
isSet_cusId = true;
this.cusId = cusId;
}
/** Property set << cusId >> ]]
*******************************************************************************************************************************/
/*******************************************************************************************************************************
* Property set << opBrch >> [[ */
@XmlTransient
private boolean isSet_opBrch = false;
protected boolean isSet_opBrch()
{
return this.isSet_opBrch;
}
protected void setIsSet_opBrch(boolean value)
{
this.isSet_opBrch = value;
}
@BxmOmm_Field(referenceType="reference", description="계좌개설점", formatType="", format="", align="right", length=1, decimal=0, arrayReference="", fill="", comment="", encrypt="", validationRule="")
private java.lang.Integer opBrch = 0;
/**
* @Description 계좌개설점
*/
public java.lang.Integer getOpBrch(){
return opBrch;
}
/**
* @Description 계좌개설점
*/
@JsonProperty("opBrch")
public void setOpBrch( java.lang.Integer opBrch ) {
isSet_opBrch = true;
this.opBrch = opBrch;
}
/** Property set << opBrch >> ]]
*******************************************************************************************************************************/
/*******************************************************************************************************************************
* Property set << accNum >> [[ */
@XmlTransient
private boolean isSet_accNum = false;
protected boolean isSet_accNum()
{
return this.isSet_accNum;
}
protected void setIsSet_accNum(boolean value)
{
this.isSet_accNum = value;
}
@BxmOmm_Field(referenceType="reference", description="계좌번호", formatType="", format="", align="left", length=6, decimal=0, arrayReference="", fill="", comment="", encrypt="", validationRule="")
private java.lang.String accNum = null;
/**
* @Description 계좌번호
*/
public java.lang.String getAccNum(){
return accNum;
}
/**
* @Description 계좌번호
*/
@JsonProperty("accNum")
public void setAccNum( java.lang.String accNum ) {
isSet_accNum = true;
this.accNum = accNum;
}
/** Property set << accNum >> ]]
*******************************************************************************************************************************/
/*******************************************************************************************************************************
* Property set << accPW >> [[ */
@XmlTransient
private boolean isSet_accPW = false;
protected boolean isSet_accPW()
{
return this.isSet_accPW;
}
protected void setIsSet_accPW(boolean value)
{
this.isSet_accPW = value;
}
@BxmOmm_Field(referenceType="reference", description="비밀번호", formatType="", format="", align="left", length=4, decimal=0, arrayReference="", fill="", comment="", encrypt="", validationRule="")
private java.lang.String accPW = null;
/**
* @Description 비밀번호
*/
public java.lang.String getAccPW(){
return accPW;
}
/**
* @Description 비밀번호
*/
@JsonProperty("accPW")
public void setAccPW( java.lang.String accPW ) {
isSet_accPW = true;
this.accPW = accPW;
}
/** Property set << accPW >> ]]
*******************************************************************************************************************************/
/*******************************************************************************************************************************
* Property set << amt >> [[ */
@XmlTransient
private boolean isSet_amt = false;
protected boolean isSet_amt()
{
return this.isSet_amt;
}
protected void setIsSet_amt(boolean value)
{
this.isSet_amt = value;
}
/**
* java.math.BigDecimal - String value setter
* @Description 잔액
*/
public void setAmt(java.lang.String value) {
isSet_amt = true;
this.amt = new java.math.BigDecimal(value);
}
/**
* java.math.BigDecimal - Double value setter
* @Description 잔액
*/
public void setAmt(double value) {
isSet_amt = true;
this.amt = java.math.BigDecimal.valueOf(value);
}
/**
* java.math.BigDecimal - Long value setter
* @Description 잔액
*/
public void setAmt(long value) {
isSet_amt = true;
this.amt = java.math.BigDecimal.valueOf(value);
}
@BxmOmm_Field(referenceType="reference", description="잔액", formatType="", format="", align="right", length=20, decimal=0, arrayReference="", fill="", comment="", encrypt="", validationRule="")
private java.math.BigDecimal amt = new java.math.BigDecimal("0.0");
/**
* @Description 잔액
*/
public java.math.BigDecimal getAmt(){
return amt;
}
/**
* @Description 잔액
*/
@JsonProperty("amt")
public void setAmt( java.math.BigDecimal amt ) {
isSet_amt = true;
this.amt = amt;
}
/** Property set << amt >> ]]
*******************************************************************************************************************************/
/*******************************************************************************************************************************
* Property set << cusNm >> [[ */
@XmlTransient
private boolean isSet_cusNm = false;
protected boolean isSet_cusNm()
{
return this.isSet_cusNm;
}
protected void setIsSet_cusNm(boolean value)
{
this.isSet_cusNm = value;
}
@BxmOmm_Field(referenceType="reference", description="고객명", formatType="", format="", align="left", length=20, decimal=0, arrayReference="", fill="", comment="", encrypt="", validationRule="")
private java.lang.String cusNm = null;
/**
* @Description 고객명
*/
public java.lang.String getCusNm(){
return cusNm;
}
/**
* @Description 고객명
*/
@JsonProperty("cusNm")
public void setCusNm( java.lang.String cusNm ) {
isSet_cusNm = true;
this.cusNm = cusNm;
}
/** Property set << cusNm >> ]]
*******************************************************************************************************************************/
@Override
public CustomerAccountCommonOut clone(){
try{
CustomerAccountCommonOut object= (CustomerAccountCommonOut)super.clone();
return object;
}
catch(CloneNotSupportedException e){
throw new bxm.omm.exception.CloneFailedException();
}
}
@Override
public int hashCode(){
final int prime=31;
int result = 1;
result = prime * result + ((cusId==null)?0:cusId.hashCode());
result = prime * result + ((opBrch==null)?0:opBrch.hashCode());
result = prime * result + ((accNum==null)?0:accNum.hashCode());
result = prime * result + ((accPW==null)?0:accPW.hashCode());
result = prime * result + ((amt==null)?0:amt.hashCode());
result = prime * result + ((cusNm==null)?0:cusNm.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if ( this == obj ) return true;
if ( obj == null ) return false;
if ( getClass() != obj.getClass() ) return false;
final bxm.dft.smp.com.onl.bc.dto.CustomerAccountCommonOut other= (bxm.dft.smp.com.onl.bc.dto.CustomerAccountCommonOut)obj;
if ( cusId == null){
if ( other.cusId != null ) return false;
}
else if ( !cusId.equals(other.cusId) )
return false;
if ( opBrch == null){
if ( other.opBrch != null ) return false;
}
else if ( !opBrch.equals(other.opBrch) )
return false;
if ( accNum == null){
if ( other.accNum != null ) return false;
}
else if ( !accNum.equals(other.accNum) )
return false;
if ( accPW == null){
if ( other.accPW != null ) return false;
}
else if ( !accPW.equals(other.accPW) )
return false;
if ( amt == null){
if ( other.amt != null ) return false;
}
else if ( !amt.equals(other.amt) )
return false;
if ( cusNm == null){
if ( other.cusNm != null ) return false;
}
else if ( !cusNm.equals(other.cusNm) )
return false;
return true;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append( "\n[bxm.dft.smp.com.onl.bc.dto.CustomerAccountCommonOut:\n");
sb.append("\tcusId: ");
sb.append(cusId==null?"null":getCusId());
sb.append("\n");
sb.append("\topBrch: ");
sb.append(opBrch==null?"null":getOpBrch());
sb.append("\n");
sb.append("\taccNum: ");
sb.append(accNum==null?"null":getAccNum());
sb.append("\n");
sb.append("\taccPW: ");
sb.append(accPW==null?"null":getAccPW());
sb.append("\n");
sb.append("\tamt: ");
sb.append(amt==null?"null":getAmt());
sb.append("\n");
sb.append("\tcusNm: ");
sb.append(cusNm==null?"null":getCusNm());
sb.append("\n");
sb.append("]\n");
return sb.toString();
}
/**
* Only for Fixed-Length Data
*/
@Override
public long predictMessageLength(){
long messageLen= 0;
messageLen+= 10; /* cusId */
messageLen+= 1; /* opBrch */
messageLen+= 6; /* accNum */
messageLen+= 4; /* accPW */
messageLen+= 20; /* amt */
messageLen+= 20; /* cusNm */
return messageLen;
}
@Override
@JsonIgnore
public java.util.List<String> getFieldNames(){
java.util.List<String> fieldNames= new java.util.ArrayList<String>();
fieldNames.add("cusId");
fieldNames.add("opBrch");
fieldNames.add("accNum");
fieldNames.add("accPW");
fieldNames.add("amt");
fieldNames.add("cusNm");
return fieldNames;
}
@Override
@JsonIgnore
public java.util.Map<String, Object> getFieldValues(){
java.util.Map<String, Object> fieldValueMap= new java.util.HashMap<String, Object>();
fieldValueMap.put("cusId", get("cusId"));
fieldValueMap.put("opBrch", get("opBrch"));
fieldValueMap.put("accNum", get("accNum"));
fieldValueMap.put("accPW", get("accPW"));
fieldValueMap.put("amt", get("amt"));
fieldValueMap.put("cusNm", get("cusNm"));
return fieldValueMap;
}
@XmlTransient
@JsonIgnore
private Hashtable<String, Object> htDynamicVariable = new Hashtable<String, Object>();
public Object get(String key) throws IllegalArgumentException{
switch( key.hashCode() ){
case 95027004 : /* cusId */
return getCusId();
case -1011618250 : /* opBrch */
return getOpBrch();
case -1423483067 : /* accNum */
return getAccNum();
case 92628552 : /* accPW */
return getAccPW();
case 96712 : /* amt */
return getAmt();
case 95027168 : /* cusNm */
return getCusNm();
default :
if ( htDynamicVariable.containsKey(key) ) return htDynamicVariable.get(key);
else throw new IllegalArgumentException("Not found element : " + key);
}
}
@SuppressWarnings("unchecked")
public void set(String key, Object value){
switch( key.hashCode() ){
case 95027004 : /* cusId */
setCusId((java.lang.String) value);
return;
case -1011618250 : /* opBrch */
setOpBrch((java.lang.Integer) value);
return;
case -1423483067 : /* accNum */
setAccNum((java.lang.String) value);
return;
case 92628552 : /* accPW */
setAccPW((java.lang.String) value);
return;
case 96712 : /* amt */
setAmt((java.math.BigDecimal) value);
return;
case 95027168 : /* cusNm */
setCusNm((java.lang.String) value);
return;
default : htDynamicVariable.put(key, value);
}
}
}
| [
"NB-18122605@192.168.56.1"
] | NB-18122605@192.168.56.1 |
0205a6d2115fd2fd6c203dec74ed548cda6d31d1 | 20ac39980cdee59bc06eb3866b6a95b409775859 | /src/main/java/com/javacodegeeks/nio/echoservice/server/Server.java | 2276038e29ac2d46d3db8f254e94e5e7a4ea18c6 | [] | no_license | pwong00710/nio_echoserver | 0490e15068e12eec39c5cc483aa42208f9ad2d2d | ff5d5cdec7a222f72c59ddc45a982b3c1930c600 | refs/heads/master | 2020-03-24T09:56:50.189226 | 2018-07-28T03:20:08 | 2018-07-28T03:20:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,093 | java | package com.javacodegeeks.nio.echoservice.server;
import com.javacodegeeks.nio.echoservice.common.ChannelWriter;
import com.javacodegeeks.nio.echoservice.common.Constants;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.lang.reflect.Array;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.*;
import java.util.concurrent.*;
@Slf4j
public final class Server implements ChannelWriter {
private static final int BUFFER_SIZE = 1024;
private final int port;
private final Map<SocketChannel, StringBuilder> session;
private int corePoolSize = 4;
private int maxPoolSize = 4;
private long keepAliveTime = 5000;
// private final ExecutorService executor = Executors.newSingleThreadExecutor();
private final ExecutorService executor = Executors.newFixedThreadPool(4);
// private final ExecutorService executor = new ThreadPoolExecutor(
// corePoolSize,
// maxPoolSize,
// keepAliveTime,
// TimeUnit.MILLISECONDS,
// new ArrayBlockingQueue<>(1000));
public static void main(final String[] args) {
if (args.length < 1) {
throw new IllegalArgumentException("Expecting one argument (1) port.");
}
new Server(Integer.valueOf(args[0])).start();
}
private Server(final int port) {
this.port = port;
this.session = new ConcurrentHashMap<>();
}
private void start() {
try (Selector selector = Selector.open(); ServerSocketChannel channel = ServerSocketChannel.open()) {
initChannel(channel, selector);
while (!Thread.currentThread().isInterrupted()) {
if (selector.isOpen()) {
final int numKeys = selector.select();
// log.info("numKeys="+numKeys);
if (numKeys > 0) {
try {
Set<SelectionKey> copiedSet = new HashSet<>(selector.selectedKeys());
handleKeys(channel, copiedSet);
} finally {
selector.selectedKeys().clear();
}
}
} else {
Thread.currentThread().interrupt();
}
}
} catch (IOException e) {
throw new RuntimeException("Unable to start server.", e);
} finally {
this.session.clear();
}
}
private void initChannel(final ServerSocketChannel channel, final Selector selector) throws IOException {
assert !Objects.isNull(channel) && !Objects.isNull(selector);
channel.socket().setReuseAddress(true);
channel.configureBlocking(false);
channel.socket().bind(new InetSocketAddress(this.port));
channel.register(selector, SelectionKey.OP_ACCEPT);
log.info("Server is ready!");
}
private void handleKeys(final ServerSocketChannel channel, final Set<SelectionKey> keys) {
assert !Objects.isNull(keys) && !Objects.isNull(channel);
// executor.execute(new WorkerThread(session, channel, keys));
final Iterator<SelectionKey> iterator = keys.iterator();
while (iterator.hasNext()) {
try {
final SelectionKey key = iterator.next();
iterator.remove();
try {
if (key.isValid()) {
if (key.isAcceptable()) {
// log.info("doAccept");
doAccept(channel, key);
} else if (key.isReadable()) {
// log.info("doProcess");
// doProcess(key);
executor.execute(new WorkerThread(session, key));
} else {
throw new UnsupportedOperationException("Key not supported by server.");
}
} else {
throw new UnsupportedOperationException("Key not valid.");
}
} finally {
// iterator.remove();
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
// private void doWrite(final SelectionKey key) throws IOException {
// if (mustEcho(key)) {
// doEcho(key);
// }
// }
private void doAccept(final ServerSocketChannel channel, final SelectionKey key) throws IOException {
assert !Objects.isNull(key) && !Objects.isNull(channel);
final SocketChannel client = channel.accept();
client.configureBlocking(false);
client.register(key.selector(), SelectionKey.OP_READ);
// Create a session for the incoming connection
this.session.put(client, new StringBuilder());
}
// private void doProcess(final SelectionKey key) throws IOException {
// assert !Objects.isNull(key);
//
// final SocketChannel client = (SocketChannel) key.channel();
// final ByteBuffer buffer = ByteBuffer.allocate(BUFFER_SIZE);
//
// final int bytesRead = client.read(buffer);
// if (bytesRead > 0) {
// String message = new String(buffer.array()).trim();
//// log.info("read: "+message);
//
// this.session.get(client).append(message.trim());
// } else if (bytesRead < 0) {
// cleanUp(key);
// }
//
// if (mustEcho(key)) {
// doEcho(key);
// }
// }
//
// private void doEcho(final SelectionKey key) throws IOException {
// assert !Objects.isNull(key);
//
// StringBuilder sb = this.session.get(key.channel());
// String message = sb.toString();
//// log.info("write: "+message);
//
// final ByteBuffer buffer = ByteBuffer.wrap(message.trim().getBytes());
//
// doWrite(buffer, (SocketChannel) key.channel());
// sb.delete(0, sb.length());
// }
//
// private boolean mustEcho(final SelectionKey key) {
// assert !Objects.isNull(key);
//
// if (key.channel() instanceof SocketChannel) {
// StringBuilder sb = this.session.get(key.channel());
// if (sb != null) {
// return sb.toString().contains(Constants.END_MESSAGE_MARKER);
// }
// }
// return false;
// }
//
// private void cleanUp(final SelectionKey key) throws IOException {
// assert !Objects.isNull(key);
//
// this.session.remove(key.channel());
//
// key.channel().close();
// key.cancel();
// }
}
| [
"keith.kk.wong@pccw.com"
] | keith.kk.wong@pccw.com |
2880051e7c66f189821c116b9664d6f2517f9054 | 37aedd33482d8fa016ee34d121861e5083de5ecb | /RedSox/java/com/kidylee/RedSox/AppTest.java | 88d67c8a8f46dce34d35c19564d5c5169d1c028d | [] | no_license | kidylee/BostonBigPlayer | 50b71b430eb6a67030f3ebc8ffe3f2ca720541ed | 351724dc02adc173a0aaeb5f8e93938df7e61660 | refs/heads/master | 2021-01-10T08:18:29.508625 | 2015-12-04T22:32:49 | 2015-12-04T22:32:49 | 47,164,832 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | package com.kidylee.RedSox;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
| [
"kidylee@gmail.com"
] | kidylee@gmail.com |
82da4c4db58769138bb5f5ef61b706402d9d6c97 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/deeplearning4j--deeplearning4j/63b8277f800a3a737f5bf7853613fe0309d50c2d/after/FFT.java | 5ff9da350f2fd9b5cf7c21f2b704e659d76a50fd | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,475 | java | package org.deeplearning4j.linalg.fft;
import org.deeplearning4j.linalg.api.complex.IComplexNDArray;
import org.deeplearning4j.linalg.api.ndarray.INDArray;
import org.deeplearning4j.linalg.factory.NDArrays;
import org.deeplearning4j.linalg.util.ArrayUtil;
import org.deeplearning4j.linalg.util.ComplexNDArrayUtil;
/**
* FFT and IFFT
* @author Adam Gibson
*/
public class FFT {
/**
* FFT along a particular dimension
* @param transform the ndarray to applyTransformToOrigin
* @param numElements the desired number of elements in each fft
* @return the ffted output
*/
public static IComplexNDArray fft(INDArray transform,int numElements) {
IComplexNDArray inputC = NDArrays.createComplex(transform);
if(inputC.isVector())
return new VectorFFT(inputC.length()).apply(inputC);
else {
return rawfft(inputC,numElements,inputC.shape().length - 1);
}
}
/**
* 1d discrete fourier applyTransformToOrigin, note that this will
* throw an exception if the passed in input
* isn't a vector.
* See matlab's fft2 for more information
* @param inputC the input to applyTransformToOrigin
* @return the the discrete fourier applyTransformToOrigin of the passed in input
*/
public static IComplexNDArray fft(IComplexNDArray inputC) {
if(inputC.isVector())
return new VectorFFT(inputC.length()).apply(inputC);
else {
return rawfft(inputC,inputC.size(inputC.shape().length - 1),inputC.shape().length - 1);
}
}
/**
* 1d discrete fourier applyTransformToOrigin, note that this will
* throw an exception if the passed in input
* isn't a vector.
* See matlab's fft2 for more information
* @param input the input to applyTransformToOrigin
* @return the the discrete fourier applyTransformToOrigin of the passed in input
*/
public static IComplexNDArray fft(INDArray input) {
IComplexNDArray inputC = NDArrays.createComplex(input);
return fft(inputC);
}
/**
* FFT along a particular dimension
* @param transform the ndarray to applyTransformToOrigin
* @param numElements the desired number of elements in each fft
* @return the ffted output
*/
public static IComplexNDArray fft(INDArray transform,int numElements,int dimension) {
IComplexNDArray inputC = NDArrays.createComplex(transform);
if(inputC.isVector())
return new VectorFFT(numElements).apply(inputC);
else {
return rawfft(inputC,numElements,dimension);
}
}
/**
* 1d discrete fourier applyTransformToOrigin, note that this will
* throw an exception if the passed in input
* isn't a vector.
* See matlab's fft2 for more information
* @param inputC the input to applyTransformToOrigin
* @return the the discrete fourier applyTransformToOrigin of the passed in input
*/
public static IComplexNDArray fft(IComplexNDArray inputC,int numElements) {
return fft(inputC,numElements,inputC.shape().length - 1);
}
/**
* 1d discrete fourier applyTransformToOrigin, note that this will
* throw an exception if the passed in input
* isn't a vector.
* See matlab's fft2 for more information
* @param inputC the input to applyTransformToOrigin
* @return the the discrete fourier applyTransformToOrigin of the passed in input
*/
public static IComplexNDArray fft(IComplexNDArray inputC,int numElements,int dimension) {
if(inputC.isVector())
return new VectorFFT(numElements).apply(inputC);
else {
return rawfft(inputC,numElements,dimension);
}
}
/**
* IFFT along a particular dimension
* @param transform the ndarray to applyTransformToOrigin
* @param numElements the desired number of elements in each fft
* @param dimension the dimension to do fft along
* @return the iffted output
*/
public static IComplexNDArray ifft(INDArray transform,int numElements,int dimension) {
IComplexNDArray inputC = NDArrays.createComplex(transform);
if(inputC.isVector())
return new VectorIFFT(numElements).apply(inputC);
else {
return rawifft(inputC, numElements, dimension);
}
}
/**
* 1d discrete fourier applyTransformToOrigin, note that this will
* throw an exception if the passed in input
* isn't a vector.
* See matlab's fft2 for more information
* @param inputC the input to applyTransformToOrigin
* @return the the discrete fourier applyTransformToOrigin of the passed in input
*/
public static IComplexNDArray ifft(IComplexNDArray inputC) {
if(inputC.isVector())
return new VectorIFFT(inputC.length()).apply(inputC);
else {
return rawifft(inputC, inputC.size(inputC.shape().length - 1), inputC.shape().length - 1);
}
}
/**
* FFT along a particular dimension
* @param transform the ndarray to applyTransformToOrigin
* @param numElements the desired number of elements in each fft
* @return the ffted output
*/
public static IComplexNDArray ifft(INDArray transform,int numElements) {
IComplexNDArray inputC = NDArrays.createComplex(transform);
if(inputC.isVector())
return new VectorIFFT(numElements).apply(inputC);
else {
return rawifft(inputC,numElements,inputC.shape().length - 1);
}
}
/**
* 1d discrete fourier applyTransformToOrigin, note that this will
* throw an exception if the passed in input
* isn't a vector.
* See matlab's fft2 for more information
* @param inputC the input to applyTransformToOrigin
* @return the the discrete fourier applyTransformToOrigin of the passed in input
*/
public static IComplexNDArray ifft(IComplexNDArray inputC,int numElements,int dimension) {
if(inputC.isVector())
return new VectorIFFT(numElements).apply(inputC);
else {
return rawifft(inputC,numElements,dimension);
}
}
/**
* ND IFFT, computes along the first on singleton dimension of
* applyTransformToOrigin
* @param transform the ndarray to applyTransformToOrigin
* @param dimension the dimension to iterate along
* @param numElements the desired number of elements in each fft
* @return the reverse ifft of the passed in array
*/
public static IComplexNDArray ifftn(INDArray transform,int dimension,int numElements) {
return ifftn(NDArrays.createComplex(transform),dimension,numElements);
}
public static IComplexNDArray irfftn(IComplexNDArray arr) {
int[] shape = arr.shape();
IComplexNDArray ret = arr.dup();
for(int i = 0; i < shape.length - 1; i++) {
ret = FFT.ifftn(ret,i,shape[i]);
}
return irfft(ret, 0);
}
public static IComplexNDArray irfft(IComplexNDArray arr,int dimension) {
return fftn(arr, arr.size(dimension), dimension);
}
public static IComplexNDArray irfft(IComplexNDArray arr) {
return arr;
}
/**
* ND IFFT
* @param transform the ndarray to applyTransformToOrigin
* @param dimension the dimension to iterate along
* @param numElements the desired number of elements in each fft
* @return the transformed array
*/
public static IComplexNDArray ifftn(IComplexNDArray transform,int dimension,int numElements) {
if(numElements < 1)
throw new IllegalArgumentException("No elements specified");
int[] finalShape = ArrayUtil.replace(transform.shape(), dimension, numElements);
int[] axes = ArrayUtil.range(0, finalShape.length);
IComplexNDArray result = transform.dup();
int desiredElementsAlongDimension = result.size(dimension);
if(numElements > desiredElementsAlongDimension) {
result = ComplexNDArrayUtil.padWithZeros(result, finalShape);
}
else if(numElements < desiredElementsAlongDimension)
result = ComplexNDArrayUtil.truncate(result,numElements,dimension);
return rawifftn(result, finalShape, axes);
}
/**
* Performs FFT along the first non singleton dimension of
* applyTransformToOrigin. This means
* @param transform the ndarray to applyTransformToOrigin
* @param dimension the dimension to iterate along
* @param numElements the desired number of elements in each fft
* along each dimension from each slice (note: each slice)
* @return the transformed array
*/
public static IComplexNDArray fftn(IComplexNDArray transform,int dimension,int numElements) {
if(numElements < 1)
throw new IllegalArgumentException("No elements specified");
int[] finalShape = ArrayUtil.replace(transform.shape(), dimension, numElements);
int[] axes = ArrayUtil.range(0, finalShape.length);
IComplexNDArray result = transform.dup();
int desiredElementsAlongDimension = result.size(dimension);
if(numElements > desiredElementsAlongDimension) {
result = ComplexNDArrayUtil.padWithZeros(result,finalShape);
}
else if(numElements < desiredElementsAlongDimension)
result = ComplexNDArrayUtil.truncate(result,numElements,dimension);
return rawfftn(result,finalShape,axes);
}
/**
* Computes the fft along the first non singleton dimension of applyTransformToOrigin
* when it is a matrix
* @param transform the ndarray to applyTransformToOrigin
* @param dimension the dimension to do fft along
* @param numElements the desired number of elements in each fft
* @return the fft of the specified ndarray
*/
public static IComplexNDArray fftn(INDArray transform,int dimension,int numElements) {
return fftn(NDArrays.createComplex(transform),dimension,numElements);
}
/**
* FFT on the whole array (n is equal the first dimension shape)
* @param transform the matrix to applyTransformToOrigin
* @return the ffted array
*/
public static IComplexNDArray fftn(INDArray transform) {
return fftn(transform,transform.shape().length - 1,transform.shape()[transform.shape().length - 1]);
}
/**
* FFT on the whole array (n is equal the first dimension shape)
* @param transform the matrix to applyTransformToOrigin
* @return the ffted array
*/
public static IComplexNDArray fftn(IComplexNDArray transform) {
return fftn(transform,transform.shape().length - 1,transform.shape()[transform.shape().length - 1]);
}
public static IComplexNDArray ifftn(IComplexNDArray transform,int dimension) {
return ifftn(transform, dimension, transform.shape()[dimension]);
}
public static IComplexNDArray ifftn(IComplexNDArray transform) {
return ifftn(transform, transform.shape().length - 1,transform.size(transform.shape().length - 1));
}
public static IComplexNDArray ifftn(INDArray transform) {
return ifftn(transform, transform.shape().length - 1, transform.size(transform.shape().length - 1));
}
//underlying ifftn
public static IComplexNDArray rawifftn(IComplexNDArray transform,int[] shape,int[] axes) {
assert shape.length > 0 : "Shape length must be > 0";
assert shape.length == axes.length : "Axes and shape must be the same length";
IComplexNDArray result = transform.dup();
for(int i = shape.length - 1; i >= 0; i--) {
result = FFT.ifft(result,shape[i],axes[i]);
}
return result;
}
//underlying fftn
public static IComplexNDArray rawfftn(IComplexNDArray transform,int[] shape,int[] axes) {
IComplexNDArray result = transform.dup();
for(int i = shape.length - 1; i >= 0; i--) {
result = FFT.fft(result, shape[i], axes[i]);
}
return result;
}
//underlying fftn
/**
* Underlying fft algorithm
* @param transform the ndarray to transform
* @param n the desired number of elements
* @param dimension the dimension to do fft along
* @return the transformed ndarray
*/
public static IComplexNDArray rawfft(IComplexNDArray transform,int n,int dimension) {
IComplexNDArray result = transform.dup();
if(transform.size(dimension) != n) {
int[] shape = ArrayUtil.copy(result.shape());
shape[dimension] = n;
if(transform.size(dimension) > n) {
result = ComplexNDArrayUtil.truncate(result,n,dimension);
}
else
result = ComplexNDArrayUtil.padWithZeros(result,shape);
}
if(dimension != result.shape().length - 1)
result = result.swapAxes(result.shape().length - 1,dimension);
result.iterateOverAllRows(new FFTSliceOp(result.size(result.shape().length - 1)));
if(dimension != result.shape().length - 1)
result = result.swapAxes(result.shape().length - 1,dimension);
return result;
}
//underlying fftn
public static IComplexNDArray rawifft(IComplexNDArray transform,int n,int dimension) {
IComplexNDArray result = transform.dup();
if(transform.size(dimension) != n) {
int[] shape = ArrayUtil.copy(result.shape());
shape[dimension] = n;
if(transform.size(dimension) > n) {
result = ComplexNDArrayUtil.truncate(result,n,dimension);
}
else
result = ComplexNDArrayUtil.padWithZeros(result,shape);
}
if(dimension != result.shape().length - 1)
result = result.swapAxes(result.shape().length - 1,dimension);
result.iterateOverAllRows(new IFFTSliceOp(result.size(result.shape().length - 1)));
if(dimension != result.shape().length - 1)
result = result.swapAxes(result.shape().length - 1,dimension);
return result;
}
//underlying fftn
public static IComplexNDArray rawifft(IComplexNDArray transform,int dimension) {
return rawifft(transform,transform.shape()[dimension],dimension);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
351928b2e8073ec7eb9e735dad50d7edac0b2ad6 | 2b228f5dfbaeb232274a21a9c480838fad93a52a | /ProjectGlacier/src/main/java/com/chameleon/selenium/exceptions/ElementNotVisibleException.java | 7a71455ee85eef47ee0d46565582a5438a3c19c3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | cmdnath/ProjectGlacier | 86b40ecada4296919198030418e4bf4031b2bb6a | 74151fb9a580814766daf2ac5dd75a8082df1428 | refs/heads/master | 2022-11-20T18:28:52.532431 | 2019-06-02T05:24:38 | 2019-06-02T05:24:38 | 184,435,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 480 | java | package com.chameleon.selenium.exceptions;
import com.chameleon.selenium.ExtendedDriver;
import com.chameleon.selenium.web.WebException;
public class ElementNotVisibleException extends WebException {
private static final long serialVersionUID = 7724792038612608062L;
public ElementNotVisibleException(String message) {
super(message);
}
public ElementNotVisibleException(String message, ExtendedDriver driver) {
super(message, driver);
}
}
| [
"cmdnath@gmail.com"
] | cmdnath@gmail.com |
112eafdfc885a599d162d9607b2c4b6e2308c3b0 | b594fcfc7c385fdb62af30527e73ffb06ca31eaf | /weatherapp/src/test/java/com/smcmaster/mockitotestingbook/chapter3/MockFromScratchTest.java | 9812ff9b82b80763047fcfbb98829fcaddce4417 | [
"Apache-2.0"
] | permissive | scottmcmaster/mocktestingbook | d5683af5c718e2a82d7509fc4dc52b3689824072 | abf17b242c6f6289b2249699af390106d132c039 | refs/heads/master | 2022-01-27T16:21:54.686449 | 2021-10-24T16:54:11 | 2021-10-24T16:54:11 | 88,381,570 | 0 | 0 | Apache-2.0 | 2022-01-21T23:15:41 | 2017-04-16T00:21:20 | Java | UTF-8 | Java | false | false | 1,677 | java | package com.smcmaster.mockitotestingbook.chapter3;
import static org.junit.Assert.*;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import com.smcmaster.mocktestingbook.chapter3.WeatherServiceMock;
import com.smcmaster.weatherapp.models.Weather;
import com.smcmaster.weatherapp.resources.WeatherResourceV2;
public class MockFromScratchTest {
private String json;
private WeatherServiceMock mock;
private WeatherResourceV2 resource;
@Before
public void setUp() throws IOException {
json = IOUtils.toString(
getClass().getResourceAsStream("/beijing_owm.json"),
"UTF-8");
mock = new WeatherServiceMock();
resource = new WeatherResourceV2(mock);
}
@Test
public void testGetWeatherForCity_Valid() throws Exception {
// Set up expectations.
mock.getWeatherForCity("cn", "beijing");
mock.getWeatherForCityThenReturn(json);
// Replay and test.
mock.replay();
Weather result = resource.getWeatherForCity("cn", "beijing");
// Verify.
assertEquals("beijing", result.getCityName());
assertEquals("10", result.getTemperature());
assertEquals("1000", result.getPressure());
assertEquals("2@300", result.getWind());
assertEquals("27", result.getHumidity());
mock.verify();
}
@Test
@Ignore
public void testGetWeatherForCity_WillFailVerify() throws Exception {
// Set up expectations.
mock.getWeatherForCity("cn", "beijing");
mock.getWeatherForCityThenReturn(json);
// Replay and test.
mock.replay();
// Verify.
mock.verify();
}
}
| [
"scott.d.mcmaster@gmail.com"
] | scott.d.mcmaster@gmail.com |
419a336e7ac07985ba63345baa0904e3a601207a | 74c2a538f1a1276017223e3222c867cc594c9da0 | /riot-core/src/main/java/com/redislabs/riot/AbstractImportCommand.java | e033280ddcdcee20ac4c44de8cc95284c7baee10 | [
"Apache-2.0"
] | permissive | komal-kothari/riot | ed1f267a0028adda3d96cef329e8b485f739dee7 | 4c68a107c8ed7db6ad627c01952e042fe4dac369 | refs/heads/master | 2023-01-12T21:02:58.181081 | 2020-11-09T02:05:00 | 2020-11-09T02:05:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,165 | java | package com.redislabs.riot;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.redis.support.AbstractRedisItemWriter;
import org.springframework.batch.item.support.CompositeItemProcessor;
import org.springframework.batch.item.support.CompositeItemWriter;
import org.springframework.util.Assert;
import com.redislabs.riot.processor.MapProcessor;
import com.redislabs.riot.processor.SpelProcessor;
import com.redislabs.riot.redis.AbstractRedisCommand;
import com.redislabs.riot.redis.EvalCommand;
import com.redislabs.riot.redis.ExpireCommand;
import com.redislabs.riot.redis.GeoaddCommand;
import com.redislabs.riot.redis.HmsetCommand;
import com.redislabs.riot.redis.LpushCommand;
import com.redislabs.riot.redis.NoopCommand;
import com.redislabs.riot.redis.RpushCommand;
import com.redislabs.riot.redis.SaddCommand;
import com.redislabs.riot.redis.SetCommand;
import com.redislabs.riot.redis.XaddCommand;
import com.redislabs.riot.redis.ZaddCommand;
import lombok.Getter;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
@Command(subcommands = { EvalCommand.class, ExpireCommand.class, GeoaddCommand.class, HmsetCommand.class,
LpushCommand.class, NoopCommand.class, RpushCommand.class, SaddCommand.class, SetCommand.class,
XaddCommand.class,
ZaddCommand.class }, subcommandsRepeatable = true, synopsisSubcommandLabel = "[REDIS COMMAND]", commandListHeading = "Redis commands:%n")
public abstract class AbstractImportCommand<I, O> extends AbstractTransferCommand<I, O> {
/*
* Initialized manually during command parsing
*/
@Getter
private List<AbstractRedisCommand<O>> redisCommands = new ArrayList<>();
@Option(arity = "1..*", names = "--spel", description = "SpEL expression to produce a field", paramLabel = "<f=exp>")
private Map<String, String> spel = new HashMap<>();
@Option(arity = "1..*", names = "--var", description = "Register a variable in the SpEL processor context", paramLabel = "<v=exp>")
private Map<String, String> variables = new HashMap<>();
@Option(arity = "1..*", names = "--regex", description = "Extract named values from source field using regex", paramLabel = "<f=exp>")
private Map<String, String> regexes = new HashMap<>();
@Option(names = "--date", description = "Processor date format (default: ${DEFAULT-VALUE})", paramLabel = "<string>")
private String dateFormat = new SimpleDateFormat().toPattern();
protected ItemProcessor<Map<String, Object>, Map<String, Object>> mapProcessor() throws Exception {
List<ItemProcessor<Map<String, Object>, Map<String, Object>>> processors = new ArrayList<>();
if (!spel.isEmpty()) {
processors.add(configure(SpelProcessor.builder().dateFormat(new SimpleDateFormat(dateFormat))
.variables(variables).fields(spel)).build());
}
if (!regexes.isEmpty()) {
processors.add(MapProcessor.builder().regexes(regexes).build());
}
if (processors.isEmpty()) {
return null;
}
if (processors.size() == 1) {
return processors.get(0);
}
CompositeItemProcessor<Map<String, Object>, Map<String, Object>> compositeItemProcessor = new CompositeItemProcessor<>();
compositeItemProcessor.setDelegates(processors);
return compositeItemProcessor;
}
@Override
protected ItemWriter<O> writer() throws Exception {
Assert.notNull(redisCommands, "RedisCommands not set");
List<AbstractRedisItemWriter<String, String, O>> writers = new ArrayList<>();
for (AbstractRedisCommand<O> redisCommand : redisCommands) {
writers.add(redisCommand.writer());
}
if (writers.isEmpty()) {
throw new IllegalArgumentException("No Redis command specified");
}
if (writers.size() == 1) {
return (ItemWriter<O>) writers.get(0);
}
CompositeItemWriter<O> writer = new CompositeItemWriter<>();
writer.setDelegates(new ArrayList<>(writers));
return writer;
}
@Override
protected String transferNameFormat() {
return "Importing from %s";
}
}
| [
"jruaux@gmail.com"
] | jruaux@gmail.com |
c2c03ea4726217f5cc2f76fc3e3600ec3ac76a17 | 44dea38f4052df45c206ea2d1bdfe3bca0b87431 | /plugins/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ActionParamTagTest.java | bc02332f582a82af6d236e60658736cf78aebc8b | [] | no_license | maxandersen/jbosstools-integration-tests | 3758784ccdd0211f3ae34a8aadebdf1e63463e53 | 1fa961acf653ed278f270ac720f1b60421029da1 | refs/heads/master | 2020-05-21T00:26:49.613221 | 2012-09-20T15:46:33 | 2012-09-20T15:46:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,673 | java | /*******************************************************************************
* Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.vpe.ui.bot.test.editor.tags;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
import org.mozilla.interfaces.nsIDOMNode;
/**
* Tests Rich Faces DataTable Tag behavior
* @author vlado pakan
*
*/
public class ActionParamTagTest extends AbstractTagTest{
@Override
protected void initTestPage() {
initTestPage(TestPageType.XHTML,
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" +
"<html xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
" xmlns:f=\"http://java.sun.com/jsf/core\"\n" +
" xmlns:a4j=\"http://richfaces.org/a4j\"\n" +
" xmlns:h=\"http://java.sun.com/jsf/html\">\n" +
"<head>\n" +
"</head>\n" +
"<body>\n" +
" <f:view>\n" +
" <a4j:commandButton value=\"Set Name to Alex\">\n" +
" <a4j:actionparam name=\"username\" value=\"Alex\"/>\n" +
" </a4j:commandButton>\n" +
" </f:view>\n" +
" </body>\n" +
"</html>");
}
@Override
protected void verifyTag() {
// check tag selection
getSourceEditor().selectLine(10);
bot.sleep(Timing.time3S());
nsIDOMNode selectedVisualNode=getVisualEditor().getSelectedDomNode();
assertNotNull("Selected node in Visual Editor cannot be null",selectedVisualNode);
String expectedSelectedNode = "DIV";
assertTrue("Selected Node has to be '" + expectedSelectedNode + "' node but is " + selectedVisualNode.getLocalName(),
selectedVisualNode.getLocalName().equalsIgnoreCase(expectedSelectedNode));
String selectedNodeTitle = SWTBotWebBrowser.getNodeAttribute(selectedVisualNode, "title");
assertNotNull("Selected Node in Visual Editor has to have attribute title but it has not." ,selectedNodeTitle);
final String expectedTitle = "f:view";
assertTrue("Selected Node in Visual Editor has to have attribute title=\"" + expectedTitle +
"\" but has \"" + selectedNodeTitle + "\"",
expectedTitle.equals(selectedNodeTitle));
}
}
| [
"vpakan@redhat.com"
] | vpakan@redhat.com |
64975d6233d2acc54fdfd24ecc3bb188d031eb3d | a2b0d2bc94b659f9c696f229840b8ce2c5396161 | /src/main/java/com/cos/photogramstart/handler/aop/ValidationAdvice.java | 8d7df9aced04dd5dacc1dd5bf0cd902965ce9736 | [] | no_license | gogoheejun/photogram | 76536bb1f88e589f085a5b5592ade94572fd61a2 | bf6bdba9a4ca93801a62ec94085b9ee9c73407df | refs/heads/main | 2023-07-25T11:56:08.487655 | 2021-09-08T10:23:49 | 2021-09-08T10:23:49 | 388,644,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,504 | java | package com.cos.photogramstart.handler.aop;
import java.util.HashMap;
import java.util.Map;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import com.cos.photogramstart.handler.ex.CustomValidationApiException;
import com.cos.photogramstart.handler.ex.CustomValidationException;
@Component //ioc에 띄워야 하는데, 애매할땐 component. restController,Service이런애들이다 component를 상속해서 만든애들임
@Aspect //이걸 써야 aop할수있는 애가 됨
public class ValidationAdvice {
@Around("execution(* com.cos.photogramstart.web.api.*Controller.*(..))") //어떤 특정함수시작 전에 시작해서 끝날때까지 관여하기...@Before는 시작전에 발동, @After는 끝난담에 발동
public Object apiAdvice(ProceedingJoinPoint proceedingJoinPoint)throws Throwable {
//proceedingJoinPoint란, 접근하는 클래스의 함수의 모든곳에 접근할 수 있는 변수임.
Object[] args = proceedingJoinPoint.getArgs();
for(Object arg: args) {
if(arg instanceof BindingResult) {
System.out.println("유효성 검사를 하는 함수입니다!!");
BindingResult bindingResult = (BindingResult) arg;
if(bindingResult.hasErrors()) {
Map<String,String> errorMap = new HashMap<>();
for(FieldError error: bindingResult.getFieldErrors()){
errorMap.put(error.getField(), error.getDefaultMessage());
}
throw new CustomValidationApiException("유효성검사 실패함",errorMap);
}
}
}
return proceedingJoinPoint.proceed();//다시 돌아가서 원래함수 실행시킴
}
@Around("execution(* com.cos.photogramstart.web.*Controller.*(..))")
public Object advice(ProceedingJoinPoint proceedingJoinPoint)throws Throwable {
Object[] args = proceedingJoinPoint.getArgs();
for(Object arg: args) {
if(arg instanceof BindingResult) {
BindingResult bindingResult = (BindingResult) arg;
if(bindingResult.hasErrors()) {
Map<String,String> errorMap = new HashMap<>();
for(FieldError error: bindingResult.getFieldErrors()){
errorMap.put(error.getField(), error.getDefaultMessage());
}
throw new CustomValidationException("유효성검사 실패함",errorMap);
}
}
}
return proceedingJoinPoint.proceed();
}
}
| [
"heejjuunn@gmail.com"
] | heejjuunn@gmail.com |
a10c177133fc8e1ccb630d04fc90e30f64a493aa | ae7ba9c83692cfcb39e95483d84610715930fe9e | /MyCATApache/Mycat-Web/src/main/java/org/mycat/web/model/SchemaChildTable.java | 63283e062ccbf31936145974710cb8419ec580c7 | [
"Apache-2.0"
] | permissive | xenron/sandbox-github-clone | 364721769ea0784fb82827b07196eaa32190126b | 5eccdd8631f8bad78eb88bb89144972dbabc109c | refs/heads/master | 2022-05-01T21:18:43.101664 | 2016-09-12T12:38:32 | 2016-09-12T12:38:32 | 65,951,766 | 5 | 7 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package org.mycat.web.model;
public class SchemaChildTable {
private String name;
private String joinkey;
private String parentkey;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getJoinkey() {
return joinkey;
}
public void setJoinkey(String joinkey) {
this.joinkey = joinkey;
}
public String getParentkey() {
return parentkey;
}
public void setParentkey(String parentkey) {
this.parentkey = parentkey;
}
}
| [
"xenron@outlook.com"
] | xenron@outlook.com |
3af11b0d04a3a312d22ce5a663dac8ecd802cd38 | 46ba390011c64f3a9a8a0149755495beeb884656 | /marshmallow/packages/services/Telecomm/src/com/android/server/telecom/NewOutgoingCallIntentBroadcaster.java | f33d4f5a6f185e5d9b89532ffd334bb7226096e9 | [] | no_license | logicdroid-project/Version-3.0 | ff1811c3c197fe8ac0a6e28c1c4726bd6c15ca26 | fcc0c8e144e9849119e319c59a94a3693d104f18 | refs/heads/master | 2021-01-19T09:52:23.858367 | 2017-03-21T16:54:45 | 2017-03-21T16:54:45 | 82,148,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,097 | java | /*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.server.telecom;
import android.app.AppOpsManager;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Trace;
import android.os.UserHandle;
import android.telecom.GatewayInfo;
import android.telecom.PhoneAccount;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.telephony.DisconnectCause;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
// LogicDroid
// ##############################################
import android.pem.Monitor;
import android.pem.PrivilegeEscalationException;
import android.pem.Event;
import android.os.Binder;
// ##############################################
// TODO: Needed for move to system service: import com.android.internal.R;
/**
* OutgoingCallIntentBroadcaster receives CALL and CALL_PRIVILEGED Intents, and broadcasts the
* ACTION_NEW_OUTGOING_CALL intent. ACTION_NEW_OUTGOING_CALL is an ordered broadcast intent which
* contains the phone number being dialed. Applications can use this intent to (1) see which numbers
* are being dialed, (2) redirect a call (change the number being dialed), or (3) prevent a call
* from being placed.
*
* After the other applications have had a chance to see the ACTION_NEW_OUTGOING_CALL intent, it
* finally reaches the {@link NewOutgoingCallBroadcastIntentReceiver}.
*
* Calls where no number is present (like for a CDMA "empty flash" or a nonexistent voicemail
* number) are exempt from being broadcast.
*
* Calls to emergency numbers are still broadcast for informative purposes. The call is placed
* prior to sending ACTION_NEW_OUTGOING_CALL and cannot be redirected nor prevented.
*/
class NewOutgoingCallIntentBroadcaster {
private static final String EXTRA_ACTUAL_NUMBER_TO_DIAL =
"android.telecom.extra.ACTUAL_NUMBER_TO_DIAL";
/**
* Legacy string constants used to retrieve gateway provider extras from intents. These still
* need to be copied from the source call intent to the destination intent in order to
* support third party gateway providers that are still using old string constants in
* Telephony.
*/
public static final String EXTRA_GATEWAY_PROVIDER_PACKAGE =
"com.android.phone.extra.GATEWAY_PROVIDER_PACKAGE";
public static final String EXTRA_GATEWAY_URI = "com.android.phone.extra.GATEWAY_URI";
public static final String EXTRA_GATEWAY_ORIGINAL_URI =
"com.android.phone.extra.GATEWAY_ORIGINAL_URI";
private final CallsManager mCallsManager;
private final Call mCall;
private final Intent mIntent;
private final Context mContext;
/*
* Whether or not the outgoing call intent originated from the default phone application. If
* so, it will be allowed to make emergency calls, even with the ACTION_CALL intent.
*/
private final boolean mIsDefaultOrSystemPhoneApp;
NewOutgoingCallIntentBroadcaster(Context context, CallsManager callsManager, Call call,
Intent intent, boolean isDefaultPhoneApp) {
mContext = context;
mCallsManager = callsManager;
mCall = call;
mIntent = intent;
mIsDefaultOrSystemPhoneApp = isDefaultPhoneApp;
}
/**
* Processes the result of the outgoing call broadcast intent, and performs callbacks to
* the OutgoingCallIntentBroadcasterListener as necessary.
*/
private class NewOutgoingCallBroadcastIntentReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Trace.beginSection("onReceiveNewOutgoingCallBroadcast");
Log.v(this, "onReceive: %s", intent);
// Once the NEW_OUTGOING_CALL broadcast is finished, the resultData is used as the
// actual number to call. (If null, no call will be placed.)
String resultNumber = getResultData();
Log.i(this, "Received new-outgoing-call-broadcast for %s with data %s", mCall,
Log.pii(resultNumber));
boolean endEarly = false;
if (resultNumber == null) {
Log.v(this, "Call cancelled (null number), returning...");
endEarly = true;
} else if (PhoneNumberUtils.isPotentialLocalEmergencyNumber(mContext, resultNumber)) {
Log.w(this, "Cannot modify outgoing call to emergency number %s.", resultNumber);
endEarly = true;
}
if (endEarly) {
if (mCall != null) {
mCall.disconnect(true /* wasViaNewOutgoingCall */);
}
Trace.endSection();
return;
}
Uri resultHandleUri = Uri.fromParts(PhoneNumberUtils.isUriNumber(resultNumber) ?
PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL, resultNumber, null);
Uri originalUri = mIntent.getData();
if (originalUri.getSchemeSpecificPart().equals(resultNumber)) {
Log.v(this, "Call number unmodified after new outgoing call intent broadcast.");
} else {
Log.v(this, "Retrieved modified handle after outgoing call intent broadcast: "
+ "Original: %s, Modified: %s",
Log.pii(originalUri),
Log.pii(resultHandleUri));
}
GatewayInfo gatewayInfo = getGateWayInfoFromIntent(intent, resultHandleUri);
mCallsManager.placeOutgoingCall(mCall, resultHandleUri, gatewayInfo,
mIntent.getBooleanExtra(TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE,
false),
mIntent.getIntExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE,
VideoProfile.STATE_AUDIO_ONLY));
Trace.endSection();
}
}
/**
* Processes the supplied intent and starts the outgoing call broadcast process relevant to the
* intent.
*
* This method will handle three kinds of actions:
*
* - CALL (intent launched by all third party dialers)
* - CALL_PRIVILEGED (intent launched by system apps e.g. system Dialer, voice Dialer)
* - CALL_EMERGENCY (intent launched by lock screen emergency dialer)
*
* @return {@link DisconnectCause#NOT_DISCONNECTED} if the call succeeded, and an appropriate
* {@link DisconnectCause} if the call did not, describing why it failed.
*/
int processIntent() {
Log.v(this, "Processing call intent in OutgoingCallIntentBroadcaster.");
Intent intent = mIntent;
String action = intent.getAction();
final Uri handle = intent.getData();
if (handle == null) {
Log.w(this, "Empty handle obtained from the call intent.");
return DisconnectCause.INVALID_NUMBER;
}
// LogicDroid
// ##################################################################
// # Hook Call #
// ##################################################################
Log.i("LogicDroid", "Request to do call from " + Binder.getCallingUid());
try
{
mContext.checkPrivilegeEscalation(Binder.getCallingUid(), Monitor.CALLPRIVILEGED_UID, System.currentTimeMillis(), "android.permission.CALL_PHONE");
}
catch (PrivilegeEscalationException pe)
{
// do nothing, just log that it has been blocked
Log.w("LogicDroid", "Request to do call from " + Binder.getCallingUid() +" is blocked because Privilege Escalation is detected");
return DisconnectCause.OUTGOING_CANCELED;
}
// ##################################################################
boolean isVoicemailNumber = PhoneAccount.SCHEME_VOICEMAIL.equals(handle.getScheme());
if (isVoicemailNumber) {
if (Intent.ACTION_CALL.equals(action)
|| Intent.ACTION_CALL_PRIVILEGED.equals(action)) {
// Voicemail calls will be handled directly by the telephony connection manager
Log.i(this, "Placing call immediately instead of waiting for "
+ " OutgoingCallBroadcastReceiver: %s", intent);
boolean speakerphoneOn = mIntent.getBooleanExtra(
TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false);
mCallsManager.placeOutgoingCall(mCall, handle, null, speakerphoneOn,
VideoProfile.STATE_AUDIO_ONLY);
return DisconnectCause.NOT_DISCONNECTED;
} else {
Log.i(this, "Unhandled intent %s. Ignoring and not placing call.", intent);
return DisconnectCause.OUTGOING_CANCELED;
}
}
String number = PhoneNumberUtils.getNumberFromIntent(intent, mContext);
if (TextUtils.isEmpty(number)) {
Log.w(this, "Empty number obtained from the call intent.");
return DisconnectCause.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isUriNumber = PhoneNumberUtils.isUriNumber(number);
if (!isUriNumber) {
number = PhoneNumberUtils.convertKeypadLettersToDigits(number);
number = PhoneNumberUtils.stripSeparators(number);
}
final boolean isPotentialEmergencyNumber = isPotentialEmergencyNumber(number);
Log.v(this, "isPotentialEmergencyNumber = %s", isPotentialEmergencyNumber);
rewriteCallIntentAction(intent, isPotentialEmergencyNumber);
action = intent.getAction();
// True for certain types of numbers that are not intended to be intercepted or modified
// by third parties (e.g. emergency numbers).
boolean callImmediately = false;
if (Intent.ACTION_CALL.equals(action)) {
if (isPotentialEmergencyNumber) {
if (!mIsDefaultOrSystemPhoneApp) {
Log.w(this, "Cannot call potential emergency number %s with CALL Intent %s "
+ "unless caller is system or default dialer.", number, intent);
launchSystemDialer(intent.getData());
return DisconnectCause.OUTGOING_CANCELED;
} else {
callImmediately = true;
}
}
} else if (Intent.ACTION_CALL_EMERGENCY.equals(action)) {
if (!isPotentialEmergencyNumber) {
Log.w(this, "Cannot call non-potential-emergency number %s with EMERGENCY_CALL "
+ "Intent %s.", number, intent);
return DisconnectCause.OUTGOING_CANCELED;
}
callImmediately = true;
} else {
Log.w(this, "Unhandled Intent %s. Ignoring and not placing call.", intent);
return DisconnectCause.INVALID_NUMBER;
}
if (callImmediately) {
Log.i(this, "Placing call immediately instead of waiting for "
+ " OutgoingCallBroadcastReceiver: %s", intent);
String scheme = isUriNumber ? PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL;
boolean speakerphoneOn = mIntent.getBooleanExtra(
TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false);
int videoState = mIntent.getIntExtra(
TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE,
VideoProfile.STATE_AUDIO_ONLY);
mCallsManager.placeOutgoingCall(mCall, Uri.fromParts(scheme, number, null), null,
speakerphoneOn, videoState);
// Don't return but instead continue and send the ACTION_NEW_OUTGOING_CALL broadcast
// so that third parties can still inspect (but not intercept) the outgoing call. When
// the broadcast finally reaches the OutgoingCallBroadcastReceiver, we'll know not to
// initiate the call again because of the presence of the EXTRA_ALREADY_CALLED extra.
}
Log.i(this, "Sending NewOutgoingCallBroadcast for %s", mCall);
broadcastIntent(intent, number, !callImmediately);
return DisconnectCause.NOT_DISCONNECTED;
}
/**
* Sends a new outgoing call ordered broadcast so that third party apps can cancel the
* placement of the call or redirect it to a different number.
*
* @param originalCallIntent The original call intent.
* @param number Call number that was stored in the original call intent.
* @param receiverRequired Whether or not the result from the ordered broadcast should be
* processed using a {@link NewOutgoingCallIntentBroadcaster}.
*/
private void broadcastIntent(
Intent originalCallIntent,
String number,
boolean receiverRequired) {
Intent broadcastIntent = new Intent(Intent.ACTION_NEW_OUTGOING_CALL);
if (number != null) {
broadcastIntent.putExtra(Intent.EXTRA_PHONE_NUMBER, number);
}
// Force receivers of this broadcast intent to run at foreground priority because we
// want to finish processing the broadcast intent as soon as possible.
broadcastIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
Log.v(this, "Broadcasting intent: %s.", broadcastIntent);
checkAndCopyProviderExtras(originalCallIntent, broadcastIntent);
mContext.sendOrderedBroadcastAsUser(
broadcastIntent,
UserHandle.CURRENT,
android.Manifest.permission.PROCESS_OUTGOING_CALLS,
AppOpsManager.OP_PROCESS_OUTGOING_CALLS,
receiverRequired ? new NewOutgoingCallBroadcastIntentReceiver() : null,
null, // scheduler
Activity.RESULT_OK, // initialCode
number, // initialData: initial value for the result data (number to be modified)
null); // initialExtras
}
/**
* Copy all the expected extras set when a 3rd party gateway provider is to be used, from the
* source intent to the destination one.
*
* @param src Intent which may contain the provider's extras.
* @param dst Intent where a copy of the extras will be added if applicable.
*/
public void checkAndCopyProviderExtras(Intent src, Intent dst) {
if (src == null) {
return;
}
if (hasGatewayProviderExtras(src)) {
dst.putExtra(EXTRA_GATEWAY_PROVIDER_PACKAGE,
src.getStringExtra(EXTRA_GATEWAY_PROVIDER_PACKAGE));
dst.putExtra(EXTRA_GATEWAY_URI,
src.getStringExtra(EXTRA_GATEWAY_URI));
Log.d(this, "Found and copied gateway provider extras to broadcast intent.");
return;
}
Log.d(this, "No provider extras found in call intent.");
}
/**
* Check if valid gateway provider information is stored as extras in the intent
*
* @param intent to check for
* @return true if the intent has all the gateway information extras needed.
*/
private boolean hasGatewayProviderExtras(Intent intent) {
final String name = intent.getStringExtra(EXTRA_GATEWAY_PROVIDER_PACKAGE);
final String uriString = intent.getStringExtra(EXTRA_GATEWAY_URI);
return !TextUtils.isEmpty(name) && !TextUtils.isEmpty(uriString);
}
private static Uri getGatewayUriFromString(String gatewayUriString) {
return TextUtils.isEmpty(gatewayUriString) ? null : Uri.parse(gatewayUriString);
}
/**
* Extracts gateway provider information from a provided intent..
*
* @param intent to extract gateway provider information from.
* @param trueHandle The actual call handle that the user is trying to dial
* @return GatewayInfo object containing extracted gateway provider information as well as
* the actual handle the user is trying to dial.
*/
public static GatewayInfo getGateWayInfoFromIntent(Intent intent, Uri trueHandle) {
if (intent == null) {
return null;
}
// Check if gateway extras are present.
String gatewayPackageName = intent.getStringExtra(EXTRA_GATEWAY_PROVIDER_PACKAGE);
Uri gatewayUri = getGatewayUriFromString(intent.getStringExtra(EXTRA_GATEWAY_URI));
if (!TextUtils.isEmpty(gatewayPackageName) && gatewayUri != null) {
return new GatewayInfo(gatewayPackageName, gatewayUri, trueHandle);
}
return null;
}
private void launchSystemDialer(Uri handle) {
Intent systemDialerIntent = new Intent();
final Resources resources = mContext.getResources();
systemDialerIntent.setClassName(
resources.getString(R.string.ui_default_package),
resources.getString(R.string.dialer_default_class));
systemDialerIntent.setAction(Intent.ACTION_DIAL);
systemDialerIntent.setData(handle);
systemDialerIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Log.v(this, "calling startActivity for default dialer: %s", systemDialerIntent);
mContext.startActivityAsUser(systemDialerIntent, UserHandle.CURRENT);
}
/**
* Check whether or not this is an emergency number, in order to enforce the restriction
* that only the CALL_PRIVILEGED and CALL_EMERGENCY intents are allowed to make emergency
* calls.
*
* To prevent malicious 3rd party apps from making emergency calls by passing in an
* "invalid" number like "9111234" (that isn't technically an emergency number but might
* still result in an emergency call with some networks), we use
* isPotentialLocalEmergencyNumber instead of isLocalEmergencyNumber.
*
* @param number number to inspect in order to determine whether or not an emergency number
* is potentially being dialed
* @return True if the handle is potentially an emergency number.
*/
private boolean isPotentialEmergencyNumber(String number) {
Log.v(this, "Checking restrictions for number : %s", Log.pii(number));
return (number != null) && PhoneNumberUtils.isPotentialLocalEmergencyNumber(mContext,
number);
}
/**
* Given a call intent and whether or not the number to dial is an emergency number, rewrite
* the call intent action to an appropriate one.
*
* @param intent Intent to rewrite the action for
* @param isPotentialEmergencyNumber Whether or not the number is potentially an emergency
* number.
*/
private void rewriteCallIntentAction(Intent intent, boolean isPotentialEmergencyNumber) {
String action = intent.getAction();
/* Change CALL_PRIVILEGED into CALL or CALL_EMERGENCY as needed. */
if (Intent.ACTION_CALL_PRIVILEGED.equals(action)) {
if (isPotentialEmergencyNumber) {
Log.i(this, "ACTION_CALL_PRIVILEGED is used while the number is a potential"
+ " emergency number. Using ACTION_CALL_EMERGENCY as an action instead.");
action = Intent.ACTION_CALL_EMERGENCY;
} else {
action = Intent.ACTION_CALL;
}
Log.v(this, " - updating action from CALL_PRIVILEGED to %s", action);
intent.setAction(action);
}
}
}
| [
"weiyi_1992@hotmail.com"
] | weiyi_1992@hotmail.com |
2ae12244ffb31ff80155ba3a0d0b4599330b27b4 | c6a506fcc255621e9605249888648eea9b6f4c03 | /cosmeticsapp/src/main/java/com/cosmeticsapp/springboot/CosmeData.java | df096ad6dfed694cf6873d98d1075add218c259a | [] | no_license | misaki-k/portofolio | f93df8b1f885381f5dd375e14e290c312c8e8d8e | ddf3d604b758fceb6999aff1c2c7957c062703fa | refs/heads/master | 2021-05-06T12:41:59.144373 | 2018-02-01T12:11:17 | 2018-02-01T12:11:17 | 113,122,818 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 665 | java | package com.cosmeticsapp.springboot;
public class CosmeData {
private String name;
private String picture;
private String brand;
private String color;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
1b46e011e194202b8ecff0df81daf0da5331db50 | 54dbc34772931fba023f0c06d63bbebd0e0ab084 | /HiddenFBpictures/app/src/main/java/com/hidden/mohamedwahabi/hiddenfbpictures/classes/AlbumClass.java | b3f8864237480229c4c02e2860fb199ec73f27d3 | [] | no_license | simowahabi/ChallengeAPPMobile | 0210efa650cb8d787b3d7dfbfd3a98ddfd0b5e5f | deef4301ba3d62d8b2db4a2e4d6a7960728cd1ec | refs/heads/master | 2021-08-23T03:32:02.338204 | 2017-12-02T23:13:46 | 2017-12-02T23:13:46 | 111,838,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | package com.hidden.mohamedwahabi.hiddenfbpictures.classes;
/**
* Created by wahabiPro on 11/21/2017.
*/
public class AlbumClass {
String id, source, name, countpic;
public AlbumClass(String id, String source, String name, String countpic) {
this.id = id;
this.source = source;
this.name = name;
this.countpic = countpic;
}
public String getCountpic() {
return countpic;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"simowahabi@gmail.com"
] | simowahabi@gmail.com |
8996c5482db683da491ad02eb191b80b923b23a7 | f34e3ec72f395528e42e7a6e84ce1836229bfab5 | /src/main/java/net/imagej/ops/special/function/AbstractBinaryFunctionOp.java | d0458a4e107203f13808024af5a17e6f3aaf154f | [
"BSD-2-Clause"
] | permissive | haesleinhuepf/imagej-ops | 147861c6d22a24085552be554aa90481e06bd611 | 162a4f56795e4933343ded1f4a4207a09dd482bd | refs/heads/master | 2021-01-18T16:55:37.011635 | 2020-08-11T07:42:16 | 2020-08-11T07:42:16 | 286,678,387 | 0 | 0 | BSD-2-Clause | 2020-08-11T07:39:52 | 2020-08-11T07:39:51 | null | UTF-8 | Java | false | false | 2,435 | java | /*
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2014 - 2020 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package net.imagej.ops.special.function;
import net.imagej.ops.special.AbstractBinaryOp;
import org.scijava.ItemIO;
import org.scijava.plugin.Parameter;
/**
* Abstract superclass for {@link BinaryFunctionOp} implementations.
*
* @author Curtis Rueden
*/
public abstract class AbstractBinaryFunctionOp<I1, I2, O> extends
AbstractBinaryOp<I1, I2, O> implements BinaryFunctionOp<I1, I2, O>
{
// -- Parameters --
@Parameter(type = ItemIO.OUTPUT)
private O out;
@Parameter
private I1 in1;
@Parameter
private I2 in2;
// -- Runnable methods --
@Override
public void run() {
out = run(in1(), in2(), null);
}
// -- BinaryInput methods --
@Override
public I1 in1() {
return in1;
}
@Override
public I2 in2() {
return in2;
}
@Override
public void setInput1(final I1 input1) {
in1 = input1;
}
@Override
public void setInput2(final I2 input2) {
in2 = input2;
}
// -- Output methods --
@Override
public O out() {
return out;
}
}
| [
"ctrueden@wisc.edu"
] | ctrueden@wisc.edu |
d8fe77daf6930bb68099b79d615c7fd3cc0b4f84 | 74ee4f20fdd25f763227d283ea166cc043a58603 | /app/src/test/java/com/example/davidruiz/preliminar/ExampleUnitTest.java | 1eeb372f96e9fcede7fd5048c624b84a4db41967 | [] | no_license | davidruizg1997/RacePuntos_App | 25530239e56337cedff549ea3c11ad2d6d6dd42b | 369820cf9becc06ec6d4f9d45af8fa5b89bc8d9c | refs/heads/master | 2020-03-09T19:11:35.514961 | 2018-05-16T03:16:13 | 2018-05-16T03:16:13 | 128,951,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 745 | java | package com.example.davidruiz.preliminar;
import android.widget.EditText;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
@Test
public void test_login_idNumber_and_pass_isCorrect() throws Exception {
String idUser="123456";
String passUser="ejemplo";
Login login=new Login();
//login.userDocument=idUser;
//login.loginPassword=passUser;
assertEquals(4, 2 + 2);
}
} | [
"davidruizg1997@gmail.com"
] | davidruizg1997@gmail.com |
488f10e4b930ff7a5dc175d63328e093fc6e6f55 | 82954e05bb05dab932cbc8af5947a0cac6b837b8 | /strongbox-event-api/src/main/java/org/carlspring/strongbox/event/server/ServerEventListener.java | 9b6c085a84a808b956824c1efba05b978a7c7f4f | [
"Apache-2.0"
] | permissive | sharsh/strongbox | f6bf72d1b0809a11049100277cd1de9fcbd3dc91 | 424addc9789c3edddb18320433f387608342450f | refs/heads/master | 2021-01-01T12:51:05.236733 | 2017-07-16T20:26:35 | 2017-07-16T20:26:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 194 | java | package org.carlspring.strongbox.event.server;
import org.carlspring.strongbox.event.EventListener;
/**
* @author mtodorov
*/
public interface ServerEventListener extends EventListener
{
}
| [
"carlspring@gmail.com"
] | carlspring@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.