blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3b4a9086ffec1f746387b0d7af030d6691838ca8 | f0d11fcc0f66c1d59cdf9cebbcb02b7056b6ac38 | /chap07Lab1/src/sec04/exam02_super/Airplane.java | 11049804319ce80671b666312de74d15ff5441ad | [] | no_license | kyeonhoy/javaLab | 6eeb2ccdf94155acd4114b2e1f0a2c8484883280 | 11c898b31e5c776911b360a1d40c88bf04d34ff3 | refs/heads/master | 2023-07-15T00:01:36.586117 | 2021-09-09T07:49:19 | 2021-09-09T07:49:19 | 403,528,619 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 282 | java | package sec04.exam02_super;
public class Airplane {
public void land() {
System.out.println("착륙합니다.");
}
public void fly() {
System.out.println("일반비행합니다.");
}
public void takeOff() {
System.out.println("이륙합니다.");
}
}
| [
"ho511sd@naver.com"
] | ho511sd@naver.com |
eac1580e4861546e44ccb9cd66647ddd6da5d7bd | 82b839181fbddf77af2489541a6600667af44b28 | /app/src/androidTest/java/sudo/nasaspaceapps/cryosphere/ExampleInstrumentedTest.java | 9833b3fc6769b7fe1d4b4b4e1456bdecbf2fbbef | [] | no_license | Kapil706/cryosphere | e971f87990b85f294dc7f82f46c0b16123c12ebe | 4e80ad022a335d1a26d2f98f00302d42f852f603 | refs/heads/master | 2020-04-02T03:39:52.982807 | 2018-10-21T05:46:56 | 2018-10-21T05:46:56 | 153,977,491 | 1 | 0 | null | 2018-10-21T05:46:01 | 2018-10-21T05:46:01 | null | UTF-8 | Java | false | false | 742 | java | package sudo.nasaspaceapps.cryosphere;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("sudo.nasaspaceapps.cryosphere", appContext.getPackageName());
}
}
| [
"sankalpchauhan.me@gmail.com"
] | sankalpchauhan.me@gmail.com |
279b02c17e457a6ec93792bd198637c95a602f8f | b2d2767d82aabf85c9ec1d51fe45137c3cde2f87 | /src/main/java/com/personal/util/CustomDateDeserializer.java | 9d88dd3e05b9fbaa311069a927a86e313fb98062 | [] | no_license | DevonZhen/NJIT-App | 249785f2e94b67c2baacab1dbe079d952487e6d7 | 3da584aa366bca7b7ac7275349ad978fc6b433f6 | refs/heads/master | 2023-01-02T20:00:16.011234 | 2020-10-26T16:19:01 | 2020-10-26T16:19:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 883 | java | package com.personal.util;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
public class CustomDateDeserializer extends JsonDeserializer<Date> {
private static SimpleDateFormat formatter =
new SimpleDateFormat("yyyy-MM-dd");
@Override
public Date deserialize(JsonParser jsonparser, DeserializationContext context)
throws IOException, JsonProcessingException {
String date = jsonparser.getText();
try {
return formatter.parse(date);
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
} | [
"zhen.devon@gmail.com"
] | zhen.devon@gmail.com |
97861e499364d05917b847a7daa3c08e50817f30 | c64984c6da13d51d92a19d054e1ef8e1379c5525 | /src/main/java/dev/pajak/blog/errorcodes/integration/CustomerRestClientException.java | e038094e7496e72739ff9b564cd4bc2baecb7ac7 | [] | no_license | maciej-pajak/error-codes-with-spring-aop-example | 83d0c199bf0662a6dcc6bd3d7392991c312bb6d9 | 0a0adb94febf34e643d2bab1992a4ba12ec0a95a | refs/heads/master | 2022-06-11T09:42:38.457124 | 2020-05-03T17:21:00 | 2020-05-03T17:24:02 | 260,982,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 199 | java | package dev.pajak.blog.errorcodes.integration;
public class CustomerRestClientException extends RuntimeException {
public CustomerRestClientException(String message) {
super(message);
}
}
| [
"maciej.pajak@horus.com.pl"
] | maciej.pajak@horus.com.pl |
7d1e6a87fd3b64b048cbf28e10c57e8ed55febb4 | d95ac9f1a0e72dda0925f6aa401f35cbeb14fbaf | /Contador/src/contador/Contador.java | f4ef7b5ed6e4d15ea4981cb82d8cdd904c0ec912 | [] | no_license | AureAle/5e18 | 5e11de40ae4858349e177f5dfa723f17e86a7a0b | 52370652272124949707eb9ba45040040566939a | refs/heads/master | 2020-04-08T09:01:49.588487 | 2018-11-29T18:03:25 | 2018-11-29T18:03:25 | 159,204,653 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 968 | java |
package contador;
import javafx.stage.FileChooser;
import javax.swing.*;
import java.awt.*;
import java.io.*;
public class Contador {
public static void main(String[] args) throws Exception {
System.out.println ("Número de palabras");
JFileChooser buscador = new JFileChooser();
buscador.showOpenDialog((buscador));
String path = buscador.getSelectedFile().getAbsolutePath();
FileInputStream fr = new FileInputStream (path);
DataInputStream entrada = new DataInputStream(fr);
BufferedReader br = new BufferedReader (new InputStreamReader(entrada));
String line = br.readLine ();
int count = 0;
while (line != null) {
String []parts = line.split(" ");
for( String w : parts)
{
count++;
}
line = br.readLine();
}
System.out.println(count);
}
} | [
"5e@iMac-de-iMac21.local"
] | 5e@iMac-de-iMac21.local |
35380b363fdcdb810c0af4868720e06298df44a2 | e6b2e02000c8512ee44b64884806ec886b0c92ee | /app/src/main/java/com/zmm/mvpsimpledemo3/model/Repository.java | 76ba8ac36657b7338ee4e5e3616ae4c33a5c8971 | [] | no_license | Giousa/MVPSimpleDemo3 | e788352b7ef132aaad2ad868a6fd3e75609e0d7e | 420c279bfccc67b3b002f5eaedf38ef7467b49cb | refs/heads/master | 2021-07-21T04:31:07.514769 | 2017-10-31T09:08:23 | 2017-10-31T09:08:23 | 108,971,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,040 | java | package com.zmm.mvpsimpledemo3.model;
import com.google.gson.annotations.SerializedName;
public class Repository {
/**
* id : 3070104
* name : abs.io
* full_name : JakeWharton/abs.io
* owner : {"login":"JakeWharton","id":66577,"avatar_url":"https://avatars3.githubusercontent.com/u/66577?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeWharton","html_url":"https://github.com/JakeWharton","followers_url":"https://api.github.com/users/JakeWharton/followers","following_url":"https://api.github.com/users/JakeWharton/following{/other_user}","gists_url":"https://api.github.com/users/JakeWharton/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeWharton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeWharton/subscriptions","organizations_url":"https://api.github.com/users/JakeWharton/orgs","repos_url":"https://api.github.com/users/JakeWharton/repos","events_url":"https://api.github.com/users/JakeWharton/events{/privacy}","received_events_url":"https://api.github.com/users/JakeWharton/received_events","type":"User","site_admin":false}
* private : false
* html_url : https://github.com/JakeWharton/abs.io
* description : Simple URL shortener for ActionBarSherlock using node.js and express.
* fork : false
* url : https://api.github.com/repos/JakeWharton/abs.io
* forks_url : https://api.github.com/repos/JakeWharton/abs.io/forks
* keys_url : https://api.github.com/repos/JakeWharton/abs.io/keys{/key_id}
* collaborators_url : https://api.github.com/repos/JakeWharton/abs.io/collaborators{/collaborator}
* teams_url : https://api.github.com/repos/JakeWharton/abs.io/teams
* hooks_url : https://api.github.com/repos/JakeWharton/abs.io/hooks
* issue_events_url : https://api.github.com/repos/JakeWharton/abs.io/issues/events{/number}
* events_url : https://api.github.com/repos/JakeWharton/abs.io/events
* assignees_url : https://api.github.com/repos/JakeWharton/abs.io/assignees{/user}
* branches_url : https://api.github.com/repos/JakeWharton/abs.io/branches{/branch}
* tags_url : https://api.github.com/repos/JakeWharton/abs.io/tags
* blobs_url : https://api.github.com/repos/JakeWharton/abs.io/git/blobs{/sha}
* git_tags_url : https://api.github.com/repos/JakeWharton/abs.io/git/tags{/sha}
* git_refs_url : https://api.github.com/repos/JakeWharton/abs.io/git/refs{/sha}
* trees_url : https://api.github.com/repos/JakeWharton/abs.io/git/trees{/sha}
* statuses_url : https://api.github.com/repos/JakeWharton/abs.io/statuses/{sha}
* languages_url : https://api.github.com/repos/JakeWharton/abs.io/languages
* stargazers_url : https://api.github.com/repos/JakeWharton/abs.io/stargazers
* contributors_url : https://api.github.com/repos/JakeWharton/abs.io/contributors
* subscribers_url : https://api.github.com/repos/JakeWharton/abs.io/subscribers
* subscription_url : https://api.github.com/repos/JakeWharton/abs.io/subscription
* commits_url : https://api.github.com/repos/JakeWharton/abs.io/commits{/sha}
* git_commits_url : https://api.github.com/repos/JakeWharton/abs.io/git/commits{/sha}
* comments_url : https://api.github.com/repos/JakeWharton/abs.io/comments{/number}
* issue_comment_url : https://api.github.com/repos/JakeWharton/abs.io/issues/comments{/number}
* contents_url : https://api.github.com/repos/JakeWharton/abs.io/contents/{+path}
* compare_url : https://api.github.com/repos/JakeWharton/abs.io/compare/{base}...{head}
* merges_url : https://api.github.com/repos/JakeWharton/abs.io/merges
* archive_url : https://api.github.com/repos/JakeWharton/abs.io/{archive_format}{/ref}
* downloads_url : https://api.github.com/repos/JakeWharton/abs.io/downloads
* issues_url : https://api.github.com/repos/JakeWharton/abs.io/issues{/number}
* pulls_url : https://api.github.com/repos/JakeWharton/abs.io/pulls{/number}
* milestones_url : https://api.github.com/repos/JakeWharton/abs.io/milestones{/number}
* notifications_url : https://api.github.com/repos/JakeWharton/abs.io/notifications{?since,all,participating}
* labels_url : https://api.github.com/repos/JakeWharton/abs.io/labels{/name}
* releases_url : https://api.github.com/repos/JakeWharton/abs.io/releases{/id}
* deployments_url : https://api.github.com/repos/JakeWharton/abs.io/deployments
* created_at : 2011-12-29T18:02:34Z
* updated_at : 2017-03-14T15:55:25Z
* pushed_at : 2011-12-29T18:02:44Z
* git_url : git://github.com/JakeWharton/abs.io.git
* ssh_url : git@github.com:JakeWharton/abs.io.git
* clone_url : https://github.com/JakeWharton/abs.io.git
* svn_url : https://github.com/JakeWharton/abs.io
* homepage : http://abs.io
* size : 108
* stargazers_count : 5
* watchers_count : 5
* language : JavaScript
* has_issues : true
* has_projects : true
* has_downloads : true
* has_wiki : false
* has_pages : false
* forks_count : 1
* mirror_url : null
* open_issues_count : 0
* forks : 1
* open_issues : 0
* watchers : 5
* default_branch : master
*/
private int id;
private String name;
private String full_name;
private OwnerBean owner;
@SerializedName("private")
private boolean privateX;
private String html_url;
private String description;
private boolean fork;
private String url;
private String forks_url;
private String keys_url;
private String collaborators_url;
private String teams_url;
private String hooks_url;
private String issue_events_url;
private String events_url;
private String assignees_url;
private String branches_url;
private String tags_url;
private String blobs_url;
private String git_tags_url;
private String git_refs_url;
private String trees_url;
private String statuses_url;
private String languages_url;
private String stargazers_url;
private String contributors_url;
private String subscribers_url;
private String subscription_url;
private String commits_url;
private String git_commits_url;
private String comments_url;
private String issue_comment_url;
private String contents_url;
private String compare_url;
private String merges_url;
private String archive_url;
private String downloads_url;
private String issues_url;
private String pulls_url;
private String milestones_url;
private String notifications_url;
private String labels_url;
private String releases_url;
private String deployments_url;
private String created_at;
private String updated_at;
private String pushed_at;
private String git_url;
private String ssh_url;
private String clone_url;
private String svn_url;
private String homepage;
private int size;
private int stargazers_count;
private int watchers_count;
private String language;
private boolean has_issues;
private boolean has_projects;
private boolean has_downloads;
private boolean has_wiki;
private boolean has_pages;
private int forks_count;
private Object mirror_url;
private int open_issues_count;
private int forks;
private int open_issues;
private int watchers;
private String default_branch;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFull_name() {
return full_name;
}
public void setFull_name(String full_name) {
this.full_name = full_name;
}
public OwnerBean getOwner() {
return owner;
}
public void setOwner(OwnerBean owner) {
this.owner = owner;
}
public boolean isPrivateX() {
return privateX;
}
public void setPrivateX(boolean privateX) {
this.privateX = privateX;
}
public String getHtml_url() {
return html_url;
}
public void setHtml_url(String html_url) {
this.html_url = html_url;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isFork() {
return fork;
}
public void setFork(boolean fork) {
this.fork = fork;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getForks_url() {
return forks_url;
}
public void setForks_url(String forks_url) {
this.forks_url = forks_url;
}
public String getKeys_url() {
return keys_url;
}
public void setKeys_url(String keys_url) {
this.keys_url = keys_url;
}
public String getCollaborators_url() {
return collaborators_url;
}
public void setCollaborators_url(String collaborators_url) {
this.collaborators_url = collaborators_url;
}
public String getTeams_url() {
return teams_url;
}
public void setTeams_url(String teams_url) {
this.teams_url = teams_url;
}
public String getHooks_url() {
return hooks_url;
}
public void setHooks_url(String hooks_url) {
this.hooks_url = hooks_url;
}
public String getIssue_events_url() {
return issue_events_url;
}
public void setIssue_events_url(String issue_events_url) {
this.issue_events_url = issue_events_url;
}
public String getEvents_url() {
return events_url;
}
public void setEvents_url(String events_url) {
this.events_url = events_url;
}
public String getAssignees_url() {
return assignees_url;
}
public void setAssignees_url(String assignees_url) {
this.assignees_url = assignees_url;
}
public String getBranches_url() {
return branches_url;
}
public void setBranches_url(String branches_url) {
this.branches_url = branches_url;
}
public String getTags_url() {
return tags_url;
}
public void setTags_url(String tags_url) {
this.tags_url = tags_url;
}
public String getBlobs_url() {
return blobs_url;
}
public void setBlobs_url(String blobs_url) {
this.blobs_url = blobs_url;
}
public String getGit_tags_url() {
return git_tags_url;
}
public void setGit_tags_url(String git_tags_url) {
this.git_tags_url = git_tags_url;
}
public String getGit_refs_url() {
return git_refs_url;
}
public void setGit_refs_url(String git_refs_url) {
this.git_refs_url = git_refs_url;
}
public String getTrees_url() {
return trees_url;
}
public void setTrees_url(String trees_url) {
this.trees_url = trees_url;
}
public String getStatuses_url() {
return statuses_url;
}
public void setStatuses_url(String statuses_url) {
this.statuses_url = statuses_url;
}
public String getLanguages_url() {
return languages_url;
}
public void setLanguages_url(String languages_url) {
this.languages_url = languages_url;
}
public String getStargazers_url() {
return stargazers_url;
}
public void setStargazers_url(String stargazers_url) {
this.stargazers_url = stargazers_url;
}
public String getContributors_url() {
return contributors_url;
}
public void setContributors_url(String contributors_url) {
this.contributors_url = contributors_url;
}
public String getSubscribers_url() {
return subscribers_url;
}
public void setSubscribers_url(String subscribers_url) {
this.subscribers_url = subscribers_url;
}
public String getSubscription_url() {
return subscription_url;
}
public void setSubscription_url(String subscription_url) {
this.subscription_url = subscription_url;
}
public String getCommits_url() {
return commits_url;
}
public void setCommits_url(String commits_url) {
this.commits_url = commits_url;
}
public String getGit_commits_url() {
return git_commits_url;
}
public void setGit_commits_url(String git_commits_url) {
this.git_commits_url = git_commits_url;
}
public String getComments_url() {
return comments_url;
}
public void setComments_url(String comments_url) {
this.comments_url = comments_url;
}
public String getIssue_comment_url() {
return issue_comment_url;
}
public void setIssue_comment_url(String issue_comment_url) {
this.issue_comment_url = issue_comment_url;
}
public String getContents_url() {
return contents_url;
}
public void setContents_url(String contents_url) {
this.contents_url = contents_url;
}
public String getCompare_url() {
return compare_url;
}
public void setCompare_url(String compare_url) {
this.compare_url = compare_url;
}
public String getMerges_url() {
return merges_url;
}
public void setMerges_url(String merges_url) {
this.merges_url = merges_url;
}
public String getArchive_url() {
return archive_url;
}
public void setArchive_url(String archive_url) {
this.archive_url = archive_url;
}
public String getDownloads_url() {
return downloads_url;
}
public void setDownloads_url(String downloads_url) {
this.downloads_url = downloads_url;
}
public String getIssues_url() {
return issues_url;
}
public void setIssues_url(String issues_url) {
this.issues_url = issues_url;
}
public String getPulls_url() {
return pulls_url;
}
public void setPulls_url(String pulls_url) {
this.pulls_url = pulls_url;
}
public String getMilestones_url() {
return milestones_url;
}
public void setMilestones_url(String milestones_url) {
this.milestones_url = milestones_url;
}
public String getNotifications_url() {
return notifications_url;
}
public void setNotifications_url(String notifications_url) {
this.notifications_url = notifications_url;
}
public String getLabels_url() {
return labels_url;
}
public void setLabels_url(String labels_url) {
this.labels_url = labels_url;
}
public String getReleases_url() {
return releases_url;
}
public void setReleases_url(String releases_url) {
this.releases_url = releases_url;
}
public String getDeployments_url() {
return deployments_url;
}
public void setDeployments_url(String deployments_url) {
this.deployments_url = deployments_url;
}
public String getCreated_at() {
return created_at;
}
public void setCreated_at(String created_at) {
this.created_at = created_at;
}
public String getUpdated_at() {
return updated_at;
}
public void setUpdated_at(String updated_at) {
this.updated_at = updated_at;
}
public String getPushed_at() {
return pushed_at;
}
public void setPushed_at(String pushed_at) {
this.pushed_at = pushed_at;
}
public String getGit_url() {
return git_url;
}
public void setGit_url(String git_url) {
this.git_url = git_url;
}
public String getSsh_url() {
return ssh_url;
}
public void setSsh_url(String ssh_url) {
this.ssh_url = ssh_url;
}
public String getClone_url() {
return clone_url;
}
public void setClone_url(String clone_url) {
this.clone_url = clone_url;
}
public String getSvn_url() {
return svn_url;
}
public void setSvn_url(String svn_url) {
this.svn_url = svn_url;
}
public String getHomepage() {
return homepage;
}
public void setHomepage(String homepage) {
this.homepage = homepage;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getStargazers_count() {
return stargazers_count;
}
public void setStargazers_count(int stargazers_count) {
this.stargazers_count = stargazers_count;
}
public int getWatchers_count() {
return watchers_count;
}
public void setWatchers_count(int watchers_count) {
this.watchers_count = watchers_count;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public boolean isHas_issues() {
return has_issues;
}
public void setHas_issues(boolean has_issues) {
this.has_issues = has_issues;
}
public boolean isHas_projects() {
return has_projects;
}
public void setHas_projects(boolean has_projects) {
this.has_projects = has_projects;
}
public boolean isHas_downloads() {
return has_downloads;
}
public void setHas_downloads(boolean has_downloads) {
this.has_downloads = has_downloads;
}
public boolean isHas_wiki() {
return has_wiki;
}
public void setHas_wiki(boolean has_wiki) {
this.has_wiki = has_wiki;
}
public boolean isHas_pages() {
return has_pages;
}
public void setHas_pages(boolean has_pages) {
this.has_pages = has_pages;
}
public int getForks_count() {
return forks_count;
}
public void setForks_count(int forks_count) {
this.forks_count = forks_count;
}
public Object getMirror_url() {
return mirror_url;
}
public void setMirror_url(Object mirror_url) {
this.mirror_url = mirror_url;
}
public int getOpen_issues_count() {
return open_issues_count;
}
public void setOpen_issues_count(int open_issues_count) {
this.open_issues_count = open_issues_count;
}
public int getForks() {
return forks;
}
public void setForks(int forks) {
this.forks = forks;
}
public int getOpen_issues() {
return open_issues;
}
public void setOpen_issues(int open_issues) {
this.open_issues = open_issues;
}
public int getWatchers() {
return watchers;
}
public void setWatchers(int watchers) {
this.watchers = watchers;
}
public String getDefault_branch() {
return default_branch;
}
public void setDefault_branch(String default_branch) {
this.default_branch = default_branch;
}
public static class OwnerBean {
/**
* login : JakeWharton
* id : 66577
* avatar_url : https://avatars3.githubusercontent.com/u/66577?v=3
* gravatar_id :
* url : https://api.github.com/users/JakeWharton
* html_url : https://github.com/JakeWharton
* followers_url : https://api.github.com/users/JakeWharton/followers
* following_url : https://api.github.com/users/JakeWharton/following{/other_user}
* gists_url : https://api.github.com/users/JakeWharton/gists{/gist_id}
* starred_url : https://api.github.com/users/JakeWharton/starred{/owner}{/repo}
* subscriptions_url : https://api.github.com/users/JakeWharton/subscriptions
* organizations_url : https://api.github.com/users/JakeWharton/orgs
* repos_url : https://api.github.com/users/JakeWharton/repos
* events_url : https://api.github.com/users/JakeWharton/events{/privacy}
* received_events_url : https://api.github.com/users/JakeWharton/received_events
* type : User
* site_admin : false
*/
private String login;
private int id;
private String avatar_url;
private String gravatar_id;
private String url;
private String html_url;
private String followers_url;
private String following_url;
private String gists_url;
private String starred_url;
private String subscriptions_url;
private String organizations_url;
private String repos_url;
private String events_url;
private String received_events_url;
private String type;
private boolean site_admin;
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getAvatar_url() {
return avatar_url;
}
public void setAvatar_url(String avatar_url) {
this.avatar_url = avatar_url;
}
public String getGravatar_id() {
return gravatar_id;
}
public void setGravatar_id(String gravatar_id) {
this.gravatar_id = gravatar_id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getHtml_url() {
return html_url;
}
public void setHtml_url(String html_url) {
this.html_url = html_url;
}
public String getFollowers_url() {
return followers_url;
}
public void setFollowers_url(String followers_url) {
this.followers_url = followers_url;
}
public String getFollowing_url() {
return following_url;
}
public void setFollowing_url(String following_url) {
this.following_url = following_url;
}
public String getGists_url() {
return gists_url;
}
public void setGists_url(String gists_url) {
this.gists_url = gists_url;
}
public String getStarred_url() {
return starred_url;
}
public void setStarred_url(String starred_url) {
this.starred_url = starred_url;
}
public String getSubscriptions_url() {
return subscriptions_url;
}
public void setSubscriptions_url(String subscriptions_url) {
this.subscriptions_url = subscriptions_url;
}
public String getOrganizations_url() {
return organizations_url;
}
public void setOrganizations_url(String organizations_url) {
this.organizations_url = organizations_url;
}
public String getRepos_url() {
return repos_url;
}
public void setRepos_url(String repos_url) {
this.repos_url = repos_url;
}
public String getEvents_url() {
return events_url;
}
public void setEvents_url(String events_url) {
this.events_url = events_url;
}
public String getReceived_events_url() {
return received_events_url;
}
public void setReceived_events_url(String received_events_url) {
this.received_events_url = received_events_url;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public boolean isSite_admin() {
return site_admin;
}
public void setSite_admin(boolean site_admin) {
this.site_admin = site_admin;
}
}
}
| [
"65489469@qq.com"
] | 65489469@qq.com |
66b505acaddc618df6857b91b2e011181ac44a9c | 9da390617a9a716a831d677d2bd79b5260860a2c | /app/src/main/java/com/example/aptech/greenfox/Insert_menu_items.java | c4288bcd1eb18b99541de2c2eac435ad4190e804 | [] | no_license | Asma-agency360/GreenFox_APP | 71369faa9ec0e986e5eb0ec7dab8bd82ed583859 | 3bf25c64e7986150d8975a32ad9867ffff9e63fb | refs/heads/main | 2023-01-19T10:54:21.028490 | 2020-11-20T16:26:42 | 2020-11-20T16:26:42 | 314,607,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,806 | java | package com.example.aptech.greenfox;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import com.android.volley.AuthFailureError;
import com.android.volley.DefaultRetryPolicy;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.OnProgressListener;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import com.theartofdev.edmodo.cropper.CropImage;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import libs.mjn.prettydialog.PrettyDialog;
import libs.mjn.prettydialog.PrettyDialogCallback;
public class Insert_menu_items extends AppCompatActivity {
String ItemName, ItemPrice, Category;
private Context context;
ProgressDialog progressDialog;
static Urls urls = new Urls();
private static final String URL_PROCESSING = urls.url_processing();
ImageView iv_selected_image;
private static final String IMAGE_DIRECTORY = "/demonuts";
Uri fileUri;
Button btn_Attachments;
EditText et_item_name, et_price;
Button button2;
String category;
ArrayList arrayList = new ArrayList();
String[] items = {"Breakfast", "Lunch", "Weekends", "sides", "Smoothies", "Drinks and retails"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_insert_menu_items);
progressDialog = new ProgressDialog(this);
progressDialog.setMessage("Uploading please wait...");
progressDialog.setCancelable(false);
final AutoCompleteTextView autoComplete = (AutoCompleteTextView) findViewById(R.id.autoComplete);
autoComplete.clearListSelection();
et_item_name = findViewById(R.id.et_item_name);
et_price = findViewById(R.id.et_price);
btn_Attachments = findViewById(R.id.btn_Attachments);
button2 = findViewById(R.id.btn_registration);
btn_Attachments.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
///====>>>> intent to image cropper library<<===///
Intent intent = CropImage.activity().getIntent(Insert_menu_items.this);
startActivityForResult(intent, CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE);
}
});
ArrayAdapter<String> adapter = new ArrayAdapter<String>
(this, android.R.layout.simple_list_item_1, items);
//Getting the instance of AutoCompleteTextView
autoComplete.setThreshold(0);//will start working from first character
autoComplete.setAdapter(adapter);//setting the adapter data into the AutoCompleteTextView
autoComplete.setTextColor(Color.RED);
autoComplete.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
autoComplete.showDropDown();
return false;
}
});
autoComplete.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if (autoComplete.getText().toString() .equals("Breakfast") )
{
category = "1";
}
else if (autoComplete.getText().toString() .equals("Lunch") )
{
category = "2";
}
else if (autoComplete.getText().toString() .equals("Weekends") )
{
category = "3";
}
else if (autoComplete.getText().toString() .equals("sides") )
{
category = "4";
}
else if (autoComplete.getText().toString() .equals("Smoothies") )
{
category = "5";
}
else if (autoComplete.getText().toString() .equals("Drinks and retails") )
{
category = "6";
}
else
{
category = autoComplete.getText().toString();
Global.category = autoComplete.getText().toString();
}
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if ((Global.itemDetailsModelClass.getItemPic() != null) &&
!et_item_name.getText().toString().isEmpty() &&
!et_price.getText().toString().isEmpty()) {
progressDialog.show();
uploadImagetoFirebaseStorage(fileUri);
} else {
btn_Attachments.setError("Select Image first");
btn_Attachments.requestFocus();
autoComplete.setError("Select category");
autoComplete.requestFocus();
et_item_name.setError("Enter Model number");
et_item_name.requestFocus();
et_price.setError("Enter Price");
et_price.requestFocus();
}
}
});
}
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE && resultCode == RESULT_OK) {
CropImage.ActivityResult result = CropImage.getActivityResult(data);
if (resultCode == RESULT_OK) {
fileUri = result.getUri();
Global.itemDetailsModelClass.ItemPic = fileUri;
btn_Attachments.setVisibility(View.VISIBLE);
btn_Attachments.setText(Global.itemDetailsModelClass.ItemPic.toString());
// Picasso.get().load(Global.chairModel.getChairPic()).into(iv_selected_image);
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), fileUri);
String path = saveImage(bitmap);
// frg_newsFeed_listItem_circleImageViiew.setImageBitmap(bitmap);
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(), "Failed!", Toast.LENGTH_SHORT).show();
}
}
} else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
Toast.makeText(getApplicationContext(), "An error occured", Toast.LENGTH_SHORT).show();
}
}
@RequiresApi(api = Build.VERSION_CODES.N)
public String saveImage(Bitmap myBitmap) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
myBitmap.compress(Bitmap.CompressFormat.JPEG, 90, bytes);
File wallpaperDirectory = new File(
Environment.getExternalStorageDirectory() + IMAGE_DIRECTORY);
// have the object build the directory structure, if needed.
if (!wallpaperDirectory.exists()) {
wallpaperDirectory.mkdirs();
}
try {
File f = new File(wallpaperDirectory, Calendar.getInstance()
.getTimeInMillis() + ".jpg");
f.createNewFile();
FileOutputStream fo = new FileOutputStream(f);
fo.write(bytes.toByteArray());
MediaScannerConnection.scanFile(this,
new String[]{f.getPath()},
new String[]{"image/jpeg"}, null);
fo.close();
Log.d("TAG", "File Saved::--->" + f.getAbsolutePath());
return f.getAbsolutePath();
} catch (IOException e1) {
e1.printStackTrace();
}
return "";
}
private void uploadImagetoFirebaseStorage(Uri fileUri) {
if (Global.itemDetailsModelClass.getItemPic() != null) {
// progressDialog.show();
StorageReference ref = FirebaseStorage.getInstance().getReference().child("1").child(String.valueOf(new Date(String.valueOf(java.util.Calendar.getInstance().getTime()))));
ref.putFile(Global.itemDetailsModelClass.getItemPic())
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Task<Uri> result = taskSnapshot.getMetadata().getReference().getDownloadUrl();
result.addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
UploadPostToDatabase(uri);
// register(Global.userData.name, Global.userData.dob, Global.userData.phoneNumber, Global.userData.gender, Global.userData.pin, uri.toString());
}
});
//postData(taskSnapshot);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
//progressDialog.dismiss();
Toast.makeText(getApplicationContext(), "Failed " + e.getMessage(), Toast.LENGTH_SHORT).show();
}
})
.addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
double progress = (100.0 * taskSnapshot.getBytesTransferred() / taskSnapshot
.getTotalByteCount());
// progressDialog.setMessage("Uploading Blog...");
}
});
}
}
public void UploadPostToDatabase(final Uri uri) {
/*
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM 'at' HH:mm");
String postID = FirebaseDatabase.getInstance().getReference(category).push().getKey();
DatabaseReference reference = FirebaseDatabase.getInstance().getReference(category).child(postID);
*/
ItemName = et_item_name.getText().toString();
ItemPrice = et_price.getText().toString();
HashMap<String, Object> hashMap = new HashMap<String, Object>();
hashMap.put("Category", category);
hashMap.put("Price", ItemPrice);
hashMap.put("Image", uri.toString());
//hashMap.put("postID", postID);
hashMap.put("ItemName", ItemName);
Log.v("Item Category",category);
Log.v("Item Name",ItemName);
Log.v("Image URL",uri.toString());
new_order_or_suborder_usingVolley("add_items",category, ItemName,ItemPrice,uri.toString(),true);
//reference.updateChildren(hashMap);
progressDialog.dismiss();
new PrettyDialog(this)
.setTitle("Item Uploaded!")
.setIcon(R.drawable.greenfoxlogo)
.setMessage("Successfully uploaded!")
.addButton("OK",
R.color.pdlg_color_white, // button text color
R.color.pdlg_color_green, // button background color
new PrettyDialogCallback() { // button OnClick listener
@Override
public void onClick() {
Intent intent = new Intent(Insert_menu_items.this, Insert_menu_items.class);
startActivity(intent);
progressDialog.dismiss();
finish();
}
}).show();
}
private void new_order_or_suborder_usingVolley(final String action, final String category1, final String item1name, final String item1price, final String url_image,final Boolean status1)
{
progressDialog.setMessage("Please Wait...");
progressDialog.show();
//volley code
StringRequest stringRequest = new StringRequest(Request.Method.POST, URL_PROCESSING,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try
{
Log.v("response", response);
JSONObject jsonObject = new JSONObject(response);
JSONObject jsonObject_data = jsonObject.getJSONObject("data");
String response_status = jsonObject_data.getString("response_status");
String response_msg = jsonObject_data.getString("response_msg");
if(response_status.equals("success"))
{
Toast.makeText(getApplicationContext(), response_msg, Toast.LENGTH_SHORT).show();
//Log.v("jsonObject_table1", String.valueOf(arrayList_sub_orders));
}
else
{
// show_dialog_message("No Categories", "No Enabled Categories");
Toast.makeText(getApplicationContext(), "No categories", Toast.LENGTH_SHORT).show();
//Log.v("response", "Invalid Credentials");
}
/*
JSONObject jsonObject = new JSONObject(response);
JSONObject jsonObject_data = jsonObject.getJSONObject("data");
String response_status = jsonObject_data.getString("response_status");
String response_msg = jsonObject_data.getString("response_msg");
JSONArray jsonArray_response_data = jsonObject_data.getJSONArray("response_data");
Log.v("response", String.valueOf(jsonArray_response_data));
if(response_status.equals("success"))
{
Toast.makeText(getApplicationContext(), response_msg, Toast.LENGTH_SHORT).show();
//Log.v("jsonObject_table1", String.valueOf(arrayList_sub_orders));
}
else
{
// show_dialog_message("No Categories", "No Enabled Categories");
Toast.makeText(getApplicationContext(), "No categories", Toast.LENGTH_SHORT).show();
//Log.v("response", "Invalid Credentials");
}
finish();
*/
}
catch(Exception ex)
{
//show_dialog_message("Network Error", "Check network connection");
Toast.makeText(getApplicationContext(), "Network Error", Toast.LENGTH_SHORT).show();
Log.v("catch err", ex.getMessage());
}
progressDialog.dismiss();
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
progressDialog.dismiss();
// show_dialog_message("Network Error", "Check network connection");
Toast.makeText(context, "Network Error!!!", Toast.LENGTH_SHORT).show();
//Log.v("Network Error", error.networkResponse.data.toString());
}
})
{
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<>();
params.put("action", "add_items");
//params.put("item_auto_id", "1");
params.put("item_name", item1name);
params.put("item_price",item1price);
params.put("item_category",category1);
params.put("item_image",url_image);
params.put("item_status",status1.toString());
return params;
}
};
DefaultRetryPolicy retryPolicy = new DefaultRetryPolicy(0,-1,DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
stringRequest.setRetryPolicy(retryPolicy);
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.getCache().clear();
requestQueue.add(stringRequest);
}
}
| [
"asma.agency360@gmail.com"
] | asma.agency360@gmail.com |
4524cfbb6f85633eebad46aeefb7fcb8aea98ebc | 4a2ab13526ce9e4f774cdad20cab21b10e190f16 | /app/src/main/java/com/warmtel/music/lyric/LyricView.java | 63244c579a257b302039c992b8d104b74257ecb9 | [] | no_license | woaihzq306/Android-Music-warmtel | 5020ce85e1291bd8be2ec8bfb8372f4862382728 | 683be0a170e5fbdfb5896c8a7514ddb40e0896cd | refs/heads/master | 2020-08-31T10:06:46.718317 | 2016-02-18T07:29:50 | 2016-02-18T07:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,245 | java | package com.warmtel.music.lyric;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;
import java.io.File;
import java.util.List;
public class LyricView extends TextView {
private Paint mPaint;
private float mX;
private static Lyric mLyric;
private Paint mPathPaint;
public String test = "test";
public int index = 0;
private List<Sentence> list;
public float mTouchHistoryY;
private int mY;
private long currentDunringTime; // 当前行歌词持续的时间,用该时间来sleep
private float middleY;// y轴中间
private static final int DY = 50; // 每一行的间隔
public LyricView(Context context) {
super(context);
init();
}
public LyricView(Context context, AttributeSet attr) {
super(context, attr);
init();
}
public LyricView(Context context, AttributeSet attr, int i) {
super(context, attr, i);
init();
}
private void init() {
setFocusable(true);
PlayListItem pli = new PlayListItem("星月神话","/mnt/sdcard/Music/jinsha.mp3", 0L, true);
mLyric = new Lyric(new File("/mnt/sdcard/Music/jinsha.lrc"), pli);
list = mLyric.list;
// 非高亮部分
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setTextSize(22);
mPaint.setColor(Color.WHITE);
mPaint.setTypeface(Typeface.SERIF);
// 高亮部分 当前歌词
mPathPaint = new Paint();
mPathPaint.setAntiAlias(true);
mPathPaint.setColor(Color.RED);
mPathPaint.setTextSize(22);
mPathPaint.setTypeface(Typeface.SANS_SERIF);
}
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawColor(0xEFeffff);
Paint p = mPaint;
Paint p2 = mPathPaint;
p.setTextAlign(Paint.Align.CENTER);
if (index == -1)
return;
p2.setTextAlign(Paint.Align.CENTER);
// 先画当前行,之后再画他的前面和后面,这样就保持当前行在中间的位置
canvas.drawText(list.get(index).getContent(), mX, middleY, p2);
float tempY = middleY;
// 画出本句之前的句子
for (int i = index - 1; i >= 0; i--) {
// Sentence sen = list.get(i);
// 向上推移
tempY = tempY - DY;
if (tempY < 0) {
break;
}
canvas.drawText(list.get(i).getContent(), mX, tempY, p);
// canvas.translate(0, DY);
}
tempY = middleY;
// 画出本句之后的句子
for (int i = index + 1; i < list.size(); i++) {
// 往下推移
tempY = tempY + DY;
if (tempY > mY) {
break;
}
canvas.drawText(list.get(i).getContent(), mX, tempY, p);
// canvas.translate(0, DY);
}
}
protected void onSizeChanged(int w, int h, int ow, int oh) {
super.onSizeChanged(w, h, ow, oh);
mX = w * 0.5f; // remember the center of the screen
mY = h;
middleY = h * 0.5f;
}
//
/**
* @param time
* 当前歌词的时间轴
*
* @return currentDunringTime 歌词只需的时间
*/
public long updateIndex(long time) {
// 歌词序号
index = mLyric.getNowSentenceIndex(time);
if (index == -1)
return -1;
Sentence sen = list.get(index);
// 返回歌词持续的时间,在这段时间内sleep
return currentDunringTime = sen.getDuring();
}
} | [
"2915858910@qq.com"
] | 2915858910@qq.com |
4b429c237fbbd840f079d0df17a4ed00abb6b940 | 0683524028e589bc6735b32c934726b9df761fea | /src/main/java/cn/bdqn/pnback/pojo/Balance.java | 2fbd70f9eb08b78e8f376b2ff1de5088fd7d0017 | [] | no_license | hou1008/pnback | 92200a290b18f647fd1969c6e2a23e2fad55ce8d | c33051cd885577dad557b9956ae7a083323628f1 | refs/heads/master | 2022-11-25T00:02:46.464047 | 2019-09-29T06:10:26 | 2019-09-29T06:10:26 | 208,063,013 | 0 | 0 | null | 2022-11-16T08:22:49 | 2019-09-12T13:53:50 | JavaScript | UTF-8 | Java | false | false | 583 | java | package cn.bdqn.pnback.pojo;
import java.io.Serializable;
public class Balance implements Serializable{
private Integer bId;
private Integer uid;
private Integer bTotal;
public Integer getbId() {
return bId;
}
public void setbId(Integer bId) {
this.bId = bId;
}
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public Integer getbTotal() {
return bTotal;
}
public void setbTotal(Integer bTotal) {
this.bTotal = bTotal;
}
}
| [
"19991008hyd"
] | 19991008hyd |
2e8c276ba2ad99187dadd97dd19ab4be8895b94a | 582cd80df52521de31c2f49f320c2d3db85e546e | /src/chapterfour/methodsandencapsulation/writingsimplelambdas/WrittingSimpleLambdas.java | 4912d8f7b2ac836d43b39b021208ecf833f744c8 | [] | no_license | HumbertoPeluso/OCA_Java_Certified | 0d387144a2b5b545e3f845c54eca49651c0f6dba | a3e18983cb808e4c5335fdbfa699db6bfa948ae5 | refs/heads/master | 2020-06-02T16:37:55.489980 | 2019-08-06T17:10:02 | 2019-08-06T17:10:02 | 191,230,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | package chapterfour.methodsandencapsulation.writingsimplelambdas;
public class WrittingSimpleLambdas {
/* Our goal is to print out all the animals in a list according to some criteria. We’ll show you
how to do this without lambdas to illustrate how lambdas are useful. We start out with the
Animal class:*/
}
class Animal {
private String species;
private boolean canHop;
private boolean canSwim;
public Animal(String speciesName, boolean hopper, boolean swimmer) {
species = speciesName;
canHop = hopper;
canSwim = swimmer;
}
public boolean canHop() {
return canHop;
}
public boolean canSwim() {
return canSwim;
}
public String toString() {
return species;
}
}
| [
"humberto.peluso@credilink.com.br"
] | humberto.peluso@credilink.com.br |
6384424d95e4b0176d566559bcccb01b68a3e729 | 0271482cc52c928ebfbd2333f46dae7ab8503a8e | /cia-gateway/src/main/java/br/com/totvs/cia/gateway/amplis/equivalencia/service/RemetenteAmplisService.java | 29d61917fd4091b934a70f8f566f1f211d07b19e | [] | no_license | diegojunior/cia | 2643d0ec9ac2285fb6547051f03835df088416b9 | 836b55921eb7a37734f42c609af5e667dd087f10 | refs/heads/master | 2020-03-08T22:00:30.389590 | 2018-04-06T16:48:12 | 2018-04-06T16:48:12 | 128,420,035 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,226 | java | package br.com.totvs.cia.gateway.amplis.equivalencia.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import br.com.totvs.amplis.api.client.ApiException;
import br.com.totvs.amplis.api.client.http.DestinatarioRemetenteResourceApi;
import br.com.totvs.amplis.api.client.json.DestinatarioRemetenteJson;
import br.com.totvs.cia.cadastro.equivalencia.json.RemetenteJson;
import br.com.totvs.cia.gateway.amplis.equivalencia.converter.RemetenteAmplisConverter;
import br.com.totvs.cia.gateway.amplis.infra.AmplisWsClient;
@Service
public class RemetenteAmplisService {
@Autowired
private RemetenteAmplisConverter converter;
@Autowired
private AmplisWsClient client;
public List<RemetenteJson> getAll() {
try {
DestinatarioRemetenteResourceApi destinatarioRemetenteResourceApi = this.client.getDestinatarioRemetenteResourceApi();
List<DestinatarioRemetenteJson> destinatariosRemetentesJson = destinatarioRemetenteResourceApi.listAll();
return this.converter.convertListFrom(destinatariosRemetentesJson);
} catch (ApiException e) {
e.printStackTrace();
//TODO [RENAN] tratar exception
}
return null;
}
} | [
"diego.junior@sp01.local"
] | diego.junior@sp01.local |
5249a432d15c66a11397cf552e42e5a2dff51acb | ea03c0eff8dbdceaab3fc1c3c9e843fadf3018a2 | /modules/tool/axis2-java2wsdl-maven-plugin/src/test/java/org/apache/axis2/maven2/java2wsdl/test/Adder.java | 4157b23fa0b3529d46ac53baaaea04b8c03f21da | [
"Apache-2.0"
] | permissive | cranelab/axis1_3 | 28544dbcf3bf0c9bf59a59441ad8ef21143f70f0 | 1754374507dee9d1502478c454abc1d13bcf15b9 | refs/heads/master | 2022-12-28T05:17:18.894411 | 2020-04-22T17:50:05 | 2020-04-22T17:50:05 | 257,970,632 | 0 | 0 | Apache-2.0 | 2020-10-13T21:25:37 | 2020-04-22T17:21:46 | Java | UTF-8 | Java | false | false | 1,032 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis2.maven2.java2wsdl.test;
/**
* A dummy service class
*/
public class Adder {
/**
* Returns the sum of its parameters.
*/
public int add(int p1, int p2) {
return p1 + p2;
}
}
| [
"45187319+cranelab@users.noreply.github.com"
] | 45187319+cranelab@users.noreply.github.com |
6a96eacacaf8fb005c895cf982701e6c5b02a579 | 71d03e24c825b527eb4a9ce0d3edda7053f57bb2 | /Imagelink/app/src/androidTest/java/com/codingblocks/imagelink/ExampleInstrumentedTest.java | f223b816149a4b0c0159a8d8ad3b9775d2102dfe | [] | no_license | neeraj0403/Android-code | 831183803d5bf97bd5d6038fb1cb1e4f59a2f9cb | a948201b228fcbdf0598e8d8ff5a455b14aaa220 | refs/heads/master | 2020-06-19T18:42:25.400878 | 2020-01-30T09:02:05 | 2020-01-30T09:02:05 | 196,826,850 | 0 | 3 | null | 2019-10-04T06:57:55 | 2019-07-14T11:12:53 | Java | UTF-8 | Java | false | false | 736 | java | package com.codingblocks.imagelink;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.codingblocks.imagelink", appContext.getPackageName());
}
}
| [
"neerajkumarp40@gmail.com"
] | neerajkumarp40@gmail.com |
e0699067c2fa64a537f050f02127dd6e6aa3b4a6 | 34152651a0b4c4b5bae7d79fd3d52f78612aa793 | /config-server/src/test/java/configserver/ConfigserverApplicationTests.java | 8c1d3555552783b9a8bdf7c9f647f38eabd21c1e | [] | no_license | sjb961121/springcloud-study | b9420145730085210d843e66bd0966a4e8094ed2 | 11a4a3390752b70a8a836e8da26ad701e058e9e8 | refs/heads/master | 2023-01-04T05:26:43.307821 | 2020-10-25T07:53:11 | 2020-10-25T07:53:11 | 307,049,645 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package configserver;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ConfigserverApplicationTests {
@Test
void contextLoads() {
}
}
| [
"sjb961121@126.com"
] | sjb961121@126.com |
4c91af587adc80accfa469e3db0e2a5b212e7fda | 7c400b9f9ab617e044c1557d1519a3c38558b861 | /RateService/src/test/java/nl/ica/oose/project/juke/rateservice/persistence/RateServiceConfigTest.java | 6ec9d28e422e86b1e25267996b2bdbb3d6306753 | [] | no_license | JStammen/JukeBox | 8f9facaaf9fd18cb46ae2c442cf632865b5c9402 | 8c7e365cc69b3bf8e01f4afd2069eb9a3213942e | refs/heads/master | 2021-01-10T16:27:42.247451 | 2015-12-18T08:27:17 | 2015-12-18T08:27:17 | 48,223,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,666 | java | package nl.ica.oose.project.juke.rateservice.persistence;
import org.junit.Before;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertNull;
public class RateServiceConfigTest {
private final static String DRIVER = "driver";
private final static String LOCATION = "location";
private final static String USERNAME = "username";
private final static String PASSWORD = "password";
private final static String MODIFIED_DRIVER = "modified_driver";
private final static String MODIFIED_LOCATION = "modified_location";
private final static String MODIFIED_USERNAME = "modified_username";
private final static String MODIFIED_PASSWORD = "modified_password";
RateServiceConfig fullConfig;
RateServiceConfig blankConfig;
@Before
public void startUp() {
fullConfig = new RateServiceConfig(DRIVER, LOCATION, USERNAME, PASSWORD);
blankConfig = new RateServiceConfig();
}
@Test
public void shouldReturnDriver() {
assertEquals(fullConfig.getDriver(), DRIVER);
}
@Test
public void shoudReturnModifiedDriver() {
fullConfig.setDriver(MODIFIED_DRIVER);
assertEquals(fullConfig.getDriver(), MODIFIED_DRIVER);
}
@Test
public void shouldReturnNullIfDriverIsEmpty() {
assertNull(blankConfig.getDriver());
}
@Test
public void shouldReturnLocation() {
assertEquals(fullConfig.getServerlocation(), LOCATION);
}
@Test
public void shoudReturnModifiedLocation() {
fullConfig.setServerlocation(MODIFIED_LOCATION);
assertEquals(fullConfig.getServerlocation(), MODIFIED_LOCATION);
}
@Test
public void shouldReturnNullIfLocationIsEmpty() {
assertNull(blankConfig.getServerlocation());
}
@Test
public void shouldReturnUsername() {
assertEquals(fullConfig.getUsername(), USERNAME);
}
@Test
public void shoudReturnModifiedUsername() {
fullConfig.setUsername(MODIFIED_USERNAME);
assertEquals(fullConfig.getUsername(), MODIFIED_USERNAME);
}
@Test
public void shouldReturnNullIfUsernameIsEmpty() {
assertNull(blankConfig.getUsername());
}
@Test
public void shouldReturnPassword() {
assertEquals(fullConfig.getPassword(), PASSWORD);
}
@Test
public void shoudReturnModifiedPassword() {
fullConfig.setPassword(MODIFIED_PASSWORD);
assertEquals(fullConfig.getPassword(), MODIFIED_PASSWORD);
}
@Test
public void shouldReturnNullIfPasswordIsEmpty() {
assertNull(blankConfig.getPassword());
}
}
| [
"jop.angel@hotmail.com"
] | jop.angel@hotmail.com |
7208e9f576066bd92f8636f2c4203044222ee928 | 6117911ef76a96406331341f197847c8b98d1393 | /src/chengyunzuo/chapter_8_arrayandmatrix/Problem_08_LongestIntegratedLength.java | 3d748737c5f5a4bb2883ebec150dc205e2b784e8 | [
"Apache-2.0"
] | permissive | faceloss/danceOffer | 885abb61163d00bbffe6fd4d1d246752339e0819 | 43c70534bebe9f4ab812b4224a45790b533567fa | refs/heads/master | 2023-05-25T00:31:11.387170 | 2023-05-14T22:32:41 | 2023-05-14T22:32:41 | 288,166,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,536 | java | package chengyunzuo.chapter_8_arrayandmatrix;
import java.util.Arrays;
import java.util.HashSet;
public class Problem_08_LongestIntegratedLength {
public static int getLIL1(int[] arr) {
if (arr == null || arr.length == 0) {
return 0;
}
int len = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = i; j < arr.length; j++) {
if (isIntegrated(arr, i, j)) {
len = Math.max(len, j - i + 1);
}
}
}
return len;
}
public static boolean isIntegrated(int[] arr, int left, int right) {
int[] newArr = Arrays.copyOfRange(arr, left, right + 1); // O(N)
Arrays.sort(newArr); // O(N*logN)
for (int i = 1; i < newArr.length; i++) {
if (newArr[i - 1] != newArr[i] - 1) {
return false;
}
}
return true;
}
public static int getLIL2(int[] arr) {
if (arr == null || arr.length == 0) {
return 0;
}
int len = 0;
int max = 0;
int min = 0;
HashSet<Integer> set = new HashSet<Integer>(); // �ж��ظ�
for (int i = 0; i < arr.length; i++) {
max = Integer.MIN_VALUE;
min = Integer.MAX_VALUE;
for (int j = i; j < arr.length; j++) {
if (set.contains(arr[j])) {
break;
}
set.add(arr[j]);
max = Math.max(max, arr[j]);
min = Math.min(min, arr[j]);
if (max - min == j - i) { // �µļ�鷽ʽ
len = Math.max(len, j - i + 1);
}
}
set.clear();
}
return len;
}
public static void main(String[] args) {
int[] arr = { 5, 5, 3, 2, 6, 4, 3 };
System.out.println(getLIL1(arr));
System.out.println(getLIL2(arr));
}
}
| [
"15195886268@163.com"
] | 15195886268@163.com |
88337f56783a61ec95da516fd215c02d2a3a22f9 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/22/22_3fdf5148b8b9da3189efe58141d13169b4c60c34/ChatService/22_3fdf5148b8b9da3189efe58141d13169b4c60c34_ChatService_s.java | 6a02167ddb764f94986da76b407cf96f5723dcb6 | [] | 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 | 3,314 | java | /*
* Copyright (c) 2012. Ansvia Inc.
* Author: Robin Syihab.
*/
package com.ansvia.mindchat;
import android.app.IntentService;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.util.Log;
/**
* Main chat service.
*/
public class ChatService extends IntentService {
private static final String TAG = "ChatService";
//private static final String GETHUB_HOST = "www.gethub.us";
//private static final int GETHUB_PORT = 6060;
private static final String GETHUB_HOST = "10.0.2.2";
private static final int GETHUB_PORT = 6060;
// @TODO(*): jangan di hard-coded.
private static final String CHANNEL = "www.gethub.us";
private LogoutEventReceiver logoutEventReceiver;
public ChatService(String name) {
super(name);
}
public ChatService(){
super(TAG);
}
private class LogoutEventReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
GethubClient gethub = GethubClient.getInstance();
gethub.logout();
}
}
@Override
protected void onHandleIntent(Intent intent) {
Log.d(TAG, "in onHandleIntent()");
this.logoutEventReceiver = new LogoutEventReceiver();
registerReceiver(this.logoutEventReceiver, new IntentFilter("logout"));
GethubClient gethub = GethubClient.getInstance();
// set your gethub server address here.
gethub.connect(GETHUB_HOST, GETHUB_PORT);
try {
String sessid = gethub.authorize(intent.getStringExtra("userName"), intent.getStringExtra("password"));
if(sessid == null){
Log.i(TAG, "Cannot authorize user");
showError("Cannot authorize user, check your connection.");
return;
}
if(!gethub.join(CHANNEL, sessid)){
Log.i(TAG, "Cannot join to channel");
showError("Cannot join to channel " + CHANNEL);
return;
}
Intent chatRoomInitial = new Intent("chatroom.init");
chatRoomInitial.putExtra("sessid", sessid);
chatRoomInitial.putExtra("userName", intent.getStringExtra("userName"));
chatRoomInitial.putExtra("channel", CHANNEL);
sendBroadcast(chatRoomInitial);
//DataReceiver dataRec = new DataReceiver(gethub, sessid, intent.getStringExtra("userName"));
PacketHandler handler = new PacketHandler(this, gethub, sessid, intent.getStringExtra("userName"));
gethub.bind(CHANNEL, sessid, handler);
}catch (Exception e){
showError(e.getMessage());
}
}
private void showError(String msg){
Intent errorIntent = new Intent("error");
errorIntent.putExtra("data", msg);
sendBroadcast(errorIntent);
}
@Override
public void onDestroy() {
super.onDestroy();
unregisterReceiver(logoutEventReceiver);
GethubClient gethub = GethubClient.getInstance();
gethub.close();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
7529efdb02d0fa4ad7998b12d9718603f17ef5a1 | 78356c2701e793dd8ea7007adac858ce82f1eeec | /demo/src/main/java/com/example/demo/use/cases/questions/update/UpdateQuestionUseCase.java | 2836d357ed6c48a00ff425fa84a5a9e9a39fa510 | [
"Unlicense"
] | permissive | pikachumetal/java-demo | 9386b322a158a027eaa1d9ab270cd97da40ccbe5 | 32d0ef0b7c5c934728d5912fe2c339a430e0181b | refs/heads/main | 2023-06-15T12:49:38.412159 | 2021-07-16T10:03:37 | 2021-07-16T10:03:37 | 383,374,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,567 | java | package com.example.demo.use.cases.questions.update;
import com.example.demo.domain.Question;
import com.example.demo.persistence.UnitOfWork;
import com.example.demo.problems.question.QuestionNonExistsProblem;
import com.example.demo.problems.question.QuestionQueryExistsProblem;
import com.example.demo.use.cases.infrastructure.BaseUseCase;
import com.example.demo.use.cases.questions.add.AddQuestionParameters;
import org.hibernate.Hibernate;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("updateQuestion")
public class UpdateQuestionUseCase
extends BaseUseCase<UpdateQuestionParameters, UpdateQuestionResult> {
@Autowired
public UpdateQuestionUseCase(SessionFactory sessionFactory) {
super(sessionFactory);
}
@Override
public UpdateQuestionResult executeImpl(
UnitOfWork unitOfWork,
UpdateQuestionParameters parameters
) {
assertQuestionExists(unitOfWork, parameters.id);
assertQuestionQueryNonExists(unitOfWork, parameters);
var result = new UpdateQuestionResult();
result.question = updateMessage(unitOfWork, parameters);
Hibernate.initialize(result.question.topic);
return result;
}
private Question updateMessage(
UnitOfWork unitOfWork,
UpdateQuestionParameters parameters
) {
var repository = unitOfWork.getQuestionRepository();
var item = repository
.update(parameters.id,
new Question(parameters.query, parameters.email, parameters.answers))
.orElseThrow();
return repository.save(item);
}
public void assertQuestionExists(UnitOfWork unitOfWork, String id) {
var repository = unitOfWork.getQuestionRepository();
var item = repository.findById(id);
if (item.isPresent()) return;
throw new QuestionNonExistsProblem(id);
}
public void assertQuestionQueryNonExists(
UnitOfWork unitOfWork,
UpdateQuestionParameters parameters
) {
var repository = unitOfWork.getQuestionRepository();
var oldQuestion = repository.findById(parameters.id);
var item = repository
.findByQuery(oldQuestion.orElseThrow().topic.id, parameters.query);
if (item.isEmpty()) return;
if (item.get().id.equals(parameters.id)) return;
throw new QuestionQueryExistsProblem(parameters.query);
}
}
| [
"adelgado@medysif.com"
] | adelgado@medysif.com |
03d236029608322cef1a067b0348b02b6cc5bb61 | a8a87cde1e65151642e66b3da30c8a406048aefd | /MySuccess/10519 - Really Strange.java | 596eb8ec6712fa21c92f5f5a19a195f0c5ba3124 | [] | no_license | codingaquarium/ProgrammingCollection | c321c78fd043e7de77b6b37fbb25c323fbd3422a | 798d48421e01eb956ffc47109cfab36dc1fcb577 | refs/heads/master | 2020-05-30T07:50:32.289872 | 2014-11-22T22:04:27 | 2014-11-22T22:04:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | /*
http://codingaquarium.wordpress.com/
Shaikh shiam Rahman
Khunla University of Engineering and Technology(KUET)
UVa - 10519 - Really Strange
*/
import java.math.BigInteger;
import java.util.Scanner;
class Main
{
public static void main( String args[] )
{
Scanner input = new Scanner( System.in );
BigInteger ans = new BigInteger ("0");
BigInteger N1 = new BigInteger ("0");
while(input.hasNextBigInteger()){
N1= input.nextBigInteger();
if(N1.equals(BigInteger.valueOf(0)))
{
System.out.println(1);
continue;
}
ans=N1.multiply(N1);
ans=ans.subtract(N1);
ans=ans.add(BigInteger.valueOf(2));
System.out.println(ans);
}
}
} | [
"shiam.619@gmail.com"
] | shiam.619@gmail.com |
f87a6762c51a9ec4ccc112f661ec300489cce2fd | 965236976a6a0f7c225f727e616ad766791a6896 | /Robot2018/src/org/usfirst/frc/team2531/robot/commands/Square2.java | d08e395c8b9fe569961f96c178a91c38baa7b435 | [] | no_license | 2531RoboHawks/2018RobotCode | c11ffb159942fddafe827bf9a3e8bdb31871bf55 | 37cbea016e59f6affdcdf748da36e62f334de20d | refs/heads/master | 2021-07-03T10:14:14.047208 | 2018-12-05T20:06:28 | 2018-12-05T20:06:28 | 111,227,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 515 | java | package org.usfirst.frc.team2531.robot.commands;
import edu.wpi.first.wpilibj.command.CommandGroup;
/**
*
*/
public class Square2 extends CommandGroup {
public Square2() {
addSequential(new TimeDrive(1000, 0.5, 0));
addSequential(new Turn2Angle(90));
addSequential(new TimeDrive(1000, 0.5, 0));
addSequential(new Turn2Angle(90));
addSequential(new TimeDrive(1000, 0.5, 0));
addSequential(new Turn2Angle(90));
addSequential(new TimeDrive(1000, 0.5, 0));
addSequential(new Turn2Angle(90));
}
}
| [
"chase@ChaseLaptop"
] | chase@ChaseLaptop |
8c1d204c21ec8fa717b6502056ae39d7c940ff1e | 15aab80ea0d27049b7ccdfd6ef4e6873f05b17bb | /app/service/BookService.java | c0390dbb7f1e7b5617d08c411c548b5814c79de3 | [] | no_license | bazzo03/library | 1e1dcc6d906e1a0f6707d18c6d6b59d7ccc2d301 | 7648a749e2b36dd9851af668bdacbbac0e2327f3 | refs/heads/master | 2020-04-11T12:46:01.538722 | 2018-12-14T14:09:38 | 2018-12-14T14:09:38 | 161,791,378 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 635 | java | package service;
import com.google.inject.Inject;
import converter.BookConverter;
import entity.BookEntity;
import repository.BookRepository;
import dto.BookDto;
import java.util.concurrent.CompletableFuture;
public class BookService {
@Inject
private BookRepository bookRepository;
public boolean saveBook(BookDto bookDto) {
bookRepository.save(BookConverter.fromDto(bookDto));
return true;
}
public CompletableFuture<BookEntity> findBookBySerial(Long serial) {
System.out.println(serial);
return bookRepository.findBookBySerial(serial);
}
}
| [
"dbernalbazzani@UNKNOWN-172-142-191-X.yahoo.com"
] | dbernalbazzani@UNKNOWN-172-142-191-X.yahoo.com |
c695bdf14cfdde5c678d8848aa67723337f2d4e2 | 4688011a82a15655b17d986c2bf2293d32ad4e7e | /example/android/app/src/debug/java/com/example/reactnativeiterate/ReactNativeFlipper.java | 66692df3848b9f7a789789dbfce815f0ee371c7e | [
"MIT"
] | permissive | endronk/react-native-iterate | d06a21572e4908bd639beb52c2eaf99201f29ae6 | c50655a89de43e7f91d32c1ad89652423284861a | refs/heads/master | 2023-06-04T10:07:54.536360 | 2021-05-14T18:25:57 | 2021-05-14T18:25:57 | 377,109,398 | 1 | 0 | MIT | 2021-06-15T09:34:59 | 2021-06-15T09:34:58 | null | UTF-8 | Java | false | false | 3,278 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.example.reactnativeiterate;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"mike@pickaxe.nyc"
] | mike@pickaxe.nyc |
259864fce57d7dc9b4b2deaa829ee38f0a5bfd15 | fdde1aad018775cc5f89a714e856175ea2d643cf | /Java(SIT)/NOP/PROJECTS_codes/Zadatak4/ProbniGUI_Builder4.2_MVC/src/view/App.java | 6057bc41113becfa0af66e5d2fa90cd2019f6812 | [] | no_license | winZD/Java | e6f49c5c4b37e174599c4477df287b995a3ac2ba | b027ec72c4f3cb90a3bce66848dcd616d7b5120f | refs/heads/master | 2020-04-27T14:59:50.686488 | 2020-02-16T17:40:45 | 2020-02-16T17:40:45 | 161,062,861 | 0 | 0 | null | 2019-03-05T14:15:20 | 2018-12-09T17:14:57 | HTML | UTF-8 | Java | false | false | 234 | java | package view;
import javax.swing.SwingUtilities;
public class App {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new AppFrame();
}
});
}
}
| [
"puntica007@gmail.com"
] | puntica007@gmail.com |
9260e355f614c608244f4ce54c66e0d7261d37fa | b0b577431700352f7c40ca41a0def6ed4f558d5c | /app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/cardview/R.java | 66ac43f80f6a58acd724764088cac9ee127bca72 | [] | no_license | angelcherry1/electronicCommerce | da9e2007703f98aa2f4bb886ef14dd121e649e6c | 98aba1a401f446b24b5a5633e65a2d5c730a1020 | refs/heads/master | 2022-09-01T17:03:33.160314 | 2020-05-20T14:14:48 | 2020-05-20T14:14:48 | 265,577,627 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,185 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.cardview;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int cardBackgroundColor = 0x7f03007d;
public static final int cardCornerRadius = 0x7f03007e;
public static final int cardElevation = 0x7f03007f;
public static final int cardMaxElevation = 0x7f030080;
public static final int cardPreventCornerOverlap = 0x7f030081;
public static final int cardUseCompatPadding = 0x7f030082;
public static final int cardViewStyle = 0x7f030083;
public static final int contentPadding = 0x7f0300c4;
public static final int contentPaddingBottom = 0x7f0300c5;
public static final int contentPaddingLeft = 0x7f0300c6;
public static final int contentPaddingRight = 0x7f0300c7;
public static final int contentPaddingTop = 0x7f0300c8;
}
public static final class color {
private color() {}
public static final int cardview_dark_background = 0x7f05002d;
public static final int cardview_light_background = 0x7f05002e;
public static final int cardview_shadow_end_color = 0x7f05002f;
public static final int cardview_shadow_start_color = 0x7f050030;
}
public static final class dimen {
private dimen() {}
public static final int cardview_compat_inset_shadow = 0x7f06004e;
public static final int cardview_default_elevation = 0x7f06004f;
public static final int cardview_default_radius = 0x7f060050;
}
public static final class style {
private style() {}
public static final int Base_CardView = 0x7f10000e;
public static final int CardView = 0x7f1000c7;
public static final int CardView_Dark = 0x7f1000c8;
public static final int CardView_Light = 0x7f1000c9;
}
public static final class styleable {
private styleable() {}
public static final int[] CardView = { 0x101013f, 0x1010140, 0x7f03007d, 0x7f03007e, 0x7f03007f, 0x7f030080, 0x7f030081, 0x7f030082, 0x7f0300c4, 0x7f0300c5, 0x7f0300c6, 0x7f0300c7, 0x7f0300c8 };
public static final int CardView_android_minWidth = 0;
public static final int CardView_android_minHeight = 1;
public static final int CardView_cardBackgroundColor = 2;
public static final int CardView_cardCornerRadius = 3;
public static final int CardView_cardElevation = 4;
public static final int CardView_cardMaxElevation = 5;
public static final int CardView_cardPreventCornerOverlap = 6;
public static final int CardView_cardUseCompatPadding = 7;
public static final int CardView_contentPadding = 8;
public static final int CardView_contentPaddingBottom = 9;
public static final int CardView_contentPaddingLeft = 10;
public static final int CardView_contentPaddingRight = 11;
public static final int CardView_contentPaddingTop = 12;
}
}
| [
"2946571671@qq.com"
] | 2946571671@qq.com |
20eab92b84bd4ef87ac0802782ba2405ab55aab0 | 4e314148918577a0daa3be856bb66ce168351383 | /trainticket-model/src/main/java/com/mangocity/vo/OrderBasisVo.java | b483e73d34f280d8748f290455b4f5a2cb3436d4 | [] | no_license | jerrik123/hcp01 | c3ee50b401d0815433eb9187c16ed866127c5754 | c59fa76350061449c45fa89860eafe24a071a987 | refs/heads/master | 2021-06-06T16:49:28.180827 | 2016-07-21T00:52:55 | 2016-07-21T00:52:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,831 | java | package com.mangocity.vo;
import java.io.Serializable;
import com.mangocity.model.Order;
/**
* 订单基本信息
*
* @author hongxiaodong
*
*/
public class OrderBasisVo extends Order implements Serializable {
/**
*
*/
private static final long serialVersionUID = 2997676210540094235L;
private String payModel;// 支付方式
private String paymetStatus;// 支付状态
private String ccrq;// 乘车日期
private String ccsj;//
private String origStationName;
private String destStationName;
private Long orderItemId;
public OrderBasisVo() {
super();
}
public String getPayModel() {
return payModel;
}
public void setPayModel(String payModel) {
this.payModel = payModel;
}
public String getPaymetStatus() {
return paymetStatus;
}
public void setPaymetStatus(String paymetStatus) {
this.paymetStatus = paymetStatus;
}
public String getCcrq() {
return ccrq;
}
public void setCcrq(String ccrq) {
this.ccrq = ccrq;
}
public String getCcsj() {
return ccsj;
}
public void setCcsj(String ccsj) {
this.ccsj = ccsj;
}
public String getOrigStationName() {
return origStationName;
}
public void setOrigStationName(String origStationName) {
this.origStationName = origStationName;
}
public String getDestStationName() {
return destStationName;
}
public void setDestStationName(String destStationName) {
this.destStationName = destStationName;
}
public Long getOrderItemId() {
return orderItemId;
}
public void setOrderItemId(Long orderItemId) {
this.orderItemId = orderItemId;
}
@Override
public String toString() {
return "OrderBasisVo [payModel=" + payModel + ", paymetStatus=" + paymetStatus + ", ccrq=" + ccrq + ", ccsj="
+ ccsj + ", origStationName=" + origStationName + ", destStationName=" + destStationName + "]";
}
}
| [
"yangjie_software@163.com"
] | yangjie_software@163.com |
01d5d85eb1608792513a1f735a2e26ec1af0e89a | c0ebf911522ad643eece2de810830b6a67fe83ba | /src/main/java/ru/malichenko/market/ws/orders/ObjectFactory.java | fcc92e569634f2a876ed5ed399a7e8ec5b33c7d6 | [] | no_license | tanbinh123/7-SpringBootMarket | 05d382f4e0859cf2567070c3e21427ab18bde80c | 3ab11ffda13cd8cc047441f6099b710f34b34ea5 | refs/heads/master | 2023-04-01T04:36:01.992741 | 2021-03-25T11:54:04 | 2021-03-25T11:54:04 | 461,385,484 | 1 | 0 | null | 2022-02-20T04:42:36 | 2022-02-20T04:42:36 | null | UTF-8 | Java | false | false | 1,959 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2020.11.13 at 02:43:48 PM MSK
//
package ru.malichenko.market.ws.orders;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the ru.malichenko.market.ws.orders package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: ru.malichenko.market.ws.orders
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link GetOrdersByUserRequest }
*
*/
public GetOrdersByUserRequest createGetOrdersByUserRequest() {
return new GetOrdersByUserRequest();
}
/**
* Create an instance of {@link GetOrdersByUserResponse }
*
*/
public GetOrdersByUserResponse createGetOrdersByUserResponse() {
return new GetOrdersByUserResponse();
}
/**
* Create an instance of {@link Order }
*
*/
public Order createOrders() {
return new Order();
}
/**
* Create an instance of {@link OrderItem }
*
*/
public OrderItem createOrderItem() {
return new OrderItem();
}
}
| [
"u.malichenko@gmail.com"
] | u.malichenko@gmail.com |
b14e04b92c59243fb9ec65a32735a1f0d293f89c | 62af4a2b48ac000b6fa0bfb206103e205ee043ee | /src/main/java/org/whyspring/core/annotation/AnnotationAttributes.java | ec4c5067b13eb2a675564c7de472da59826c530d | [] | no_license | Why1214/whyspring | e5f407a4bac04c54543954cf6d5704e63f337176 | d379d03cf0493d30bf8d1ada68b8695f89c0784d | refs/heads/master | 2020-05-01T08:11:51.900991 | 2019-04-13T08:38:37 | 2019-04-13T08:38:37 | 177,372,226 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,014 | java | package org.whyspring.core.annotation;
import org.whyspring.util.Assert;
import java.util.LinkedHashMap;
import java.util.Map;
import static java.lang.String.format;
@SuppressWarnings("serial")
public class AnnotationAttributes extends LinkedHashMap<String, Object> {
/**
* Create a new, empty {@link AnnotationAttributes} instance.
*/
public AnnotationAttributes() {
}
/**
* Create a new, empty {@link AnnotationAttributes} instance with the given initial
* capacity to optimize performance.
*
* @param initialCapacity initial size of the underlying map
*/
public AnnotationAttributes(int initialCapacity) {
super(initialCapacity);
}
public AnnotationAttributes(Map<String, Object> map) {
super(map);
}
public String getString(String attributeName) {
return doGet(attributeName, String.class);
}
public String[] getStringArray(String attributeName) {
return doGet(attributeName, String[].class);
}
public boolean getBoolean(String attributeName) {
return doGet(attributeName, Boolean.class);
}
@SuppressWarnings("unchecked")
public <N extends Number> N getNumber(String attributeName) {
return (N) doGet(attributeName, Integer.class);
}
@SuppressWarnings("unchecked")
public <E extends Enum<?>> E getEnum(String attributeName) {
return (E) doGet(attributeName, Enum.class);
}
@SuppressWarnings("unchecked")
public <T> Class<? extends T> getClass(String attributeName) {
return doGet(attributeName, Class.class);
}
public Class<?>[] getClassArray(String attributeName) {
return doGet(attributeName, Class[].class);
}
@SuppressWarnings("unchecked")
private <T> T doGet(String attributeName, Class<T> expectedType) {
Object value = this.get(attributeName);
Assert.notNull(value, format("Attribute '%s' not found", attributeName));
return (T) value;
}
} | [
"root@whydeMacBook.local"
] | root@whydeMacBook.local |
e89ab454105912ba28f3323670ba5f69a5ffbfb7 | 9687d6e6fc7a1a59f5a769d0bf1696484d5cd879 | /car-service-api/order/order-web/src/main/java/com/car/order/web/model/instance/OrderCaseDetail.java | 0c3b4219541814a92361e7cd5b2550de2540d2e2 | [] | no_license | willpyshan13/CarStore2.0 | 15fa662d5a8ca4a76c9e9d205dd1640d42e30e53 | e8b85b7b3145bcc10cdccdf4779300846bce6026 | refs/heads/main | 2023-08-14T14:03:35.196407 | 2021-09-14T06:08:56 | 2021-09-14T06:08:56 | 385,832,432 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 972 | java | package com.car.order.web.model.instance;
import com.car.common.datasource.model.BaseModelInfo;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Table;
import java.math.BigDecimal;
/**
* @author zhouz
* @date 2020/12/31
*/
@Data
@Table(name = "order_case_detail")
public class OrderCaseDetail extends BaseModelInfo {
/**
* 订单uuid
*/
@Column(name = "order_uuid")
private String orderUuid;
/**
* 案例uuid
*/
@Column(name = "case_uuid")
private String caseUuid;
/**
* 案例名称
*/
@Column(name = "case_name")
private String caseName;
/**
* 案例数量
*/
@Column(name = "case_num")
private Integer caseNum;
/**
* 案例资源地址
*/
@Column(name = "case_img_url")
private String caseImgUrl;
/**
* 案例价格
*/
@Column(name = "materials_expenses")
private BigDecimal materialsExpenses;
}
| [
"545512533@qq.com"
] | 545512533@qq.com |
c3a86c87fc730ea17485f6597dae650d721dc2d1 | 7758319f54034acbec8825463a7df5f8f9e5be66 | /backend/src/main/java/com/cyio/backend/security/oauth2/HttpCookieOAuth2AuthorizationRequestRepository.java | 9a5d8bd0fb2951e854fe9de98b407d70efc4f717 | [] | no_license | Mluckydwyer/Cy.io | 87fb6f8b47698d2d18df3bcf5182403689b1c71a | 50a0e64a430e7fd6068a0422ad1e72d24282a6fd | refs/heads/master | 2023-01-23T21:05:13.885693 | 2020-01-03T11:05:31 | 2020-01-03T11:05:31 | 231,502,820 | 3 | 0 | null | 2023-01-12T05:57:41 | 2020-01-03T03:11:02 | HTML | UTF-8 | Java | false | false | 2,484 | java | package com.cyio.backend.security.oauth2;
import com.cyio.backend.util.CookieUtils;
import org.springframework.security.oauth2.client.web.AuthorizationRequestRepository;
import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest;
import org.springframework.stereotype.Component;
import com.nimbusds.oauth2.sdk.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Component
public class HttpCookieOAuth2AuthorizationRequestRepository implements AuthorizationRequestRepository<OAuth2AuthorizationRequest> {
public static final String OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME = "oauth2_auth_request";
public static final String REDIRECT_URI_PARAM_COOKIE_NAME = "redirect_uri";
private static final int cookieExpireSeconds = 180;
@Override
public OAuth2AuthorizationRequest loadAuthorizationRequest(HttpServletRequest request){
return CookieUtils.getCookie(request, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME)
.map(cookie -> CookieUtils.deserializa(cookie,OAuth2AuthorizationRequest.class))
.orElse(null);
}
@Override
public void saveAuthorizationRequest(OAuth2AuthorizationRequest authorizationRequest, HttpServletRequest request, HttpServletResponse response){
if (authorizationRequest == null){
CookieUtils.deleteCookie(request,response, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME);
CookieUtils.deleteCookie(request,response, REDIRECT_URI_PARAM_COOKIE_NAME);
return;
}
CookieUtils.addCookie(response, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME, CookieUtils.serialize(authorizationRequest), cookieExpireSeconds);
String redirectUriAfterLogin = request.getParameter(REDIRECT_URI_PARAM_COOKIE_NAME);
if (StringUtils.isNotBlank(redirectUriAfterLogin)){
CookieUtils.addCookie(response, REDIRECT_URI_PARAM_COOKIE_NAME,redirectUriAfterLogin,cookieExpireSeconds);
}
}
@Override
public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest request){
return this.loadAuthorizationRequest(request);
}
public void removeAuthorizationRequestCookies(HttpServletRequest request, HttpServletResponse response) {
CookieUtils.deleteCookie(request, response, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME);
CookieUtils.deleteCookie(request, response, REDIRECT_URI_PARAM_COOKIE_NAME);
}
}
| [
"tomsun@localhost.localdomain"
] | tomsun@localhost.localdomain |
fdc29629ca2964ebf13db59cb04ed4b5f9a4a52a | fcf6fc9d71b3bb2740b4ef222dc5e459a0fcc7a0 | /src/sz/iecas/dao/UserMapper.java | 0003a547a14016f4b66a9bdd19cdce8fdaab46f3 | [] | no_license | Dylanwooo/Recruitment-system | 4db144428fc2206106d70cd8ebffd5a4ea9c2786 | f70643f6dd8ae840bab03db5fa326d4ebcd02502 | refs/heads/master | 2021-01-19T18:19:56.324472 | 2017-09-12T13:40:03 | 2017-09-12T13:40:03 | 101,124,149 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,597 | java | package sz.iecas.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import sz.iecas.model.User;
import sz.iecas.model.UserExample;
public interface UserMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int countByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int deleteByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int insert(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int insertSelective(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
List<User> selectByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
User selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int updateByExample(@Param("record") User record, @Param("example") UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbggenerated
*/
int updateByPrimaryKey(User record);
} | [
"13128589345@163.com"
] | 13128589345@163.com |
664490372e0cda50d0e5df5325a678ef2ac04866 | 51afb31b4ccd3047fc7ad0450e4186aa4582a8b9 | /app/src/main/java/com/thebitcorps/imagemanipulator/fragments/CameraCaptureFragment.java | 1de8782501c04e81572660b92aac82ca5af56c47 | [] | no_license | diegollams/ImageManipulator | d87d685a7fa7729090f89bbcf99a14aebd2b8e42 | b5bbb0eecbfca1f943cc8dbca7ba4707c536dd1a | refs/heads/master | 2016-08-11T11:19:47.253236 | 2016-03-03T17:40:52 | 2016-03-03T17:40:52 | 50,435,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,955 | java | package com.thebitcorps.imagemanipulator.fragments;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.graphics.Bitmap;
import android.hardware.Camera;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.thebitcorps.imagemanipulator.R;
import com.thebitcorps.imagemanipulator.helpers.BitmapTrasformer;
import com.thebitcorps.imagemanipulator.helpers.CamaraPreview;
import com.thebitcorps.imagemanipulator.helpers.UriCreator;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
// TODO: 2/6/16 fix bug in in oorientation change camera
public class CameraCaptureFragment extends Fragment{
private CamaraPreview cameraPreview;
private Camera camera;
private int cameraId;
private Uri imageUri;
private static int IMAGE_WIDTH_DEFAULT = 500;
private static int IMAGE_HEIGTH_DEFAULT = 500;
private static final String TAG = "shit";
public static final String DEFAULT_IMAGE_NAME = "sampleImage.jpg";
FrameLayout frameLayout;
public static CameraCaptureFragment newInstance(){
CameraCaptureFragment cameraCaptureFragment = new CameraCaptureFragment();
return cameraCaptureFragment;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_camera_capture,container,false);
// capture camra button
FloatingActionButton captureButton = (FloatingActionButton) view.findViewById(R.id.capture);
captureButton.setOnClickListener(captureListener);
// change camera button
FloatingActionButton changeCamera = (FloatingActionButton) view.findViewById(R.id.change_camera);
// if device not support various cameras hide button
if(Camera.getNumberOfCameras() > 1){
changeCamera.setOnClickListener(changeCameraOnClickListener);
}else{
changeCamera.setVisibility(View.INVISIBLE);
}
// default camera
cameraId = Camera.CameraInfo.CAMERA_FACING_BACK;
frameLayout = (FrameLayout) view.findViewById(R.id.camera);
return view;
}
/**
*
* @return return the instance of the camera selected of null if can't open any
*/
public static Camera getCameraInstance(int cameraId,Activity activity ){
Camera camera = null;
try{
// TODO: 2/6/16 Add camera features
// open the camra
camera = Camera.open(cameraId);
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(cameraId,info);
// get the display rotation
int rotation = activity.getWindowManager().getDefaultDisplay().getRotation();
int degrees = 0;
// adjust image depending in rotation of the sceeen
switch (rotation) {
case Surface.ROTATION_0: degrees = 0; break;
case Surface.ROTATION_90: degrees = 90; break;
case Surface.ROTATION_180: degrees = 180; break;
case Surface.ROTATION_270: degrees = 270; break;
}
int result;
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
result = (info.orientation + degrees) % 360;
result = (360 - result) % 360; // compensate the mirror
} else { // back-facing
result = (info.orientation - degrees + 360) % 360;
}
camera.setDisplayOrientation(result);
}
catch (Exception e){
e.printStackTrace();
Log.e(TAG,"camera instance: " + e.getMessage());
}
return camera;
}
@Override
public void onResume() {
super.onResume();
camera = getCameraInstance(cameraId,getActivity());
if(camera != null){
// create a new camera preview and add it to the framelayot
// TODO: 2/2/16 fix bug on resume no opening preview
// // TODO: 1/27/16 Change so we dont instance a new camera preview so only we change the camera
if(cameraPreview == null){
cameraPreview = new CamaraPreview(getActivity(),camera);
frameLayout.addView(cameraPreview);
}else {
cameraPreview.setCamera(camera);
}
}
else{
Snackbar.make(frameLayout,R.string.camera_error,Snackbar.LENGTH_LONG).setAction("~Action", null).show();
}
}
@Override
public void onPause() {
super.onPause();
stopCamera();
}
private void stopCamera() {
if(camera != null){
// we stop the camera so other applications can use it
camera.stopPreview();
camera.setPreviewCallback(null);
cameraPreview.getHolder().removeCallback(cameraPreview);
camera.release();
camera = null;
}
}
public static void changeToShowImageFragment(Uri imageUri,FragmentManager fragmentManager) {
ShowImageFragment imageFragment = ShowImageFragment.newInstance();
Bundle extras = new Bundle();
extras.putParcelable(ShowImageFragment.IMAGE_URI_EXTRA, imageUri);
imageFragment.setArguments(extras);
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.fragment,imageFragment);
// fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
private Camera.PictureCallback pictureCallback = new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
File pictureFile = UriCreator.getOutputMediaFile(UriCreator.MEDIA_TYPE_IMAGE,getActivity().getPackageName());
if(pictureFile == null){
Log.d(TAG, "Error creating media file, check storage permissions: ");
return;
}
Bitmap bitmap = BitmapTrasformer.decodeSampledBitmapFromData(data,IMAGE_WIDTH_DEFAULT,IMAGE_HEIGTH_DEFAULT);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(pictureFile);
bitmap.compress(Bitmap.CompressFormat.JPEG,100,fos);
// fos.write(bitmap,to);
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
imageUri = Uri.fromFile(pictureFile);
stopCamera();
changeToShowImageFragment(imageUri,getFragmentManager());
}
};
private View.OnClickListener captureListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
camera.takePicture(null, null, pictureCallback);
}
};
private FloatingActionButton.OnClickListener changeCameraOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
stopCamera();
cameraId = cameraId == Camera.CameraInfo.CAMERA_FACING_BACK ? Camera.CameraInfo.CAMERA_FACING_FRONT : Camera.CameraInfo.CAMERA_FACING_BACK;
camera = getCameraInstance(cameraId,getActivity());
if(camera != null) {
cameraPreview.setCamera(camera);
}else{
Snackbar.make(frameLayout,R.string.camera_error,Snackbar.LENGTH_LONG).setAction("~Action", null).show();
}
}
};
}
| [
"diegollams@gmail.com"
] | diegollams@gmail.com |
a97543fb7cc8117245686ebe4615dacbeb134b99 | e039956f728dc7961972afd6b9b2eab981f555ac | /src/main/java/edu/northeastern/ccs/cs5500/problem1/AbstractFactory.java | 768edf3a97c61a47baf8853cca32bb34b36386d8 | [] | no_license | kryvtsunt/card-games | 84d3e4ee50f92fa203ed67f3edbd52d00ed1b364 | d3c8550310613cf680d5cb36267e6f3b6040fc9a | refs/heads/master | 2020-04-03T07:54:13.498356 | 2018-10-30T14:59:29 | 2018-10-30T14:59:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,397 | java | package edu.northeastern.ccs.cs5500.problem1;
/**
* An AbstractFactory is an abstraction of a Factory (Games and Decks generator).
*
* @author Tymofii Kryvtsun
*/
public abstract class AbstractFactory {
/**
* Generates a Deck by input Deck Type (look up DeckType Enum).
*
* @param type type of the Deck to generate.
* @return generated Deck.
*/
abstract Deck getDeck(DeckType type);
/**
* Generates a Deck by input Deck Type (look up DeckType Enum) and number of decks to combine together.
*
* @param type type of the Deck to generate.
* @param numberOfDecks number of decks to combined together.
* @return generated Deck.
*/
abstract Deck getDeck(DeckType type, int numberOfDecks);
/**
* Generates a Game by inputs.
*
* @param deckType type of the Deck.
* @param numberOfDecks number of decks to combine together.
* @param numberOfPlayers number of players in the game.
* @return generated Game.
*/
abstract Game getGame(String deckType, int numberOfDecks, int numberOfPlayers);
/**
* /**
* Generates a Game by inputs.
*
* @param deckType type of the Deck.
* @param numberOfPlayers number of players in the game.
* @return generated Game.
*/
abstract Game getGame(String deckType, int numberOfPlayers);
}
| [
"kryvtsun.t@husky.neu.edu"
] | kryvtsun.t@husky.neu.edu |
f2262feaee3a1ce35fa7acc71a423e1da6ec8cb9 | 665f14bdd75b01ff2a74a18bdf0fe4c7d346b7d8 | /core/src/main/java/cn/fdongl/point/core/service/UploadService.java | a506ad25bee803908ef95d6a024f1421e013cfc3 | [] | no_license | fangdongliu/point | 4b0507c97290e61c303cfd825ffc9c5bf34a6101 | a1ddff0e5eacd3ae3abbfaf35430d587e614f48f | refs/heads/master | 2022-07-14T04:10:29.541838 | 2019-09-15T09:20:22 | 2019-09-15T09:20:22 | 208,569,734 | 0 | 0 | null | 2022-06-29T17:38:43 | 2019-09-15T09:19:55 | Java | UTF-8 | Java | false | false | 12,132 | java | package cn.fdongl.point.core.service;
import cn.fdongl.point.auth.repository.UserRepository;
import cn.fdongl.point.auth.vo.JwtUser;
import cn.fdongl.point.core.exception.SheetNotFoundException;
import cn.fdongl.point.core.mapper.BatchUploadMapper;
import cn.fdongl.point.core.repository.CourseRepository;
import cn.fdongl.point.core.repository.IndexRepository;
import cn.fdongl.point.core.repository.MapCourseIndexRepository;
import cn.fdongl.point.core.vo.UploadCourse;
import cn.fdongl.point.core.vo.UploadStudentCourse;
import cn.fdongl.point.core.vo.UploadTeacher;
import cn.fdongl.point.core.vo.UploadTeacherCourse;
import cn.fdongl.point.excel.util.SheetHelper;
import cn.fdongl.point.model.entity.*;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.swing.plaf.multi.MultiDesktopPaneUI;
import java.text.ParseException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Service
public class UploadService {
@Autowired
PasswordEncoder passwordEncoder;
@Autowired
CourseRepository courseRepository;
@Autowired
UserRepository userRepository;
@Autowired
StatusService statusService;
@Autowired
BatchUploadMapper uploadMapper;
@Autowired
IndexRepository indexRepository;
@Autowired
MapCourseIndexRepository mapCourseIndexRepository;
@Value("${batch-size}")
Integer batchSize;
private final Pattern pattern = Pattern.compile("\\d{4}");
public int uploadCultivateMatrix(Workbook workbook,String filename,JwtUser jwtUser) throws SheetNotFoundException {
Sheet sheet = workbook.getSheetAt(2);
Matcher matcher = pattern.matcher(filename);
Long grade = null;
if(matcher.find()) {
grade = Long.valueOf(matcher.group(0));
}
if(sheet==null){
throw new SheetNotFoundException();
}
SheetHelper sheetHelper = new SheetHelper(sheet,3);
List<List<Object>>headers = sheetHelper.collectLines(1,3,2,sheetHelper.getColCount());
List<String>h1 = sheetHelper.filterNull(headers.get(0)).stream().map(Object::toString).collect(Collectors.toList());
List<String>h2 = sheetHelper.filterNull(headers.get(1)).stream().map(Object::toString).collect(Collectors.toList());
String[]h = new String[h1.size()];
for(int i =h1.size()-1;i>=0;i--){
h[i] = h1.get(i) +'\n' + h2.get(i);
}
List<List<Object>>lines = sheetHelper.collectLines(3,-2,0,-2);
Date now = new Date();
List<Object>obj = sheetHelper.filterNull(lines.get(0));
obj = obj.subList(0,obj.size());
List<Index>firstLine = obj.stream().map(i->{
Index index = new Index();
String s = i.toString();
int comma = s.indexOf('.');
int space = s.indexOf(' ');
String sub1 = s.substring(0,comma);
Long title = Long.valueOf(sub1);
String sub2 = s.substring(comma+1,space);
index.setIndexContent(s.substring(space+1));
index.setIndexTitle(title);
index.setIndexNumber(Long.valueOf(sub2));
index.setParent(h[title.intValue() - 1]);
index.setCreateDate(now);
index.setModifyDate(now);
index.setCreateBy(jwtUser.getId());
index.setModifiedBy(jwtUser.getId());
return index;
}).collect(Collectors.toList());
indexRepository.saveAll(firstLine);
List<MapCourseIndex>indices = new ArrayList<>();
for(int i=lines.size()-1;i>0;i--){
List<Object>line = lines.get(i);
for(int j=line.size()-2;j>1;j--){
Object o = line.get(j);
if(o!=null){
MapCourseIndex mapCourseIndex = new MapCourseIndex();
Index index = firstLine.get(j - 2);
if(line.get(0) instanceof String){
mapCourseIndex.setCourseNumber((String)line.get(0));
} else {
mapCourseIndex.setCourseNumber(String.valueOf(((Double) line.get(0)).longValue()));
}
mapCourseIndex.setIndexId(index.getId());
mapCourseIndex.setTitle(index.getIndexTitle()+"."+index.getIndexNumber());
mapCourseIndex.setProportionValue((Double)o);
mapCourseIndex.setCourseSemester(grade);
indices.add(mapCourseIndex);
}
}
}
mapCourseIndexRepository.deleteAllInBatch();
mapCourseIndexRepository.saveAll(indices);
return indices.size();
}
public int uploadTeacherCourse(Workbook workbook,JwtUser jwtUser) throws SheetNotFoundException, IllegalAccessException, ParseException, InstantiationException {
Sheet sheet = workbook.getSheetAt(0);
if(sheet==null){
throw new SheetNotFoundException();
}
SheetHelper sheetHelper = new SheetHelper(sheet,2);
List<UploadTeacherCourse> sourceCourses = sheetHelper.collectLinesForClass(UploadTeacherCourse.class,3);
List<MapTeacherCourse> courses = sourceCourses.stream().map(UploadTeacherCourse::toCourse).collect(Collectors.toList());
Date now = new Date();
List<User> users = userRepository.findAll();
Map<String,String>userMap = new HashMap<>();
for (User user : users) {
userMap.put(user.getRealName(),user.getWorkId());
}
List<MapTeacherCourse>newCourses = new ArrayList<>();
for (MapTeacherCourse cours : courses) {
cours.setTeacherWorkId(userMap.get(cours.getTeacherRealName()));
if(cours.getTeacherWorkId() == null){
continue;
}
cours.setCreateDate(now);
cours.setModifyDate(now);
cours.setCreateBy(jwtUser.getId());
cours.setModifiedBy(jwtUser.getId());
newCourses.add(cours);
}
for(int i = newCourses.size();i>=0;i-=batchSize){
int start = i-batchSize;
if(start<0){
start = 0;
}
uploadMapper.insertTeacherCourseIgnore(newCourses.subList(start,i));
}
return newCourses.size();
}
// @Async
public void uploadStudentCourse(Workbook workbook,String statusId,JwtUser jwtUser) throws SheetNotFoundException, IllegalAccessException, ParseException, InstantiationException {
try {
statusService.updateStatus(statusId, -1);
Sheet sheet = workbook.getSheetAt(0);
if (sheet == null) {
throw new SheetNotFoundException();
}
SheetHelper sheetHelper = new SheetHelper(sheet, 0);
String password = passwordEncoder.encode("123456");
List<UploadStudentCourse> lines = sheetHelper.collectLinesForClass(UploadStudentCourse.class, 1);
Map<String, User> students = new HashMap<>();
for (UploadStudentCourse line : lines) {
if (!students.containsKey(line.getUserWorkId())) {
students.put(line.getUserWorkId(), line.toUser());
}
}
Collection<User> cl = students.values();
List<User> clist = new ArrayList<>(cl);
Date now = new Date();
for (User user : clist) {
user.setUserPwd(password);
user.setCreateDate(now);
user.setModifyDate(now);
user.setCreateBy(jwtUser.getId());
user.setModifiedBy(jwtUser.getId());
}
for (int i = clist.size(); i >= 0; i -= batchSize) {
int start = i - batchSize;
if (start < 0) {
start = 0;
}
uploadMapper.insertUserIgnore(clist.subList(start, i));
}
List<MapStudentCourse> courses = lines.stream().map(UploadStudentCourse::toMapStudentCourse).collect(Collectors.toList());
for (MapStudentCourse cours : courses) {
cours.setCreateDate(now);
cours.setModifyDate(now);
cours.setCreateBy(jwtUser.getId());
cours.setModifiedBy(jwtUser.getId());
}
int count = 0;
for (int i = courses.size(); i >= 0; i -= batchSize) {
int start = i - batchSize;
if (start < 0) {
start = 0;
}
uploadMapper.insertStudentCourseIgnore(courses.subList(start, i));
count += (i - start);
statusService.updateStatus(statusId, count);
}
System.out.println("status 2");
statusService.updateStatus(statusId, -2);
}catch (Exception e){
System.out.println("status -3");
statusService.updateStatus(statusId,-3);
}
}
public int uploadCourse(Workbook file, JwtUser jwtUser) throws Exception {
Sheet sheet = file.getSheetAt(0);
if(sheet==null){
throw new SheetNotFoundException();
}
SheetHelper sheetHelper = new SheetHelper(sheet,2);
String head = String.valueOf(sheetHelper.filterNull(sheetHelper.collectLines(0,1).get(0)).get(0));
Matcher match = pattern.matcher(head);
Long semester = null;
if(match.find()){
semester = Long.valueOf(match.group(0));
} else {
throw new Exception("未指定学期");
}
List<UploadCourse> sourceCourses = sheetHelper.collectLinesForClass(UploadCourse.class,3);
List<Course> courses = sourceCourses.stream().map(UploadCourse::toCourse).collect(Collectors.toList());
Date now = new Date();
for (Course cours : courses) {
cours.setCourseSemester(semester);
cours.setCreateDate(now);
cours.setModifyDate(now);
cours.setCreateBy(jwtUser.getId());
cours.setModifiedBy(jwtUser.getId());
}
for(int i = courses.size();i>=0;i-=batchSize){
int start = i-batchSize;
if(start<0){
start = 0;
}
uploadMapper.insertCourseIgnore(courses.subList(start,i));
}
return courses.size();
}
public int uploadTeacher(Workbook workbook, JwtUser jwtUser) throws SheetNotFoundException, IllegalAccessException, ParseException, InstantiationException {
Sheet sheet = workbook.getSheetAt(0);
if(sheet==null){
throw new SheetNotFoundException();
}
SheetHelper sheetHelper = new SheetHelper(sheet,2);
String password = passwordEncoder.encode("123456");
List<UploadTeacher> sourseUsers = sheetHelper.collectLinesForClass(UploadTeacher.class,3);
List<User> users = sourseUsers.stream().map(UploadTeacher::toUser).collect(Collectors.toList());
Date now = new Date();
for (User user : users) {
user.setUserPwd(password);
user.setCreateDate(now);
user.setModifyDate(now);
user.setCreateBy(jwtUser.getId());
user.setModifiedBy(jwtUser.getId());
}
for(int i = users.size();i>=0;i-=batchSize){
int start = i-batchSize;
if(start<0){
start = 0;
}
uploadMapper.insertUserIgnore(users.subList(start,i));
}
// userMapper.insertUserIgnore(users);
// userRepository.insertUserIgnore(users.get(0));
// userRepository.saveAll(users);
return users.size();
}
}
| [
"894856599@qq.com"
] | 894856599@qq.com |
12c67e5571c6bff1be92613fa0654631374f4bb1 | 57bbcb0d0ea93ed881698ef8e6ab433fc64df0df | /PromoAdapter.java | 851e1b6f0cd058e55778f2a4dd92a09a152aec08 | [] | no_license | ykim344/WalkingDistance | d3169a3df9b6345e432bcbaa94735c8610d7ec42 | fec884170cf6a7148c269a1ba53d85d1cbde3837 | refs/heads/master | 2021-01-21T12:58:51.258809 | 2016-05-05T21:25:29 | 2016-05-05T21:25:29 | 54,291,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,931 | java | package com.example.yeonjun.walkingdistance;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
/**
* Created by Grisha on 3/23/2016.
*/
public class PromoAdapter extends ArrayAdapter<PromObject>{
Context context;
int layoutResourceId ;
PromObject data[] = null ;
public PromoAdapter(Context context, int resource, PromObject[] data) {
super(context, resource, data);
this.context = context;
this.layoutResourceId = resource;
this.data = data;
}
public PromObject getItem(int position){
return super.getItem(position);
}
public View getView(int position, View convertView, ViewGroup parent){
View promoIcon = convertView ; // inflate the layout for single promoObject
LayoutInflater inflater = LayoutInflater.from(context);
promoIcon = inflater.inflate(layoutResourceId,parent,false); // get a refrence to different view element we want to update
// gets a reference to the different view elements we want to update
TextView bName = (TextView) promoIcon.findViewById(R.id.storeName);
TextView bExp = (TextView ) promoIcon.findViewById(R.id.expDate);
ImageView bImage = (ImageView) promoIcon.findViewById(R.id.businessImage);
// get the data from the data array
PromObject promo = data[position];
// setting the view to reflect the data we need to display
bName.setText(promo.getBusinessName());
bExp.setText(promo.promoDateTime());
int resId = context.getResources().getIdentifier(promo.getbusinessPhoto(),"drawable", context.getPackageName());
bImage.setImageResource(resId);
return promoIcon ;
}
}
| [
"klaykrueger@wisc.edu"
] | klaykrueger@wisc.edu |
1f53780df13fa5d79980e74c0058767cc992686b | 83f7fb41cc12224da83d351e182e83e3ac658f7f | /src/main/java/com/dbzq/po/Items.java | 0ea599ebcbf3d743a2f2615dfbd7e99e65f21b0d | [] | no_license | 4621374/SpringMVC | 93a48a230de76abb8f40be1789712cb6db9a273e | f6d337e15a2c4b2f2ac906253ed6b5b7cbc83e22 | refs/heads/master | 2021-05-14T18:34:28.338316 | 2018-01-31T08:52:17 | 2018-01-31T08:52:17 | 116,078,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,523 | java | package com.dbzq.po;
import java.util.Date;
public class Items {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column items.id
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column items.name
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column items.price
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
private Float price;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column items.pic
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
private String pic;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column items.createtime
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
private Date createtime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column items.detail
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
private String detail;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column items.id
*
* @return the value of items.id
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column items.id
*
* @param id the value for items.id
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column items.name
*
* @return the value of items.name
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column items.name
*
* @param name the value for items.name
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column items.price
*
* @return the value of items.price
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public Float getPrice() {
return price;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column items.price
*
* @param price the value for items.price
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public void setPrice(Float price) {
this.price = price;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column items.pic
*
* @return the value of items.pic
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public String getPic() {
return pic;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column items.pic
*
* @param pic the value for items.pic
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public void setPic(String pic) {
this.pic = pic == null ? null : pic.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column items.createtime
*
* @return the value of items.createtime
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public Date getCreatetime() {
return createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column items.createtime
*
* @param createtime the value for items.createtime
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column items.detail
*
* @return the value of items.detail
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public String getDetail() {
return detail;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column items.detail
*
* @param detail the value for items.detail
*
* @mbg.generated Fri Jan 19 11:21:43 CST 2018
*/
public void setDetail(String detail) {
this.detail = detail == null ? null : detail.trim();
}
} | [
"zxj@DESKTOP-M30U0KD"
] | zxj@DESKTOP-M30U0KD |
0c43a15510fc066e5efe890d8b2edf8377aa7143 | e641aaf228d591d1ddf3530704364f39977511d8 | /doc/api/src/builder/ABuilder.java | 1bb5e85db53195a6685e839725e09a9189b434a8 | [
"MIT"
] | permissive | quentpilot/LiveCurrencyConverter | 5bacf5e73ac844b46d18a159d50bad9488f2671e | 0eefdbf8d74a09489b2d8bbed6d5f86fa1dcbc94 | refs/heads/master | 2021-07-24T03:39:34.121883 | 2017-11-05T11:17:17 | 2017-11-05T11:17:17 | 109,491,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | /**
* @Description: Object class would to do some stuff
* @Author: Quentin Le Bian <quentin>
* @Email: quentin.lebian@pilotaweb.fr
* @Project: LiveCurrencyConverter
* @About: You're welcome to hack and code as your are each of theses sources files <3:p|--<;
* @Filename: ABuilder.java
* @Date: 2017-11-04T17:32:16+01:00
* @Last modified by: quentin
* @Last modified time: 2017-11-04T17:32:17+01:00
* @License: MIT
* @See: projects.quentinlebian.fr/LiveCurrencyConverter
*/
| [
"quentin.lebian.pro@gmail.com"
] | quentin.lebian.pro@gmail.com |
1cf6d9fcc0a4f2342a85da2f722556ea305e1ce5 | 5d3a7ebf663f3ff46b5d44337b1885a770ccebc9 | /sso-auth-dao/src/main/java/me/wuwenbin/items/sso/dao/model/querybo/LogBo.java | 7eece2e33b88101d5da321385bf83cecfbaf99a4 | [] | no_license | miyakowork/template-items-sso | db1f1a5e49240414ee963fae867e8fdfce94bf6e | 97f1635bfdeff9ff4c658ac071b52c4385ba1475 | refs/heads/master | 2021-09-11T15:21:29.020733 | 2018-04-09T06:28:54 | 2018-04-09T06:28:54 | 115,243,315 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 695 | java | package me.wuwenbin.items.sso.dao.model.querybo;
import lombok.Getter;
import lombok.Setter;
import me.wuwenbin.modules.pagination.query.model.bootstrap.BootstrapTableQuery;
import me.wuwenbin.modules.pagination.query.support.annotation.QueryColumn;
import me.wuwenbin.modules.pagination.query.support.annotation.QueryTable;
import me.wuwenbin.modules.pagination.query.support.operator.Operator;
/**
* Created by wuwenbin on 2017/7/13/013.
*/
@Setter
@Getter
@QueryTable(name = "t_oauth_user_login_log")
public class LogBo extends BootstrapTableQuery {
private String username;
@QueryColumn(column = "last_login_date", operator = Operator.GTE)
private String lastLoginDate;
}
| [
"wwb547521014"
] | wwb547521014 |
784baee3061d7dbdfa0631cfd87bc0f72da51659 | 1cd3c0d1905aaad3d67d0c624b2c288c7b4d279c | /TypingMyMomsName/src/basicInputOutput/controller/BasicIORunner.java | ce8eb67ee7ec47331122c795984f24d7f48ecf86 | [] | no_license | FenderPickV87C/Java-Workspace | f88a75320a98ac232fcb6ef93206c5a0f408065a | 3ba3ed6842815ac42c114030bdcc82e5e8298b19 | refs/heads/master | 2021-01-25T16:45:23.387201 | 2017-11-03T04:32:20 | 2017-11-03T04:32:20 | 101,302,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 223 | java | package basicInputOutput.controller;
public class BasicIORunner
{
public static void main(String[] args)
{
BasicIOController myGreeting = new BasicIOController("Anita", "Wynn");
myGreeting.printGreeting();
}
}
| [
"CEB-Student@caddoschools.org"
] | CEB-Student@caddoschools.org |
b0815be82f1edeca5ebf72ba36d7c56481cbcffc | 73208473ead4c2483e3685765fc000bd9972b506 | /plugins/gradle-dsl/src/com/android/tools/idea/gradle/dsl/api/dependencies/ModuleDependencyModel.java | 3423c92ff9a7bbbf119adc97a937c012e586d5c6 | [
"Apache-2.0"
] | permissive | code-general/intellij-community | a72bda439b374a08a2fb753e32ddeb4d494b0b98 | a00c61d009b376bdf62a2859dd757c0766894a28 | refs/heads/master | 2023-02-12T04:29:56.503752 | 2020-12-30T04:29:00 | 2020-12-30T04:29:00 | 320,182,339 | 1 | 0 | Apache-2.0 | 2020-12-30T06:58:32 | 2020-12-10T06:36:43 | null | UTF-8 | Java | false | false | 1,081 | java | /*
* Copyright (C) 2017 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.tools.idea.gradle.dsl.api.dependencies;
import com.android.tools.idea.gradle.dsl.api.ext.ResolvedPropertyModel;
import org.jetbrains.annotations.NotNull;
public interface ModuleDependencyModel extends DependencyModel {
@NotNull
@Override
String configurationName();
@NotNull
String name();
void setName(@NotNull String name);
@NotNull
ResolvedPropertyModel path();
@NotNull
ResolvedPropertyModel configuration();
}
| [
"intellij-monorepo-bot-no-reply@jetbrains.com"
] | intellij-monorepo-bot-no-reply@jetbrains.com |
85bbde86b4f42100d1c0be0bb75cbe1d454db864 | 415ae6774696b074c857701484eae9c2d8e46d42 | /app/src/androidTest/java/com/codepath/musichunter/FragmentTestRule.java | 5486daec2bbf66f9e08357674867780f5100d20e | [] | no_license | uchitsingh/MusicHunter | c144b6a0d9d3cec864cc86f6b2bf109b33ad2504 | b08ce97cb566813b4cd2a25ba6daec950d2268f1 | refs/heads/master | 2021-04-26T22:29:28.450121 | 2018-03-15T17:29:14 | 2018-03-15T17:29:14 | 124,101,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,582 | java | package com.codepath.musichunter;
import android.support.test.rule.ActivityTestRule;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import org.junit.Assert;
/**
* Created by kalpesh on 20/07/2017.
*/
public class FragmentTestRule<F extends Fragment> extends ActivityTestRule<MainActivity> {
private final Class<F> mFragmentClass;
private F mFragment;
public FragmentTestRule(final Class<F> fragmentClass) {
super(MainActivity.class, true, false);
mFragmentClass = fragmentClass;
}
@Override
protected void afterActivityLaunched() {
super.afterActivityLaunched();
getActivity().runOnUiThread(() -> {
try {
//Instantiate and insert the fragment into the container layout
FragmentManager manager = getActivity().getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
mFragment = mFragmentClass.newInstance();
transaction.replace(R.id.pager, mFragment);
transaction.commit();
} catch (InstantiationException | IllegalAccessException e) {
Assert.fail(String.format("%s: Could not insert %s into TestActivity: %s",
getClass().getSimpleName(),
mFragmentClass.getSimpleName(),
e.getMessage()));
}
});
}
public F getFragment(){
return mFragment;
}
}
| [
"uchitsingh7@gmail.com"
] | uchitsingh7@gmail.com |
9ad6c9c8a6fa6c91bae9fe287d0a2e250db723f4 | 19351b3b8f092816176d46db020d164742db6be2 | /main/java/demo/com/reiniot/av/compnentdependence/ApplicationComponent.java | 7c4f7856dd67ded3e78c105ce2d64a1de3c3abe2 | [] | no_license | chris-lg/dagger | d89bda1641f94df4e8be788ace1493cda5e60dbc | 88db2a58bc270701b5c0e2f76438dead44128656 | refs/heads/master | 2022-02-03T14:48:39.156807 | 2019-02-26T09:04:33 | 2019-02-26T09:04:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package demo.com.reiniot.av.compnentdependence;
import android.content.Context;
import dagger.Component;
//定义ApplicationComponent
@Component(modules={ApplicationModule.class})
public interface ApplicationComponent{
@ContextLife("Application")
Context getApplication(); // 对外提供ContextLife类型为"Application"的Context
}
| [
"756384955@qq.com"
] | 756384955@qq.com |
90b9382c58d07ef4137d58b7e804229b81a6191c | 1e8994706cadbe6ec0c0a084b863797fe6bb8c96 | /app/src/main/java/id/rllyhz/animeus/ui/AnimeFragment.java | 5ef34f18e2e765b9e739faf29a2f62f9dba775c2 | [
"Apache-2.0"
] | permissive | rllyhz/anime-us-android-app | 1eb745d0a17930ebfb03e2b178442906589b8da9 | b6e9af3df188dfe79981fff20bad2fdb62092da9 | refs/heads/master | 2023-03-02T19:46:22.620989 | 2021-02-10T07:34:54 | 2021-02-10T07:34:54 | 337,647,087 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,150 | java | package id.rllyhz.animeus.ui;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.picasso.Picasso;
import java.util.List;
import id.rllyhz.animeus.R;
import id.rllyhz.animeus.activity.AnimeDetailActivity;
import id.rllyhz.animeus.activity.MainActivity;
import id.rllyhz.animeus.adapter.TopAnimeAdapter;
import id.rllyhz.animeus.api.ApiClient;
import id.rllyhz.animeus.api.data_service.AnimeAPIService;
import id.rllyhz.animeus.api.response_type.GetTopAnimeResponseType;
import id.rllyhz.animeus.helper.CustomToast;
import id.rllyhz.animeus.api.response_type.GetTopAnimeResponseType.Anime;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class AnimeFragment extends Fragment {
private SearchableRecyclerviewListener searchableRecyclerviewListener;
private TopAnimeAdapter adapter;
private AnimeAPIService animeAPIService;
private Call<GetTopAnimeResponseType> call;
private RelativeLayout animeTopContainer;
private RecyclerView recyclerViewAnime;
private TextView animeTopTitle, animeTopRankText, animeListHeading;
private ImageView animeTopImage, animeTopRankIcon;
private TextView footerText;
private ProgressDialog progressDialog;
private CustomToast toast;
private boolean listFailedTobeDownloaded = false;
private List<Anime> topAnimeList;
private Anime topAnime;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
toast = new CustomToast(getActivity(), R.layout.custom_toast);
progressDialog = new ProgressDialog(getActivity());
animeAPIService = ApiClient.getAnimeApiServiceInstance().create(AnimeAPIService.class);
call = animeAPIService.getTopAnime();
showDialog("Loading...", false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
animeListHeading = getActivity().findViewById(R.id.anime_list_heading);
animeTopContainer = getActivity().findViewById(R.id.anime_top_container);
animeTopTitle = getActivity().findViewById(R.id.anime_top_title);
animeTopRankText = getActivity().findViewById(R.id.anime_top_rank_status);
animeTopImage = getActivity().findViewById(R.id.anime_top_image);
//animeTopRankIcon = getActivity().findViewById(R.id.anime_top_rank_icon);
recyclerViewAnime = getActivity().findViewById(R.id.recyclerview_anime);
footerText = getActivity().findViewById(R.id.footer_text);
footerText.setVisibility(View.GONE);
fetchData();
}
private void fetchData() {
if (call == null) return;
call.enqueue(new Callback<GetTopAnimeResponseType>() {
@Override
public void onResponse(Call<GetTopAnimeResponseType> call, Response<GetTopAnimeResponseType> response) {
if (response.isSuccessful() && response.code() == 200 && response.body() != null) {
topAnimeList = response.body().getAnimeList();
topAnime = topAnimeList.get(0);
setUI();
closeDialog();
footerText.setVisibility(View.VISIBLE);
}
}
@Override
public void onFailure(Call<GetTopAnimeResponseType> call, Throwable t) {
showToast("Failed load data!");
setFailedUI();
closeDialog();
footerText.setVisibility(View.VISIBLE);
}
});
}
private void setFailedUI() {
animeTopImage.setBackground(getActivity().getDrawable(R.mipmap.ic_launcher_round));
animeTopTitle.setText("Failed to load data");
animeTopRankText.setText("Please check your connection!");
showDialog("Failed to load data", "Please check your connection!", true);
animeTopContainer.setVisibility(View.VISIBLE);
animeListHeading.setVisibility(View.VISIBLE);
}
private void setUI() {
if (!listFailedTobeDownloaded) {
Picasso.get().load(topAnime.getImageUrl())
.placeholder(R.mipmap.ic_launcher_round)
.into(animeTopImage);
animeTopTitle.setText(topAnime.getTitle());
animeTopRankText.setText("Total Episodes : " + topAnime.getEpisodes());
animeTopContainer.setOnClickListener(v -> gotoAnimeDetailActivity(topAnime));
} else {
animeTopImage.setImageDrawable(getActivity().getDrawable(R.mipmap.ic_launcher_round));
animeTopTitle.setText(".......");
animeTopRankText.setText("..............");
}
animeTopContainer.setVisibility(View.VISIBLE);
animeListHeading.setVisibility(View.VISIBLE);
setRecyclerView();
}
private void setRecyclerView() {
topAnimeList.remove(0);
adapter = new TopAnimeAdapter(getContext(), topAnimeList);
adapter.setOnItemClickListener((view, position) -> gotoAnimeDetailActivity(adapter.getAnimeAt(position)));
recyclerViewAnime.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
recyclerViewAnime.setAdapter(adapter);
recyclerViewAnime.setFocusable(false);
recyclerViewAnime.setVisibility(View.VISIBLE);
}
public void setSearchableRecyclerviewListener(SearchableRecyclerviewListener listener) {
this.searchableRecyclerviewListener = listener;
}
public void filterAnimeAdapter(String textPattern) {
if (searchableRecyclerviewListener != null && adapter != null)
searchableRecyclerviewListener.onSearch(adapter, textPattern);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_anime, container, false);
}
private void gotoAnimeDetailActivity(Anime topAnime) {
Intent animeDetailActivity = new Intent(getActivity(), AnimeDetailActivity.class);
animeDetailActivity.putExtra(AnimeDetailActivity.EXTRA_ANIME_DETAIL_ID, topAnime.getId());
getActivity().overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
getActivity().startActivityForResult(animeDetailActivity, MainActivity.REQUEST_CODE_ANIME_DETAIL);
}
@Override
public void onDestroy() {
super.onDestroy();
setSearchableRecyclerviewListener(null);
}
private void showDialog(String message, boolean isCancelable) {
progressDialog.setMessage(message);
progressDialog.setCancelable(isCancelable);
if (!progressDialog.isShowing())
progressDialog.show();
}
private void showDialog(String title, String message, boolean isCancelable) {
progressDialog.setTitle(title);
progressDialog.setMessage(message);
progressDialog.setCancelable(isCancelable);
progressDialog.setButton(DialogInterface.BUTTON_POSITIVE, "Oke",
(dialog, which) -> progressDialog.dismiss());
if (!progressDialog.isShowing())
progressDialog.show();
}
private void closeDialog() {
if (progressDialog.isShowing())
progressDialog.dismiss();
}
private void showToast(String message) {
toast.show(null, message);
}
public interface SearchableRecyclerviewListener {
void onSearch(TopAnimeAdapter adapter, String textPattern);
}
}
| [
"rullyihza00@gmail.com"
] | rullyihza00@gmail.com |
8b6af4840c613b260f57781c42cc893115ce8dd8 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/14/14_0eaa39badd5f86dace75e28f93b5ffa9406f4f42/MainWindow/14_0eaa39badd5f86dace75e28f93b5ffa9406f4f42_MainWindow_s.java | 7673178b6a05d30a144a85668aa8a9c606ef7b1e | [] | 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 | 46,182 | java | package pl.poznan.put.cs.bioserver.gui;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import org.apache.commons.lang3.StringUtils;
import org.biojava.bio.structure.Chain;
import org.biojava.bio.structure.ResidueNumber;
import org.biojava.bio.structure.Structure;
import org.biojava.bio.structure.StructureException;
import org.biojava.bio.structure.StructureImpl;
import org.biojava.bio.structure.align.gui.jmol.JmolPanel;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.DefaultXYItemRenderer;
import org.jfree.data.xy.DefaultXYDataset;
import org.jmol.api.JmolViewer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pl.poznan.put.cs.bioserver.alignment.AlignmentOutput;
import pl.poznan.put.cs.bioserver.alignment.OutputAlignSeq;
import pl.poznan.put.cs.bioserver.alignment.SequenceAligner;
import pl.poznan.put.cs.bioserver.alignment.StructureAligner;
import pl.poznan.put.cs.bioserver.comparison.ComparisonListener;
import pl.poznan.put.cs.bioserver.comparison.GlobalComparison;
import pl.poznan.put.cs.bioserver.comparison.MCQ;
import pl.poznan.put.cs.bioserver.comparison.RMSD;
import pl.poznan.put.cs.bioserver.comparison.TorsionLocalComparison;
import pl.poznan.put.cs.bioserver.helper.Helper;
import pl.poznan.put.cs.bioserver.helper.PdbManager;
import pl.poznan.put.cs.bioserver.torsion.AngleDifference;
import pl.poznan.put.cs.bioserver.visualisation.MDS;
import pl.poznan.put.cs.bioserver.visualisation.MDSPlot;
import com.csvreader.CsvWriter;
class MainWindow extends JFrame {
private static final String TITLE = "MCQ4Structures: computing similarity of 3D RNA / protein structures";
private static final long serialVersionUID = 1L;
private static final Logger LOGGER = LoggerFactory
.getLogger(MainWindow.class);
private static final char CSV_DELIMITER = ';';
private static final String CARD_GLOBAL = "CARD_GLOBAL";
private static final String CARD_LOCAL = "CARD_LOCAL";
private static final String CARD_ALIGN_SEQ = "CARD_ALIGN_SEQ";
private static final String CARD_ALIGN_STRUC = "CARD_ALIGN_STRUC";
private static final String ABOUT = "MCQ4Structures is a tool for "
+ "structural similarity computation based on molecule tertiary "
+ "structure representation in torsional angle space.\nIt has been "
+ "designed to work primarily for RNA structures. Proteins are "
+ "also handled and their representation is restricted to the "
+ "backbone angles.\n\nMCQ4Structures is available as a free Java "
+ "WebStart application. The source code is licensed under BSD."
+ "\n\nCiting MCQ4Structures.\n"
+ "T. Zok, M. Popenda, M. Szachniuk. MCQ4Structures to compute "
+ "similarity of molecule structures. Central European Journal of "
+ "Operations Research, in press.\n\nAcknowledgements and funding.\n"
+ "This work has been partially supported by the European Regional "
+ "Development Fund within Innovative Economy Programme "
+ "(POIG.02.03.00-00-018/08 POWIEW)\nand grants from the National "
+ "Science Centre, Poland (2012/05/B/ST6/03026).";
private static Component getCurrentCard(JPanel panel) {
for (Component component : panel.getComponents()) {
if (component.isVisible()) {
return component;
}
}
return null;
}
private JFileChooser chooserSaveFile;
private PdbManagerDialog managerDialog;
private StructureSelectionDialog structureDialog;
private ChainSelectionDialog chainDialog;
private TorsionAnglesSelectionDialog torsionDialog;
private String[] resultGlobalNames;
private double[][] resultGlobalMatrix;
private Map<String, List<AngleDifference>> resultLocal;
private String resultAlignStruc;
private String resultAlignSeq;
public MainWindow() {
super();
chooserSaveFile = new JFileChooser();
managerDialog = PdbManagerDialog.getInstance(this);
managerDialog.setVisible(true);
structureDialog = StructureSelectionDialog.getInstance(this);
chainDialog = ChainSelectionDialog.getInstance(this);
torsionDialog = TorsionAnglesSelectionDialog.getInstance(this);
/*
* Create menu
*/
JMenuItem itemOpen = new JMenuItem("Open structure(s)",
loadIcon("/toolbarButtonGraphics/general/Open16.gif"));
final JMenuItem itemSave = new JMenuItem("Save results",
loadIcon("/toolbarButtonGraphics/general/Save16.gif"));
itemSave.setEnabled(false);
final JCheckBox checkBoxManager = new JCheckBox(
"View structure manager", true);
JMenuItem itemExit = new JMenuItem("Exit");
JMenu menuFile = new JMenu("File");
menuFile.setMnemonic(KeyEvent.VK_F);
menuFile.add(itemOpen);
menuFile.add(itemSave);
menuFile.addSeparator();
menuFile.add(checkBoxManager);
menuFile.addSeparator();
menuFile.add(itemExit);
final JRadioButton radioMcq = new JRadioButton("MCQ", true);
JRadioButton radioRmsd = new JRadioButton("RMSD", false);
ButtonGroup group = new ButtonGroup();
group.add(radioMcq);
group.add(radioRmsd);
final JMenuItem itemSelectStructures = new JMenuItem(
"Select structures to compare");
final JMenuItem itemComputeGlobal = new JMenuItem(
"Compute distance matrix");
itemComputeGlobal.setEnabled(false);
final JMenuItem itemVisualise = new JMenuItem("Visualise results");
itemVisualise.setEnabled(false);
final JMenuItem itemCluster = new JMenuItem("Cluster results");
itemCluster.setEnabled(false);
JMenu menuGlobal = new JMenu("Global distance");
menuGlobal.add(itemSelectStructures);
menuGlobal.addSeparator();
menuGlobal.add(new JLabel("Distance measure:"));
menuGlobal.add(radioMcq);
menuGlobal.add(radioRmsd);
menuGlobal.addSeparator();
menuGlobal.add(itemComputeGlobal);
menuGlobal.add(itemVisualise);
menuGlobal.add(itemVisualise);
menuGlobal.add(itemCluster);
final JMenuItem itemSelectChainsCompare = new JMenuItem(
"Select chains to compare");
final JMenuItem itemSelectTorsion = new JMenuItem(
"Select torsion angles");
itemSelectTorsion.setEnabled(false);
final JMenuItem itemComputeLocal = new JMenuItem("Compute distances");
itemComputeLocal.setEnabled(false);
JMenu menuLocal = new JMenu("Local distance");
menuLocal.add(itemSelectChainsCompare);
menuLocal.add(itemSelectTorsion);
menuLocal.add(itemComputeLocal);
JMenu menuDistance = new JMenu("Distance computation");
menuDistance.setMnemonic(KeyEvent.VK_D);
menuDistance.add(menuGlobal);
menuDistance.addSeparator();
menuDistance.add(menuLocal);
final JRadioButton radioAlignGlobal = new JRadioButton("Global", true);
JRadioButton radioAlignLocal = new JRadioButton("Local", false);
ButtonGroup groupAlign = new ButtonGroup();
groupAlign.add(radioAlignGlobal);
groupAlign.add(radioAlignLocal);
final JMenuItem itemSelectChainsAlignSeq = new JMenuItem(
"Select chains to align");
final JMenuItem itemComputeAlignSeq = new JMenuItem("Compute alignment");
itemComputeAlignSeq.setEnabled(false);
JMenu menuAlignSeq = new JMenu("Sequence alignment");
menuAlignSeq.add(itemSelectChainsAlignSeq);
menuAlignSeq.addSeparator();
menuAlignSeq.add(radioAlignGlobal);
menuAlignSeq.add(radioAlignLocal);
menuAlignSeq.addSeparator();
menuAlignSeq.add(itemComputeAlignSeq);
final JMenuItem itemSelectChainsAlignStruc = new JMenuItem(
"Select chains to align");
final JMenuItem itemComputeAlignStruc = new JMenuItem(
"Compute alignment");
itemComputeAlignStruc.setEnabled(false);
JMenu menuAlignStruc = new JMenu("3D structure alignment");
menuAlignStruc.add(itemSelectChainsAlignStruc);
menuAlignStruc.add(itemComputeAlignStruc);
JMenu menuAlignment = new JMenu("Alignment");
menuAlignment.setMnemonic(KeyEvent.VK_A);
menuAlignment.add(menuAlignSeq);
menuAlignment.addSeparator();
menuAlignment.add(menuAlignStruc);
JMenuItem itemGuide = new JMenuItem("Quick guide");
itemGuide.setMnemonic(KeyEvent.VK_Q);
itemGuide.setMaximumSize(new Dimension(
itemGuide.getPreferredSize().width,
itemGuide.getMaximumSize().height));
JMenuItem itemAbout = new JMenuItem("About");
itemAbout.setMnemonic(KeyEvent.VK_O);
itemAbout.setMaximumSize(new Dimension(
itemAbout.getPreferredSize().width,
itemAbout.getMaximumSize().height));
JMenuBar menuBar = new JMenuBar();
menuBar.add(menuFile);
menuBar.add(menuDistance);
menuBar.add(menuAlignment);
menuBar.add(itemGuide);
menuBar.add(itemAbout);
setJMenuBar(menuBar);
/*
* Create card layout
*/
final JTable tableMatrix = new JTable();
final JProgressBar progressBar = new JProgressBar();
progressBar.setStringPainted(true);
JPanel panelProgressBar = new JPanel();
panelProgressBar.setLayout(new BoxLayout(panelProgressBar,
BoxLayout.X_AXIS));
panelProgressBar.add(new JLabel("Progress in computing:"));
panelProgressBar.add(progressBar);
final JPanel panelResultsGlobal = new JPanel(new BorderLayout());
panelResultsGlobal.add(new JScrollPane(tableMatrix),
BorderLayout.CENTER);
panelResultsGlobal.add(panelProgressBar, BorderLayout.SOUTH);
final JPanel panelResultsLocal = new JPanel(new GridLayout(1, 1));
final JTextArea textAreaAlignSeq = new JTextArea();
textAreaAlignSeq.setEditable(false);
textAreaAlignSeq.setFont(new Font("Monospaced", Font.PLAIN, 20));
final JPanel panelResultsAlignSeq = new JPanel(new BorderLayout());
panelResultsAlignSeq.add(new JScrollPane(textAreaAlignSeq),
BorderLayout.CENTER);
JPanel panelAlignStrucInfo = new JPanel(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = 0;
constraints.gridy = 0;
constraints.weightx = 0.5;
panelAlignStrucInfo.add(new JLabel("Whole structures (Jmol view)"),
constraints);
constraints.gridx++;
constraints.weightx = 0;
final JLabel labelAlignStrucStatus = new JLabel("Ready");
panelAlignStrucInfo.add(labelAlignStrucStatus, constraints);
constraints.gridx++;
constraints.weightx = 0.5;
panelAlignStrucInfo.add(new JLabel("Aligned fragments (Jmol view)"),
constraints);
final JmolPanel panelJmolLeft = new JmolPanel();
panelJmolLeft.executeCmd("background lightgrey");
final JmolPanel panelJmolRight = new JmolPanel();
panelJmolRight.executeCmd("background darkgray");
JPanel panelJmolBoth = new JPanel(new GridLayout(1, 2));
panelJmolBoth.add(panelJmolLeft);
panelJmolBoth.add(panelJmolRight);
final JPanel panelResultsAlignStruc = new JPanel(new BorderLayout());
panelResultsAlignStruc.add(panelAlignStrucInfo, BorderLayout.NORTH);
panelResultsAlignStruc.add(panelJmolBoth, BorderLayout.CENTER);
final CardLayout layoutCards = new CardLayout();
final JPanel panelCards = new JPanel();
panelCards.setLayout(layoutCards);
panelCards.add(panelResultsGlobal, MainWindow.CARD_GLOBAL);
panelCards.add(panelResultsLocal, MainWindow.CARD_LOCAL);
panelCards.add(panelResultsAlignSeq, MainWindow.CARD_ALIGN_SEQ);
panelCards.add(panelResultsAlignStruc, MainWindow.CARD_ALIGN_STRUC);
setLayout(new BorderLayout());
add(panelCards, BorderLayout.CENTER);
/*
* Set window properties
*/
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle(MainWindow.TITLE);
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension size = toolkit.getScreenSize();
setSize(size.width * 3 / 4, size.height * 3 / 4);
setLocation(size.width / 8, size.height / 8);
/*
* Set action listeners
*/
managerDialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
super.windowClosing(e);
checkBoxManager.setSelected(false);
}
});
itemOpen.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
File[] files = PdbFileChooser.getSelectedFiles(MainWindow.this);
for (File f : files) {
if (PdbManager.loadStructure(f) != null) {
PdbManagerDialog.MODEL.addElement(f);
}
}
}
});
itemSave.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Component current = MainWindow.getCurrentCard(panelCards);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-DD-HH-mm");
Date now = new Date();
File proposedName = null;
if (current.equals(panelResultsGlobal)) {
proposedName = new File(sdf.format(now) + "-global.csv");
} else {
StringBuilder builder = new StringBuilder();
builder.append(PdbManager
.getStructureName(chainDialog.selectedStructures[0]));
builder.append('-');
builder.append(PdbManager
.getStructureName(chainDialog.selectedStructures[1]));
if (current.equals(panelResultsLocal)) {
proposedName = new File(sdf.format(now) + "-local-"
+ builder.toString() + ".csv");
} else if (current.equals(panelResultsAlignSeq)) {
proposedName = new File(sdf.format(now) + "-alignseq-"
+ builder.toString() + ".txt");
} else { // current.equals(panelResultsAlignStruc)
proposedName = new File(sdf.format(now)
+ "-alignstruc-" + builder.toString() + ".pdb");
}
}
chooserSaveFile.setSelectedFile(proposedName);
int chosenOption = chooserSaveFile
.showSaveDialog(MainWindow.this);
if (chosenOption != JFileChooser.APPROVE_OPTION) {
return;
}
if (current.equals(panelResultsGlobal)) {
saveResultsGlobalComparison(chooserSaveFile
.getSelectedFile());
} else if (current.equals(panelResultsLocal)) {
saveResultsLocalComparison(chooserSaveFile
.getSelectedFile());
} else if (current.equals(panelResultsAlignSeq)) {
try (FileOutputStream stream = new FileOutputStream(
chooserSaveFile.getSelectedFile())) {
stream.write(resultAlignSeq.getBytes("UTF-8"));
} catch (IOException e1) {
MainWindow.LOGGER.error(
"Failed to save aligned sequences", e1);
JOptionPane.showMessageDialog(MainWindow.this,
e1.getMessage(), "Error",
JOptionPane.ERROR_MESSAGE);
}
} else { // current.equals(panelResultsAlignStruc)
try (FileOutputStream stream = new FileOutputStream(
chooserSaveFile.getSelectedFile())) {
stream.write(resultAlignStruc.getBytes("UTF-8"));
} catch (IOException e1) {
MainWindow.LOGGER.error(
"Failed to save PDB of aligned structures", e1);
JOptionPane.showMessageDialog(MainWindow.this,
e1.getMessage(), "Error",
JOptionPane.ERROR_MESSAGE);
}
}
}
});
checkBoxManager.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
managerDialog.setVisible(checkBoxManager.isSelected());
}
});
itemExit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dispatchEvent(new WindowEvent(MainWindow.this,
WindowEvent.WINDOW_CLOSING));
}
});
itemSelectStructures.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
/*
* Add new structures to the "all" section of structures
* selection dialog
*/
Enumeration<File> elements = PdbManagerDialog.MODEL.elements();
while (elements.hasMoreElements()) {
File path = elements.nextElement();
if (!structureDialog.modelAll.contains(path)
&& !structureDialog.modelSelected.contains(path)) {
structureDialog.modelAll.addElement(path);
}
}
/*
* Remove from "all" section these structures, that were removed
* in PDB manager dialog
*/
elements = structureDialog.modelAll.elements();
while (elements.hasMoreElements()) {
File path = elements.nextElement();
if (PdbManager.getStructure(path) == null) {
structureDialog.modelAll.removeElement(path);
}
}
/*
* Remove from "selected" section these structures, that were
* removed in PDB manager dialog
*/
elements = structureDialog.modelSelected.elements();
while (elements.hasMoreElements()) {
File path = elements.nextElement();
if (PdbManager.getStructure(path) == null) {
structureDialog.modelSelected.removeElement(path);
}
}
/*
* Show dialog
*/
structureDialog.setVisible(true);
if (structureDialog.selectedStructures != null
&& structureDialog.selectedStructures.size() >= 2) {
itemComputeGlobal.setEnabled(true);
}
}
});
itemComputeGlobal.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (structureDialog.selectedStructures == null
|| structureDialog.selectedStructures.size() < 2) {
JOptionPane.showMessageDialog(MainWindow.this,
"You must open at least two structures",
"Information", JOptionPane.INFORMATION_MESSAGE);
return;
}
layoutCards.show(panelCards, MainWindow.CARD_GLOBAL);
final GlobalComparison comparison;
if (radioMcq.isSelected()) {
comparison = new MCQ();
} else { // radioRmsd.isSelected() == true
comparison = new RMSD();
}
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
Structure[] structures = PdbManager
.getSelectedStructures(structureDialog.selectedStructures);
resultGlobalNames = PdbManager
.getSelectedStructuresNames(structureDialog.selectedStructures);
resultGlobalMatrix = comparison.compare(structures,
new ComparisonListener() {
@Override
public void stateChanged(long all,
long completed) {
progressBar.setMaximum((int) all);
progressBar.setValue((int) completed);
}
});
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
MatrixTableModel model = new MatrixTableModel(
resultGlobalNames, resultGlobalMatrix);
tableMatrix.setModel(model);
itemSave.setEnabled(true);
itemSave.setText("Save results (CSV)");
itemCluster.setEnabled(true);
itemVisualise.setEnabled(true);
}
});
}
});
thread.start();
}
});
itemVisualise.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
MatrixTableModel model = (MatrixTableModel) tableMatrix
.getModel();
String[] names = model.getNames();
double[][] values = model.getValues();
for (double[] value : values) {
for (double element : value) {
if (Double.isNaN(element)) {
JOptionPane.showMessageDialog(MainWindow.this,
"Cannot visualize, because some "
+ "of the structures were "
+ "incomparable", "Error",
JOptionPane.ERROR_MESSAGE);
return;
}
}
}
double[][] mds = MDS.multidimensionalScaling(values, 2);
if (mds == null) {
JOptionPane.showMessageDialog(null,
"Cannot visualise specified structures in 2D",
"Warning", JOptionPane.WARNING_MESSAGE);
return;
}
MDSPlot plot = new MDSPlot(mds, names);
plot.setVisible(true);
}
});
itemCluster.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
MatrixTableModel model = (MatrixTableModel) tableMatrix
.getModel();
String[] names = model.getNames();
double[][] values = model.getValues();
for (double[] value : values) {
for (double element : value) {
if (Double.isNaN(element)) {
JOptionPane.showMessageDialog(MainWindow.this,
"Cannot cluster, because some "
+ "of the structures were "
+ "incomparable", "Error",
JOptionPane.ERROR_MESSAGE);
return;
}
}
}
ClusteringDialog dialogClustering = new ClusteringDialog(names,
values);
dialogClustering.setVisible(true);
}
});
ActionListener actionListenerSelectChains = new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
chainDialog.modelLeft.removeAllElements();
chainDialog.modelRight.removeAllElements();
Enumeration<File> elements = PdbManagerDialog.MODEL.elements();
while (elements.hasMoreElements()) {
File path = elements.nextElement();
chainDialog.modelLeft.addElement(path);
chainDialog.modelRight.addElement(path);
}
chainDialog.setVisible(true);
if (chainDialog.selectedStructures != null
&& chainDialog.selectedChains != null) {
for (int i = 0; i < 2; i++) {
if (chainDialog.selectedChains[i].length == 0) {
JOptionPane
.showMessageDialog(
MainWindow.this,
"No chains specified for structure: "
+ chainDialog.selectedStructures[i],
"Error", JOptionPane.ERROR_MESSAGE);
chainDialog.selectedStructures = null;
chainDialog.selectedChains = null;
return;
}
}
Object source = arg0.getSource();
if (source.equals(itemSelectChainsCompare)) {
itemSelectTorsion.setEnabled(true);
} else if (source.equals(itemSelectChainsAlignSeq)) {
if (chainDialog.selectedChains[0].length != 1
|| chainDialog.selectedChains[1].length != 1) {
JOptionPane.showMessageDialog(MainWindow.this,
"For sequence alignment, you need "
+ "to select a single chain "
+ "from each structure",
"Information",
JOptionPane.INFORMATION_MESSAGE);
chainDialog.selectedStructures = null;
chainDialog.selectedChains = null;
return;
}
itemComputeAlignSeq.setEnabled(true);
} else { // source.equals(itemSelectChainsAlignStruc)
itemComputeAlignStruc.setEnabled(true);
}
}
}
};
itemSelectChainsCompare.addActionListener(actionListenerSelectChains);
itemSelectChainsAlignSeq.addActionListener(actionListenerSelectChains);
itemSelectChainsAlignStruc
.addActionListener(actionListenerSelectChains);
itemSelectTorsion.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
torsionDialog.setVisible(true);
itemComputeLocal.setEnabled(true);
}
});
itemComputeLocal.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
layoutCards.show(panelCards, MainWindow.CARD_LOCAL);
final Structure[] structures = new Structure[2];
for (int i = 0; i < 2; i++) {
structures[i] = new StructureImpl();
// FIXME: NPE after hitting Cancel on chain selection
structures[i].setChains(Arrays
.asList(chainDialog.selectedChains[i]));
}
try {
resultLocal = TorsionLocalComparison.compare(structures[0],
structures[1], false);
} catch (StructureException e1) {
JOptionPane.showMessageDialog(MainWindow.this,
e1.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
return;
}
Set<ResidueNumber> set = new HashSet<>();
for (String angle : torsionDialog.selectedNames) {
if (!resultLocal.containsKey(angle)) {
continue;
}
for (AngleDifference ad : resultLocal.get(angle)) {
set.add(ad.getResidue());
}
}
List<ResidueNumber> list = new ArrayList<>(set);
Collections.sort(list);
DefaultXYDataset dataset = new DefaultXYDataset();
for (String angle : torsionDialog.selectedNames) {
if (!resultLocal.containsKey(angle)) {
continue;
}
List<AngleDifference> diffs = resultLocal.get(angle);
Collections.sort(diffs);
double[] x = new double[diffs.size()];
double[] y = new double[diffs.size()];
for (int i = 0; i < diffs.size(); i++) {
AngleDifference ad = diffs.get(i);
x[i] = list.indexOf(ad.getResidue());
y[i] = ad.getDifference();
}
dataset.addSeries(angle, new double[][] { x, y });
}
NumberAxis xAxis = new TorsionAxis(resultLocal);
xAxis.setLabel("Residue");
NumberAxis yAxis = new NumberAxis();
yAxis.setAutoRange(false);
yAxis.setRange(0, Math.PI);
yAxis.setLabel("Distance [rad]");
XYPlot plot = new XYPlot(dataset, xAxis, yAxis,
new DefaultXYItemRenderer());
panelResultsLocal.removeAll();
panelResultsLocal.add(new ChartPanel(new JFreeChart(plot)));
panelResultsLocal.revalidate();
itemSave.setEnabled(true);
itemSave.setText("Save results (CSV)");
}
});
itemComputeAlignSeq.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
layoutCards.show(panelCards, MainWindow.CARD_ALIGN_SEQ);
Chain chains[] = new Chain[] {
chainDialog.selectedChains[0][0],
chainDialog.selectedChains[1][0] };
boolean isRNA = Helper.isNucleicAcid(chains[0]);
if (isRNA != Helper.isNucleicAcid(chains[1])) {
String message = "Structures meant to be aligned "
+ "represent different molecule types!";
MainWindow.LOGGER.error(message);
JOptionPane.showMessageDialog(null, message, "Error",
JOptionPane.ERROR_MESSAGE);
return;
}
OutputAlignSeq alignment = SequenceAligner.align(chains[0],
chains[1], radioAlignGlobal.isSelected());
resultAlignSeq = alignment.toString();
textAreaAlignSeq.setText(resultAlignSeq);
itemSave.setEnabled(true);
itemSave.setText("Save results (TXT)");
}
});
itemComputeAlignStruc.addActionListener(new ActionListener() {
private Thread thread;
@Override
public void actionPerformed(ActionEvent e) {
if (thread != null && thread.isAlive()) {
JOptionPane.showMessageDialog(null,
"Alignment calculation underway!", "Information",
JOptionPane.INFORMATION_MESSAGE);
return;
}
layoutCards.show(panelCards, MainWindow.CARD_ALIGN_STRUC);
final Structure[] structures = new Structure[2];
for (int i = 0; i < 2; i++) {
structures[i] = new StructureImpl();
structures[i].setChains(Arrays
.asList(chainDialog.selectedChains[i]));
}
boolean isRNA = Helper.isNucleicAcid(structures[0]);
if (isRNA != Helper.isNucleicAcid(structures[1])) {
String message = "Structures meant to be aligned "
+ "represent different molecule types!";
MainWindow.LOGGER.error(message);
JOptionPane.showMessageDialog(null, message, "Error",
JOptionPane.ERROR_MESSAGE);
return;
}
labelAlignStrucStatus.setText("Processing");
final Timer timer = new Timer(250, new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
String text = labelAlignStrucStatus.getText();
int count = StringUtils.countMatches(text, ".");
if (count < 5) {
labelAlignStrucStatus.setText(text + ".");
} else {
labelAlignStrucStatus.setText("Processing");
}
}
});
timer.start();
thread = new Thread(new Runnable() {
@Override
public void run() {
try {
Helper.normalizeAtomNames(structures[0]);
Helper.normalizeAtomNames(structures[1]);
AlignmentOutput output = StructureAligner.align(
structures[0], structures[1]);
final Structure[] aligned = output.getStructures();
SwingUtilities.invokeLater(new Runnable() {
private static final String JMOL_SCRIPT = "frame 0.0; "
+ "cartoon only; "
+ "select model=1.1; color green; "
+ "select model=1.2; color red; ";
@Override
public void run() {
StringBuilder builder = new StringBuilder();
builder.append("MODEL 1 \n");
builder.append(aligned[0].toPDB());
builder.append("ENDMDL \n");
builder.append("MODEL 2 \n");
builder.append(aligned[1].toPDB());
builder.append("ENDMDL \n");
resultAlignStruc = builder.toString();
JmolViewer viewer = panelJmolLeft
.getViewer();
viewer.openStringInline(builder.toString());
panelJmolLeft.executeCmd(JMOL_SCRIPT);
builder = new StringBuilder();
builder.append("MODEL 1 \n");
builder.append(aligned[2].toPDB());
builder.append("ENDMDL \n");
builder.append("MODEL 2 \n");
builder.append(aligned[3].toPDB());
builder.append("ENDMDL \n");
viewer = panelJmolRight.getViewer();
viewer.openStringInline(builder.toString());
panelJmolRight.executeCmd(JMOL_SCRIPT);
itemSave.setEnabled(true);
itemSave.setText("Save results (PDB)");
}
});
} catch (StructureException e1) {
MainWindow.LOGGER.error(
"Failed to align structures", e1);
JOptionPane.showMessageDialog(getParent(),
e1.getMessage(), "Error",
JOptionPane.ERROR_MESSAGE);
} finally {
timer.stop();
labelAlignStrucStatus.setText("Ready");
}
}
});
thread.start();
}
});
itemGuide.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
QuickGuideDialog dialog = new QuickGuideDialog(MainWindow.this);
dialog.setVisible(true);
}
});
itemAbout.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(MainWindow.this,
MainWindow.ABOUT, "About",
JOptionPane.INFORMATION_MESSAGE);
}
});
}
private ImageIcon loadIcon(String name) {
URL resource = getClass().getResource(name);
if (resource == null) {
MainWindow.LOGGER.error("Failed to load icon: " + name);
return null;
}
return new ImageIcon(resource);
}
private void saveResultsGlobalComparison(File outputFile) {
try (FileOutputStream stream = new FileOutputStream(outputFile)) {
CsvWriter writer = new CsvWriter(stream, MainWindow.CSV_DELIMITER,
Charset.forName("UTF-8"));
/*
* Print header
*/
int length = resultGlobalNames.length;
writer.write("");
for (int i = 0; i < length; i++) {
writer.write(resultGlobalNames[i]);
}
writer.endRecord();
/*
* Print each value in the matrix
*/
for (int i = 0; i < length; i++) {
writer.write(resultGlobalNames[i]);
for (int j = 0; j < length; j++) {
writer.write(Double.toString(resultGlobalMatrix[i][j]));
}
writer.endRecord();
}
writer.close();
} catch (IOException e) {
MainWindow.LOGGER.error(
"Failed to save results from global comparison", e);
JOptionPane.showMessageDialog(this, e.getMessage(), "Error",
JOptionPane.ERROR_MESSAGE);
}
}
private void saveResultsLocalComparison(File outputFile) {
/*
* Reverse information: [angleName -> angleValue(residue)] into:
* [residue -> angleValue(angleName)]
*/
SortedMap<String, Map<String, Double>> map = new TreeMap<>();
Set<String> setAngleNames = new LinkedHashSet<>();
for (Entry<String, List<AngleDifference>> pair : resultLocal.entrySet()) {
String angleName = pair.getKey();
boolean isAnyNotNaN = false;
for (AngleDifference ad : pair.getValue()) {
ResidueNumber residue = ad.getResidue();
String residueName = String.format("%s:%03d",
residue.getChainId(), residue.getSeqNum());
if (!map.containsKey(residueName)) {
map.put(residueName, new LinkedHashMap<String, Double>());
}
Map<String, Double> angleValues = map.get(residueName);
double difference = ad.getDifference();
angleValues.put(angleName, difference);
if (!Double.isNaN(difference)) {
isAnyNotNaN = true;
}
}
if (isAnyNotNaN) {
setAngleNames.add(angleName);
}
}
try (FileOutputStream stream = new FileOutputStream(outputFile)) {
CsvWriter writer = new CsvWriter(stream, MainWindow.CSV_DELIMITER,
Charset.forName("UTF-8"));
/*
* Write header
*/
writer.write("");
for (String angleName : setAngleNames) {
writer.write(angleName);
}
writer.endRecord();
/*
* Write a record for each residue
*/
for (String residueName : map.keySet()) {
writer.write(residueName);
Map<String, Double> mapAngles = map.get(residueName);
for (String angleName : setAngleNames) {
if (mapAngles.containsKey(angleName)) {
String angleValue = Double.toString(mapAngles
.get(angleName));
writer.write(angleValue);
} else {
writer.write("");
}
}
writer.endRecord();
}
writer.close();
} catch (IOException e) {
MainWindow.LOGGER.error(
"Failed to save results from local comparison", e);
JOptionPane.showMessageDialog(this, e.getMessage(), "Error",
JOptionPane.ERROR_MESSAGE);
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
56fb7a3e87ecb9ee22706227c91755272006678e | 3b4b17e567e1418177a204b30a64bc2b8cf4939d | /src/main/java/com/eshop/model/CartDetails.java | 940e611be92323755161424f6c7a6261b79b13e5 | [] | no_license | muniniit/pro1 | acc1e8923514da1079178257a66ccd6cc0c3beee | 1972db54dde747f7c6e5411194dc3f6547867547 | refs/heads/master | 2020-12-02T11:23:57.767907 | 2017-07-09T06:32:42 | 2017-07-09T06:33:50 | 96,635,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,455 | java | package com.eshop.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.springframework.stereotype.Component;
@Entity
@Table
@Component
public class CartDetails {
@Id
@GeneratedValue
@Column(name ="cartId")
private int cartId;
@Column(name ="cartUser")
private String cartUser;
@Column(name ="proId")
private int proId;
@Column(name ="proName")
private String proName;
@Column(name ="proPrice")
private int proPrice;
@Column(name ="totalPrice")
private int totalPrice;
public int getCartId() {
return cartId;
}
public void setCartId(int cartId) {
this.cartId = cartId;
}
public String getCartUser() {
return cartUser;
}
public void setCartUser(String cartUser) {
this.cartUser = cartUser;
}
public int getProId() {
return proId;
}
public void setProId(int proId) {
this.proId = proId;
}
public String getProName() {
return proName;
}
public void setProName(String proName) {
this.proName = proName;
}
public int getProPrice() {
return proPrice;
}
public void setProPrice(int proPrice) {
this.proPrice = proPrice;
}
public int getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(int totalPrice) {
this.totalPrice = totalPrice;
}
}
| [
"munilakshmi4a6@gmail.com"
] | munilakshmi4a6@gmail.com |
a2e424528eff4848d052eec46ac84f0badcb5257 | ce7650c821f81113113cb8a5bf9acfec9b398f98 | /src/main/java/com/tpsc/thepeoplesscorecard/controllers/CustomErrorController.java | 2d3d6e107903adc72a0d015ad2de1214932b2b9d | [] | no_license | nickbratt16/TPSC | 3bd3801feeb7a4b1410ed2b3f09bf8009c486791 | 2c73128b6590f38674229c0c9aade6c2e106d011 | refs/heads/main | 2023-04-19T09:20:00.607284 | 2021-05-05T00:07:05 | 2021-05-05T00:07:05 | 339,885,508 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,328 | java | package com.tpsc.thepeoplesscorecard.controllers;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
@Controller
@RequestMapping("/error")
public class CustomErrorController implements ErrorController {
@GetMapping
public String handleError(HttpServletRequest request, Model model) {
Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
String message = "Something went wrong... We are working on it!";
if (status != null) {
Integer statusCode = Integer.valueOf(status.toString());
if (statusCode == HttpStatus.NOT_FOUND.value())
message = "We could not find that page!";
else if (statusCode == HttpStatus.FORBIDDEN.value())
message = "You are not allowed to access that page.";
}
model.addAttribute("message", message);
return "error";
}
@Override
public String getErrorPath() {
return null;
}
}
| [
"nrbratt@neiu.edu"
] | nrbratt@neiu.edu |
bd72be0cfe8d1f8693d2da0acd1fc9d20dbde29d | 0cc3e4df345e6f44ff5ff80f0e22e9e39c4fff68 | /src/main/java/me/andpay/ti/util/BasicFuture.java | f7f30a87890837c2f777025b789227b20f210073 | [] | no_license | echo-weng/ti-srv-util | 0a288d4325502f6b17fb3802744c34f8c0cd3818 | 2f70d94f90205c57322bcd99b1ff2b83b847d45d | refs/heads/master | 2016-09-06T05:22:37.587679 | 2015-03-03T10:21:53 | 2015-03-03T10:21:53 | 31,592,490 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,408 | java | package me.andpay.ti.util;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* 简单Future实现类
*
* @author alex
*/
public class BasicFuture<T> implements Future<T> {
/**
* 是否已完成
*/
private volatile boolean completed;
/**
* 是否被取消
*/
private volatile boolean cancelled;
/**
* 执行结果
*/
private volatile T result;
/**
* 执行异常
*/
private volatile Exception ex;
/**
* 实际任务
*/
private volatile Future<?> task;
/**
* 运行线程
*/
private volatile Thread runner;
/**
* 执行成功
*
* @param result
*/
public boolean completed(final T result) {
synchronized (this) {
if (completed) {
return false;
}
completed = true;
runner = null;
this.result = result;
notifyAll();
}
return true;
}
/**
* 执行失败
*
* @param exception
*/
public boolean failed(final Exception exception) {
synchronized (this) {
if (completed) {
return false;
}
completed = true;
runner = null;
ex = exception;
notifyAll();
}
return true;
}
/**
* {@inheritDoc}
*/
public boolean isCancelled() {
return cancelled;
}
/**
* {@inheritDoc}
*/
public boolean isDone() {
return completed;
}
/**
* {@inheritDoc}
*/
public boolean cancel(final boolean mayInterruptIfRunning) {
synchronized (this) {
if (completed) {
return false;
}
completed = true;
try {
cancelled = (task != null ? task.cancel(mayInterruptIfRunning) : true);
} catch (Exception ex) {
}
if (mayInterruptIfRunning) {
if (runner != null) {
try {
runner.interrupt();
} catch (Exception ex) {
}
cancelled = true;
}
}
runner = null;
notifyAll();
}
return cancelled;
}
/**
* 捕获运行线程 - 用于cancel
*/
public void catchRunner() {
synchronized (this) {
if (completed) {
return;
}
runner = Thread.currentThread();
}
}
/**
* {@inheritDoc}
*/
public synchronized T get() throws InterruptedException, ExecutionException {
while (completed == false) {
wait();
}
return getResult();
}
/**
* {@inheritDoc}
*/
public synchronized T get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException,
TimeoutException {
final long msecs = unit.toMillis(timeout);
final long startTime = (msecs <= 0) ? 0 : System.currentTimeMillis();
long waitTime = msecs;
if (completed) {
return getResult();
} else if (waitTime <= 0) {
throw new TimeoutException();
} else {
for (;;) {
wait(waitTime);
if (completed) {
return getResult();
} else {
waitTime = msecs - (System.currentTimeMillis() - startTime);
if (waitTime <= 0) {
throw new TimeoutException();
}
}
}
}
}
/**
* 获得执行结果
*
* @throws CancellationException
* @throws ExecutionException
*/
private T getResult() throws ExecutionException {
if (cancelled) {
throw new CancellationException();
}
if (ex != null) {
throw new ExecutionException(ex);
}
return result;
}
/**
* @param task
* the task to set
*/
public void setTask(Future<?> task) {
this.task = task;
}
}
| [
"xiuqing.weng@yeepay.com"
] | xiuqing.weng@yeepay.com |
aa9479796cb13b430c19e088de0880dc7eb88309 | ff6f264f8d6b7a962f1c0bd6519cb59ecea6a162 | /src/java/net/sf/picard/util/IntervalTree.java | 77c89e9a3a1de88e187602857a1cb912586da744 | [] | no_license | utgenome/picard | c5c583d9362ec3cd535f806cfc19b82564cb3a7a | 8ef0bb735d06ffd1d4a399e15632713adbad7bb6 | refs/heads/master | 2021-01-10T02:04:15.653437 | 2013-11-05T01:38:13 | 2013-11-05T01:38:13 | 8,496,273 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 36,001 | java | /*
* The MIT License
*
* Copyright (c) 2009 The Broad Institute
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package net.sf.picard.util;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* A Red-Black tree with intervals for keys.
* Not thread-safe, and cannot be made so.
*
* 7/24/2008: This was copied from the tedUtils package.
* IMPORTANT!!! It has been modified to use the Reseq way of
* handling coordinates (end-inclusive).
*
* @author tsharpe
*/
public class IntervalTree<V> implements Iterable<IntervalTree.Node<V>>
{
/**
* Return the number of intervals in the tree.
* @return The number of intervals.
*/
public int size()
{
return mRoot == null ? 0 : mRoot.getSize();
}
/**
* Remove all entries.
*/
public void clear()
{
mRoot = null;
}
/**
* Put a new interval into the tree (or update the value associated with an existing interval).
* If the interval is novel, the special sentinel value is returned.
* @param start The interval's start.
* @param end The interval's end.
* @param value The associated value.
* @return The old value associated with that interval, or the sentinel.
*/
@SuppressWarnings("null")
public V put( final int start, final int end, final V value )
{
if ( start > end )
throw new IllegalArgumentException("Start cannot exceed end.");
V result = mSentinel;
if ( mRoot == null )
{
mRoot = new Node<V>(start,end,value);
}
else
{
Node<V> parent = null;
Node<V> node = mRoot;
int cmpVal = 0;
while ( node != null )
{
parent = node; // last non-null node
cmpVal = node.compare(start,end);
if ( cmpVal == 0 )
{
break;
}
node = cmpVal < 0 ? node.getLeft() : node.getRight();
}
if ( cmpVal == 0 )
{
result = parent.setValue(value);
}
else
{
if ( cmpVal < 0 )
{
mRoot = parent.insertLeft(start,end,value,mRoot);
}
else
{
mRoot = parent.insertRight(start,end,value,mRoot);
}
}
}
return result;
}
/**
* Remove an interval from the tree. If the interval does not exist in the tree the
* special sentinel value is returned.
* @param start The interval's start.
* @param end The interval's end.
* @return The value associated with that interval, or the sentinel.
*/
public V remove( final int start, final int end )
{
V result = mSentinel;
Node<V> node = mRoot;
while ( node != null )
{
final int cmpVal = node.compare(start,end);
if ( cmpVal == 0 )
{
result = node.getValue();
mRoot = node.remove(mRoot);
break;
}
node = cmpVal < 0 ? node.getLeft() : node.getRight();
}
return result;
}
/**
* Find an interval.
* @param start The interval's start.
* @param end The interval's end.
* @return The Node that represents that interval, or null.
*/
public Node<V> find( final int start, final int end )
{
Node<V> node = mRoot;
while ( node != null )
{
final int cmpVal = node.compare(start,end);
if ( cmpVal == 0 )
{
break;
}
node = cmpVal < 0 ? node.getLeft() : node.getRight();
}
return node;
}
/**
* Find the nth interval in the tree.
* @param idx The rank of the interval sought (from 0 to size()-1).
* @return The Node that represents the nth interval.
*/
public Node<V> findByIndex( final int idx )
{
return Node.findByRank(mRoot,idx+1);
}
/**
* Find the rank of the specified interval. If the specified interval is not in the
* tree, then -1 is returned.
* @param start The interval's start.
* @param end The interval's end.
* @return The rank of that interval, or -1.
*/
public int getIndex( final int start, final int end )
{
return Node.getRank(mRoot,start,end) - 1;
}
/**
* Find the least interval in the tree.
* @return The earliest interval, or null if the tree is empty.
*/
public Node<V> min()
{
Node<V> result = null;
Node<V> node = mRoot;
while ( node != null )
{
result = node;
node = node.getLeft();
}
return result;
}
/**
* Find the earliest interval in the tree greater than or equal to the specified interval.
* @param start The interval's start.
* @param end The interval's end.
* @return The earliest >= interval, or null if there is none.
*/
@SuppressWarnings("null")
public Node<V> min( final int start, final int end )
{
Node<V> result = null;
Node<V> node = mRoot;
int cmpVal = 0;
while ( node != null )
{
result = node;
cmpVal = node.compare(start,end);
if ( cmpVal == 0 )
{
break;
}
node = cmpVal < 0 ? node.getLeft() : node.getRight();
}
if ( cmpVal > 0 )
{
result = result.getNext();
}
return result;
}
/**
* Find the earliest interval in the tree that overlaps the specified interval.
* @param start The interval's start.
* @param end The interval's end.
* @return The earliest overlapping interval, or null if there is none.
*/
public Node<V> minOverlapper( final int start, final int end )
{
Node<V> result = null;
Node<V> node = mRoot;
if ( node != null && node.getMaxEnd() >= start )
{
while ( true )
{
if ( node.getStart() <= end && start <= node.getEnd() )
{ // this node overlaps. there might be a lesser overlapper down the left sub-tree.
// no need to consider the right sub-tree: even if there's an overlapper, if won't be minimal
result = node;
node = node.getLeft();
if ( node == null || node.getMaxEnd() < start )
break; // no left sub-tree or all nodes end too early
}
else
{ // no overlap. if there might be a left sub-tree overlapper, consider the left sub-tree.
final Node<V> left = node.getLeft();
if ( left != null && left.getMaxEnd() >= start )
{
node = left;
}
else
{ // left sub-tree cannot contain an overlapper. consider the right sub-tree.
if ( node.getStart() > end )
break; // everything in the right sub-tree is past the end of the query interval
node = node.getRight();
if ( node == null || node.getMaxEnd() < start )
break; // no right sub-tree or all nodes end too early
}
}
}
}
return result;
}
/**
* Find the greatest interval in the tree.
* @return The latest interval, or null if the tree is empty.
*/
public Node<V> max()
{
Node<V> result = null;
Node<V> node = mRoot;
while ( node != null )
{
result = node;
node = node.getRight();
}
return result;
}
/**
* Find the latest interval in the tree less than or equal to the specified interval.
* @param start The interval's start.
* @param end The interval's end.
* @return The latest >= interval, or null if there is none.
*/
@SuppressWarnings("null")
public Node<V> max( final int start, final int end )
{
Node<V> result = null;
Node<V> node = mRoot;
int cmpVal = 0;
while ( node != null )
{
result = node;
cmpVal = node.compare(start,end);
if ( cmpVal == 0 )
{
break;
}
node = cmpVal < 0 ? node.getLeft() : node.getRight();
}
if ( cmpVal < 0 )
{
result = result.getPrev();
}
return result;
}
/**
* Return an iterator over the entire tree.
* @return An iterator.
*/
public Iterator<Node<V>> iterator()
{
return new FwdIterator(min());
}
/**
* Return an iterator over all intervals greater than or equal to the specified interval.
* @param start The interval's start.
* @param end The interval's end.
* @return An iterator.
*/
public Iterator<Node<V>> iterator( final int start, final int end )
{
return new FwdIterator(min(start,end));
}
/**
* Return an iterator over all intervals overlapping the specified range.
* @param start The range start.
* @param end The range end.
* @return An iterator.
*/
public Iterator<Node<V>> overlappers( final int start, final int end )
{
return new OverlapIterator(start,end);
}
/**
* Return an iterator over the entire tree that returns intervals in reverse order.
* @return An iterator.
*/
public Iterator<Node<V>> reverseIterator()
{
return new RevIterator(max());
}
/**
* Return an iterator over all intervals less than or equal to the specified interval, in reverse order.
* @param start The interval's start.
* @param end The interval's end.
* @return An iterator.
*/
public Iterator<Node<V>> reverseIterator( final int start, final int end )
{
return new RevIterator(max(start,end));
}
/**
* Get the special sentinel value that will be used to signal novelty when putting a new interval
* into the tree, or to signal "not found" when removing an interval. This is null by default.
* @return The sentinel value.
*/
public V getSentinel()
{
return mSentinel;
}
/**
* Set the special sentinel value that will be used to signal novelty when putting a new interval
* into the tree, or to signal "not found" when removing an interval.
* @param sentinel The new sentinel value.
* @return The old sentinel value.
*/
public V setSentinel( final V sentinel )
{
final V result = mSentinel;
mSentinel = sentinel;
return result;
}
/**
* This method is only for debugging.
* It verifies whether the tree is internally consistent with respect to the mMaxEnd cached on each node.
* @throws IllegalStateException If an inconsistency is detected.
*/
public void checkMaxEnds() {
if (mRoot != null) mRoot.checkMaxEnd();
}
/**
* This method draws a nested picture of the tree on System.out.
* Useful for debugging.
*/
public void printTree() {
if (mRoot != null) mRoot.printNode();
}
void removeNode( final Node<V> node )
{
mRoot = node.remove(mRoot);
}
private Node<V> mRoot;
private V mSentinel;
public static class Node<V1>
{
// bit-wise definitions from which the other constants are composed
public static final int HAS_LESSER_PART = 1;
public static final int HAS_OVERLAPPING_PART = 2;
public static final int HAS_GREATER_PART = 4;
public static final int IS_ADJACENT_AND_EMPTY = 0;
public static final int IS_STRICTLY_LESS = HAS_LESSER_PART; // 1
public static final int IS_SUBSET = HAS_OVERLAPPING_PART; // 2
public static final int IS_LEFT_OVERHANGING_OVERLAPPER = HAS_LESSER_PART | HAS_OVERLAPPING_PART; // 3
public static final int IS_STRICTLY_GREATER = HAS_GREATER_PART; // 4
// there is no value that equals 5, since that would imply overhanging on left and right without overlapping
public static final int IS_RIGHT_OVERHANGING_OVERLAPPER = HAS_GREATER_PART | HAS_OVERLAPPING_PART; // 6
public static final int IS_SUPERSET = HAS_LESSER_PART | HAS_OVERLAPPING_PART | HAS_GREATER_PART; // 7
Node( final int start, final int end, final V1 value )
{
mStart = start;
mEnd = end;
mValue = value;
mSize = 1;
mMaxEnd = mEnd;
mIsBlack = true;
}
Node( final Node<V1> parent, final int start, final int end, final V1 value )
{
mParent = parent;
mStart = start;
mEnd = end;
mValue = value;
mMaxEnd = mEnd;
mSize = 1;
}
public int getStart()
{
return mStart;
}
public int getEnd()
{
return mEnd;
}
public int getLength()
{
return mEnd - mStart;
}
public int getRelationship( final Node<V1> interval )
{
int result = 0;
if ( mStart < interval.getStart() )
result = HAS_LESSER_PART;
if ( mEnd > interval.getEnd() )
result |= HAS_GREATER_PART;
if ( mStart < interval.getEnd() && interval.getStart() < mEnd )
result |= HAS_OVERLAPPING_PART;
return result;
}
public boolean isAdjacent( final Node<V1> interval )
{
return mStart == interval.getEnd() || mEnd == interval.getStart();
}
public V1 getValue()
{
return mValue;
}
public V1 setValue( final V1 value )
{
final V1 result = mValue;
mValue = value;
return result;
}
int getSize()
{
return mSize;
}
int getMaxEnd()
{
return mMaxEnd;
}
Node<V1> getLeft()
{
return mLeft;
}
Node<V1> insertLeft( final int start, final int end, final V1 value, final Node<V1> root )
{
mLeft = new Node<V1>(this,start,end,value);
return insertFixup(mLeft,root);
}
Node<V1> getRight()
{
return mRight;
}
Node<V1> insertRight( final int start, final int end, final V1 value, final Node<V1> root )
{
mRight = new Node<V1>(this,start,end,value);
return insertFixup(mRight,root);
}
Node<V1> getNext()
{
Node<V1> result;
if ( mRight != null )
{
result = mRight;
while ( result.mLeft != null )
{
result = result.mLeft;
}
}
else
{
Node<V1> node = this;
result = mParent;
while ( result != null && node == result.mRight )
{
node = result;
result = result.mParent;
}
}
return result;
}
Node<V1> getPrev()
{
Node<V1> result;
if ( mLeft != null )
{
result = mLeft;
while ( result.mRight != null )
{
result = result.mRight;
}
}
else
{
Node<V1> node = this;
result = mParent;
while ( result != null && node == result.mLeft )
{
node = result;
result = result.mParent;
}
}
return result;
}
boolean wasRemoved()
{
return mSize == 0;
}
Node<V1> remove( Node<V1> root )
{
if ( mSize == 0 )
{
throw new IllegalStateException("Entry was already removed.");
}
if ( mLeft == null )
{
if ( mRight == null )
{ // no children
if ( mParent == null )
{
root = null;
}
else if ( mParent.mLeft == this )
{
mParent.mLeft = null;
fixup(mParent);
if ( mIsBlack )
root = removeFixup(mParent,null,root);
}
else
{
mParent.mRight = null;
fixup(mParent);
if ( mIsBlack )
root = removeFixup(mParent,null,root);
}
}
else
{ // single child on right
root = spliceOut(mRight,root);
}
}
else if ( mRight == null )
{ // single child on left
root = spliceOut(mLeft,root);
}
else
{ // two children
final Node<V1> next = getNext();
root = next.remove(root);
// put next into tree in same position as this, effectively removing this
if ( (next.mParent = mParent) == null )
root = next;
else if ( mParent.mLeft == this )
mParent.mLeft = next;
else
mParent.mRight = next;
if ( (next.mLeft = mLeft) != null )
{
mLeft.mParent = next;
}
if ( (next.mRight = mRight) != null )
{
mRight.mParent = next;
}
next.mIsBlack = mIsBlack;
next.mSize = mSize;
// PIC-123 fix
fixup(next);
}
mSize = 0;
return root;
}
// backwards comparison! compares start+end to this.
int compare( final int start, final int end )
{
int result = 0;
if ( start > mStart )
result = 1;
else if ( start < mStart )
result = -1;
else if ( end > mEnd )
result = 1;
else if ( end < mEnd )
result = -1;
return result;
}
@SuppressWarnings("null")
static <V1> Node<V1> getNextOverlapper( Node<V1> node, final int start, final int end )
{
do
{
Node<V1> nextNode = node.mRight;
if ( nextNode != null && nextNode.mMaxEnd >= start )
{
node = nextNode;
while ( (nextNode = node.mLeft) != null && nextNode.mMaxEnd >= start )
node = nextNode;
}
else
{
nextNode = node;
while ( (node = nextNode.mParent) != null && node.mRight == nextNode )
nextNode = node;
}
if ( node != null && node.mStart > end )
node = null;
}
while ( node != null && !(node.mStart <= end && start <= node.mEnd) );
return node;
}
static <V1> Node<V1> findByRank( Node<V1> node, int rank )
{
while ( node != null )
{
final int nodeRank = node.getRank();
if ( rank == nodeRank )
break;
if ( rank < nodeRank )
{
node = node.mLeft;
}
else
{
node = node.mRight;
rank -= nodeRank;
}
}
return node;
}
static <V1> int getRank( Node<V1> node, final int start, final int end )
{
int rank = 0;
while ( node != null )
{
final int cmpVal = node.compare(start,end);
if ( cmpVal < 0 )
{
node = node.mLeft;
}
else
{
rank += node.getRank();
if ( cmpVal == 0 )
return rank; // EARLY RETURN!!!
node = node.mRight;
}
}
return 0;
}
private int getRank()
{
int result = 1;
if ( mLeft != null )
result = mLeft.mSize + 1;
return result;
}
private Node<V1> spliceOut( final Node<V1> child, Node<V1> root )
{
if ( (child.mParent = mParent) == null )
{
root = child;
child.mIsBlack = true;
}
else
{
if ( mParent.mLeft == this )
mParent.mLeft = child;
else
mParent.mRight = child;
fixup(mParent);
if ( mIsBlack )
root = removeFixup(mParent,child,root);
}
return root;
}
private Node<V1> rotateLeft( Node<V1> root )
{
final Node<V1> child = mRight;
final int childSize = child.mSize;
child.mSize = mSize;
mSize -= childSize;
if ( (mRight = child.mLeft) != null )
{
mRight.mParent = this;
mSize += mRight.mSize;
}
if ( (child.mParent = mParent) == null )
root = child;
else if ( this == mParent.mLeft )
mParent.mLeft = child;
else
mParent.mRight = child;
child.mLeft = this;
mParent = child;
setMaxEnd();
child.setMaxEnd();
return root;
}
private Node<V1> rotateRight( Node<V1> root )
{
final Node<V1> child = mLeft;
final int childSize = child.mSize;
child.mSize = mSize;
mSize -= childSize;
if ( (mLeft = child.mRight) != null )
{
mLeft.mParent = this;
mSize += mLeft.mSize;
}
if ( (child.mParent = mParent) == null )
root = child;
else if ( this == mParent.mLeft )
mParent.mLeft = child;
else
mParent.mRight = child;
child.mRight = this;
mParent = child;
setMaxEnd();
child.setMaxEnd();
return root;
}
private void setMaxEnd()
{
mMaxEnd = mEnd;
if ( mLeft != null )
mMaxEnd = Math.max(mMaxEnd,mLeft.mMaxEnd);
if ( mRight != null )
mMaxEnd = Math.max(mMaxEnd,mRight.mMaxEnd);
}
private static <V1> void fixup( Node<V1> node )
{
do
{
node.mSize = 1;
node.mMaxEnd = node.mEnd;
if ( node.mLeft != null )
{
node.mSize += node.mLeft.mSize;
node.mMaxEnd = Math.max(node.mMaxEnd,node.mLeft.mMaxEnd);
}
if ( node.mRight != null )
{
node.mSize += node.mRight.mSize;
node.mMaxEnd = Math.max(node.mMaxEnd,node.mRight.mMaxEnd);
}
}
while ( (node = node.mParent) != null );
}
private static <V1> Node<V1> insertFixup( Node<V1> daughter, Node<V1> root )
{
Node<V1> mom = daughter.mParent;
fixup(mom);
while( mom != null && !mom.mIsBlack )
{
final Node<V1> gramma = mom.mParent;
Node<V1> auntie = gramma.mLeft;
if ( auntie == mom )
{
auntie = gramma.mRight;
if ( auntie != null && !auntie.mIsBlack )
{
mom.mIsBlack = true;
auntie.mIsBlack = true;
gramma.mIsBlack = false;
daughter = gramma;
}
else
{
if ( daughter == mom.mRight )
{
root = mom.rotateLeft(root);
mom = daughter;
}
mom.mIsBlack = true;
gramma.mIsBlack = false;
root = gramma.rotateRight(root);
break;
}
}
else
{
if ( auntie != null && !auntie.mIsBlack )
{
mom.mIsBlack = true;
auntie.mIsBlack = true;
gramma.mIsBlack = false;
daughter = gramma;
}
else
{
if ( daughter == mom.mLeft )
{
root = mom.rotateRight(root);
mom = daughter;
}
mom.mIsBlack = true;
gramma.mIsBlack = false;
root = gramma.rotateLeft(root);
break;
}
}
mom = daughter.mParent;
}
root.mIsBlack = true;
return root;
}
private static <V1> Node<V1> removeFixup( Node<V1> parent, Node<V1> node, Node<V1> root )
{
do
{
if ( node == parent.mLeft )
{
Node<V1> sister = parent.mRight;
if ( !sister.mIsBlack )
{
sister.mIsBlack = true;
parent.mIsBlack = false;
root = parent.rotateLeft(root);
sister = parent.mRight;
}
if ( (sister.mLeft == null || sister.mLeft.mIsBlack) && (sister.mRight == null || sister.mRight.mIsBlack) )
{
sister.mIsBlack = false;
node = parent;
}
else
{
if ( sister.mRight == null || sister.mRight.mIsBlack )
{
sister.mLeft.mIsBlack = true;
sister.mIsBlack = false;
root = sister.rotateRight(root);
sister = parent.mRight;
}
sister.mIsBlack = parent.mIsBlack;
parent.mIsBlack = true;
sister.mRight.mIsBlack = true;
root = parent.rotateLeft(root);
node = root;
}
}
else
{
Node<V1> sister = parent.mLeft;
if ( !sister.mIsBlack )
{
sister.mIsBlack = true;
parent.mIsBlack = false;
root = parent.rotateRight(root);
sister = parent.mLeft;
}
if ( (sister.mLeft == null || sister.mLeft.mIsBlack) && (sister.mRight == null || sister.mRight.mIsBlack) )
{
sister.mIsBlack = false;
node = parent;
}
else
{
if ( sister.mLeft == null || sister.mLeft.mIsBlack )
{
sister.mRight.mIsBlack = true;
sister.mIsBlack = false;
root = sister.rotateLeft(root);
sister = parent.mLeft;
}
sister.mIsBlack = parent.mIsBlack;
parent.mIsBlack = true;
sister.mLeft.mIsBlack = true;
root = parent.rotateRight(root);
node = root;
}
}
parent = node.mParent;
}
while ( parent != null && node.mIsBlack );
node.mIsBlack = true;
return root;
}
public void checkMaxEnd() {
if (mMaxEnd != calcMaxEnd()) {
throw new IllegalStateException("Max end mismatch " + mMaxEnd + " vs " + calcMaxEnd() + ": " + this);
}
if (mLeft != null) mLeft.checkMaxEnd();
if (mRight != null) mRight.checkMaxEnd();
}
private int calcMaxEnd() {
int end = mEnd;
if (mLeft != null) end = Math.max(end, mLeft.mMaxEnd);
if (mRight != null) end = Math.max(end, mRight.mMaxEnd);
return end;
}
public void printNode() {
this.printNodeInternal("", "root: ");
}
private void printNodeInternal(final String padding, final String tag) {
System.out.println(padding + tag + " " + this);
if (mLeft != null) mLeft.printNodeInternal(padding + " ", "left: ");
if (mRight != null) mRight.printNodeInternal(padding + " ", "right:");
}
public String toString() {
return "Node(" + mStart + "," + mEnd + "," + mValue + "," + mSize + "," + mMaxEnd + "," + mIsBlack + ")";
}
private Node<V1> mParent;
private Node<V1> mLeft;
private Node<V1> mRight;
private final int mStart;
private final int mEnd;
private V1 mValue;
private int mSize;
private int mMaxEnd;
private boolean mIsBlack;
}
public class FwdIterator
implements Iterator<Node<V>>
{
public FwdIterator( final Node<V> node )
{
mNext = node;
}
public boolean hasNext()
{
return mNext != null;
}
public Node<V> next()
{
if ( mNext == null )
{
throw new NoSuchElementException("No next element.");
}
if ( mNext.wasRemoved() )
{
mNext = min(mNext.getStart(),mNext.getEnd());
if ( mNext == null )
throw new ConcurrentModificationException("Current element was removed, and there are no more elements.");
}
mLast = mNext;
mNext = mNext.getNext();
return mLast;
}
public void remove()
{
if ( mLast == null )
{
throw new IllegalStateException("No entry to remove.");
}
removeNode(mLast);
mLast = null;
}
private Node<V> mNext;
private Node<V> mLast;
}
public class RevIterator
implements Iterator<Node<V>>
{
public RevIterator( final Node<V> node )
{
mNext = node;
}
public boolean hasNext()
{
return mNext != null;
}
public Node<V> next()
{
if ( mNext == null )
throw new NoSuchElementException("No next element.");
if ( mNext.wasRemoved() )
{
mNext = max(mNext.getStart(),mNext.getEnd());
if ( mNext == null )
throw new ConcurrentModificationException("Current element was removed, and there are no more elements.");
}
mLast = mNext;
mNext = mNext.getPrev();
return mLast;
}
public void remove()
{
if ( mLast == null )
{
throw new IllegalStateException("No entry to remove.");
}
removeNode(mLast);
mLast = null;
}
private Node<V> mNext;
private Node<V> mLast;
}
public class OverlapIterator
implements Iterator<Node<V>>
{
public OverlapIterator( final int start, final int end )
{
mNext = minOverlapper(start,end);
mStart = start;
mEnd = end;
}
public boolean hasNext()
{
return mNext != null;
}
public Node<V> next()
{
if ( mNext == null )
{
throw new NoSuchElementException("No next element.");
}
if ( mNext.wasRemoved() )
{
throw new ConcurrentModificationException("Current element was removed.");
}
mLast = mNext;
mNext = Node.getNextOverlapper(mNext,mStart,mEnd);
return mLast;
}
public void remove()
{
if ( mLast == null )
{
throw new IllegalStateException("No entry to remove.");
}
removeNode(mLast);
mLast = null;
}
private Node<V> mNext;
private Node<V> mLast;
private final int mStart;
private final int mEnd;
}
public static class ValuesIterator<V1>
implements Iterator<V1>
{
public ValuesIterator( final Iterator<Node<V1>> itr )
{
mItr = itr;
}
public boolean hasNext()
{
return mItr.hasNext();
}
public V1 next()
{
return mItr.next().getValue();
}
public void remove()
{
mItr.remove();
}
private final Iterator<Node<V1>> mItr;
}
}
| [
"alecw@8bce386e-0d6e-43e0-b1ca-608082c0432d"
] | alecw@8bce386e-0d6e-43e0-b1ca-608082c0432d |
39f2dad5d53b0eef7e648a1158592c6edc4cf09d | e3706f94f3f3b16f7b91361bec06b8c028d50d1e | /FinalExamQuestions/src/QuestionA/iPersonReadWrite.java | 17e049474fd2fe2f7cc2acbab883927879afc474 | [] | no_license | bhodges24/Final_Exam_Questions | a7bc5fd38c015040faef808e66841190b6cc1ce1 | 349d1e52fa9beaf9652cdeb8e4812e058a565427 | refs/heads/master | 2016-08-11T21:14:32.961100 | 2015-12-18T21:50:50 | 2015-12-18T21:50:50 | 48,255,506 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 379 | java | package QuestionA;
import java.util.Date;
public interface iPersonReadWrite {
//Add all methods that set values
void setFirstName(String FirstName);
void setMiddleName(String MiddleName);
void setLastName(String LastName);
void setDOB(Date DOB);
void setAddress(String newAddress);
void setPhone(String newPhone_number);
void setEmail(String newEmail);
}
| [
"benhodges@wifi-roaming-128-4-184-104.host.udel.edu"
] | benhodges@wifi-roaming-128-4-184-104.host.udel.edu |
4ad947317e0beb888e07e0983ce04b90a1bab5d8 | a03d40cbad1f26c2587528db07c1d7da9c8f4338 | /src/os4/task/params/AbstractGUIParameter.java | 31ccac92a554e1a144931868a62376be02567bf6 | [] | no_license | sergyegorov/OpenSpectrIV | 2989f8a1fc1621b4cee2f159dcd714db9ef0d207 | 52e9d89b3251474eca362b3c6101521ad0b4950b | refs/heads/master | 2021-01-01T18:07:37.116429 | 2014-12-25T09:14:12 | 2014-12-25T09:14:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,131 | java | /*
* The MIT License
*
* Copyright 2014 root.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package os4.task.params;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import javax.swing.JPanel;
import os4.OS4ExceptionInternalError;
import os4.OS4UnExpectedError;
/**
*
* @author root
*/
public interface AbstractGUIParameter {
default public boolean is(String id){
return id.equals(getId());
}
JPanel getGui();
String getId();
void load(DataInputStream str) throws IOException, OS4ExceptionInternalError;
void save(DataOutputStream str) throws IOException, OS4ExceptionInternalError;
void reset();
public static final int TypeSelector = 0;
public static final int TypeDouble = 1;
public static final int TypeString = 2;
int getType();
public static AbstractGUIParameter createInstance(int type) throws OS4ExceptionInternalError{
switch(type){
case TypeSelector:
return new GUIParameterSelector();
case TypeDouble:
return new GUIParameterDouble();
case TypeString:
return new GUIParameterString();
}
throw new OS4ExceptionInternalError("Unknown type of GUI parameter:"+type+" Fix It!");
}
public static String getShortDescription(String full_description){
int point = full_description.indexOf('.');
return full_description.substring(0,point);
}
GUIParameterCollection getMaster();
void initMaster(GUIParameterCollection master);
double getAsDouble();
String getAsString();
default public long getAsLong(){
return Math.round(getAsDouble());
}
default public int getAsInt(){
long ret = Math.round(getAsDouble());
if(ret < -Integer.MAX_VALUE ||
ret > Integer.MAX_VALUE)
throw new OS4UnExpectedError("Value bigger then int "+ret);
return (int)ret;
}
}
| [
"sergyegorov2012@gmail.com"
] | sergyegorov2012@gmail.com |
88cfe051ae62d3107e69500feb1fe605d6d42207 | beb5d09e8065bd2e127535baf75f3a60a68a95a0 | /fish-game/src/main/java/com/toyo/fish/game/FishZoneApp.java | ee55e17321e5641d78aa02018bbca52f5f139d9e | [] | no_license | autumnsparrow/fish-game | 94c145cb3a98c61a8ed470d7e5026dfdae48e7f2 | 3178a63c455d39c51d35b33147f5b8071a94b0dd | refs/heads/master | 2021-04-06T20:17:52.280900 | 2018-03-14T14:55:50 | 2018-03-14T14:55:50 | 125,228,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,221 | java | package com.toyo.fish.game;
import com.sky.game.context.SpringContext;
import com.sky.game.context.service.ServerStarupService;
import com.sky.game.context.util.G;
import com.sky.game.context.util.GameUtil;
import com.toyo.fish.game.logic.handler.GlobalUserManager;
import com.toyo.remote.service.user.ILoginService;
/**
* Hello world!
*
*/
public class FishZoneApp
{
//
public static void main( String[] args )
{
//System.out.println( "Hello World!" );
GameUtil.initTokenSerail();
boolean flag=FishApp.DEBUG;
if(flag){
System.out.println("##########DEBUG MODE##############");
SpringContext.init(new String[]{
"classpath:/META-INF/spring/debug//applicationContext-fish-protocol-service-zone.xml",
"classpath:/META-INF/spring/debug/applicationContext-fish-zone.xml"
});
}else{
System.out.println("##########RELEASE MODE##############");
SpringContext.init(new String[]{
"classpath:/META-INF/spring/release/applicationContext-fish-protocol-service-zone.xml",
"classpath:/META-INF/spring/release/applicationContext-fish-zone.xml"
});
}
}
}
| [
"ruiqiuzhang@gmail.com"
] | ruiqiuzhang@gmail.com |
03bf201090501cfd6c36218d7059ccf96425d577 | 3e3d42f75d76b647997936ae885b28ac8ad76547 | /app/src/main/java/com/musicgarden/android/lib/ListItemController.java | 1ce30b779aa00dd4854fe601750185deed35ac2c | [] | no_license | sidn27/music-garden-android-app | 7fc31666e823b9a47671582f17ad4ba6f6c396bb | 4f946e7e77bae163fd66c572013a1cee4dc95592 | refs/heads/master | 2020-04-11T07:11:15.458278 | 2018-12-13T08:13:22 | 2018-12-13T08:13:22 | 161,603,785 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 165 | java | package com.musicgarden.android.lib;
public interface ListItemController {
public String getImage_url();
public String getName();
public int getId();
}
| [
"siddharthnarayan27@gmail.com"
] | siddharthnarayan27@gmail.com |
4eb3dee28b078ffb365ece3b1e1b0e14e2231a99 | ea002e3b86a51eb5e45f68cf6e40319297cb7679 | /app/src/main/java/com/opus_bd/myapplication/Utils/SinchCons.java | 9b1ef0a6fa4c29ce408934fcb4e5048d3f6b238e | [] | no_license | SUZAUDDAULA/Cyber_Chat_Kotha | e2937ab0da46bdc856ef27da63e74154b52fa551 | 0b358d0300a6212f57e30019ac71eb8a89277cf8 | refs/heads/master | 2022-11-22T00:46:28.184689 | 2020-07-12T10:55:11 | 2020-07-12T10:55:11 | 278,852,539 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package com.opus_bd.myapplication.Utils;
import com.sinch.android.rtc.SinchClient;
import com.sinch.android.rtc.calling.Call;
public class SinchCons {
public static String applicationKey = "a08de83a-27fb-474f-bece-0d4a107d16eb";
public static String applicationSecret = "W7/ieNUNLEiuYa24aOGSRA==";
public static String environmentHost = "clientapi.sinch.com";
public static Call incomingCallInstance;
public static SinchClient callSnichClient;
} | [
"suzauddaula103@gmail.com"
] | suzauddaula103@gmail.com |
3c6d5a1264a19540fca911390e17b185893b3cbd | edeb76ba44692dff2f180119703c239f4585d066 | /libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/operations/XMLItem.java | 9a43b8838082b4c65c70ce9d7fda4ac0887f5947 | [] | no_license | CafeGIS/gvSIG2_0 | f3e52bdbb98090fd44549bd8d6c75b645d36f624 | 81376f304645d040ee34e98d57b4f745e0293d05 | refs/heads/master | 2020-04-04T19:33:47.082008 | 2012-09-13T03:55:33 | 2012-09-13T03:55:33 | 5,685,448 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package org.gvsig.fmap.mapcontext.layers.operations;
import org.gvsig.fmap.mapcontext.layers.FLayer;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
public interface XMLItem {
public void parse(ContentHandler handler) throws SAXException;
public FLayer getLayer();
}
| [
"tranquangtruonghinh@gmail.com"
] | tranquangtruonghinh@gmail.com |
3db3170edc4327e8ff7517e8dd42cfc51c2c2684 | 518eadde6db89bca44770cdb8f09fa56873220c2 | /OOPAdvanced/Exercises/Reflection/src/pr02PrivateClassFiddling/com/BlackBoxInt.java | e93fc30e474d1184b6b2f047a6f07627e9e89655 | [] | no_license | vonrepiks/Java-Fundamentals-May-2018 | 7d000b709c0eaf03334cbc90f702b770b6e4c321 | 8beb9ac54aac5669841954b2240cee2bc27787a4 | refs/heads/master | 2020-03-17T10:17:35.674518 | 2018-08-08T07:07:11 | 2018-08-08T07:07:11 | 133,507,163 | 4 | 13 | null | 2018-11-02T19:44:59 | 2018-05-15T11:36:37 | Java | UTF-8 | Java | false | false | 719 | java | package pr02PrivateClassFiddling.com;
public class BlackBoxInt {
private static final int DEFAULT_VALUE = 0;
private int innerValue;
private BlackBoxInt(int innerValue) {
this.innerValue = innerValue;
}
private BlackBoxInt() {
this.innerValue = DEFAULT_VALUE;
}
private void add(int addend) {
this.innerValue += addend;
}
private void subtract(int subtrahend) {
this.innerValue -= subtrahend;
}
private void multiply(int multiplier) {
this.innerValue *= multiplier;
}
private void divide(int divider) {
this.innerValue /= divider;
}
private void leftShift(int shifter) {
this.innerValue <<= shifter;
}
private void rightShift(int shifter) {
this.innerValue >>= shifter;
}
}
| [
"ico_skipernov@abv.bg"
] | ico_skipernov@abv.bg |
7aed87b1bb0d919cdeb037cd14e856cd918b2454 | cabe6d501ba7ca997c939606d55015955ea6fc4e | /src/main/java/ar/edu/ort/p1/u4/practico04/ej04_viajes_tren/src/Recorrido.java | b4ab8a3474e9348e43b82a989adddbd9ae9b8284 | [] | no_license | DelmerRo/Ejercicios-resueltos-herencia-polimorfismo-interfaz-fifo | 9a2f45999fa1b22bd29dbb4a2e602e8ebb3e7e2b | 6f0ccd913e2e28e1e925152685ab9b253374bd0f | refs/heads/master | 2023-09-02T08:42:09.623739 | 2021-11-22T18:18:07 | 2021-11-22T18:18:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,223 | java | package ar.edu.ort.p1.u4.practico04.ej04_viajes_tren.src;
public class Recorrido {
private static double PRECIO_X_ESTACION = 50;
private static double DCTO = 0.2;
private Estacion estDestino;
private Estacion estPartida;
public Recorrido(Estacion estDestino, Estacion estPartida) {
super();
this.estDestino = estDestino;
this.estPartida = estPartida;
}
public double getPrecio() {
double precio;
precio = cantEstacionesRecorridas() * PRECIO_X_ESTACION;
if (fueCompleto()) {
precio = precio - precio * DCTO;
}
return precio;
}
private boolean fueCompleto() {
return cantEstacionesRecorridas() == Estacion.values().length - 1;
}
private int cantEstacionesRecorridas() {
int idx1;
int idx2;
idx1 = this.estDestino.ordinal();
idx2 = this.estPartida.ordinal();
return Math.abs(idx1 - idx2); // El valor absoluto asegura que siempre sea positivo
}
public boolean pasaPor(Estacion e) {
int idxPartida, idxDestino, idxE = 0;
idxPartida = this.estPartida.ordinal();
idxDestino = this.estDestino.ordinal();
if (idxPartida > idxDestino) {
int aux = idxPartida;
idxPartida = idxDestino;
idxDestino = aux;
}
return idxE >= idxPartida && idxE <= idxDestino;
}
}
| [
"ignacio.sanchez@comafi.com.ar"
] | ignacio.sanchez@comafi.com.ar |
029c210da83a1051a38f24d5bde246bd494e6dd7 | db6c4de1f2ae20618968843a30f3b4dbdfb6d7eb | /Test/src/AES.java | 72bef9b4bdbdbdef434b957a84e5250e0ba5041d | [] | no_license | ravikumarbmca1986/Test | dc0a5858e20933613c6d95c3ed27cf22c452b4f3 | 5868e29d4e5896586107cf7b48efbaeef6c8e732 | refs/heads/master | 2021-09-01T13:52:46.779652 | 2017-12-27T07:23:39 | 2017-12-27T07:23:39 | 115,490,348 | 0 | 0 | null | 2017-12-27T08:59:33 | 2017-12-27T06:39:33 | Java | UTF-8 | Java | false | false | 2,370 | java | import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class AES {
private static String mykey = "***** this is the secret key hidden *****";
private static SecretKeySpec secretKey;
private static byte[] key;
//ravi is coming 1rretrr
public static void setKey(String myKey)
{
MessageDigest sha = null;
try {
key = myKey.getBytes("UTF-8");
sha = MessageDigest.getInstance("SHA-1");
key = sha.digest(key);
key = Arrays.copyOf(key, 16);
secretKey = new SecretKeySpec(key, "AES");
}
catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
public static String encrypt(String strToEncrypt)
{
try
{
setKey(mykey);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
return Base64.getEncoder().encodeToString(cipher.doFinal(strToEncrypt.getBytes("UTF-8")));
}
catch (Exception e)
{
System.out.println("Error while encrypting: " + e.toString());
}
return null;
}
public static String decrypt(String strToDecrypt)
{
try
{
setKey(mykey);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
cipher.init(Cipher.DECRYPT_MODE, secretKey);
return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt)));
}
catch (Exception e)
{
System.out.println("Error while decrypting: " + e.toString());
}
return null;
}
public static void main(String[] args) throws Exception {
String plainText = "Hello World";
System.out.println("Original Text:" + plainText);
System.out.println("Encrypted Text :" + encrypt(plainText));
System.out.println("Descrypted Text:" + decrypt(encrypt(plainText)));
}
} | [
"PPMS@TA-RAVIKUMAR"
] | PPMS@TA-RAVIKUMAR |
bbd3d5b70db034784783f432433928bfc93946d7 | 7d77d015978a622787ced6e812ac989353e60450 | /library/common/src/main/java/com/jaydenxiao/common/base/BaseActivity.java | c3effef01d5976c2d01cf78e148eadedec8b8370 | [
"Apache-2.0"
] | permissive | jolewill/MvpZhihuNews | 9125446bc78c67cce3f18fe42398a491e30e13db | 3f755996b9bca717543d255c7b7dfc6cc20b3d23 | refs/heads/master | 2020-12-30T15:53:45.207580 | 2017-05-13T14:08:53 | 2017-05-13T14:08:53 | 91,176,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,176 | java | package com.jaydenxiao.common.base;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import com.jaydenxiao.common.BuildConfig;
import com.jaydenxiao.common.R;
import com.jaydenxiao.common.baseapp.AppManager;
import com.jaydenxiao.common.baserx.RxManager;
import com.jaydenxiao.common.commonutils.TUtil;
import com.jaydenxiao.common.commonutils.ToastUitl;
import com.jaydenxiao.common.commonwidget.LoadingDialog;
import com.jaydenxiao.common.commonwidget.StatusBarCompat;
import com.jaydenxiao.common.daynightmodeutils.ChangeModeController;
import butterknife.ButterKnife;
/**
* 基类
*/
/***************使用例子*********************/
//1.mvp模式
//public class SampleActivity extends BaseActivity<NewsChanelPresenter, NewsChannelModel>implements NewsChannelContract.View {
// @Override
// public int getLayoutId() {
// return R.layout.activity_news_channel;
// }
//
// @Override
// public void initPresenter() {
// mPresenter.setVM(this, mModel);
// }
//
// @Override
// public void initView() {
// }
//}
//2.普通模式
//public class SampleActivity extends BaseActivity {
// @Override
// public int getLayoutId() {
// return R.layout.activity_news_channel;
// }
//
// @Override
// public void initPresenter() {
// }
//
// @Override
// public void initView() {
// }
//}
public abstract class BaseActivity<T extends BasePresenter, E extends BaseModel> extends AppCompatActivity {
public T mPresenter;
public E mModel;
public Context mContext;
public RxManager mRxManager;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mRxManager = new RxManager();
doBeforeSetcontentView();
setContentView(getLayoutId());
ButterKnife.bind(this);
mContext = this;
mPresenter = TUtil.getT(this, 0);
mModel = TUtil.getT(this, 1);
if (mPresenter != null) {
mPresenter.mContext = this;
}
this.initPresenter();
this.initView();
}
/**
* 设置layout前配置
*/
private void doBeforeSetcontentView() {
//设置昼夜主题
initTheme();
// 把actvity放到application栈中管理
AppManager.getAppManager().addActivity(this);
// 无标题
requestWindowFeature(Window.FEATURE_NO_TITLE);
// 设置竖屏
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
// 默认着色状态栏
SetStatusBarColor();
}
/*********************子类实现*****************************/
//获取布局文件
public abstract int getLayoutId();
//简单页面无需mvp就不用管此方法即可,完美兼容各种实际场景的变通
public abstract void initPresenter();
//初始化view
public abstract void initView();
/**
* 设置主题
*/
private void initTheme() {
ChangeModeController.setTheme(this, R.style.DayTheme, R.style.NightTheme);
}
/**
* 着色状态栏(4.4以上系统有效)
*/
protected void SetStatusBarColor() {
StatusBarCompat.setStatusBarColor(this, ContextCompat.getColor(this, R.color.main_blue));
}
/**
* 着色状态栏(4.4以上系统有效)
*/
protected void SetStatusBarColor(int color) {
StatusBarCompat.setStatusBarColor(this, color);
}
/**
* 沉浸状态栏(4.4以上系统有效)
*/
protected void SetTranslanteBar() {
StatusBarCompat.translucentStatusBar(this);
}
/**
* 通过Class跳转界面
**/
public void startActivity(Class<?> cls) {
startActivity(cls, null);
}
/**
* 通过Class跳转界面
**/
public void startActivityForResult(Class<?> cls, int requestCode) {
startActivityForResult(cls, null, requestCode);
}
/**
* 含有Bundle通过Class跳转界面
**/
public void startActivityForResult(Class<?> cls, Bundle bundle,
int requestCode) {
Intent intent = new Intent();
intent.setClass(this, cls);
if (bundle != null) {
intent.putExtras(bundle);
}
startActivityForResult(intent, requestCode);
}
/**
* 含有Bundle通过Class跳转界面
**/
public void startActivity(Class<?> cls, Bundle bundle) {
Intent intent = new Intent();
intent.setClass(this, cls);
if (bundle != null) {
intent.putExtras(bundle);
}
startActivity(intent);
}
/**
* 开启浮动加载进度条
*/
public void startProgressDialog() {
LoadingDialog.showDialogForLoading(this);
}
/**
* 开启浮动加载进度条
*
* @param msg
*/
public void startProgressDialog(String msg) {
LoadingDialog.showDialogForLoading(this, msg, true);
}
/**
* 停止浮动加载进度条
*/
public void stopProgressDialog() {
LoadingDialog.cancelDialogForLoading();
}
/**
* 短暂显示Toast提示(来自String)
**/
public void showShortToast(String text) {
ToastUitl.showShort(text);
}
/**
* 短暂显示Toast提示(id)
**/
public void showShortToast(int resId) {
ToastUitl.showShort(resId);
}
/**
* 长时间显示Toast提示(来自res)
**/
public void showLongToast(int resId) {
ToastUitl.showLong(resId);
}
/**
* 长时间显示Toast提示(来自String)
**/
public void showLongToast(String text) {
ToastUitl.showLong(text);
}
/**
* 带图片的toast
*
* @param text
* @param res
*/
public void showToastWithImg(String text, int res) {
ToastUitl.showToastWithImg(text, res);
}
/**
* 网络访问错误提醒
*/
public void showNetErrorTip() {
ToastUitl.showToastWithImg(getText(R.string.net_error).toString(), R.drawable.ic_wifi_off);
}
public void showNetErrorTip(String error) {
ToastUitl.showToastWithImg(error, R.drawable.ic_wifi_off);
}
@Override
protected void onResume() {
super.onResume();
//debug版本不统计crash
if (!BuildConfig.LOG_DEBUG) {
//友盟统计
// MobclickAgent.onResume(this);
}
}
@Override
protected void onPause() {
super.onPause();
//debug版本不统计crash
if (!BuildConfig.LOG_DEBUG) {
//友盟统计
// MobclickAgent.onPause(this);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mPresenter != null)
mPresenter.onDestroy();
mRxManager.clear();
ButterKnife.unbind(this);
AppManager.getAppManager().finishActivity(this);
}
}
| [
"1106577075@qq.com"
] | 1106577075@qq.com |
0ff893ef968c6d5e600e4c7114f6353ddb5b8742 | a7e15cf3bffe5241992afd2c9a03f13f30d20ee8 | /src/main/java/com/Learning/JAVAPackage/LearnJava_1.java | 483c22649abb0af6d621004ac4f08e2ea2b7d20c | [] | no_license | QAFrameworks/LearningJavaStarter | 000a24ece3349185e70bdee788b1e6d46cc49eef | 18587f471da329392aa1661cdb6d367cbeac3213 | refs/heads/master | 2023-03-07T04:26:27.416314 | 2021-02-06T20:17:32 | 2021-02-06T20:17:32 | 336,529,258 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 652 | java | package com.Learning.JAVAPackage;
public class LearnJava_1 {
public int getX() { // getter setter
return x;
}
public void setX(int x) {
this.x = x;
}
int x= 4; // variable
public static void main(String args[]) { // execution starts from here
LearnJava_1 learnJava = new LearnJava_1(); // memory allocation at the time of creating object , learnJava is reference Variable
System.out.println(learnJava.x); //sout
learnJava.setX(5); //invoke setter method
System.out.println(learnJava.getX()); //invoke getter method and print it as well on console.
}
}
| [
"kunalmehta.km@gmail.com"
] | kunalmehta.km@gmail.com |
c09e32b1e9dfb7704056bc93d89124c159facac9 | be6b58c303fbf1bcabd2cc063ac760d5f91b748e | /test/de/stock/utils/UtilsTest.java | 84fa388a4d08276fd78846b11fffbffcad2c41b6 | [] | no_license | chlange/stock | 1bb7084411798eacdc7ef4a1fed635964ef111bd | eef2fd987ebba77d78b3dd975bce7c8771a5e22e | refs/heads/master | 2016-09-05T14:47:06.124686 | 2013-05-21T23:03:57 | 2013-05-21T23:03:57 | 5,319,739 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package de.stock.utils;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class UtilsTest {
@Test
public void testRandomDouble() {
assertEquals(new Double(0), Utils.random(0.0, 0.0));
assertEquals(new Double(1.0), Utils.random(1.0, 1.0));
assertEquals(new Double(0), Utils.random(1.0, 0.0), 1.0);
}
@Test
public void testRandomInt() {
assertEquals(new Integer(0), Utils.random(0, 0));
assertEquals(new Integer(1), Utils.random(1, 1));
assertEquals(new Integer(0), Utils.random(1, 0), 1);
}
}
| [
"chlange@htwg-konstanz.de"
] | chlange@htwg-konstanz.de |
8f38bf858598f40227e279192ec064a6ba796f42 | f377da2511519d130c0d1c0376e59998fdea02a4 | /src/game/generator/InitCase.java | 72c97c0c6aee5a5a603aaf4f6ab755289cae4b72 | [] | no_license | weiweijiaa/life_game | 601b553bcedbba6fc69dabe3e83df2de1cb2a6e6 | 4fb8b6285c80985ddfdb93ec7af8d8d47971b443 | refs/heads/master | 2022-11-13T22:06:24.214979 | 2020-07-09T16:55:23 | 2020-07-09T16:55:23 | 278,416,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,715 | java | package game.generator;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
public class InitCase {
public static final int FILE_NUM=10;
public static void main(String[] args) {
for (int i = 0; i < FILE_NUM; i++) {
createCaseFile();
System.out.println("成功生成一个case文件");
}
}
/**
* 创建测试案例
*/
private static void createCaseFile() {
Random random = new Random();
int rows = 1 + random.nextInt(100);
int cols = 1 + random.nextInt(100);
int duration = 200;
int num = 300;
File file = new File(cols+"_"+rows+"_"+System.nanoTime() + ".txt");
PrintWriter writer = null;
try {
writer = new PrintWriter(new FileWriter(file));
StringBuilder sb = new StringBuilder(cols + " " + rows + " " + duration + " " + num);
writer.write(sb.append("\n").toString());
//开始逐行初始化
for (int y = 0; y < rows; y++) {
sb = new StringBuilder();
for (int x = 0; x < cols; x++) {
if (random.nextInt(3) % 3 == 0) {
sb.append("1 ");
} else {
sb.append("0 ");
}
}
sb.deleteCharAt(sb.length()-1).append("\n");
writer.write(sb.toString());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (writer != null) {
writer.close();
}
}
}
} | [
"496377073@qq.com"
] | 496377073@qq.com |
4bf819e08f494dc5e0f723b2e3c5345254c2d7ee | 5dd8d7c191d4897a3628e5e5baba8344fbd06b2b | /robotium/src/androidTest/java/com/example/dandancao/robotium/MyApplicationTest.java | 8cf3144e90765a579a7159eb0a74884defb36b5e | [] | no_license | Damily2016/Robotium_Test | 801280a2828c16d9dceedf997b4d1a79437fc2fc | ebb368c542534508605d58f5ec1c7692d3e3673f | refs/heads/master | 2021-01-12T02:46:15.718279 | 2017-01-05T08:53:00 | 2017-01-05T08:53:00 | 78,094,441 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,776 | java | package com.example.dandancao.robotium;
import android.test.ActivityInstrumentationTestCase2;
import com.robotium.solo.Solo;
import org.junit.Before;
import org.junit.Test;
/**
* Created by Dandan.Cao on 2016/12/30.
*/
public class MyApplicationTest extends ActivityInstrumentationTestCase2<MainActivity> {
private static Solo solo=null;
boolean tag = false;
private static int run = 0;
private static final int NUMBER_TOTAL_CASES = 2;
public MyApplicationTest() {
super(MainActivity.class);
}
@Before
public void setUp() throws Exception {
super.setUp();
if (solo==null){
MyApplicationTest.solo = new Solo(getInstrumentation(), getActivity());}
}
@Test
public void testInputText() {
if (tag) {
for (int i = 0; i < 10; i++) { //循环执行1条用例
judgeText("This is EditTextActivity",1000);
solo.clearEditText(0); // 清空EditText表单 clearEditText(int index)
}
} else {
judgeText("This is EditTextActivity",1000);
}
}
@Test
public void testInputText2() {
judgeText("This is EditTextActivity2",1000);
}
private void judgeText( String text2, int time) {
solo.clickOnButton(getActivity().getString(R.string.btn_change));
assertTrue("test",solo.searchEditText(text2));//判定结果
solo.sleep(time);
}
public void tearDown() throws Exception {
//Check whether it's the last case executed.
run += countTestCases();
try {
if(run >= NUMBER_TOTAL_CASES) {
this.solo.finishOpenedActivities();}
} catch (Throwable e) {
e.printStackTrace();
}
}
}
| [
"389967719@qq.com"
] | 389967719@qq.com |
055098dc9b324506d55ffddf886c833479170528 | 661babc2a50b15a05aef7b8ff567ee676552bd1c | /src/main/java/com/raj/reactive/ReactiveDemo/bean/SearchResult.java | 7e973c5996f63f235019abdfb61a825ed79c83f6 | [] | no_license | PranavBrothers/reactive-demo | 341649bd9e7a4d7c83b8a625e5a303f6f0da15ba | f22f5ff84e87d2afc917eed21f0ba5d0bd346980 | refs/heads/main | 2023-04-18T07:19:23.658852 | 2021-04-30T03:03:56 | 2021-04-30T03:03:56 | 361,609,536 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 297 | java | package com.raj.reactive.ReactiveDemo.bean;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SearchResult {
private String airlineName;
private BigDecimal fare;
}
| [
"monishrajkumar@gmail.com"
] | monishrajkumar@gmail.com |
7cbfcfe03dc2e28859088568394e37c270043c15 | 523325b68dfc8fc343dc309e43dca6b218c0371d | /lib-android/info.cmptech.scanwrapper/src/main/java/info/cmptech/scanwrapper/DecodeHandler.java | fb9d62486fa2a56065eca9bb45508f3f1aa934ae | [] | no_license | SZU-BDI/app-hybrid-core | cd87d3feaf864ec701bb85c5391717e414ee85a0 | 4d1e5cda8bab7fc9f6983f447ced78710c5cfe0d | refs/heads/master | 2020-04-15T14:01:31.873552 | 2018-01-26T10:12:57 | 2018-01-26T10:12:57 | 58,211,106 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 3,488 | java | /*
* Copyright (C) 2010 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package info.cmptech.scanwrapper;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.DecodeHintType;
import com.google.zxing.MultiFormatReader;
//import com.google.zxing.PlanarYUVLuminanceSource;
import com.google.zxing.ReaderException;
import com.google.zxing.Result;
import com.google.zxing.common.HybridBinarizer;
import java.util.Hashtable;
class DecodeHandler extends Handler {
private static final String TAG = DecodeHandler.class.getSimpleName();
private final MipcaActivityCapture activity;
private final MultiFormatReader multiFormatReader;
DecodeHandler(MipcaActivityCapture activity, Hashtable<DecodeHintType, Object> hints) {
multiFormatReader = new MultiFormatReader();
multiFormatReader.setHints(hints);
this.activity = activity;
}
@Override
public void handleMessage(Message message) {
if (message.what == R.id.decode) {
decode((byte[]) message.obj, message.arg1, message.arg2);
} else if (message.what == R.id.quit) {
Looper.myLooper().quit();
}
}
private void decode(byte[] data, int width, int height) {
long start = System.currentTimeMillis();
Result rawResult = null;
//modify here
byte[] rotatedData = new byte[data.length];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++)
rotatedData[x * height + height - y - 1] = data[x + y * width];
}
int tmp = width; // Here we are swapping, that's the difference to #11
width = height;
height = tmp;
PlanarYUVLuminanceSource source = CameraManager.getShareInstance().buildLuminanceSource(rotatedData, width, height);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
try {
rawResult = multiFormatReader.decodeWithState(bitmap);
} catch (ReaderException re) {
// continue
} finally {
multiFormatReader.reset();
}
if (rawResult != null) {
long end = System.currentTimeMillis();
Log.d(TAG, "Found barcode (" + (end - start) + " ms):\n" + rawResult.toString());
Message message = Message.obtain(activity.getHandler(), R.id.decode_succeeded, rawResult);
Bundle bundle = new Bundle();
bundle.putParcelable(DecodeThread.BARCODE_BITMAP, source.renderCroppedGreyscaleBitmap());
message.setData(bundle);
//Log.d(TAG, "Sending decode succeeded message...");
message.sendToTarget();
} else {
Message message = Message.obtain(activity.getHandler(), R.id.decode_failed);
message.sendToTarget();
}
}
}
| [
"wanjochan@gmail.com"
] | wanjochan@gmail.com |
0d74284ae5a864910fef5c84c675d454c9916b04 | 5c18b96d8d02aa95c00526e726d74179daab5ef1 | /src/java/Composant/dropDownnList.java | 897ae9d4c6afc2198811ee57f23b445ad251d53a | [] | no_license | jakubowicz/lixian_reponsive | 911c87eaf91395411b081fe28cbd9a4f7d13b906 | 0c1e69b6d7b4e20895cd66b38e5e47693e21ffdb | refs/heads/master | 2023-01-21T10:54:31.620429 | 2020-12-01T14:13:35 | 2020-12-01T14:13:35 | 315,715,010 | 0 | 0 | null | 2020-11-30T16:01:14 | 2020-11-24T18:08:39 | Java | UTF-8 | Java | false | false | 1,122 | 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 Composant;
import accesbase.Connexion;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Vector;
/**
*
* @author Joël
*/
public class dropDownnList {
private String req="";
private ResultSet rs=null;
public Vector ListeItem = new Vector(30);
public void buildListeTypeModule(String nomBase,Connexion myCnx, Statement st){
req= "SELECT id, nom, description FROM TypeModule ORDER BY ordre";
this.buildListeItem( nomBase, myCnx, st, req);
}
public void buildListeItem(String nomBase,Connexion myCnx, Statement st, String req){
rs = myCnx.ExecReq(st, myCnx.nomBase, req);
try {
while (rs.next()) {
item theItem = new item();
theItem.id = rs.getInt(1);
theItem.nom = rs.getString(2);
this.ListeItem.addElement(theItem);
}
}
catch (Exception e) {}
}
}
| [
"joel_jakubowicz@hotmail.fr"
] | joel_jakubowicz@hotmail.fr |
7d6da95abeed1c802e9e7dbd1243b0009924326e | 07d8035be107669b512d0a884a438a3f2e89ca76 | /final-data/final-data-core/src/main/java/org/ifinal/finalframework/data/query/condition/CompareCondition.java | 388530df15c07ed9c656435672f13a0748abfa68 | [
"Apache-2.0"
] | permissive | liniukesi/final-frameworks | 71f239e3708ebf05e02ac0e376a1c70a3a73b906 | 22a6d45ecab565403f691b36de9e02cbffff5bcb | refs/heads/master | 2023-02-19T02:17:53.532617 | 2021-01-15T13:37:02 | 2021-01-15T13:37:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 573 | java | package org.ifinal.finalframework.data.query.condition;
import org.springframework.lang.NonNull;
/**
* @author likly
* @version 1.0.0
* @since 1.0.0
*/
@SuppressWarnings("unused")
public interface CompareCondition<V, R> extends Condition {
R eq(@NonNull V value);
R neq(@NonNull V value);
R gt(@NonNull V value);
R gte(@NonNull V value);
R lt(@NonNull V value);
R lte(@NonNull V value);
default R before(@NonNull V value) {
return lt(value);
}
default R after(@NonNull V value) {
return gt(value);
}
}
| [
"likly@ilikly.com"
] | likly@ilikly.com |
0b91789d9e9e2df57b37d7e6360ab19d6ec26156 | a3f3a2229f3484949f0ba1b490c19b5571c44240 | /src/test/java/mendiandingdanModelTest/tuihuorukuTest.java | 51422e92b726d109b3cea518cb129551d30df2ec | [] | no_license | jiangtechao/WebDriverq | f04c5439fd5c2e7ce4d35050aeac7886cd02f42f | abd243148f2cb3664fd314b986937e2247f04583 | refs/heads/master | 2020-03-28T10:33:42.196027 | 2018-10-15T07:43:44 | 2018-10-15T07:43:44 | 148,120,308 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,273 | java | package mendiandingdanModelTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import publicMode.logins;
public class tuihuorukuTest {
WebDriver driver = new FirefoxDriver();
@Test
public void kehuliebiaoo() throws InterruptedException {
String username = "haikou";
String password = "!2ikKxvrAh";
logins.login(driver, username, password);
Thread.sleep(5000);
driver.findElement(By.xpath(".//*[@id='oneLevel_0']/span")).click();
driver.findElement(By.xpath(".//*[@id='sub_one_0']/li[3]/a/span")).click();
driver.findElement(By.linkText("退货入库")).click();
Thread.sleep(4000);
String title = driver.getTitle();
Assert.assertEquals("隔壁仓库 V1.1.5 - 退货入库",title);
}
@BeforeTest
public void beforeTest() {
String Url = "http://test-manage.depotnextdoor.com:7070/login";
driver.get(Url);
driver.manage().window().maximize();
}
@AfterTest
public void afterTest() {
driver.quit();
}
}
| [
"18217771547@163.com"
] | 18217771547@163.com |
481cfc49e6952bd5850d447709094ed862f149d3 | 573a66e4f4753cc0f145de8d60340b4dd6206607 | /JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/357876/2014.07.18/cgeo-market_20140718/cgeo-market_20140718/main/src/cgeo/geocaching/settings/RegisterSend2CgeoPreference.java | cc2de9f2c922a370ab5d62aeb218ba399a447817 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | mkaouer/Code-Smells-Detection-in-JavaScript | 3919ec0d445637a7f7c5f570c724082d42248e1b | 7130351703e19347884f95ce6d6ab1fb4f5cfbff | refs/heads/master | 2023-03-09T18:04:26.971934 | 2022-03-23T22:04:28 | 2022-03-23T22:04:28 | 73,915,037 | 8 | 3 | null | 2023-02-28T23:00:07 | 2016-11-16T11:47:44 | null | UTF-8 | Java | false | false | 4,125 | java | package cgeo.geocaching.settings;
import cgeo.geocaching.R;
import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.network.Network;
import cgeo.geocaching.network.Parameters;
import cgeo.geocaching.ui.dialog.Dialogs;
import cgeo.geocaching.utils.Log;
import ch.boye.httpclientandroidlib.HttpResponse;
import org.apache.commons.lang3.StringUtils;
import rx.Observable;
import rx.android.observables.AndroidObservable;
import rx.functions.Action1;
import rx.functions.Func0;
import rx.schedulers.Schedulers;
import android.app.ProgressDialog;
import android.content.Context;
import android.preference.Preference;
import android.util.AttributeSet;
public class RegisterSend2CgeoPreference extends AbstractClickablePreference {
public RegisterSend2CgeoPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public RegisterSend2CgeoPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected OnPreferenceClickListener getOnPreferenceClickListener(final SettingsActivity activity) {
return new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
// satisfy static code analysis
if (activity == null) {
return true;
}
final String deviceName = Settings.getWebDeviceName();
final String deviceCode = Settings.getWebDeviceCode();
if (StringUtils.isBlank(deviceName)) {
ActivityMixin.showToast(activity, R.string.err_missing_device_name);
return false;
}
final ProgressDialog progressDialog = ProgressDialog.show(activity,
activity.getString(R.string.init_sendToCgeo),
activity.getString(R.string.init_sendToCgeo_registering), true);
progressDialog.setCancelable(false);
AndroidObservable.bindActivity(activity, Observable.defer(new Func0<Observable<Integer>>() {
@Override
public Observable<Integer> call() {
final String nam = StringUtils.defaultString(deviceName);
final String cod = StringUtils.defaultString(deviceCode);
final Parameters params = new Parameters("name", nam, "code", cod);
HttpResponse response = Network.getRequest("http://send2.cgeo.org/auth.html", params);
if (response != null && response.getStatusLine().getStatusCode() == 200) {
//response was OK
final String[] strings = StringUtils.split(Network.getResponseData(response), ',');
Settings.setWebNameCode(nam, strings[0]);
try {
return Observable.from(Integer.parseInt(strings[1].trim()));
} catch (final Exception e) {
Log.e("RegisterSend2CgeoPreference", e);
}
}
return Observable.empty();
}
}).firstOrDefault(0)).subscribe(new Action1<Integer>() {
@Override
public void call(final Integer pin) {
progressDialog.dismiss();
if (pin > 0) {
Dialogs.message(activity, R.string.init_sendToCgeo,
activity.getString(R.string.init_sendToCgeo_register_ok)
.replace("####", String.valueOf(pin)));
} else {
Dialogs.message(activity, R.string.init_sendToCgeo, R.string.init_sendToCgeo_register_fail);
}
}
}, Schedulers.io());
return true;
}
};
}
}
| [
"mmkaouer@umich.edu"
] | mmkaouer@umich.edu |
c39dc1343c8774e404b3c1693a3e937742b137ce | 082e26b011e30dc62a62fae95f375e4f87d9e99c | /docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/tencent/soter/p663a/p1108f/C30958e.java | f6104b0caa0ba7088075b4dff5425dfca52a82a2 | [] | no_license | xsren/AndroidReverseNotes | 9631a5aabc031006e795a112b7ac756a8edd4385 | 9202c276fe9f04a978e4e08b08e42645d97ca94b | refs/heads/master | 2021-04-07T22:50:51.072197 | 2019-07-16T02:24:43 | 2019-07-16T02:24:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package com.tencent.soter.p663a.p1108f;
/* renamed from: com.tencent.soter.a.f.e */
public interface C30958e extends C44468a<C16168a, C30959b> {
/* renamed from: com.tencent.soter.a.f.e$a */
public static class C16168a {
public String AvZ;
public String Awa;
public C16168a(String str, String str2) {
this.Awa = str;
this.AvZ = str2;
}
}
/* renamed from: com.tencent.soter.a.f.e$b */
public static class C30959b {
public boolean Awb;
public C30959b(boolean z) {
this.Awb = z;
}
}
}
| [
"alwangsisi@163.com"
] | alwangsisi@163.com |
ac577dd07550a45b540195dcf9d7a9a24a0ed1fe | ebb4a89fb46f548e4d23a1f60a6a610dbe2c1aa2 | /dao-jaxb/src/test/java/org/tristan/parking/dao/jaxbimpl/test/EntityDAOJaxbImplTest.java | 7ccceb745ac9151f25d5808e261e3c09bff54fea | [
"Apache-2.0"
] | permissive | 10tliu/ticketmachine | 2709ff14efe494dd71a960467d96fab79dd38352 | a1f1dd5b02b52044399d6dc841fce8de6dd22eaf | refs/heads/master | 2020-04-16T15:45:23.711715 | 2019-01-14T20:11:47 | 2019-01-14T20:11:47 | 165,712,756 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,480 | 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 org.tristan.parking.dao.jaxbimpl.test;
import java.io.File;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tristan.parking.dao.jaxbimpl.EntityDAOJaxbImpl;
import org.tristan.parking.model.Entity;
import org.tristan.parking.model.EntityDAO;
import org.tristan.parking.model.TicketMachine;
/**
* tests for entityDao.createEntity(entity) entityDao.deleteEntity(Id) entityDao.retrieveAllEntities() entityDao.retrieveEntity(Id)
* entityDao.retrieveMatchingEntites(entityTempate) entityDao.updateEntity(entity)
*
* @author cgallen
*/
public class EntityDAOJaxbImplTest {
private static final Logger LOG = LoggerFactory.getLogger(EntityDAOJaxbImplTest.class);
public final String TEST_DATA_FILE_LOCATION = "target/testDaofile.xml";
@Test
public void testDestinationsDAOJaxb() {
// delete test file at start of test
File file = new File(TEST_DATA_FILE_LOCATION);
file.delete();
assertFalse(file.exists());
// create dao
EntityDAO entityDao = new EntityDAOJaxbImpl(TEST_DATA_FILE_LOCATION);
//TicketMachine entityDao = new EntityDAOJaxbImpl(TEST_DATA_FILE_LOCATION);
// check that new file created
assertTrue(file.exists());
// check there are no entities
assertTrue(entityDao.retrieveAllEntities().isEmpty());
// add a 3 entities
int ENTITY_NUMBER = 4;
for (int intityId = 0; intityId < ENTITY_NUMBER; intityId++) {
Entity entity = new Entity();
entity.setField_A("field_A_" + intityId);
entity.setField_B("field_B_" + intityId);;
entity.setField_C("field_C_" + intityId);;
LOG.debug("adding entity:" + entity);
Entity e = entityDao.createEntity(entity);
assertNotNull(e);
}
// check 3 entities added
assertTrue(ENTITY_NUMBER == entityDao.retrieveAllEntities().size());
// check return false for delete unknown entity
assertFalse(entityDao.deleteEntity(Integer.SIZE));
// find an entity to delete
List<Entity> elist = entityDao.retrieveAllEntities();
Integer idToDelete = elist.get(1).getId();
LOG.debug("deleting entity:" + idToDelete);
// check found and deleted
assertTrue(entityDao.deleteEntity(idToDelete));
// check no longer found after deletion
assertNull(entityDao.retrieveEntity(idToDelete));
// check entities size decremeted
List<Entity> elist2 = entityDao.retrieveAllEntities();
assertTrue(ENTITY_NUMBER - 1 == elist2.size());
// update entity
Entity entityToUpdate = elist2.get(1);
LOG.debug("updating entity: " + entityToUpdate);
// add 3 newProperties for entity
entityToUpdate.setField_A("field_A_Update");
entityToUpdate.setField_B("field_B_Update");
entityToUpdate.setField_C(null); // do not update field C
LOG.debug("update template: " + entityToUpdate);
Entity updatedEntity = entityDao.updateEntity(entityToUpdate);
LOG.debug("updated entity: " + updatedEntity);
assertNotNull(updatedEntity);
// check entity updated
Entity retrievedEntity = entityDao.retrieveEntity(updatedEntity.getId());
LOG.debug("retreived entity: " + retrievedEntity);
assertEquals(entityToUpdate.getField_A(), retrievedEntity.getField_A());
assertEquals(entityToUpdate.getField_A(), retrievedEntity.getField_A());
assertNotEquals(entityToUpdate.getField_C(), retrievedEntity.getField_C());
// test retrieve matching entities
List<Entity> entityList = entityDao.retrieveAllEntities();
Entity searchfor = entityList.get(2);
LOG.debug("searching for: " + searchfor);
Entity template = new Entity();
template.setField_B(searchfor.getField_B());
LOG.debug("using template : " + template);
List<Entity> retrievedList = entityDao.retrieveMatchingEntities(template);
assertEquals(1, retrievedList.size());
LOG.debug("found : " + retrievedList.get(0));
assertEquals(searchfor, retrievedList.get(0));
}
}
| [
"3liut48@solent.ac.uk"
] | 3liut48@solent.ac.uk |
b00b6eae9dfa4aebaa92c64d36a7cbff83363b5c | 3b9cf2936abe0bb4d5507853a79d98f2d91af870 | /vividus/src/test/java/org/vividus/bdd/steps/FileStepsTests.java | 8559a8477c6f2546b0bc8fb4d99dac43b0b50b6e | [
"Apache-2.0"
] | permissive | ALegchilov/vividus | ef8a4906efb0c2ff68fd624fde4d2e6d743bae9b | 55bce7d2a7bcf5c43f17d34eb2c190dd6142f552 | refs/heads/master | 2020-09-08T16:50:21.014816 | 2019-11-12T10:40:45 | 2019-11-15T10:10:52 | 221,188,634 | 0 | 0 | Apache-2.0 | 2019-11-12T10:15:40 | 2019-11-12T10:15:39 | null | UTF-8 | Java | false | false | 2,146 | java | /*
* Copyright 2019 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.vividus.bdd.steps;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.vividus.bdd.context.IBddVariableContext;
import org.vividus.bdd.variable.VariableScope;
@ExtendWith(MockitoExtension.class)
class FileStepsTests
{
@Mock
private IBddVariableContext bddVariableContext;
@InjectMocks
private FileSteps fileSteps;
@Test
void testSaveResponseBodyToFile() throws IOException
{
String content = "content";
String pathVariable = "path";
Set<VariableScope> scopes = Set.of(VariableScope.SCENARIO);
fileSteps.saveResponseBodyToFile("test.txt", content, scopes, pathVariable);
verify(bddVariableContext).putVariable(eq(scopes), eq(pathVariable), argThat(path ->
{
try
{
return FileUtils.readFileToString(new File((String) path), StandardCharsets.UTF_8).equals(content);
}
catch (IOException e)
{
throw new UncheckedIOException(e);
}
}));
}
}
| [
"valfirst@yandex.ru"
] | valfirst@yandex.ru |
dbcbda183f774d1101f7720cdca92619a0be7f9b | 2180002d4b35248ee20d5f712a69f65d2299ff5e | /Tanya/src/Simple.java | 66866ddcc18319a9d3598ebab805307f48465e9c | [] | no_license | Tannya1309/selenium | 6c44ac35105e711408ab2aba2d3a5d6d74f3b830 | d69080c8a796742821196ad25066740f8f6f7d8c | refs/heads/master | 2022-11-16T16:06:50.842336 | 2020-07-04T18:33:16 | 2020-07-04T18:33:16 | 277,162,236 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 106 | java |
public class Simple {
public static void main(String[] args) {
Test s1= new Test(111, "karan");
}
} | [
"Tanya@192.168.1.3"
] | Tanya@192.168.1.3 |
b39b7d724547518465d3f879efb2a6377602be90 | b49626124678d79ba23ed48c52a0a4237394753d | /src/main/java/com/cominvi/app/oauth/services/IEmpleadosPerfilesService.java | c02713c879870c4689c53eaa2529b7e40ca5693b | [] | no_license | saul-granados/servicio-general | 5178e8ce88b7afb207dc2fd1ff46d1c807b72ba5 | 66f18a30ba537f8a8f2cb405864e3e574f265257 | refs/heads/main | 2023-06-12T03:52:25.828550 | 2021-06-23T13:27:28 | 2021-06-23T13:27:28 | 379,611,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package com.cominvi.app.oauth.services;
import java.util.List;
import com.cominvi.app.commons.general.EmpleadosPerfiles;
public interface IEmpleadosPerfilesService {
List<EmpleadosPerfiles> findAll();
EmpleadosPerfiles findById(Long idempleado, Long idperfil);
EmpleadosPerfiles save(EmpleadosPerfiles empleadosperfile);
Boolean saveAll(List<EmpleadosPerfiles> empleadosperfiles);
EmpleadosPerfiles update(EmpleadosPerfiles empleadosperfile, Long idempleado, Long idperfil);
Boolean removeById(Long idempleado, Long idperfil);
}
| [
"rocha.sgl@gmail.com"
] | rocha.sgl@gmail.com |
f3c32e155a9bb312256d55f06024bf38858cf6ef | 047cca08319a33f3d3f1d6d51a63644fd02cfce5 | /tillerinobot/src/main/java/tillerino/tillerinobot/predicates/StarDiff.java | 7a94409ac90f2e5525bd1ef7c1d981d35150b358 | [] | no_license | leusonmario/Tillerinobot | 9a99da6285c6cbfcfbbdffebcebf4872e1a9af3e | dfc13c160d0aca6fdb9c4da579e7815530e55ea8 | refs/heads/master | 2021-09-21T03:23:31.064935 | 2018-03-15T18:46:15 | 2018-03-15T18:46:15 | 109,865,367 | 0 | 0 | null | 2017-11-07T16:59:45 | 2017-11-07T16:59:45 | null | UTF-8 | Java | false | false | 369 | java | package tillerino.tillerinobot.predicates;
import org.tillerino.osuApiModel.OsuApiBeatmap;
public class StarDiff implements NumericBeatmapProperty {
@Override
public String getName() {
return "STAR";
}
@Override
public double getValue(OsuApiBeatmap beatmap, long mods) {
return beatmap.getStarDifficulty();
}
}
| [
"omkelderman@gmail.com"
] | omkelderman@gmail.com |
35dbc3cfb51a1e4b9b9d82bae60e30261d2cc377 | 87059cd742e9ebe982c74ff71db81bff01f0925c | /src/main/java/com/my/restfulapi/common/util/log4j2/LogData.java | e42385b962c3122c5428e6a68e91e6e10b4c9079 | [] | no_license | wgy22316/my_restfulapi | e6f753dd57b29a069ebc50bbb0375ff99e7f0aeb | 3c5a08f62a75da96b8e8081499247b6c541781d1 | refs/heads/master | 2021-11-28T09:56:55.356621 | 2021-11-16T07:17:01 | 2021-11-16T07:17:01 | 154,527,300 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | package com.my.restfulapi.common.util.log4j2;
import lombok.Data;
import java.util.List;
@Data
public class LogData {
/**
* 调用结果
*/
private Object result;
/**
* 服务器执行耗时
*/
private long elapsedMilliseconds;
/**
* 调用方完整信息
*/
private String invocation;
/**
* Rest服务参数校验失败的错误信息
*/
private List<String> paramCheckErrors;
/**
* 服务调用发生异常时,完整的异常信息
*/
private String errorStack;
/**
* Rest服务的请求url
*/
private String restUrl;
/**
* 调用方的IP
*/
private String remoteIp;
/**
* 主机IP
*/
private String hostIp;
/**
* 链路Id
*/
private String traceId;
}
| [
"wu.gongyao@mwee.cn"
] | wu.gongyao@mwee.cn |
06b16a59fbb848e58a96e52eda59804d97fd3902 | f9c269be41fc8a3db6faf897ed486906ac628965 | /src/main/java/ng/com/gness/cardschemeconsumer/CardschemeConsumerApplication.java | 28e59ca62a4fc78def366319ccbb214987facc26 | [] | no_license | gness007/card-scheme-consumer | 08fb6b06abd30b102304ca222afbe73f03e94cba | 74272b8253ef3ab8c963724bd66e4923d04cdd8d | refs/heads/master | 2022-11-04T22:27:58.986486 | 2020-06-24T16:13:45 | 2020-06-24T16:13:45 | 274,708,887 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,298 | java | package ng.com.gness.cardschemeconsumer;
import ng.com.gness.cardschemeconsumer.model.Card;
import ng.com.gness.cardschemeconsumer.pojo.CardDTO;
import ng.com.gness.cardschemeconsumer.services.CardService;
import org.h2.tools.Server;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.converter.RecordMessageConverter;
import org.springframework.kafka.support.converter.StringJsonMessageConverter;
import java.sql.SQLException;
@SpringBootApplication
public class CardschemeConsumerApplication {
private final Logger logger = LoggerFactory.getLogger(CardschemeConsumerApplication.class);
private final TaskExecutor exec = new SimpleAsyncTaskExecutor();
@Autowired
private CardService cardService;
public static void main(String[] args) {
SpringApplication.run(CardschemeConsumerApplication.class, args).close();
}
@Bean
public RecordMessageConverter converter() {
return new StringJsonMessageConverter();
}
@KafkaListener(id = "fooGroup", topics = "com.ng.vela.even.card_verified")
public void listen(CardDTO cardDTO) {
logger.info("Received: " + cardDTO);
Card card = new Card(cardDTO);
cardService.save(card);
this.exec.execute(() -> System.out.println("Hit Enter to terminate..."));
}
@Bean
public ApplicationRunner runner() {
return args -> {
System.out.println("Hit Enter to terminate...");
System.in.read();
};
}
//a Spring bean for an in-memory H2 database — and expose it via a TCP port
@Bean(initMethod = "start", destroyMethod = "stop")
public Server inMemoryH2DatabaseaServer() throws SQLException {
return Server.createTcpServer(
"-tcp", "-tcpAllowOthers", "-tcpPort", "9090");
}
} | [
"gohilebo@gmail.com"
] | gohilebo@gmail.com |
1d4e32b6ec6c6b087417e25175c068cf85c8acdf | 409b7b11774a090607d742ae51e55ff2914963b5 | /src/main/java/com/spark/interfaces/InputStreamReader.java | d0845a005f811b5e86ac495b66eb04e2076da39d | [
"MIT"
] | permissive | cbartram/spark | c624d7fb514ca9e75280ea724088264d542711cb | 7ef3cb508f532fe8ccd013cfc05606a8c6fa94f4 | refs/heads/master | 2021-05-12T20:09:50.444622 | 2020-09-08T13:52:45 | 2020-09-08T13:52:45 | 117,114,440 | 3 | 0 | null | 2018-01-11T14:54:48 | 2018-01-11T14:54:47 | null | UTF-8 | Java | false | false | 544 | java | package com.spark.interfaces;
import java.io.InputStream;
import java.net.URL;
/**
* InputStreamReader - This interface should be implemented by any class who opens a URL connection and reads an input stream
* of any kind. The generic type T should indicate the type of data being read from the input stream. If the data being read
* is a JAR file type T may be a ClassNode[], if the data is text T may be a POJO or String[] etc...
* @param <T>
*/
public interface InputStreamReader<T> {
T read();
InputStream open(final URL url);
} | [
"cbartram3@gmail.com"
] | cbartram3@gmail.com |
5f379bf2b2094547dc71926246b3e4b05e369a14 | 0c6e0ac2b21ad94b3a3de0e0f9cd57483c7b4e16 | /src/main/java/com/ldb/pojo/PageBean.java | 81f226099d4c42f21ee76ea6604c676c8f439b38 | [] | no_license | dddddb/CS | 895041eb13747018e11f42e3785d581a2f129bf4 | f43f60b6878ff11d196ff7eeee8c4c93c7feb7c9 | refs/heads/master | 2023-05-08T22:53:15.779188 | 2021-05-27T10:12:01 | 2021-05-27T10:12:01 | 371,266,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package com.ldb.pojo;
import lombok.Data;
import java.util.List;
@Data
public class PageBean<T> {
private int totalCount;//总记录数
private int totalPage;//总页数
private int currentPage;//当前页码
private int pageSize;//每页显示的条数
private List<T> list;//每页显示的数据集合
}
| [
"1263335061@qq.com"
] | 1263335061@qq.com |
63e9f185946fe58eb5d35e3de5494e09e30c8712 | 2b63502a88956a9d278aa21db7132b61136f7633 | /mongo-plan-checker-reactivestreams/src/main/java/com/github/isopov/mongoplanchecker/reactivestreams/PlanCheckerMongoCollection.java | be31f68c19eea2f4795f76b9abc97d2c0556ddaf | [
"MIT"
] | permissive | isopov/mongo-plan-checker | 5d2e7b706ca7d0cc37646fc7a1a5a05d40a32a0b | ec87324ccecf112436c0442dee5011adc030e5a0 | refs/heads/master | 2020-06-06T01:18:19.605202 | 2019-10-22T07:38:42 | 2019-10-22T07:38:42 | 192,598,775 | 0 | 0 | MIT | 2019-08-30T14:32:31 | 2019-06-18T19:14:13 | Java | UTF-8 | Java | false | false | 26,918 | java | package com.github.isopov.mongoplanchecker.reactivestreams;
import static com.github.isopov.mongoplanchecker.core.PlanChecker.explainModifier;
import com.github.isopov.mongoplanchecker.core.Nullable;
import com.github.isopov.mongoplanchecker.core.PlanChecker;
import com.mongodb.MongoNamespace;
import com.mongodb.ReadConcern;
import com.mongodb.ReadPreference;
import com.mongodb.WriteConcern;
import com.mongodb.bulk.BulkWriteResult;
import com.mongodb.client.model.*;
import com.mongodb.client.result.DeleteResult;
import com.mongodb.client.result.UpdateResult;
import com.mongodb.reactivestreams.client.*;
import java.util.List;
import java.util.function.Supplier;
import org.bson.Document;
import org.bson.codecs.configuration.CodecRegistry;
import org.bson.conversions.Bson;
import org.reactivestreams.Publisher;
public class PlanCheckerMongoCollection<TDocument> implements MongoCollection<TDocument> {
private final MongoCollection<TDocument> c;
private final PlanChecker checker;
public PlanCheckerMongoCollection(MongoCollection<TDocument> c, PlanChecker checker) {
this.c = c;
this.checker = checker;
}
@Override
public MongoNamespace getNamespace() {
return c.getNamespace();
}
@Override
public Class<TDocument> getDocumentClass() {
return c.getDocumentClass();
}
@Override
public CodecRegistry getCodecRegistry() {
return c.getCodecRegistry();
}
@Override
public ReadPreference getReadPreference() {
return c.getReadPreference();
}
@Override
public WriteConcern getWriteConcern() {
return c.getWriteConcern();
}
@Override
public ReadConcern getReadConcern() {
return c.getReadConcern();
}
@Override
public <NewTDocument> MongoCollection<NewTDocument> withDocumentClass(Class<NewTDocument> clazz) {
return new PlanCheckerMongoCollection<>(c.withDocumentClass(clazz), checker);
}
@Override
public MongoCollection<TDocument> withCodecRegistry(CodecRegistry codecRegistry) {
return new PlanCheckerMongoCollection<>(c.withCodecRegistry(codecRegistry), checker);
}
@Override
public MongoCollection<TDocument> withReadPreference(ReadPreference readPreference) {
return new PlanCheckerMongoCollection<>(c.withReadPreference(readPreference), checker);
}
@Override
public MongoCollection<TDocument> withWriteConcern(WriteConcern writeConcern) {
return new PlanCheckerMongoCollection<>(c.withWriteConcern(writeConcern), checker);
}
@Override
public MongoCollection<TDocument> withReadConcern(ReadConcern readConcern) {
return new PlanCheckerMongoCollection<>(c.withReadConcern(readConcern), checker);
}
@Override
@SuppressWarnings("deprecation")
public Publisher<Long> count() {
return c.count();
}
private <T> Publisher<T> check(Bson filter, Supplier<Publisher<T>> realPublisher) {
return check(filter, null, null, realPublisher);
}
private <T> Publisher<T> check(
Bson filter, Collation collation, Supplier<Publisher<T>> realPublisher) {
return check(filter, null, collation, realPublisher);
}
@SuppressWarnings("deprecation")
private <T> Publisher<T> check(
Bson filter,
@Nullable Bson hint,
@Nullable Collation collation,
Supplier<Publisher<T>> realPublisher) {
if (filter.toBsonDocument(Document.class, getCodecRegistry()).isEmpty()) {
return realPublisher.get();
}
return mainSubscriber ->
c.find(filter)
.hint(hint)
.collation(collation)
.modifiers(explainModifier())
.first()
.subscribe(
new PlanCheckingSubscriber<>(
mainSubscriber, checker, () -> realPublisher.get().subscribe(mainSubscriber)));
}
private <T> Publisher<T> check(
ClientSession clientSession, Bson filter, Supplier<Publisher<T>> realPublisher) {
return check(clientSession, filter, null, null, realPublisher);
}
private <T> Publisher<T> check(
ClientSession clientSession,
Bson filter,
Collation collation,
Supplier<Publisher<T>> realPublisher) {
return check(clientSession, filter, null, collation, realPublisher);
}
@SuppressWarnings("deprecation")
private <T> Publisher<T> check(
ClientSession clientSession,
Bson filter,
@Nullable Bson hint,
@Nullable Collation collation,
Supplier<Publisher<T>> realPublisher) {
if (filter.toBsonDocument(Document.class, getCodecRegistry()).isEmpty()) {
return realPublisher.get();
}
return mainSubscriber ->
c.find(clientSession, filter)
.hint(hint)
.collation(collation)
.modifiers(explainModifier())
.first()
.subscribe(
new PlanCheckingSubscriber<>(
mainSubscriber, checker, () -> realPublisher.get().subscribe(mainSubscriber)));
}
@Override
@SuppressWarnings("deprecation")
public Publisher<Long> count(Bson filter) {
return check(filter, () -> c.count(filter));
}
@Override
@SuppressWarnings("deprecation")
public Publisher<Long> count(Bson filter, CountOptions options) {
return check(filter, options.getHint(), options.getCollation(), () -> c.count(filter, options));
}
@Override
@SuppressWarnings("deprecation")
public Publisher<Long> count(ClientSession clientSession) {
return c.count(clientSession);
}
@Override
@SuppressWarnings("deprecation")
public Publisher<Long> count(ClientSession clientSession, Bson filter) {
return check(clientSession, filter, () -> c.count(clientSession, filter));
}
@Override
@SuppressWarnings("deprecation")
public Publisher<Long> count(ClientSession clientSession, Bson filter, CountOptions options) {
return check(
clientSession,
filter,
options.getHint(),
options.getCollation(),
() -> c.count(clientSession, filter, options));
}
@Override
public Publisher<Long> estimatedDocumentCount() {
return c.estimatedDocumentCount();
}
@Override
public Publisher<Long> estimatedDocumentCount(EstimatedDocumentCountOptions options) {
return c.estimatedDocumentCount(options);
}
@Override
public Publisher<Long> countDocuments() {
return c.countDocuments();
}
@Override
public Publisher<Long> countDocuments(Bson filter) {
return check(filter, () -> c.countDocuments(filter));
}
@Override
public Publisher<Long> countDocuments(Bson filter, CountOptions options) {
return check(
filter, options.getHint(), options.getCollation(), () -> c.countDocuments(filter, options));
}
@Override
public Publisher<Long> countDocuments(ClientSession clientSession) {
return c.countDocuments(clientSession);
}
@Override
public Publisher<Long> countDocuments(ClientSession clientSession, Bson filter) {
return check(clientSession, filter, () -> c.countDocuments(clientSession, filter));
}
@Override
public Publisher<Long> countDocuments(
ClientSession clientSession, Bson filter, CountOptions options) {
return check(
clientSession,
filter,
options.getHint(),
options.getCollation(),
() -> c.countDocuments(clientSession, filter, options));
}
@Override
public <TResult> DistinctPublisher<TResult> distinct(
String fieldName, Class<TResult> tResultClass) {
return c.distinct(fieldName, tResultClass);
}
@Override
public <TResult> DistinctPublisher<TResult> distinct(
String fieldName, Bson filter, Class<TResult> tResultClass) {
return c.distinct(fieldName, filter, tResultClass);
}
@Override
public <TResult> DistinctPublisher<TResult> distinct(
ClientSession clientSession, String fieldName, Class<TResult> tResultClass) {
return c.distinct(clientSession, fieldName, tResultClass);
}
@Override
public <TResult> DistinctPublisher<TResult> distinct(
ClientSession clientSession, String fieldName, Bson filter, Class<TResult> tResultClass) {
return c.distinct(clientSession, fieldName, filter, tResultClass);
}
@Override
public FindPublisher<TDocument> find() {
return new PlanCheckerFindPublisher<>(c.find(), checker);
}
@Override
public <TResult> PlanCheckerFindPublisher<TResult> find(Class<TResult> clazz) {
return new PlanCheckerFindPublisher<>(c.find(clazz), checker);
}
@Override
public PlanCheckerFindPublisher<TDocument> find(Bson filter) {
return new PlanCheckerFindPublisher<>(c.find(filter), checker);
}
@Override
public <TResult> PlanCheckerFindPublisher<TResult> find(Bson filter, Class<TResult> clazz) {
return new PlanCheckerFindPublisher<>(c.find(filter, clazz), checker);
}
@Override
public PlanCheckerFindPublisher<TDocument> find(ClientSession clientSession) {
return new PlanCheckerFindPublisher<>(c.find(clientSession), checker);
}
@Override
public <TResult> PlanCheckerFindPublisher<TResult> find(
ClientSession clientSession, Class<TResult> clazz) {
return new PlanCheckerFindPublisher<>(c.find(clientSession, clazz), checker);
}
@Override
public PlanCheckerFindPublisher<TDocument> find(ClientSession clientSession, Bson filter) {
return new PlanCheckerFindPublisher<>(c.find(clientSession, filter), checker);
}
@Override
public <TResult> PlanCheckerFindPublisher<TResult> find(
ClientSession clientSession, Bson filter, Class<TResult> clazz) {
return new PlanCheckerFindPublisher<>(c.find(clientSession, filter, clazz), checker);
}
@Override
public AggregatePublisher<Document> aggregate(List<? extends Bson> pipeline) {
return c.aggregate(pipeline);
}
@Override
public <TResult> AggregatePublisher<TResult> aggregate(
List<? extends Bson> pipeline, Class<TResult> clazz) {
return c.aggregate(pipeline, clazz);
}
@Override
public AggregatePublisher<Document> aggregate(
ClientSession clientSession, List<? extends Bson> pipeline) {
return c.aggregate(clientSession, pipeline);
}
@Override
public <TResult> AggregatePublisher<TResult> aggregate(
ClientSession clientSession, List<? extends Bson> pipeline, Class<TResult> clazz) {
return c.aggregate(clientSession, pipeline, clazz);
}
@Override
public ChangeStreamPublisher<Document> watch() {
return c.watch();
}
@Override
public <TResult> ChangeStreamPublisher<TResult> watch(Class<TResult> tResultClass) {
return c.watch(tResultClass);
}
@Override
public ChangeStreamPublisher<Document> watch(List<? extends Bson> pipeline) {
return c.watch(pipeline);
}
@Override
public <TResult> ChangeStreamPublisher<TResult> watch(
List<? extends Bson> pipeline, Class<TResult> tResultClass) {
return c.watch(pipeline, tResultClass);
}
@Override
public ChangeStreamPublisher<Document> watch(ClientSession clientSession) {
return c.watch(clientSession);
}
@Override
public <TResult> ChangeStreamPublisher<TResult> watch(
ClientSession clientSession, Class<TResult> tResultClass) {
return c.watch(clientSession, tResultClass);
}
@Override
public ChangeStreamPublisher<Document> watch(
ClientSession clientSession, List<? extends Bson> pipeline) {
return c.watch(clientSession, pipeline);
}
@Override
public <TResult> ChangeStreamPublisher<TResult> watch(
ClientSession clientSession, List<? extends Bson> pipeline, Class<TResult> tResultClass) {
return c.watch(clientSession, pipeline, tResultClass);
}
@Override
public MapReducePublisher<Document> mapReduce(String mapFunction, String reduceFunction) {
return c.mapReduce(mapFunction, reduceFunction);
}
@Override
public <TResult> MapReducePublisher<TResult> mapReduce(
String mapFunction, String reduceFunction, Class<TResult> clazz) {
return c.mapReduce(mapFunction, reduceFunction, clazz);
}
@Override
public MapReducePublisher<Document> mapReduce(
ClientSession clientSession, String mapFunction, String reduceFunction) {
return c.mapReduce(clientSession, mapFunction, reduceFunction);
}
@Override
public <TResult> MapReducePublisher<TResult> mapReduce(
ClientSession clientSession,
String mapFunction,
String reduceFunction,
Class<TResult> clazz) {
return c.mapReduce(clientSession, mapFunction, reduceFunction, clazz);
}
@Override
public Publisher<BulkWriteResult> bulkWrite(
List<? extends WriteModel<? extends TDocument>> requests) {
return c.bulkWrite(requests);
}
@Override
public Publisher<BulkWriteResult> bulkWrite(
List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options) {
return c.bulkWrite(requests, options);
}
@Override
public Publisher<BulkWriteResult> bulkWrite(
ClientSession clientSession, List<? extends WriteModel<? extends TDocument>> requests) {
return c.bulkWrite(clientSession, requests);
}
@Override
public Publisher<BulkWriteResult> bulkWrite(
ClientSession clientSession,
List<? extends WriteModel<? extends TDocument>> requests,
BulkWriteOptions options) {
return c.bulkWrite(clientSession, requests, options);
}
@Override
public Publisher<Success> insertOne(TDocument tDocument) {
return c.insertOne(tDocument);
}
@Override
public Publisher<Success> insertOne(TDocument tDocument, InsertOneOptions options) {
return c.insertOne(tDocument, options);
}
@Override
public Publisher<Success> insertOne(ClientSession clientSession, TDocument tDocument) {
return c.insertOne(clientSession, tDocument);
}
@Override
public Publisher<Success> insertOne(
ClientSession clientSession, TDocument tDocument, InsertOneOptions options) {
return c.insertOne(clientSession, tDocument, options);
}
@Override
public Publisher<Success> insertMany(List<? extends TDocument> tDocuments) {
return c.insertMany(tDocuments);
}
@Override
public Publisher<Success> insertMany(
List<? extends TDocument> tDocuments, InsertManyOptions options) {
return c.insertMany(tDocuments, options);
}
@Override
public Publisher<Success> insertMany(
ClientSession clientSession, List<? extends TDocument> tDocuments) {
return c.insertMany(clientSession, tDocuments);
}
@Override
public Publisher<Success> insertMany(
ClientSession clientSession,
List<? extends TDocument> tDocuments,
InsertManyOptions options) {
return c.insertMany(clientSession, tDocuments, options);
}
@Override
public Publisher<DeleteResult> deleteOne(Bson filter) {
return check(filter, () -> c.deleteOne(filter));
}
@Override
public Publisher<DeleteResult> deleteOne(Bson filter, DeleteOptions options) {
return check(filter, options.getCollation(), () -> c.deleteOne(filter, options));
}
@Override
public Publisher<DeleteResult> deleteOne(ClientSession clientSession, Bson filter) {
return check(clientSession, filter, () -> c.deleteOne(clientSession, filter));
}
@Override
public Publisher<DeleteResult> deleteOne(
ClientSession clientSession, Bson filter, DeleteOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.deleteOne(clientSession, filter, options));
}
@Override
public Publisher<DeleteResult> deleteMany(Bson filter) {
return check(filter, () -> c.deleteMany(filter));
}
@Override
public Publisher<DeleteResult> deleteMany(Bson filter, DeleteOptions options) {
return check(filter, options.getCollation(), () -> c.deleteMany(filter, options));
}
@Override
public Publisher<DeleteResult> deleteMany(ClientSession clientSession, Bson filter) {
return check(clientSession, filter, () -> c.deleteMany(clientSession, filter));
}
@Override
public Publisher<DeleteResult> deleteMany(
ClientSession clientSession, Bson filter, DeleteOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.deleteMany(clientSession, filter, options));
}
@Override
public Publisher<UpdateResult> replaceOne(Bson filter, TDocument replacement) {
return check(filter, () -> c.replaceOne(filter, replacement));
}
@Override
public Publisher<UpdateResult> replaceOne(
Bson filter, TDocument replacement, ReplaceOptions options) {
return check(filter, options.getCollation(), () -> c.replaceOne(filter, replacement, options));
}
@Override
@SuppressWarnings("deprecation")
public Publisher<UpdateResult> replaceOne(
Bson filter, TDocument replacement, UpdateOptions options) {
return check(filter, options.getCollation(), () -> c.replaceOne(filter, replacement, options));
}
@Override
public Publisher<UpdateResult> replaceOne(
ClientSession clientSession, Bson filter, TDocument replacement) {
return check(clientSession, filter, () -> c.replaceOne(clientSession, filter, replacement));
}
@Override
public Publisher<UpdateResult> replaceOne(
ClientSession clientSession, Bson filter, TDocument replacement, ReplaceOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.replaceOne(clientSession, filter, replacement, options));
}
@Override
@SuppressWarnings("deprecation")
public Publisher<UpdateResult> replaceOne(
ClientSession clientSession, Bson filter, TDocument replacement, UpdateOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.replaceOne(clientSession, filter, replacement, options));
}
@Override
public Publisher<UpdateResult> updateOne(Bson filter, Bson update) {
return check(filter, () -> c.updateOne(filter, update));
}
@Override
public Publisher<UpdateResult> updateOne(Bson filter, Bson update, UpdateOptions options) {
return check(filter, options.getCollation(), () -> c.updateOne(filter, update, options));
}
@Override
public Publisher<UpdateResult> updateOne(ClientSession clientSession, Bson filter, Bson update) {
return check(clientSession, filter, () -> c.updateOne(clientSession, filter, update));
}
@Override
public Publisher<UpdateResult> updateOne(
ClientSession clientSession, Bson filter, Bson update, UpdateOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.updateOne(clientSession, filter, update, options));
}
@Override
public Publisher<UpdateResult> updateMany(Bson filter, Bson update) {
return check(filter, () -> c.updateMany(filter, update));
}
@Override
public Publisher<UpdateResult> updateMany(Bson filter, Bson update, UpdateOptions options) {
return check(filter, options.getCollation(), () -> c.updateMany(filter, update, options));
}
@Override
public Publisher<UpdateResult> updateMany(ClientSession clientSession, Bson filter, Bson update) {
return check(clientSession, filter, () -> c.updateMany(clientSession, filter, update));
}
@Override
public Publisher<UpdateResult> updateMany(
ClientSession clientSession, Bson filter, Bson update, UpdateOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.updateMany(clientSession, filter, update, options));
}
@Override
public Publisher<TDocument> findOneAndDelete(Bson filter) {
return check(filter, () -> c.findOneAndDelete(filter));
}
@Override
public Publisher<TDocument> findOneAndDelete(Bson filter, FindOneAndDeleteOptions options) {
return check(filter, options.getCollation(), () -> c.findOneAndDelete(filter, options));
}
@Override
public Publisher<TDocument> findOneAndDelete(ClientSession clientSession, Bson filter) {
return check(clientSession, filter, () -> c.findOneAndDelete(clientSession, filter));
}
@Override
public Publisher<TDocument> findOneAndDelete(
ClientSession clientSession, Bson filter, FindOneAndDeleteOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.findOneAndDelete(clientSession, filter, options));
}
@Override
public Publisher<TDocument> findOneAndReplace(Bson filter, TDocument replacement) {
return check(filter, () -> c.findOneAndReplace(filter, replacement));
}
@Override
public Publisher<TDocument> findOneAndReplace(
Bson filter, TDocument replacement, FindOneAndReplaceOptions options) {
return check(
filter, options.getCollation(), () -> c.findOneAndReplace(filter, replacement, options));
}
@Override
public Publisher<TDocument> findOneAndReplace(
ClientSession clientSession, Bson filter, TDocument replacement) {
return check(
clientSession, filter, () -> c.findOneAndReplace(clientSession, filter, replacement));
}
@Override
public Publisher<TDocument> findOneAndReplace(
ClientSession clientSession,
Bson filter,
TDocument replacement,
FindOneAndReplaceOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.findOneAndReplace(clientSession, filter, replacement, options));
}
@Override
public Publisher<TDocument> findOneAndUpdate(Bson filter, Bson update) {
return check(filter, () -> c.findOneAndUpdate(filter, update));
}
@Override
public Publisher<TDocument> findOneAndUpdate(
Bson filter, Bson update, FindOneAndUpdateOptions options) {
return check(filter, options.getCollation(), () -> c.findOneAndUpdate(filter, update, options));
}
@Override
public Publisher<TDocument> findOneAndUpdate(
ClientSession clientSession, Bson filter, Bson update) {
return check(clientSession, filter, () -> c.findOneAndUpdate(clientSession, filter, update));
}
@Override
public Publisher<TDocument> findOneAndUpdate(
ClientSession clientSession, Bson filter, Bson update, FindOneAndUpdateOptions options) {
return check(
clientSession,
filter,
options.getCollation(),
() -> c.findOneAndUpdate(clientSession, filter, update, options));
}
@Override
public Publisher<Success> drop() {
return c.drop();
}
@Override
public Publisher<Success> drop(ClientSession clientSession) {
return c.drop(clientSession);
}
@Override
public Publisher<String> createIndex(Bson key) {
return c.createIndex(key);
}
@Override
public Publisher<String> createIndex(Bson key, IndexOptions options) {
return c.createIndex(key, options);
}
@Override
public Publisher<String> createIndex(ClientSession clientSession, Bson key) {
return c.createIndex(clientSession, key);
}
@Override
public Publisher<String> createIndex(
ClientSession clientSession, Bson key, IndexOptions options) {
return c.createIndex(clientSession, key, options);
}
@Override
public Publisher<String> createIndexes(List<IndexModel> indexes) {
return c.createIndexes(indexes);
}
@Override
public Publisher<String> createIndexes(
List<IndexModel> indexes, CreateIndexOptions createIndexOptions) {
return c.createIndexes(indexes, createIndexOptions);
}
@Override
public Publisher<String> createIndexes(ClientSession clientSession, List<IndexModel> indexes) {
return c.createIndexes(clientSession, indexes);
}
@Override
public Publisher<String> createIndexes(
ClientSession clientSession,
List<IndexModel> indexes,
CreateIndexOptions createIndexOptions) {
return c.createIndexes(clientSession, indexes, createIndexOptions);
}
@Override
public ListIndexesPublisher<Document> listIndexes() {
return c.listIndexes();
}
@Override
public <TResult> ListIndexesPublisher<TResult> listIndexes(Class<TResult> clazz) {
return c.listIndexes(clazz);
}
@Override
public ListIndexesPublisher<Document> listIndexes(ClientSession clientSession) {
return c.listIndexes(clientSession);
}
@Override
public <TResult> ListIndexesPublisher<TResult> listIndexes(
ClientSession clientSession, Class<TResult> clazz) {
return c.listIndexes(clientSession, clazz);
}
@Override
public Publisher<Success> dropIndex(String indexName) {
return c.dropIndex(indexName);
}
@Override
public Publisher<Success> dropIndex(Bson keys) {
return c.dropIndex(keys);
}
@Override
public Publisher<Success> dropIndex(String indexName, DropIndexOptions dropIndexOptions) {
return c.dropIndex(indexName, dropIndexOptions);
}
@Override
public Publisher<Success> dropIndex(Bson keys, DropIndexOptions dropIndexOptions) {
return c.dropIndex(keys, dropIndexOptions);
}
@Override
public Publisher<Success> dropIndex(ClientSession clientSession, String indexName) {
return c.dropIndex(clientSession, indexName);
}
@Override
public Publisher<Success> dropIndex(ClientSession clientSession, Bson keys) {
return c.dropIndex(clientSession, keys);
}
@Override
public Publisher<Success> dropIndex(
ClientSession clientSession, String indexName, DropIndexOptions dropIndexOptions) {
return c.dropIndex(clientSession, indexName, dropIndexOptions);
}
@Override
public Publisher<Success> dropIndex(
ClientSession clientSession, Bson keys, DropIndexOptions dropIndexOptions) {
return c.dropIndex(clientSession, keys, dropIndexOptions);
}
@Override
public Publisher<Success> dropIndexes() {
return c.dropIndexes();
}
@Override
public Publisher<Success> dropIndexes(DropIndexOptions dropIndexOptions) {
return c.dropIndexes(dropIndexOptions);
}
@Override
public Publisher<Success> dropIndexes(ClientSession clientSession) {
return c.dropIndexes(clientSession);
}
@Override
public Publisher<Success> dropIndexes(
ClientSession clientSession, DropIndexOptions dropIndexOptions) {
return c.dropIndexes(clientSession, dropIndexOptions);
}
@Override
public Publisher<Success> renameCollection(MongoNamespace newCollectionNamespace) {
return c.renameCollection(newCollectionNamespace);
}
@Override
public Publisher<Success> renameCollection(
MongoNamespace newCollectionNamespace, RenameCollectionOptions options) {
return c.renameCollection(newCollectionNamespace, options);
}
@Override
public Publisher<Success> renameCollection(
ClientSession clientSession, MongoNamespace newCollectionNamespace) {
return c.renameCollection(clientSession, newCollectionNamespace);
}
@Override
public Publisher<Success> renameCollection(
ClientSession clientSession,
MongoNamespace newCollectionNamespace,
RenameCollectionOptions options) {
return c.renameCollection(clientSession, newCollectionNamespace, options);
}
}
| [
"sopov.ivan@gmail.com"
] | sopov.ivan@gmail.com |
552a4bca1c98f8af64b3c799f24b484abaf1604f | 0e9edb0807b04b20f846e76f18f3c8f0b26b9526 | /src/main/java/sk/mrtn/pixi/client/parsers/Tmp.java | e2dcf9f0ad8fa5cee680350d470492ec001ad9f9 | [
"MIT"
] | permissive | klaun76/gwt-pixi | 9d3f5a1ef8ed860c1d4989406e079afc39b958bf | 22cbd1690b2a9e5e89eb95d8d1074b640a638fb3 | refs/heads/master | 2020-07-06T10:49:53.970090 | 2017-06-22T20:12:46 | 2017-06-22T20:12:46 | 66,664,125 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 247 | java | package sk.mrtn.pixi.client.parsers;
/**
* Created by klaun on 30/05/16.
* temporary class used when generating partial classes from javascript
* intended to be replaced by actual type when tested or read in
* documentation
*/
class Tmp {
}
| [
"martin.liptak@sowhat.sk"
] | martin.liptak@sowhat.sk |
e7bc9a69266fe70927bec0a276a19752255ad55c | 5f24433e4f5376b107793c6e9d862c1b324350d3 | /HW4/My_bprotsess/src/ttu/idu0080/ordershipmentservice/client/OrderShipmentService_OrderShipmentServicePort_Client.java | a401b8537d9e6d394e5341d1a26db230bff90844 | [] | no_license | arturgummel/IDU0080 | a22077df1792bb1bf2e8587de7ac41baedc23e14 | 6eb3e0969f64e27503f8c5b8ba7adcdb45d251e6 | refs/heads/master | 2021-01-21T07:01:07.118965 | 2017-02-27T13:39:47 | 2017-02-27T13:39:47 | 83,313,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,167 | java |
package ttu.idu0080.ordershipmentservice.client;
/**
* Please modify this class to meet your needs
* This class is not complete
*/
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.Action;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
/**
* This class was generated by Apache CXF 2.6.16
* 2015-04-15T10:39:43.661+03:00
* Generated source version: 2.6.16
*
*/
public final class OrderShipmentService_OrderShipmentServicePort_Client {
private static final QName SERVICE_NAME = new QName("http://server.order.idu0080.ttu/", "OrderShipmentServiceService");
public OrderShipmentService_OrderShipmentServicePort_Client() {
}
public int orderShipment(int orderId, String ryhmName, String trackingNumber, String courierName, double shippingPrice, int days) throws java.lang.Exception {
URL wsdlURL = OrderShipmentServiceService.WSDL_LOCATION;
OrderShipmentServiceService ss = new OrderShipmentServiceService(wsdlURL, SERVICE_NAME);
OrderShipmentService port = ss.getOrderShipmentServicePort();
int _insertOrderShipment__return = 0;
{
//javax.xml.datatype.XMLGregorianCalendar _insertOrderShipment_approxDeliveryDate = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar("2015-04-14T22:53:35.083+03:00");
java.util.GregorianCalendar c = new java.util.GregorianCalendar();
c.setTime(new java.util.Date());
c.add(java.util.Calendar.DATE, days);
javax.xml.datatype.XMLGregorianCalendar _insertOrderShipment_approxDeliveryDate = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
_insertOrderShipment__return = port.insertOrderShipment(orderId, ryhmName, trackingNumber, courierName, _insertOrderShipment_approxDeliveryDate, shippingPrice);
}
return _insertOrderShipment__return;
}
}
| [
"arturgummel@gmail.com"
] | arturgummel@gmail.com |
275b5e28286872efccd5fbb1807dad9e1e54e007 | 3b100d0403ebf41600654a7b4963632986876d72 | /SuperDemo/lib/src/main/java/com/android/core/control/logcat/LogLevel.java | 7eaf613382c73d33820ad450e9a1c0e5c0a9fe2a | [] | no_license | KoalaHui/SuperDemo | 81c00671ae6345f53305b6e1a3dea6eb3cbd16b8 | 244fc5a875f41946d66616c1342e89816f6b3cf2 | refs/heads/master | 2021-01-17T18:18:25.158800 | 2016-08-04T10:23:11 | 2016-08-04T10:23:11 | 64,975,187 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 119 | java | package com.android.core.control.logcat;
public enum LogLevel {
FULL,
NONE;
private LogLevel() {
}
}
| [
"233192133@qq.com"
] | 233192133@qq.com |
8c57cbcb6cc34114a3a8f48a0ba51b3ee401fc5e | 1bc9ba30be08c84ae4ea5a3172cea9a3e527a030 | /gen/cn/david/listview/R.java | d532300afe11c4de876966c6554a0405429ca8fa | [] | no_license | LNAmp/ListViewTestApp | 28bd8a07db8c64e2e6665a5f5b8f51991535f2fe | 6ffa05958de69c76c2ceb6e25a094db8ac566009 | refs/heads/master | 2016-08-12T18:53:01.486859 | 2015-10-27T11:22:15 | 2015-10-27T11:22:15 | 45,035,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,717 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package cn.david.listview;
public final class R {
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f040000;
public static final int activity_vertical_margin=0x7f040001;
}
public static final class drawable {
public static final int a1v=0x7f020000;
public static final int a1w=0x7f020001;
public static final int aab=0x7f020002;
public static final int aah=0x7f020003;
public static final int facebook_hdpi=0x7f020004;
public static final int filer_hdpi=0x7f020005;
public static final int gmail_hdpi=0x7f020006;
public static final int ic_launcher=0x7f020007;
public static final int mail_hdpi=0x7f020008;
}
public static final class id {
public static final int action_settings=0x7f08000a;
public static final int btn_send=0x7f080001;
public static final int et_content=0x7f080002;
public static final int firstLine=0x7f080006;
public static final int icon=0x7f080004;
public static final int iv_user_image=0x7f080008;
public static final int listview=0x7f080003;
public static final int rl_bottom=0x7f080000;
public static final int secondLine=0x7f080005;
public static final int tv_content=0x7f080009;
public static final int tv_time=0x7f080007;
}
public static final class layout {
public static final int activity_main=0x7f030000;
public static final int chat_listview=0x7f030001;
public static final int list_item=0x7f030002;
public static final int list_item2=0x7f030003;
public static final int listview_ex1=0x7f030004;
public static final int rec_list_item=0x7f030005;
public static final int send_list_item=0x7f030006;
}
public static final class menu {
public static final int main=0x7f070000;
}
public static final class string {
public static final int action_settings=0x7f050001;
public static final int app_name=0x7f050000;
public static final int hello_world=0x7f050002;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f060000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f060001;
}
}
| [
"351450944@qq.com"
] | 351450944@qq.com |
97097a7a3222692e9564af6bb42566e5c76d82cb | 0cdfb75efb63fdfb1cd1bb2cc1e6d5db7a8f9213 | /AMFICOM/v1/bkp/mapviewclient/src/com/syrus/AMFICOM/Client/Map/UI/MapViewTableController.java | 5cdecff2a6b99c00465aa35d7a6d37bde93f734e | [] | no_license | syrus-ru/amficom | b230bd554b8c056c9ca1b3236f4c6ac0dc4bf0b5 | 1d1f0c89f05ad224cb7a111bbb36ed14416ab2fc | refs/heads/master | 2023-04-10T17:21:00.091946 | 2006-07-05T02:23:17 | 2006-07-05T02:23:17 | 361,810,067 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,965 | java | /*
* TestResourceController.java Created on 20.08.2004 10:38:55
*/
package com.syrus.AMFICOM.Client.Map.UI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.syrus.AMFICOM.Client.General.Lang.LangModelMap;
import com.syrus.AMFICOM.Client.Map.MapPropertiesManager;
import com.syrus.AMFICOM.general.ApplicationException;
import com.syrus.AMFICOM.general.StorableObjectPool;
import com.syrus.AMFICOM.mapview.MapView;
import com.syrus.util.Wrapper;
public final class MapViewTableController implements Wrapper {
public static final String KEY_NAME = "Name";
public static final String KEY_DOMAIN = "Domain";
public static final String KEY_USER = "User_id";
public static final String KEY_CREATED = "Created";
public static final String KEY_MODIFIED = "Modified";
private static MapViewTableController instance;
private List keys;
private String[] keysArray;
private MapViewTableController() {
// empty private constructor
this.keysArray = new String[] {
KEY_NAME,
KEY_DOMAIN,
KEY_USER,
KEY_CREATED,
KEY_MODIFIED
};
this.keys = Collections.unmodifiableList(new ArrayList(
Arrays.asList(this.keysArray)));
}
public static MapViewTableController getInstance() {
if(instance == null)
instance = new MapViewTableController();
return instance;
}
public List getKeys() {
return this.keys;
}
public String[] getKeysArray() {
return this.keysArray;
}
public String getName(final String key) {
String name = LangModelMap.getString(key);
return name;
}
public Object getValue(final Object object, final String key) {
Object result = null;
MapView view = (MapView )object;
if(key.equals(KEY_NAME)) {
result = view.getName();
}
else
if(key.equals(KEY_DOMAIN)) {
try {
result = StorableObjectPool.getStorableObject(view.getDomainId(), false);
} catch(ApplicationException e) {
e.printStackTrace();
}
}
else
if(key.equals(KEY_USER)) {
try {
result = StorableObjectPool.getStorableObject(view.getCreatorId(), false);
} catch(ApplicationException e) {
e.printStackTrace();
}
}
else
if(key.equals(KEY_CREATED)) {
result = MapPropertiesManager.getDateFormat().format(view.getCreated());
}
else
if(key.equals(KEY_MODIFIED)) {
result = MapPropertiesManager.getDateFormat().format(view.getModified());
}
return result;
}
public boolean isEditable(final String key) {
return false;
}
public void setValue(Object object, final String key, final Object value) {
// empty
}
public String getKey(final int index) {
return (String )this.keys.get(index);
}
public Object getPropertyValue(final String key) {
Object result = "";
return result;
}
public void setPropertyValue(
String key,
Object objectKey,
Object objectValue) {
// empty
}
public Class getPropertyClass(String key) {
Class clazz = String.class;
return clazz;
}
}
| [
"andrei.kroupennikov@gmail.com"
] | andrei.kroupennikov@gmail.com |
09f61ba251de1b6ed8d01c6cc794802dd83a3d22 | 5ecf279d1c4ec6466bab436cb718f590d2fead6a | /src/main/java/pl/edu/wat/wcy/isi/siecsilowni/controllers/SearchClientController.java | 490ac25415f6e697db58dba82cf569786c93686d | [] | no_license | MatexN/GymManagementApp | 6bef3342566d443140d7a13ba8fd19fb655e28ea | 35c1a141c8d83b05c82e64d8f66973670842f9cc | refs/heads/master | 2021-04-12T08:27:34.974983 | 2018-03-20T12:31:22 | 2018-03-20T12:31:22 | 126,012,824 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,583 | java | package pl.edu.wat.wcy.isi.siecsilowni.controllers;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import pl.edu.wat.wcy.isi.siecsilowni.GymApp;
import pl.edu.wat.wcy.isi.siecsilowni.components.NumberTextField;
import pl.edu.wat.wcy.isi.siecsilowni.controllers.base.BaseController;
import pl.edu.wat.wcy.isi.siecsilowni.database.queries.ClientQueries;
import pl.edu.wat.wcy.isi.siecsilowni.events.SearchSubmitEvent;
import java.net.URL;
import java.util.ResourceBundle;
public class SearchClientController extends BaseController {
@FXML
private Button searchBtn;
@FXML
private Label resultLabel;
@FXML
private NumberTextField peselField;
@Override
public void initialize(URL location, ResourceBundle resources) {
searchBtn.addEventHandler(SearchSubmitEvent.SEARCH_SUBMIT_EVENT, event -> {
if (!searchBtn.isDisabled()) {
searchBtn.fire();
}
});
}
public void searchClientByPesel(ActionEvent actionEvent) {
ClientQueries.findClientByPesel(peselField.getText(), client -> {
resultLabel.setText(client == null ?
GymApp.resource.getString("searchresult.noclient")
: client.hasValidSubscriptionCard());
}, () -> {
resultLabel.setText(GymApp.resource.getString("searchresult.error"));
});
}
public void enterPressed(ActionEvent actionEvent) {
searchBtn.fireEvent(new SearchSubmitEvent());
}
}
| [
"matex95@gmail.com"
] | matex95@gmail.com |
2421ec50da69ffe68beb1d553494005d9f8392f4 | bc70a4652a047a7afd15333747fc2aebfc90d2c4 | /platform/dolphin-platform-remoting-server/src/main/java/com/canoo/platform/remoting/server/RemotingContext.java | aeeb4f833d944dffc9d1c540fedcbe2d75c9efa4 | [
"Apache-2.0"
] | permissive | potapczuk/dolphin-platform | 91bc4f564f5accf61ea7b462701473622f63db5f | 95c13dbd72b8c9c54caf8e9dd06a4933baeba490 | refs/heads/master | 2021-07-18T07:16:08.341221 | 2017-10-23T12:26:31 | 2017-10-23T12:26:31 | 108,169,860 | 1 | 0 | null | 2017-10-24T18:53:03 | 2017-10-24T18:53:03 | null | UTF-8 | Java | false | false | 2,123 | java | /*
* Copyright 2015-2017 Canoo Engineering AG.
*
* 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.canoo.platform.remoting.server;
import com.canoo.platform.remoting.BeanManager;
import com.canoo.platform.remoting.server.binding.PropertyBinder;
import com.canoo.platform.server.client.ClientSession;
import com.canoo.platform.remoting.server.event.DolphinEventBus;
/**
* Facade to get access to all instances of a Dolphin Platform remoting context. Each {@link ClientSession} that uses the remoting layer of Dolphin Platform will contain exactly one remoting context.
*
* This is a util interface that normally is not needed for application developers since all needed parts of the context can be injected directly in Dolphin Platform controller classes or other managed beans.
*
* @author Hendrik Ebbers
*/
public interface RemotingContext {
/**
* Return the id of the context.
* @return the id
*/
String getId();
/**
* Return the executor for the context
* @return the executor
*/
ClientSessionExecutor createSessionExecutor();
/**
* Return the binder for the context
* @return the binder
*/
PropertyBinder getBinder();
/**
* Returns the bean manager for the context
* @return the bean manager
*/
BeanManager getBeanManager();
/**
* Returns the event bus for the context
* @return the event bus
*/
DolphinEventBus getEventBus();
/**
* Returns the client session for the context
* @return the client session
*/
ClientSession getClientSession();
}
| [
"hendrik.ebbers@web.de"
] | hendrik.ebbers@web.de |
1a88c3fb5a76a474430cd2d5c993c1fd1d70559e | 9b3bcf523609aae3907b50e0dc550e3e4678f9d6 | /ideafork_ee6/src/main/java/at/irian/cdiatwork/ideafork/core/impl/config/typed/TypedConfigHandler.java | 7cd4f4b2dc9ff04d8bb577d85e52159548a5b542 | [] | no_license | CDIatWork/IdeaForkLite | 5283d3cf4f471bde369d43ffebfa3609193b7dcf | 152ff0d949160e0abfeb52d95f363bbcbb950aaa | refs/heads/master | 2021-01-18T02:10:25.389617 | 2016-08-01T16:21:33 | 2017-05-30T09:06:14 | 68,370,895 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,738 | java | package at.irian.cdiatwork.ideafork.core.impl.config.typed;
import at.irian.cdiatwork.ideafork.core.api.config.ApplicationVersion;
import at.irian.cdiatwork.ideafork.core.impl.config.context.ConfigScoped;
import org.apache.deltaspike.core.api.config.ConfigResolver;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@TypedConfig
@ConfigScoped
@SuppressWarnings("unused")
public class TypedConfigHandler implements InvocationHandler {
private Map<String, Object> loadedValues = new ConcurrentHashMap<String, Object>();
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
String key = method.getName();
Object result = loadedValues.get(key);
if (result != null) {
return result;
}
String loadedValue = ConfigResolver.getProjectStageAwarePropertyValue(key);
final Class<?> configType = method.getReturnType();
result = parseValue(loadedValue, configType);
loadedValues.put(key, result);
return result;
}
private Object parseValue(String loadedValue, Class<?> configType) {
if (loadedValue != null) {
if (configType.equals(Integer.class)) {
return Integer.parseInt(loadedValue);
} else if (configType.equals(String.class)) {
return loadedValue;
} else if (configType.equals(ApplicationVersion.class)) {
return new ApplicationVersion(loadedValue);
} else {
throw new IllegalStateException(configType.getName() + " isn't supported");
}
}
return null;
}
}
| [
"gerhard.petracek@irian.at"
] | gerhard.petracek@irian.at |
2c5f555a8bf56b0d020ab2ae63c4940d2a17876b | edf7dc42337f0f644c5217afb9048acda2b22bea | /src/main/java/de/vs/monopoly/model/Player.java | 2bfbd22ddb229b096be862ae86a8693b7a524260 | [] | no_license | d-is/Monopoly | 8a92f3f8b1692da9c458d581c06b8c9c1f542b34 | 948c148db2c292bb8e1727262d3063e0cd6d594d | refs/heads/master | 2016-08-11T14:17:36.287152 | 2016-01-13T14:30:53 | 2016-01-13T14:30:53 | 44,614,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,547 | java | package de.vs.monopoly.model;
public class Player {
private String id;
private String name;
private String uri;
private Place place;
private int position;
private boolean ready;
public boolean isReady() {
return ready;
}
public void setReady(boolean ready) {
this.ready = ready;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public Place getPlace() {
return place;
}
public void setPlace(Place place) {
this.place = place;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
public Player(String id, String name, String uri, Place place, int position){
this.id = id;
this.name = name;
this.uri = uri;
this.place = place;
this.position = position;
this.ready = false;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Player other = (Player) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
| [
"magnus@philipp"
] | magnus@philipp |
b952ca25e5c3e4c2d345ec1d48fe4182ed880a24 | 798744bdb13947314962a7835a088d1d8a31d0d3 | /test/br/com/six2six/validator/model/Person.java | 570e2cd7c84411b937003feaeb0c9a73afa73c0f | [] | no_license | six2six/validator | ae2249c23f422386a976720bd54984e4290fdd89 | 4e82b5f275199a2919b4b28f3103fb895089e24c | refs/heads/master | 2020-05-05T07:57:12.977024 | 2012-09-04T06:35:41 | 2012-09-04T06:51:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package br.com.six2six.validator.model;
public class Person {
private String name;
private int age;
private Address homeAddress;
private Address workingAddress;
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Address getHomeAddress() {
return homeAddress;
}
public void setHomeAddress(Address homeAddress) {
this.homeAddress = homeAddress;
}
public Address getWorkingAddress() {
return workingAddress;
}
public void setWorkingAddress(Address workingAddress) {
this.workingAddress = workingAddress;
}
}
| [
"bjornnborg@gmail.com"
] | bjornnborg@gmail.com |
d9b604295bcb0d5947cf396fdb5445860ab25a73 | 7f20b1bddf9f48108a43a9922433b141fac66a6d | /core3/impl/tags/impl-parent-3.0.0-alpha9/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/CyActivator.java | d3e426f5e7175a714f9143658795aea940fae39c | [] | no_license | ahdahddl/cytoscape | bf783d44cddda313a5b3563ea746b07f38173022 | a3df8f63dba4ec49942027c91ecac6efa920c195 | refs/heads/master | 2020-06-26T16:48:19.791722 | 2013-08-28T04:08:31 | 2013-08-28T04:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,011 | java |
package org.cytoscape.view.vizmap.gui.internal;
import java.awt.Color;
import java.awt.Font;
import java.awt.Paint;
import java.util.Properties;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableCellRenderer;
import org.cytoscape.application.CyApplicationConfiguration;
import org.cytoscape.application.CyApplicationManager;
import org.cytoscape.application.swing.CyAction;
import org.cytoscape.event.CyEventHelper;
import org.cytoscape.io.read.VizmapReaderManager;
import org.cytoscape.model.CyNetworkFactory;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.CyNetworkTableManager;
import org.cytoscape.model.CyTableManager;
import org.cytoscape.service.util.AbstractCyActivator;
import org.cytoscape.service.util.CyServiceRegistrar;
import org.cytoscape.task.EdgeViewTaskFactory;
import org.cytoscape.view.model.CyNetworkViewFactory;
import org.cytoscape.view.presentation.RenderingEngineFactory;
import org.cytoscape.view.presentation.property.values.BendFactory;
import org.cytoscape.view.vizmap.VisualMappingFunctionFactory;
import org.cytoscape.view.vizmap.VisualMappingManager;
import org.cytoscape.view.vizmap.VisualStyleFactory;
import org.cytoscape.view.vizmap.gui.editor.ValueEditor;
import org.cytoscape.view.vizmap.gui.editor.VisualPropertyEditor;
import org.cytoscape.view.vizmap.gui.internal.action.EditSelectedCellAction;
import org.cytoscape.view.vizmap.gui.internal.bypass.BypassManager;
import org.cytoscape.view.vizmap.gui.internal.editor.BooleanVisualPropertyEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.ColorVisualPropertyEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.EditorManagerImpl;
import org.cytoscape.view.vizmap.gui.internal.editor.NumberVisualPropertyEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.StringVisualPropertyEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.propertyeditor.CyColorPropertyEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.propertyeditor.CyComboBoxPropertyEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.BooleanValueEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.CyColorChooser;
import org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.FontEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.NumericValueEditor;
import org.cytoscape.view.vizmap.gui.internal.editor.valueeditor.StringValueEditor;
import org.cytoscape.view.vizmap.gui.internal.event.VizMapEventHandlerManagerImpl;
import org.cytoscape.view.vizmap.gui.internal.task.ClearBendTaskFactory;
import org.cytoscape.view.vizmap.gui.internal.task.CopyVisualStyleTaskFactory;
import org.cytoscape.view.vizmap.gui.internal.task.CreateLegendTaskFactory;
import org.cytoscape.view.vizmap.gui.internal.task.CreateNewVisualStyleTaskFactory;
import org.cytoscape.view.vizmap.gui.internal.task.DeleteMappingFunctionTaskFactory;
import org.cytoscape.view.vizmap.gui.internal.task.DeleteVisualStyleTaskFactory;
import org.cytoscape.view.vizmap.gui.internal.task.ImportDefaultVizmapTaskFactory;
import org.cytoscape.view.vizmap.gui.internal.task.RenameVisualStyleTaskFactory;
import org.cytoscape.view.vizmap.gui.internal.theme.ColorManager;
import org.cytoscape.view.vizmap.gui.internal.theme.IconManager;
import org.cytoscape.view.vizmap.gui.internal.util.VizMapperUtil;
import org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.FitLabelMappingGenerator;
import org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.NumberSeriesMappingGenerator;
import org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.RainbowColorMappingGenerator;
import org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.RainbowOscColorMappingGenerator;
import org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.RandomColorMappingGenerator;
import org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.RandomNumberMappingGenerator;
import org.cytoscape.view.vizmap.gui.util.DiscreteMappingGenerator;
import org.cytoscape.work.ServiceProperties;
import org.cytoscape.work.TaskFactory;
import org.cytoscape.work.swing.DialogTaskManager;
import org.osgi.framework.BundleContext;
import com.l2fprod.common.propertysheet.PropertySheetPanel;
public class CyActivator extends AbstractCyActivator {
public CyActivator() {
super();
}
public void start(BundleContext bc) {
CyApplicationConfiguration cyApplicationConfigurationServiceRef = getService(bc,CyApplicationConfiguration.class);
DialogTaskManager dialogTaskManagerServiceRef = getService(bc,DialogTaskManager.class);
VisualStyleFactory visualStyleFactoryServiceRef = getService(bc,VisualStyleFactory.class);
VisualMappingManager vmmServiceRef = getService(bc,VisualMappingManager.class);
CyNetworkManager cyNetworkManagerServiceRef = getService(bc,CyNetworkManager.class);
CyApplicationManager cyApplicationManagerServiceRef = getService(bc,CyApplicationManager.class);
RenderingEngineFactory presentationFactoryServiceRef = getService(bc,RenderingEngineFactory.class);
CyNetworkFactory cyNetworkFactoryServiceRef = getService(bc,CyNetworkFactory.class);
CyNetworkViewFactory graphViewFactoryServiceRef = getService(bc,CyNetworkViewFactory.class);
CyEventHelper cyEventHelperServiceRef = getService(bc,CyEventHelper.class);
CyTableManager cyTableManagerServiceRef = getService(bc,CyTableManager.class);
CyServiceRegistrar cyServiceRegistrarServiceRef = getService(bc,CyServiceRegistrar.class);
VizmapReaderManager vizmapReaderManagerServiceRef = getService(bc,VizmapReaderManager.class);
CyNetworkTableManager cyNetworkTableManagerServiceRef = getService(bc,CyNetworkTableManager.class);
AttributeSetManager attributeSetManager = new AttributeSetManager(cyNetworkTableManagerServiceRef);
EditorManagerImpl editorManager = new EditorManagerImpl(cyApplicationManagerServiceRef,attributeSetManager,vmmServiceRef,cyNetworkTableManagerServiceRef, cyNetworkManagerServiceRef);
MappingFunctionFactoryManagerImpl mappingFunctionFactoryManager = new MappingFunctionFactoryManagerImpl(editorManager);
PropertySheetPanel propertySheetPanel = new PropertySheetPanel();
CyColorChooser colorEditor = new CyColorChooser();
CyColorPropertyEditor cyColorPropertyEditor = new CyColorPropertyEditor(colorEditor);
FontEditor fontEditor = new FontEditor();
NumericValueEditor<Double> doubleValueEditor = new NumericValueEditor<Double>(Double.class);
NumericValueEditor<Integer> integerValueEditor = new NumericValueEditor<Integer>(Integer.class);
NumericValueEditor<Float> floatValueEditor = new NumericValueEditor<Float>(Float.class);
StringValueEditor stringValueEditor = new StringValueEditor();
BooleanValueEditor booleanValueEditor = new BooleanValueEditor();
ColorVisualPropertyEditor colorPropertyEditor = new ColorVisualPropertyEditor(Paint.class,cyNetworkTableManagerServiceRef,cyApplicationManagerServiceRef,editorManager,vmmServiceRef, cyColorPropertyEditor);
NumberVisualPropertyEditor doublePropertyEditor = new NumberVisualPropertyEditor(Double.class,cyNetworkTableManagerServiceRef,cyApplicationManagerServiceRef,editorManager,vmmServiceRef);
NumberVisualPropertyEditor integerPropertyEditor = new NumberVisualPropertyEditor(Integer.class,cyNetworkTableManagerServiceRef,cyApplicationManagerServiceRef,editorManager,vmmServiceRef);
NumberVisualPropertyEditor floatPropertyEditor = new NumberVisualPropertyEditor(Float.class,cyNetworkTableManagerServiceRef,cyApplicationManagerServiceRef,editorManager,vmmServiceRef);
StringVisualPropertyEditor stringPropertyEditor = new StringVisualPropertyEditor();
final CyComboBoxPropertyEditor booleanEditor = new CyComboBoxPropertyEditor();
booleanEditor.setAvailableValues(new Boolean[] {true, false});
BooleanVisualPropertyEditor booleanVisualPropertyEditor = new BooleanVisualPropertyEditor(booleanEditor);
ColorManager colorMgr = new ColorManager();
IconManager iconManager = new IconManager();
VizMapperMenuManager menuManager = new VizMapperMenuManager(dialogTaskManagerServiceRef,propertySheetPanel,vmmServiceRef, cyApplicationManagerServiceRef);
DefaultViewPanelImpl defaultViewPanel = new DefaultViewPanelImpl(cyNetworkFactoryServiceRef,graphViewFactoryServiceRef,presentationFactoryServiceRef, vmmServiceRef);
VizMapperUtil vizMapperUtil = new VizMapperUtil(vmmServiceRef);
SetViewModeAction viewModeAction = new SetViewModeAction();
DefaultViewEditorImpl defViewEditor = new DefaultViewEditorImpl(defaultViewPanel,editorManager,cyApplicationManagerServiceRef,vmmServiceRef,vizMapperUtil,cyEventHelperServiceRef,viewModeAction);
CreateNewVisualStyleTaskFactory createNewVisualStyleTaskFactory = new CreateNewVisualStyleTaskFactory(visualStyleFactoryServiceRef,vmmServiceRef);
DeleteVisualStyleTaskFactory removeVisualStyleTaskFactory = new DeleteVisualStyleTaskFactory(vmmServiceRef);
ImportDefaultVizmapTaskFactory importDefaultVizmapTaskFactory = new ImportDefaultVizmapTaskFactory(vizmapReaderManagerServiceRef,vmmServiceRef,cyApplicationConfigurationServiceRef);
DefaultTableCellRenderer emptyBoxRenderer = new DefaultTableCellRenderer();
DefaultTableCellRenderer filledBoxRenderer = new DefaultTableCellRenderer();
emptyBoxRenderer = new DefaultTableCellRenderer();
emptyBoxRenderer.setHorizontalTextPosition(SwingConstants.CENTER);
emptyBoxRenderer.setHorizontalAlignment(SwingConstants.CENTER);
emptyBoxRenderer.setBackground(new Color(0, 200, 255, 20));
emptyBoxRenderer.setForeground(Color.red);
emptyBoxRenderer.setFont(new Font("SansSerif", Font.BOLD, 12));
filledBoxRenderer = new DefaultTableCellRenderer();
filledBoxRenderer.setBackground(Color.white);
filledBoxRenderer.setForeground(Color.blue);
VizMapPropertyBuilder vizMapPropertyBuilder = new VizMapPropertyBuilder(cyNetworkManagerServiceRef, editorManager, emptyBoxRenderer, filledBoxRenderer);
VizMapPropertySheetBuilder vizMapPropertySheetBuilder = new VizMapPropertySheetBuilder(menuManager,propertySheetPanel,editorManager,defaultViewPanel,vizMapperUtil,vmmServiceRef, vizMapPropertyBuilder);
EditorWindowManager editorWindowManager = new EditorWindowManager(editorManager,propertySheetPanel);
VizMapperMainPanel vizMapperMainPanel = new VizMapperMainPanel(visualStyleFactoryServiceRef,defViewEditor,iconManager,colorMgr,vmmServiceRef,menuManager,editorManager,propertySheetPanel,vizMapPropertySheetBuilder,editorWindowManager,cyApplicationManagerServiceRef,importDefaultVizmapTaskFactory,dialogTaskManagerServiceRef,viewModeAction);
RenameVisualStyleTaskFactory renameVisualStyleTaskFactory = new RenameVisualStyleTaskFactory(vmmServiceRef);
CopyVisualStyleTaskFactory copyVisualStyleTaskFactory = new CopyVisualStyleTaskFactory(vmmServiceRef,visualStyleFactoryServiceRef);
CreateLegendTaskFactory createLegendTaskFactory = new CreateLegendTaskFactory(cyApplicationManagerServiceRef, vmmServiceRef);
DeleteMappingFunctionTaskFactory deleteMappingFunctionTaskFactory = new DeleteMappingFunctionTaskFactory(propertySheetPanel,vmmServiceRef, cyApplicationManagerServiceRef);
RainbowColorMappingGenerator rainbowGenerator = new RainbowColorMappingGenerator(Color.class);
RainbowOscColorMappingGenerator rainbowOscGenerator = new RainbowOscColorMappingGenerator(Color.class);
RandomColorMappingGenerator randomColorGenerator = new RandomColorMappingGenerator(Color.class);
NumberSeriesMappingGenerator<Number> seriesGenerator = new NumberSeriesMappingGenerator<Number>(Number.class);
RandomNumberMappingGenerator randomNumberGenerator = new RandomNumberMappingGenerator();
FitLabelMappingGenerator<Number> fitLabelMappingGenerator = new FitLabelMappingGenerator<Number>(Number.class, cyApplicationManagerServiceRef, vmmServiceRef);
VizMapEventHandlerManagerImpl vizMapEventHandlerManager = new VizMapEventHandlerManagerImpl(vmmServiceRef, editorManager,vizMapPropertySheetBuilder,propertySheetPanel,vizMapperMainPanel,cyNetworkTableManagerServiceRef,cyApplicationManagerServiceRef,attributeSetManager,vizMapperUtil);
BypassManager bypassManager = new BypassManager(cyServiceRegistrarServiceRef,editorManager, vmmServiceRef);
// Context menu for edge bend
BendFactory bf = getService(bc, BendFactory.class);
final Properties clearBendProp = new Properties();
clearBendProp.put(ServiceProperties.PREFERRED_MENU, "Clear Bend");
final ClearBendTaskFactory clearBendTaskFactory = new ClearBendTaskFactory(vmmServiceRef, bf);
registerService(bc, clearBendTaskFactory, EdgeViewTaskFactory.class, clearBendProp);
registerAllServices(bc,viewModeAction, new Properties());
registerAllServices(bc,attributeSetManager, new Properties());
registerAllServices(bc,vizMapperMainPanel, new Properties());
registerAllServices(bc,defViewEditor, new Properties());
registerAllServices(bc,editorManager.getNodeEditor(), new Properties());
registerAllServices(bc,editorManager.getEdgeEditor(), new Properties());
registerAllServices(bc,editorManager.getNetworkEditor(), new Properties());
registerAllServices(bc,colorEditor, new Properties());
registerAllServices(bc,fontEditor, new Properties());
registerAllServices(bc,doubleValueEditor, new Properties());
registerAllServices(bc,integerValueEditor, new Properties());
registerAllServices(bc,floatValueEditor, new Properties());
registerAllServices(bc,stringValueEditor, new Properties());
registerAllServices(bc,booleanValueEditor, new Properties());
registerAllServices(bc,colorPropertyEditor, new Properties());
registerAllServices(bc,doublePropertyEditor, new Properties());
registerAllServices(bc,floatPropertyEditor, new Properties());
registerAllServices(bc,integerPropertyEditor, new Properties());
registerAllServices(bc,stringPropertyEditor, new Properties());
registerAllServices(bc,booleanVisualPropertyEditor, new Properties());
registerAllServices(bc,editorManager, new Properties());
Properties createNewVisualStyleTaskFactoryProps = new Properties();
createNewVisualStyleTaskFactoryProps.setProperty("service.type","vizmapUI.taskFactory");
createNewVisualStyleTaskFactoryProps.setProperty("title","Create New Visual Style");
createNewVisualStyleTaskFactoryProps.setProperty("menu","main");
registerAllServices(bc,createNewVisualStyleTaskFactory, createNewVisualStyleTaskFactoryProps);
Properties removeVisualStyleTaskFactoryProps = new Properties();
removeVisualStyleTaskFactoryProps.setProperty("service.type","vizmapUI.taskFactory");
removeVisualStyleTaskFactoryProps.setProperty("title","Remove Visual Style");
removeVisualStyleTaskFactoryProps.setProperty("menu","main");
registerAllServices(bc,removeVisualStyleTaskFactory, removeVisualStyleTaskFactoryProps);
Properties renameVisualStyleTaskFactoryProps = new Properties();
renameVisualStyleTaskFactoryProps.setProperty("service.type","vizmapUI.taskFactory");
renameVisualStyleTaskFactoryProps.setProperty("title","Rename Visual Style");
renameVisualStyleTaskFactoryProps.setProperty("menu","main");
registerAllServices(bc,renameVisualStyleTaskFactory, renameVisualStyleTaskFactoryProps);
Properties copyVisualStyleTaskFactoryProps = new Properties();
copyVisualStyleTaskFactoryProps.setProperty("service.type","vizmapUI.taskFactory");
copyVisualStyleTaskFactoryProps.setProperty("title","Copy Visual Style");
copyVisualStyleTaskFactoryProps.setProperty("menu","main");
registerAllServices(bc,copyVisualStyleTaskFactory, copyVisualStyleTaskFactoryProps);
Properties createLegendTaskFactoryProps = new Properties();
createLegendTaskFactoryProps.setProperty("service.type","vizmapUI.taskFactory");
createLegendTaskFactoryProps.setProperty("title","Create Legend");
createLegendTaskFactoryProps.setProperty("menu","main");
registerAllServices(bc,createLegendTaskFactory, createLegendTaskFactoryProps);
Properties deleteMappingFunctionTaskFactoryProps = new Properties();
deleteMappingFunctionTaskFactoryProps.setProperty("service.type","vizmapUI.taskFactory");
deleteMappingFunctionTaskFactoryProps.setProperty("title","Delete Selected Mapping");
deleteMappingFunctionTaskFactoryProps.setProperty("menu","context");
registerAllServices(bc,deleteMappingFunctionTaskFactory, deleteMappingFunctionTaskFactoryProps);
Properties rainbowGeneratorProps = new Properties();
rainbowGeneratorProps.setProperty("service.type","vizmapUI.contextMenu");
rainbowGeneratorProps.setProperty("title","Rainbow");
rainbowGeneratorProps.setProperty("menu","context");
registerService(bc,rainbowGenerator,DiscreteMappingGenerator.class, rainbowGeneratorProps);
Properties rainbowOscGeneratorProps = new Properties();
rainbowOscGeneratorProps.setProperty("service.type","vizmapUI.contextMenu");
rainbowOscGeneratorProps.setProperty("title","Rainbow OSC");
rainbowOscGeneratorProps.setProperty("menu","context");
registerService(bc,rainbowOscGenerator,DiscreteMappingGenerator.class, rainbowOscGeneratorProps);
Properties randomColorGeneratorProps = new Properties();
randomColorGeneratorProps.setProperty("service.type","vizmapUI.contextMenu");
randomColorGeneratorProps.setProperty("title","Random Color");
randomColorGeneratorProps.setProperty("menu","context");
registerService(bc,randomColorGenerator,DiscreteMappingGenerator.class, randomColorGeneratorProps);
Properties numberSeriesGeneratorProps = new Properties();
numberSeriesGeneratorProps.setProperty("service.type","vizmapUI.contextMenu");
numberSeriesGeneratorProps.setProperty("title","Number Series");
numberSeriesGeneratorProps.setProperty("menu","context");
registerService(bc,seriesGenerator,DiscreteMappingGenerator.class, numberSeriesGeneratorProps);
Properties randomNumberGeneratorProps = new Properties();
randomNumberGeneratorProps.setProperty("service.type","vizmapUI.contextMenu");
randomNumberGeneratorProps.setProperty("title","Random Numbers");
randomNumberGeneratorProps.setProperty("menu","context");
registerService(bc, randomNumberGenerator, DiscreteMappingGenerator.class, randomNumberGeneratorProps);
Properties fitLabelGeneratorProps = new Properties();
fitLabelGeneratorProps.setProperty("service.type","vizmapUI.contextMenu");
fitLabelGeneratorProps.setProperty("title","Fit label width (SUID to Node Width)");
fitLabelGeneratorProps.setProperty("menu","context");
registerService(bc, fitLabelMappingGenerator, DiscreteMappingGenerator.class, fitLabelGeneratorProps);
EditSelectedCellAction editAction = new EditSelectedCellAction(editorManager, cyApplicationManagerServiceRef, propertySheetPanel, vmmServiceRef);
Properties editSelectedProps = new Properties();
editSelectedProps.setProperty("service.type","vizmapUI.contextMenu");
editSelectedProps.setProperty("title","Edit Selected");
editSelectedProps.setProperty("menu","context");
registerService(bc,editAction, CyAction.class, editSelectedProps);
// Adding Vizmap-local context menus.
registerServiceListener(bc,menuManager,"onBind","onUnbind",CyAction.class);
registerServiceListener(bc,mappingFunctionFactoryManager,"addFactory","removeFactory",VisualMappingFunctionFactory.class);
registerServiceListener(bc,editorManager,"addValueEditor","removeValueEditor",ValueEditor.class);
registerServiceListener(bc,editorManager,"addVisualPropertyEditor","removeVisualPropertyEditor",VisualPropertyEditor.class);
registerServiceListener(bc,menuManager,"addTaskFactory","removeTaskFactory",TaskFactory.class);
registerServiceListener(bc,menuManager,"addMappingGenerator","removeMappingGenerator",DiscreteMappingGenerator.class);
registerServiceListener(bc,editorManager,"addRenderingEngineFactory","removeRenderingEngineFactory",RenderingEngineFactory.class);
registerServiceListener(bc,bypassManager,"addBypass","removeBypass",RenderingEngineFactory.class);
registerServiceListener(bc,vizMapEventHandlerManager,"registerPCL","unregisterPCL", RenderingEngineFactory.class);
}
}
| [
"kono@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] | kono@0ecc0d97-ab19-0410-9704-bfe1a75892f5 |
66cb2fb7d295148e78709fc8caeee2c4c3726b6f | 7e7ccc418be440da6ace4984f6b87b341687b903 | /src/main/java/org/jcodec/codecs/mpeg4/MPEG4DCT.java | 76aaeb284c8c3204c6c028127afe173ab4c121f4 | [
"BSD-2-Clause",
"BSD-2-Clause-Views"
] | permissive | dsmatter/jcodec | e451334b16261462b8e0e3a5924cfd469ed4e166 | 3911d2ba6b8a9b677b753648ca71cae09285597d | refs/heads/master | 2021-06-08T19:58:44.863091 | 2021-04-12T10:32:28 | 2021-04-12T10:32:28 | 159,028,636 | 0 | 0 | BSD-2-Clause | 2018-11-25T12:20:29 | 2018-11-25T12:20:29 | null | UTF-8 | Java | false | false | 9,573 | java | package org.jcodec.codecs.mpeg4;
import org.jcodec.common.tools.MathUtil;
/**
* This class is part of JCodec ( www.jcodec.org ) This software is distributed
* under FreeBSD License
*
* @author The JCodec project
*
*/
public class MPEG4DCT {
private final static int W1 = 2841;
private final static int W2 = 2676;
private final static int W3 = 2408;
private final static int W5 = 1609;
private final static int W6 = 1108;
private final static int W7 = 565;
public static void idctPut(byte[][] p, short[][] block, boolean interlacing) {
idctRows(block[0]);
idctRows(block[1]);
idctRows(block[2]);
idctRows(block[3]);
idctRows(block[4]);
idctRows(block[5]);
int stride = 16;
int stride2 = 8;
int nextBlock = 128;
if (interlacing) {
nextBlock = stride;
stride *= 2;
}
idctColumnsPut(block[0], p[0], 0, stride);
idctColumnsPut(block[1], p[0], 8, stride);
idctColumnsPut(block[2], p[0], nextBlock, stride);
idctColumnsPut(block[3], p[0], nextBlock + 8, stride);
idctColumnsPut(block[4], p[1], 0, stride2);
idctColumnsPut(block[5], p[2], 0, stride2);
}
public static void idctAdd(byte[][] p, short[] block, int index, boolean interlacing) {
idctRows(block);
switch (index) {
case 0:
idctColumnsAdd(block, p[0], 0, 16);
break;
case 1:
idctColumnsAdd(block, p[0], 8, 16);
break;
case 2:
if (interlacing) {
idctColumnsAdd(block, p[0], 16, 32);
} else {
idctColumnsAdd(block, p[0], 128, 16);
}
break;
case 3:
if (interlacing) {
idctColumnsAdd(block, p[0], 24, 32);
} else {
idctColumnsAdd(block, p[0], 136, 16);
}
break;
case 4:
idctColumnsAdd(block, p[1], 0, 8);
break;
case 5:
idctColumnsAdd(block, p[2], 0, 8);
break;
}
}
private final static byte clamp255(int val) {
val -= 255;
val = -(255 + ((val >> 31) & val));
return (byte) ((-((val >> 31) & val)) - 128);
}
public static void idctColumnsPut(short[] block, byte[] dst, int dstOffset, int stride) {
int X0, X1, X2, X3, X4, X5, X6, X7, X8;
for (int i = 0; i < 8; i++) {
int offset = dstOffset + i;
if (((X1 = (block[i + 8 * 4] << 8)) | (X2 = block[i + 8 * 6]) | (X3 = block[i + 8 * 2])
| (X4 = block[i + 8 * 1]) | (X5 = block[i + 8 * 7]) | (X6 = block[i + 8 * 5])
| (X7 = block[i + 8 * 3])) == 0) {
dst[offset + stride * 0] = dst[offset + stride * 1] = dst[offset + stride * 2] = dst[offset
+ stride * 3] = dst[offset + stride * 4] = dst[offset + stride * 5] = dst[offset
+ stride * 6] = dst[offset + stride * 7] = clamp255(((block[i + 8 * 0] + 32) >> 6));
continue;
}
X0 = (block[i + 8 * 0] << 8) + 8192;
X8 = W7 * (X4 + X5) + 4;
X4 = (X8 + (W1 - W7) * X4) >> 3;
X5 = (X8 - (W1 + W7) * X5) >> 3;
X8 = W3 * (X6 + X7) + 4;
X6 = (X8 - (W3 - W5) * X6) >> 3;
X7 = (X8 - (W3 + W5) * X7) >> 3;
X8 = X0 + X1;
X0 -= X1;
X1 = W6 * (X3 + X2) + 4;
X2 = (X1 - (W2 + W6) * X2) >> 3;
X3 = (X1 + (W2 - W6) * X3) >> 3;
X1 = X4 + X6;
X4 -= X6;
X6 = X5 + X7;
X5 -= X7;
X7 = X8 + X3;
X8 -= X3;
X3 = X0 + X2;
X0 -= X2;
X2 = (181 * (X4 + X5) + 128) >> 8;
X4 = (181 * (X4 - X5) + 128) >> 8;
dst[offset + stride * 0] = clamp255((X7 + X1) >> 14);
dst[offset + stride * 1] = clamp255((X3 + X2) >> 14);
dst[offset + stride * 2] = clamp255((X0 + X4) >> 14);
dst[offset + stride * 3] = clamp255((X8 + X6) >> 14);
dst[offset + stride * 4] = clamp255((X8 - X6) >> 14);
dst[offset + stride * 5] = clamp255((X0 - X4) >> 14);
dst[offset + stride * 6] = clamp255((X3 - X2) >> 14);
dst[offset + stride * 7] = clamp255((X7 - X1) >> 14);
}
}
public static void idctColumnsAdd(short[] block, byte[] dst, int dstOffset, int stride) {
int X0, X1, X2, X3, X4, X5, X6, X7, X8;
for (int i = 0; i < 8; i++) {
int offset = dstOffset + i;
if (((X1 = (block[i + 8 * 4] << 8)) | (X2 = block[i + 8 * 6]) | (X3 = block[i + 8 * 2])
| (X4 = block[i + 8 * 1]) | (X5 = block[i + 8 * 7]) | (X6 = block[i + 8 * 5])
| (X7 = block[i + 8 * 3])) == 0) {
int pixel = (block[i + 8 * 0] + 32) >> 6;
dst[offset + stride * 0] = (byte) MathUtil.clip(dst[offset + stride * 0] + pixel, -128, 127);
dst[offset + stride * 1] = (byte) MathUtil.clip(dst[offset + stride * 1] + pixel, -128, 127);
dst[offset + stride * 2] = (byte) MathUtil.clip(dst[offset + stride * 2] + pixel, -128, 127);
dst[offset + stride * 3] = (byte) MathUtil.clip(dst[offset + stride * 3] + pixel, -128, 127);
dst[offset + stride * 4] = (byte) MathUtil.clip(dst[offset + stride * 4] + pixel, -128, 127);
dst[offset + stride * 5] = (byte) MathUtil.clip(dst[offset + stride * 5] + pixel, -128, 127);
dst[offset + stride * 6] = (byte) MathUtil.clip(dst[offset + stride * 6] + pixel, -128, 127);
dst[offset + stride * 7] = (byte) MathUtil.clip(dst[offset + stride * 7] + pixel, -128, 127);
continue;
}
X0 = (block[i + 8 * 0] << 8) + 8192;
X8 = W7 * (X4 + X5) + 4;
X4 = (X8 + (W1 - W7) * X4) >> 3;
X5 = (X8 - (W1 + W7) * X5) >> 3;
X8 = W3 * (X6 + X7) + 4;
X6 = (X8 - (W3 - W5) * X6) >> 3;
X7 = (X8 - (W3 + W5) * X7) >> 3;
X8 = X0 + X1;
X0 -= X1;
X1 = W6 * (X3 + X2) + 4;
X2 = (X1 - (W2 + W6) * X2) >> 3;
X3 = (X1 + (W2 - W6) * X3) >> 3;
X1 = X4 + X6;
X4 -= X6;
X6 = X5 + X7;
X5 -= X7;
X7 = X8 + X3;
X8 -= X3;
X3 = X0 + X2;
X0 -= X2;
X2 = (181 * (X4 + X5) + 128) >> 8;
X4 = (181 * (X4 - X5) + 128) >> 8;
dst[offset + stride * 0] = (byte) MathUtil.clip(dst[offset + stride * 0] + ((X7 + X1) >> 14), -128, 127);
dst[offset + stride * 1] = (byte) MathUtil.clip(dst[offset + stride * 1] + ((X3 + X2) >> 14), -128, 127);
dst[offset + stride * 2] = (byte) MathUtil.clip(dst[offset + stride * 2] + ((X0 + X4) >> 14), -128, 127);
dst[offset + stride * 3] = (byte) MathUtil.clip(dst[offset + stride * 3] + ((X8 + X6) >> 14), -128, 127);
dst[offset + stride * 4] = (byte) MathUtil.clip(dst[offset + stride * 4] + ((X8 - X6) >> 14), -128, 127);
dst[offset + stride * 5] = (byte) MathUtil.clip(dst[offset + stride * 5] + ((X0 - X4) >> 14), -128, 127);
dst[offset + stride * 6] = (byte) MathUtil.clip(dst[offset + stride * 6] + ((X3 - X2) >> 14), -128, 127);
dst[offset + stride * 7] = (byte) MathUtil.clip(dst[offset + stride * 7] + ((X7 - X1) >> 14), -128, 127);
}
}
public static void idctRows(short[] block) {
int X0, X1, X2, X3, X4, X5, X6, X7, X8;
for (int i = 0; i < 8; i++) {
int offset = i << 3;
if (((X1 = block[offset + 4] << 11) | (X2 = block[offset + 6]) | (X3 = block[offset + 2])
| (X4 = block[offset + 1]) | (X5 = block[offset + 7]) | (X6 = block[offset + 5])
| (X7 = block[offset + 3])) == 0) {
block[offset] = block[offset + 1] = block[offset + 2] = block[offset + 3] = block[offset
+ 4] = block[offset + 5] = block[offset + 6] = block[offset + 7] = (short) (block[offset] << 3);
continue;
}
X0 = (block[offset] << 11) + 128;
X8 = W7 * (X4 + X5);
X4 = X8 + (W1 - W7) * X4;
X5 = X8 - (W1 + W7) * X5;
X8 = W3 * (X6 + X7);
X6 = X8 - (W3 - W5) * X6;
X7 = X8 - (W3 + W5) * X7;
X8 = X0 + X1;
X0 -= X1;
X1 = W6 * (X3 + X2);
X2 = X1 - (W2 + W6) * X2;
X3 = X1 + (W2 - W6) * X3;
X1 = X4 + X6;
X4 -= X6;
X6 = X5 + X7;
X5 -= X7;
X7 = X8 + X3;
X8 -= X3;
X3 = X0 + X2;
X0 -= X2;
X2 = (181 * (X4 + X5) + 128) >> 8;
X4 = (181 * (X4 - X5) + 128) >> 8;
block[offset] = (short) ((X7 + X1) >> 8);
block[offset + 1] = (short) ((X3 + X2) >> 8);
block[offset + 2] = (short) ((X0 + X4) >> 8);
block[offset + 3] = (short) ((X8 + X6) >> 8);
block[offset + 4] = (short) ((X8 - X6) >> 8);
block[offset + 5] = (short) ((X0 - X4) >> 8);
block[offset + 6] = (short) ((X3 - X2) >> 8);
block[offset + 7] = (short) ((X7 - X1) >> 8);
}
}
}
| [
"zhukov.alex@gmail.com"
] | zhukov.alex@gmail.com |
83953032759d024a0644ac3a77a150a65b8f5341 | 77d08aaa311e9e59b857ea99a37e05a49fc9aa21 | /VeryGoodBookLibary/src/vgb/test/TestProperties.java | bda171dd98b0b2169816160912a7421a7398aa11 | [] | no_license | stardust220/verygoodbooks_Project | 8eb52dcf751daf15e6efe8021c431fcdc1aeafc3 | 7198dd8cf4056a60643cd02360eb3985d4a87e91 | refs/heads/master | 2021-01-19T12:22:37.739881 | 2016-09-30T10:30:55 | 2016-09-30T10:30:55 | 69,634,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,116 | 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 vgb.test;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Administrator
*/
public class TestProperties {
public static void main(String[] args) {
Properties props = new Properties();
System.out.println(props.getProperty("mydata1", "456"));
System.out.println(System.getProperty("user.dir")); //working path
System.out.println(System.getProperty("user.name")); //user name
System.out.println(System.getProperty("file.encoding")); //UTF-8
props = System.getProperties();
props.setProperty("mydata", "一佴参");
System.out.println(props.getProperty("mydata"));
System.out.println(props.getProperty("user.dir")); //working path
System.out.println(props.getProperty("user.name")); //user name
System.out.println(props.getProperty("file.encoding")); //UTF-8
//FileWriter writer = new FileWriter("test.properties"); //無法指定編碼
File dir = new File("conf");
if(!dir.exists()){
dir.mkdir();
}
File file = new File(dir, "test.properties");
try (FileOutputStream out = new FileOutputStream(file);
BufferedOutputStream bout = new BufferedOutputStream(out);
OutputStreamWriter writer = new OutputStreamWriter(bout, "UTF-8");){
props.store(writer, "測試如何寫入Properties");
System.out.println(file.getAbsoluteFile());
} catch (IOException ex) {
Logger.getLogger(TestProperties.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| [
"r01941003@gmail.com"
] | r01941003@gmail.com |
8ed85e28832167ec97ae3207821cc4ba77caad38 | e3ec4e4c3e755e197adff5e22787ecb34a862cd1 | /app/src/main/java/recruitapp/ittproject3/com/recruitmentapp/JobApplicationFragment.java | 30b16dba2ccb923c9578b4efcb979c8fbb257af1 | [] | no_license | Andy----/RecruitmentApp | 996434b551bf2df981ebed369d3f115f21e5da52 | a3befd4ed7d25f5dfec2eea20c602e41605c934d | refs/heads/master | 2020-05-19T12:19:07.695219 | 2015-05-01T13:10:20 | 2015-05-01T13:10:20 | 29,937,260 | 0 | 1 | null | 2015-04-08T22:14:39 | 2015-01-27T22:05:03 | Java | UTF-8 | Java | false | false | 9,649 | java | package recruitapp.ittproject3.com.recruitmentapp;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.VolleyLog;
import com.android.volley.toolbox.JsonArrayRequest;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import recruitapp.ittproject3.com.recruitmentapp.Models.JobApplication;
import recruitapp.ittproject3.com.recruitmentapp.helper.*;
/**
* INTERVIEW SCREEN FRAGMENT.
*/
public class JobApplicationFragment extends Fragment {
/**
* The fragment argument representing the section number for this
* fragment.
*/
private static final String ARG_SECTION_NUMBER = "section_number";
private static final String TAG = JobApplication.class.getSimpleName();
private SQLiteHandler db;
private ProgressDialog pDialog;
private List<JobApplication> jobApplicationList;
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static JobApplicationFragment newInstance(int sectionNumber) {
JobApplicationFragment fragment = new JobApplicationFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
public JobApplicationFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_job_application_screen, container, false);
return rootView;
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
((UserProfileInterviewScreenActivity) activity).onSectionAttached(
getArguments().getInt(ARG_SECTION_NUMBER));
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// Progress dialog
pDialog = new ProgressDialog(this.getActivity());
pDialog.setCancelable(false);
jobApplicationList = new ArrayList<>();
db = new SQLiteHandler(getActivity().getApplicationContext());
getInterviews(db.getUserDetails().get("email"));
}
/**
* function to retrieve all job applications for user
* This method calls on the displayJobApplications method after the job application list has been filled
* */
private void getInterviews(final String email) {
pDialog.setMessage("Retrieving Account Info ...");
showDialog();
Map<String, String> postParams = new HashMap<String, String>();
postParams.put("email", email);
JsonArrayRequest jsonObjReq = new JsonArrayRequest(Request.Method.POST, AppConfig.URL_GET_INTERVIEWS, new JSONObject(postParams),
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
Log.d(TAG, response.toString());
pDialog.setMessage(response.toString());
hideDialog();
try {
// Check for error node in json
if (response != null) {
for (int i = 0; i < response.length(); i++) {
JSONObject jsonObject = response.getJSONObject(i);
JobApplication ja = new JobApplication(jsonObject.getLong("app_id"), jsonObject.getLong("job_id"), jsonObject.getString("job_title"), jsonObject.getString("job_description"), jsonObject.getString("job_location"), jsonObject.getString("status"));
jobApplicationList.add(ja);
// db.addJobApplication(jsonObject.getLong("app_id"), jsonObject.getLong("job_id"), jsonObject.getString("job_title"), jsonObject.getString("job_description"), jsonObject.getString("job_location"), jsonObject.getString("status"));
}
displayJobApplications();
}
} catch (Exception e) {
// JSON error
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.d(TAG, "Error: " + error.getMessage());
hideDialog();
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json");
headers.put( "charset", "utf-8");
return headers;
}
};
// Adding request to request queue
VolleyApplication.getInstance().addToRequestQueue(jsonObjReq);
}
public void displayJobApplications() {
LinearLayout ll = (LinearLayout)(this.getActivity().findViewById(R.id.jobApplicationLinearLayout));
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(0, 20, 0, 20);
if(jobApplicationList != null) {
for (int i = 0; i < jobApplicationList.size(); i++) {
final Long jobId = jobApplicationList.get(i).getJobId();
final Long applicationId = jobApplicationList.get(i).getAppId();
LinearLayout newll = new LinearLayout(this.getActivity());
newll.setOrientation(LinearLayout.VERTICAL);
newll.setPadding(0, 40, 0, 40);
newll.setBackground(getResources().getDrawable(R.drawable.layout_border));
TextView jobTitle = new TextView(this.getActivity());
jobTitle.setText("Title: \t\t\t\t\t" + jobApplicationList.get(i).getJob_title());
jobTitle.setTextColor(getResources().getColor(R.color.white));
newll.addView(jobTitle);
TextView jobLocation = new TextView(this.getActivity());
jobLocation.setText("Location: \t" + jobApplicationList.get(i).getJob_location());
jobLocation.setTextColor(getResources().getColor(R.color.white));
newll.addView(jobLocation);
TextView jobID = new TextView(this.getActivity());
jobID.setText("Job ID: \t\t\t" + jobApplicationList.get(i).getJobId());
jobID.setTextColor(getResources().getColor(R.color.white));
newll.addView(jobID);
TextView jobStatus = new TextView(this.getActivity());
jobStatus.setText("Status: \t\t\t" + jobApplicationList.get(i).getStatus());
jobStatus.setTextColor(getResources().getColor(R.color.white));
// if(jobApplicationList.get(i).getStatus().equals("submitted")) {jobStatus.setBackgroundColor(getResources().getColor(R.color.danger));}
// else if(jobApplicationList.get(i).getStatus().equals("accepted")) {jobStatus.setBackgroundColor(getResources().getColor(R.color.warning));}
// else if(jobApplicationList.get(i).getStatus().equals("interview")) {jobStatus.setBackgroundColor(getResources().getColor(R.color.success));}
newll.addView(jobStatus);
if (jobApplicationList.get(i).getStatus().equals("interview")) {
Button button = new Button(this.getActivity());
button.setId(i);
button.setText("Start Interview");
button.setBackgroundColor(getResources().getColor(R.color.light_blue));
button.setTextColor(getResources().getColor(R.color.white));
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent(getActivity(), InterviewStartScreenActivity.class);
intent.putExtra("jobId", jobId);
intent.putExtra("applicationId", applicationId);
startActivity(intent);
}
});
newll.addView(button, layoutParams);
}
ll.addView(newll, layoutParams);
}
}
// Toast.makeText(getActivity().getApplicationContext(), jobApplicationList.size()+" Job Applications On File", Toast.LENGTH_LONG).show();
}
private void showDialog() {
if (!pDialog.isShowing())
pDialog.show();
}
private void hideDialog() {
if (pDialog.isShowing())
pDialog.dismiss();
}
} | [
"andypollard84@gmail.com"
] | andypollard84@gmail.com |
a33db171d423b5563a37c6ab0bb541f57f0ff9d0 | 216b2aaa10e2bacc84a560e9f7523f9d9e9ddb44 | /app/src/main/java/com/badoystudio/jelajahlebak/splashscreen.java | 93489292c7938ac29d6b5a532f8d4cdd5ba5d10b | [] | no_license | guntoro12/jelajahlebak | e7e973afcf6a56faec88307d1f31cab5b02310d4 | 4d97cc12c888ae6db8da3b0f497214bc08dcf091 | refs/heads/master | 2021-01-19T13:08:53.180847 | 2017-08-20T00:00:57 | 2017-08-20T00:00:57 | 100,827,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,340 | java | package com.badoystudio.jelajahlebak;
import android.support.v7.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;
//Created by Fathur (okedroid.com)
public class splashscreen extends AppCompatActivity {
//Set waktu lama splashscreen
private static int splashInterval = 2000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.splashscreen);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
Intent i = new Intent(splashscreen.this, MainActivity.class);
startActivity(i); // menghubungkan activity splashscren ke main activity dengan intent
//jeda selesai Splashscreen
this.finish();
}
private void finish() {
// TODO Auto-generated method stub
}
}, splashInterval);
};
}
| [
"guntoroagun@gmail.com"
] | guntoroagun@gmail.com |
65207c3abac3aa9f42aacbc37ec6a04dcb515cfe | 7cbd210808dacf3a21c0ad291feff450704efa93 | /algae-client-server/src/main/java/edu/odu/cs/AlgAE/Server/MenuGenerator.java | 6a059c9ddb9a5c674325c61c1e037180b36abfed | [
"LicenseRef-scancode-warranty-disclaimer",
"ECL-1.0"
] | permissive | sjzeil/AlgAE | ba4d7f56dd774da090176ff9f5667428f38230a1 | cdbe4a38f317f4fab0ab20cde4ed9d83d650347d | refs/heads/master | 2023-06-21T19:55:23.450615 | 2023-06-16T18:05:10 | 2023-06-16T18:05:10 | 19,076,217 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,063 | java | package edu.odu.cs.AlgAE.Server;
/**
* Interface to classes that can be used for generating AlgAE algorithm
* menus.
**/
public interface MenuGenerator
{
/**
* Each animation overrides this function to set up a menu of
* algorithms that can be selected for animation.
*/
public void buildMenu();
/**
* Called from buildMenu to add an item to the Algorithm menu.
*/
public void register(String menuItem, MenuFunction action);
/**
* Called from buildMenu to register an initial action to be
* run at the start of the animation, before any selections
* from the menu.
*/
public void registerStartingAction (MenuFunction action);
/**
* Supply a message to appear in the Help..About dialog.
* Typically, this indicates the origin of the source code
* being animated and the name of the person who prepared the
* animation.
*
* This can also be a useful way to supply hints about what you
* would like people running the animation to try.
*
**/
public String about();
}
| [
"zeil@cs.odu.edu"
] | zeil@cs.odu.edu |
f29b74933ad8486869445e3c42bd1ae49e07c0c4 | 412ef59326645437156fc844cf420f2a9b830d8a | /src/com/redcms/dao/imp/ContentAttachmentDaoImp.java | 58db6159c8e10756e6bbe1a921b2df7919fb496b | [] | no_license | langyamoren/redcms | a2f07d87cf87d914bc1f9d27b04cdec9dd77738a | 3529d9a302157836c5c6034deff701656a3a5e9d | refs/heads/master | 2021-01-23T07:35:31.878172 | 2017-06-01T08:37:01 | 2017-06-01T08:37:01 | 93,035,377 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 624 | java | package com.redcms.dao.imp;
import java.sql.SQLException;
import java.util.List;
import com.redcms.beans.ContentAttachment;
import com.redcms.dao.ContentAttachmentDao;
import com.redcms.dao.core.BaseDaoImp;
public class ContentAttachmentDaoImp extends BaseDaoImp<ContentAttachment>
implements ContentAttachmentDao
{
@Override
public List<ContentAttachment> getAttachmentsByContentAndModel(int modelId,
int contentId) throws SQLException {
String sql="select * from content_attachment where content_id=? and model_id=?";
return this.getAll(ContentAttachment.class, sql, new Object[]{contentId,modelId});
}
}
| [
"9703239@qq.com"
] | 9703239@qq.com |
91ab7b09f3f7a8f0250948f07d2d146fc8aa25ce | 793753e64b4eb25476845db57d22b0a7f845d2a9 | /src/main/java/cn/leiyy/modules/package-info.java | f7de9abbfa1d157a333409437615b853724624d6 | [
"Apache-2.0"
] | permissive | 13211331331/guns | e63c36677fe0311816aed7fbe0695ec6d3152a39 | b77b002ed71614fc398c8ce86ee321013be22d86 | refs/heads/master | 2021-01-01T06:08:41.503279 | 2017-08-29T07:48:32 | 2017-08-29T07:48:32 | 97,366,142 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 73 | java | /**
* Created by hanlin.huang on 2017/8/6.
*/
package cn.leiyy.modules; | [
"280468298@qq.com"
] | 280468298@qq.com |
70785fe3ddca8a084d0bf12dd8a8f179dfc7a42c | d885d7181d0923d0d3e5b7a915405125775ed878 | /TransportControl/src/transportManagement/supportClasses/NullTransition.java | 45320d2490d333cb6324873e991e409c072494f1 | [] | no_license | 3volve/TransportControl | 9a6401feddfde438a5d06f0e0d009cfbdc00d471 | d9c2b0bf82be03d401bdc8ddfe67e95e89ecc831 | refs/heads/master | 2020-04-26T00:44:33.523484 | 2019-05-21T16:44:39 | 2019-05-21T16:44:39 | 173,188,049 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package transportManagement.supportClasses;
import transportManagement.Transition;
public class NullTransition extends Transition {
public NullTransition() { super("", "This is a null transition.", null, null); }
protected boolean hasCities(String orig, String... dest) { return false; }
public void printSimpleString() {}
public String toViewingString() { return "This is a Null Transition."; }
@Override
public String toString() { return "NULL"; }
}
| [
"evolve95@gmail.com"
] | evolve95@gmail.com |
77afeff8b1093a6df0e44b4bb596c9ace26dff18 | ef14229979d26a08ac348b6e6ca62b41766c0af5 | /rh-admin/src/main/java/com/ntnikka/datasources/DataSourceNames.java | de43aaeee7f295ab73013f878361ac490c151972 | [] | no_license | dalu8888/rh-epframe-v1 | 861c6eade0af5e274cb6f09a6a2783793f3c3922 | 905ccf32d9036931758aad1f5e17ecc7c1739c46 | refs/heads/master | 2021-04-12T03:50:03.796820 | 2018-05-03T11:45:06 | 2018-05-03T11:45:06 | 125,827,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package com.ntnikka.datasources;
/**
* 增加多数据源,在此配置
*
* @author chenshun
*/
public interface DataSourceNames {
String FIRST = "first";
String SECOND = "second";
}
| [
"408462247@qq.com"
] | 408462247@qq.com |
89368b5dfd3332dca40cbdf6d7aefe56d5af14ef | 70c783f031a183c92324a7ec2aa9302b115fba0e | /android/app/src/main/java/com/bhekelapp/MainApplication.java | 933a63ddfdcc7097228676043b9dfe86b9b7d3d1 | [] | no_license | arternauta/bhekelApp | 49763324de1a134336dcea32376b2dff8c8f35dd | 72ffdaf2ec5b4f3fa21e821aaeea565b217ea5f4 | refs/heads/master | 2021-01-12T08:08:18.218739 | 2016-12-22T10:07:20 | 2016-12-22T10:07:20 | 76,479,431 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,032 | java | package com.bhekelapp;
import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.horcrux.svg.RNSvgPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage(),
new RNSvgPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}
| [
"arternauta@gmail.com"
] | arternauta@gmail.com |
d5a9e35671752b7a58bf30297de241ad1d65e3cf | 52bb643078a8ad02f080deb75823cdba954430f0 | /src/main/java/academy/academyhelper/Post.java | 4c17ece984fe6f28061d5eb789026d06d03f0db7 | [] | no_license | Jernsten/academyhelper | ad908b1edba7ab0df0d2fd1ae899bb364cdbe413 | 872ba23d80cf0cbd5ada4913d91e1e6c4fe0344c | refs/heads/master | 2021-08-30T05:55:16.231978 | 2017-12-16T09:08:33 | 2017-12-16T09:08:33 | 113,024,441 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,600 | java | package academy.academyhelper;
public class Post {
private int id;
private int userId;
private String content;
private String timestamp;
private int likes;
private int topicId;
private String name;
public Post() {
}
public Post(int id, int userId, String content, String timestamp, int likes, int topicId, String name) {
this.id = id;
this.userId = userId;
this.content = content;
this.timestamp = timestamp;
this.likes = likes;
this.topicId = topicId;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
public int getLikes() {
return likes;
}
public void setLikes(int likes) {
this.likes = likes;
}
public int getTopicId() {
return topicId;
}
public void setTopicId(int topicId) {
this.topicId = topicId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"demirtas@kth.se"
] | demirtas@kth.se |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.