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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d91f732c58c4f0f7ef02ee81434b3969095498e | 8ab09621ff26103fa480694a42c3d268683bd0e1 | /src/com/jeecms/cms/manager/main/impl/ActivityCommentMngImpl.java | e479daeca99cc971167a628de242571621eb8fc4 | [] | no_license | zyhwyl/lewall | 4fc75a102817ec913246798d47ef3bb1b4d74f0a | 4e3c3623ac98970de10f5724e7d02fcf4a3aaaec | refs/heads/master | 2020-05-17T21:28:21.784475 | 2014-03-10T08:47:34 | 2014-03-10T08:47:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,302 | java | package com.jeecms.cms.manager.main.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeecms.cms.dao.main.ActivityCommentDao;
import com.jeecms.cms.dao.main.ActivityCountryDao;
import com.jeecms.cms.dao.main.ActivityDao;
import com.jeecms.cms.dao.main.ChannelExtDao;
import com.jeecms.cms.entity.main.Activity;
import com.jeecms.cms.entity.main.ActivityComment;
import com.jeecms.cms.entity.main.ActivityCountry;
import com.jeecms.cms.entity.main.Channel;
import com.jeecms.cms.entity.main.ChannelExt;
import com.jeecms.cms.manager.main.ActivityCommentMng;
import com.jeecms.cms.manager.main.ActivityCountryMng;
import com.jeecms.cms.manager.main.ActivityMng;
import com.jeecms.cms.manager.main.ChannelExtMng;
import com.jeecms.common.hibernate3.Updater;
import com.jeecms.common.page.Pagination;
@Service
@Transactional
public class ActivityCommentMngImpl implements ActivityCommentMng {
private ActivityCommentDao dao;
@Autowired
public void setDao(ActivityCommentDao dao) {
this.dao = dao;
}
@Override
public ActivityComment save(ActivityComment bean) {
return dao.save(bean);
}
@Override
public ActivityComment updateByUpdater(Updater<ActivityComment> updater) {
return dao.updateByUpdater(updater);
}
@Override
public ActivityComment deleteById(Integer id) {
return dao.deleteById(id);
}
@Override
public Pagination getPaginationByProperities(String[] keys,
Object[] values, int pageNo, int pageSize) {
return dao.getPaginationByProperities(keys, values, pageNo, pageSize);
}
@Override
public ActivityComment findById(Integer id) {
return dao.findById(id);
}
@Override
public List getListByProperities(String[] keys,
Object[] values) {
return dao.getListByProperities(keys, values);
}
@Override
public Pagination getPaginationByProperities(String[] keys,
Object[] values, int pageNo, int pageSize, String order) {
return dao.getPaginationByProperities(keys, values, pageNo, pageSize, order);
}
@Override
public List<ActivityComment> getListByProperities(String[] keys,
Object[] values, String order) {
return dao.getListByProperities(keys, values, order);
}
} | [
"zyh19880605@gmail.com"
] | zyh19880605@gmail.com |
4edf0f8d3e065071cc4b88de006fcd3933a05348 | 49d91510adbc40151ab7000b3eb25d0ca3f12ed4 | /src/test/java/tests/day08/C03_SoftAssertTest.java | 38a4d6f6df7a2c28105f4e30d9b7c63ba3ffced9 | [] | no_license | zynpblt/com.GroupWorkMavenTestNG | 96ab14aa2c1f9951f0c42039765712e3a44966bd | 5c834e06d3ec6cc10771e71c73989509b193f88d | refs/heads/main | 2023-09-02T20:33:13.110041 | 2021-10-22T11:24:42 | 2021-10-22T11:24:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,539 | java | package tests.day08;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
public class C03_SoftAssertTest {
// //Yeni bir Class Olusturun : D10_SoftAssertTest
// //1. “http://zero.webappsecurity.com/” Adresine gidin
// // 2. Sign in butonuna basin
// // 3. Login kutusuna “username” yazin
// // 4. Password kutusuna “password.” yazin
// // 5. Sign in tusuna basin
// // 6. Pay Bills sayfasina gidin
// // 7. “Purchase Foreign Currency” tusuna basin
// // 8. “Currency” drop down menusunden Eurozone’u secin
// // 9. soft assert kullanarak "Eurozone (Euro)" secildigini test edin
// // 10. soft assert kullanarak DropDown listesinin su secenekleri oldugunu test edin "Select One", "Australia (dollar)",
// // "Canada (dollar)","Switzerland (franc)","China (yuan)","Denmark (krone)","Eurozone (euro)","Great Britain (pound)","Hong Kong (dollar)",
// // "Japan (yen)","Mexico (peso)","Norway (krone)","New Zealand (dollar)","Sweden (krona)","Singapore (dollar)","Thailand (baht)"
WebDriver driver;
@BeforeClass
public void setUp(){
WebDriverManager.chromedriver().setup();
driver=new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
}
@Test
public void test(){
driver.get("http://zero.webappsecurity.com/");
driver.findElement(By.id("signin_button")).click();
driver.findElement(By.id("user_login")).sendKeys("username");
driver.findElement(By.id("user_password")).sendKeys("password");
driver.findElement(By.name("submit")).click();
driver.get("http://zero.webappsecurity.com/");
driver.findElement(By.xpath("//strong[text()='Online Banking']")).click();
driver.findElement(By.id("pay_bills_link")).click();
driver.findElement(By.linkText("Purchase Foreign Currency")).click();
// 8. “Currency” drop down menusunden Eurozone’u secin
WebElement dropdown=driver.findElement(By.id("pc_currency"));
Select select=new Select(dropdown);
select.selectByValue("EUR");
// // 9. soft assert kullanarak "Eurozone (Euro)" secildigini test edin
String actualData=select.getFirstSelectedOption().getText();
String expectedData="Eurozone (euro)";
SoftAssert softAssert=new SoftAssert();
softAssert.assertEquals(actualData,expectedData,"secilen option Euro zone degil");
// // 10. soft assert kullanarak DropDown listesinin su secenekleri oldugunu test edin
// "Select One", "Australia (dollar)",
// "Canada (dollar)","Switzerland (franc)","China (yuan)","Denmark (krone)",
// "Eurozone (euro)",
// "Great Britain (pound)","Hong Kong (dollar)",
// "Japan (yen)","Mexico (peso)","Norway (krone)",
// "New Zealand (dollar)","Sweden (krona)","Singapore (dollar)","Thailand (baht)"
List<WebElement> allOptions= select.getOptions();
List<String> allOptionsString=new ArrayList<>();
for (WebElement element:allOptions)
{ allOptionsString.add(element.getText());
}
List<String> expectedOptionList= Arrays.asList("Select One", "Australia (dollar)",
"Canada (dollar)","Switzerland (franc)","China (yuan)","Denmark (krone)",
"Eurozone (euro)",
"Great Britain (pound)","Hong Kong (dollar)",
"Japan (yen)","Mexico (peso)","Norway (krone)",
"New Zealand (dollar)","Sweden (krona)","Singapore (dollar)","Thailand (baht)");
//softAssert.assertEquals(allOptionsString,expectedOptionList,"Liste farkli");
Assert.assertEquals(allOptionsString,expectedOptionList,"liste farkli");
softAssert.assertAll();
}
@AfterClass
public void tearDown(){
driver.close();
}
}
| [
"fzaydin6636@gmail.com"
] | fzaydin6636@gmail.com |
26c1adab843e418e606b1a17eeffceac017bc0b1 | f7db152aad119932554b98bad1344a79b7658fc2 | /app/src/main/java/com/crowderia/recyclerviewproject/utilities/CheckNetwork.java | 008b3db388b681df34150a687eddd1902bef74af | [] | no_license | cagline/retrofit-2-recycler-view | fdcc41d3214e46bbb0e21486f38d7df9f4649a16 | 4ab39e3322d58963e51b8a534205648b65aa9c29 | refs/heads/master | 2021-01-20T12:51:46.899325 | 2017-09-07T06:28:00 | 2017-09-07T06:28:00 | 101,727,763 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,006 | java | package com.crowderia.recyclerviewproject.utilities;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
/**
* Created by crowderia on 9/1/17.
*/
public class CheckNetwork {
private static final String TAG = CheckNetwork.class.getSimpleName();
public static boolean isInternetAvailable(Context context)
{
NetworkInfo info = (NetworkInfo) ((ConnectivityManager)
context.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
if (info == null)
{
Log.d(TAG,"no internet connection");
return false;
}
else
{
if(info.isConnected())
{
Log.d(TAG," internet connection available...");
return true;
}
else
{
Log.d(TAG," internet connection");
return true;
}
}
}
}
| [
"chanuka@crowderia.com"
] | chanuka@crowderia.com |
4ca64467359c2a06d14ff89a09fe7e1b4d98cf06 | 7abeae5aa8f2374df600b229b851d51b0a2ec025 | /FitSDKRelease_21.40.00/java/com/garmin/fit/MesgWithEventListener.java | 2f601ec5b83e989199ee3b03677ada71adcfe30b | [
"Apache-2.0"
] | permissive | JoyKuan/ArchitecturalDesign_AI | c66ffe0a98a67b6a36a6ffb60071e9a97de90014 | 71442dcfdba20564a772a6807e43cbb86dafc14d | refs/heads/main | 2023-02-28T07:45:46.378995 | 2021-02-02T21:54:55 | 2021-02-02T21:54:55 | 322,163,300 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,076 | java | ////////////////////////////////////////////////////////////////////////////////
// The following FIT Protocol software provided may be used with FIT protocol
// devices only and remains the copyrighted property of Garmin Canada Inc.
// The software is being provided on an "as-is" basis and as an accommodation,
// and therefore all warranties, representations, or guarantees of any kind
// (whether express, implied or statutory) including, without limitation,
// warranties of merchantability, non-infringement, or fitness for a particular
// purpose, are specifically disclaimed.
//
// Copyright 2020 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.40Release
// Tag = production/akw/21.40.00-0-g813c158
////////////////////////////////////////////////////////////////////////////////
package com.garmin.fit;
public interface MesgWithEventListener {
public void onMesg(MesgWithEvent message);
}
| [
"kuanhuil@usc.edu"
] | kuanhuil@usc.edu |
9a3c42bbb36cbe9cd79db1e10b39ba9751d0aacf | c1504a609901a2a3ab234fc5dcc1588a14e54d19 | /src/Lab1/CodeChallenge3/CC3.java | a7c95a571a6485b62dff7c9549acfa285a5c9b8b | [] | no_license | motoc96/AtelierDigital2020 | c77abc8ff00e8e89a0d62b11b8bd9b1411e64286 | cb5f2f9ba33512935789eca35b69c4e45c8760d7 | refs/heads/master | 2023-02-07T02:48:23.722139 | 2020-07-04T23:55:56 | 2020-07-04T23:55:56 | 255,424,780 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,106 | java | package Lab1.CodeChallenge3;
public class CC3 {
public int Pairof2 (){
int vector[]={5,9,-5,7,-5};
int result=0;
for(var i=0; i<vector.length;i++){
System.out.println(vector[i]);
for(var j=vector.length-1; j>0;j--){
if(vector[i] + vector[j] == 0 && vector[i] != 0){
System.out.println(vector[j]);
vector[i]=0;
vector[j]=0;
result=+1;
}
}
}
return result;
}
public int Pairof3(){
int vector[]={-1,-1,-1,2};
int result = 0;
for(var i=0;i<vector.length;i++){
for(var j=vector.length-1;j>0;j--){
for(var k=1;k<vector.length;k++){
if(vector[i] + vector[j] + vector[k] == 0 && vector[i] !=0 ){
vector[i]=0;
vector[j]=0;
vector[k]=0;
result=+1;
}
}
}
}
return result;
}
}
| [
"motoc.rc96@gmail.com"
] | motoc.rc96@gmail.com |
9e56c8e47de2133a67d774ef8e45e4f13a6a24b8 | 7fd9a24763387cb3abd8b203f545b8792d17a7a0 | /ShowYouAndroid/src/es/ulpgc/eite/showyou/android/screen/view/I_StartPageView.java | a1e2130543bc88946d817f165a9b4dafa9cc0a97 | [] | no_license | sarashdez/InProcess_App | 2fa920bcee8b5083fad1eb002e0ce56bfa428b77 | f60ef4db269b50a002c8c1297230c58bb71ecb59 | refs/heads/master | 2021-01-21T04:50:27.142839 | 2016-03-25T12:59:30 | 2016-03-25T12:59:30 | 54,139,141 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 113 | java | package es.ulpgc.eite.showyou.android.screen.view;
public interface I_StartPageView {
void setLayout();
}
| [
"sara.shdez@gmail.com"
] | sara.shdez@gmail.com |
a115f843468453b1296c6c2a4a9071c70bab3f52 | e924221cc30625a6602a3e53dc043cf41c8af336 | /LinkedListDequeTest.java | dd6d7efe438fdd0daf21142f0219b5d450d5826c | [
"MIT"
] | permissive | yashgoenka/Double-Ended-Queue | 9f617a278586240b75f6c43060fee755942eef90 | e40d3861c91eac5ae99959f845caa0b457e34303 | refs/heads/master | 2020-03-25T13:21:35.242673 | 2018-08-07T04:57:19 | 2018-08-07T04:57:19 | 143,821,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,806 | java | /** Performs some basic linked list tests. */
public class LinkedListDequeTest {
/* Utility method for printing out empty checks. */
public static boolean checkEmpty(boolean expected, boolean actual) {
if (expected != actual) {
System.out.println("isEmpty() returned " + actual + ", but expected: " + expected);
return false;
}
return true;
}
/* Utility method for printing out empty checks. */
public static boolean checkSize(int expected, int actual) {
if (expected != actual) {
System.out.println("size() returned " + actual + ", but expected: " + expected);
return false;
}
return true;
}
/* Prints a nice message based on whether a test passed.
* The \n means newline. */
public static void printTestStatus(boolean passed) {
if (passed) {
System.out.println("Test passed!\n");
} else {
System.out.println("Test failed!\n");
}
}
/** Adds a few things to the list, checking isEmpty() and size() are correct,
* finally printing the results.
*
* && is the "and" operation. */
public static void addIsEmptySizeTest() {
System.out.println("Running add/isEmpty/Size test.");
LinkedListDeque<String> lld1 = new LinkedListDeque<String>();
boolean passed = checkEmpty(true, lld1.isEmpty());
lld1.addFirst("front");
// The && operator is the same as "and" in Python.
// It's a binary operator that returns true if both arguments true, and false otherwise.
passed = checkSize(1, lld1.size()) && passed;
passed = checkEmpty(false, lld1.isEmpty()) && passed;
lld1.addLast("middle");
passed = checkSize(2, lld1.size()) && passed;
lld1.addLast("back");
passed = checkSize(3, lld1.size()) && passed;
System.out.println("Printing out deque: ");
lld1.printDeque();
printTestStatus(passed);
}
/** Adds an item, then removes an item, and ensures that dll is empty afterwards. */
public static void addRemoveTest() {
System.out.println("Running add/remove test.");
LinkedListDeque<Integer> lld1 = new LinkedListDeque<Integer>();
// should be empty
boolean passed = checkEmpty(true, lld1.isEmpty());
lld1.addFirst(10);
// should not be empty
passed = checkEmpty(false, lld1.isEmpty()) && passed;
lld1.removeFirst();
// should be empty
passed = checkEmpty(true, lld1.isEmpty()) && passed;
printTestStatus(passed);
}
public static void main(String[] args) {
System.out.println("Running tests.\n");
addIsEmptySizeTest();
addRemoveTest();
}
}
| [
"yash@berkeley.edu"
] | yash@berkeley.edu |
5d4054b56ebb19d76269cb38f53687a7979bb2b9 | ea8568898a20e3a8a3c91c72d41ddaf29dcebd75 | /ITC515_assignment2/src/datamanagement/Student.java | ee828e9b613cb7f689cef9151336f69bb38b7e9c | [] | no_license | aamerk2/Code-Debuggers | 66390627c60ecf805452c534086492dd160f29a1 | 2aa57e08ad9737372a1f6db83b43f282aa69d7df | refs/heads/master | 2020-05-21T17:54:36.363975 | 2016-09-19T08:56:48 | 2016-09-19T08:56:48 | 64,348,514 | 1 | 2 | null | 2016-09-19T10:45:00 | 2016-07-27T23:30:47 | Java | UTF-8 | Java | false | false | 1,131 | java | package datamanagement;
public class Student implements IStudent {
private Integer id; // id of integer type
private String fn;// fn of String type
private String ln; // lnof String type
private StudentUnitRecordList su;//su of type StudentUnitrecordList property
public Student(Integer id, String fn, String ln, StudentUnitRecordList su) {
this.id = id;
this.fn = fn;
this.ln = ln;
this.su = su == null ? new StudentUnitRecordList() : su;
}
public Integer getID() { // Property getID
return this.id;
}
public String getFirstName() { // Property getFirstName
return fn;
}
public void setFirstName(String firstName) { // Property setFirstName
this.fn = firstName;
}
public String getLastName() {
return ln;
}
public void setLastName(String lastName) {
this.ln = lastName;
}
public void addUnitRecord(IStudentUnitRecord record) {
su.add(record);
}
public IStudentUnitRecord getUnitRecord(String unitCode) {
for (IStudentUnitRecord r : su)
if (r.getUnitCode().equals(unitCode))
return r;
return null;
}
public StudentUnitRecordList getUnitRecords() {
return su;
}
}
| [
"jawwadaamer@gmail.com"
] | jawwadaamer@gmail.com |
4e362032711edbf3c10d4aed3d60a73ba54689e5 | 8aea95c114e07d043d217f51a30807b4642d49a7 | /testbench/modules/testDataFlow/languages/testCustomAnalyzer/source_gen/testCustomAnalyzer/dataFlow/Child_IntraProcedural_BuilderMode_DataFlow.java | ab90c69832c6bb0c060a7a128374a6616fd60752 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | JetBrains/MPS | ec03a005e0eda3055c4e4856a28234b563af92c6 | 0d2aeaf642e57a86b23268fc87740214daa28a67 | refs/heads/master | 2023-09-03T15:14:10.508189 | 2023-09-01T13:25:35 | 2023-09-01T13:30:22 | 2,209,077 | 1,242 | 309 | Apache-2.0 | 2023-07-25T18:10:10 | 2011-08-15T09:48:06 | JetBrains MPS | UTF-8 | Java | false | false | 837 | java | package testCustomAnalyzer.dataFlow;
/*Generated by MPS */
import jetbrains.mps.lang.dataFlow.DataFlowBuilder;
import jetbrains.mps.lang.dataFlow.DataFlowBuilderContext;
import java.util.Collection;
import jetbrains.mps.lang.dataFlow.framework.IDataFlowModeId;
import java.util.Arrays;
import jetbrains.mps.lang.dataFlow.framework.ConceptDataFlowModeId;
public class Child_IntraProcedural_BuilderMode_DataFlow extends DataFlowBuilder {
public void build(final DataFlowBuilderContext _context) {
_context.getBuilder().emitNop("r:11be8b48-b45e-48e5-98ad-b77dc1b202b1(testCustomAnalyzer.dataFlow)/2955426575105812292");
}
@Override
public Collection<IDataFlowModeId> getModes() {
return Arrays.<IDataFlowModeId>asList(new ConceptDataFlowModeId("jetbrains.mps.lang.dataFlow.structure.IntraProcedural_BuilderMode"));
}
}
| [
"Semen.Alperovich@jetbrains.com"
] | Semen.Alperovich@jetbrains.com |
d900f4d848aaad878e1a67704045e746a5af79c6 | 60330e008ab97af9e3dc5237d67332f9e3c1439f | /jsphomme/src/main/java/kr/co/jsphomme/purchaselist/service/PurchaseListviceImpl.java | 600a877be5ebb2ec40ed5f95dd9f52263f7bec3a | [] | no_license | hyemijung/SpringTeamProject | dad94283c8397ca4498c4bb6a15286592730f29c | 955c8267fe969fb788d121054d39a6ca1a7d53b5 | refs/heads/master | 2020-05-07T17:23:22.028308 | 2019-04-12T10:05:56 | 2019-04-12T10:05:56 | 180,726,531 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | package kr.co.jsphomme.purchaselist.service;
import kr.co.jsphomme.purchaselist.vo.PurchaseListVo;
public class PurchaseListviceImpl implements PurchaseListService{
@Override
public PurchaseListVo purchaseListInsert(PurchaseListVo purchaseListVo) {
// TODO Auto-generated method stub
return null;
}
@Override
public PurchaseListVo purchaseListView(PurchaseListVo purchaseListVo) {
// TODO Auto-generated method stub
return null;
}
@Override
public int purchaseListDelete(int no) {
// TODO Auto-generated method stub
return 0;
}
}
| [
"hyemijung84@gmail.com"
] | hyemijung84@gmail.com |
ddcf6c00a1f580d227e58384e6f89425d93f55c3 | e5079314d2f6f2d52e262251e35a4dd8cdbcef3c | /src/main/java/cz/nizam/bjb/rss/TRss.java | d8709108c391580511843bdf211c9c7313dbee40 | [] | no_license | nizamsyed/best-java-blogs | bdcba30bee94d436d47fde1d2b33f544b1889816 | f8103b8a775ab8ee4c6ec34c42feac0a241a93f2 | refs/heads/master | 2021-01-23T10:20:35.485923 | 2017-06-14T19:14:05 | 2017-06-14T19:14:05 | 93,051,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,989 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2017.06.11 at 11:28:56 PM IST
//
package cz.nizam.bjb.rss;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
* <p>Java class for tRss complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="tRss">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="channel" type="{}tRssChannel" maxOccurs="unbounded"/>
* <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}decimal" fixed="2.0" />
* <anyAttribute/>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "tRss", propOrder = {
"channel",
"any"
})
public class TRss {
@XmlElement(required = true)
protected List<TRssChannel> channel;
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAttribute(required = true)
protected BigDecimal version;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Gets the value of the channel property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the channel property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getChannel().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link TRssChannel }
*
*
*/
public List<TRssChannel> getChannel() {
if (channel == null) {
channel = new ArrayList<TRssChannel>();
}
return this.channel;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getVersion() {
if (version == null) {
return new BigDecimal("2.0");
} else {
return version;
}
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
*/
public void setVersion(BigDecimal value) {
this.version = value;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}
| [
"syednizamvali@gmail.com"
] | syednizamvali@gmail.com |
e0511c99e527a96187ef95b2196646a3b0fd9747 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/spring/generated/src/main/java/org/openapitools/model/ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo.java | afa1d30a137d187c9120d02fd0bea20f549d53d5 | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | Java | false | false | 4,526 | java | package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenProperties;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-08-05T01:13:37.880Z[GMT]")
public class ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo {
@JsonProperty("pid")
private String pid = null;
@JsonProperty("title")
private String title = null;
@JsonProperty("description")
private String description = null;
@JsonProperty("properties")
private ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenProperties properties = null;
public ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo pid(String pid) {
this.pid = pid;
return this;
}
/**
* Get pid
* @return pid
**/
@ApiModelProperty(value = "")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo title(String title) {
this.title = title;
return this;
}
/**
* Get title
* @return title
**/
@ApiModelProperty(value = "")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
**/
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo properties(ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenProperties properties) {
this.properties = properties;
return this;
}
/**
* Get properties
* @return properties
**/
@ApiModelProperty(value = "")
@Valid
public ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenProperties getProperties() {
return properties;
}
public void setProperties(ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo comAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo = (ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo) o;
return Objects.equals(this.pid, comAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo.pid) &&
Objects.equals(this.title, comAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo.title) &&
Objects.equals(this.description, comAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo.description) &&
Objects.equals(this.properties, comAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ComAdobeCqSocialContentFragmentsServicesImplCommunitiesFragmenInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
3487dccf2210eb50c0b8c0690eaa37e39e3f9fb0 | fc16b0bf8f1f5ab72bceffcb7e4165ceb9aebf44 | /SammyUnit12/src/RentalDemo.java | 9c65bdd06a5b5640fd58278e07ea9f83d714bf1d | [] | no_license | SharkTaleLover/My-School-Java-Projects | 36a076c59179abdb8a5d494122c69d16cff038ff | 416dca91f631d8722f4b681eb63aff300ea7aa6a | refs/heads/main | 2023-05-02T20:14:23.884841 | 2021-05-21T15:54:26 | 2021-05-21T15:54:26 | 351,823,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,669 | java | import java.util.InputMismatchException;
import java.util.Scanner;
public class RentalDemo
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int minutesRented, hoursRented, rentalCost, minutesExtra;
Rental[] rentals = new Rental[8];
for(int i = 0; i < rentals.length; i++)
{
while(true)
{
try
{
rentals[i] = new Rental(i + 1, SammysRentalPriceWithMethods.askRental(), SammysRentalPriceWithMethods.askEquipment());
break;
} catch (InputMismatchException e)
{
System.out.println("Please enter in the correct format.");
}
}
}
SammysRentalPriceWithMethods.displayMotto();
System.out.println();
/*
for(int i = 0; i < person3.getHoursRented(); i++)
{
System.out.println("Coupon good for 10% off next rental");
}
*/
System.out.println();
for (Rental rental : rentals)
{
SammysRentalPriceWithMethods.displayRental(rental);
}
while(true) {
System.out.print("Would you like to sort ascending order by (C)ontract price, (#)Contract Number, or (E)quipment Type, or (Q)uit >");
char userChoice = input.next().charAt(0);
if (userChoice == 'Q')
System.exit(0);
while (userChoice != 'C' && userChoice != '#' && userChoice != 'E') {
System.out.print("Please enter again >");
userChoice = input.next().charAt(0);
}
SammysRentalPriceWithMethods.sortRentals(rentals, userChoice);
for (Rental rental : rentals)
{
SammysRentalPriceWithMethods.displayRental(rental);
}
}
/*
SammysRentalPriceWithMethods.displayRental(compareRentals(person1, person2));
System.out.println();
SammysRentalPriceWithMethods.displayRental(compareRentals(person1, person3));
System.out.println();
SammysRentalPriceWithMethods.displayRental(compareRentals(person2, person3));
*/
}
/*
public static Rental compareRentals(Rental r1, Rental r2)
{
SammysRentalPriceWithMethods.displayRental(r1);
SammysRentalPriceWithMethods.displayRental(r2);
if(r1.getHoursRented() * 60 + r1.getMinutesExtra() > r2.getHoursRented() * 60 + r2.getMinutesExtra())
return r1;
else if(r1.getHoursRented() * 60 + r1.getMinutesExtra() < r2.getHoursRented() * 60 + r2.getMinutesExtra())
return r2;
else
return r1;
}
*/
}
| [
"kylecfick@gmail.com"
] | kylecfick@gmail.com |
41a888a3bca02f2e0ee7c6cb2f16f591cb8ff842 | c46f99dbb1ea967302d4ba6f974928c43e0b7eb1 | /src/pptx4j/java/org/pptx4j/pml/CTTLSetBehavior.java | 7e12298af9a782b0280d32cdd3e14918b91b57f0 | [
"Apache-2.0"
] | permissive | manivannans/docx4j | 688320ebde87c6f6d7cd43f32d475eb635d5e9c1 | 777c78a844b98e15c3d472fedd3b3e01e6017327 | refs/heads/master | 2020-12-25T00:50:18.304299 | 2012-05-29T03:59:59 | 2012-05-29T03:59:59 | 4,479,085 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,825 | java | /*
* Copyright 2010, Plutext Pty Ltd.
*
* This file is part of docx4j.
docx4j is licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.pptx4j.pml;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CT_TLSetBehavior complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CT_TLSetBehavior">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="cBhvr" type="{http://schemas.openxmlformats.org/presentationml/2006/main}CT_TLCommonBehaviorData"/>
* <element name="to" type="{http://schemas.openxmlformats.org/presentationml/2006/main}CT_TLAnimVariant" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CT_TLSetBehavior", propOrder = {
"cBhvr",
"to"
})
public class CTTLSetBehavior {
@XmlElement(required = true)
protected CTTLCommonBehaviorData cBhvr;
protected CTTLAnimVariant to;
/**
* Gets the value of the cBhvr property.
*
* @return
* possible object is
* {@link CTTLCommonBehaviorData }
*
*/
public CTTLCommonBehaviorData getCBhvr() {
return cBhvr;
}
/**
* Sets the value of the cBhvr property.
*
* @param value
* allowed object is
* {@link CTTLCommonBehaviorData }
*
*/
public void setCBhvr(CTTLCommonBehaviorData value) {
this.cBhvr = value;
}
/**
* Gets the value of the to property.
*
* @return
* possible object is
* {@link CTTLAnimVariant }
*
*/
public CTTLAnimVariant getTo() {
return to;
}
/**
* Sets the value of the to property.
*
* @param value
* allowed object is
* {@link CTTLAnimVariant }
*
*/
public void setTo(CTTLAnimVariant value) {
this.to = value;
}
}
| [
"jason@plutext.org"
] | jason@plutext.org |
55d7f557d61eabdd9fb2a639595239eea9dd7072 | 184e2007b130592a4096017c5b2d51608ad2bf31 | /src/com/coolweather/app/db/CoolWeatherDB.java | d2b95761340959af0575bbd25793a36ff93a88c1 | [
"Apache-2.0"
] | permissive | tigline/coolweather | 5dbbff7262a502b446ff3ee1e84bac7830aea402 | c8a8be6dc755b70637fa8b44c5bb453c78f3d519 | refs/heads/master | 2021-01-10T02:33:05.441042 | 2015-06-05T07:51:14 | 2015-06-05T07:51:14 | 36,794,387 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 4,101 | java | package com.coolweather.app.db;
import java.util.ArrayList;
import java.util.List;
import com.coolweather.app.model.City;
import com.coolweather.app.model.County;
import com.coolweather.app.model.Province;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
public class CoolWeatherDB {
/**
* 数据库名
*/
public static final String DB_NAME = "cool_weather";
/**
* 数据库版本
*/
public static final int VERSION = 1;
private static CoolWeatherDB coolWeatherDB;
private SQLiteDatabase db;
/**
* 构造方法私有化
*/
private CoolWeatherDB(Context context){
CoolWeatherOpenHelper dbHelper = new CoolWeatherOpenHelper(context, DB_NAME,
null, VERSION);
db = dbHelper.getWritableDatabase();
}
/**
* 获取CoolWeatherDB实例
*/
public synchronized static CoolWeatherDB getInstance(Context context){
if (coolWeatherDB == null) {
coolWeatherDB = new CoolWeatherDB(context);
}
return coolWeatherDB;
}
/**
* 将Province实例存储到数据库
*/
public void saveProvince(Province province){
if (province != null) {
ContentValues values = new ContentValues();
values.put("province_name", province.getProvinceName());
values.put("province_code", province.getProvinceCode());
db.insert("Province", null, values);
}
}
/**
* 从数据库获取全国所有省份信息
*/
public List<Province> loadProvinces(){
List<Province> list = new ArrayList<Province>();
Cursor cursor = db.query("Province", null, null, null, null, null, null);
if (cursor.moveToFirst()) {
do {
Province province = new Province();
province.setId(cursor.getInt(cursor.getColumnIndex("id")));
province.setProvinceName(cursor.getString(cursor.getColumnIndex("province_name")));
province.setProvinceCode(cursor.getString(cursor.getColumnIndex("province_code")));
list.add(province);
} while (cursor.moveToNext());
}
return list;
}
/**
* 将City实例存储到数据库
*/
public void saveCity(City city){
if (city != null) {
ContentValues values = new ContentValues();
values.put("city_name", city.getCityName());
values.put("city_code", city.getCityCode());
values.put("province_id", city.getProvinceId());
db.insert("City", null, values);
}
}
/**
* 从数据库读取某省下的所有城市信息
*/
public List<City> loadCities(int provinceId){
List<City> list = new ArrayList<City>();
Cursor cursor = db.query("City", null, "province_id = ?",
new String[] {String.valueOf(provinceId)}, null, null, null);
if (cursor.moveToFirst()) {
do {
City city = new City();
city.setId(cursor.getInt(cursor.getColumnIndex("id")));
city.setCityName(cursor.getString(cursor.getColumnIndex("city_name")));
city.setCityCode(cursor.getString(cursor.getColumnIndex("city_code")));
city.setProvinceId(provinceId);
list.add(city);
} while (cursor.moveToNext());
}
return list;
}
/**
* 将County实例存储到数据库
*/
public void saveCounty(County county){
if(county != null){
ContentValues values = new ContentValues();
values.put("county_name", county.getCountyName());
values.put("county_code", county.getCountyCode());
values.put("city_id", county.getCityId());
db.insert("County", null, values);
}
}
/**
* 从数据库读取某城市下的所县信息
*/
public List<County> loadCounties(int cityId){
List<County> list = new ArrayList<County>();
Cursor cursor = db.query("County", null, "city_id = ?", new String[] {String.valueOf(cityId)},
null, null, null);
if (cursor.moveToFirst()) {
do {
County county = new County();
county.setId(cursor.getInt(cursor.getColumnIndex("id")));
county.setCountyName(cursor.getString(cursor.getColumnIndex("county_name")));
county.setCountyCode(cursor.getString(cursor.getColumnIndex("county_code")));
county.setCityId(cityId);
list.add(county);
} while (cursor.moveToNext());
}
return list;
}
}
| [
"projectgame@163.com"
] | projectgame@163.com |
14de8ff25f31507fe78133882e7c405b197935f9 | 8381f7acfb91f9a432af92b43055b284744f73db | /src/test/java/runnerPackage/TestRunner.java | 9feed54f57489eb670f1856996d6b0179b95f2ca | [] | no_license | okanalkan98/CucumberDemo | f9698bcec215633a52b47aef2a99ceb5b59cc79e | a00b6142b754f6d09489732eca22beb5573b595e | refs/heads/master | 2021-01-24T02:47:36.352205 | 2018-02-25T21:03:15 | 2018-02-25T21:03:15 | 122,862,376 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 807 | java | package runnerPackage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;
import io.github.bonigarcia.wdm.WebDriverManager;
@CucumberOptions(features= {"features"},glue= {"stepDefinitionPackage"})
public class TestRunner extends AbstractTestNGCucumberTests{
public static WebDriver driver;
@BeforeTest
public void setUp() {
WebDriverManager.chromedriver().setup();
driver=new ChromeDriver();
System.out.println("Set up script is running");
System.out.println("My first cucumber test");
}
@AfterTest
public void tearDown() {
driver.close();
}
}
| [
"okanalkan83@gmail.com"
] | okanalkan83@gmail.com |
a60cecec09ff323c3b59080ededc8768ca8b04cd | ead5a617b23c541865a6b57cf8cffcc1137352f2 | /decompiled/sources/com/google/api/client/extensions/android/http/packageinfo.java | de9ae72769f7cd3c4a78e9ea883879411dec45ce | [] | no_license | erred/uva-ssn | 73a6392a096b38c092482113e322fdbf9c3c4c0e | 4fb8ea447766a735289b96e2510f5a8d93345a8c | refs/heads/master | 2022-02-26T20:52:50.515540 | 2019-10-14T12:30:33 | 2019-10-14T12:30:33 | 210,376,140 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package com.google.api.client.extensions.android.http;
import com.google.api.client.util.Beta;
@Beta
/* renamed from: com.google.api.client.extensions.android.http.package-info reason: invalid class name */
interface packageinfo {
}
| [
"seankhliao@gmail.com"
] | seankhliao@gmail.com |
18a4ec3a35d891d58becbbd826acf1e54a3f4814 | 2b2b5ca18d79c0db8ba5194b83be51d46a614239 | /myJavaProject/src/com/yyy/Circle.java | 42756eb4d5233452f337cbaae05e650666ab4f96 | [] | no_license | mpafit02/cs133---Object-Oriented-Programming---Java | 91bdbbc79195959dbb0998803c1153240a491351 | 969104deb3370feaa14a61754ae36d146eff49dd | refs/heads/master | 2020-06-23T03:09:56.883483 | 2019-07-23T18:37:10 | 2019-07-23T18:37:10 | 198,488,208 | 0 | 0 | null | 2019-07-23T19:10:14 | 2019-07-23T18:35:51 | HTML | UTF-8 | Java | false | false | 358 | java | package com.yyy;
public class Circle {
private double radius;
public Circle(double radius) {
this.radius = radius;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this.radius = radius;
}
public static void main(String[] args) {
Circle c = new Circle(1.23);
System.out.println(c.getRadius());
}
}
| [
"mpafit02@cs.ucy.ac.cy"
] | mpafit02@cs.ucy.ac.cy |
7fb8c76ad0ee8b16948c26b9aa347d482e983949 | 3eab9aafe4eb373cb4b0051d92afe145e46e6073 | /src/main/java/com/example/habrreactive/HabrreactiveApplication.java | 18ef30b41ab287f14e662a385d2223cec76300f5 | [] | no_license | dkul108/habrreactive | 96752d24ff8dd38661373a21c267b527b3848020 | f0d8e0f527c07a36cf6a32e6abda6c0dcee09c45 | refs/heads/master | 2021-08-14T11:41:04.898977 | 2017-11-15T15:07:02 | 2017-11-15T15:07:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package com.example.habrreactive;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HabrreactiveApplication {
public static void main(String[] args) {
SpringApplication.run(HabrreactiveApplication.class, args);
}
}
| [
"SGSamoylov@alfabank.ru"
] | SGSamoylov@alfabank.ru |
c5e07efb5354d953d21bce8428a14c698f7c168d | 7af846ccf54082cd1832c282ccd3c98eae7ad69a | /ftmap/src/main/java/taxi/nicecode/com/ftmap/generated/package_28/Foo102.java | ac9fbd7cc6835723ec2012d6fbb747cb00d86dc3 | [] | no_license | Kadanza/TestModules | 821f216be53897d7255b8997b426b359ef53971f | 342b7b8930e9491251de972e45b16f85dcf91bd4 | refs/heads/master | 2020-03-25T08:13:09.316581 | 2018-08-08T10:47:25 | 2018-08-08T10:47:25 | 143,602,647 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 270 | java | package taxi.nicecode.com.ftmap.generated.package_28;
public class Foo102 {
public void foo0(){
new Foo101().foo5();
}
public void foo1(){
foo0();
}
public void foo2(){
foo1();
}
public void foo3(){
foo2();
}
public void foo4(){
foo3();
}
public void foo5(){
foo4();
}
} | [
"1"
] | 1 |
12faa86278ba7ec7a0b4fc3a5b1ea4880d19e999 | 74b2cb9e8e5d5042ff3a00278d78e39f037a9e4b | /src/main/java/com/hackathon/mred/config/apidoc/SwaggerConfiguration.java | fbba16cf5df55d54024089c2bd105545a62c7c68 | [] | no_license | BulkSecurityGeneratorProject/hackathon | ad4ce4530357940775c4bb772788e95d55070b64 | 5d84632b66d839ac37c8a81f0a574ab56b879d27 | refs/heads/master | 2022-12-28T17:54:46.799835 | 2016-12-16T10:50:45 | 2016-12-16T10:50:45 | 296,586,464 | 0 | 0 | null | 2020-09-18T10:15:16 | 2020-09-18T10:15:15 | null | UTF-8 | Java | false | false | 2,760 | java | package com.hackathon.mred.config.apidoc;
import com.hackathon.mred.config.Constants;
import com.hackathon.mred.config.JHipsterProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.*;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StopWatch;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import static springfox.documentation.builders.PathSelectors.regex;
/**
* Springfox Swagger configuration.
*
* Warning! When having a lot of REST endpoints, Springfox can become a performance issue. In that
* case, you can use a specific Spring profile for this class, so that only front-end developers
* have access to the Swagger view.
*/
@Configuration
@EnableSwagger2
@Import(springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration.class)
@Profile(Constants.SPRING_PROFILE_SWAGGER)
public class SwaggerConfiguration {
private final Logger log = LoggerFactory.getLogger(SwaggerConfiguration.class);
public static final String DEFAULT_INCLUDE_PATTERN = "/api/.*";
/**
* Swagger Springfox configuration.
*
* @param jHipsterProperties the properties of the application
* @return the Swagger Springfox configuration
*/
@Bean
public Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
log.debug("Starting Swagger");
StopWatch watch = new StopWatch();
watch.start();
Contact contact = new Contact(
jHipsterProperties.getSwagger().getContactName(),
jHipsterProperties.getSwagger().getContactUrl(),
jHipsterProperties.getSwagger().getContactEmail());
ApiInfo apiInfo = new ApiInfo(
jHipsterProperties.getSwagger().getTitle(),
jHipsterProperties.getSwagger().getDescription(),
jHipsterProperties.getSwagger().getVersion(),
jHipsterProperties.getSwagger().getTermsOfServiceUrl(),
contact,
jHipsterProperties.getSwagger().getLicense(),
jHipsterProperties.getSwagger().getLicenseUrl());
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo)
.forCodeGeneration(true)
.genericModelSubstitutes(ResponseEntity.class)
.select()
.paths(regex(DEFAULT_INCLUDE_PATTERN))
.build();
watch.stop();
log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
return docket;
}
}
| [
"nemesismk2@googlemail.com"
] | nemesismk2@googlemail.com |
be763721f03376d35dadd11ce061613009e713c7 | d4e758b7b9bd6104fd2ea0b95be5cd5dd439d649 | /src/main/java/com/example/demo/SecurityConfig.java | 501e3716b9df7de7862c95f14fef2d7e7ead68ca | [] | no_license | yusuke-emoto/BookSummary | 790b8eb7b6346ea6a89782d3b200ac604d5f4c25 | 117cd9056417535abbe65ced703fcfc53d8abc1d | refs/heads/master | 2022-11-30T18:33:30.076095 | 2020-08-08T15:06:47 | 2020-08-08T15:06:47 | 274,056,351 | 0 | 0 | null | 2020-08-08T15:06:48 | 2020-06-22T06:22:35 | Java | UTF-8 | Java | false | false | 3,867 | java | package com.example.demo;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
@EnableWebSecurity //デフォルトのwebセキュリティ設定をオフにしますよ
@Configuration //設定用のクラスですよ
public class SecurityConfig extends WebSecurityConfigurerAdapter{
@Bean //パスワードエンコーダーのBean定義
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
//データソース、@Autowiredを付けることで@Componentのついたクラスから該当を探して、newしてインスタンスを突っ込んでくれる
@Autowired
private DataSource dataSource;
//ユーザーIDとパスワードを検索するSQL文
private static final String USER_SQL= " SELECT"
+ " user_id,"
+ " password,"
+ " true"
+ " FROM"
+ " m_user"
+ " WHERE"
+ " user_id = ?";
//ユーザーのロールをする検索SQL文
private static final String ROLE_SQL=" SELECT"
+ " user_id,"
+ " role"
+ " FROM"
+ " m_user"
+ " WHERE"
+ " user_id=?";
@Override
public void configure(WebSecurity web) throws Exception{
//静的リソースへのアクセスには、セキュリティを適用しない
web.ignoring().antMatchers("/webjars/**","/css/**");
}
@Override
protected void configure(HttpSecurity http) throws Exception{
//ログイン不要ページの設定
http.authorizeRequests()
.antMatchers("/webjars/**").permitAll()//webjarsへアクセス許可
.antMatchers("/css/**").permitAll()//cssへアクセス許可
.antMatchers("/images/**").permitAll()
.antMatchers("/login").permitAll() //ログインページは直リンクOK
.antMatchers("/signup").permitAll() //ユーザー登録画面は直リンクOK
.antMatchers("/home").permitAll()//ホーム画面は直リンクOK
.antMatchers("/post").permitAll()
.anyRequest().authenticated(); //それ以外は直リンク禁止
//ログイン処理
http.formLogin().loginProcessingUrl("/login")//ログイン処理のパス
.loginPage("/login") //ログインページの指定、これがないとデフォルトのセキュリティページになってしまう
.failureUrl("/login") //ログイン失敗時の遷移先
.usernameParameter("userId") //ログインページのユーザーID
.passwordParameter("password") //ログインページのユーザーID
.defaultSuccessUrl("/home",true); //ログイン成功後の遷移先
//ログアウト処理
http.logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutUrl("/logout")
.logoutSuccessUrl("/login");
//CSRF対策を無効に設定(一時的)
http.csrf().disable();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception{
//ログイン処理時のユーザー情報を、DBから取得する
auth.jdbcAuthentication()
.dataSource(dataSource)
.usersByUsernameQuery(USER_SQL)
.authoritiesByUsernameQuery(ROLE_SQL)
.passwordEncoder(passwordEncoder());
}
}
| [
"emoyuu0824@gmail.com"
] | emoyuu0824@gmail.com |
d78ea6f80267ade5a2cfb8b457389ec02403c992 | 2ead3493f04e7bd8be4916ea2af34e0366fedb51 | /JavaStreams/src/Problem_06/Main.java | 968c1972a5f29ad649014d3a5a9e4c0da22a8c4b | [] | no_license | Ivanov-Stiliqn/Java-Fundamentals-Homeworks | c4a3970e8063b8831c54c1a12c96d73e93119ccd | 2c908cf29d62e8e704707a870e0f907a8a127fc6 | refs/heads/master | 2021-01-10T16:26:56.127547 | 2015-11-24T12:54:25 | 2015-11-24T12:54:25 | 46,791,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,900 | java | package Problem_06;
import java.io.*;
/*
Problem 6. *Save a Custom Object in a file
Write a program that saves and loads the information from a custom Object that you have created to a file using
ObjectInputStream, ObjectOutputStream. Create a class Course that has a String field containing the name and an integer field
containing the number of students attending the course. Set the name of the new file as course.save.
*/
public class Main {
private static Course[] courses;
public static void main(String[] args) {
courses=new Course[3];
courses[0]=new Course("Java Fundamentals",300);
courses[1]=new Course("C# Fundamentals",400);
courses[2]=new Course("C# Basics",1200);
//Save();
Load();
}
public static void Save(){
try (
ObjectOutputStream oos=
new ObjectOutputStream(
new BufferedOutputStream(
new FileOutputStream("resources/problem_06/course.save")))){
for(Course c: courses){
oos.writeObject(c);
}
} catch (IOException e) {
e.printStackTrace();
}
}
public static void Load(){
try (
ObjectInputStream ois=
new ObjectInputStream(
new BufferedInputStream(
new FileInputStream("resources/problem_06/course.save")))){
Object obj;
while((obj=ois.readObject())!=null){
System.out.println("Course: "+obj);
}
}catch (EOFException eof){
System.out.println("End of File");
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
| [
"stilianivanovivanov@gmail.com"
] | stilianivanovivanov@gmail.com |
eab6f86df3fa7381820229e3a2bcd53a60c92e11 | 3b1cadc9eb3b8f0a14983298a81ca8c91f2a2e11 | /T7Ejem_HiloSencillo/app/src/androidTest/java/com/alexiscv/t7ejem_hilosencillo/ExampleInstrumentedTest.java | 34fcecd5a46e6584715f5168609cc7c6015a3c90 | [
"MIT"
] | permissive | alexiscv/DAM2_PMDM | 4d4b1a024dda82db954e2ec8026421b2f7810f19 | 141ee7791e7e850c57e39c4e53a2222087bc5df7 | refs/heads/master | 2020-04-03T21:01:25.545064 | 2018-12-12T10:47:30 | 2018-12-12T10:47:30 | 155,560,748 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 748 | java | package com.alexiscv.t7ejem_hilosencillo;
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.alexiscv.t7ejem_hilosencillo", appContext.getPackageName());
}
}
| [
"hogo.jp@gmail.com"
] | hogo.jp@gmail.com |
8258d875354f5f2da26c140d01eb45abb83f1073 | 9c21e86c9772b932e85d0200bb0645115e693d3e | /interfaces/music5/Music5.java | dac2c42cf63d04204c8f96eb64440d9ccbb69223 | [] | no_license | duranchen/OnJava8 | 64c9ccff272df15c5060a077de247989b191064a | ba20b128a7d3d7f98beac4bb26d0ee034a1c69b2 | refs/heads/master | 2022-09-09T09:25:05.103693 | 2020-05-31T09:23:15 | 2020-05-31T09:23:15 | 262,552,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,307 | java | package interfaces.music5;
import polymorphism.music.Note;
interface Instrument {
int VALUE =5;
default void play(Note n) {
System.out.println(this + ".play() " + n);
}
default void adjust() {
System.out.println("Adjusting " + this);
}
}
class Wind implements Instrument {
@Override
public String toString() {
return "Wind";
}
}
class Percussion implements Instrument {
@Override
public String toString() { return "Percussion"; }
}
class Stringed implements Instrument {
@Override
public String toString() { return "Stringed"; }
}
class Brass extends Wind {
@Override
public String toString() { return "Brass"; }
}
class Woodwind extends Wind {
@Override
public String toString() { return "Woodwind"; }
}
public class Music5 {
static void tune(Instrument i) {
i.play(Note.MIDDLE_C);
}
static void tuneAll(Instrument[] e) {
for (Instrument i:
e) {
tune(i);
}
}
public static void main(String[] args) {
Instrument[] orchestra = {
new Wind(),
new Percussion(),
new Stringed(),
new Brass(),
new Woodwind()
};
tuneAll(orchestra);
}
}
| [
"duran.chen@outlook.com"
] | duran.chen@outlook.com |
9fb115a1a8e596580507dfcf2303df6bfac8c380 | 2f26ed6f6dac814ebd04548b2cd274246e8c9326 | /WEB-INF/src/com/yhaguy/domain/UsuarioPropiedades.java | 568a5e21b98635071e40973ab643a3f760b4f435 | [] | no_license | sraul/yhaguy-baterias | ecbac89f922fc88c5268102025affc0a6d07ffb5 | 7aacfdd3fbca50f9d71c940ba083337a2c80e899 | refs/heads/master | 2023-08-19T05:21:03.565167 | 2023-08-18T15:33:08 | 2023-08-18T15:33:08 | 144,028,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,101 | java | package com.yhaguy.domain;
import com.coreweb.domain.Domain;
import com.coreweb.domain.Tipo;
import com.coreweb.domain.Usuario;
@SuppressWarnings("serial")
public class UsuarioPropiedades extends Domain {
private Usuario usuario = new Usuario();
private Deposito depositoParaFacturar = new Deposito();
private Tipo modoVenta = new Tipo();
private Tipo modoDesarrollador = new Tipo();
@Override
public int compareTo(Object o) {
return -1;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
public Deposito getDepositoParaFacturar() {
return depositoParaFacturar;
}
public void setDepositoParaFacturar(Deposito depositoParaFacturar) {
this.depositoParaFacturar = depositoParaFacturar;
}
public Tipo getModoVenta() {
return modoVenta;
}
public void setModoVenta(Tipo modoVenta) {
this.modoVenta = modoVenta;
}
public Tipo getModoDesarrollador() {
return modoDesarrollador;
}
public void setModoDesarrollador(Tipo modoDesarrollador) {
this.modoDesarrollador = modoDesarrollador;
}
}
| [
"sraul@users.noreply.github.com"
] | sraul@users.noreply.github.com |
b694b2f9f0b65d35ea1a8079c103111f865f33a3 | a1bca7e14c44d3288d8e1f66c41270d09d76e916 | /src/main/java/io/sj/exception/MessageResourceHandler.java | 5cc2aca763dc94173e45c0733a7a3f85fd1ea61c | [] | no_license | Shubhamjain2908/Boot | aa26e6628a9eec8a4823befe6b8d8b1ec948c6ae | 614ab70cbd6a11fa2ea746df84fe755aa8ccd50a | refs/heads/master | 2020-04-13T23:12:53.808620 | 2018-12-29T10:06:39 | 2018-12-29T10:06:39 | 163,500,494 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,254 | java | package io.sj.exception;
import java.util.Locale;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.NoSuchMessageException;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.stereotype.Component;
/**
* Helper to simplify accessing i18n messages in code.
* This finds messages automatically found from
* src/main/resources (files named messages_*.properties)
*
*
* @author Surabhi Bhawsar
* @since 2017-11-04
*/
@Component
public class MessageResourceHandler {
@Autowired
private MessageSource messageSource;
private MessageSourceAccessor accessor;
/**
* TODO
*/
@PostConstruct
private void init() {
accessor = new MessageSourceAccessor(messageSource, Locale.ENGLISH);
}
/**
* TODO
* @param code
* @return
*/
public String get(String code) {
try {
return accessor.getMessage(code);
} catch (NoSuchMessageException ex ) {
return code; //When message is not found for given key, then return key as message instead of breaking.
}
}
} | [
"shubhamjain2908@gmail.com"
] | shubhamjain2908@gmail.com |
cdc32efdb4b14d181294d5e403f04c16ce416f26 | ec728f5b2668a5698b37167e259f7713a76925a8 | /PartitionUIMindset/app/src/main/java/com/android/kpe/partitionuimindset/TitlesFragment.java | ceddee865f8a7969e439a95a013f8c28526b97ef | [] | no_license | kurt-patrick/android | 84d8b6c1ae125e332a571bc6abe3e49cc962fe29 | c659a872e63591fe9810a108bee36c4bb54ab9e3 | refs/heads/master | 2021-09-03T04:06:42.660746 | 2018-01-05T12:59:05 | 2018-01-05T12:59:05 | 104,538,335 | 1 | 0 | null | 2017-11-25T12:08:06 | 2017-09-23T03:25:25 | Java | UTF-8 | Java | false | false | 926 | java | package com.android.kpe.partitionuimindset;
import android.app.ListFragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
/**
* Created by LocalUser on 20/09/2017.
*/
public class TitlesFragment extends ListFragment {
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
((OnCourseChangedListener) getActivity() ).onCourseChanged(position);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
String[] titles = getResources().getStringArray(R.array.course_titles);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(
getActivity(), android.R.layout.simple_list_item_1, titles);
setListAdapter(adapter);
}
}
| [
"kurt_patrick_online@hotmail.com"
] | kurt_patrick_online@hotmail.com |
52b0b1dff56d2db4e287b9cf885cfd18cb9a1b41 | 5765c87fd41493dff2fde2a68f9dccc04c1ad2bd | /Variant Programs/1-4/33/production/GrowerTerminate.java | 53e24403c65ca348be452ee7bf48581b91d28494 | [
"MIT"
] | permissive | hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism | 42e4c2061c3f8da0dfce760e168bb9715063645f | a42ced1d5a92963207e3565860cac0946312e1b3 | refs/heads/master | 2020-08-09T08:10:08.888384 | 2019-11-25T01:14:23 | 2019-11-25T01:14:23 | 214,041,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package production;
import manufacturedBelongings.MinableOppose;
import warehouses.*;
public class GrowerTerminate extends Presenter {
public RinglikeAssociatedLeaning<MinableOppose> basket = null;
public GrowerTerminate(double spiteful, double drift, Repository ago) {
parallelize(spiteful, drift, null, ago);
this.central = EmitterTerritory.overpopulated;
this.basket = new RinglikeAssociatedLeaning<MinableOppose>();
}
protected synchronized void eligibleSoonBody() throws DepositoryEliminateDeparture {
try {
this.presentPreclude = this.firstStowage.afterParagraph();
} catch (DepositoryEliminateDeparture samad) {
throw samad;
}
}
protected synchronized void propelOngoingAimCoughMemory() {
this.basket.injectedSurvive(this.presentPreclude);
this.presentPreclude = null;
}
}
| [
"hayden.cheers@me.com"
] | hayden.cheers@me.com |
85db836cf637431436cf7a250d7c4b42ff58f964 | a69843c67fd8a5b227837bd253fde3f672739e87 | /api-executor-v1/src/main/java/com/linkedpipes/etl/executor/api/v1/service/DefaultExceptionFactory.java | f9c9195618830059667456c950e831cde252fb1e | [
"MIT"
] | permissive | eghuro/etl | 28713014be4db6bb010bd8c6a4e9a8249857ed2f | 5d74f9156397a4b48ad0eb3d833721dc67ba74a2 | refs/heads/master | 2020-04-02T02:41:15.816327 | 2018-09-20T11:44:31 | 2018-09-20T11:44:31 | 153,922,127 | 0 | 0 | NOASSERTION | 2018-10-20T15:53:20 | 2018-10-20T15:53:20 | null | UTF-8 | Java | false | false | 363 | java | package com.linkedpipes.etl.executor.api.v1.service;
import com.linkedpipes.etl.executor.api.v1.LpException;
/**
* Default implementation of exception factory.
*/
class DefaultExceptionFactory implements ExceptionFactory {
@Override
public LpException failure(String message, Object... args) {
return new LpException(message, args);
}
}
| [
"skodapetr@gmail.com"
] | skodapetr@gmail.com |
94b1b9adfbea8d17bd41ffb6b961ea2cfbae0caf | 60efbd957bfc8f98121f0dc6d2ea8cfafc1865ea | /app/src/main/java/com/example/intership2019/Fragment/DPDependencyInjectionExample/Person.java | f64fc737cce9fb0064d2082a9034c2050f6d59a1 | [] | no_license | annv1990/PTIT-Internship-2019-CW | 6f4040dd878cb7a5327b9eba7aa539e6de60129d | ad6481fd419247f72363a1c53616e4bc896cc324 | refs/heads/master | 2020-06-22T14:21:19.220632 | 2020-06-19T02:36:48 | 2020-06-19T02:36:48 | 197,728,954 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | package com.example.intership2019.Fragment.DPDependencyInjectionExample;
import javax.inject.Inject;
public class Person{
Body body;
@Inject
public Person(Body body){
this.body = body;
}
}
| [
"vutiendat2412@gmail.com"
] | vutiendat2412@gmail.com |
50de0989e5e9f7d9347cf864861b5a857cb3135f | fba58f501701ebe25a48590f34f076082217026e | /src/main/java/wang/mh/base/collection/CollectionsDemo.java | 6bdfc24e7267d84e7c0217637031cd361f61a47c | [] | no_license | HelloWangmh/java-learning | c773f773527dee63e72d1d9f6287aeea567bcc09 | 90a7828d49b1dc65df51f89cddb8c73824c2d23f | refs/heads/master | 2022-11-25T17:25:53.039118 | 2021-04-22T01:34:49 | 2021-04-22T01:34:49 | 90,616,908 | 2 | 0 | null | 2022-11-16T09:28:01 | 2017-05-08T10:43:01 | Java | UTF-8 | Java | false | false | 2,707 | java | package wang.mh.base.collection;
import com.google.common.collect.Lists;
import java.util.*;
public class CollectionsDemo {
public static void main(String[] args) {
listToArr();
}
/**
* 集合转数组
*/
private static void listToArr(){
ArrayList<Integer> list = Lists.newArrayList();
list.add(1);
list.add(2);
list.add(3);
//返回一个新数组
Integer[] arr = list.toArray(new Integer[0]);
System.out.println("arr:"+arr[1]);
//如果arr.length >= size 那么返回的就是这个数组
Integer[] existArr = new Integer[list.size()+1];
Integer[] newArr = list.toArray(existArr);
System.out.println(newArr == existArr); //true
System.out.println("existArr:"+existArr[1]);
System.out.println("existArr:"+existArr[3]); //null
System.out.println("newArr:"+newArr[1]);
}
/**
* 返回一个空集合
* 不可修改
*/
private static void testEmpty(){
Set<String> set = Collections.emptySet();
set.add("hello"); //error UnsupportedOperationException
}
/**
* 返回给定范围的集合 包前不包后
* subList的改变也会影响原始List
*/
private static void testSubList(){
ArrayList<Integer> list = Lists.newArrayList();
list.add(1);
list.add(2);
list.add(3);
list.add(4);
List<Integer> subList = list.subList(0, 2);
subList.remove(new Integer(1));
System.out.println(subList); //2
System.out.println(list); // 2 3 4
}
/**
* 返回一个数组元素的列表视图,可以修改,但是不能改变大小
*/
private static void testAsList(){
List<Integer> list = Arrays.asList(1, 2, 3);
list.set(0,11);
list.add(5);//error
}
/**
* 不可修改
*/
private static void testSingleton(){
Set<Integer> singleton = Collections.singleton(1);
singleton.add(2); //error
}
/**
* 不可改变 返回一个包含n个相同元素的列表,集合
*/
private static void testNCopies(){
List<Integer> integers = Collections.nCopies(100, 88);
integers.add(1);
System.out.println("size:"+integers.size());//100
}
/**
* 受查视图
* 添加的时候会进行类型检查,避免在get()时候发现
*
*/
private static void testCheckedList(){
List<String> list = Collections.checkedList(new ArrayList<>(),String.class);
list.add("test");
List listObj = list;
//error ClassCastException
listObj.add(1);
}
}
| [
"wmh@wmhdeMacBook-Pro.local"
] | wmh@wmhdeMacBook-Pro.local |
95ff849b3c858829a7bb881affb7bc274d4c5b27 | b92e887aaaa55e5875727892381e2f0eb117f629 | /app/src/test/java/com/huburt/app/ExampleUnitTest.java | d8cd4783c7d3d13fbf8798b4a0104102b882fbd5 | [] | no_license | huburt-Hu/AndroidArchitecture | e9cc51ee50475d54f013336dce70692cbc59cbb7 | caac91c03b3685777dca542554928bb772814210 | refs/heads/master | 2021-08-24T05:31:49.358539 | 2017-12-08T07:21:40 | 2017-12-08T07:21:40 | 112,594,544 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 392 | java | package com.huburt.app;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"654360340@qq.com"
] | 654360340@qq.com |
10e3a1943ff1f6ca90d2ea5efdbef4a8601e1777 | 23d0987433973217344b570039f53f70b48261de | /src/main/java/dev/map/anticheat/events/CompassCPS.java | d8fd09d23698a305ec273bfde24b9c273a41532f | [] | no_license | gabrielvicenteYT/MapAntiCheat | 47c78a6bb417651af218f53d8d5a1161f14d9886 | c1635f62128008c2ff2a121d3404c5602997ca8b | refs/heads/master | 2023-04-05T02:40:09.783063 | 2021-03-30T20:42:06 | 2021-03-30T20:42:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,157 | java | package dev.map.anticheat.events;
import com.sun.tools.javac.util.Convert;
import dev.map.anticheat.autoclicker.CPSDetection;
import dev.map.anticheat.main.Main;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import java.util.HashMap;
import java.util.UUID;
public class CompassCPS implements Listener {
private int taskID;
private int clicks = 0;
private int playerclicks;
private HashMap<UUID, Boolean> playerIDisRunningMap = new HashMap<UUID, Boolean>();
@EventHandler
public void onClick(PlayerInteractEntityEvent event) {
Entity target = event.getRightClicked();
String targetname = target.getName();
Player player = event.getPlayer();
if (target instanceof Player) {
if (player.getItemInHand().getType().equals(Material.COMPASS)) {
if (!playerIDisRunningMap.containsKey(player.getUniqueId())) {
playerIDisRunningMap.put(player.getUniqueId(), false);
} else {
if (playerIDisRunningMap.get(player.getUniqueId()) == true) {
player.sendMessage(ChatColor.RED + "Thread is already running.");
} else {
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getPlugin(Main.class), new Runnable() {
int index = 11;
double averageclicks = 0;
public void run() {
if (index == 11) {
playerIDisRunningMap.put(player.getUniqueId(), false);
CPSDetection.clicks.put(target.getUniqueId(), 0);
index--;
playerIDisRunningMap.put(player.getUniqueId(), true);
} else if (index > 0 && index < 11) {
clicks = CPSDetection.clicks.get(target.getUniqueId());
player.sendMessage(ChatColor.GRAY + "Clicks: " + ChatColor.DARK_AQUA + clicks);
averageclicks = averageclicks + clicks;
CPSDetection.clicks.put(target.getUniqueId(), 0);
index--;
}
if (index == 0) {
player.sendMessage(target.getName() + ChatColor.GRAY + ": Had an average of " + ChatColor.DARK_AQUA + averageclicks / 10 + " CPS");
Bukkit.getScheduler().cancelTask(taskID);
playerIDisRunningMap.put(player.getUniqueId(), false);
}
}
}, 0, 20);
}
}
}
}
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
f8b0a7d56b2c079392a526a2fd28837ba3fda7e4 | bb60768a6eb5435a4b315f4af861b25addfd3b44 | /dingtalk/java/src/main/java/com/aliyun/dingtalkdrive_1_0/models/AddFileRequest.java | d6910f8d6d67960296976cc3929250d6d9db5391 | [
"Apache-2.0"
] | permissive | yndu13/dingtalk-sdk | f023e758d78efe3e20afa1456f916238890e65dd | 700fb7bb49c4d3167f84afc5fcb5e7aa5a09735f | refs/heads/master | 2023-06-30T04:49:11.263304 | 2021-08-12T09:54:35 | 2021-08-12T09:54:35 | 395,271,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,007 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.dingtalkdrive_1_0.models;
import com.aliyun.tea.*;
public class AddFileRequest extends TeaModel {
// 父目录id
@NameInMap("parentId")
public String parentId;
// 文件类型
@NameInMap("fileType")
public String fileType;
// 文件名
@NameInMap("fileName")
public String fileName;
// mediaId
@NameInMap("mediaId")
public String mediaId;
// 文件名冲突策略
@NameInMap("addConflictPolicy")
public String addConflictPolicy;
// 用户id
@NameInMap("unionId")
public String unionId;
public static AddFileRequest build(java.util.Map<String, ?> map) throws Exception {
AddFileRequest self = new AddFileRequest();
return TeaModel.build(map, self);
}
public AddFileRequest setParentId(String parentId) {
this.parentId = parentId;
return this;
}
public String getParentId() {
return this.parentId;
}
public AddFileRequest setFileType(String fileType) {
this.fileType = fileType;
return this;
}
public String getFileType() {
return this.fileType;
}
public AddFileRequest setFileName(String fileName) {
this.fileName = fileName;
return this;
}
public String getFileName() {
return this.fileName;
}
public AddFileRequest setMediaId(String mediaId) {
this.mediaId = mediaId;
return this;
}
public String getMediaId() {
return this.mediaId;
}
public AddFileRequest setAddConflictPolicy(String addConflictPolicy) {
this.addConflictPolicy = addConflictPolicy;
return this;
}
public String getAddConflictPolicy() {
return this.addConflictPolicy;
}
public AddFileRequest setUnionId(String unionId) {
this.unionId = unionId;
return this;
}
public String getUnionId() {
return this.unionId;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
2466001e9b5d3f933a2d1b82feddf0cfc2b2b380 | 53e540321e8453827d115bd4847073f75c05394e | /library/app/src/androidTest/java/com/longzhiye/android/libdemo/ApplicationTest.java | 3076c92e3b39e58c25169e6cfb033e7c1e603565 | [] | no_license | longzhiye/LibLongzhiye | c5794323fa0610da2b19cc47719f1c69b3778082 | cc6c1206f34cdc25c61c890e4bee372081e88d98 | refs/heads/master | 2021-01-13T05:23:45.043822 | 2017-03-08T09:17:52 | 2017-03-08T09:17:52 | 81,399,567 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package com.longzhiye.android.libdemo;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"longzhiye@163.com"
] | longzhiye@163.com |
ca33df55655dfef9454315c3cdd71ba39504e5f8 | 27c60f5f4a933713fce384264d3f8eb05442feb6 | /A09/src/FilterFactory.java | 2d2848b6f63a2d79be15471b82787bd31648da1d | [] | no_license | rieder91/Programmierpraxis | fe95f512d44c2cae38b5600bc906c6d8c5a0507b | 2b7e3439dfac561684d56e424d82e3d45555942b | refs/heads/master | 2021-01-01T08:56:51.325156 | 2012-01-21T14:25:12 | 2012-01-21T14:25:12 | 2,852,666 | 0 | 1 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,812 | java | import java.util.Scanner;
/**
* @author Thomas Rieder
* @matrikelnummer 1125403
* @date 2011-12-16
* @description 9. Übungsbeispiel
*
*/
public class FilterFactory implements Factory {
/**
* Standardkonstruktor
*/
public FilterFactory() {
}
/**
* liest die Parameter für die Filteroperationen ein und gibt die jeweilige
* Operation zurück
*
* @return jeweilige Filteroperation (derzeit nur median)
*/
public Operation create(Scanner scanner) throws FactoryException {
// nur 1 Zeile auslesen
scanner = new Scanner(scanner.nextLine());
String filter = null;
String genType = null;
Operation ret = null;
BlockGenerator gen = new XBlockGenerator();
int size = 3;
if (scanner.hasNext()) {
filter = scanner.next();
// Zusätzlicher size-Parameter der Bonusaufgabe
if (scanner.hasNextInt()) {
size = scanner.nextInt();
if ((size % 2) == 0 || size <= 1) {
throw new FactoryException("invalid size");
}
}
// Zusätzlicher Typ-Parameter der Bonusaufgabe
if (scanner.hasNext()) {
genType = scanner.next();
if (genType.equals("x")) {
gen = new XBlockGenerator(size);
} else if (genType.equals("circular")) {
gen = new CircularBlockGenerator(size);
} else if (genType.equals("replicate")) {
gen = new ReplicateBlockGenerator(size);
} else if (genType.equals("symmetric")) {
gen = new SymmetricBlockGenerator(size);
} else {
throw new FactoryException("wrong parameters");
}
}
if (filter.equals("median")) {
ret = new MedianOperation(gen);
} else if (filter.equals("average")) {
ret = new AverageOperation(gen);
} else {
throw new FactoryException("wrong parameters");
}
} else {
throw new FactoryException("wrong parameters");
}
return ret;
}
}
| [
"tho.rieder@aon.at"
] | tho.rieder@aon.at |
2a724d8f4c312dd8d44d1bf3f5deec8ef94b9895 | c2fb6846d5b932928854cfd194d95c79c723f04c | /java_backup/my java/series/SUM.java | 117c208d6f93d9aafaa0b53cede720ec7e83e68e | [
"MIT"
] | permissive | Jimut123/code-backup | ef90ccec9fb6483bb6dae0aa6a1f1cc2b8802d59 | 8d4c16b9e960d352a7775786ea60290b29b30143 | refs/heads/master | 2022-12-07T04:10:59.604922 | 2021-04-28T10:22:19 | 2021-04-28T10:22:19 | 156,666,404 | 9 | 5 | MIT | 2022-12-02T20:27:22 | 2018-11-08T07:22:48 | Jupyter Notebook | UTF-8 | Java | false | false | 372 | java |
import java.io.*;
public class SUM
{
public static void main(int n)throws IOException
{ BufferedReader br=new BufferedReader(new InputStreamReader (System.in));
int s,p,i,j;p=1;s=0;
for(i=1;i<=n;i++)
{p=1;
for(j=1;j<=i+1;j++)
{
p=p*j;
}
s=s+p;
}
System.out.println("THE SERIES:"+s);
}
} | [
"jimutbahanpal@yahoo.com"
] | jimutbahanpal@yahoo.com |
bcb000aa32225342c3007f475d9be1871b2ec0d8 | 6ae77f59faecb1f7c1879c98bf5c730ed463ec9b | /src/java/servlets_form_data/CheckBox_request.java | ba604e08145f32fdf149bccd88add837eedc904b | [] | no_license | mohammed-a-wadod/Servlets_TutorialsPoint | 9e69d2e0afc63a9ddf976205e891d5c644864b39 | 4166673b2fbbf81ba3110a51010e8dbac0b6bb70 | refs/heads/master | 2021-01-16T21:21:16.104953 | 2014-11-18T12:08:24 | 2014-11-18T12:08:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,174 | java | package servlets_form_data;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CheckBox_request extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
/*
* as we do by using getParameter method in the GET_Method class we can use the same way
* but here we want to use other way to read all parameters coming for CHECKBOX form
*/
PrintWriter out = resp.getWriter();
read_CheckBox_Single_Value(req, resp); // here we are using the old Way which in the GET_method Class
out.println("<hr/>");
out.println("<h1> Using Enumeration"+ "</h1>");
read_CheckBox_All_Values(req, resp); // here we are reading all the values
}
private void read_CheckBox_Single_Value(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
out.println("Me : " + req.getParameter("Me") + "<br>");
out.println("Here : " + req.getParameter("Here") + "<br>");
out.println("There : " + req.getParameter("There") + "<br>");
}
private void read_CheckBox_All_Values(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
//creating Enumeration which takes all paramter names from request
Enumeration paramNames = req.getParameterNames();
//use hasMoreELements to move arround this enum
while (paramNames.hasMoreElements()) {
//get the first emum element which represent the name pass through the request
String paramName = (String) paramNames.nextElement();
//here i don't know if this paramter carry one value or more
//so i will use getPrameterValues which return array of values
String[] paramValues = req.getParameterValues(paramName);
//check if hte paramValues has one element or not
if (paramValues.length == 1) {
String paramValue = paramValues[0];
//here check if this value.length==0 then we don't have value
if (paramValue.length() == 0) {
out.println("No Value <br>");
} else {
out.println(paramName + " : " + paramValue + "<br>");
}
} else {
// here we have more than one element in the paramValues
//so i need to loop on in it
for (int i = 1; i < paramValues.length; i++) {
out.println(paramName + " : " + paramValues[i] + "<br>");
}
}
}
}
}
| [
"Muhammed@Muhammed-wadod"
] | Muhammed@Muhammed-wadod |
487795eeb5bcb0c7b1e51c0102b2bbdc6298454d | 76e0e6e5991f82290bf3cf0d66e2eb0f650e8e00 | /03EnumerationsAndAnnotations/src/_002WarningLevels/Main.java | 7ff6930923736b4b4824341e4d29ea3a040c3c7f | [
"MIT"
] | permissive | lapd87/SoftUniJavaOOPAdvanced | 47ba0efba41b4b2619d4b363996e23fe070290cc | e06cf284fffc7259210a94f327d078d228edf76f | refs/heads/master | 2020-03-27T21:40:22.120084 | 2018-09-03T07:26:02 | 2018-09-03T07:26:02 | 147,166,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,003 | java | package _002WarningLevels;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by IntelliJ IDEA.
* User: LAPD
* Date: 18.7.2018 г.
* Time: 09:48 ч.
*/
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(System.in));
String loggerImportanceLevel = bufferedReader.readLine();
Logger logger = new Logger(loggerImportanceLevel);
String input;
while (true) {
if ("END".equals(input = bufferedReader.readLine())) {
break;
}
String[] messageArgs = input.split(": ");
Message message = new Message(messageArgs[0],
messageArgs[1]);
logger.addMessage(message);
}
for (Message message : logger.getMessages()) {
System.out.println(message);
}
}
} | [
"mario87lapd@gmail.com"
] | mario87lapd@gmail.com |
fe57a4df57ff13c6ad0d6c9141c05f579f601b35 | 04eb88e2eb3fd7004930170919eff41a0a9e0d6b | /src/main/java/com/anbang/qipai/xiuxianchang/msg/service/DianpaoGameRoomMsgService.java | 9f924ef4a5909bfe92808f2737c35ced8bd6e4bd | [] | no_license | flyarong/qipai_xiuxianchang | 65240715b01c51a1b82278fca83544c3a4b60e12 | 93d8ac49b3d7116fd607f45635edece27b57547d | refs/heads/master | 2023-03-15T16:23:59.061112 | 2019-05-15T07:32:24 | 2019-05-15T07:32:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package com.anbang.qipai.xiuxianchang.msg.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import com.anbang.qipai.xiuxianchang.msg.channel.source.DianpaoGameRoomSource;
import com.anbang.qipai.xiuxianchang.msg.msjobs.CommonMO;
@EnableBinding(DianpaoGameRoomSource.class)
public class DianpaoGameRoomMsgService {
@Autowired
private DianpaoGameRoomSource dianpaoGameRoomSource;
public void removeGameRoom(List<String> gameIds) {
CommonMO mo = new CommonMO();
mo.setMsg("gameIds");
mo.setData(gameIds);
dianpaoGameRoomSource.dianpaoGameRoom().send(MessageBuilder.withPayload(mo).build());
}
public void createGameRoom(String gameId, String game) {
CommonMO mo = new CommonMO();
mo.setMsg("create gameroom");
Map data = new HashMap<>();
mo.setData(data);
data.put("gameId", gameId);
data.put("game", game);
dianpaoGameRoomSource.dianpaoGameRoom().send(MessageBuilder.withPayload(mo).build());
}
}
| [
"林少聪 @PC-20180515PRDG"
] | 林少聪 @PC-20180515PRDG |
066513cfb04728aa7d033d65853e83e292f97ed5 | ea2bdf5ab8d469e95168024e66ca7dbb69f102b1 | /src/main/java/view/Console.java | 33ea28dd2d3a14fc7a755ef18ee6f0c1bb626ab9 | [] | no_license | NikolayNN/StringFilter | 9b29453ea128d2c6433e4c3f6dcb54b478fa7ccc | a0167f7147af3752762c8634a50d8b940b0b8f5a | refs/heads/master | 2021-05-02T13:58:27.683596 | 2018-02-08T17:47:54 | 2018-02-08T17:47:54 | 120,709,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package view;
import java.util.Scanner;
public class Console implements View {
@Override
public String read() {
Scanner sc = new Scanner(System.in);
return sc.nextLine();
}
@Override
public void write(String message) {
System.out.println(message);
}
}
| [
"kolya.by@mail.ru"
] | kolya.by@mail.ru |
bfb18322d129834c53f579b11dea8b3113e92290 | 48841e20165ebc37e196f4f1747cfb13ea3de25b | /dmbase/src/main/java/com/dm/search/service/EntityService.java | de847f3b453955bc38be1c5c153669b3bfdcf2e4 | [] | no_license | zmdevelop/topiesearch | c09f9240addf0c052307a08c6ff3755239ad7530 | 40b54d33913f81f8699b57b248e2496089487471 | refs/heads/master | 2020-12-21T17:28:20.152632 | 2016-08-11T07:52:21 | 2016-08-11T07:52:21 | 59,458,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 489 | java | package com.dm.search.service;
import java.util.List;
import java.util.Map;
import com.dm.search.model.SearchEntity;
import com.github.pagehelper.PageInfo;
public interface EntityService {
int add(SearchEntity record);
int update(SearchEntity record);
int delete(Integer id);
SearchEntity load(Integer id);
PageInfo<SearchEntity> list(Integer pageSize,Integer PageNum,Map searchMap);
public List<SearchEntity> list(Map searchMap);
boolean updateStatus(Integer id);
}
| [
"1028483257@qq.com"
] | 1028483257@qq.com |
7267ed5b0a0f97d123244022ad9c86d3137421c3 | 03e7edccca6f36675ac60a0a1b1076ba8fce3648 | /app/src/main/java/appzlogic/architecturalexample/LocalDatabase/NoteViewModel.java | 6bead4841a72ae4fc85f8c03cc3d8108c1462611 | [] | no_license | satyendrababu/mvvm_room_retrofit_databinding | e7a447087e615026ae0c48673c49ca275d88fee5 | ad6879d5dd7c17e637e1dc8b9699d9277f15da47 | refs/heads/master | 2022-09-05T23:21:57.319061 | 2020-05-27T17:49:35 | 2020-05-27T17:49:35 | 267,386,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,019 | java | package appzlogic.architecturalexample.LocalDatabase;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import java.util.List;
public class NoteViewModel extends AndroidViewModel {
private NoteRepository repository;
private LiveData<List<Note>> allNotes;
public NoteViewModel(@NonNull Application application) {
super(application);
repository = new NoteRepository(application);
allNotes = repository.getAllNotes();
}
public void insert(Note note){
repository.insert(note);
}
public void update(Note note){
repository.update(note);
}
public void delete(Note note){
repository.delete(note);
}
public void deleteAllNotes(){
repository.deleteAllNotes();
}
public LiveData<List<Note>> getAllNotes(){
return allNotes;
}
public void initData(){
allNotes = repository.getAllNotes();
}
}
| [
"satendra@appzlogic.com"
] | satendra@appzlogic.com |
ff61492cdac499c392a31ba5b08258a9abd7ba89 | 09389d27cb0559859c1d78714367d785123277b2 | /src/main/java/org/uma/mbd/mdRectas/rectas/Segmento.java | 06dbce0048cb99396ca5f99bd355aa0bc4e3c0ca | [] | no_license | Proteus1989/BigData-UMA-Master-Java | 3d0854238f56ce88620a20ad374b3d8012565b09 | 30992e4d34ed1b56a129c24f0349914a3d5fa512 | refs/heads/master | 2022-04-03T15:11:53.330176 | 2020-02-03T21:48:35 | 2020-02-03T21:48:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 677 | java | package org.uma.mbd.mdRectas.rectas;
public class Segmento {
private Punto origen;
private Punto extremo;
public Segmento(double x1, double y1, double x2, double y2)
{
origen = new Punto(x1, y1);
extremo = new Punto(x2, y2);
}
public Segmento(Punto p1, Punto p2)
{
origen = p1;
extremo = p2;
}
public void trasladar(double a, double b)
{
origen.trasladar(a, b);
extremo.trasladar(a, b);
}
public double longitud()
{
return origen.distancia(extremo);
}
@Override
public String toString() {
return "S(" + origen + ", " + extremo + ")";
}
}
| [
"antonioproteus@gmail.com"
] | antonioproteus@gmail.com |
9fa180e8815db410d99f46c30e17c379b47cddf5 | 26c38e9bb35e79c899cff9c5e3ccef7b949832ff | /apps-test/taglib-it/src/test/java/org/apache/struts/taglib/SimpleBeanForTesting.java | 5a3d0969b6f8783fbf3a71e9276a40728ae5740f | [] | no_license | apache/struts-sandbox | 58292b54dccdce5de68e6a186ff6b64e1fb33d96 | e9b8ac4c8b53387bd96da9bcc0dd01bbc2725e3b | refs/heads/trunk | 2023-08-05T16:10:39.408041 | 2022-04-23T08:38:11 | 2022-04-23T08:38:11 | 206,401 | 3 | 16 | null | 2022-04-22T21:32:02 | 2009-05-21T01:42:37 | Java | UTF-8 | Java | false | false | 7,215 | java | /*
* $Id$
*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts.taglib;
import org.apache.struts.action.ActionForm;
import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
/**
* Simple bean for unit tests.
*/
public class SimpleBeanForTesting extends ActionForm {
public SimpleBeanForTesting() {
super();
}
public SimpleBeanForTesting(List lst) {
this.lst = lst;
}
public SimpleBeanForTesting(boolean checked) {
this.checked = checked;
}
public SimpleBeanForTesting(Boolean checkedWrapper) {
this.checkedWrapper = checkedWrapper;
}
public SimpleBeanForTesting(Map map) {
this.map = map;
}
public SimpleBeanForTesting(String string) {
this.string = string;
}
public SimpleBeanForTesting(String[] stringArray) {
this.stringArray = stringArray;
}
public SimpleBeanForTesting(Integer integerValue) {
this.integerValue = integerValue;
}
private String string;
private String[] stringArray;
private Integer integerValue;
private Double doubleValue;
private List lst;
private Map map;
private String x;
private String y;
private Object nestedObject;
private Object[] array;
private Enumeration enumeration;
private Collection collection;
private boolean checked;
private Boolean checkedWrapper;
//Copied right from the FAQ
private String strAry[] =
{ "String 0", "String 1", "String 2", "String 3", "String 4" };
public String getStringIndexed(int index) {
return (strAry[index]);
}
public void setStringIndexed(int index, String value) {
strAry[index] = value;
}
/**
* Returns the lst.
*
* @return List
*/
public List getList() {
return lst;
}
/**
* Returns the map.
*
* @return Map
*/
public Map getMap() {
return map;
}
/**
* Sets the lst.
*
* @param lst The lst to set
*/
public void setList(List lst) {
this.lst = lst;
}
/**
* Sets the map.
*
* @param map The map to set
*/
public void setMap(Map map) {
this.map = map;
}
/**
* Returns the string.
*
* @return String
*/
public String getString() {
return string;
}
/**
* Sets the string.
*
* @param string The string to set
*/
public void setString(String string) {
this.string = string;
}
/**
* Returns an array of type String.
*
* @return String[]
*/
public String[] getStringArray() {
return stringArray;
}
/**
* Sets the string array.
*
* @param string The string array to set
*/
public void setStringArray(String[] stringArray) {
this.stringArray = stringArray;
}
/**
* Returns the lst.
*
* @return List
*/
public List getLst() {
return lst;
}
/**
* Sets the lst.
*
* @param lst The lst to set
*/
public void setLst(List lst) {
this.lst = lst;
}
/**
* Returns the Object Array.
*
* @return Object[]
*/
public Object[] getArray() {
return array;
}
/**
* Sets the Object Array .
*
* @param array The Object array to set
*/
public void setArray(Object[] array) {
this.array = array;
}
/**
* Returns the enumeration.
*
* @return Enumeration
*/
public Enumeration getEnumeration() {
return enumeration;
}
/**
* Sets the enumeration.
*
* @param enumeration The enumeration to set
*/
public void setEnumeration(Enumeration enumeration) {
this.enumeration = enumeration;
}
/**
* Returns the nestedObject.
*
* @return Object
*/
public Object getNestedObject() {
return nestedObject;
}
/**
* Sets the nestedObject.
*
* @param nestedObject The nestedObject to set
*/
public void setNestedObject(Object nestedObject) {
this.nestedObject = nestedObject;
}
/**
* Returns the collection.
*
* @return Collection
*/
public Collection getCollection() {
return collection;
}
/**
* Sets the collection.
*
* @param collection The collection to set
*/
public void setCollection(Collection collection) {
this.collection = collection;
}
/**
* Returns the doubleValue.
*
* @return Double
*/
public Double getDoubleValue() {
return doubleValue;
}
/**
* Returns the integerValue.
*
* @return Integer
*/
public Integer getIntegerValue() {
return integerValue;
}
/**
* Sets the doubleValue.
*
* @param doubleValue The doubleValue to set
*/
public void setDoubleValue(Double doubleValue) {
this.doubleValue = doubleValue;
}
/**
* Sets the integerValue.
*
* @param integerValue The integerValue to set
*/
public void setIntegerValue(Integer integerValue) {
this.integerValue = integerValue;
}
/**
* Returns the checked.
*
* @return boolean
*/
public boolean isChecked() {
return checked;
}
/**
* Sets the checked.
*
* @param checked The checked to set
*/
public void setChecked(boolean checked) {
this.checked = checked;
}
/**
* Returns the checkedWrapper.
*
* @return Boolean
*/
public Boolean getCheckedWrapper() {
return checkedWrapper;
}
/**
* Sets the checkedWrapper.
*
* @param checkedWrapper The checkedWrapper to set
*/
public void setCheckedWrapper(Boolean checkedWrapper) {
this.checkedWrapper = checkedWrapper;
}
/**
* Returns the x.
*
* @return String
*/
public String getX() {
return x;
}
/**
* Returns the y.
*
* @return String
*/
public String getY() {
return y;
}
/**
* Sets the x.
*
* @param x The x to set
*/
public void setX(String x) {
this.x = x;
}
/**
* Sets the y.
*
* @param y The y to set
*/
public void setY(String y) {
this.y = y;
}
public String getJustThrowAnException() throws Exception {
throw new Exception();
}
}
| [
"wsmoak@apache.org"
] | wsmoak@apache.org |
87f6cb8dc0e7ceddca840ba7a29a3ff269e73255 | 00ee4995af2c0de95480dd39034c36436843fcd3 | /pcm/src/main/java/gov/samhsa/c2s/pcm/service/exception/NoDataFoundException.java | 0f8af77b17efff89e2d345e96d7b2bf5d5e19c65 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | tlinqu/pcm | 07348d2980f9692c2a13bfc0b313ed768085b654 | e751cfefcc8d0c5c3e2aa2c08571255dae8f0a53 | refs/heads/master | 2021-08-11T11:19:13.482293 | 2017-10-20T18:11:37 | 2017-10-20T18:11:37 | 263,652,819 | 1 | 0 | Apache-2.0 | 2020-05-13T14:25:26 | 2020-05-13T14:25:25 | null | UTF-8 | Java | false | false | 763 | java | package gov.samhsa.c2s.pcm.service.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.NOT_FOUND)
public class NoDataFoundException extends RuntimeException {
public NoDataFoundException() {
}
public NoDataFoundException(String message) {
super(message);
}
public NoDataFoundException(String message, Throwable cause) {
super(message, cause);
}
public NoDataFoundException(Throwable cause) {
super(cause);
}
public NoDataFoundException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}
| [
"Jiahao.Li@feisystems.com"
] | Jiahao.Li@feisystems.com |
4ac4effd43f682958e6e073ba27d31ec2db8267d | 571fc48d53e6377d2fe266f84c35181aacc80202 | /Fgcm/app/src/main/java/com/fanwang/fgcm/MainActivity.java | 5d10255700ca45b250d13b1516f859314e5cc761 | [] | no_license | edcedc/Fg | 618a381d4399664d3fac9e04dd7a11b62b752f7e | 19fd32837347fd17f9b43e816e3cc9fd0c207eb4 | refs/heads/master | 2020-04-04T10:08:23.469555 | 2019-06-29T06:09:21 | 2019-06-29T06:09:21 | 155,843,816 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,372 | java | package com.fanwang.fgcm;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.mapapi.SDKInitializer;
import com.blankj.utilcode.util.LogUtils;
import com.fanwang.fgcm.bean.User;
import com.fanwang.fgcm.controller.CloudApi;
import com.fanwang.fgcm.event.BundleDataInEvent;
import com.fanwang.fgcm.gt.MyGTIntentService;
import com.fanwang.fgcm.gt.MyGTService;
import com.fanwang.fgcm.view.ui.MainFrg;
import com.fanwang.fgcm.weight.ShareLoginOK;
import com.igexin.sdk.PushManager;
import com.umeng.socialize.UMShareAPI;
import org.json.JSONObject;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import me.yokeyword.eventbusactivityscope.EventBusActivityScope;
import me.yokeyword.fragmentation.SwipeBackLayout;
import me.yokeyword.fragmentation.anim.FragmentAnimator;
import me.yokeyword.fragmentation_swipeback.SwipeBackActivity;
public class MainActivity extends SwipeBackActivity {
// 定位相关
private LocationClient mLocClient;
private MyLocationListenner myListener = new MyLocationListenner();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
// getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
setContentView(R.layout.activity_main);
if (findFragment(MainFrg.class) == null) {
loadRootFragment(R.id.fl_container, MainFrg.newInstance());
}
getSwipeBackLayout().setEdgeOrientation(SwipeBackLayout.EDGE_ALL);
setSwipeBackEnable(false);
// 注册 SDK 广播监听者
IntentFilter iFilter = new IntentFilter();
iFilter.addAction(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_OK);
iFilter.addAction(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_ERROR);
iFilter.addAction(SDKInitializer.SDK_BROADCAST_ACTION_STRING_NETWORK_ERROR);
mReceiver = new BaiduReceiver();
registerReceiver(mReceiver, iFilter);
//定位
// 定位初始化
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true); // 打开gps
option.setCoorType("bd09ll"); // 设置坐标类型
option.setScanSpan(1000);
option.setIsNeedAddress(true); //加上这个配置后才可以取到详细地址信息
mLocClient.setLocOption(option);
mLocClient.start();
ShareLoginOK.getInstance(this).save(true);
initGT();
}
protected void initGT() {
// 为第三方自定义推送服务
PushManager.getInstance().initialize(this, MyGTService.class);
// 为第三方自定义的推送服务事件接收类
PushManager.getInstance().registerPushIntentService(this, MyGTIntentService.class);
PushManager.getInstance().turnOnPush(this);
}
/**
* 限制SwipeBack的条件,默认栈内Fragment数 <= 1时 , 优先滑动退出Activity , 而不是Fragment
*
* @return true: Activity优先滑动退出; false: Fragment优先滑动退出
*/
@Override
public boolean swipeBackPriority() {
return super.swipeBackPriority();
}
public FragmentAnimator onCreateFragmentAnimator() {
return super.onCreateFragmentAnimator();
}
@Override
public void onBackPressedSupport() {
// 对于 4个类别的主Fragment内的回退back逻辑,已经在其onBackPressedSupport里各自处理了
super.onBackPressedSupport();
}
/**
* Android 点击EditText文本框之外任何地方隐藏键盘
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
View v = getCurrentFocus();
if (isShouldHideInput(v, ev)) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
}
return super.dispatchTouchEvent(ev);
}
// 必不可少,否则所有的组件都不会有TouchEvent了
if (getWindow().superDispatchTouchEvent(ev)) {
return true;
}
return onTouchEvent(ev);
}
private boolean isShouldHideInput(View v, MotionEvent event) {
if (v != null && (v instanceof EditText)) {
int[] leftTop = {0, 0};
//获取输入框当前的location位置
v.getLocationInWindow(leftTop);
int left = leftTop[0];
int top = leftTop[1];
int bottom = top + v.getHeight();
int right = left + v.getWidth();
if (event.getX() > left && event.getX() < right
&& event.getY() > top && event.getY() < bottom) {
// 点击的是输入框区域,保留点击EditText的事件
return false;
} else {
return true;
}
}
return false;
}
/**
* 构造广播监听类,监听 SDK key 验证以及网络异常广播
*/
private class BaiduReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
String s = intent.getAction();
if (s.equals(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_ERROR)) {
LogUtils.e("key 验证出错! 错误码 :" + intent.getIntExtra
(SDKInitializer.SDK_BROADTCAST_INTENT_EXTRA_INFO_KEY_ERROR_CODE, 0)
+ " ; 请在 AndroidManifest.xml 文件中检查 key 设置");
} else if (s.equals(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_OK)) {
LogUtils.e("key 验证成功! 功能可以正常使用");
} else if (s.equals(SDKInitializer.SDK_BROADCAST_ACTION_STRING_NETWORK_ERROR)) {
LogUtils.e("网络出错");
}
}
}
private BaiduReceiver mReceiver;
@Override
protected void onDestroy() {
super.onDestroy();
// 取消监听 SDK 广播
unregisterReceiver(mReceiver);
}
private static final int REQUEST_CODE_SETTING = 300;
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
switch (requestCode) {
case BundleDataInEvent.select_video:
EventBusActivityScope.getDefault(this).post(new BundleDataInEvent(BundleDataInEvent.select_video, data));
break;
case BundleDataInEvent.select_img:
EventBusActivityScope.getDefault(this).post(new BundleDataInEvent(BundleDataInEvent.select_img, data));
break;
case REQUEST_CODE_SETTING:
break;
}
}
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
}
/**
* 定位SDK监听函数
*/
public class MyLocationListenner implements BDLocationListener {
@Override
public void onReceiveLocation(BDLocation location) {
// map view 销毁后不在处理新接收的位置
if (location == null) {
return;
}
// mCurrentLat = location.getLatitude();
// mCurrentLon = location.getLongitude();
LogUtils.e(location.getLatitude(), location.getLongitude(), location.getProvince(), location.getCity(), location.getDistrict());
/* mCurrentAccracy = location.getRadius();
locData = new MyLocationData.Builder()
.accuracy(location.getRadius())
// 此处设置开发者获取到的方向信息,顺时针0-360
.direction(mCurrentDirection).latitude(location.getLatitude())
.longitude(location.getLongitude()).build();
if (isFirstLoc) {
isFirstLoc = false;
LatLng ll = new LatLng(location.getLatitude(),
location.getLongitude());
MapStatus.Builder builder = new MapStatus.Builder();
builder.target(ll).zoom(18.0f);
}*/
mLocClient.stop();
double latitude = location.getLatitude();
double longitude = location.getLongitude();
String province = location.getProvince();
String city = location.getCity();
String district = location.getDistrict();
String street = location.getStreet();
String streetNumber = location.getStreetNumber();
Bundle bundle = new Bundle();
bundle.putDouble("latitude", latitude);
bundle.putDouble("longitude", longitude);
bundle.putString("province", province == null ? "广东省" : province);
bundle.putString("city", city == null ? "广州市" : city);
bundle.putString("district", district == null ? "番禺区" : district);
bundle.putString("street", street);
bundle.putString("streetNumber", streetNumber);
User.getInstance().setAddressBundle(bundle);
// EventBusActivityScope.getDefault(MainActivity.this).post(new BundleDataInEvent(BundleDataInEvent.mLookMap));
userupdate(longitude, latitude);
}
}
@Override
protected void onStop() {
super.onStop();
mLocClient.stop();
}
private void userupdate(double location, double latitude){
CloudApi.userupdate(location, latitude)
.doOnSubscribe(new Consumer<Disposable>() {
@Override
public void accept(Disposable disposable) throws Exception {
}
})
.subscribeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<JSONObject>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(JSONObject jsonObject) {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
}
}
| [
"501807647@qq.com"
] | 501807647@qq.com |
1d017077aff09606f7da425c066eb4beb03f987a | a00326c0e2fc8944112589cd2ad638b278f058b9 | /src/main/java/000/123/872/CWE113_HTTP_Response_Splitting__database_setHeaderServlet_54c.java | e35b6ea8f5f16ef9cf7bb02dc93359133e6a2a0c | [] | no_license | Lanhbao/Static-Testing-for-Juliet-Test-Suite | 6fd3f62713be7a084260eafa9ab221b1b9833be6 | b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68 | refs/heads/master | 2020-08-24T13:34:04.004149 | 2019-10-25T09:26:00 | 2019-10-25T09:26:00 | 216,822,684 | 0 | 1 | null | 2019-11-08T09:51:54 | 2019-10-22T13:37:13 | Java | UTF-8 | Java | false | false | 1,586 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE113_HTTP_Response_Splitting__database_setHeaderServlet_54c.java
Label Definition File: CWE113_HTTP_Response_Splitting.label.xml
Template File: sources-sinks-54c.tmpl.java
*/
/*
* @description
* CWE: 113 HTTP Response Splitting
* BadSource: database Read data from a database
* GoodSource: A hardcoded string
* Sinks: setHeaderServlet
* GoodSink: URLEncode input
* BadSink : querystring to setHeader()
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
import javax.servlet.http.*;
public class CWE113_HTTP_Response_Splitting__database_setHeaderServlet_54c
{
public void badSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
(new CWE113_HTTP_Response_Splitting__database_setHeaderServlet_54d()).badSink(data , request, response);
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
(new CWE113_HTTP_Response_Splitting__database_setHeaderServlet_54d()).goodG2BSink(data , request, response);
}
/* goodB2G() - use badsource and goodsink */
public void goodB2GSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
(new CWE113_HTTP_Response_Splitting__database_setHeaderServlet_54d()).goodB2GSink(data , request, response);
}
}
| [
"anhtluet12@gmail.com"
] | anhtluet12@gmail.com |
b094166f20ec32505b42e122ad8fc4a351b38de5 | 2981c30657d462b16d827aa6b4629b7a7baf3651 | /app/src/test/java/com/example/abel/milagecalculator/ExampleUnitTest.java | 848025b5cee7f4fe1eeb79f0fe04b38c7cd469d9 | [
"MIT"
] | permissive | agonza16/MPG_Calculator | de066a42b809bd6766cc51c18e4146fcbcb92ff5 | b138a3a3bbdb1ceb3a3b2988b8bd3b42111e8d5a | refs/heads/master | 2021-09-09T00:21:40.634567 | 2018-03-12T22:05:09 | 2018-03-12T22:05:09 | 124,949,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 427 | java | package com.example.abel.milagecalculator;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"agonza16@asu.edu"
] | agonza16@asu.edu |
de9b73bc41afc532d60786819ecd25082cd4e5e4 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/32/32_26b9a527cdfd8a37dc7f453eb5399431f069bc87/DCBlockListener/32_26b9a527cdfd8a37dc7f453eb5399431f069bc87_DCBlockListener_t.java | 25adb5d02fb8e35042659d9e23f3ebce63cdfe1c | [] | 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 | 7,920 | java | package com.smartaleq.bukkit.dwarfcraft.events;
import java.util.HashMap;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockListener;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.inventory.ItemStack;
import com.smartaleq.bukkit.dwarfcraft.DCPlayer;
import com.smartaleq.bukkit.dwarfcraft.DwarfCraft;
import com.smartaleq.bukkit.dwarfcraft.Effect;
import com.smartaleq.bukkit.dwarfcraft.EffectType;
import com.smartaleq.bukkit.dwarfcraft.Skill;
import com.smartaleq.bukkit.dwarfcraft.Util;
/**
* This watches for broken blocks and reacts
*
*/
public class DCBlockListener extends BlockListener {
private final DwarfCraft plugin;
public DCBlockListener(final DwarfCraft plugin) {
this.plugin = plugin;
}
/**
* Called when a block is destroyed by a player.
*
* @param event
* Relevant event details
*/
@Override
public void onBlockBreak(BlockBreakEvent event) {
if (event.isCancelled())
return;
Player player = event.getPlayer();
DCPlayer dCPlayer = plugin.getDataManager().find(player);
HashMap<Integer, Skill> skills = dCPlayer.getSkills();
ItemStack tool = player.getItemInHand();
int toolId = -1;
short durability = 0;
if (tool != null) {
toolId = tool.getTypeId();
durability = tool.getDurability();
}
Location loc = event.getBlock().getLocation();
int materialId = event.getBlock().getTypeId();
byte meta = event.getBlock().getData();
boolean blockDropChange = false;
for (Skill s : skills.values()) {
for (Effect effect : s.getEffects()) {
if (effect.getEffectType() == EffectType.BLOCKDROP && effect.checkInitiator(materialId, meta)) {
// Crops special line:
if (effect.getInitiatorId() == 59){
if (meta != 7)
continue;
}
if (DwarfCraft.debugMessagesThreshold < 4)
System.out.println("DC4: Effect: " + effect.getId() + " tool: " + toolId + " and toolRequired: " + effect.getToolRequired());
if (effect.checkTool(toolId)) {
ItemStack item = effect.getOutput(dCPlayer, meta);
if (DwarfCraft.debugMessagesThreshold < 6)
System.out.println("Debug: dropped " + item.toString());
if (item.getAmount() > 0)
loc.getWorld().dropItemNaturally(loc, item);
blockDropChange = true;
}
}
if (effect.getEffectType() == EffectType.TOOLDURABILITY && durability != -1) {
if (effect.checkTool(toolId)) {
double effectAmount = effect.getEffectAmount(dCPlayer);
if (DwarfCraft.debugMessagesThreshold < 3)
System.out.println("DC2: affected durability of a tool - old:" + durability);
tool.setDurability((short)(durability + Util.randomAmount(effectAmount)));
// if you use the tool on a non-dropping block it
// doesn't take special durability damage
if (DwarfCraft.debugMessagesThreshold < 3)
System.out.println("DC3: affected durability of a tool - new:" + tool.getDurability());
if (tool.getDurability() >= tool.getType().getMaxDurability()){
if (tool.getTypeId() == 267 && tool.getDurability() < 250)
continue;
player.setItemInHand(null);
}
}
}
if (tool != null){
if (effect.getEffectType() == EffectType.SWORDDURABILITY && effect.checkTool(toolId)) {
if (DwarfCraft.debugMessagesThreshold < 2)
System.out.println("DC2: affected durability of a sword - old:" + durability + " effect called: " + effect.getId());
tool.setDurability((short)(durability + (Util.randomAmount(effect.getEffectAmount(dCPlayer) * 2))));
if (DwarfCraft.debugMessagesThreshold < 3)
System.out.println("DC3: affected durability of a sword - new:" + tool.getDurability());
if (tool.getDurability() >= tool.getType().getMaxDurability()){
if (tool.getTypeId() == 267 && tool.getDurability() < 250)
continue;
player.setItemInHand(null);
}
}
}
}
}
if (blockDropChange) {
event.getBlock().setTypeId(0);
event.setCancelled(true);
}
}
/**
* onBlockDamage used to accelerate how quickly blocks are destroyed.
* setDamage() not implemented yet
*/
@Override
public void onBlockDamage(BlockDamageEvent event) {
if (event.isCancelled())
return;
Player player = event.getPlayer();
DCPlayer dCPlayer = plugin.getDataManager().find(player);
HashMap<Integer, Skill> skills = dCPlayer.getSkills();
// Effect Specific information
ItemStack tool = player.getItemInHand();
int toolId = -1;
if (tool != null)
toolId = tool.getTypeId();
int materialId = event.getBlock().getTypeId();
byte data = event.getBlock().getData();
//if (event.getDamageLevel() != BlockDamageLevel.STARTED)
// return;
for (Skill s : skills.values()) {
for (Effect e : s.getEffects()) {
if (e.getEffectType() == EffectType.DIGTIME && e.checkInitiator(materialId, data)) {
if (DwarfCraft.debugMessagesThreshold < 2)
System.out.println("DC2: started instamine check");
if (e.checkTool(toolId)) {
if (Util.randomAmount(e.getEffectAmount(dCPlayer)) == 0)
return;
if (DwarfCraft.debugMessagesThreshold < 3)
System.out.println("DC3: Insta-mine occured. Block: " + materialId);
event.setInstaBreak(true);
}
}
}
}
}
@Override
public void onBlockPhysics(BlockPhysicsEvent event){
if (event.getBlock().getType() == Material.CACTUS && plugin.getConfigManager().disableCacti){
World world = event.getBlock().getWorld();
Location loc = event.getBlock().getLocation();
//this is a re-implementation of BlockCactus's doPhysics event, minus the spawning of a droped item.
if (!(checkCacti(world, loc))){
event.getBlock().setTypeId(0, true);
event.setCancelled(true);
Material base = world.getBlockAt(loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ()).getType();
if ((base != Material.CACTUS) && (base != Material.SAND))
world.dropItemNaturally(loc, new ItemStack(Material.CACTUS, 1));
}
}
}
private boolean checkCacti(World world, Location loc){
int x = loc.getBlockX();
int y = loc.getBlockY();
int z = loc.getBlockZ();
if (isBuildable(world.getBlockAt(x - 1, y, z ).getType())) return false;
if (isBuildable(world.getBlockAt(x + 1, y, z ).getType())) return false;
if (isBuildable(world.getBlockAt(x, y, z - 1).getType())) return false;
if (isBuildable(world.getBlockAt(x, y, z + 1).getType())) return false;
Material base = world.getBlockAt(x, y - 1, z).getType();
return (base == Material.CACTUS) || (base == Material.SAND);
}
//Bukkit really needs to implement access to Material.isBuildable()
private boolean isBuildable(Material block){
switch(block){
case AIR:
case WATER:
case STATIONARY_WATER:
case LAVA:
case STATIONARY_LAVA:
case YELLOW_FLOWER:
case RED_ROSE:
case BROWN_MUSHROOM:
case RED_MUSHROOM:
case SAPLING:
case SUGAR_CANE:
case FIRE:
case STONE_BUTTON:
case DIODE_BLOCK_OFF:
case DIODE_BLOCK_ON:
case LADDER:
case LEVER:
case RAILS:
case REDSTONE_WIRE:
case TORCH:
case REDSTONE_TORCH_ON:
case REDSTONE_TORCH_OFF:
case SNOW:
case POWERED_RAIL:
case DETECTOR_RAIL:
return false;
default:
return true;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
38d41e3cf417dc12097ade1ceb0169b6a63b3b42 | 21f2918feebee4afa31534f4714ef497911c8c79 | /java-basic/app/src/main/java/com/eomcs/oop/ex12/Exam0210.java | 8600048c7920e8fd76f2ae52ded06398ea593977 | [] | no_license | eomjinyoung/bitcamp-20210607 | 276aab07d6ab067e998328d7946f592816e28baa | 2f07da3993e3b6582d9f50a60079ce93ed3c261f | refs/heads/main | 2023-06-14T23:47:21.139807 | 2021-06-25T09:48:48 | 2021-06-25T09:48:48 | 374,601,444 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 480 | java | // Lambda 문법 - functional interface의 자격
package com.eomcs.oop.ex12;
public class Exam0210 {
// 추상 메서드가 한 개짜리 인터페이스여야 한다.
interface Player {
void play();
}
public static void main(String[] args) {
// 추상 메서드를 한 개만 갖고 있는 인터페이스에 대해
// 람다 문법으로 익명 클래스를 만들 수 있다.
Player p = () -> System.out.println("Player...");
p.play();
}
}
| [
"jinyoung.eom@gmail.com"
] | jinyoung.eom@gmail.com |
a32682652745f8041bb71552837a9ffb09030a5d | 7cb4d77ac492bb4dfcdf19f0ca15ca02c3fc1c7c | /genericUygulama/src/genericUygulama/student.java | 7f13487fc2a3e1dabb27ee465b88849de7f3d6e5 | [] | no_license | sametcavur/Java-SE | 1759294d49afb07a9f8b147c8986aa0fa0a00467 | e645f00bd1bf240c935b30468c2bd8ae72defb19 | refs/heads/main | 2023-04-12T07:22:06.937907 | 2021-05-15T16:44:19 | 2021-05-15T16:44:19 | 367,648,188 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | package genericUygulama;
public class student extends person {
private String scNumber;
public student() {}
public student(String name, String surname, int age, String scNumber) {
super(name, surname, age);
this.scNumber = scNumber;
}
public String getScNumber() {
return scNumber;
}
public void setScNumber(String scNumber) {
this.scNumber = scNumber;
}
@Override
public String toString() {
return "student [scNumber=" + scNumber + ", Name=" + getName() + ", Surname=" + getSurname()
+ ", Age=" + getAge() + "]";
}
}
| [
"54666839+sametcavur@users.noreply.github.com"
] | 54666839+sametcavur@users.noreply.github.com |
edc5ab1115e80ad8cff264148714f45137e125c9 | fa8880ead2d16178475191e659991d46f251a92c | /Java Core/task12/task1209/Solution.java | 2e5254840e676a668ed4f071ad9d270e6b57847c | [] | no_license | Haumidzaki/JavaRush-HW | 5386e3c519f1f65175abaeefa3160b3552857eb6 | 61f4ca6f1eee0bebfc321786f8fb8b56ee4f1332 | refs/heads/master | 2021-01-08T02:30:22.334082 | 2020-07-28T13:11:07 | 2020-07-28T13:11:07 | 241,863,583 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,659 | java | package com.javarush.task.task12.task1209;
/*
Три метода и минимум
Написать public static методы: int min(int, int),
long min(long, long), double min(double, double).
Каждый метод должен возвращать минимальное из двух
переданных в него чисел.
Требования:
• Программа не должна выводить текст на экран.
• Класс Solution должен содержать четыре метода.
• Класс Solution должен содержать статический метод int min(int, int).
• Метод int min(int, int) должен возвращать минимальное из двух чисел типа int.
• Класс Solution должен содержать статический метод long min(long, long).
• Метод long min(long, long) должен возвращать минимальное из двух чисел типа long.
• Класс Solution должен содержать статический метод double min(double, double).
• Метод double min(double, double) должен возвращать минимальное из
двух чисел типа double.
*/
public class Solution {
public static void main(String[] args) {
}
static int min(int a, int b){
int min = Integer.min(a,b);
return min;
}
static long min(long a, long b){
long min = Long.min(a,b);
return min;
}
static double min(double a, double b){
double min = Double.min(a,b);
return min;
}
} | [
"art684@yandex.ru"
] | art684@yandex.ru |
ed669ff2ce18de0cccabb8455bb773904ac3da0d | a1bf37cdb1368507c62246e0c9357c530d374a79 | /src/main/java/com/zzsharing/basic/utils/PageableUtil.java | 8d5a7bbc89ec30b1f21f78010e7f180ebdb38aa1 | [] | no_license | zsl131/zzsharing | 094d25e92ddfc247d3adbef30225ba76e3038add | c544e234304b12ba07bfe3a67bad0651241c3930 | refs/heads/master | 2020-06-17T20:10:10.871363 | 2016-12-05T09:15:26 | 2016-12-05T09:15:26 | 74,972,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,041 | java | package com.zzsharing.basic.utils;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
/**
* Created by 钟述林 393156105@qq.com on 2016/10/21 15:45.
*/
public class PageableUtil {
/**
* 获取基础分页对象
* @param page 获取第几页
* @param size 每页条数
* @param dtos 排序对象数组
* @return
*/
public static Pageable basicPage(Integer page, Integer size, SortDto... dtos) {
Sort sort = SortUtil.basicSort(dtos);
page = (page==null || page<0)?0:page;
size = (size==null || size<=0)?15:size;
Pageable pageable = new PageRequest(page, size, sort);
return pageable;
}
/**
* 获取基础分页对象,每页条数默认15条
* - 默认以id降序排序
* @param page 获取第几页
* @return
*/
public static Pageable basicPage(Integer page) {
return basicPage(page, 0, new SortDto("desc", "id"));
}
/**
* 获取基础分页对象,每页条数默认15条
* @param page 获取第几页
* @param dtos 排序对象数组
* @return
*/
public static Pageable basicPage(Integer page, SortDto... dtos) {
return basicPage(page, 0, dtos);
}
/**
* 获取基础分页对象,排序方式默认降序
* @param page 获取第几页
* @param size 每页条数
* @param orderField 排序字段
* @return
*/
public static Pageable basicPage(Integer page, Integer size, String orderField) {
return basicPage(page, size, new SortDto("desc", orderField));
}
/**
* 获取基础分页对象
* - 每页条数默认15条
* - 排序方式默认降序
* @param page 获取第几页
* @param orderField 排序字段
* @return
*/
public static Pageable basicPage(Integer page, String orderField) {
return basicPage(page, 0, new SortDto("desc", orderField));
}
}
| [
"zslin_com@163.com"
] | zslin_com@163.com |
ab5a5bca12381175f670aba32bb957ab8a92f5c5 | ebdbeb7841912f7038d40c7c96a7f60b4609b64d | /src/com/riccio/abstraction/Parrot.java | aea5d6bb6689096513a85b9fb212e0a78433d7cc | [] | no_license | niosoulmusic/myJava | d7fdebbfd0d69218670835e26839e615dda78513 | 132eb5801fea56fa7cb5e1ce15cc7a47dae4a333 | refs/heads/master | 2020-03-20T05:43:07.912434 | 2018-06-13T14:04:56 | 2018-06-13T14:04:56 | 137,223,967 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 133 | java | package com.riccio.abstraction;
public class Parrot extends Bird {
public Parrot(String name) {
super(name);
}
}
| [
"euge@MBP-di-euge.lan"
] | euge@MBP-di-euge.lan |
6411e694fa3a78684bb27b183e76b8568a7eeda6 | 12f0d18fe38d16ecd0a7f6e5f5ec5b3c90e78881 | /DGT/radar/src/main/java/edu/uclm/es/radar/App.java | 9748e5183ea3be71991d740ded1f0bbd2b2d7e68 | [] | no_license | ExposoftIso2/Exposoft | 0e5a3519499757abf86cc591d4f42b52c53b4c98 | c178b3bdd0143b0ed69dc08da427b4a9f1181636 | refs/heads/master | 2021-05-03T18:03:48.910339 | 2016-12-21T11:19:44 | 2016-12-21T11:19:44 | 71,891,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 193 | java | package edu.uclm.es.radar;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
| [
"fernycozar@gmail.com"
] | fernycozar@gmail.com |
328392c9fd88d3db2fd56e02a59b3fba44d0c62c | 047b413521874dd6e887c9ea057b504df9c9e029 | /app/src/main/java/com/android/materialdesign/ui/fragments/FragmentA.java | 4e8124a466b3d6957ac57e929f888d0da5c491c6 | [] | no_license | nataraj06/MaterialDesign | b31880c8bd21f4b40c769dec8619ae32707f6d1b | bd6ed47c2f792431d1cec16494a7aea3416faf2c | refs/heads/master | 2021-01-13T05:14:05.087179 | 2017-03-28T15:16:28 | 2017-03-28T15:16:28 | 81,275,960 | 0 | 0 | null | 2017-03-28T15:16:28 | 2017-02-08T01:59:14 | Java | UTF-8 | Java | false | false | 732 | java | package com.android.materialdesign.ui.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.android.materialdesign.R;
public class FragmentA extends Fragment {
public FragmentA() {
//Mandatory empty constructor for the fragment manager to instantiate the fragment (e.g. upon screen orientation changes).
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_a, container, false);
}
} | [
"nataraj.sharan@gmail.com"
] | nataraj.sharan@gmail.com |
90186710c2eda8531d28c99f303448f556d30717 | 217d0fa1e2bf4c845dffea5d0e0581181973dff5 | /series_9.java | 3b5bce53ba8369a53aee2920a818fab893c86ae3 | [] | no_license | aryamancomp/Aryaman-program | b1bd6f2984f32323b23a4f2c012e8ba59275de3c | 54edfffcce237e0f87ace79577973cd56d8edbe2 | refs/heads/master | 2022-12-11T19:35:13.799674 | 2020-09-03T19:01:10 | 2020-09-03T19:01:10 | 291,467,137 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 461 | java | import java.util.*;
class series_9
{
int n;
int s=0;
void accept()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the value");
n=sc.nextInt();
}
void calc()
{
for(int i=1;i<=n;i++)
{
s=s+i/1;
}
System.out.println(s);
}
public static void main()
{
series_9 obj=new series_9();
obj.accept();
obj.calc();
}
} | [
"Aryaman Singh@DESKTOP-DR5G5E9"
] | Aryaman Singh@DESKTOP-DR5G5E9 |
4bb06c4a37faca59558060ea7924851faab5a133 | 59384f38a43b76b24a782c6e13f371a03dfa7d4c | /springBoot/src/main/java/org/gaverdov/springBoot/security/SecurityConfig.java | d77c01f7074a4c4b4d127a83ccee6a7c09088ab6 | [] | no_license | 22Matvey22/springBoot | 0c0bbc9157d127fb30e070b86df8a84b54fbb1ff | d219cee98b44c0883a154d9a87d7f2bee08a0a53 | refs/heads/master | 2023-06-06T10:41:09.429821 | 2021-06-17T06:19:35 | 2021-06-17T06:19:35 | 377,725,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,286 | java | package org.gaverdov.springBoot.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
private final UserDetailsService userDetailsService;
private final SuccessUserHandler successUserHandler;
public SecurityConfig(@Qualifier("userDetailsServiceImpl") UserDetailsService userDetailsService, SuccessUserHandler successUserHandler) {
this.userDetailsService = userDetailsService;
this.successUserHandler = successUserHandler;
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.authorizeRequests()
.antMatchers("/").permitAll()
.antMatchers("/admin/**").hasRole("ADMIN")
.antMatchers("/user/**").authenticated()
.and().formLogin()
.successHandler(successUserHandler);
http.logout()
.permitAll()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/");
}
@Bean
public static NoOpPasswordEncoder passwordEncoder() {
return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance();
}
@Autowired
public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}
}
| [
"matvey.gaverdov@yandex.ru"
] | matvey.gaverdov@yandex.ru |
2b4474ad16cce87664bef172af8695b4bb5113ea | 39b87f687c9b9674506c61c294100dd6a0052b95 | /T24.java | e337b3f6d6044da12c6c4d1427b2f84e25f8b35f | [] | no_license | heatsink/NinjaFighter | e396afdf292956face107c7b5053ce50644852d7 | a096689a0f1387d8c54c89db2aa3bcf070c9a61f | refs/heads/master | 2021-01-21T16:26:40.411421 | 2015-12-06T04:43:37 | 2015-12-06T04:43:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,858 | java | import greenfoot.*;
import java.util.*;
/**
* Write a description of class K1 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class T24 extends Trap//bill
{
static boolean played = false;
GreenfootSound billin = new GreenfootSound("billin.mp3");
Counter shurikenCounter = new ShurikenCounter(getThisWorld(),"Shurikens: ");
Counter powerCounter = new PowerCounter("Power: ");
Counter levelCounter = new Counter("Stage: ");
Counter healthCounter = new HealthCounter(getThisWorld(), "Health: ");
private List<NPCS> npcs;
private int counterDelay = 0;
Ninja ninja;
int delay = 11;
public T24(Ninja ninja)//bill
{
super();
billin.setVolume(40);
this.ninja = ninja;
prepare();
}
private void prepare()//bill
{
doorT21 doort21 = new doorT21();
addObject(doort21, 625, 125);
for(int i = 0; i<15; i++)
for(int j = 0; j<2; j++)
{
Stump fence = new Stump();
addObject(fence, 25+j*700, 50*i+25);
}
for(int i = 1;i<15; i++)
for(int j = 0; j<2; j++)
{
Stump fence = new Stump();
addObject(fence, 50*i+25, 25+j*(700-50));
}
for(int i = 1; i<8; i++)
{
ForestBat bluemm = new ForestBat(2,2);
addObject(bluemm, 25+i*50, 425);
}
for(int i = 1; i<5; i++)
{
ForestBat bluemm = new ForestBat(2, 2);
addObject(bluemm, 375, 675-50*i);
}
for(int i = 4; i<10; i++)
{
ForestBat bluemm = new ForestBat(2, 2);
addObject(bluemm, 225+50*i, 225);
}
Teleport teleport1 = new Teleport();
addObject(teleport1, 375, 275);
Teleport teleport2 = new Teleport();
addObject(teleport2, 375, 325);
Teleport teleport3 = new Teleport();
instaPower instaPower1 = new instaPower();
addObject(instaPower1, 125, 675-50);
instaPower instaPower2 = new instaPower();
addObject(instaPower2, 175, 675-50);
addObject(teleport3, 375, 375);
addObject(healthCounter, 866, 120);
healthCounter.setValue(ninja.getNINJAHP());
addObject(shurikenCounter, 866, 201);
shurikenCounter.setValue(ninja.getSHURIKENNUMBER());
addObject(powerCounter, 866, 161);
powerCounter.setValue(ninja.getPOWERBAR());
makeAllIcons();
addObject(levelCounter, 950, 15);
levelCounter.setValue(24);
addObject(ninja, 75, 675-50);
npcs = getObjects(NPCS.class);
for(int i = 0; i<npcs.size(); i++)
{
TempText9 text = new TempText9(npcs.get(i));
addObject(text, npcs.get(i).getX(), npcs.get(i).getY()-20);
}
}
public void act()//bill
{
counterDelay++;
if(!played)
{
billin.playLoop();
played = !played;
}
checkTeleport();
if (Greenfoot.isKeyDown("h")&&delay>10)
{
clickSound.play();
Menu menu = new Menu(getThisWorld());
Greenfoot.setWorld(menu);
delay = 0;
}
if(getObjects(Ninja.class).size() != 0&& counterDelay >= 10)
{
checkDoorT21();
healthCounter.setValue(ninja.getNINJAHP());
shurikenCounter.setValue(ninja.getSHURIKENNUMBER());
powerCounter.setValue(ninja.getPOWERBAR());
counterDelay-= 10;
/**/ // TEMPORAY FUNCTIONS FOR HAYDEN TO CHANGE LEVELS TO MAKE THEM /**/
/**/ // TEMPORAY FUNCTIONS FOR HAYDEN TO CHANGE LEVELS TO MAKE THEM /**/
}
delay++;
}
public void makeAllIcons()//sean
{
SwordIcon swordicon = new SwordIcon();
addObject(swordicon, 889, 360);
ShurikenIcon shurikenicon = new ShurikenIcon();
addObject(shurikenicon, 838, 360);
DashIcon dashicon = new DashIcon();
addObject(dashicon, 819, 308);
}
public void checkTeleport(){//bill
if(ninja.checkTeleport())
{
ninja.setLocation(75, 625);
}
}
public void checkDoorT21()//bill
{
if(ninja.checkDoorT21()==true)
{
billin.stop();
Greenfoot.setWorld(new T25(ninja));
}
}
public Ninja getNinja()//bill
{
return ninja;
}
public Trap getThisWorld()//bill
{
return this;
}
public void gameover(){//Hayden
ninja.setHP(ninja.getArmor());
Greenfoot.setWorld(new T24(ninja));
}
} | [
"seanswally@gmail.com"
] | seanswally@gmail.com |
bc2cde1b832f97796cf5aeca40bf82014a818a87 | 587021c8bee5f17d7e66bf75ebe6d854d4802e66 | /eap.comps.orm.mybatis/src/main/java/eap/comps/orm/mybatis/config/NamespaceHandler.java | 04d10bc5a1c385550cf1c4be736853ed0af735f3 | [
"Apache-2.0"
] | permissive | rocky-zh/eap | 1f8fa4ac1e9d1452982b40d9e037e9932106a7f6 | f2293803506a25caf461080baecfb5919e5a4dbd | refs/heads/master | 2021-01-16T22:45:21.183953 | 2014-08-13T15:13:57 | 2014-08-13T15:13:57 | 22,976,288 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 602 | java | package eap.comps.orm.mybatis.config;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
/**
* <p> Title: </p>
* <p> Description: </p>
* @作者 chiknin@gmail.com
* @创建时间
* @版本 1.00
* @修改记录
* <pre>
* 版本 修改人 修改时间 修改内容描述
* ----------------------------------------
*
* ----------------------------------------
* </pre>
*/
public class NamespaceHandler extends NamespaceHandlerSupport {
@Override
public void init() {
registerBeanDefinitionParser("init", new InitBeanDefinitionParser());
}
}
| [
"chiknin@gmail.com"
] | chiknin@gmail.com |
5409a24f26c0d57f4ee81191cebd15c96f715d26 | 6acaa770d60f19c702c4a393fefc08ea72e48a48 | /src/com/joyl/iotserver/Session.java | 43780b66c07448ae79e7476c41f06b7f04502f24 | [] | no_license | KateLim/IoTServer | fb55ef19202ad5861356ca27bccc677cd4180e32 | abbe581cefb7fc13b2cbc8339570572e04ce9b8a | refs/heads/master | 2021-01-13T02:18:40.096041 | 2013-06-28T05:15:47 | 2013-06-28T05:15:47 | 10,538,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 639 | java | package com.joyl.iotserver;
public class Session {
protected String sessionID;
protected long lastHeartbeat;
public Session() {
super();
}
public boolean isAlive(long sessionTimeout) {
if (sessionID == null || lastHeartbeat == 0)
return false;
if ( (System.currentTimeMillis() - lastHeartbeat) > sessionTimeout)
return false;
return true;
}
public void updateSession() {
lastHeartbeat = System.currentTimeMillis();
}
public String getSessionID() {
return sessionID;
}
public boolean isValidSession(String sessionID) {
if (sessionID.equals(this.sessionID))
return true;
return false;
}
} | [
"meekyung.lim@gmail.com"
] | meekyung.lim@gmail.com |
5b5fbdc17d88b6f45444c620c5436df279ceae77 | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/tags/2.6.4/code/base/simulator/tests.base/com/tc/objectserver/control/NullServerControl.java | 34e93ad81875050a670e35e05c1a0639f6113207 | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 982 | java | /*
* All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright
* notice. All rights reserved.
*/
package com.tc.objectserver.control;
public class NullServerControl implements ServerControl {
private boolean isRunning;
public synchronized void attemptShutdown() throws Exception {
isRunning = false;
}
public synchronized void shutdown() throws Exception {
isRunning = false;
}
public synchronized void crash() throws Exception {
isRunning = false;
}
public synchronized void start() throws Exception {
this.isRunning = true;
}
public synchronized boolean isRunning() {
return isRunning;
}
public void clean() {
return;
}
public void mergeSTDOUT() {
return;
}
public void mergeSTDERR() {
return;
}
public void waitUntilShutdown() {
return;
}
public int getDsoPort() {
return 0;
}
public int getAdminPort() {
return 0;
}
}
| [
"foshea@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | foshea@7fc7bbf3-cf45-46d4-be06-341739edd864 |
b77321f0c408f94127b6df14a78f2aa4f730fe88 | 562112f15c396095bf6a54a197980449def5848b | /src/main/java/com/agile/modules/database/SYS_USER_GROUP.java | ffc30b735e9f03baa106ee2964e828c6264d8277 | [
"Apache-2.0"
] | permissive | xuanspace/SpringAgile | 52507c7610554a47eeba0e83d8a2b70b94eeb28e | f4adacd93a305498d4b9102280c87c36bd5be8dc | refs/heads/master | 2021-09-13T13:21:12.487488 | 2018-04-30T15:01:22 | 2018-04-30T15:01:22 | 115,268,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,617 | java | /*
* Copyright (C) 2016-2017 Spring Agile. All rights reserved.
* Licensed under the Apache License, Version 2.0
*/
package com.agile.modules.database;
import java.util.Date;
import com.agile.framework.query.SQLField;
import com.agile.framework.query.SQLTable;
public class SYS_USER_GROUP extends SQLTable {
public final static SQLField<Integer> ID = new SQLField<Integer>("sys_user_group", "id");
public final static SQLField<String> PARENT_ID = new SQLField<String>("sys_user_group", "parent_id");
public final static SQLField<Integer> USER_ID = new SQLField<Integer>("sys_user_group", "user_id");
public final static SQLField<String> GROUP_ID = new SQLField<String>("sys_user_group", "group_id");
public final static SQLField<String> CREATE_BY = new SQLField<String>("sys_user_group", "create_by");
public final static SQLField<Date> CREATE_TIME = new SQLField<Date>("sys_user_group", "create_time");
public final static SQLField<String> UPDATE_BY = new SQLField<String>("sys_user_group", "update_by");
public final static SQLField<Date> UPDATE_TIME = new SQLField<Date>("sys_user_group", "update_time");
public final static SQLField<String> DELETED = new SQLField<String>("sys_user_group", "deleted");
@Override
public String getName() {
return "sys_user_group";
}
@Override
public String getComment() {
return null;
}
@Override
public String toString() {
return "sys_user_group";
}
public SQLField<?>[] getFileds() {
SQLField<?>[] fields = {
ID,PARENT_ID,USER_ID,GROUP_ID,CREATE_BY,CREATE_TIME,UPDATE_BY,UPDATE_TIME,DELETED,
};
return fields;
}
}
| [
"linweixuan@gmail.com"
] | linweixuan@gmail.com |
faa842a48378217659142b5a2adcef63668de725 | db3fc771c22842b1a0bbb321c436e9bfb7225635 | /app/src/androidTest/java/com/goldenfuturecommunication/androidnetworking/ExampleInstrumentedTest.java | 97ce233bbd610eb55ff5b1d73129e058ae10526f | [] | no_license | SMalik97/Android_Networking_Universal_imageload | d5d12827da8f749c1ea09a217b4c1e94c756fa40 | a302128547964a8d04451c65f7a585d89b1e1630 | refs/heads/master | 2020-08-03T23:06:12.155396 | 2019-10-11T15:48:34 | 2019-10-11T15:48:34 | 211,914,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 810 | java | package com.goldenfuturecommunication.androidnetworking;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.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.getInstrumentation().getTargetContext();
assertEquals("com.goldenfuturecommunication.androidnetworking", appContext.getPackageName());
}
}
| [
"subratamalik1997@gmail.com"
] | subratamalik1997@gmail.com |
4d64d6c87b045f9c1fa6bba4d7eb157b4a0170cb | c8d753c500a90a476ef5439ebbc7bcc9b702ae96 | /src/main/java/decorator/pattern/starbuzz/code/Soy.java | 12deebbb40c4fd69899516cd7e85d194e4253be7 | [] | no_license | asniii/design-patterns | 1e12e49fca9b015eb64521ae3ca74faf6f23ba3d | 55077e6157c2c753fe32ad7c966cd2d7086b2182 | refs/heads/master | 2020-03-22T18:33:39.161306 | 2019-05-23T08:41:24 | 2019-05-23T08:41:24 | 140,467,439 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 358 | java | package decorator.pattern.starbuzz.code;
public class Soy extends CondimentDecorator {
Beverage beverage;
public Soy(Beverage beverage) {
this.beverage = beverage;
}
public String getDescription() {
return beverage.getDescription() + ", Soy";
}
public double cost() {
return .15 + beverage.cost();
}
}
| [
"asniii.coder@gmail.com"
] | asniii.coder@gmail.com |
1eb32b993f9feb89117c2cdbd2516399342c2593 | cbc979a8b8aabe1aa4a7030e2b34696a0220babb | /src/main/java/sk/fiit/aks/fail2ban/servlet/RouterServlet.java | 6da55c5309258897b006fe2c131e0c8d89e09778 | [] | no_license | andrejmlyncar/onepk-fail2ban | 7d27fed4677506b1a4a53c0ec7d7f9622c8c64d6 | f6548b136b1a41b3ba25b1eca434f05d92243f80 | refs/heads/master | 2020-06-29T21:06:28.896268 | 2017-03-20T14:22:12 | 2017-03-20T14:22:12 | 74,409,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,586 | 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 sk.fiit.aks.fail2ban.servlet;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.json.Json;
import javax.json.JsonArrayBuilder;
import javax.json.JsonObject;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import sk.fiit.aks.fail2ban.controller.ElementRegistry;
import sk.fiit.aks.fail2ban.enitiy.Router;
import sk.fiit.aks.fail2ban.exception.Fail2BanServletException;
import sk.fiit.aks.fail2ban.exception.Fail2banConnectionException;
import sk.fiit.aks.fail2ban.servlet.util.ServletDataReader;
/**
*
* @author Andrej Mlyncar <a.mlyncar@gmail.com>
*/
public class RouterServlet extends HttpServlet {
@Override
public void init() throws ServletException {
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
JsonArrayBuilder arrayBuilder = Json.createArrayBuilder();
for (Router router : ElementRegistry.getInstance().getAllRouters()) {
arrayBuilder.add(Json.createObjectBuilder().add("router_id", router.getId()).add("router_name", router.getName()).add("ip_address", router.getAddress()).build());
}
response.setContentType("application/json");
response.setStatus(200);
response.getWriter().write(arrayBuilder.build().toString());
}
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
JsonObject object = ServletDataReader.getJsonData(request);
ElementRegistry.getInstance().registerRouter(object.getString("ip_address"), object.getString("username"), object.getString("password"), object.getString("name"));
response.setStatus(200);
response.getWriter().write(Json.createObjectBuilder().add("status", "rotuer registered").build().toString());
} catch (Fail2BanServletException | Fail2banConnectionException ex) {
response.sendError(500);
Logger.getLogger(RouterServlet.class.getName()).log(Level.SEVERE, "Error registering router", ex);
}
}
@Override
public void destroy() {
}
}
| [
"a.mlyncar@gmail.com"
] | a.mlyncar@gmail.com |
a09fa0c9a8a4d4190645e75442497b3bba3d7d30 | 3274d151ad1db18ee513551864bdc944866d3a18 | /CNS_analysis/MyCNSanalysis/src/me/songbx/mains/Maize282PopulationGenePresentAbsent.java | e1ebe7c5b12d1fea39781a885c51cf3281f3bda0 | [
"MIT"
] | permissive | baoxingsong/CNSpublication | 4e91f6f6c94583e11cee23f3b2cd1ff4e2fdab6f | 00540e13be60631e2ea6f337944101e78c45119c | refs/heads/master | 2023-03-20T05:37:14.825450 | 2021-02-27T20:19:44 | 2021-02-27T20:19:44 | 292,394,564 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,397 | java | package me.songbx.mains;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import me.songbx.impl.ChromoSomeReadImpl;
import me.songbx.impl.ReadGffForSimpleGene;
import me.songbx.model.BedRecord;
import me.songbx.model.GeneSimple;
import me.songbx.service.IfIntron;
import htsjdk.tribble.readers.TabixReader;
import edu.unc.genomics.Contig;
import edu.unc.genomics.io.WigFileReader;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Maize282PopulationGenePresentAbsent {
public static void main1(String[] args) {
HashMap<String, String> maizeGenome = new ChromoSomeReadImpl("./Zea_mays.AGPv4.dna.toplevel.fa").getChromoSomeHashMap();
HashMap<String, GeneSimple> maizeGenes = new ReadGffForSimpleGene("./Zea_mays.AGPv4.34.gff3").getGenes();
PrintWriter outPut = null;
try {
outPut = new PrintWriter("./gene_sequence.fa");
for( String geneid : maizeGenes.keySet() ) {
String seq_name = maizeGenes.get(geneid).getChromeSomeName()+":"+maizeGenes.get(geneid).getStart()+"-"+maizeGenes.get(geneid).getEnd();
outPut.println(">"+geneid+"\t"+seq_name);
outPut.println(maizeGenome.get(maizeGenes.get(geneid).getChromeSomeName()).substring(maizeGenes.get(geneid).getStart()-1, maizeGenes.get(geneid).getEnd()));
}
outPut.close();
}catch (IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
PrintWriter outPut = null;
try {
outPut = new PrintWriter(args[0] + "_genotype");
//HashMap<String, String> maizeGenome = new ChromoSomeReadImpl("/media/bs674/1_8t/AndCns/maskGenomeForGenomeAlignment/masked_B73_v4_k20_46.fa").getChromoSomeHashMap();
HashMap<String, String> maizeGenome = new ChromoSomeReadImpl("masked_B73_v4_k20_46.fa").getChromoSomeHashMap();
HashMap<String, TabixReader> tabixReaders = new HashMap<String, TabixReader>();
HashMap<String, WigFileReader> wigFileReaders = new HashMap<String, WigFileReader>();
HashMap<String, WigFileReader> wigFileReaders2 = new HashMap<String, WigFileReader>();
IfIntron ifIntron = new IfIntron("./Zea_mays.AGPv4.34.gff3");
HashMap<String, GeneSimple> maizeGenes = new ReadGffForSimpleGene("./Zea_mays.AGPv4.34.gff3").getGenes();
outPut.print("geneName\tGeneRange\tlength");
HashMap<String, String> seqNameToId = new HashMap<String, String>();
try {
//reading gene sequence begin
File fastaFile = new File("gene_sequence.fa");
BufferedReader fastaReader = new BufferedReader(new FileReader(fastaFile));
String tempString = null;
Pattern pattern = Pattern.compile("^>(\\S+)\\s+(\\S+)");
while ((tempString = fastaReader.readLine()) != null) {
Matcher match = pattern.matcher(tempString);
if( match.find() ) {
seqNameToId.put(match.group(2), match.group(1));
}
}
fastaReader.close();
//reading gene sequence done
//reading reads coverage begin
File file = new File(args[0]);
BufferedReader reader = new BufferedReader(new FileReader(file));
tempString = null;
while ((tempString = reader.readLine()) != null) {
tempString = tempString.trim();
String baseName = tempString;
baseName = baseName.replaceAll(".*\\/", "");
baseName = baseName.replaceAll(".bam.bed.gz", "");
outPut.print("\t" + baseName);
//String bwFilePosition0 = "/media/bs674/panAndAssemblyfi/maize282Genotyping/coverageBwFiles/" + baseName + ".bw";
//String bwFilePosition0 = "./coverageBwFiles/" + baseName + ".bw";
String bwFilePosition0 = "/public/home/xpsun/521bwabam/bamtoWig/bigwig/" + baseName + ".bam.wig.bw";
Path bwFile0 = Paths.get(bwFilePosition0);
WigFileReader wig0 = WigFileReader.autodetect(bwFile0);
wigFileReaders.put(baseName, wig0);
//String bwFilePosition = "/media/bs674/1_8t/AndCns/mapCnsToReads/sorghum/mapreadsToCns/" + baseName + ".bw";
//String bwFilePosition = "./mapreadsToGene/" + baseName + ".bw";
String bwFilePosition = "/public/home/xpsun/521bwabam/geneSeqWig/bigwig/" + baseName + ".bw";
Path bwFile = Paths.get(bwFilePosition);
WigFileReader wig = WigFileReader.autodetect(bwFile);
wigFileReaders2.put(baseName, wig);
TabixReader tr = new TabixReader(tempString);
tabixReaders.put(baseName, tr);
}
reader.close();
//reading reads coverage done
} catch (IOException e) {
e.printStackTrace();
}
outPut.println();
//SamReader reader0 = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.SILENT).open(new File("/media/bs674/1_8t/AndCns/sorghum/and_cns_sorghum_maize_V2_smaller_kmer_frequency/5.bam"));
for( String geneid: maizeGenes.keySet() ) {
int start = maizeGenes.get(geneid).getStart();
int end = maizeGenes.get(geneid).getEnd();
String chr = maizeGenes.get(geneid).getChromeSomeName();
HashSet<Integer> nonMaskingPositions = new HashSet<Integer>();
int totalLength = 0;
for( int i=start-1; i<end; ++i ) {
if (ifIntron.getElement ( chr, i+1 ) == 2 ) {
totalLength = totalLength + 1;
nonMaskingPositions.add(i);
}
}
if(totalLength > 30) {
outPut.print(geneid+"\t"+chr+":"+start+"-"+end+"\t" + totalLength);
String seq_name = chr+":"+start+"-"+end;
//System.out.println(seq_name);
//read bed files begin
File file = new File(args[0]);
try {
BufferedReader reader = new BufferedReader(new FileReader(file));
String tempString = null;
while ((tempString = reader.readLine()) != null) {
tempString = tempString.trim();
try {
ArrayList<BedRecord> bedRecords = new ArrayList<BedRecord>();
String baseName = tempString;
baseName = baseName.replaceAll(".*\\/", "");
baseName = baseName.replaceAll(".bam.bed.gz", "");
WigFileReader wig = wigFileReaders.get(baseName);
WigFileReader wig2 = wigFileReaders2.get(baseName);
TabixReader tr = tabixReaders.get(baseName);
String s;
int st = start-1;
TabixReader.Iterator iter = tr.query(chr+":"+st+"-"+end); // get the iterator
while ((s = iter.next()) != null) {
String[] arrOfStr = s.split("\\s+");
if( arrOfStr[3].compareTo("CALLABLE")==0 ) {
BedRecord bedRecord = new BedRecord(Integer.parseInt(arrOfStr[1])+1, Integer.parseInt(arrOfStr[2])); //bed has special coordinate
bedRecords.add(bedRecord);
}
}
int totalGoodLength = 0;
for( int i : nonMaskingPositions ) {
if( maizeGenome.get(chr).charAt(i) == 'n' && ifCallAble(i+1, bedRecords, wig, chr, i+2-start, wig2, seqNameToId.get(seq_name)) ) {
//if( maizeGenome.get(chr).charAt(i) != 'n' && ifCallAble(i+1, bedRecords, wig, chr) ) {
totalGoodLength = totalGoodLength + 1;
}
}
outPut.print("\t" + totalGoodLength);
} catch (IOException e) {
e.printStackTrace();
}
}
reader.close();
outPut.println();
} catch (IOException e) {
e.printStackTrace();
}//read bed files end
}
}
outPut.close();
for( String baseName : tabixReaders.keySet() ) {
tabixReaders.get(baseName).close();
wigFileReaders.get(baseName).close();
wigFileReaders2.get(baseName).close();
}
}catch (IOException e) {
e.printStackTrace();
}// catch (WigFileException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
static boolean ifCallAble( int position, ArrayList<BedRecord> bedRecords, WigFileReader wig, String chr, int position2, WigFileReader wig2, String seq_name ) {
for( BedRecord bedRecord : bedRecords ) {
if( position >= bedRecord.getStart() && position <= bedRecord.getEnd() ) {
return true;
}
if( bedRecord.getStart() > position ) {
break;
}
}
Contig result;
double thisMean;
try {
result = wig.query(chr, position, position);
thisMean = result.mean();
if (thisMean > 0){
return true;
}
result = wig2.query(seq_name, position2, position2);
thisMean = result.mean();
if (thisMean > 0){
return true;
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return false;
}
}
| [
"yifeiren07"
] | yifeiren07 |
099b791ad71f069d489d1c8b1b88678b2f0f9dca | 610f12c7d416408f114814a0c335929788645250 | /Assignment 5/PageRank/src/edu/stevens/cs549/hadoop/pagerank/InitMapper.java | 23fb3e0a98003cac4e838798c27e908837c466ca | [] | no_license | nvaldes/nvaldes_549 | ba25978d5cd09d5a308dae1b7ffcad48c374de67 | dc1bd827ed5e3da57f09a09a0e2a9caabfd23754 | refs/heads/master | 2020-06-19T08:37:16.131038 | 2017-12-02T02:15:35 | 2017-12-02T02:15:35 | 68,145,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | package edu.stevens.cs549.hadoop.pagerank;
import java.io.IOException;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.io.*;
public class InitMapper extends Mapper<LongWritable, Text, Text, Text> {
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException,
IllegalArgumentException {
String[] line = value.toString().split(": "); // Converts Line to a String
/*
* DONE Just echo the input, since it is already in adjacency list format.
*/
if (line.length == 1) {
line = new String[] {line[0], ""};
}
Text outKey = new Text(line[0]);
Text outVal = new Text(line[1]);
context.write(outKey, outVal);
// return;
}
}
| [
"nvaldes@c21stores.com"
] | nvaldes@c21stores.com |
44f0a398f9d05287344728ddb9421ff416fa9b9d | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13372-12-2-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/extension/xar/internal/handler/XarExtensionHandler_ESTest_scaffolding.java | 0e64226891a97e39897a5829d92383217b37b154 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sat Apr 04 04:47:39 UTC 2020
*/
package org.xwiki.extension.xar.internal.handler;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class XarExtensionHandler_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
1b8602095c418619ac1c309881890ee2e36e465b | 6826e00925044a43e6175c7e5e0fe755e02b2e69 | /Email_crypt/app/src/main/java/com/indeema/email/mail/store/imap/ImapMemoryLiteral.java | 373a625c7d0f09fb2402f6a921a4ddb54d6639c5 | [] | no_license | nazarcybulskij/DefaultEmail-OpenKeyChain | 6e7fa5125221c218e3b08c2c918554da68dd265d | 415ee83155a73725ba7bb768554e7813a8c6114c | refs/heads/master | 2016-09-11T02:53:17.425139 | 2015-03-08T20:54:20 | 2015-03-08T20:54:20 | 31,715,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,096 | java | /*
* Copyright (C) 2010 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.indeema.email.mail.store.imap;
import com.indeema.email.FixedLengthInputStream;
import com.indeema.emailcommon.Logging;
import com.indeema.emailcommon.utility.Utility;
import com.indeema.mail.utils.LogUtils;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* Subclass of {@link ImapString} used for literals backed by an in-memory byte array.
*/
public class ImapMemoryLiteral extends ImapString {
private byte[] mData;
/* package */ ImapMemoryLiteral(FixedLengthInputStream in) throws IOException {
// We could use ByteArrayOutputStream and IOUtils.copy, but it'd perform an unnecessary
// copy....
mData = new byte[in.getLength()];
int pos = 0;
while (pos < mData.length) {
int read = in.read(mData, pos, mData.length - pos);
if (read < 0) {
break;
}
pos += read;
}
if (pos != mData.length) {
LogUtils.w(Logging.LOG_TAG, "");
}
}
@Override
public void destroy() {
mData = null;
super.destroy();
}
@Override
public String getString() {
return Utility.fromAscii(mData);
}
@Override
public InputStream getAsStream() {
return new ByteArrayInputStream(mData);
}
@Override
public String toString() {
return String.format("{%d byte literal(memory)}", mData.length);
}
}
| [
"nazar.cybulskij@optigra-soft.com"
] | nazar.cybulskij@optigra-soft.com |
5ed2f773606cc89aee78c120155a6df6503573a7 | ed28529ad189a75f90f36ddcc242d33af1133852 | /app/src/main/java/com/zvin/wificonnect/util/Const.java | bfd5a70780fed003cf843ec5a3b68415e17292d7 | [] | no_license | ZVin-Chen/Android-Wifi-Connect | 87dce5837d23e9106fed9498e868b5a3167c5cb4 | 479e07bfcb8ed8b8a44159a5a6ffa27211971e60 | refs/heads/master | 2021-01-10T14:42:36.490476 | 2016-01-15T08:48:19 | 2016-01-15T08:48:19 | 49,007,484 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 902 | java | package com.zvin.wificonnect.util;
/**
* Created by chenzhengwen on 2015/12/28.
*/
public class Const {
public static final String MAIN_OBSERBER_TAG = "main_observer_tag";
public static final String PRE_LOGIN_TAG = "pre_login_tag--->";
public static final long http_timeout=60 * 1000; //网络连接超时 60秒
public static final long http_logout_timeout=60 * 1000; //下线时网络连接超时 20秒
public static final long free_biz_http_timeout=10 * 1000; //下线时网络连接超时 20秒
public static final String BAIDU_URL= "http://www.baidu.com";
public static final String NEWS_BAIDU = "http://news.baidu.com";
// 准现网地址,用于测试联调时使用
public static final String HOST = "120.197.230.56";// "120.197.230.56";
//portal判断是否是漫游的依据
public static final String JUDGE_ROAMING = "pccwwifi;roamhk";
}
| [
"chenzwkeepmoving@gmail.com"
] | chenzwkeepmoving@gmail.com |
8054c5d6a3d0f9b0585a527bc00bd3cabecbfa02 | f09223d4fe1457428b8f3b5a138f3b8dd51d864a | /src/main/java/com/redhat/errai/math/client/shared/Manufacturer.java | afa8fdf2499526676ddccad597eec46f3b606c7f | [] | no_license | sabre1041/errai-math | dc0e62ce4b5f8505577362c5fc7c8b132e2a219b | 8381cec50cd792e5f68e3341878c2dcef004bea3 | refs/heads/master | 2021-01-17T17:17:45.288007 | 2013-06-13T13:29:43 | 2013-06-13T13:29:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package com.redhat.errai.math.client.shared;
public enum Manufacturer {
MICROSOFT,APPLE,MOZILLA,GOOGLE,OPERA,BLACKBERRY, LINUX;
}
| [
"andy.block@gmail.com"
] | andy.block@gmail.com |
91f5792acc1a33b8f0a2b82f3d52f1ad8f74ab3b | 703d7b0e617616d77c6461503e869bd78ac5e071 | /Model/SpotifyData.java | 143901234b90f8605eba2e95e852c2817bf19ee2 | [] | no_license | FedyaSavchuk/MusicAdvisor | 162a9766ac23a6a745dc83ca64f4ec17f47b3a58 | bd2d78113724a5f4c34d0e6c410ec1a45f4fcfd8 | refs/heads/master | 2022-08-30T13:52:42.889655 | 2020-05-25T18:27:35 | 2020-05-25T18:27:35 | 266,840,808 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 899 | java | package advisor.Model;
public class SpotifyData {
String album = null;
String artists = null;
String category = null;
String link = null;
public void setAlbum(String album) {
this.album = album;
}
public void setArtists(String authors) {
this.artists = authors;
}
public void setCategory(String category) {
this.category = category;
}
public void setLink(String link) {
this.link = link;
}
@Override
public String toString() {
StringBuilder info = new StringBuilder();
if (album != null) { info.append(album).append("\n"); }
if (artists != null) { info.append(artists).append("\n");; }
if (link != null) { info.append(link).append("\n");; }
if (category != null) { info.append(category).append("\n");; }
return info.toString().replaceAll("\"", "");
}
}
| [
"fedyasavchuk@gmail.com"
] | fedyasavchuk@gmail.com |
2acf233807f85310512826baf9d68ac97124350d | e42569d6e75efb0e7ed5238bc8c31943f67cf203 | /Paradigms-2019/Java/SimpleExpression/expression/Variable.java | 66bc8afdcf28b490897bdc02768f6c7efbb7ce25 | [] | no_license | alexanderlvarfolomeev/ITMO | 3894cc0b342442f1e49fc144e84968d727e58113 | af23fd25f1b18786debc61f436cd813f0a72796a | refs/heads/master | 2022-05-28T08:06:22.736193 | 2021-03-21T20:28:32 | 2021-03-21T20:28:32 | 181,557,213 | 1 | 0 | null | 2022-05-20T21:19:01 | 2019-04-15T20:02:43 | Java | UTF-8 | Java | false | false | 317 | java | package expression;
public class Variable extends AbstractExpression {
private String name;
public Variable(String name) {
this.name = name;
}
public double evaluate(double valueOfX) {
return valueOfX;
}
public int evaluate(int valueOfX) {
return valueOfX;
}
}
| [
"47699145+alexanderlvarfolomeev@users.noreply.github.com"
] | 47699145+alexanderlvarfolomeev@users.noreply.github.com |
eadc321e8380c1ada2aeedf0f994f3c9c8c6e31a | 2c3e2e227eee24b3409be4edd206a1f8b3ea258b | /src/main/java/com/trapp/cursomc/domain/Categoria.java | e859cf75e7173281ceaf371bed47b9e08c638f86 | [] | no_license | etrapp/cursomc | ab86fae6de0a8c0c5b8290f73c082ead83e715cf | 2ca43dba8bf4b5a86ca0b8b75484145812c829dc | refs/heads/master | 2022-11-19T21:16:39.142101 | 2020-07-24T09:36:50 | 2020-07-24T09:36:50 | 279,030,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,662 | java | package com.trapp.cursomc.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import com.fasterxml.jackson.annotation.JsonManagedReference;
@Entity
public class Categoria implements Serializable {
private static final long serialVersionUID = 1;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String nome;
@JsonManagedReference
@ManyToMany(mappedBy = "categorias")
private List<Produto> produtos = new ArrayList<>();
public List<Produto> getProdutos() {
return produtos;
}
public void setProdutos(List<Produto> produtos) {
this.produtos = produtos;
}
public Categoria() {
}
public Categoria(Integer id, String nome) {
super();
this.id = id;
this.nome = nome;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
@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;
Categoria other = (Categoria) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
| [
"etrapp@gmail.com"
] | etrapp@gmail.com |
681dea1deecf1b792c93afcf80ef3c3762e54c95 | 5099514f6a536565058ed9ee9695faee25f3d7ba | /SwiftTrading/src/main/java/com/citi/swifttrading/generator/OrderBookItem.java | 36083a8ed74b612b7bd65c9220ea5dfabc8a9ba8 | [] | no_license | CitiAnalyst2017/SwiftTrading | b5244e753a5b5a79b8163b55b198732fc1e106cd | 7f155702a5c5be402ec94c06dec2bdb07040d087 | refs/heads/master | 2021-01-02T19:17:13.336132 | 2018-11-09T18:26:42 | 2018-11-09T18:26:42 | 99,309,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package com.citi.swifttrading.generator;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class OrderBookItem {
private String bid;
private Double price;
private int qty;
public OrderBookItem(String bid, double price, int qty) {
super();
this.bid = bid;
this.price = price;
this.qty = qty;
}
@Override
public String toString() {
return "OrderBookItem [bid=" + bid + ", price=" + price + ", qty=" + qty + "]";
}
public OrderBookItem() {
}
}
| [
"990242649@qq.com"
] | 990242649@qq.com |
35d593cd39dc1ac8a725076c85cc09704d1b1b93 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a150/A150605Test.java | 4d045ce3eff0281bb2ab2cb74627de6d542aa7dd | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 256 | java | package irvine.oeis.a150;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A150605Test extends AbstractSequenceTest {
@Override
protected int maxTerms() {
return 10;
}
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
2f960a6bcab17dbdd03874e188b4927a42d96590 | d5b39e9e1e8b24a23313ab13bc3c185ae4612d5e | /fastdfs.client/src/main/java/com/m/fastdfs/sources/ClientGlobal.java | beccd1270b9fe933ec47601dae8fafe34afc9cd9 | [] | no_license | yangge007/taotao | 52656438bb7dc50e38b48e042073c4f4a42e71af | 3a44b777fbea86e46036428bac98015800eb35eb | refs/heads/master | 2021-01-24T17:01:14.068283 | 2018-10-12T08:53:53 | 2018-10-12T08:53:53 | 123,103,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,613 | java | /**
* Copyright (C) 2008 Happy Fish / YuQing
*
* FastDFS Java Client may be copied only under the terms of the GNU Lesser
* General Public License (LGPL).
* Please visit the FastDFS Home Page http://www.csource.org/ for more detail.
**/
package com.m.fastdfs.sources;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import com.m.fastdfs.common.IniFileReader;
import com.m.fastdfs.common.MyException;
/**
* Global variables
* @author Happy Fish / YuQing
* @version Version 1.11
*/
public class ClientGlobal
{
public static int g_connect_timeout; //millisecond
public static int g_network_timeout; //millisecond
public static String g_charset;
public static int g_tracker_http_port;
public static boolean g_anti_steal_token; //if anti-steal token
public static String g_secret_key; //generage token secret key
public static TrackerGroup g_tracker_group;
public static final int DEFAULT_CONNECT_TIMEOUT = 5; //second
public static final int DEFAULT_NETWORK_TIMEOUT = 30; //second
public static String DEFAULT_GROUP_NAME;//if groupname is null ,return deault groupname
private ClientGlobal()
{
}
/**
* load global variables
* @param conf_filename config filename
*/
public static void init(String conf_filename) throws FileNotFoundException, IOException, MyException
{
IniFileReader iniReader;
String[] szTrackerServers;
String[] parts;
iniReader = new IniFileReader(conf_filename);
g_connect_timeout = iniReader.getIntValue("connect_timeout", DEFAULT_CONNECT_TIMEOUT);
if (g_connect_timeout < 0)
{
g_connect_timeout = DEFAULT_CONNECT_TIMEOUT;
}
g_connect_timeout *= 1000; //millisecond
g_network_timeout = iniReader.getIntValue("network_timeout", DEFAULT_NETWORK_TIMEOUT);
if (g_network_timeout < 0)
{
g_network_timeout = DEFAULT_NETWORK_TIMEOUT;
}
g_network_timeout *= 1000; //millisecond
g_charset = iniReader.getStrValue("charset");
if (g_charset == null || g_charset.length() == 0)
{
g_charset = "ISO8859-1";
}
szTrackerServers = iniReader.getValues("tracker_server");
if (szTrackerServers == null)
{
throw new MyException("item \"tracker_server\" in " + conf_filename + " not found");
}
InetSocketAddress[] tracker_servers = new InetSocketAddress[szTrackerServers.length];
for (int i=0; i<szTrackerServers.length; i++)
{
parts = szTrackerServers[i].split("\\:", 2);
if (parts.length != 2)
{
throw new MyException("the value of item \"tracker_server\" is invalid, the correct format is host:port");
}
tracker_servers[i] = new InetSocketAddress(parts[0].trim(), Integer.parseInt(parts[1].trim()));
}
g_tracker_group = new TrackerGroup(tracker_servers);
g_tracker_http_port = iniReader.getIntValue("http.tracker_http_port", 80);
g_anti_steal_token = iniReader.getBoolValue("http.anti_steal_token", false);
if (g_anti_steal_token)
{
g_secret_key = iniReader.getStrValue("http.secret_key");
}
DEFAULT_GROUP_NAME = iniReader.getStrValue("default_group_name");
}
/**
* construct Socket object
* @param ip_addr ip address or hostname
* @param port port number
* @return connected Socket object
*/
public static Socket getSocket(String ip_addr, int port) throws IOException
{
Socket sock = new Socket();
sock.setSoTimeout(ClientGlobal.g_network_timeout);
sock.connect(new InetSocketAddress(ip_addr, port), ClientGlobal.g_connect_timeout);
return sock;
}
/**
* construct Socket object
* @param addr InetSocketAddress object, including ip address and port
* @return connected Socket object
*/
public static Socket getSocket(InetSocketAddress addr) throws IOException
{
Socket sock = new Socket();
sock.setSoTimeout(ClientGlobal.g_network_timeout);
sock.connect(addr, ClientGlobal.g_connect_timeout);
return sock;
}
public static int getG_connect_timeout()
{
return g_connect_timeout;
}
public static void setG_connect_timeout(int connect_timeout)
{
ClientGlobal.g_connect_timeout = connect_timeout;
}
public static int getG_network_timeout()
{
return g_network_timeout;
}
public static void setG_network_timeout(int network_timeout)
{
ClientGlobal.g_network_timeout = network_timeout;
}
public static String getG_charset()
{
return g_charset;
}
public static void setG_charset(String charset)
{
ClientGlobal.g_charset = charset;
}
public static int getG_tracker_http_port()
{
return g_tracker_http_port;
}
public static void setG_tracker_http_port(int tracker_http_port)
{
ClientGlobal.g_tracker_http_port = tracker_http_port;
}
public static boolean getG_anti_steal_token()
{
return g_anti_steal_token;
}
public static boolean isG_anti_steal_token()
{
return g_anti_steal_token;
}
public static void setG_anti_steal_token(boolean anti_steal_token)
{
ClientGlobal.g_anti_steal_token = anti_steal_token;
}
public static String getG_secret_key()
{
return g_secret_key;
}
public static void setG_secret_key(String secret_key)
{
ClientGlobal.g_secret_key = secret_key;
}
public static TrackerGroup getG_tracker_group()
{
return g_tracker_group;
}
public static void setG_tracker_group(TrackerGroup tracker_group)
{
ClientGlobal.g_tracker_group = tracker_group;
}
public static String getDEFAULT_GROUP_NAME() {
return DEFAULT_GROUP_NAME;
}
public static void setDEFAULT_GROUP_NAME(String dEFAULT_GROUP_NAME) {
DEFAULT_GROUP_NAME = dEFAULT_GROUP_NAME;
}
}
| [
"yangshen9808@163.com"
] | yangshen9808@163.com |
ca869a1f6d148ef0fca6efd6427ee28489b8c22d | 4245b565c16d1d5223a1dde065e6b4d03aff4fb8 | /app/src/androidTest/java/com/ivansolutions/gcmandroidnights/ApplicationTest.java | 67e6fadd75e123253090dfb7999c31effd693a49 | [] | no_license | sierisimo/GcmAndroidNights | 8bdd41ed791263f18a5753d4b461072f11631d61 | e84889eadcfaaf272a7a2ea49a31d38283689b59 | refs/heads/master | 2021-01-21T23:37:44.118733 | 2015-11-05T05:45:19 | 2015-11-05T05:45:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 365 | java | package com.ivansolutions.gcmandroidnights;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"elias.carrillo@alsea.com.mx"
] | elias.carrillo@alsea.com.mx |
4aae6ecdedec3881bfac3a8e29e483770d715e97 | 33cae071de05a68ce026bbbdeaa34780f965fd42 | /src/数组与矩阵/搜索二维矩阵_II_240.java | eec92b83ab886890fc729e97e44f427f3bc522fe | [] | no_license | xiaok1024/AlgorithmWithDesign | 85c04ab08f43409b5314fdc21220f0446aa3f2be | 80f5fce4d4864a7451534d13cbc9bc83e4b042ef | refs/heads/master | 2020-05-01T09:47:53.202394 | 2019-03-24T12:02:05 | 2019-03-24T12:02:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,317 | java | package 数组与矩阵;
public class 搜索二维矩阵_II_240 {
/*
* 编写一个高效的算法来搜索 m x n 矩阵 matrix 中的一个目标值 target。该矩阵具有以下特性:
每行的元素从左到右升序排列。
每列的元素从上到下升序排列。
* [
[1, 4, 7, 11, 15],
[2, 5, 8, 12, 19],
[3, 6, 9, 16, 22],
[10, 13, 14, 17, 24],
[18, 21, 23, 26, 30]
]
给定 target = 5,返回 true。
给定 target = 20,返回 false。
*/
//思路:从右上角开始(行上最大,列上最小), 比较target 和 matrix[i][j]的值. 如果小于target(该行最大的数都小于target), 则该行不可能有此数, 所以i++;
//如果大于target(该行右边的数大于target), 则该列不可能有此数, 所以j--(向左搜索). 遇到边界则表明该矩阵不含target.
public boolean searchMatrix(int[][] matrix, int target) {
//row为0 column 为0
if(matrix.length==0 || matrix[0].length ==0)
return false;
//从右上角开始
int i = 0;
int j = matrix[0].length-1;
//遍历,条件为不到达边界
while(i<=matrix.length-1 && j>=0) {
//获取当前位置的值
int x = matrix[i][j];
if(x==target)
return true;
if(x < target)
i++;
if(x > target)
j--;
}
return false;
}
}
| [
"xiaokang136106@163.com"
] | xiaokang136106@163.com |
d9a7b907832ed9ed4feb8ab4ec5d3b7d2c2cf2b1 | a037b6c0ca1a936898c2996cacf8871fdb1ab109 | /Lection15/ElectronicRegistry/servlets-layer/src/main/java/ru/senla/bialevich/servlets/GetAllRoomsServlet.java | b079a2eba867525f04d3a04aa32bfb0b97c6fdc4 | [] | no_license | SiarheiBialevich/SenlaCourseJavaEE | 8f7139b0c0f7ff0b3d9824ff7e8962e9e2f6afac | 0543db4973589aaf0812704a80f52c34abaaec3a | refs/heads/master | 2021-09-09T19:23:37.277007 | 2018-03-01T01:53:40 | 2018-03-01T01:53:40 | 103,466,137 | 0 | 1 | null | 2018-03-19T07:31:26 | 2017-09-14T00:36:43 | Java | UTF-8 | Java | false | false | 920 | java | package ru.senla.bialevich.servlets;
import com.fasterxml.jackson.databind.ObjectMapper;
import ru.senla.bialevich.model.Room;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
@WebServlet("/allRooms")
public class GetAllRoomsServlet extends AbstractServlet {
private static final long serialVersionUID = 5335416693092046179L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
ObjectMapper mapper = new ObjectMapper();
resp.setContentType(JSON);
PrintWriter writer = resp.getWriter();
List<Room> rooms = hotel.getAllRooms(null);
writer.write(mapper.writeValueAsString(rooms));
}
}
| [
"acharne1985@gmail.com"
] | acharne1985@gmail.com |
90c1dde8a74c69a116626dfdf03fc1a94aaea282 | 26310ffd080286e8ba21c67ab6f51ab9c89aaee4 | /app/src/main/java/com/wzy/helptravel/ui/Fragment/MeFragment.java | 1374b58e25bcdb671d275f843db85c022c300b9c | [] | no_license | oldwu/HelpTravel | 57ce3dd1b857c0ad65464570783b1fccfc1f5f42 | edfa1baf2bb5a5be3b909605837d796216112ae5 | refs/heads/master | 2021-01-15T15:33:24.218664 | 2016-08-23T05:27:50 | 2016-08-23T05:27:50 | 62,987,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,549 | java | package com.wzy.helptravel.ui.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.wzy.helptravel.R;
import com.wzy.helptravel.base.BaseToolBarFragment;
import com.wzy.helptravel.base.UniversalImageLoader;
import com.wzy.helptravel.bean.User;
import com.wzy.helptravel.dao.UserModel;
import com.wzy.helptravel.ui.LoginActivity;
import com.wzy.helptravel.ui.MainActivity;
import com.wzy.helptravel.ui.MeActivity;
import com.wzy.helptravel.ui.MyInfoActivity;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.bmob.v3.Bmob;
/**
* Created by wzy on 2016/7/8.
*/
public class MeFragment extends BaseToolBarFragment {
@Bind(R.id.avatar_bg)
LinearLayout avatarBg;
@Bind(R.id.avatar_me_img)
ImageView avatar;
@Bind(R.id.username_me_tv)
TextView username;
@Bind(R.id.meInfo)
View meInfo;
@Bind(R.id.helpInfo)
View helpInfo;
@Bind(R.id.logout_me_view)
View logout;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_me, container, false);
ButterKnife.bind(this, rootView);
return rootView;
}
@Override
public void onResume() {
super.onResume();
initUserInfo();
}
@Override
protected String title() {
return "";
}
@OnClick(R.id.meInfo)
void onMeInfo() {
Bundle bundle = new Bundle();
bundle.putSerializable("user", MainActivity.user);
bundle.putBoolean("canChanged", true);
startActivity(MeActivity.class, bundle);
}
@OnClick(R.id.helpInfo)
void onHelpInfo() {
startActivity(MyInfoActivity.class, null);
}
@OnClick(R.id.logout_me_view)
void onLogout(){
UserModel.getInstance().logout();
startActivity(LoginActivity.class, null);
getActivity().finish();
}
private void initUserInfo() {
User user = UserModel.getInstance().getCurrentUser();
new UniversalImageLoader().load(avatar, user.getAvatar(), R.mipmap.default_avator, null);
username.setText(user.getNickName() != null ? user.getNickName() : user.getUsername());
}
}
| [
"zhenyu Wu"
] | zhenyu Wu |
19bcc755b0537930214c539c0164aa712604fda1 | e2b1b702ac35aaf390b11248ea11e0d9b037ac82 | /organizationsvc/src/test/java/com/springland365/organization/respository/OrganizationRespsitoryTest.java | 54184e9686da6fa5c0340c9299681bfe7adbdb08 | [] | no_license | springland/SpringMicroService | 5dc3c6910aa773e678cb2159bcdf16d6a626e42e | b7b78fe48c1aaa6ba70d27da9f46e6b5a648726b | refs/heads/master | 2023-02-11T04:56:53.316676 | 2021-01-10T20:38:48 | 2021-01-10T20:38:48 | 325,688,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,153 | java | package com.springland365.organization.respository;
import com.springland365.organization.model.Organization;
import com.springland365.organization.repository.OrganizationRepository;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertEquals;
@SpringBootTest
@ActiveProfiles("test")
public class OrganizationRespsitoryTest {
@Autowired
OrganizationRepository repo ;
@Test
public void test()
{
Organization org = Organization.builder()
.id("org1")
.name("test org")
.contactPhone("203-550-5581")
.contactEmail("test@email.com")
.contactName("test contact")
.build();
repo.save(org);
Optional<Organization> result = repo.findById("org1");
assertEquals(result.get() , org);
}
}
| [
"fenglinmail@yahoo.com"
] | fenglinmail@yahoo.com |
1a13c0d2a6415afd0c9b130b20eecad66a706d1d | 1f19aec2ecfd756934898cf0ad2758ee18d9eca2 | /u-1/u-11/u-11-111/u-11-111-1111/u-11-111-1111-11111/u-11-111-1111-11111-f1915.java | 9221350031ff2a683860a9d908cdb94a5e72204e | [] | no_license | apertureatf/perftest | f6c6e69efad59265197f43af5072aa7af8393a34 | 584257a0c1ada22e5486052c11395858a87b20d5 | refs/heads/master | 2020-06-07T17:52:51.172890 | 2019-06-21T18:53:01 | 2019-06-21T18:53:01 | 193,039,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 106 | java | mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117
6080341067780 | [
"jenkins@khan.paloaltonetworks.local"
] | jenkins@khan.paloaltonetworks.local |
0421a38452cbe790975a202649e4b6b18e35f858 | 0a638fa6d36556bb9024cbd415e51f5f77be57bc | /src/main/java/com/example/manager_house_88/domain/Collection.java | 82e444327cbd0bffca8db1ed01cc70a0791fe86b | [] | no_license | Curtaingit/maneger_house_88 | c14be7538275958b57267f654e0c7001d3a293ef | 8801bb4aef3377c8a56b4d5a615259c30d391b53 | refs/heads/master | 2021-09-08T21:18:09.694845 | 2018-03-12T08:21:20 | 2018-03-12T08:21:20 | 116,771,407 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 595 | java | package com.example.manager_house_88.domain;
import com.example.manager_house_88.bos.BaseEntity;
import com.example.manager_house_88.bos.Bostype;
import com.example.manager_house_88.bos.Entry;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Getter;
import lombok.Setter;
import sun.management.counter.perf.PerfInstrumentation;
import javax.persistence.*;
@Getter
@Setter
@Entity(name = "t_collection")
@Bostype("A08")
public class Collection extends BaseEntity {
/*用户id*/
private String userId;
/*标的物id*/
private String commodityId;
}
| [
"1004711601@qq.com"
] | 1004711601@qq.com |
5be7dd586371806d274fcc1aee86a65949fbc7dc | 892c3c8f61a74fa33b23ac4eb95e619ffc0226eb | /javaee_01/src/main/java/myjava/servlets/LoginSServlet.java | 8bf378434fc3302c0631cf2715c18ab2892ccae5 | [] | no_license | mengchuize/javaee_hw3 | 925be3e7de95dde13a2bf09297f70f3770ecf8e5 | 6846c39fcd83f8615e87cbf04f0cdeeafbccbd5e | refs/heads/master | 2022-07-03T05:26:36.255489 | 2020-03-25T12:18:10 | 2020-03-25T12:18:10 | 249,950,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,318 | java | package myjava.servlets;
import myjava.tables.Student;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/LoginSServlet")
public class LoginSServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
String username = request.getParameter("susername");
String password = request.getParameter("spassword");
StudentD td=new StudentD();
Student t=td.search(username);
if(t.getSpassword().equals(password)){
System.out.println("yes");
request.setAttribute( "susername ",username);
request.getRequestDispatcher( "/student.jsp").forward(request,response);
}else{
System.out.println("no");
request.getRequestDispatcher( "/failed.jsp").forward(request,response);
}
}
}
| [
"17301075@bjtu.edu.cn"
] | 17301075@bjtu.edu.cn |
a86c9df6e856996eac4db5a27cdbd3a1f8145394 | 342440e2ad54cd78bb9a36c9a16a0b1503256e20 | /app/src/main/java/com/example/mangoservices/Dashboard.java | ff64e3b3bf92754f401b0e31152ed9fc4f6a72b5 | [] | no_license | hmgtech/MaterialUI-Mango-Services | e46dd81f86242848a9d2255e98139d3e69328bc8 | 8d357dc1c27117e757e46db071a4e9284d98ae18 | refs/heads/master | 2023-02-05T13:43:30.935987 | 2020-12-26T11:46:02 | 2020-12-26T11:46:02 | 324,538,281 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package com.example.mangoservices;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class Dashboard extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard);
}
} | [
"hiteshgupta1234561197@gmail.com"
] | hiteshgupta1234561197@gmail.com |
8abc240a1828410931e351ed82d137b2db5f46fe | 9256e3fcf749d857f3524b1f994c3eacb22556f5 | /src/com/caglardev/agift/Plugin.java | f0e2d1a655c4cefbcc520ae4b17dea5eeba1f44b | [] | no_license | Caglar2306/Spigot-Bukkit-1.8.x-AGift | 01e40f04a30ea9478fd7882018faa6fd6ed65c29 | 3611ce912b1eed5c3741a17cbc7c7da7e62d17c9 | refs/heads/master | 2021-01-13T01:02:59.076055 | 2015-11-27T23:41:27 | 2015-11-27T23:41:27 | 47,003,305 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,386 | java | package com.caglardev.agift;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map.Entry;
import org.bukkit.Material;
import org.bukkit.plugin.java.JavaPlugin;
import com.caglardev.agift.events.OnPlayerJoinEvent;
import com.caglardev.agift.objects.Gift;
public class Plugin extends JavaPlugin {
// General
public final String PLUGIN_NAME = "AGift";
// Configuration files
public static Configuration configurationDefault;
public static String CONFIG_DEFAULT = "Config.yml";
public static Configuration configurationTemplates;
public static String CONFIG_TEMPLATES = "Template.yml";
public static Configuration configurationGifts;
public static String CONFIG_GIFTS = "Gifts.yml";
public static Configuration configurationPlayers;
public static String CONFIG_PLAYERS = "Players.yml";
public static HashMap<Integer, Gift> gifts;
public static HashMap<String, Calendar> players;
@Override
public void onDisable() {
System.out.println("Saving players...");
for(String key : configurationPlayers.getConfig().getConfigurationSection("Players").getKeys(false)) {
configurationPlayers.getConfig().set("Players" + key, null);
}
for(Entry<String, Calendar> entry : players.entrySet()) {
configurationPlayers.getConfig().set("Players." + entry.getKey(), entry.getValue().getTimeInMillis());
}
configurationPlayers.saveConfig();
System.out.println("Players saved.");
}
@Override
public void onEnable() {
initializePlugin(this);
}
public void initializePlugin(JavaPlugin javaPlugin) {
// Configuration files
configurationDefault = new Configuration(javaPlugin, CONFIG_DEFAULT);
configurationTemplates = new Configuration(javaPlugin, CONFIG_TEMPLATES);
configurationGifts = new Configuration(javaPlugin, CONFIG_GIFTS);
configurationPlayers = new Configuration(javaPlugin, CONFIG_PLAYERS);
// Loading players
if(!configurationPlayers.getConfig().contains("Players")) {
configurationPlayers.getConfig().createSection("Players");
}
configurationPlayers.saveConfig();
configurationPlayers.reloadConfig();
players = new HashMap<String, Calendar>();
for(String key : configurationPlayers.getConfig().getConfigurationSection("Players").getKeys(false)) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(configurationPlayers.getConfig().getLong("Players." + key, 0));
players.put(key, calendar);
}
// Loading gifts
if(!configurationGifts.getConfig().contains("Gifts")) {
configurationGifts.getConfig().createSection("Gifts");
}
configurationGifts.saveConfig();
configurationGifts.reloadConfig();
gifts = new HashMap<Integer, Gift>();
for(String key : configurationGifts.getConfig().getConfigurationSection("Gifts").getKeys(false)) {
Material material = Material.getMaterial(configurationGifts.getConfig().getString("Gifts." + key + ".Material"));
if(material != null) {
Gift gift = new Gift(material, configurationGifts.getConfig().getInt("Gifts." + key + ".Stack", 1));
if(configurationGifts.getConfig().getString("Gifts." + key + ".DisplayName") != null) {
gift.setDisplayName(configurationGifts.getConfig().getString("Gifts." + key + ".DisplayName"));
}
gifts.put(gifts.size(), gift);
}
}
this.getServer().getPluginManager().registerEvents(new OnPlayerJoinEvent(), this);
}
}
| [
"caglar2306@outlook.de"
] | caglar2306@outlook.de |
0f872c49d217b10907710508e2b03410c132a6d3 | f46894370c5e9cc7f5022b396a8d29a511c409b4 | /portalobra/src/main/java/br/com/grupopibb/portalobra/dao/insumo/GrupoInsumosFacade.java | 4aabd4c8c2f27ce67f1c729daa8a808011fbb870 | [] | no_license | Manhattan/agenda | 11298e51aac499d813083185bb5347988444e5b5 | 78341253012053b18c35a11bebf787334e57c221 | refs/heads/master | 2021-01-10T17:03:38.154163 | 2016-03-15T19:17:57 | 2016-03-15T19:17:57 | 53,972,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,068 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package br.com.grupopibb.portalobra.dao.insumo;
import br.com.grupopibb.portalobra.dao.commons.AbstractEntityBeans;
import static br.com.grupopibb.portalobra.dao.commons.AbstractEntityBeans.getMapParams;
import br.com.grupopibb.portalobra.model.insumo.GrupoInsumos;
import br.com.grupopibb.portalobra.utils.UtilBeans;
import java.util.List;
import java.util.Map;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author tone.lima
*/
@Stateless
@LocalBean
//@Interceptors({LogTime.class})
public class GrupoInsumosFacade extends AbstractEntityBeans<GrupoInsumos, String> {
@PersistenceContext(unitName = UtilBeans.PERSISTENCE_UNIT)
private EntityManager em;
public GrupoInsumosFacade() {
super(GrupoInsumos.class, GrupoInsumosFacade.class);
}
@Override
protected EntityManager getEntityManager() {
return em;
}
public List<GrupoInsumos> findByClasse(final String classe){
Map<String, Object> params = getMapParams();
paramsFiltro(params, classe);
return listPesqParam("GrupoInsumos.findByClasse", params);
}
public GrupoInsumos findByClasseGrupo(final String classeGrupo){
Map<String, Object> params = getMapParams();
paramsFiltro2(params, classeGrupo);
return pesqParam("GrupoInsumos.findByClasseGrupo", params);
}
/**
* Params do FindByClasse
* @param params
* @param classe
*/
private void paramsFiltro(Map<String, Object> params, final String classe){
params.put("classe", classe);
}
/**
* Params do FindByClasseGrupo
* @param params
* @param classeGrupo
*/
private void paramsFiltro2(Map<String, Object> params, final String classeGrupo){
params.put("classeGrupo", classeGrupo);
}
}
| [
"tone.lima@gpdttecw0801.grupopibb.corp"
] | tone.lima@gpdttecw0801.grupopibb.corp |
8baa9fc7b1e25c8479db4d68ba6fd040990793b6 | b4c3d962d8f52aa7d00e9508d072560e115be078 | /src/com/gersonberger/Stats.java | ce9035a87eafb26ca788ceae2b99efc18b214b96 | [] | no_license | mrnamwen/IIDX-FX | 2f93ca7fad41e928835159390e0082ded27dd2ed | 3cbb4b5c179bd620c31c7fd25193eeea8ec508d9 | refs/heads/master | 2021-01-23T10:23:34.919769 | 2017-05-24T00:50:33 | 2017-05-24T00:50:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,171 | java | package com.gersonberger;
import javafx.collections.ObservableList;
import java.util.Arrays;
class Stats {
//statsAllStatus[status]
//status: 0=noplay, 1=failed, ..., 7=fullcombo
private int[] statsAllStatus = new int[8];
//statsAllGrade[grade]
//grade: 0=none, 1=F, 2=E, ..., 7=AA, 8=AAA, 8=MAX
private int[] statsAllGrade = new int[10];
//statsLevel[level][status]
//level: 0=1, 1=2, ..., 11=12
//status: 0=noplay, 1=failed, ..., 7=fullcombo
private int[][] statsLevel = new int[12][8];
//statsLevel[style][status]
//style: 0=1st Style, 1=Substream, ..., 23=copula
//status: 0=noplay, 1=failed, ..., 7=fullcombo
private int[][] statsStyle = new int[24][8];
Stats(ObservableList<SongEntry> masterData){
//init array with 0
for (int[] row : statsLevel) Arrays.fill(row, 0);
for (int[] row : statsStyle) Arrays.fill(row, 0);
int style;
int grade;
int status;
int level;
for (SongEntry songEntry : masterData) {
if (songEntry.getOmnimix() == 1 && Main.songlist.equals(Style.COPULAFULL)) continue;
style = Style.styleToInt(songEntry.getStyle());
grade = songEntry.getGrade().equals("") ? Grade.NONE_INT : Grade.gradeToInt(songEntry.getGrade().split(" ")[0]);
status = Status.statusToInt(songEntry.getStatus());
level = Integer.valueOf(songEntry.getLevel()) - 1;
statsAllStatus[status]++;
statsAllGrade[grade]++;
statsLevel[level][status]++;
statsStyle[style][status]++;
}
}
int getAllStatus(int status) {
return statsAllStatus[status];
}
int getAllGrade(int grade) {
return statsAllGrade[grade];
}
int getTotalClears() {
return getAllStatus(Status.CLEAR_INT) + getAllStatus(Status.HARDCLEAR_INT) + getAllStatus(Status.EXHARDCLEAR_INT) + getAllStatus(Status.FULLCOMBO_INT);
}
int getTotal() {
return getAllStatus(Status.NOPLAY_INT) + getAllStatus(Status.FAILED_INT) + getAllStatus(Status.ASSISTCLEAR_INT) + getAllStatus(Status.EASYCLEAR_INT)
+ getAllStatus(Status.CLEAR_INT) + getAllStatus(Status.HARDCLEAR_INT) + getAllStatus(Status.EXHARDCLEAR_INT) + getAllStatus(Status.FULLCOMBO_INT);
}
int getTotalPlayed() {
return getAllStatus(Status.FAILED_INT) + getAllStatus(Status.ASSISTCLEAR_INT) + getAllStatus(Status.EASYCLEAR_INT)
+ getAllStatus(Status.CLEAR_INT) + getAllStatus(Status.HARDCLEAR_INT) + getAllStatus(Status.EXHARDCLEAR_INT) + getAllStatus(Status.FULLCOMBO_INT);
}
int getAllStyle(int style) {
int val = 0;
for (int i = 0; i < statsStyle[style].length; i++) {
val += statsStyle[style][i];
}
return val;
}
int getAllLevel(int level) {
level--;
int val = 0;
for (int i = 0; i < statsLevel[level].length; i++) {
val += statsLevel[level][i];
}
return val;
}
int getLevelStatus(int level, int status) {
return statsLevel[level - 1][status];
}
int getLevelCleared(int level) {
level--;
return statsLevel[level][Status.CLEAR_INT] + statsLevel[level][Status.HARDCLEAR_INT] + statsLevel[level][Status.EXHARDCLEAR_INT] + statsLevel[level][Status.FULLCOMBO_INT];
}
int getLevelNotCleared(int level) {
level--;
return statsLevel[level][Status.NOPLAY_INT] + statsLevel[level][Status.FAILED_INT] + statsLevel[level][Status.ASSISTCLEAR_INT] + statsLevel[level][Status.EASYCLEAR_INT];
}
int getStyleStatus(int style, int status) {
return statsStyle[style][status];
}
int getStyleCleared(int style) {
return statsStyle[style][Status.CLEAR_INT] + statsStyle[style][Status.HARDCLEAR_INT] + statsStyle[style][Status.EXHARDCLEAR_INT] + statsStyle[style][Status.FULLCOMBO_INT];
}
int getStyleNotCleared(int style) {
return statsStyle[style][Status.NOPLAY_INT] + statsStyle[style][Status.FAILED_INT] + statsStyle[style][Status.ASSISTCLEAR_INT] + statsStyle[style][Status.EASYCLEAR_INT];
}
}
| [
"gersonberger@me.com"
] | gersonberger@me.com |
9f3f2d259b9c195ee952920178ce2f03754dfd3a | 26c4ec2efde07d976a42b5d8bf0af9586b315da4 | /zing-dao/src/main/java/com/yibao/dao/entity/HospitalDepartmentDO.java | 04aae4fa5403e897f32103b147e405200326a5aa | [] | no_license | wenyiliu/zings | 270cc34021ecf2c5202dfed993a76c49e45979ed | e9ec4eb91530dde32488bc672330cfedd812dc5f | refs/heads/master | 2022-07-12T19:52:49.101454 | 2019-08-05T05:06:00 | 2019-08-05T05:06:00 | 187,988,731 | 0 | 0 | null | 2022-06-29T17:25:01 | 2019-05-22T07:44:07 | Java | UTF-8 | Java | false | false | 1,049 | java | package com.yibao.dao.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author liuwenyi
* @date 2019/5/23
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HospitalDepartmentDO {
/**
* 自增ID
*/
private Integer id;
/**
* 是否删除(0:未删除 1:已删除)
*/
private Integer isDeleted;
/**
* 记录创建时间
*/
private java.time.LocalDateTime createTime;
/**
* 记录修改时间
*/
private java.time.LocalDateTime modifyTime;
/**
* 创建人,0表示无创建人值
*/
private Integer creator;
/**
* 修改人,如果为0则表示纪录未修改
*/
private Integer modifier;
/**
* 医院ID
*/
private Integer hospitalId;
/**
* 科室名称
*/
private String departmentName;
/**
* 科室级别(1:普通科室 2:重点科室)
*/
private Integer departmentLevel;
}
| [
"13503991075@163.com"
] | 13503991075@163.com |
a3bfb4a3eea06975b344533135b8b71c4ece8d28 | 2c9e0541ed8a22bcdc81ae2f9610a118f62c4c4d | /harmony/java/trunk/classlib/modules/luni/src/main/java/java/util/Calendar.java | 3d77276de08c835559fae326e30c6dffe7314c24 | [] | no_license | JetBrains/jdk8u_tests | 774de7dffd513fd61458b4f7c26edd7924c7f1a5 | 263c74f1842954bae0b34ec3703ad35668b3ffa2 | refs/heads/master | 2023-08-07T17:57:58.511814 | 2017-03-20T08:13:25 | 2017-03-20T08:16:11 | 70,048,797 | 11 | 9 | null | null | null | null | UTF-8 | Java | false | false | 48,993 | 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 java.util;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
import java.io.Serializable;
/**
* {@code Calendar} is an abstract base class for converting between a
* {@code Date} object and a set of integer fields such as
* {@code YEAR}, {@code MONTH}, {@code DAY},
* {@code HOUR}, and so on. (A {@code Date} object represents a
* specific instant in time with millisecond precision. See {@link Date} for
* information about the {@code Date} class.)
*
* <p>
* Subclasses of {@code Calendar} interpret a {@code Date}
* according to the rules of a specific calendar system.
*
* <p>
* Like other locale-sensitive classes, {@code Calendar} provides a class
* method, {@code getInstance}, for getting a default instance of
* this class for general use. {@code Calendar}'s {@code getInstance} method
* returns a calendar whose locale is based on system settings and whose time fields
* have been initialized with the current date and time: <blockquote>
*
* <pre>Calendar rightNow = Calendar.getInstance()</pre>
*
* </blockquote>
*
* <p>
* A {@code Calendar} object can produce all the time field values needed
* to implement the date-time formatting for a particular language and calendar
* style (for example, Japanese-Gregorian, Japanese-Traditional).
* {@code Calendar} defines the range of values returned by certain
* fields, as well as their meaning. For example, the first month of the year
* has value {@code MONTH} == {@code JANUARY} for all calendars.
* Other values are defined by the concrete subclass, such as {@code ERA}
* and {@code YEAR}. See individual field documentation and subclass
* documentation for details.
*
* <p>
* When a {@code Calendar} is <em>lenient</em>, it accepts a wider
* range of field values than it produces. For example, a lenient
* {@code GregorianCalendar} interprets {@code MONTH} ==
* {@code JANUARY}, {@code DAY_OF_MONTH} == 32 as February 1. A
* non-lenient {@code GregorianCalendar} throws an exception when given
* out-of-range field settings. When calendars recompute field values for return
* by {@code get()}, they normalize them. For example, a
* {@code GregorianCalendar} always produces {@code DAY_OF_MONTH}
* values between 1 and the length of the month.
*
* <p>
* {@code Calendar} defines a locale-specific seven day week using two
* parameters: the first day of the week and the minimal days in first week
* (from 1 to 7). These numbers are taken from the locale resource data when a
* {@code Calendar} is constructed. They may also be specified explicitly
* through the API.
*
* <p>
* When setting or getting the {@code WEEK_OF_MONTH} or
* {@code WEEK_OF_YEAR} fields, {@code Calendar} must determine
* the first week of the month or year as a reference point. The first week of a
* month or year is defined as the earliest seven day period beginning on
* {@code getFirstDayOfWeek()} and containing at least
* {@code getMinimalDaysInFirstWeek()} days of that month or year. Weeks
* numbered ..., -1, 0 precede the first week; weeks numbered 2, 3,... follow
* it. Note that the normalized numbering returned by {@code get()} may
* be different. For example, a specific {@code Calendar} subclass may
* designate the week before week 1 of a year as week <em>n</em> of the
* previous year.
*
* <p>
* When computing a {@code Date} from time fields, two special
* circumstances may arise: there may be insufficient information to compute the
* {@code Date} (such as only year and month but no day in the month), or
* there may be inconsistent information (such as "Tuesday, July 15, 1996" --
* July 15, 1996 is actually a Monday).
*
* <p>
* <strong>Insufficient information.</strong> The calendar will use default
* information to specify the missing fields. This may vary by calendar; for the
* Gregorian calendar, the default for a field is the same as that of the start
* of the epoch: i.e., YEAR = 1970, MONTH = JANUARY, DATE = 1, etc.
*
* <p>
* <strong>Inconsistent information.</strong> If fields conflict, the calendar
* will give preference to fields set more recently. For example, when
* determining the day, the calendar will look for one of the following
* combinations of fields. The most recent combination, as determined by the
* most recently set single field, will be used.
*
* <blockquote>
*
* <pre>
* MONTH + DAY_OF_MONTH
* MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
* MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
* DAY_OF_YEAR
* DAY_OF_WEEK + WEEK_OF_YEAR</pre>
*
* </blockquote>
*
* For the time of day:
*
* <blockquote>
*
* <pre>
* HOUR_OF_DAY
* AM_PM + HOUR</pre>
*
* </blockquote>
*
* <p>
* <strong>Note:</strong> There are certain possible ambiguities in
* interpretation of certain singular times, which are resolved in the following
* ways:
* <ol>
* <li> 24:00:00 "belongs" to the following day. That is, 23:59 on Dec 31, 1969
* < 24:00 on Jan 1, 1970 < 24:01:00 on Jan 1, 1970 form a sequence of
* three consecutive minutes in time.
*
* <li> Although historically not precise, midnight also belongs to "am", and
* noon belongs to "pm", so on the same day, we have 12:00 am (midnight) < 12:01 am,
* and 12:00 pm (noon) < 12:01 pm
* </ol>
*
* <p>
* The date or time format strings are not part of the definition of a calendar,
* as those must be modifiable or overridable by the user at runtime. Use
* {@link java.text.DateFormat} to format dates.
*
* <p>
* <strong>Field manipulation methods</strong>
*
* <p>
* {@code Calendar} fields can be changed using three methods:
* {@code set()}, {@code add()}, and {@code roll()}.
*
* <p>
* <strong>{@code set(f, value)}</strong> changes field {@code f}
* to {@code value}. In addition, it sets an internal member variable to
* indicate that field {@code f} has been changed. Although field
* {@code f} is changed immediately, the calendar's milliseconds is not
* recomputed until the next call to {@code get()},
* {@code getTime()}, or {@code getTimeInMillis()} is made. Thus,
* multiple calls to {@code set()} do not trigger multiple, unnecessary
* computations. As a result of changing a field using {@code set()},
* other fields may also change, depending on the field, the field value, and
* the calendar system. In addition, {@code get(f)} will not necessarily
* return {@code value} after the fields have been recomputed. The
* specifics are determined by the concrete calendar class.
*
* <p>
* <em>Example</em>: Consider a {@code GregorianCalendar} originally
* set to August 31, 1999. Calling <code>set(Calendar.MONTH,
* Calendar.SEPTEMBER)</code>
* sets the calendar to September 31, 1999. This is a temporary internal
* representation that resolves to October 1, 1999 if {@code getTime()}is
* then called. However, a call to {@code set(Calendar.DAY_OF_MONTH, 30)}
* before the call to {@code getTime()} sets the calendar to September
* 30, 1999, since no recomputation occurs after {@code set()} itself.
*
* <p>
* <strong>{@code add(f, delta)}</strong> adds {@code delta} to
* field {@code f}. This is equivalent to calling <code>set(f,
* get(f) + delta)</code>
* with two adjustments:
*
* <blockquote>
* <p>
* <strong>Add rule 1</strong>. The value of field {@code f} after the
* call minus the value of field {@code f} before the call is
* {@code delta}, modulo any overflow that has occurred in field
* {@code f}. Overflow occurs when a field value exceeds its range and,
* as a result, the next larger field is incremented or decremented and the
* field value is adjusted back into its range.
*
* <p>
* <strong>Add rule 2</strong>. If a smaller field is expected to be invariant,
* but it is impossible for it to be equal to its prior value because of
* changes in its minimum or maximum after field {@code f} is changed,
* then its value is adjusted to be as close as possible to its expected value.
* A smaller field represents a smaller unit of time. {@code HOUR} is a
* smaller field than {@code DAY_OF_MONTH}. No adjustment is made to
* smaller fields that are not expected to be invariant. The calendar system
* determines what fields are expected to be invariant.
* </blockquote>
*
* <p>
* In addition, unlike {@code set()}, {@code add()} forces an
* immediate recomputation of the calendar's milliseconds and all fields.
*
* <p>
* <em>Example</em>: Consider a {@code GregorianCalendar} originally
* set to August 31, 1999. Calling {@code add(Calendar.MONTH, 13)} sets
* the calendar to September 30, 2000. <strong>Add rule 1</strong> sets the
* {@code MONTH} field to September, since adding 13 months to August
* gives September of the next year. Since {@code DAY_OF_MONTH} cannot be
* 31 in September in a {@code GregorianCalendar}, <strong>add rule 2</strong>
* sets the {@code DAY_OF_MONTH} to 30, the closest possible value.
* Although it is a smaller field, {@code DAY_OF_WEEK} is not adjusted by
* rule 2, since it is expected to change when the month changes in a
* {@code GregorianCalendar}.
*
* <p>
* <strong>{@code roll(f, delta)}</strong> adds {@code delta} to
* field {@code f} without changing larger fields. This is equivalent to
* calling {@code add(f, delta)} with the following adjustment:
*
* <blockquote>
* <p>
* <strong>Roll rule</strong>. Larger fields are unchanged after the call. A
* larger field represents a larger unit of time. {@code DAY_OF_MONTH} is
* a larger field than {@code HOUR}.
* </blockquote>
*
* <p>
* <em>Example</em>: Consider a {@code GregorianCalendar} originally
* set to August 31, 1999. Calling <code>roll(Calendar.MONTH,
* 8)</code> sets
* the calendar to April 30, <strong>1999</strong>. Add rule 1 sets the
* {@code MONTH} field to April. Using a {@code GregorianCalendar},
* the {@code DAY_OF_MONTH} cannot be 31 in the month April. Add rule 2
* sets it to the closest possible value, 30. Finally, the <strong>roll rule</strong>
* maintains the {@code YEAR} field value of 1999.
*
* <p>
* <em>Example</em>: Consider a {@code GregorianCalendar} originally
* set to Sunday June 6, 1999. Calling
* {@code roll(Calendar.WEEK_OF_MONTH, -1)} sets the calendar to Tuesday
* June 1, 1999, whereas calling {@code add(Calendar.WEEK_OF_MONTH, -1)}
* sets the calendar to Sunday May 30, 1999. This is because the roll rule
* imposes an additional constraint: The {@code MONTH} must not change
* when the {@code WEEK_OF_MONTH} is rolled. Taken together with add rule
* 1, the resultant date must be between Tuesday June 1 and Saturday June 5.
* According to add rule 2, the {@code DAY_OF_WEEK}, an invariant when
* changing the {@code WEEK_OF_MONTH}, is set to Tuesday, the closest
* possible value to Sunday (where Sunday is the first day of the week).
*
* <p>
* <strong>Usage model</strong>. To motivate the behavior of {@code add()}
* and {@code roll()}, consider a user interface component with
* increment and decrement buttons for the month, day, and year, and an
* underlying {@code GregorianCalendar}. If the interface reads January
* 31, 1999 and the user presses the month increment button, what should it
* read? If the underlying implementation uses {@code set()}, it might
* read March 3, 1999. A better result would be February 28, 1999. Furthermore,
* if the user presses the month increment button again, it should read March
* 31, 1999, not March 28, 1999. By saving the original date and using either
* {@code add()} or {@code roll()}, depending on whether larger
* fields should be affected, the user interface can behave as most users will
* intuitively expect.
*
* <p>
* <b>Note:</b> You should always use {@code roll} and {@code add} rather than
* attempting to perform arithmetic operations directly on the fields of a
* <tt>Calendar</tt>. It is quite possible for <tt>Calendar</tt> subclasses
* to have fields with non-linear behavior, for example missing months or days
* during non-leap years. The subclasses' <tt>add</tt> and <tt>roll</tt>
* methods will take this into account, while simple arithmetic manipulations
* may give invalid results.
*
* @see Date
* @see GregorianCalendar
* @see TimeZone
*/
public abstract class Calendar implements Serializable, Cloneable,
Comparable<Calendar> {
private static final long serialVersionUID = -1807547505821590642L;
/**
* Set to {@code true} when the calendar fields have been set from the time, set to
* {@code false} when a field is changed and the fields must be recomputed.
*/
protected boolean areFieldsSet;
/**
* An integer array of calendar fields. The length is {@code FIELD_COUNT}.
*/
protected int[] fields;
/**
* A boolean array. Each element indicates if the corresponding field has
* been set. The length is {@code FIELD_COUNT}.
*/
protected boolean[] isSet;
/**
* Set to {@code true} when the time has been set, set to {@code false} when a field is
* changed and the time must be recomputed.
*/
protected boolean isTimeSet;
/**
* The time in milliseconds since January 1, 1970.
*/
protected long time;
transient int lastTimeFieldSet;
transient int lastDateFieldSet;
private boolean lenient;
private int firstDayOfWeek;
private int minimalDaysInFirstWeek;
private TimeZone zone;
/**
* Value of the {@code MONTH} field indicating the first month of the
* year.
*/
public static final int JANUARY = 0;
/**
* Value of the {@code MONTH} field indicating the second month of
* the year.
*/
public static final int FEBRUARY = 1;
/**
* Value of the {@code MONTH} field indicating the third month of the
* year.
*/
public static final int MARCH = 2;
/**
* Value of the {@code MONTH} field indicating the fourth month of
* the year.
*/
public static final int APRIL = 3;
/**
* Value of the {@code MONTH} field indicating the fifth month of the
* year.
*/
public static final int MAY = 4;
/**
* Value of the {@code MONTH} field indicating the sixth month of the
* year.
*/
public static final int JUNE = 5;
/**
* Value of the {@code MONTH} field indicating the seventh month of
* the year.
*/
public static final int JULY = 6;
/**
* Value of the {@code MONTH} field indicating the eighth month of
* the year.
*/
public static final int AUGUST = 7;
/**
* Value of the {@code MONTH} field indicating the ninth month of the
* year.
*/
public static final int SEPTEMBER = 8;
/**
* Value of the {@code MONTH} field indicating the tenth month of the
* year.
*/
public static final int OCTOBER = 9;
/**
* Value of the {@code MONTH} field indicating the eleventh month of
* the year.
*/
public static final int NOVEMBER = 10;
/**
* Value of the {@code MONTH} field indicating the twelfth month of
* the year.
*/
public static final int DECEMBER = 11;
/**
* Value of the {@code MONTH} field indicating the thirteenth month
* of the year. Although {@code GregorianCalendar} does not use this
* value, lunar calendars do.
*/
public static final int UNDECIMBER = 12;
/**
* Value of the {@code DAY_OF_WEEK} field indicating Sunday.
*/
public static final int SUNDAY = 1;
/**
* Value of the {@code DAY_OF_WEEK} field indicating Monday.
*/
public static final int MONDAY = 2;
/**
* Value of the {@code DAY_OF_WEEK} field indicating Tuesday.
*/
public static final int TUESDAY = 3;
/**
* Value of the {@code DAY_OF_WEEK} field indicating Wednesday.
*/
public static final int WEDNESDAY = 4;
/**
* Value of the {@code DAY_OF_WEEK} field indicating Thursday.
*/
public static final int THURSDAY = 5;
/**
* Value of the {@code DAY_OF_WEEK} field indicating Friday.
*/
public static final int FRIDAY = 6;
/**
* Value of the {@code DAY_OF_WEEK} field indicating Saturday.
*/
public static final int SATURDAY = 7;
/**
* Field number for {@code get} and {@code set} indicating the
* era, e.g., AD or BC in the Julian calendar. This is a calendar-specific
* value; see subclass documentation.
*
* @see GregorianCalendar#AD
* @see GregorianCalendar#BC
*/
public static final int ERA = 0;
/**
* Field number for {@code get} and {@code set} indicating the
* year. This is a calendar-specific value; see subclass documentation.
*/
public static final int YEAR = 1;
/**
* Field number for {@code get} and {@code set} indicating the
* month. This is a calendar-specific value. The first month of the year is
* {@code JANUARY}; the last depends on the number of months in a
* year.
*
* @see #JANUARY
* @see #FEBRUARY
* @see #MARCH
* @see #APRIL
* @see #MAY
* @see #JUNE
* @see #JULY
* @see #AUGUST
* @see #SEPTEMBER
* @see #OCTOBER
* @see #NOVEMBER
* @see #DECEMBER
* @see #UNDECIMBER
*/
public static final int MONTH = 2;
/**
* Field number for {@code get} and {@code set} indicating the
* week number within the current year. The first week of the year, as
* defined by {@code getFirstDayOfWeek()} and
* {@code getMinimalDaysInFirstWeek()}, has value 1. Subclasses
* define the value of {@code WEEK_OF_YEAR} for days before the first
* week of the year.
*
* @see #getFirstDayOfWeek
* @see #getMinimalDaysInFirstWeek
*/
public static final int WEEK_OF_YEAR = 3;
/**
* Field number for {@code get} and {@code set} indicating the
* week number within the current month. The first week of the month, as
* defined by {@code getFirstDayOfWeek()} and
* {@code getMinimalDaysInFirstWeek()}, has value 1. Subclasses
* define the value of {@code WEEK_OF_MONTH} for days before the
* first week of the month.
*
* @see #getFirstDayOfWeek
* @see #getMinimalDaysInFirstWeek
*/
public static final int WEEK_OF_MONTH = 4;
/**
* Field number for {@code get} and {@code set} indicating the
* day of the month. This is a synonym for {@code DAY_OF_MONTH}. The
* first day of the month has value 1.
*
* @see #DAY_OF_MONTH
*/
public static final int DATE = 5;
/**
* Field number for {@code get} and {@code set} indicating the
* day of the month. This is a synonym for {@code DATE}. The first
* day of the month has value 1.
*
* @see #DATE
*/
public static final int DAY_OF_MONTH = 5;
/**
* Field number for {@code get} and {@code set} indicating the
* day number within the current year. The first day of the year has value
* 1.
*/
public static final int DAY_OF_YEAR = 6;
/**
* Field number for {@code get} and {@code set} indicating the
* day of the week. This field takes values {@code SUNDAY},
* {@code MONDAY}, {@code TUESDAY}, {@code WEDNESDAY},
* {@code THURSDAY}, {@code FRIDAY}, and
* {@code SATURDAY}.
*
* @see #SUNDAY
* @see #MONDAY
* @see #TUESDAY
* @see #WEDNESDAY
* @see #THURSDAY
* @see #FRIDAY
* @see #SATURDAY
*/
public static final int DAY_OF_WEEK = 7;
/**
* Field number for {@code get} and {@code set} indicating the
* ordinal number of the day of the week within the current month. Together
* with the {@code DAY_OF_WEEK} field, this uniquely specifies a day
* within a month. Unlike {@code WEEK_OF_MONTH} and
* {@code WEEK_OF_YEAR}, this field's value does <em>not</em>
* depend on {@code getFirstDayOfWeek()} or
* {@code getMinimalDaysInFirstWeek()}. {@code DAY_OF_MONTH 1}
* through {@code 7} always correspond to <code>DAY_OF_WEEK_IN_MONTH
* 1</code>;
* {@code 8} through {@code 15} correspond to
* {@code DAY_OF_WEEK_IN_MONTH 2}, and so on.
* {@code DAY_OF_WEEK_IN_MONTH 0} indicates the week before
* {@code DAY_OF_WEEK_IN_MONTH 1}. Negative values count back from
* the end of the month, so the last Sunday of a month is specified as
* {@code DAY_OF_WEEK = SUNDAY, DAY_OF_WEEK_IN_MONTH = -1}. Because
* negative values count backward they will usually be aligned differently
* within the month than positive values. For example, if a month has 31
* days, {@code DAY_OF_WEEK_IN_MONTH -1} will overlap
* {@code DAY_OF_WEEK_IN_MONTH 5} and the end of {@code 4}.
*
* @see #DAY_OF_WEEK
* @see #WEEK_OF_MONTH
*/
public static final int DAY_OF_WEEK_IN_MONTH = 8;
/**
* Field number for {@code get} and {@code set} indicating
* whether the {@code HOUR} is before or after noon. E.g., at
* 10:04:15.250 PM the {@code AM_PM} is {@code PM}.
*
* @see #AM
* @see #PM
* @see #HOUR
*/
public static final int AM_PM = 9;
/**
* Field number for {@code get} and {@code set} indicating the
* hour of the morning or afternoon. {@code HOUR} is used for the
* 12-hour clock. E.g., at 10:04:15.250 PM the {@code HOUR} is 10.
*
* @see #AM_PM
* @see #HOUR_OF_DAY
*/
public static final int HOUR = 10;
/**
* Field number for {@code get} and {@code set} indicating the
* hour of the day. {@code HOUR_OF_DAY} is used for the 24-hour
* clock. E.g., at 10:04:15.250 PM the {@code HOUR_OF_DAY} is 22.
*
* @see #HOUR
*/
public static final int HOUR_OF_DAY = 11;
/**
* Field number for {@code get} and {@code set} indicating the
* minute within the hour. E.g., at 10:04:15.250 PM the {@code MINUTE}
* is 4.
*/
public static final int MINUTE = 12;
/**
* Field number for {@code get} and {@code set} indicating the
* second within the minute. E.g., at 10:04:15.250 PM the
* {@code SECOND} is 15.
*/
public static final int SECOND = 13;
/**
* Field number for {@code get} and {@code set} indicating the
* millisecond within the second. E.g., at 10:04:15.250 PM the
* {@code MILLISECOND} is 250.
*/
public static final int MILLISECOND = 14;
/**
* Field number for {@code get} and {@code set} indicating the
* raw offset from GMT in milliseconds.
*/
public static final int ZONE_OFFSET = 15;
/**
* Field number for {@code get} and {@code set} indicating the
* daylight savings offset in milliseconds.
*/
public static final int DST_OFFSET = 16;
/**
* This is the total number of fields in this calendar.
*/
public static final int FIELD_COUNT = 17;
/**
* Value of the {@code AM_PM} field indicating the period of the day
* from midnight to just before noon.
*/
public static final int AM = 0;
/**
* Value of the {@code AM_PM} field indicating the period of the day
* from noon to just before midnight.
*/
public static final int PM = 1;
@SuppressWarnings("nls")
private static String[] fieldNames = { "ERA=", "YEAR=", "MONTH=",
"WEEK_OF_YEAR=", "WEEK_OF_MONTH=", "DAY_OF_MONTH=", "DAY_OF_YEAR=",
"DAY_OF_WEEK=", "DAY_OF_WEEK_IN_MONTH=", "AM_PM=", "HOUR=",
"HOUR_OF_DAY", "MINUTE=", "SECOND=", "MILLISECOND=",
"ZONE_OFFSET=", "DST_OFFSET=" };
/**
* Constructs a {@code Calendar} instance using the default {@code TimeZone} and {@code Locale}.
*/
protected Calendar() {
this(TimeZone.getDefault(), Locale.getDefault());
}
Calendar(TimeZone timezone) {
fields = new int[FIELD_COUNT];
isSet = new boolean[FIELD_COUNT];
areFieldsSet = isTimeSet = false;
setLenient(true);
setTimeZone(timezone);
}
/**
* Constructs a {@code Calendar} instance using the specified {@code TimeZone} and {@code Locale}.
*
* @param timezone
* the timezone.
* @param locale
* the locale.
*/
protected Calendar(TimeZone timezone, Locale locale) {
this(timezone);
com.ibm.icu.util.Calendar icuCalendar = com.ibm.icu.util.Calendar
.getInstance(com.ibm.icu.util.SimpleTimeZone
.getTimeZone(timezone.getID()), locale);
setFirstDayOfWeek(icuCalendar.getFirstDayOfWeek());
setMinimalDaysInFirstWeek(icuCalendar.getMinimalDaysInFirstWeek());
}
/**
* Adds the specified amount to a {@code Calendar} field.
*
* @param field
* the {@code Calendar} field to modify.
* @param value
* the amount to add to the field.
* @throws IllegalArgumentException
* if {@code field} is {@code DST_OFFSET} or {@code
* ZONE_OFFSET}.
*/
abstract public void add(int field, int value);
/**
* Returns whether the {@code Date} specified by this {@code Calendar} instance is after the {@code Date}
* specified by the parameter. The comparison is not dependent on the time
* zones of the {@code Calendar}.
*
* @param calendar
* the {@code Calendar} instance to compare.
* @return {@code true} when this Calendar is after calendar, {@code false} otherwise.
* @throws IllegalArgumentException
* if the time is not set and the time cannot be computed
* from the current field values.
*/
public boolean after(Object calendar) {
if (!(calendar instanceof Calendar)) {
return false;
}
return getTimeInMillis() > ((Calendar) calendar).getTimeInMillis();
}
/**
* Returns whether the {@code Date} specified by this {@code Calendar} instance is before the
* {@code Date} specified by the parameter. The comparison is not dependent on the
* time zones of the {@code Calendar}.
*
* @param calendar
* the {@code Calendar} instance to compare.
* @return {@code true} when this Calendar is before calendar, {@code false} otherwise.
* @throws IllegalArgumentException
* if the time is not set and the time cannot be computed
* from the current field values.
*/
public boolean before(Object calendar) {
if (!(calendar instanceof Calendar)) {
return false;
}
return getTimeInMillis() < ((Calendar) calendar).getTimeInMillis();
}
/**
* Clears all of the fields of this {@code Calendar}. All fields are initialized to
* zero.
*/
public final void clear() {
for (int i = 0; i < FIELD_COUNT; i++) {
fields[i] = 0;
isSet[i] = false;
}
areFieldsSet = isTimeSet = false;
}
/**
* Clears the specified field to zero and sets the isSet flag to {@code false}.
*
* @param field
* the field to clear.
*/
public final void clear(int field) {
fields[field] = 0;
isSet[field] = false;
areFieldsSet = isTimeSet = false;
}
/**
* Returns a new {@code Calendar} with the same properties.
*
* @return a shallow copy of this {@code Calendar}.
*
* @see java.lang.Cloneable
*/
@Override
public Object clone() {
try {
Calendar clone = (Calendar) super.clone();
clone.fields = fields.clone();
clone.isSet = isSet.clone();
clone.zone = (TimeZone) zone.clone();
return clone;
} catch (CloneNotSupportedException e) {
return null;
}
}
/**
* Computes the time from the fields if the time has not already been set.
* Computes the fields from the time if the fields are not already set.
*
* @throws IllegalArgumentException
* if the time is not set and the time cannot be computed
* from the current field values.
*/
protected void complete() {
if (!isTimeSet) {
computeTime();
isTimeSet = true;
}
if (!areFieldsSet) {
computeFields();
areFieldsSet = true;
}
}
/**
* Computes the {@code Calendar} fields from {@code time}.
*/
protected abstract void computeFields();
/**
* Computes {@code time} from the Calendar fields.
*
* @throws IllegalArgumentException
* if the time cannot be computed from the current field
* values.
*/
protected abstract void computeTime();
/**
* Compares the specified object to this {@code Calendar} and returns whether they are
* equal. The object must be an instance of {@code Calendar} and have the same
* properties.
*
* @param object
* the object to compare with this object.
* @return {@code true} if the specified object is equal to this {@code Calendar}, {@code false}
* otherwise.
*/
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!(object instanceof Calendar)) {
return false;
}
Calendar cal = (Calendar) object;
return getTimeInMillis() == cal.getTimeInMillis()
&& isLenient() == cal.isLenient()
&& getFirstDayOfWeek() == cal.getFirstDayOfWeek()
&& getMinimalDaysInFirstWeek() == cal
.getMinimalDaysInFirstWeek()
&& getTimeZone().equals(cal.getTimeZone());
}
/**
* Gets the value of the specified field after computing the field values by
* calling {@code complete()} first.
*
* @param field
* the field to get.
* @return the value of the specified field.
*
* @throws IllegalArgumentException
* if the fields are not set, the time is not set, and the
* time cannot be computed from the current field values.
* @throws ArrayIndexOutOfBoundsException
* if the field is not inside the range of possible fields.
* The range is starting at 0 up to {@code FIELD_COUNT}.
*/
public int get(int field) {
complete();
return fields[field];
}
/**
* Gets the maximum value of the specified field for the current date.
*
* @param field
* the field.
* @return the maximum value of the specified field.
*/
public int getActualMaximum(int field) {
int value, next;
if (getMaximum(field) == (next = getLeastMaximum(field))) {
return next;
}
complete();
long orgTime = time;
set(field, next);
do {
value = next;
roll(field, true);
next = get(field);
} while (next > value);
time = orgTime;
areFieldsSet = false;
return value;
}
/**
* Gets the minimum value of the specified field for the current date.
*
* @param field
* the field.
* @return the minimum value of the specified field.
*/
public int getActualMinimum(int field) {
int value, next;
if (getMinimum(field) == (next = getGreatestMinimum(field))) {
return next;
}
complete();
long orgTime = time;
set(field, next);
do {
value = next;
roll(field, false);
next = get(field);
} while (next < value);
time = orgTime;
areFieldsSet = false;
return value;
}
/**
* Gets the list of installed {@code Locale}s which support {@code Calendar}.
*
* @return an array of {@code Locale}.
*/
public static synchronized Locale[] getAvailableLocales() {
return Locale.getAvailableLocales();
}
/**
* Gets the first day of the week for this {@code Calendar}.
*
* @return the first day of the week.
*/
public int getFirstDayOfWeek() {
return firstDayOfWeek;
}
/**
* Gets the greatest minimum value of the specified field. This is the
* biggest value that {@code getActualMinimum} can return for any possible
* time.
*
* @param field
* the field.
* @return the greatest minimum value of the specified field.
*/
abstract public int getGreatestMinimum(int field);
/**
* Constructs a new instance of the {@code Calendar} subclass appropriate for the
* default {@code Locale}.
*
* @return a {@code Calendar} subclass instance set to the current date and time in
* the default {@code Timezone}.
*/
public static synchronized Calendar getInstance() {
return new GregorianCalendar();
}
/**
* Constructs a new instance of the {@code Calendar} subclass appropriate for the
* specified {@code Locale}.
*
* @param locale
* the locale to use.
* @return a {@code Calendar} subclass instance set to the current date and time.
*/
public static synchronized Calendar getInstance(Locale locale) {
return new GregorianCalendar(locale);
}
/**
* Constructs a new instance of the {@code Calendar} subclass appropriate for the
* default {@code Locale}, using the specified {@code TimeZone}.
*
* @param timezone
* the {@code TimeZone} to use.
* @return a {@code Calendar} subclass instance set to the current date and time in
* the specified timezone.
*/
public static synchronized Calendar getInstance(TimeZone timezone) {
return new GregorianCalendar(timezone);
}
/**
* Constructs a new instance of the {@code Calendar} subclass appropriate for the
* specified {@code Locale}.
*
* @param timezone
* the {@code TimeZone} to use.
* @param locale
* the {@code Locale} to use.
* @return a {@code Calendar} subclass instance set to the current date and time in
* the specified timezone.
*/
public static synchronized Calendar getInstance(TimeZone timezone,
Locale locale) {
return new GregorianCalendar(timezone, locale);
}
/**
* Gets the smallest maximum value of the specified field. This is the
* smallest value that {@code getActualMaximum()} can return for any
* possible time.
*
* @param field
* the field number.
* @return the smallest maximum value of the specified field.
*/
abstract public int getLeastMaximum(int field);
/**
* Gets the greatest maximum value of the specified field. This returns the
* biggest value that {@code get} can return for the specified field.
*
* @param field
* the field.
* @return the greatest maximum value of the specified field.
*/
abstract public int getMaximum(int field);
/**
* Gets the minimal days in the first week of the year.
*
* @return the minimal days in the first week of the year.
*/
public int getMinimalDaysInFirstWeek() {
return minimalDaysInFirstWeek;
}
/**
* Gets the smallest minimum value of the specified field. this returns the
* smallest value thet {@code get} can return for the specified field.
*
* @param field
* the field number.
* @return the smallest minimum value of the specified field.
*/
abstract public int getMinimum(int field);
/**
* Gets the time of this {@code Calendar} as a {@code Date} object.
*
* @return a new {@code Date} initialized to the time of this {@code Calendar}.
*
* @throws IllegalArgumentException
* if the time is not set and the time cannot be computed
* from the current field values.
*/
public final Date getTime() {
return new Date(getTimeInMillis());
}
/**
* Computes the time from the fields if required and returns the time.
*
* @return the time of this {@code Calendar}.
*
* @throws IllegalArgumentException
* if the time is not set and the time cannot be computed
* from the current field values.
*/
public long getTimeInMillis() {
if (!isTimeSet) {
computeTime();
isTimeSet = true;
}
return time;
}
/**
* Gets the timezone of this {@code Calendar}.
*
* @return the {@code TimeZone} used by this {@code Calendar}.
*/
public TimeZone getTimeZone() {
return zone;
}
/**
* Returns an integer hash code for the receiver. Objects which are equal
* return the same value for this method.
*
* @return the receiver's hash.
*
* @see #equals
*/
@Override
public int hashCode() {
return (isLenient() ? 1237 : 1231) + getFirstDayOfWeek()
+ getMinimalDaysInFirstWeek() + getTimeZone().hashCode();
}
/**
* Gets the value of the specified field without recomputing.
*
* @param field
* the field.
* @return the value of the specified field.
*/
protected final int internalGet(int field) {
return fields[field];
}
/**
* Returns if this {@code Calendar} accepts field values which are outside the valid
* range for the field.
*
* @return {@code true} if this {@code Calendar} is lenient, {@code false} otherwise.
*/
public boolean isLenient() {
return lenient;
}
/**
* Returns whether the specified field is set.
*
* @param field
* a {@code Calendar} field number.
* @return {@code true} if the specified field is set, {@code false} otherwise.
*/
public final boolean isSet(int field) {
return isSet[field];
}
/**
* Adds the specified amount to the specified field and wraps the value of
* the field when it goes beyond the maximum or minimum value for the
* current date. Other fields will be adjusted as required to maintain a
* consistent date.
*
* @param field
* the field to roll.
* @param value
* the amount to add.
*/
public void roll(int field, int value) {
boolean increment = value >= 0;
int count = increment ? value : -value;
for (int i = 0; i < count; i++) {
roll(field, increment);
}
}
/**
* Increment or decrement the specified field and wrap the value of the
* field when it goes beyond the maximum or minimum value for the current
* date. Other fields will be adjusted as required to maintain a consistent
* date.
*
* @param field
* the number indicating the field to roll.
* @param increment
* {@code true} to increment the field, {@code false} to decrement.
*/
abstract public void roll(int field, boolean increment);
/**
* Sets a field to the specified value.
*
* @param field
* the code indicating the {@code Calendar} field to modify.
* @param value
* the value.
*/
public void set(int field, int value) {
fields[field] = value;
isSet[field] = true;
areFieldsSet = isTimeSet = false;
if (field > MONTH && field < AM_PM) {
lastDateFieldSet = field;
}
if (field == HOUR || field == HOUR_OF_DAY) {
lastTimeFieldSet = field;
}
if (field == AM_PM) {
lastTimeFieldSet = HOUR;
}
}
/**
* Sets the year, month and day of the month fields. Other fields are not
* changed.
*
* @param year
* the year.
* @param month
* the month.
* @param day
* the day of the month.
*/
public final void set(int year, int month, int day) {
set(YEAR, year);
set(MONTH, month);
set(DATE, day);
}
/**
* Sets the year, month, day of the month, hour of day and minute fields.
* Other fields are not changed.
*
* @param year
* the year.
* @param month
* the month.
* @param day
* the day of the month.
* @param hourOfDay
* the hour of day.
* @param minute
* the minute.
*/
public final void set(int year, int month, int day, int hourOfDay,
int minute) {
set(year, month, day);
set(HOUR_OF_DAY, hourOfDay);
set(MINUTE, minute);
}
/**
* Sets the year, month, day of the month, hour of day, minute and second
* fields. Other fields are not changed.
*
* @param year
* the year.
* @param month
* the month.
* @param day
* the day of the month.
* @param hourOfDay
* the hour of day.
* @param minute
* the minute.
* @param second
* the second.
*/
public final void set(int year, int month, int day, int hourOfDay,
int minute, int second) {
set(year, month, day, hourOfDay, minute);
set(SECOND, second);
}
/**
* Sets the first day of the week for this {@code Calendar}.
*
* @param value
* a {@code Calendar} day of the week.
*/
public void setFirstDayOfWeek(int value) {
firstDayOfWeek = value;
}
/**
* Sets this {@code Calendar} to accept field values which are outside the valid
* range for the field.
*
* @param value
* a boolean value.
*/
public void setLenient(boolean value) {
lenient = value;
}
/**
* Sets the minimal days in the first week of the year.
*
* @param value
* the minimal days in the first week of the year.
*/
public void setMinimalDaysInFirstWeek(int value) {
minimalDaysInFirstWeek = value;
}
/**
* Sets the time of this {@code Calendar}.
*
* @param date
* a {@code Date} object.
*/
public final void setTime(Date date) {
setTimeInMillis(date.getTime());
}
/**
* Sets the time of this {@code Calendar}.
*
* @param milliseconds
* the time as the number of milliseconds since Jan. 1, 1970.
*/
public void setTimeInMillis(long milliseconds) {
if (!isTimeSet || !areFieldsSet || time != milliseconds) {
time = milliseconds;
isTimeSet = true;
areFieldsSet = false;
complete();
}
}
/**
* Sets the {@code TimeZone} used by this Calendar.
*
* @param timezone
* a {@code TimeZone}.
*/
public void setTimeZone(TimeZone timezone) {
zone = timezone;
areFieldsSet = false;
}
/**
* Returns the string representation of this {@code Calendar}.
*
* @return the string representation of this {@code Calendar}.
*/
@Override
@SuppressWarnings("nls")
public String toString() {
StringBuilder result = new StringBuilder(getClass().getName() + "[time="
+ (isTimeSet ? String.valueOf(time) : "?")
+ ",areFieldsSet="
+ areFieldsSet
+ // ",areAllFieldsSet=" + areAllFieldsSet +
",lenient=" + lenient + ",zone=" + zone + ",firstDayOfWeek="
+ firstDayOfWeek + ",minimalDaysInFirstWeek="
+ minimalDaysInFirstWeek);
for (int i = 0; i < FIELD_COUNT; i++) {
result.append(',');
result.append(fieldNames[i]);
result.append('=');
if (isSet[i]) {
result.append(fields[i]);
} else {
result.append('?');
}
}
result.append(']');
return result.toString();
}
/**
* Compares the times of the two {@code Calendar}, which represent the milliseconds
* from the January 1, 1970 00:00:00.000 GMT (Gregorian).
*
* @param anotherCalendar
* another calendar that this one is compared with.
* @return 0 if the times of the two {@code Calendar}s are equal, -1 if the time of
* this {@code Calendar} is before the other one, 1 if the time of this
* {@code Calendar} is after the other one.
* @throws NullPointerException
* if the argument is null.
* @throws IllegalArgumentException
* if the argument does not include a valid time
* value.
*/
public int compareTo(Calendar anotherCalendar) {
if (null == anotherCalendar) {
throw new NullPointerException();
}
long timeInMillis = getTimeInMillis();
long anotherTimeInMillis = anotherCalendar.getTimeInMillis();
if (timeInMillis > anotherTimeInMillis) {
return 1;
}
if (timeInMillis == anotherTimeInMillis) {
return 0;
}
return -1;
}
@SuppressWarnings("nls")
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("areFieldsSet", Boolean.TYPE),
new ObjectStreamField("fields", int[].class),
new ObjectStreamField("firstDayOfWeek", Integer.TYPE),
new ObjectStreamField("isSet", boolean[].class),
new ObjectStreamField("isTimeSet", Boolean.TYPE),
new ObjectStreamField("lenient", Boolean.TYPE),
new ObjectStreamField("minimalDaysInFirstWeek", Integer.TYPE),
new ObjectStreamField("nextStamp", Integer.TYPE),
new ObjectStreamField("serialVersionOnStream", Integer.TYPE),
new ObjectStreamField("time", Long.TYPE),
new ObjectStreamField("zone", TimeZone.class), };
@SuppressWarnings("nls")
private void writeObject(ObjectOutputStream stream) throws IOException {
complete();
ObjectOutputStream.PutField putFields = stream.putFields();
putFields.put("areFieldsSet", areFieldsSet);
putFields.put("fields", this.fields);
putFields.put("firstDayOfWeek", firstDayOfWeek);
putFields.put("isSet", isSet);
putFields.put("isTimeSet", isTimeSet);
putFields.put("lenient", lenient);
putFields.put("minimalDaysInFirstWeek", minimalDaysInFirstWeek);
putFields.put("nextStamp", 2 /* MINIMUM_USER_STAMP */);
putFields.put("serialVersionOnStream", 1);
putFields.put("time", time);
putFields.put("zone", zone);
stream.writeFields();
}
@SuppressWarnings("nls")
private void readObject(ObjectInputStream stream) throws IOException,
ClassNotFoundException {
ObjectInputStream.GetField readFields = stream.readFields();
areFieldsSet = readFields.get("areFieldsSet", false);
this.fields = (int[]) readFields.get("fields", null);
firstDayOfWeek = readFields.get("firstDayOfWeek", Calendar.SUNDAY);
isSet = (boolean[]) readFields.get("isSet", null);
isTimeSet = readFields.get("isTimeSet", false);
lenient = readFields.get("lenient", true);
minimalDaysInFirstWeek = readFields.get("minimalDaysInFirstWeek", 1);
time = readFields.get("time", 0L);
zone = (TimeZone) readFields.get("zone", null);
}
}
| [
"vitaly.provodin@jetbrains.com"
] | vitaly.provodin@jetbrains.com |
1f5d6206892588365bc83665dcf2b415375afabb | c066c38e4785cd74df68f86dcd65e2625d83cd1c | /menu/src/main/java/cn/edu/xidian/menu/MenuApplication.java | 6566a5c012845289db031953720615d8c10c6fe9 | [] | no_license | AnInvalidName/orchestrator_springcloud | 91444eae03a06acbde4ebecbe1400fcec6849021 | 9076e2093f7111e623f6314bcf264ae1e753d906 | refs/heads/master | 2022-06-24T21:47:40.761262 | 2019-12-13T02:36:00 | 2019-12-13T02:36:00 | 227,740,255 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 414 | java | package cn.edu.xidian.menu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@EnableEurekaServer
@SpringBootApplication
public class MenuApplication {
public static void main(String[] args) {
SpringApplication.run(MenuApplication.class, args);
}
}
| [
"lgx4645610@qq.com"
] | lgx4645610@qq.com |
12d27e0ff885c2defd52c06b7f776146845cdd1c | 816553c97a66b15a2b0a23ab52b0d74a39532c6d | /SMS/gen/com/example/sms/R.java | 2dea047a39ab3fda420d038d6c6dbe9d723f9411 | [] | no_license | wesley5201314/Android-Project-Demo | 4466ca5a94b7655091bce9d4243ee1550baa5bca | c75245f13538b3dfe2ed08eb6939f3e3cf171472 | refs/heads/master | 2020-06-06T04:57:34.857538 | 2015-02-02T10:20:44 | 2015-02-02T10:20:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,948 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example.sms;
public final class R {
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
*/
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 ic_launcher=0x7f020000;
}
public static final class id {
public static final int action_settings=0x7f080005;
public static final int button1=0x7f080004;
public static final int editText1=0x7f080001;
public static final int editText2=0x7f080003;
public static final int textView1=0x7f080000;
public static final int textView2=0x7f080002;
}
public static final class layout {
public static final int activity_main=0x7f030000;
}
public static final class menu {
public static final int main=0x7f070000;
}
public static final class string {
public static final int action_settings=0x7f050002;
public static final int app_name=0x7f050000;
public static final int button=0x7f050004;
public static final int hello_world=0x7f050001;
public static final int label=0x7f050003;
public static final int success=0x7f050005;
}
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;
}
}
| [
"893189117@qq.com"
] | 893189117@qq.com |
71562ba93f85d7853ce54d138b39fbaff30ccdfd | 1bdab33b7bba71fc03965156649652f3462b2fc2 | /src/test/java/Fifth/JavaLearning/JavaLearning/Strings/CompareTwoArrarys.java | 74e6ca2cf7acb02cafdfbb1d873b32136e3ebcc0 | [] | no_license | narendrareddytippala/JavaLearning | 80f7a178bf30666975d9a781057ba33318b4a81c | a594859b283699ddcb3e5bc2d0e21d5be8ac6e2a | refs/heads/main | 2023-04-10T05:54:26.718255 | 2021-04-05T16:36:47 | 2021-04-05T16:36:47 | 354,895,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 251 | java | package Fifth.JavaLearning.JavaLearning.Strings;
import java.util.Arrays;
public class CompareTwoArrarys {
public static void main(String[] args) {
int a[] = {2,4,6,7,9};
int b[] ={2,4,6,7,9};
System.out.println(Arrays.equals(a, b));
}
}
| [
"narendranaresh@gmail.com"
] | narendranaresh@gmail.com |
f821773e5098b913f2638e59e676b00f83b4092e | 66b646058b66abbe18ea693414f0a7306514b2f1 | /src/com/company/ninth_lesson/abs/AbstractShape.java | 10f4d82422fc078936e291c57ca233b6ecfed9a9 | [] | no_license | eugene-kuntsevich/java_course | 821e73343b7c915cc99284c58ae7f81bebf145f9 | 4e201d74a62550a40c6067e7f3f5c34858609c4d | refs/heads/master | 2023-01-09T18:31:15.864952 | 2020-11-15T12:34:56 | 2020-11-15T12:34:56 | 291,498,065 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 278 | java | package com.company.ninth_lesson.abs;
public abstract class AbstractShape
{
protected int square;
public AbstractShape(int square)
{
this.square = square;
}
protected void printSquare()
{
System.out.println("Shape");
}
protected abstract int countPerimeter();
}
| [
"eugene.kuntsevich@intexsoft.by"
] | eugene.kuntsevich@intexsoft.by |
f56f9bfe6033428fabc3a26eba41b2f569d39684 | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/tags/3.4.0_1/code/base/common/src/com/tc/util/Conversion.java | 421f5b44a856841d621040b1173db25028ca2cd1 | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,749 | java | /**
* All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright
* notice. All rights reserved.
*/
package com.tc.util;
import com.tc.bytes.TCByteBuffer;
import com.tc.exception.TCException;
import com.tc.exception.TCRuntimeException;
import java.io.UnsupportedEncodingException;
import java.text.DecimalFormat;
import java.util.regex.Pattern;
/**
* Data conversion algorithms and whatnot can be found in java.io.DataInput and java.io.DataOutput. Contains methods for
* converting from one kind of thing to another.
*
* @author orion
*/
public class Conversion {
public static final long MIN_UINT = 0;
public static final long MAX_UINT = 4294967295L; // 2^32 - 1
private static int makeInt(byte b3, byte b2, byte b1, byte b0) {
return ((((b3 & 0xff) << 24) | ((b2 & 0xff) << 16) | ((b1 & 0xff) << 8) | ((b0 & 0xff) << 0)));
}
public static byte setFlag(byte flags, int offset, boolean value) {
if (value) {
return (byte) (flags | offset);
} else {
return (byte) (flags & ~offset);
}
}
public static boolean getFlag(byte flags, int offset) {
return (flags & offset) == offset;
}
/**
* Helper method to convert a byte to an unsigned int. Use me when you want to treat a java byte as unsigned
*/
public static short byte2uint(byte b) {
return (short) (b & 0xFF);
}
public static long bytes2uint(byte b[]) {
return bytes2uint(b, 0, b.length);
}
public static long bytes2uint(byte b[], int length) {
return bytes2uint(b, 0, length);
}
/**
* Helper method to convert 1-4 bytes (big-endiand) into an unsigned int (max: 2^32 -1)
*/
public static long bytes2uint(byte b[], int offset, int length) {
if ((length < 1) || (length > 4)) { throw new IllegalArgumentException("invalid byte array length: " + length); }
if ((b.length - offset) < length) { throw new IllegalArgumentException("not enough data available for length "
+ length + " starting at offset " + offset
+ " in a byte array of length " + b.length); }
long rv = 0;
switch (length) {
case 1: {
return byte2uint(b[offset]);
}
case 2: {
rv += ((long) byte2uint(b[0 + offset])) << 8;
rv += byte2uint(b[1 + offset]);
return rv;
}
case 3: {
rv += ((long) byte2uint(b[0 + offset])) << 16;
rv += ((long) byte2uint(b[1 + offset])) << 8;
rv += byte2uint(b[2 + offset]);
return rv;
}
case 4: {
rv += ((long) byte2uint(b[0 + offset])) << 24;
rv += ((long) byte2uint(b[1 + offset])) << 16;
rv += ((long) byte2uint(b[2 + offset])) << 8;
rv += byte2uint(b[3 + offset]);
return rv;
}
default: {
throw new RuntimeException("internal error");
}
}
}
/**
* Helper method to write a 4 byte unsigned integer value into a given byte array at a given offset
*
* @param l the unsigned int value to write
* @param dest the byte array to write the uint into
* @param index starting offset into the destination byte array
*/
public static void writeUint(long l, byte[] dest, int index) {
if ((l > MAX_UINT) || (l < 0)) { throw new IllegalArgumentException("unsigned integer value invalid: " + l); }
int pos = index;
dest[pos++] = (byte) ((l >>> 24) & 0x000000FF);
dest[pos++] = (byte) ((l >>> 16) & 0x000000FF);
dest[pos++] = (byte) ((l >>> 8) & 0x000000FF);
dest[pos++] = (byte) (l & 0x000000FF);
return;
}
/**
* Helper method to write a 4 byte java (signed) integer value into a given byte array at a given offset
*
* @param l the signed int value to write
* @param dest the byte array to write the uint into
* @param index starting offset into the destination byte array
*/
public static void writeInt(int i, byte[] dest, int index) {
dest[index] = (byte) ((i >>> 24) & 0x000000FF);
dest[index + 1] = (byte) ((i >>> 16) & 0x000000FF);
dest[index + 2] = (byte) ((i >>> 8) & 0x000000FF);
dest[index + 3] = (byte) ((i >>> 0) & 0x000000FF);
return;
}
/**
* Helper method to convert an unsigned short to 2 bytes (big-endian)
*/
public static byte[] ushort2bytes(int i) {
if ((i > 0xFFFF) || (i < 0)) { throw new IllegalArgumentException("invalid short value: " + i); }
byte[] rv = new byte[2];
rv[0] = (byte) ((i >>> 8) & 0x000000FF);
rv[1] = (byte) ((i >>> 0) & 0x000000FF);
return rv;
}
/**
* Helper method to convert an unsigned integer to 4 bytes (big-endian)
*/
public static byte[] uint2bytes(long l) {
if ((l > MAX_UINT) || (l < 0)) { throw new IllegalArgumentException("unsigned integer value out of range: " + l); }
byte[] rv = new byte[4];
rv[0] = (byte) ((l >>> 24) & 0x000000FF);
rv[1] = (byte) ((l >>> 16) & 0x000000FF);
rv[2] = (byte) ((l >>> 8) & 0x000000FF);
rv[3] = (byte) ((l >>> 0) & 0x000000FF);
return rv;
}
/**
* Helper method to convert a string to bytes in a safe way.
*/
public static String bytes2String(byte[] bytes) {
try {
return new String(bytes, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new TCRuntimeException(e);
}
}
/**
* Helper method to convert a string to bytes in a safe way.
*/
public static byte[] string2Bytes(String string) {
try {
return (string == null) ? new byte[0] : string.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new TCRuntimeException(e);
}
}
public static boolean bytes2Boolean(byte[] bytes) {
return (bytes[0] != 0 ? true : false);
}
public static byte[] boolean2Bytes(boolean v) {
byte[] rv = new byte[1];
rv[0] = v ? (byte) 1 : (byte) 0;
return rv;
}
public static byte[] byte2Bytes(byte v) {
return new byte[] { v };
}
public static char bytes2Char(byte[] bytes) {
return (char) ((bytes[0] << 8) | (bytes[1] & 0xff));
}
public static byte[] char2Bytes(char v) {
return new byte[] { (byte) (0xff & (v >> 8)), (byte) (0xff & v) };
}
public static double bytes2Double(byte[] bytes) {
return Double.longBitsToDouble(Conversion.bytes2Long(bytes));
}
public static byte[] double2Bytes(double l) {
return Conversion.long2Bytes(Double.doubleToLongBits(l));
}
public static float bytes2Float(byte[] bytes) {
return Float.intBitsToFloat(Conversion.bytes2Int(bytes));
}
public static byte[] float2Bytes(float l) {
return Conversion.int2Bytes(Float.floatToIntBits(l));
}
public static int bytes2Int(byte[] bytes, int offset) {
return makeInt(bytes[offset], bytes[offset + 1], bytes[offset + 2], bytes[offset + 3]);
}
public static int bytes2Int(byte[] bytes) {
return makeInt(bytes[0], bytes[1], bytes[2], bytes[3]);
}
public static byte[] int2Bytes(int v) {
byte[] rv = new byte[4];
rv[0] = (byte) ((v >>> 24) & 0xFF);
rv[1] = (byte) ((v >>> 16) & 0xFF);
rv[2] = (byte) ((v >>> 8) & 0xFF);
rv[3] = (byte) ((v >>> 0) & 0xFF);
return rv;
}
public static long bytes2Long(byte[] bytes) {
return bytes2Long(bytes, 0);
}
public static long bytes2Long(byte[] bytes, int offset) {
return (((long) bytes[offset] << 56) + ((long) (bytes[offset + 1] & 0xFF) << 48)
+ ((long) (bytes[offset + 2] & 0xFF) << 40) + ((long) (bytes[offset + 3] & 0xFF) << 32)
+ ((long) (bytes[offset + 4] & 0xFF) << 24) + ((bytes[offset + 5] & 0xFF) << 16)
+ ((bytes[offset + 6] & 0xFF) << 8) + ((bytes[offset + 7] & 0xFF) << 0));
}
public static byte[] long2Bytes(long l) {
byte[] rv = new byte[8];
writeLong(l, rv, 0);
return rv;
}
public static void writeLong(long l, byte[] rv, int offset) {
rv[offset] = (byte) (l >>> 56);
rv[offset + 1] = (byte) (l >>> 48);
rv[offset + 2] = (byte) (l >>> 40);
rv[offset + 3] = (byte) (l >>> 32);
rv[offset + 4] = (byte) (l >>> 24);
rv[offset + 5] = (byte) (l >>> 16);
rv[offset + 6] = (byte) (l >>> 8);
rv[offset + 7] = (byte) (l >>> 0);
}
public static short bytes2Short(byte[] bytes) {
short rv = (short) (((bytes[0] & 0xFF) << 8) + ((bytes[1] & 0xFF) << 0));
return rv;
}
public static byte[] short2Bytes(short v) {
byte[] rv = new byte[2];
rv[0] = (byte) ((v >>> 8) & 0xFF);
rv[1] = (byte) ((v >>> 0) & 0xFF);
return rv;
}
public static boolean byte2Boolean(byte b) {
return b != 0;
}
/**
* @param value
*/
public static byte boolean2Byte(boolean value) {
return (value) ? (byte) 1 : (byte) 0;
}
/**
* Equivalent to calling <code>bytesToHex(b, 0, b.length)</code>.
*/
public static String bytesToHex(byte[] b) {
return bytesToHex(b, 0, b.length);
}
/**
* Converts a single byte to a hex string representation, can be decoded with Byte.parseByte().
*
* @param b the byte to encode
* @return a
*/
public static String bytesToHex(byte[] b, int index, int length) {
StringBuffer buf = new StringBuffer();
byte leading, trailing;
for (int pos = index; pos >= 0 && pos < index + length && pos < b.length; ++pos) {
leading = (byte) ((b[pos] >>> 4) & 0x0f);
trailing = (byte) (b[pos] & 0x0f);
buf.append((0 <= leading) && (leading <= 9) ? (char) ('0' + leading) : (char) ('A' + (leading - 10)));
buf.append((0 <= trailing) && (trailing <= 9) ? (char) ('0' + trailing) : (char) ('A' + (trailing - 10)));
}
return buf.toString();
}
/**
* @param hexString
* @return an array of bytes, decoded from the hex-encoded string, if <code>hexString</code> is <code>null</code> or
* the length is not a multiple of two then <code>null</code> is returned.
*/
public static byte[] hexToBytes(String hexString) {
if (hexString == null || hexString.length() % 2 != 0) { return null; }
int length = hexString.length();
byte rv[] = new byte[length / 2];
int x, y;
for (x = 0, y = 0; x < length; x += 2, ++y) {
rv[y] = Byte.parseByte(hexString.substring(x, x + 2), 16);
}
return rv;
}
public static String buffer2String(int length, TCByteBuffer buffer) {
byte[] bytes = new byte[length];
buffer.get(bytes);
return Conversion.bytes2String(bytes);
}
public static enum MemorySizeUnits {
KILO("k"), MEGA("m"), GIGA("g");
private final String unit;
private MemorySizeUnits(final String unit) {
this.unit = unit;
}
public long getInBytes() throws MetricsFormatException {
if (this.unit.equals(KILO.getUnit())) {
return 1024;
} else if (this.unit.equals(MEGA.getUnit())) {
return 1024 * KILO.getInBytes();
} else if (this.unit.equals(GIGA.getUnit())) {
return 1024 * MEGA.getInBytes();
} else {
throw new MetricsFormatException("Unexpected size: " + toString());
}
}
@Override
public String toString() {
return "'" + this.unit + "'";
}
public String getUnit() {
return unit;
}
}
// XXX: FIX rename method
public static int memorySizeAsIntBytes(final String memorySizeInUnits) throws MetricsFormatException {
long rv = memorySizeAsLongBytes(memorySizeInUnits);
if (rv > Integer.MAX_VALUE) {
throw new MetricsFormatException(memorySizeInUnits + " is greater than integer range");
} else {
return (int) rv;
}
}
public static long memorySizeAsLongBytes(final String memorySizeInUnits) throws MetricsFormatException {
final String input = memorySizeInUnits.toLowerCase().trim();
// XXX: review pattern matcher regex
if (!Pattern.matches("[0-9]*([.][0-9]+)? *([kmg])?", input)) { throw new MetricsFormatException("Unexpected Size: "
+ input); }
String[] str = input.split("[kmg]");
if (str.length > 1) { throw new MetricsFormatException("Unexpected size: " + input); }
double base = 0;
try {
base = Double.parseDouble(str[0].trim());
} catch (NumberFormatException nfe) {
throw new MetricsFormatException("Unexpectes metrics: " + input);
}
if (input.endsWith(MemorySizeUnits.KILO.getUnit())) {
return (long) (base * MemorySizeUnits.KILO.getInBytes());
} else if (input.endsWith(MemorySizeUnits.MEGA.getUnit())) {
return (long) (base * MemorySizeUnits.MEGA.getInBytes());
} else if (input.endsWith(MemorySizeUnits.GIGA.getUnit())) {
return (long) (base * MemorySizeUnits.GIGA.getInBytes());
} else {
return (long) base;
}
}
static DecimalFormat twoDForm = new DecimalFormat("#.##");
public static String memoryBytesAsSize(final long bytes) throws NumberFormatException, MetricsFormatException {
if (bytes < MemorySizeUnits.KILO.getInBytes()) {
return bytes + "b";
} else if (bytes < MemorySizeUnits.MEGA.getInBytes()) {
double rv = (bytes / (MemorySizeUnits.KILO.getInBytes() * 1.0));
return Double.valueOf(twoDForm.format(rv)) + "k";
} else if (bytes < MemorySizeUnits.GIGA.getInBytes()) {
double rv = (bytes / (MemorySizeUnits.MEGA.getInBytes() * 1.0));
return Double.valueOf(twoDForm.format(rv)) + "m";
} else {
double rv = (bytes / (MemorySizeUnits.GIGA.getInBytes() * 1.0));
return Double.valueOf(twoDForm.format(rv)) + "g";
}
}
public static class MetricsFormatException extends TCException {
public MetricsFormatException(String message) {
super(message);
}
}
} | [
"jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864 |
96ef1361078f67e79df872b85faa3bf2af9522ff | 726cf01270d48994defec40733a0e69ac4c72d78 | /src/main/java/com/tsystems/tschool/logiweb/services/impl/UserServiceImpl.java | 609f3aae7733045f78bba1574e8ecc64b4c926d5 | [] | no_license | raspyatnikov/tschool | d2d14031eb252abfec368619896c7c724ac2c1f3 | 1e1eb678b8b003fe1fc639d07b8a98acce1ee78f | refs/heads/master | 2021-07-16T04:52:37.446686 | 2017-10-23T08:00:01 | 2017-10-23T08:00:01 | 107,146,413 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,362 | java | package com.tsystems.tschool.logiweb.services.impl;
import com.tsystems.tschool.logiweb.dao.UserDao;
import com.tsystems.tschool.logiweb.dao.exceptions.DaoException;
import com.tsystems.tschool.logiweb.entities.User;
import com.tsystems.tschool.logiweb.services.UserService;
import com.tsystems.tschool.logiweb.services.exceptions.ServiceException;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
@Autowired
UserDao userDao;
private static final Logger LOGGER = Logger.getLogger(OrderServiceImpl.class);
@Transactional
@Override
public List<User> findAllUsers() throws ServiceException {
try {
return userDao.findAll();
} catch (DaoException e) {
LOGGER.warn("Error in service layer");
throw new ServiceException(e.getMessage(), e);
}
}
@Transactional
@Override
public void editUser(User editedUser) throws ServiceException {
try {
userDao.update(editedUser);
} catch (DaoException e) {
LOGGER.warn("Error in service layer");
throw new ServiceException(e.getMessage(), e);
}
}
@Transactional
@Override
public int addUser(User newUser) throws ServiceException {
try {
userDao.create(newUser);
return newUser.getId();
} catch (DaoException e) {
LOGGER.warn("Error in service layer");
throw new ServiceException(e.getMessage(), e);
}
}
@Transactional
@Override
public User findUserById(int id) throws ServiceException {
try {
return userDao.findById(id);
} catch (DaoException e) {
LOGGER.warn("Error in service layer");
throw new ServiceException(e.getMessage(), e);
}
}
@Transactional
@Override
public User findUserByEmail(String email) throws ServiceException {
try {
return userDao.findUserByEmail(email);
} catch (DaoException e) {
LOGGER.warn("Error in service layer");
throw new ServiceException(e.getMessage(), e);
}
}
}
| [
"ilyar2008@gmail.com"
] | ilyar2008@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.