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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71b4f673907ed7ba1040184182a5e3464af6d7ed | 91b858c01e70ebd9b3e70bfff88515bbda9aa376 | /src/main/java/com/company/project/model/CustomerTable.java | 4281aac3600dc38fd8c2229b192e97c9589a1c45 | [] | no_license | cag1456089397/spring-boot-api-project-seed | f409dde2f9d8ca28580e83a69e55015ea0af077b | 737aede374b76141d54028d1bd90caf85be01291 | refs/heads/master | 2022-12-08T04:10:49.308466 | 2019-07-30T04:54:12 | 2019-07-30T04:54:12 | 199,577,101 | 0 | 0 | null | 2022-12-05T23:35:42 | 2019-07-30T04:53:41 | Java | UTF-8 | Java | false | false | 11,990 | java | package com.company.project.model;
import java.util.Date;
import javax.persistence.*;
@Table(name = "customer_table")
public class CustomerTable {
/**
* 编号
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 客户名称
*/
private String customer;
/**
* 业务类型
*/
@Column(name = "business_type")
private String businessType;
/**
* 产品号码
*/
@Column(name = "produce_number")
private String produceNumber;
/**
* 网关名称
*/
@Column(name = "network_name")
private String networkName;
/**
* 网关别名
*/
@Column(name = "network_name_other")
private String networkNameOther;
/**
* 网关设备IP
*/
@Column(name = "network_ip")
private String networkIp;
/**
* 网关接口
*/
@Column(name = "network_port")
private String networkPort;
/**
* 接入设备名称
*/
@Column(name = "insert_name")
private String insertName;
/**
* 接入设备别名
*/
@Column(name = "insert_name_other")
private String insertNameOther;
/**
* 接入设备别名
*/
@Column(name = "insert_ip")
private String insertIp;
/**
* 接入端口
*/
@Column(name = "insert_port")
private String insertPort;
/**
* VLAN
*/
@Column(name = "vlan_id")
private String vlanId;
/**
* 工单号
*/
@Column(name = "wf_id")
private String wfId;
/**
* 电路编号
*/
@Column(name = "electric_id")
private String electricId;
/**
* 互联IP
*/
@Column(name = "connect_ip")
private String connectIp;
/**
* 用户IP
*/
@Column(name = "user_ip")
private String userIp;
/**
* IP数量
*/
@Column(name = "ip_num")
private Integer ipNum;
/**
* 接入速率
*/
@Column(name = "insert_speed")
private Integer insertSpeed;
/**
* 客户联系人
*/
@Column(name = "link_people")
private String linkPeople;
/**
* 客户联系方式
*/
@Column(name = "link_phone")
private String linkPhone;
/**
* 装机地址
*/
@Column(name = "customer_address")
private String customerAddress;
/**
* 开通时间
*/
@Column(name = "open_date")
private Date openDate;
/**
* 更新时间
*/
@Column(name = "up_date")
private Date upDate;
/**
* 带宽是否一致
*/
@Column(name = "same_band")
private String sameBand;
/**
* 备注
*/
private String remark;
/**
* 是否开通80、8080、443端口
*/
@Column(name = "is_80")
private String is80;
/**
* 获取编号
*
* @return id - 编号
*/
public Integer getId() {
return id;
}
/**
* 设置编号
*
* @param id 编号
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取客户名称
*
* @return customer - 客户名称
*/
public String getCustomer() {
return customer;
}
/**
* 设置客户名称
*
* @param customer 客户名称
*/
public void setCustomer(String customer) {
this.customer = customer;
}
/**
* 获取业务类型
*
* @return business_type - 业务类型
*/
public String getBusinessType() {
return businessType;
}
/**
* 设置业务类型
*
* @param businessType 业务类型
*/
public void setBusinessType(String businessType) {
this.businessType = businessType;
}
/**
* 获取产品号码
*
* @return produce_number - 产品号码
*/
public String getProduceNumber() {
return produceNumber;
}
/**
* 设置产品号码
*
* @param produceNumber 产品号码
*/
public void setProduceNumber(String produceNumber) {
this.produceNumber = produceNumber;
}
/**
* 获取网关名称
*
* @return network_name - 网关名称
*/
public String getNetworkName() {
return networkName;
}
/**
* 设置网关名称
*
* @param networkName 网关名称
*/
public void setNetworkName(String networkName) {
this.networkName = networkName;
}
/**
* 获取网关别名
*
* @return network_name_other - 网关别名
*/
public String getNetworkNameOther() {
return networkNameOther;
}
/**
* 设置网关别名
*
* @param networkNameOther 网关别名
*/
public void setNetworkNameOther(String networkNameOther) {
this.networkNameOther = networkNameOther;
}
/**
* 获取网关设备IP
*
* @return network_ip - 网关设备IP
*/
public String getNetworkIp() {
return networkIp;
}
/**
* 设置网关设备IP
*
* @param networkIp 网关设备IP
*/
public void setNetworkIp(String networkIp) {
this.networkIp = networkIp;
}
/**
* 获取网关接口
*
* @return network_port - 网关接口
*/
public String getNetworkPort() {
return networkPort;
}
/**
* 设置网关接口
*
* @param networkPort 网关接口
*/
public void setNetworkPort(String networkPort) {
this.networkPort = networkPort;
}
/**
* 获取接入设备名称
*
* @return insert_name - 接入设备名称
*/
public String getInsertName() {
return insertName;
}
/**
* 设置接入设备名称
*
* @param insertName 接入设备名称
*/
public void setInsertName(String insertName) {
this.insertName = insertName;
}
/**
* 获取接入设备别名
*
* @return insert_name_other - 接入设备别名
*/
public String getInsertNameOther() {
return insertNameOther;
}
/**
* 设置接入设备别名
*
* @param insertNameOther 接入设备别名
*/
public void setInsertNameOther(String insertNameOther) {
this.insertNameOther = insertNameOther;
}
/**
* 获取接入设备别名
*
* @return insert_ip - 接入设备别名
*/
public String getInsertIp() {
return insertIp;
}
/**
* 设置接入设备别名
*
* @param insertIp 接入设备别名
*/
public void setInsertIp(String insertIp) {
this.insertIp = insertIp;
}
/**
* 获取接入端口
*
* @return insert_port - 接入端口
*/
public String getInsertPort() {
return insertPort;
}
/**
* 设置接入端口
*
* @param insertPort 接入端口
*/
public void setInsertPort(String insertPort) {
this.insertPort = insertPort;
}
/**
* 获取VLAN
*
* @return vlan_id - VLAN
*/
public String getVlanId() {
return vlanId;
}
/**
* 设置VLAN
*
* @param vlanId VLAN
*/
public void setVlanId(String vlanId) {
this.vlanId = vlanId;
}
/**
* 获取工单号
*
* @return wf_id - 工单号
*/
public String getWfId() {
return wfId;
}
/**
* 设置工单号
*
* @param wfId 工单号
*/
public void setWfId(String wfId) {
this.wfId = wfId;
}
/**
* 获取电路编号
*
* @return electric_id - 电路编号
*/
public String getElectricId() {
return electricId;
}
/**
* 设置电路编号
*
* @param electricId 电路编号
*/
public void setElectricId(String electricId) {
this.electricId = electricId;
}
/**
* 获取互联IP
*
* @return connect_ip - 互联IP
*/
public String getConnectIp() {
return connectIp;
}
/**
* 设置互联IP
*
* @param connectIp 互联IP
*/
public void setConnectIp(String connectIp) {
this.connectIp = connectIp;
}
/**
* 获取用户IP
*
* @return user_ip - 用户IP
*/
public String getUserIp() {
return userIp;
}
/**
* 设置用户IP
*
* @param userIp 用户IP
*/
public void setUserIp(String userIp) {
this.userIp = userIp;
}
/**
* 获取IP数量
*
* @return ip_num - IP数量
*/
public Integer getIpNum() {
return ipNum;
}
/**
* 设置IP数量
*
* @param ipNum IP数量
*/
public void setIpNum(Integer ipNum) {
this.ipNum = ipNum;
}
/**
* 获取接入速率
*
* @return insert_speed - 接入速率
*/
public Integer getInsertSpeed() {
return insertSpeed;
}
/**
* 设置接入速率
*
* @param insertSpeed 接入速率
*/
public void setInsertSpeed(Integer insertSpeed) {
this.insertSpeed = insertSpeed;
}
/**
* 获取客户联系人
*
* @return link_people - 客户联系人
*/
public String getLinkPeople() {
return linkPeople;
}
/**
* 设置客户联系人
*
* @param linkPeople 客户联系人
*/
public void setLinkPeople(String linkPeople) {
this.linkPeople = linkPeople;
}
/**
* 获取客户联系方式
*
* @return link_phone - 客户联系方式
*/
public String getLinkPhone() {
return linkPhone;
}
/**
* 设置客户联系方式
*
* @param linkPhone 客户联系方式
*/
public void setLinkPhone(String linkPhone) {
this.linkPhone = linkPhone;
}
/**
* 获取装机地址
*
* @return customer_address - 装机地址
*/
public String getCustomerAddress() {
return customerAddress;
}
/**
* 设置装机地址
*
* @param customerAddress 装机地址
*/
public void setCustomerAddress(String customerAddress) {
this.customerAddress = customerAddress;
}
/**
* 获取开通时间
*
* @return open_date - 开通时间
*/
public Date getOpenDate() {
return openDate;
}
/**
* 设置开通时间
*
* @param openDate 开通时间
*/
public void setOpenDate(Date openDate) {
this.openDate = openDate;
}
/**
* 获取更新时间
*
* @return up_date - 更新时间
*/
public Date getUpDate() {
return upDate;
}
/**
* 设置更新时间
*
* @param upDate 更新时间
*/
public void setUpDate(Date upDate) {
this.upDate = upDate;
}
/**
* 获取带宽是否一致
*
* @return same_band - 带宽是否一致
*/
public String getSameBand() {
return sameBand;
}
/**
* 设置带宽是否一致
*
* @param sameBand 带宽是否一致
*/
public void setSameBand(String sameBand) {
this.sameBand = sameBand;
}
/**
* 获取备注
*
* @return remark - 备注
*/
public String getRemark() {
return remark;
}
/**
* 设置备注
*
* @param remark 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* 获取是否开通80、8080、443端口
*
* @return is_80 - 是否开通80、8080、443端口
*/
public String getIs80() {
return is80;
}
/**
* 设置是否开通80、8080、443端口
*
* @param is80 是否开通80、8080、443端口
*/
public void setIs80(String is80) {
this.is80 = is80;
}
} | [
"1456089397@qq.com"
] | 1456089397@qq.com |
4db6373a92753692a231021b4cb05b133c259739 | bb50f74ac0ac77df2fab0a3bdde48f41588c757c | /src/pres/Presentation.java | 8c1542d89a8320520400346ba119dc9e9f48b561 | [] | no_license | ABDEL-GR/Jee | 25466e1f0aec6b2d773584b8cf59d2b35e652546 | 41bc4c02c28c5395ff6849a7f838ec78e174ef2a | refs/heads/main | 2023-03-28T21:46:50.647312 | 2021-03-30T22:28:37 | 2021-03-30T22:28:37 | null | 0 | 0 | null | null | null | null | ISO-8859-2 | Java | false | false | 1,074 | java | package pres;
import java.io.File;
import java.io.FileNotFoundException;
import java.lang.reflect.Method;
import java.util.Scanner;
import dao.DaoImpl;
import dao.Idao;
import metier.IMetier;
import metier.MetierImpl;
public class Presentation {
public static void main (String[] args) throws Exception {
/*
* Injection des dépendances par instanciation statique
DaoImpl dao = new DaoImpl();
MetierImpl metier=new MetierImpl();
metier.setDao(dao);
System.out.println(metier.calcul());
*/
//Injection des dépendances instanciation dynamique
Scanner scanner= new Scanner(new File("config.txt"));
String daoClassName=scanner.nextLine();
Class cDao=Class.forName(daoClassName);
Idao dao=(Idao) cDao.newInstance();
String metierClassName = scanner.nextLine();
Class cMetier=Class.forName(metierClassName);
IMetier metier =(IMetier) cMetier.newInstance();
Method m= cMetier.getMethod("setDao", Idao.class);
m.invoke(metier, dao);
//System.out.println(dao.getData());
System.out.println(metier.calcul());
}
}
| [
"abdogardam@gmail.com"
] | abdogardam@gmail.com |
b54cba7ceb396ad29cf8313342949659372b5b92 | 4e4d0727e275a539601b69a986853c337cca21d8 | /ContactList/app/src/test/java/com/example/saksham/contactlist/ExampleUnitTest.java | 1318d25d957c3ac17e8719a04eedacd78a493dbf | [] | no_license | sakki007/ContactList | 084dc85478eac2a4247261b3067b76ed584591f0 | 87949e2ece3e781304f364e43d48b9bf93a2ac44 | refs/heads/master | 2021-01-20T06:44:24.081999 | 2017-05-01T12:57:26 | 2017-05-01T12:57:26 | 89,923,783 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | package com.example.saksham.contactlist;
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);
}
} | [
"asaksham14@gmail.com"
] | asaksham14@gmail.com |
9ab26a87cdcbd6d1a374f0a88968b1a21a381613 | c3d7dcdb764e92fd69d6ed785cba709a617e0e28 | /GeoChan/src/main/java/com/teamshodan/geochan/interfaces/GetCommentsRunnableInterface.java | c65c95c7927e4394edf829fc183074ad13229696 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | teamshodan/GeoChan | 3f946de171bca3302c125649720eabb7494775c9 | 5f96120a94b69e5ce4c025dfe497c0530dc54679 | refs/heads/master | 2020-05-17T00:52:09.633278 | 2014-04-10T04:15:43 | 2014-04-10T04:15:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,207 | java | /*
* Copyright 2014 Artem Chikin
* Copyright 2014 Artem Herasymchuk
* Copyright 2014 Tom Krywitsky
* Copyright 2014 Henry Pabst
* Copyright 2014 Bradley Simons
*
* 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.teamshodan.geochan.interfaces;
/**
* Provides an interface for a Runnable that
* gets Comments from ElasticSearch.
* @author Artem Herasymchuk
*
*/
public interface GetCommentsRunnableInterface {
/**
* Handles the possible states of the Runnable
* that gets the comments.
* @param state the state
*/
void handleGetCommentsState(int state);
/* Getters and setters */
void setGetCommentsThread(Thread thread);
}
| [
"artemh@gmail.com"
] | artemh@gmail.com |
53f1a5c9dbf011bd771dd0f9282d1d9b929124d4 | b2fb3c54a28c94820d8e3d368d06816fb1d132e8 | /java/src/test/java/org/teneighty/leibniz/function/trigonometric/SineTest.java | 45839f76adeaccc963dec17953484b1b3317d792 | [] | no_license | ctongfei/leibniz | a2dadb3c4797b2ad44c7d9d1166d9fe36a7c88e8 | 3a6da70c609e9aaa23438147ed8e01424a2b37fb | refs/heads/master | 2023-08-23T06:39:24.051204 | 2013-07-12T01:52:46 | 2013-07-12T01:52:46 | 43,380,960 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,824 | java | /*
* $Id$
*
* Copyright (c) 2012-2013 Fran Lattanzio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.teneighty.leibniz.function.trigonometric;
import org.teneighty.leibniz.Differentiable;
import org.teneighty.leibniz.Differentiables;
import org.teneighty.leibniz.function.AbstractUnivariateDifferentiableTest;
/**
* Test for the sine function.
*/
public final class SineTest
extends AbstractUnivariateDifferentiableTest
{
/**
* @see org.teneighty.leibniz.function.AbstractUnivariateDifferentiableTest#apply(org.teneighty.leibniz.Differentiable)
*/
@Override
protected Differentiable apply(final Differentiable argument)
{
return Differentiables.sin(argument);
}
}
| [
"syenkoc@gmail.com"
] | syenkoc@gmail.com |
cb99a69a2d190b01f86387ef9d33ecf126be3047 | 13d5a9bbc23b3c1a8e91aaebea7e3bfc5c1fe0ba | /src/main/java/com/turkoglu/strategy/RandomSelectionStrategy.java | a77e5ae902a0c9e312cccdef2a248f95801354fa | [] | no_license | halilturkoglucs/paper-rock-scissors | 7564db51d0913c689cf2c81deeb80d7228767c41 | dc6c3bc1c4a9d477dd418195cc27fb7d936be208 | refs/heads/master | 2023-08-21T05:01:25.251886 | 2021-10-22T15:34:17 | 2021-10-22T15:34:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 911 | java | package com.turkoglu.strategy;
import com.turkoglu.game.Selection;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
public class RandomSelectionStrategy implements PlayingStrategy {
private static final int SELECTION_SIZE = Selection.values().length;
private static final Map<Integer, Selection> selections = new HashMap<>();
private final Random random;
static {
Selection[] selectionEnums = Selection.values();
for (int i = 0; i < selectionEnums.length; i++) {
selections.put(i+1, selectionEnums[i]);
}
}
public RandomSelectionStrategy() {
this.random = new Random();
}
@Override
public Selection decide() {
// random selection between [1, SELECTION_SIZE] inclusive
int randomChoice = random.nextInt(SELECTION_SIZE - 1) + 1;
return selections.get(randomChoice);
}
}
| [
"halilturkoglucs@gmail.com"
] | halilturkoglucs@gmail.com |
0ab878bd3c7429bc1ba549e0bf14d4c8e856c88e | 707d6d197c05a0e8e9dc90d02e5f70cdb28a3f12 | /spring-rest/src/main/java/rest/consumer/springconsumer/dto/TwitterTweetDto.java | 810bd6f12504c9861f800db448472aac1480c96d | [] | no_license | theavicaster/covid-media-similarity | 3a120952fc2ff1ae6792ebe4ab870d8ba433fcc7 | 1a04125fb887069b739c5bcc0229ff4dfb7ce495 | refs/heads/main | 2023-04-10T20:50:20.866500 | 2021-04-23T10:07:03 | 2021-04-23T10:07:03 | 360,300,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package rest.consumer.springconsumer.dto;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.Data;
import rest.consumer.springconsumer.domain.TwitterTweet;
import rest.consumer.springconsumer.utils.TwitterTweetDtoDeserializer;
import java.util.ArrayList;
import java.util.List;
@Data
@JsonDeserialize(using = TwitterTweetDtoDeserializer.class)
public class TwitterTweetDto {
private List<TwitterTweet> tweetList;
public TwitterTweetDto() {
tweetList = new ArrayList<>();
}
}
| [
"avinandanbanerjee99@gmail.com"
] | avinandanbanerjee99@gmail.com |
7fcb65140cb849b8d1af484a92e610a51751371b | 76f9d1d880e7656f4cf2da30bab1654d26e66bb6 | /src/AC.java | 6edb4a3e0c778b9d523346509bf13e626424f5ef | [] | no_license | AlishaLotlikar/HomeAutomation | 138b0f5a3f8f121def235a7bc901920718f78e30 | df49638ddf93ef50b86d3fe9cd1c41f87318636e | refs/heads/master | 2020-03-12T20:12:09.639298 | 2018-04-24T07:54:56 | 2018-04-24T07:54:56 | 130,800,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | import java.util.Scanner;
public class AC {
int onFlag=1;
int temperature=30;
public void turnOn(){
onFlag=0;
System.out.println("AC is Turned On");
}
public void turnOff(){
onFlag=1;
System.out.println("AC is Turned On");
}
public void tempIncrease(){
temperature++;
System.out.println("Temperature: "+temperature);
}
public void tempDecrease(){
temperature--;
System.out.println("Temperature: "+temperature);
}
}
| [
"Student@acer-PC"
] | Student@acer-PC |
6627bfda2bf251d93b41510c48b551a124601f9f | 0f970637b29a7db25c03e6057c97b6ccac9dbd9c | /src/main/Transmission.java | 7bc56b8918b5c6ad778a50a7b4b0020b4693ff96 | [] | no_license | slavikovbasa/HeterogeneousScheduling | 4b0a86e0d7a3c617fc5717c6cc7e416b6b31ce90 | c50b322734f9026720a172fe489fc7269189cb10 | refs/heads/master | 2020-04-15T20:06:10.427286 | 2019-01-20T22:59:03 | 2019-01-20T22:59:03 | 164,979,200 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | class Transmission {
int startTime, finishTime;
Task fromTask, toTask;
int fromProc, toProc;
Transmission(int startTime, int finishTime, Task fromTask, Task toTask, int fromProc, int toProc) {
this.startTime = startTime;
this.finishTime = finishTime;
this.fromTask = fromTask;
this.toTask = toTask;
this.fromProc = fromProc;
this.toProc = toProc;
}
}
| [
"slavikovbasa@gmail.com"
] | slavikovbasa@gmail.com |
cd9f7d521e9dd39e30a496a829458544c31e026c | 7a83daf384a0ece87924221f57adef8034789342 | /tests/tests-lib/src/main/java/lib/enable/EnableBar.java | 840ce00fdfa6dcc0020cf4ad11987165279df38c | [
"Apache-2.0"
] | permissive | spring-operator/spring-init | 18df112ed469a61e6f076d103fe9ccec2ded35b1 | 51d6f3d9d5804bb45b118bfbcf1fb9be1e0daf0a | refs/heads/master | 2020-04-28T08:27:40.712022 | 2019-03-04T15:10:19 | 2019-03-04T15:10:19 | 175,127,478 | 0 | 0 | Apache-2.0 | 2019-03-12T03:21:41 | 2019-03-12T03:21:33 | Java | UTF-8 | Java | false | false | 1,066 | java | /*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package lib.enable;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;
/**
* @author Dave Syer
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Import(BarConfiguration.class)
public @interface EnableBar {
}
| [
"dsyer@pivotal.io"
] | dsyer@pivotal.io |
77ed8c7888ca5578a3a27220c7a65f6997892f26 | 9709a535cf29bc6d99b3c285bdcb3f0bdd9a0be5 | /test/src/main/java/HitCounter.java | bccc90f2728ddb488225cba402afe3548ccfbf62 | [] | no_license | mavinkurve/pallavi-personal-project | 4cc7922c7928c52dda8fc0dfe60f3129949be11e | 26c09151d475bda453f1a98f19456f69d322b9dd | refs/heads/master | 2021-04-15T06:49:55.603224 | 2018-08-25T16:36:19 | 2018-08-25T16:36:19 | 126,874,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | import java.util.ArrayList;
import java.util.List;
class HitCounter {
List<Integer> hits;
/** Initialize your data structure here. */
public HitCounter() {
hits = new ArrayList<>();
}
/** Record a hit.
@param timestamp - The current timestamp (in seconds granularity). */
public void hit(int timestamp) {
hits.add(timestamp);
}
/** Return the number of hits in the past 5 minutes.
@param timestamp - The current timestamp (in seconds granularity). */
public int getHits(int timestamp) {
int h = 0;
timestamp = timestamp - 300;
for (int i = hits.size() - 1; i >= 0; i--) {
if (hits.get(i) > timestamp)
h++;
}
return h;
}
} | [
"mavinkurve@gmail.com"
] | mavinkurve@gmail.com |
358eb4215a77262874c40128889132b2746b1ec8 | 3c37060bf034c7a415096280fc3653998943198b | /compiler/HW6/java_cup/emit.java | 200c3a863d5032c78c1701cf119f4dbf770f07d9 | [] | no_license | msbanik/compiler | 8dcfe875c2123dd9a8f057add17dc7d44af26978 | a1468a384e8a7e3f6e01adff2dc8e52cd11c7738 | refs/heads/master | 2021-01-23T16:29:57.630042 | 2013-06-20T05:41:04 | 2013-06-20T05:41:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 35,707 | java | package java_cup;
import java.io.PrintWriter;
import java.util.Date;
import java.util.Enumeration;
import java.util.Stack;
/**
* This class handles emitting generated code for the resulting parser.
* The various parse tables must be constructed, etc. before calling any
* routines in this class.<p>
* <p/>
* Three classes are produced by this code:
* <dl>
* <dt> symbol constant class
* <dd> this contains constant declarations for each terminal (and
* optionally each non-terminal).
* <dt> action class
* <dd> this non-public class contains code to invoke all the user actions
* that were embedded in the parser specification.
* <dt> parser class
* <dd> the specialized parser class consisting primarily of some user
* supplied general and initialization code, and the parse tables.
* </dl><p>
* <p/>
* Three parse tables are created as part of the parser class:
* <dl>
* <dt> production table
* <dd> lists the LHS non terminal number, and the length of the RHS of
* each production.
* <dt> action table
* <dd> for each state of the parse machine, gives the action to be taken
* (shift, reduce, or error) under each lookahead symbol.<br>
* <dt> reduce-goto table
* <dd> when a reduce on a given production is taken, the parse stack is
* popped back a number of elements corresponding to the RHS of the
* production. This reveals a prior state, which we transition out
* of under the LHS non terminal symbol for the production (as if we
* had seen the LHS symbol rather than all the symbols matching the
* RHS). This table is indexed by non terminal numbers and indicates
* how to make these transitions.
* </dl><p>
* <p/>
* In addition to the method interface, this class maintains a series of
* public global variables and flags indicating how misc. parts of the code
* and other output is to be produced, and counting things such as number of
* conflicts detected (see the source code and public variables below for
* more details).<p>
* <p/>
* This class is "static" (contains only static data and methods).<p>
*
* @author Scott Hudson
* @version last update: 11/25/95
* @see java_cup.main
*/
/* Major externally callable routines here include:
symbols - emit the symbol constant class
parser - emit the parser class
In addition the following major internal routines are provided:
emit_package - emit a package declaration
emit_action_code - emit the class containing the user's actions
emit_production_table - emit declaration and init for the production table
do_action_table - emit declaration and init for the action table
do_reduce_table - emit declaration and init for the reduce-goto table
Finally, this class uses a number of public instance variables to communicate
optional parameters and flags used to control how code is generated,
as well as to report counts of various things (such as number of conflicts
detected). These include:
prefix - a prefix string used to prefix names that would
otherwise "pollute" someone else's name space.
package_name - name of the package emitted code is placed in
(or null for an unnamed package.
symbol_const_class_name - name of the class containing symbol constants.
parser_class_name - name of the class for the resulting parser.
action_code - user supplied declarations and other code to be
placed in action class.
parser_code - user supplied declarations and other code to be
placed in parser class.
init_code - user supplied code to be executed as the parser
is being initialized.
scan_code - user supplied code to get the next Symbol.
start_production - the start production for the grammar.
import_list - list of imports for use with action class.
num_conflicts - number of conflicts detected.
nowarn - true if we are not to issue warning messages.
not_reduced - count of number of productions that never reduce.
unused_term - count of unused terminal symbols.
unused_non_term - count of unused non terminal symbols.
*_time - a series of symbols indicating how long various
sub-parts of code generation took (used to produce
optional time reports in main).
*/
public class emit {
/*-----------------------------------------------------------*/
/*--- Constructor(s) ----------------------------------------*/
/*-----------------------------------------------------------*/
/**
* Only constructor is private so no instances can be created.
*/
private emit() {
}
/*-----------------------------------------------------------*/
/*--- Static (Class) Variables ------------------------------*/
/*-----------------------------------------------------------*/
/**
* The prefix placed on names that pollute someone else's name space.
*/
public static String prefix = "CUP$";
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Package that the resulting code goes into (null is used for unnamed).
*/
public static String package_name = null;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Name of the generated class for symbol constants.
*/
public static String symbol_const_class_name = "sym";
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Name of the generated parser class.
*/
public static String parser_class_name = "parser";
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* User declarations for direct inclusion in user action class.
*/
public static String action_code = null;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* User declarations for direct inclusion in parser class.
*/
public static String parser_code = null;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* User code for user_init() which is called during parser initialization.
*/
public static String init_code = null;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* User code for scan() which is called to get the next Symbol.
*/
public static String scan_code = null;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* The start production of the grammar.
*/
public static production start_production = null;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* List of imports (Strings containing class names) to go with actions.
*/
public static Stack import_list = new Stack();
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Number of conflict found while building tables.
*/
public static int num_conflicts = 0;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Do we skip warnings?
*/
public static boolean nowarn = false;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Count of the number on non-reduced productions found.
*/
public static int not_reduced = 0;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Count of unused terminals.
*/
public static int unused_term = 0;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Count of unused non terminals.
*/
public static int unused_non_term = 0;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/* Timing values used to produce timing report in main.*/
/**
* Time to produce symbol constant class.
*/
public static long symbols_time = 0;
/**
* Time to produce parser class.
*/
public static long parser_time = 0;
/**
* Time to produce action code class.
*/
public static long action_code_time = 0;
/**
* Time to produce the production table.
*/
public static long production_table_time = 0;
/**
* Time to produce the action table.
*/
public static long action_table_time = 0;
/**
* Time to produce the reduce-goto table.
*/
public static long goto_table_time = 0;
/* frankf 6/18/96 */
protected static boolean _lr_values;
/**
* whether or not to emit code for left and right values
*/
public static boolean lr_values() {
return _lr_values;
}
protected static void set_lr_values(boolean b) {
_lr_values = b;
}
/*-----------------------------------------------------------*/
/*--- General Methods ---------------------------------------*/
/*-----------------------------------------------------------*/
/**
* Build a string with the standard prefix.
*
* @param str string to prefix.
*/
protected static String pre(String str) {
return prefix + parser_class_name + "$" + str;
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Emit a package spec if the user wants one.
*
* @param out stream to produce output on.
*/
protected static void emit_package(PrintWriter out) {
/* generate a package spec if we have a name for one */
if (package_name != null) {
out.println("package " + package_name + ";");
out.println();
}
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Emit code for the symbol constant class, optionally including non terms,
* if they have been requested.
*
* @param out stream to produce output on.
* @param emit_non_terms do we emit constants for non terminals?
* @param sym_interface should we emit an interface, rather than a class?
*/
public static void symbols(PrintWriter out,
boolean emit_non_terms, boolean sym_interface) {
terminal term;
non_terminal nt;
String class_or_interface = (sym_interface) ? "interface" : "class";
long start_time = System.currentTimeMillis();
/* top of file */
out.println();
out.println("//----------------------------------------------------");
out.println("// The following code was generated by " +
version.title_str);
out.println("// " + new Date());
out.println("//----------------------------------------------------");
out.println();
emit_package(out);
/* class header */
out.println("/** CUP generated " + class_or_interface +
" containing symbol constants. */");
out.println("public " + class_or_interface + " " +
symbol_const_class_name + " {");
out.println(" /* terminals */");
/* walk over the terminals */ /* later might sort these */
for (Enumeration e = terminal.all(); e.hasMoreElements(); ) {
term = (terminal) e.nextElement();
/* output a constant decl for the terminal */
out.println(" public static final int " + term.name() + " = " +
term.index() + ";");
}
/* do the non terminals if they want them (parser doesn't need them) */
if (emit_non_terms) {
out.println();
out.println(" /* non terminals */");
/* walk over the non terminals */ /* later might sort these */
for (Enumeration e = non_terminal.all(); e.hasMoreElements(); ) {
nt = (non_terminal) e.nextElement();
/* output a constant decl for the terminal */
out.println(" static final int " + nt.name() + " = " +
nt.index() + ";");
}
}
/* end of class */
out.println("}");
out.println();
symbols_time = System.currentTimeMillis() - start_time;
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Emit code for the non-public class holding the actual action code.
*
* @param out stream to produce output on.
* @param start_prod the start production of the grammar.
*/
protected static void emit_action_code(PrintWriter out, production start_prod)
throws internal_error {
production prod;
long start_time = System.currentTimeMillis();
/* class header */
out.println();
out.println(
"/** Cup generated class to encapsulate user supplied action code.*/"
);
out.println("class " + pre("actions") + " {");
/* user supplied code */
if (action_code != null) {
out.println();
out.println(action_code);
}
/* field for parser object */
out.println(" private final " + parser_class_name + " parser;");
/* constructor */
out.println();
out.println(" /** Constructor */");
out.println(" " + pre("actions") + "(" + parser_class_name + " parser) {");
out.println(" this.parser = parser;");
out.println(" }");
/* action method head */
out.println();
out.println(" /** Method with the actual generated action code. */");
out.println(" public final java_cup.runtime.Symbol " +
pre("do_action") + "(");
out.println(" int " + pre("act_num,"));
out.println(" java_cup.runtime.lr_parser " + pre("parser,"));
out.println(" java.util.Stack " + pre("stack,"));
out.println(" int " + pre("top)"));
out.println(" throws java.lang.Exception");
out.println(" {");
/* declaration of result symbol */
/* New declaration!! now return Symbol
6/13/96 frankf */
out.println(" /* Symbol object for return from actions */");
out.println(" java_cup.runtime.Symbol " + pre("result") + ";");
out.println();
/* switch top */
out.println(" /* select the action based on the action number */");
out.println(" switch (" + pre("act_num") + ")");
out.println(" {");
/* emit action code for each production as a separate case */
for (Enumeration p = production.all(); p.hasMoreElements(); ) {
prod = (production) p.nextElement();
/* case label */
out.println(" /*. . . . . . . . . . . . . . . . . . . .*/");
out.println(" case " + prod.index() + ": // " +
prod.to_simple_string());
/* give them their own block to work in */
out.println(" {");
/* create the result symbol */
/*make the variable RESULT which will point to the new Symbol (see below)
and be changed by action code
6/13/96 frankf */
out.println(" " + prod.lhs().the_symbol().stack_type() +
" RESULT = null;");
/* Add code to propagate RESULT assignments that occur in
* action code embedded in a production (ie, non-rightmost
* action code). 24-Mar-1998 CSA
*/
for (int i = 0; i < prod.rhs_length(); i++) {
// only interested in non-terminal symbols.
if (!(prod.rhs(i) instanceof symbol_part)) continue;
symbol s = ((symbol_part) prod.rhs(i)).the_symbol();
if (!(s instanceof non_terminal)) continue;
// skip this non-terminal unless it corresponds to
// an embedded action production.
if (((non_terminal) s).is_embedded_action == false) continue;
// OK, it fits. Make a conditional assignment to RESULT.
int index = prod.rhs_length() - i - 1; // last rhs is on top.
out.println(" " + "// propagate RESULT from " +
s.name());
out.println(" " + "if ( " +
"((java_cup.runtime.Symbol) " + emit.pre("stack") + ".elementAt("
+ emit.pre("top") + "-" + index + ")).value != null )");
out.println(" " + "RESULT = " +
"(" + prod.lhs().the_symbol().stack_type() + ") " +
"((java_cup.runtime.Symbol) " + emit.pre("stack") + ".elementAt("
+ emit.pre("top") + "-" + index + ")).value;");
}
/* if there is an action string, emit it */
if (prod.action() != null && prod.action().code_string() != null &&
!prod.action().equals(""))
out.println(prod.action().code_string());
/* here we have the left and right values being propagated.
must make this a command line option.
frankf 6/18/96 */
/* Create the code that assigns the left and right values of
the new Symbol that the production is reducing to */
if (emit.lr_values()) {
int loffset;
String leftstring, rightstring;
int roffset = 0;
rightstring = "((java_cup.runtime.Symbol)" + emit.pre("stack") + ".elementAt(" +
emit.pre("top") + "-" + roffset + ")).right";
if (prod.rhs_length() == 0)
leftstring = rightstring;
else {
loffset = prod.rhs_length() - 1;
leftstring = "((java_cup.runtime.Symbol)" + emit.pre("stack") + ".elementAt(" +
emit.pre("top") + "-" + loffset + ")).left";
}
out.println(" " + pre("result") + " = new java_cup.runtime.Symbol(" +
prod.lhs().the_symbol().index() + "/*" +
prod.lhs().the_symbol().name() + "*/" +
", " + leftstring + ", " + rightstring + ", RESULT);");
} else {
out.println(" " + pre("result") + " = new java_cup.runtime.Symbol(" +
prod.lhs().the_symbol().index() + "/*" +
prod.lhs().the_symbol().name() + "*/" +
", RESULT);");
}
/* end of their block */
out.println(" }");
/* if this was the start production, do action for accept */
if (prod == start_prod) {
out.println(" /* ACCEPT */");
out.println(" " + pre("parser") + ".done_parsing();");
}
/* code to return lhs symbol */
out.println(" return " + pre("result") + ";");
out.println();
}
/* end of switch */
out.println(" /* . . . . . .*/");
out.println(" default:");
out.println(" throw new Exception(");
out.println(" \"Invalid action number found in " +
"internal parse table\");");
out.println();
out.println(" }");
/* end of method */
out.println(" }");
/* end of class */
out.println("}");
out.println();
action_code_time = System.currentTimeMillis() - start_time;
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Emit the production table.
*
* @param out stream to produce output on.
*/
protected static void emit_production_table(PrintWriter out) {
production all_prods[];
production prod;
long start_time = System.currentTimeMillis();
/* collect up the productions in order */
all_prods = new production[production.number()];
for (Enumeration p = production.all(); p.hasMoreElements(); ) {
prod = (production) p.nextElement();
all_prods[prod.index()] = prod;
}
// make short[][]
short[][] prod_table = new short[production.number()][2];
for (int i = 0; i < production.number(); i++) {
prod = all_prods[i];
// { lhs symbol , rhs size }
prod_table[i][0] = (short) prod.lhs().the_symbol().index();
prod_table[i][1] = (short) prod.rhs_length();
}
/* do the top of the table */
out.println();
out.println(" /** Production table. */");
out.println(" protected static final short _production_table[][] = ");
out.print(" unpackFromStrings(");
do_table_as_string(out, prod_table);
out.println(");");
/* do the public accessor method */
out.println();
out.println(" /** Access to production table. */");
out.println(" public short[][] production_table() " +
"{return _production_table;}");
production_table_time = System.currentTimeMillis() - start_time;
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Emit the action table.
*
* @param out stream to produce output on.
* @param act_tab the internal representation of the action table.
* @param compact_reduces do we use the most frequent reduce as default?
*/
protected static void do_action_table(
PrintWriter out,
parse_action_table act_tab,
boolean compact_reduces)
throws internal_error {
parse_action_row row;
parse_action act;
int red;
long start_time = System.currentTimeMillis();
/* collect values for the action table */
short[][] action_table = new short[act_tab.num_states()][];
/* do each state (row) of the action table */
for (int i = 0; i < act_tab.num_states(); i++) {
/* get the row */
row = act_tab.under_state[i];
/* determine the default for the row */
if (compact_reduces)
row.compute_default();
else
row.default_reduce = -1;
/* make temporary table for the row. */
short[] temp_table = new short[2 * row.size()];
int nentries = 0;
/* do each column */
for (int j = 0; j < row.size(); j++) {
/* extract the action from the table */
act = row.under_term[j];
/* skip error entries these are all defaulted out */
if (act.kind() != parse_action.ERROR) {
/* first put in the symbol index, then the actual entry */
/* shifts get positive entries of state number + 1 */
if (act.kind() == parse_action.SHIFT) {
/* make entry */
temp_table[nentries++] = (short) j;
temp_table[nentries++] = (short)
(((shift_action) act).shift_to().index() + 1);
}
/* reduce actions get negated entries of production# + 1 */
else if (act.kind() == parse_action.REDUCE) {
/* if its the default entry let it get defaulted out */
red = ((reduce_action) act).reduce_with().index();
if (red != row.default_reduce) {
/* make entry */
temp_table[nentries++] = (short) j;
temp_table[nentries++] = (short) (-(red + 1));
}
} else if (act.kind() == parse_action.NONASSOC) {
/* do nothing, since we just want a syntax error */
}
/* shouldn't be anything else */
else
throw new internal_error("Unrecognized action code " +
act.kind() + " found in parse table");
}
}
/* now we know how big to make the row */
action_table[i] = new short[nentries + 2];
System.arraycopy(temp_table, 0, action_table[i], 0, nentries);
/* finish off the row with a default entry */
action_table[i][nentries++] = -1;
if (row.default_reduce != -1)
action_table[i][nentries++] = (short) (-(row.default_reduce + 1));
else
action_table[i][nentries++] = 0;
}
/* finish off the init of the table */
out.println();
out.println(" /** Parse-action table. */");
out.println(" protected static final short[][] _action_table = ");
out.print(" unpackFromStrings(");
do_table_as_string(out, action_table);
out.println(");");
/* do the public accessor method */
out.println();
out.println(" /** Access to parse-action table. */");
out.println(" public short[][] action_table() {return _action_table;}");
action_table_time = System.currentTimeMillis() - start_time;
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Emit the reduce-goto table.
*
* @param out stream to produce output on.
* @param red_tab the internal representation of the reduce-goto table.
*/
protected static void do_reduce_table(
PrintWriter out,
parse_reduce_table red_tab) {
lalr_state goto_st;
parse_action act;
long start_time = System.currentTimeMillis();
/* collect values for reduce-goto table */
short[][] reduce_goto_table = new short[red_tab.num_states()][];
/* do each row of the reduce-goto table */
for (int i = 0; i < red_tab.num_states(); i++) {
/* make temporary table for the row. */
short[] temp_table = new short[2 * red_tab.under_state[i].size()];
int nentries = 0;
/* do each entry in the row */
for (int j = 0; j < red_tab.under_state[i].size(); j++) {
/* get the entry */
goto_st = red_tab.under_state[i].under_non_term[j];
/* if we have none, skip it */
if (goto_st != null) {
/* make entries for the index and the value */
temp_table[nentries++] = (short) j;
temp_table[nentries++] = (short) goto_st.index();
}
}
/* now we know how big to make the row. */
reduce_goto_table[i] = new short[nentries + 2];
System.arraycopy(temp_table, 0, reduce_goto_table[i], 0, nentries);
/* end row with default value */
reduce_goto_table[i][nentries++] = -1;
reduce_goto_table[i][nentries++] = -1;
}
/* emit the table. */
out.println();
out.println(" /** <code>reduce_goto</code> table. */");
out.println(" protected static final short[][] _reduce_table = ");
out.print(" unpackFromStrings(");
do_table_as_string(out, reduce_goto_table);
out.println(");");
/* do the public accessor method */
out.println();
out.println(" /** Access to <code>reduce_goto</code> table. */");
out.println(" public short[][] reduce_table() {return _reduce_table;}");
out.println();
goto_table_time = System.currentTimeMillis() - start_time;
}
// print a string array encoding the given short[][] array.
protected static void do_table_as_string(PrintWriter out, short[][] sa) {
out.println("new String[] {");
out.print(" \"");
int nchar = 0, nbytes = 0;
nbytes += do_escaped(out, (char) (sa.length >> 16));
nchar = do_newline(out, nchar, nbytes);
nbytes += do_escaped(out, (char) (sa.length & 0xFFFF));
nchar = do_newline(out, nchar, nbytes);
for (int i = 0; i < sa.length; i++) {
nbytes += do_escaped(out, (char) (sa[i].length >> 16));
nchar = do_newline(out, nchar, nbytes);
nbytes += do_escaped(out, (char) (sa[i].length & 0xFFFF));
nchar = do_newline(out, nchar, nbytes);
for (int j = 0; j < sa[i].length; j++) {
// contents of string are (value+2) to allow for common -1, 0 cases
// (UTF-8 encoding is most efficient for 0<c<0x80)
nbytes += do_escaped(out, (char) (2 + sa[i][j]));
nchar = do_newline(out, nchar, nbytes);
}
}
out.print("\" }");
}
// split string if it is very long; start new line occasionally for neatness
protected static int do_newline(PrintWriter out, int nchar, int nbytes) {
if (nbytes > 65500) {
out.println("\", ");
out.print(" \"");
} else if (nchar > 11) {
out.println("\" +");
out.print(" \"");
} else return nchar + 1;
return 0;
}
// output an escape sequence for the given character code.
protected static int do_escaped(PrintWriter out, char c) {
StringBuffer escape = new StringBuffer();
if (c <= 0xFF) {
escape.append(Integer.toOctalString(c));
while (escape.length() < 3) escape.insert(0, '0');
} else {
escape.append(Integer.toHexString(c));
while (escape.length() < 4) escape.insert(0, '0');
escape.insert(0, 'u');
}
escape.insert(0, '\\');
out.print(escape.toString());
// return number of bytes this takes up in UTF-8 encoding.
if (c == 0) return 2;
if (c >= 0x01 && c <= 0x7F) return 1;
if (c >= 0x80 && c <= 0x7FF) return 2;
return 3;
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/**
* Emit the parser subclass with embedded tables.
*
* @param out stream to produce output on.
* @param action_table internal representation of the action table.
* @param reduce_table internal representation of the reduce-goto table.
* @param start_st start state of the parse machine.
* @param start_prod start production of the grammar.
* @param compact_reduces do we use most frequent reduce as default?
* @param suppress_scanner should scanner be suppressed for compatibility?
*/
public static void parser(
PrintWriter out,
parse_action_table action_table,
parse_reduce_table reduce_table,
int start_st,
production start_prod,
boolean compact_reduces,
boolean suppress_scanner)
throws internal_error {
long start_time = System.currentTimeMillis();
/* top of file */
out.println();
out.println("//----------------------------------------------------");
out.println("// The following code was generated by " +
version.title_str);
out.println("// " + new Date());
out.println("//----------------------------------------------------");
out.println();
emit_package(out);
/* user supplied imports */
for (int i = 0; i < import_list.size(); i++)
out.println("import " + import_list.elementAt(i) + ";");
/* class header */
out.println();
out.println("/** " + version.title_str + " generated parser.");
out.println(" * @version " + new Date());
out.println(" */");
out.println("public class " + parser_class_name +
" extends java_cup.runtime.lr_parser {");
/* constructors [CSA/davidm, 24-jul-99] */
out.println();
out.println(" /** Default constructor. */");
out.println(" public " + parser_class_name + "() {super();}");
if (!suppress_scanner) {
out.println();
out.println(" /** Constructor which sets the default scanner. */");
out.println(" public " + parser_class_name +
"(java_cup.runtime.Scanner s) {super(s);}");
}
/* emit the various tables */
emit_production_table(out);
do_action_table(out, action_table, compact_reduces);
do_reduce_table(out, reduce_table);
/* instance of the action encapsulation class */
out.println(" /** Instance of action encapsulation class. */");
out.println(" protected " + pre("actions") + " action_obj;");
out.println();
/* action object initializer */
out.println(" /** Action encapsulation object initializer. */");
out.println(" protected void init_actions()");
out.println(" {");
out.println(" action_obj = new " + pre("actions") + "(this);");
out.println(" }");
out.println();
/* access to action code */
out.println(" /** Invoke a user supplied parse action. */");
out.println(" public java_cup.runtime.Symbol do_action(");
out.println(" int act_num,");
out.println(" java_cup.runtime.lr_parser parser,");
out.println(" java.util.Stack stack,");
out.println(" int top)");
out.println(" throws java.lang.Exception");
out.println(" {");
out.println(" /* call code in generated class */");
out.println(" return action_obj." + pre("do_action(") +
"act_num, parser, stack, top);");
out.println(" }");
out.println("");
/* method to tell the parser about the start state */
out.println(" /** Indicates start state. */");
out.println(" public int start_state() {return " + start_st + ";}");
/* method to indicate start production */
out.println(" /** Indicates start production. */");
out.println(" public int start_production() {return " +
start_production.index() + ";}");
out.println();
/* methods to indicate EOF and error symbol indexes */
out.println(" /** <code>EOF</code> Symbol index. */");
out.println(" public int EOF_sym() {return " + terminal.EOF.index() +
";}");
out.println();
out.println(" /** <code>error</code> Symbol index. */");
out.println(" public int error_sym() {return " + terminal.error.index() +
";}");
out.println();
/* user supplied code for user_init() */
if (init_code != null) {
out.println();
out.println(" /** User initialization code. */");
out.println(" public void user_init() throws java.lang.Exception");
out.println(" {");
out.println(init_code);
out.println(" }");
}
/* user supplied code for scan */
if (scan_code != null) {
out.println();
out.println(" /** Scan to get the next Symbol. */");
out.println(" public java_cup.runtime.Symbol scan()");
out.println(" throws java.lang.Exception");
out.println(" {");
out.println(scan_code);
out.println(" }");
}
/* user supplied code */
if (parser_code != null) {
out.println();
out.println(parser_code);
}
/* end of class */
out.println("}");
/* put out the action code class */
emit_action_code(out, start_prod);
parser_time = System.currentTimeMillis() - start_time;
}
/*-----------------------------------------------------------*/
}
| [
"msbanik@gmail.com"
] | msbanik@gmail.com |
7d3c3be9f0dc3acc986c4a3f1325aea1973059ec | 5a1c44f16955ee7bb1dcecc2cb12728a655becd9 | /app/src/main/java/com/example/finalproject/MainActivity.java | 851bb6821208bd8c6fa4fb42a77f6fa3c5c13f2d | [] | no_license | ZmichZaelT/final-project | 7584de96cccabc9b51bb22c3cc515eeed178b913 | 0623c487db74b690cd876c890b269e4ab188edfa | refs/heads/master | 2020-09-23T14:47:52.401641 | 2019-12-03T03:42:34 | 2019-12-03T03:42:34 | 225,524,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,352 | java | package com.example.finalproject;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
Button startgame = findViewById(R.id.startgame);
startgame.setOnClickListener(unused -> {
Intent intent = new Intent(this, GameAvtivity.class);
startActivity(intent);
finish();
});
}
}
| [
"55122684+ZmichZaelT@users.noreply.github.com"
] | 55122684+ZmichZaelT@users.noreply.github.com |
6c86360e2a6415d22bb0f8a10740fa5bec700161 | 7f714da6d3dbf6aed386e02c8b27956b9aa9b7c9 | /src/main/java/org/emamotor/morecat/admin/common/filter/LoginPageFilter.java | c0adfa3b791affa21d1aaeb8089aa86eddb1d28f | [] | no_license | jarnaiz/morecat_old | c62ece711438e7ff0d5de0a12e643538ac899947 | e9a10fa17aa657714a81ede2d097ddc8bb8d4c07 | refs/heads/master | 2021-01-11T02:39:29.442908 | 2014-11-05T11:23:25 | 2014-11-05T11:23:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,300 | java | package org.emamotor.morecat.admin.common.filter;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* To prevent user from going back to Login page if the user already logged in
*
* @author tanabe
*/
@WebFilter(urlPatterns = "/mc-admin/login.xhtml")
public class LoginPageFilter implements Filter {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
if (request.getUserPrincipal() != null) {
response.sendRedirect(request.getContextPath() + "/mc-admin/overview/view.xhtml");
} else {
filterChain.doFilter(servletRequest, servletResponse);
}
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void destroy() {
}
}
| [
"lanabe.lanabe@gmail.com"
] | lanabe.lanabe@gmail.com |
dd82af09bd5274966380ee3051bd2ab7521b0d36 | 0e30f234a830c8e1ba78687d36eab01ab81f492b | /org.jpat.scuba.analysisprovider.static.bcel/src/main/java/org/jpat/scuba/analysisprovider/statica/bcel/model/BCELStaticFANChallenge.java | 64b9a1c9cebf4d9e5dd3a95804d4f0097aa7b17a | [
"MIT"
] | permissive | JPAT-ROSEMARY/SCUBA | 6b724d070b12f70cf68386c3f830448435714af1 | 0d7dcee9e62e724af8dc006e1399d5c3e7b77dd1 | refs/heads/master | 2022-07-23T05:06:54.121412 | 2021-04-04T21:14:29 | 2021-04-04T21:14:29 | 39,628,474 | 2 | 1 | MIT | 2022-06-29T18:54:38 | 2015-07-24T11:13:38 | HTML | UTF-8 | Java | false | false | 352 | java | package org.jpat.scuba.analysisprovider.statica.bcel.model;
import org.jpat.scuba.core.model.FANChallenge;
import de.schlichtherle.truezip.file.TFile;
public final class BCELStaticFANChallenge extends FANChallenge
{
public BCELStaticFANChallenge(final TFile file, final String name)
{
super(file, name, "BCEL Static SCUBA");
}
}
| [
"rosemary@localhost.localdomain"
] | rosemary@localhost.localdomain |
d7e0653ea5387e9305cc2f8adfb6cc488feedf7c | 99c5e754de15d86e0ce8b4efab4376c4d894f877 | /target/generated-sources/xjc/org/mayCourse/FullCountryInfo.java | b5ab50e15a2067e3321765cec3b7b18fb1502521 | [] | no_license | nagendraalavala/user-service | 273f1fac726ce92e5b21208eeb26e6da5ac4c39a | d56917d4bb4bb256e32d06e3ed735b5c17e3dbef | refs/heads/master | 2022-06-21T02:14:52.943835 | 2020-05-14T20:37:02 | 2020-05-14T20:37:02 | 263,652,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,900 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2020.05.15 at 01:51:27 AM IST
//
package org.mayCourse;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="sCountryISOCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sCountryISOCode"
})
@XmlRootElement(name = "FullCountryInfo")
public class FullCountryInfo {
@XmlElement(required = true)
protected String sCountryISOCode;
/**
* Gets the value of the sCountryISOCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSCountryISOCode() {
return sCountryISOCode;
}
/**
* Sets the value of the sCountryISOCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSCountryISOCode(String value) {
this.sCountryISOCode = value;
}
}
| [
"nagendra.alavala@gmail.com"
] | nagendra.alavala@gmail.com |
15c7c75dd13c860c4e1319f182106953e7f5295c | 796defc8fca6e9351b4bc3b1ef6c86734e4e9599 | /ticket82/src/main/java/com/ticket/service/impl/AdminServiceImpl.java | 6158e4d8aab47fc3ecd7bff393497e186ab714db | [] | no_license | silhouette222/pjticket | 83b6d79fb18cf012522a49c1acec40a86fd7e6bc | 2bdf1a2dec39b138aeb6b51cd893d2054a7c9e4e | refs/heads/master | 2021-04-28T16:01:45.003764 | 2018-04-09T08:04:50 | 2018-04-09T08:04:50 | 122,005,445 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | package com.ticket.service.impl;
import java.sql.SQLException;
import com.ticket.dao.AdminDAO;
import com.ticket.domain.AdminVO;
import com.ticket.service.AdminService;
public class AdminServiceImpl implements AdminService {
private AdminDAO adminDAO;
public void setAdminDAO(AdminDAO adminDAO){
this.adminDAO=adminDAO;
}
@Override
public AdminVO getAdminById(String am_id) throws SQLException {
AdminVO admin=adminDAO.selectAdminById(am_id);
return admin;
}
@Override
public AdminVO login(String am_id) throws SQLException {
AdminVO admin=adminDAO.selectAdminById(am_id);
return admin;
}
}
| [
"sw2-11@sw2-11-PC"
] | sw2-11@sw2-11-PC |
e015c53c9e6402d5f8b3217d0d0524a93723ed02 | 4e4e5d8b9b46fad963443929bba3950f7ff9e518 | /java/com/sdcards/greenit/greenit/ModelActivity.java | 2e7d1c6c9dc7a5f3bd05be8cf858a0f9972f2826 | [] | no_license | jsshack15/greenit | 4d005e8ebe56c5f62089071dcc151c465f996a90 | 22c00fdb3fa736eb4d94bdf0b172e01eb148d6ff | refs/heads/master | 2021-01-10T09:25:37.393681 | 2015-11-22T04:08:04 | 2015-11-22T04:08:04 | 46,609,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | package com.sdcards.greenit.greenit;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.ListView;
public class ModelActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_model);
String options[] = {"model"};
ListAdapter bobsAdapter = new CustomAdapter(this, options);
ListView modelList = (ListView) findViewById(R.id.modelList);
modelList.setAdapter(bobsAdapter);
}
}
| [
"gneha.bob@gmail.com"
] | gneha.bob@gmail.com |
b1d6ed2ac09e0c98fd48853397372c6d8dcb30a1 | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdas/applicationModule/src/test/java/applicationModulepackageJava14/Foo43Test.java | 2dbab2716160fd1f668edb4c65809f7562c9e631 | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 475 | java | package applicationModulepackageJava14;
import org.junit.Test;
public class Foo43Test {
@Test
public void testFoo0() {
new Foo43().foo0();
}
@Test
public void testFoo1() {
new Foo43().foo1();
}
@Test
public void testFoo2() {
new Foo43().foo2();
}
@Test
public void testFoo3() {
new Foo43().foo3();
}
@Test
public void testFoo4() {
new Foo43().foo4();
}
@Test
public void testFoo5() {
new Foo43().foo5();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
02419f66adf1315483a63c259dde1d764bba6b82 | 678a3d58c110afd1e9ce195d2f20b2531d45a2e0 | /sources/com/airbnb/android/cohosting/epoxycontrollers/CohostingInvitationErrorEpoxyController_EpoxyHelper.java | 69facf239079cc73493a2cf30220bb84bdce4cc2 | [] | no_license | jasonnth/AirCode | d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5 | d37db1baa493fca56f390c4205faf5c9bbe36604 | refs/heads/master | 2020-07-03T08:35:24.902940 | 2019-08-12T03:34:56 | 2019-08-12T03:34:56 | 201,842,970 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package com.airbnb.android.cohosting.epoxycontrollers;
import com.airbnb.android.core.viewcomponents.models.HeroMarqueeEpoxyModel_;
import com.airbnb.epoxy.ControllerHelper;
public class CohostingInvitationErrorEpoxyController_EpoxyHelper extends ControllerHelper<CohostingInvitationErrorEpoxyController> {
private final CohostingInvitationErrorEpoxyController controller;
public CohostingInvitationErrorEpoxyController_EpoxyHelper(CohostingInvitationErrorEpoxyController controller2) {
this.controller = controller2;
}
public void resetAutoModels() {
this.controller.marquee = new HeroMarqueeEpoxyModel_();
this.controller.marquee.m4690id(-1);
setControllerToStageTo(this.controller.marquee, this.controller);
}
}
| [
"thanhhuu2apc@gmail.com"
] | thanhhuu2apc@gmail.com |
54c95caaee3e52214593c83e675fd65b6dc9a00b | 1a4bff3acbfbb479c7daaf5058f562a4c13dcb19 | /src/enums/LevelEnum.java | 752356d6ed33e6cb4ae968c48f52b3d2a433a1bb | [] | no_license | aykutaaykut/HadiCezmi | 8fadc6fbec6d24ed4b4649cab3b28da34a3477ab | d56c0dfcbcccb6a04ce2abef185362d627631217 | refs/heads/master | 2020-09-09T06:48:28.869391 | 2020-05-06T10:43:41 | 2020-05-06T10:43:41 | 94,441,497 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 59 | java | package enums;
public enum LevelEnum {
LEVEL1, LEVEL2
}
| [
"aykut09aykut@gmail.com"
] | aykut09aykut@gmail.com |
4e398f0ec711bf0fe3b29be8316ce3d9565971e3 | e1081211081f7039693b54897dbf8eefa31a1d93 | /ThreadPractice.java | ddf2c40ab984d95a7ca504a532baf6667e171383 | [] | no_license | nitinchauhan235/GitHubBasics | 5fbe55095b812fc697ffc621e068e025b370ee90 | ec096e405585b95b76039660df748f9a7a11b9da | refs/heads/master | 2023-06-23T18:43:58.340547 | 2021-07-25T07:34:56 | 2021-07-25T07:34:56 | 387,152,894 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 825 | java |
//public class ThreadPractice extends Thread
// By implementing runnable interafce
public class ThreadPractice extends Thread
{
public void run()
{
for(int i=1;i<=5;i++)
{
System.out.println(i);
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public void finalize()
{
System.out.println("garbage collected");
}
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
// ThreadPractice t1 = new ThreadPractice();
// t1.start();
ThreadPractice t1 = new ThreadPractice();
ThreadPractice t2 = new ThreadPractice();
ThreadPractice t3 = new ThreadPractice();
t1.start();
t1.join();
t2.start();
t3.start();
System.gc();
}
}
| [
"nitinchauhan86@gmail.com"
] | nitinchauhan86@gmail.com |
33fa3eab39d2244329b54b247153f260bade37fb | 993b263a9b9bca14360babd4cbd3066dda45fd71 | /src/main/java/com/ntt/dtoConverter/DTOToEntityOrder.java | a264271bc9a67a2aef5faece9b4f806f23070b3c | [] | no_license | harshithatapse/PharmacyStoreApplication | 09fe2cf7d8478a5c823348bfa73db258bba1b71c | 99c7af5be1bbbd015218a953b109f3c41821f0d2 | refs/heads/master | 2023-04-03T01:03:37.281438 | 2021-04-19T07:26:29 | 2021-04-19T07:26:29 | 359,363,389 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,258 | java | package com.ntt.dtoConverter;
import java.util.HashSet;
import java.util.Set;
import com.ntt.dto.OrderDTO;
import com.ntt.dto.ProductOrdersDTO;
import com.ntt.model.Order;
import com.ntt.model.ProductOrders;
public class DTOToEntityOrder {
public static Order buildOrderEntity(OrderDTO orderDTO) {
Order order = new Order();
//order.setOrderId(orderDTO.getOrderId());
order.setAddress(orderDTO.getAddress());
order.setOrderDate(orderDTO.getOrderDate());
order.setDeliverDate(orderDTO.getDeliverDate());
order.setUserId(orderDTO.getUserId());
order.setTotalAmount(orderDTO.getTotalAmount());
Set<ProductOrdersDTO> productOrdersDTO = orderDTO.getProductOrdersDTOSet();
Set<ProductOrders> productOrdersSet = new HashSet<>();
for(ProductOrdersDTO productOrderDTO:productOrdersDTO)
{
ProductOrders productOrders = new ProductOrders();
//productOrders.setOrderLine(productOrderDTO.getOrderLine());
productOrders.setOrder(order);
productOrders.setProductId(productOrderDTO.getProductId());
productOrders.setQuantity(productOrderDTO.getQuantity());
productOrdersSet.add(productOrders);
}
order.setProductOrders(productOrdersSet);
return order;
}
}
| [
"41188171+harshithatapse@users.noreply.github.com"
] | 41188171+harshithatapse@users.noreply.github.com |
9aa6fa3cfbc09a1618ed7f7ce16109bfbfdba5fb | 2c6e2ba03eb71ca45fe690ff6e4586f6e2fa0f17 | /material/apks/banco/sources/ar/com/santander/rio/mbanking/services/soap/beans/body/RefInternaDeudaBean.java | ecafc5e4b7f3e3caa029d8aeea9431af0a489cbe | [] | no_license | lcrcastor/curso-mobile-2019 | 3088a196139b3e980ed6e09797a0bbf5efb6440b | 7585fccb6437a17c841772c1d9fb0701d6c68042 | refs/heads/master | 2023-04-06T21:46:32.333236 | 2020-10-30T19:47:54 | 2020-10-30T19:47:54 | 308,680,747 | 0 | 1 | null | 2023-03-26T06:57:57 | 2020-10-30T16:08:31 | Java | UTF-8 | Java | false | false | 1,243 | java | package ar.com.santander.rio.mbanking.services.soap.beans.body;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.google.gson.annotations.SerializedName;
public class RefInternaDeudaBean implements Parcelable {
public static final Creator<RefInternaDeudaBean> CREATOR = new Creator<RefInternaDeudaBean>() {
public RefInternaDeudaBean createFromParcel(Parcel parcel) {
return new RefInternaDeudaBean(parcel);
}
public RefInternaDeudaBean[] newArray(int i) {
return new RefInternaDeudaBean[i];
}
};
@SerializedName("leyenda")
public String leyenda;
@SerializedName("valor")
public String valor;
public int describeContents() {
return 0;
}
public RefInternaDeudaBean() {
}
public RefInternaDeudaBean(String str, String str2) {
this.leyenda = str;
this.valor = str2;
}
protected RefInternaDeudaBean(Parcel parcel) {
this.leyenda = parcel.readString();
this.valor = parcel.readString();
}
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(this.leyenda);
parcel.writeString(this.valor);
}
}
| [
"luis@MARK-2.local"
] | luis@MARK-2.local |
74d9604eaf1e4d9c7b55771bd2d22104f92d9063 | 3f19788d243f52f99e41954a9e6c98afcbb80823 | /Implementation/[17276] 배열 돌리기.java | 133cbdbea4a6d99d49125fb0cde5c46f9c1701ab | [] | no_license | devsfirst/BaekjoonOnlineJudge | 0ff84ec5cf23ba7d9f7f06176bc5b284fe2d1341 | 7d32054fe7a932ddda40ff256a67ef7450f2c163 | refs/heads/main | 2023-05-02T20:19:19.454193 | 2021-05-22T08:22:56 | 2021-05-22T08:22:56 | 324,514,779 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,210 | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
StringBuilder sb = new StringBuilder();
for (int i = 0; i < T; i++) {
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
int d = Integer.parseInt(st.nextToken());
int[][] X = new int[n + 1][n + 1];
boolean clockwise = d > 0;
d = Math.abs(d / 45);
for (int r = 1; r <= n; r++) {
st = new StringTokenizer(br.readLine());
for (int c = 1; c <= n; c++) {
X[r][c] = Integer.parseInt(st.nextToken());
}
}
int center = (n + 1) / 2;
for (int j = 0; j < d; j++) {
int[][] newX = new int[n + 1][n + 1];
if (clockwise) {
for (int k = 1; k <= n; k++) {
//X의 주 대각선을 ((1,1), (2,2), …, (n, n)) 가운데 열 ((n+1)/2 번째 열)로 옮긴다.
newX[k][center] = X[k][k];
//X의 가운데 열을 X의 부 대각선으로 ((n, 1), (n-1, 2), …, (1, n)) 옮긴다.
newX[k][n + 1 - k] = X[k][center];
//X의 부 대각선을 X의 가운데 행 ((n+1)/2번째 행)으로 옮긴다.
newX[center][k] = X[n + 1 - k][k];
//X의 가운데 행을 X의 주 대각선으로 옮긴다.
newX[k][k] = X[center][k];
}
} else {
for (int k = 1; k <= n; k++) {
//X의 주 대각선을 ((1,1), (2,2), …, (n, n)) 가운데 행 ((n+1)/2 번째 행)으로 옮긴다.
newX[center][k] = X[k][k];
//X의 가운데 열을 X의 주 대각선으로 ((1, 1), (2, 2), …, (n, n)) 옮긴다.
newX[k][k] = X[k][center];
//X의 부 대각선을 X의 가운데 열 ((n+1)/2번째 열)로 옮긴다.
newX[n + 1 - k][center] = X[n + 1 - k][k];
//X의 가운데 행을 X의 부 대각선으로 옮긴다.
newX[n + 1 - k][k] = X[center][k];
}
}
//X의 다른 원소의 위치는 변하지 않는다.
for (int r = 1; r <= n; r++) {
for (int c = 1; c <= n; c++) {
if (newX[r][c] == 0) newX[r][c] = X[r][c];
}
}
X = newX;
}
for (int r = 1; r <= n; r++) {
for (int c = 1; c <= n; c++) {
sb.append(X[r][c]).append(" ");
}
sb.append("\n");
}
}
System.out.println(sb.toString());
}
} | [
"seokjh7172@naver.com"
] | seokjh7172@naver.com |
4d04c67dd52e8d147db2c2987d67cabb8d420220 | 507a5c6f36db65cc1213ad28d55d3038ede75ba0 | /app/src/main/java/com/example/myapplication/data/source/MedicineRepository.java | 684ae7b49a4c3e489ce6ca987690e978c158599b | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | chris9797/CardiacCare | 70d44d09a362d0356349e92d1ae6026a151b3771 | f27258e9402b1892655dfa34907121c8d338f63f | refs/heads/master | 2020-05-16T20:20:30.058161 | 2019-04-24T18:34:38 | 2019-04-24T18:34:38 | 183,280,466 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,196 | java | package com.example.myapplication.data.source;
import android.support.annotation.NonNull;
import java.util.List;
public class MedicineRepository implements MedicineDataSource {
private static MedicineRepository mInstance = null;
private final MedicineDataSource localDataSource;
private MedicineRepository(@NonNull MedicineDataSource localDataSource) {
this.localDataSource = localDataSource;
}
public static MedicineRepository getInstance(MedicineDataSource localDataSource) {
if (mInstance == null) {
mInstance = new MedicineRepository(localDataSource);
}
return mInstance;
}
@Override
public void getMedicineHistory(final LoadHistoryCallbacks loadHistoryCallbacks) {
localDataSource.getMedicineHistory(new LoadHistoryCallbacks() {
@Override
public void onHistoryLoaded(List<History> historyList) {
loadHistoryCallbacks.onHistoryLoaded(historyList);
}
@Override
public void onDataNotAvailable() {
loadHistoryCallbacks.onDataNotAvailable();
}
});
}
@Override
public void getMedicineAlarmById(long id, final GetTaskCallback callback) {
localDataSource.getMedicineAlarmById(id, new GetTaskCallback() {
@Override
public void onTaskLoaded(MedicineAlarm medicineAlarm) {
if (medicineAlarm == null) {
return;
}
callback.onTaskLoaded(medicineAlarm);
}
@Override
public void onDataNotAvailable() {
callback.onDataNotAvailable();
}
});
}
@Override
public void saveMedicine(MedicineAlarm medicineAlarm, Pills pills) {
localDataSource.saveMedicine(medicineAlarm, pills);
}
@Override
public void getMedicineListByDay(int day, final LoadMedicineCallbacks callbacks) {
localDataSource.getMedicineListByDay(day, new LoadMedicineCallbacks() {
@Override
public void onMedicineLoaded(List<MedicineAlarm> medicineAlarmList) {
callbacks.onMedicineLoaded(medicineAlarmList);
}
@Override
public void onDataNotAvailable() {
callbacks.onDataNotAvailable();
}
});
}
@Override
public boolean medicineExits(String pillName) {
return false;
}
@Override
public List<Long> tempIds() {
return null;
}
@Override
public void deleteAlarm(long alarmId) {
localDataSource.deleteAlarm(alarmId);
}
@Override
public List<MedicineAlarm> getMedicineByPillName(String pillName) {
return localDataSource.getMedicineByPillName(pillName);
}
@Override
public Pills getPillsByName(String pillName) {
return localDataSource.getPillsByName(pillName);
}
@Override
public long savePills(Pills pills) {
return localDataSource.savePills(pills);
}
@Override
public void saveToHistory(History history) {
localDataSource.saveToHistory(history);
}
}
| [
"christens97@gmail.com"
] | christens97@gmail.com |
2bd741eb53cec31612c319568d997a77a344d559 | e3084a4ea6b23553fef20d947d6682c6cc6a5e0a | /src/graphs/ListGraph.java | 31373c82468b9d9e59173ebbd9a28b0858b074e8 | [] | no_license | tjernquist/KartProgramJava | 2aa13d2ed3b804fc132e647f3e60bf8fe0dcf158 | 118fa80256a92c4539cd7ee590399653a821fbcf | refs/heads/master | 2021-01-10T02:35:35.515372 | 2015-12-05T20:42:55 | 2015-12-05T20:42:55 | 47,471,743 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,962 | java | package graphs;
import java.util.*;
public class ListGraph<N> implements Graph<N> {
private Map<N, List<Edge<N>>> nodes = new HashMap<>();
public Edge<N> getEdgeBetween(N s1, N s2) {
Edge<N> förbindelse = null;
if (!nodes.containsKey(s1) || !nodes.containsKey(s2)) {
throw new NoSuchElementException("Staden " + s2 + " och/eller staden " + s1 + " finns inte");
}
for (Edge<N> e : nodes.get(s1)) {
if (e.getDestination().equals(s2) == true) {
förbindelse = e;
}
}
return förbindelse;
}
public void add(N ny) {
if (nodes.containsKey(ny)) {
throw new IllegalArgumentException("Stad finns redan");
}
nodes.put(ny, new ArrayList<Edge<N>>());
}
public void connect(N from, N to, String namn, int vikt) {
if (from == null || to == null) {
throw new IllegalArgumentException("En av noderna är null");
}
if (!nodes.containsKey(from) || !nodes.containsKey(to)) {
throw new NoSuchElementException("En eller både noder fattas");
}
if (vikt < 0) {
throw new IllegalArgumentException("Vikten får inte vara negativ");
}
if (getEdgeBetween(from, to) != null) {
throw new IllegalStateException("Det finns redan en connection mellan de två platserna");
}
List<Edge<N>> toList = nodes.get(to);
List<Edge<N>> fromList = nodes.get(from);
if (fromList == null || toList == null) { //kanske ta bort
throw new NoSuchElementException("Ingen konnektion");
}
Edge<N> e1 = new Edge<>(to, namn, vikt);
Edge<N> e2 = new Edge<>(from, namn, vikt);
fromList.add(e1);
toList.add(e2);
}
public void setConnectionWeight(N from, N to, int nyVikt) {
if (nyVikt < 0) {
throw new IllegalArgumentException("Vikt får inte vara negativ!");
}
Edge<N> e1 = getEdgeBetween(to, from);
Edge<N> e2 = getEdgeBetween(from, to);
if (e1 == null || e2 == null) {
throw new NoSuchElementException("Det finns ingen förbindelse mellan noderna");
}
e1.setWeight(nyVikt);
e2.setWeight(nyVikt);
}
@Override
public List<Edge<N>> getEdgesFrom(N from) {
if (nodes.containsKey(from)) {
return nodes.get(from);
} else {
throw new NoSuchElementException("Elementet " + from + " finns ej!");
}
}
public Set<N> getNodes() {
return nodes.keySet();
}
public String toString() {
String str = "";
for (Map.Entry<N, List<Edge<N>>> me : nodes.entrySet()) {
str += me.getKey() + ": ";
for (Edge e : me.getValue()) {
str += e.toString() + " ";
}
str += "\n";
}
return str;
}
}
| [
"adamtjernquist@msn.com"
] | adamtjernquist@msn.com |
25c43cf269c5fbca4472117ed452699132a681e2 | 59a1c9a75f6d82a8872499bee3f4c0e62e4cbb99 | /src/com/javarush/test/level12/lesson12/home04/Solution.java | 7888e7eb349dd3b9bc135e7e8ba1c585ec28235b | [] | no_license | Mistes/MyRep | 9dbfcfc391510be739dca19ced3eafcc52a43444 | 1700a6f1c04f31a40a9dc1312f7a9125f61e7119 | refs/heads/master | 2020-04-06T04:12:20.857417 | 2016-10-11T08:01:16 | 2016-10-11T08:01:16 | 57,094,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,270 | java | package com.javarush.test.level12.lesson12.home04;
/* Что это? «Кот», «Тигр», «Лев», «Бык», «хз»
Напиши метод, который определяет, какой объект передали в него.
Программа должна выводить на экран одну из надписей:
«Кот», «Тигр», «Лев», «Бык», «хз».
*/
public class Solution
{
public static void main(String[] args)
{
System.out.println(getObjectType(new Cat()));
System.out.println(getObjectType(new Tiger()));
System.out.println(getObjectType(new Lion()));
System.out.println(getObjectType(new Bull()));
System.out.println(getObjectType(new Pig()));
}
public static String getObjectType(Object o)
{
if (o instanceof Cat){return "Кот";}
else if (o instanceof Tiger){return "Тигр";}
if (o instanceof Lion){return "Лев";}
if (o instanceof Bull){return "Бык";}
else
return "хз";
}
public static class Cat
{
}
public static class Tiger
{
}
public static class Lion
{
}
public static class Bull
{
}
public static class Pig
{
}
}
| [
"kurilenko.dm@gmail.com"
] | kurilenko.dm@gmail.com |
3a864fafeff4dba0ff57e62a3faeddc1b04fab89 | 3fdbcacd504ec47874cc1e8be9ccdb6d7b54957a | /src/CalculatorMain/MVCCalculator.java | 459f31a9bf9733eca84da7ceac8e5e890b6d28ab | [] | no_license | kgb48/Calculator | e020e1e0f3a7350aa54e629e5501e0e3f348889f | 45aa3798928a54aaceb8d932b75624d98f45bd01 | refs/heads/master | 2021-01-23T02:15:54.271417 | 2016-03-15T01:12:08 | 2016-03-15T01:12:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 898 | java | package CalculatorMain;
import java.io.IOException;
import Client.CalculatorClient;
import CompositeServer.CalculatorServer;
import mvc.CalculatorController;
public class MVCCalculator {
public static void main(String[] args) {
CalculatorController controller = new CalculatorController();
controller.start();
Thread serverThread = new Thread() {
public void run() {
CalculatorServer server = new CalculatorServer(5000);
try {
server.start();
} catch (IOException e) {
e.printStackTrace();
}
}
};
Thread clientThread = new Thread() {
public void run() {
CalculatorClient client = new CalculatorClient("localhost", 5000);
client.start();
try {
client.readResponse();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
serverThread.start();
clientThread.start();
}
}
| [
"renju467@gmail.com"
] | renju467@gmail.com |
5fcb56bf569809c1dba60e10d0c04d813d0b200b | 21d61898e3df30950afc424619d660dbd1a9bd16 | /src/main/java/com/ezreal/demo/handler/GlobalExceptionHandler.java | 336403cfb1a0486d48f612c1354690bc499d0827 | [] | no_license | Enjoylone1y/WebApiDemo | c574086c208540fa7b8223c75f8817e3320d9bd8 | 62eba51faa3ebcf725e89f365be3ba844b576838 | refs/heads/master | 2021-04-06T00:18:01.518371 | 2018-03-15T09:22:58 | 2018-03-15T09:22:58 | 125,342,105 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | package com.ezreal.demo.handler;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* 异常处理类
* 一般而言,针对不同业务,不同 exception 编写不同的处理方法
* 同时,将exception信息写入日志保存
*/
@ControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(value = Exception.class)
@ResponseBody
public Map<String,Object> exceptionHandler(HttpServletRequest request,Exception e){
Map<String,Object> result = new HashMap<>();
result.put("success",false);
result.put("errMsg",e.getMessage());
return result;
}
}
| [
"747568825@qq.com"
] | 747568825@qq.com |
ae62cb0f1a2cc3d57f48c64aac9beefdd94f9a9f | 386392a0b910c55fdfc9c6f9f7798793404e6a8e | /src/com/android/messaging/util/exif/ExifParser.java | 4b6cf681a7f3948e81da7c33e76abceb96204a4b | [] | no_license | CyanogenMod/android_packages_apps_Messaging | c7ecdb8f6999b612bf1066014e641ec9c569f53b | d5fc4ce8c407e94dce2c013d94f643289b7a1a5c | refs/heads/cm-13.0 | 2021-01-17T01:48:47.750950 | 2016-12-22T01:19:35 | 2016-12-22T01:19:35 | 45,417,877 | 14 | 74 | null | 2016-11-27T12:08:08 | 2015-11-02T19:46:08 | Java | UTF-8 | Java | false | false | 34,459 | java | /*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.messaging.util.exif;
import android.util.Log;
import com.android.messaging.util.LogUtil;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.Map.Entry;
import java.util.TreeMap;
/**
* This class provides a low-level EXIF parsing API. Given a JPEG format
* InputStream, the caller can request which IFD's to read via
* {@link #parse(java.io.InputStream, int)} with given options.
* <p>
* Below is an example of getting EXIF data from IFD 0 and EXIF IFD using the
* parser.
*
* <pre>
* void parse() {
* ExifParser parser = ExifParser.parse(mImageInputStream,
* ExifParser.OPTION_IFD_0 | ExifParser.OPTIONS_IFD_EXIF);
* int event = parser.next();
* while (event != ExifParser.EVENT_END) {
* switch (event) {
* case ExifParser.EVENT_START_OF_IFD:
* break;
* case ExifParser.EVENT_NEW_TAG:
* ExifTag tag = parser.getTag();
* if (!tag.hasValue()) {
* parser.registerForTagValue(tag);
* } else {
* processTag(tag);
* }
* break;
* case ExifParser.EVENT_VALUE_OF_REGISTERED_TAG:
* tag = parser.getTag();
* if (tag.getDataType() != ExifTag.TYPE_UNDEFINED) {
* processTag(tag);
* }
* break;
* }
* event = parser.next();
* }
* }
*
* void processTag(ExifTag tag) {
* // process the tag as you like.
* }
* </pre>
*/
public class ExifParser {
private static final boolean LOGV = false;
private static final String TAG = LogUtil.BUGLE_TAG;
/**
* When the parser reaches a new IFD area. Call {@link #getCurrentIfd()} to
* know which IFD we are in.
*/
public static final int EVENT_START_OF_IFD = 0;
/**
* When the parser reaches a new tag. Call {@link #getTag()}to get the
* corresponding tag.
*/
public static final int EVENT_NEW_TAG = 1;
/**
* When the parser reaches the value area of tag that is registered by
* {@link #registerForTagValue(ExifTag)} previously. Call {@link #getTag()}
* to get the corresponding tag.
*/
public static final int EVENT_VALUE_OF_REGISTERED_TAG = 2;
/**
* When the parser reaches the compressed image area.
*/
public static final int EVENT_COMPRESSED_IMAGE = 3;
/**
* When the parser reaches the uncompressed image strip. Call
* {@link #getStripIndex()} to get the index of the strip.
*
* @see #getStripIndex()
* @see #getStripCount()
*/
public static final int EVENT_UNCOMPRESSED_STRIP = 4;
/**
* When there is nothing more to parse.
*/
public static final int EVENT_END = 5;
/**
* Option bit to request to parse IFD0.
*/
public static final int OPTION_IFD_0 = 1 << 0;
/**
* Option bit to request to parse IFD1.
*/
public static final int OPTION_IFD_1 = 1 << 1;
/**
* Option bit to request to parse Exif-IFD.
*/
public static final int OPTION_IFD_EXIF = 1 << 2;
/**
* Option bit to request to parse GPS-IFD.
*/
public static final int OPTION_IFD_GPS = 1 << 3;
/**
* Option bit to request to parse Interoperability-IFD.
*/
public static final int OPTION_IFD_INTEROPERABILITY = 1 << 4;
/**
* Option bit to request to parse thumbnail.
*/
public static final int OPTION_THUMBNAIL = 1 << 5;
protected static final int EXIF_HEADER = 0x45786966; // EXIF header "Exif"
protected static final short EXIF_HEADER_TAIL = (short) 0x0000; // EXIF header in APP1
// TIFF header
protected static final short LITTLE_ENDIAN_TAG = (short) 0x4949; // "II"
protected static final short BIG_ENDIAN_TAG = (short) 0x4d4d; // "MM"
protected static final short TIFF_HEADER_TAIL = 0x002A;
protected static final int TAG_SIZE = 12;
protected static final int OFFSET_SIZE = 2;
private static final Charset US_ASCII = Charset.forName("US-ASCII");
protected static final int DEFAULT_IFD0_OFFSET = 8;
private final CountedDataInputStream mTiffStream;
private final int mOptions;
private int mIfdStartOffset = 0;
private int mNumOfTagInIfd = 0;
private int mIfdType;
private ExifTag mTag;
private ImageEvent mImageEvent;
private int mStripCount;
private ExifTag mStripSizeTag;
private ExifTag mJpegSizeTag;
private boolean mNeedToParseOffsetsInCurrentIfd;
private boolean mContainExifData = false;
private int mApp1End;
private int mOffsetToApp1EndFromSOF = 0;
private byte[] mDataAboveIfd0;
private int mIfd0Position;
private int mTiffStartPosition;
private final ExifInterface mInterface;
private static final short TAG_EXIF_IFD = ExifInterface
.getTrueTagKey(ExifInterface.TAG_EXIF_IFD);
private static final short TAG_GPS_IFD = ExifInterface.getTrueTagKey(ExifInterface.TAG_GPS_IFD);
private static final short TAG_INTEROPERABILITY_IFD = ExifInterface
.getTrueTagKey(ExifInterface.TAG_INTEROPERABILITY_IFD);
private static final short TAG_JPEG_INTERCHANGE_FORMAT = ExifInterface
.getTrueTagKey(ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT);
private static final short TAG_JPEG_INTERCHANGE_FORMAT_LENGTH = ExifInterface
.getTrueTagKey(ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH);
private static final short TAG_STRIP_OFFSETS = ExifInterface
.getTrueTagKey(ExifInterface.TAG_STRIP_OFFSETS);
private static final short TAG_STRIP_BYTE_COUNTS = ExifInterface
.getTrueTagKey(ExifInterface.TAG_STRIP_BYTE_COUNTS);
private final TreeMap<Integer, Object> mCorrespondingEvent = new TreeMap<Integer, Object>();
private boolean isIfdRequested(int ifdType) {
switch (ifdType) {
case IfdId.TYPE_IFD_0:
return (mOptions & OPTION_IFD_0) != 0;
case IfdId.TYPE_IFD_1:
return (mOptions & OPTION_IFD_1) != 0;
case IfdId.TYPE_IFD_EXIF:
return (mOptions & OPTION_IFD_EXIF) != 0;
case IfdId.TYPE_IFD_GPS:
return (mOptions & OPTION_IFD_GPS) != 0;
case IfdId.TYPE_IFD_INTEROPERABILITY:
return (mOptions & OPTION_IFD_INTEROPERABILITY) != 0;
}
return false;
}
private boolean isThumbnailRequested() {
return (mOptions & OPTION_THUMBNAIL) != 0;
}
private ExifParser(InputStream inputStream, int options, ExifInterface iRef)
throws IOException, ExifInvalidFormatException {
if (inputStream == null) {
throw new IOException("Null argument inputStream to ExifParser");
}
if (LOGV) {
Log.v(TAG, "Reading exif...");
}
mInterface = iRef;
mContainExifData = seekTiffData(inputStream);
mTiffStream = new CountedDataInputStream(inputStream);
mOptions = options;
if (!mContainExifData) {
return;
}
parseTiffHeader();
long offset = mTiffStream.readUnsignedInt();
if (offset > Integer.MAX_VALUE) {
throw new ExifInvalidFormatException("Invalid offset " + offset);
}
mIfd0Position = (int) offset;
mIfdType = IfdId.TYPE_IFD_0;
if (isIfdRequested(IfdId.TYPE_IFD_0) || needToParseOffsetsInCurrentIfd()) {
registerIfd(IfdId.TYPE_IFD_0, offset);
if (offset != DEFAULT_IFD0_OFFSET) {
mDataAboveIfd0 = new byte[(int) offset - DEFAULT_IFD0_OFFSET];
read(mDataAboveIfd0);
}
}
}
/**
* Parses the the given InputStream with the given options
*
* @exception java.io.IOException
* @exception ExifInvalidFormatException
*/
protected static ExifParser parse(InputStream inputStream, int options, ExifInterface iRef)
throws IOException, ExifInvalidFormatException {
return new ExifParser(inputStream, options, iRef);
}
/**
* Parses the the given InputStream with default options; that is, every IFD
* and thumbnaill will be parsed.
*
* @exception java.io.IOException
* @exception ExifInvalidFormatException
* @see #parse(java.io.InputStream, int)
*/
protected static ExifParser parse(InputStream inputStream, ExifInterface iRef)
throws IOException, ExifInvalidFormatException {
return new ExifParser(inputStream, OPTION_IFD_0 | OPTION_IFD_1
| OPTION_IFD_EXIF | OPTION_IFD_GPS | OPTION_IFD_INTEROPERABILITY
| OPTION_THUMBNAIL, iRef);
}
/**
* Moves the parser forward and returns the next parsing event
*
* @exception java.io.IOException
* @exception ExifInvalidFormatException
* @see #EVENT_START_OF_IFD
* @see #EVENT_NEW_TAG
* @see #EVENT_VALUE_OF_REGISTERED_TAG
* @see #EVENT_COMPRESSED_IMAGE
* @see #EVENT_UNCOMPRESSED_STRIP
* @see #EVENT_END
*/
protected int next() throws IOException, ExifInvalidFormatException {
if (!mContainExifData) {
return EVENT_END;
}
int offset = mTiffStream.getReadByteCount();
int endOfTags = mIfdStartOffset + OFFSET_SIZE + TAG_SIZE * mNumOfTagInIfd;
if (offset < endOfTags) {
mTag = readTag();
if (mTag == null) {
return next();
}
if (mNeedToParseOffsetsInCurrentIfd) {
checkOffsetOrImageTag(mTag);
}
return EVENT_NEW_TAG;
} else if (offset == endOfTags) {
// There is a link to ifd1 at the end of ifd0
if (mIfdType == IfdId.TYPE_IFD_0) {
long ifdOffset = readUnsignedLong();
if (isIfdRequested(IfdId.TYPE_IFD_1) || isThumbnailRequested()) {
if (ifdOffset != 0) {
registerIfd(IfdId.TYPE_IFD_1, ifdOffset);
}
}
} else {
int offsetSize = 4;
// Some camera models use invalid length of the offset
if (mCorrespondingEvent.size() > 0) {
offsetSize = mCorrespondingEvent.firstEntry().getKey() -
mTiffStream.getReadByteCount();
}
if (offsetSize < 4) {
Log.w(TAG, "Invalid size of link to next IFD: " + offsetSize);
} else {
long ifdOffset = readUnsignedLong();
if (ifdOffset != 0) {
Log.w(TAG, "Invalid link to next IFD: " + ifdOffset);
}
}
}
}
while (mCorrespondingEvent.size() != 0) {
Entry<Integer, Object> entry = mCorrespondingEvent.pollFirstEntry();
Object event = entry.getValue();
try {
skipTo(entry.getKey());
} catch (IOException e) {
Log.w(TAG, "Failed to skip to data at: " + entry.getKey() +
" for " + event.getClass().getName() + ", the file may be broken.");
continue;
}
if (event instanceof IfdEvent) {
mIfdType = ((IfdEvent) event).ifd;
mNumOfTagInIfd = mTiffStream.readUnsignedShort();
mIfdStartOffset = entry.getKey();
if (mNumOfTagInIfd * TAG_SIZE + mIfdStartOffset + OFFSET_SIZE > mApp1End) {
Log.w(TAG, "Invalid size of IFD " + mIfdType);
return EVENT_END;
}
mNeedToParseOffsetsInCurrentIfd = needToParseOffsetsInCurrentIfd();
if (((IfdEvent) event).isRequested) {
return EVENT_START_OF_IFD;
} else {
skipRemainingTagsInCurrentIfd();
}
} else if (event instanceof ImageEvent) {
mImageEvent = (ImageEvent) event;
return mImageEvent.type;
} else {
ExifTagEvent tagEvent = (ExifTagEvent) event;
mTag = tagEvent.tag;
if (mTag.getDataType() != ExifTag.TYPE_UNDEFINED) {
readFullTagValue(mTag);
checkOffsetOrImageTag(mTag);
}
if (tagEvent.isRequested) {
return EVENT_VALUE_OF_REGISTERED_TAG;
}
}
}
return EVENT_END;
}
/**
* Skips the tags area of current IFD, if the parser is not in the tag area,
* nothing will happen.
*
* @throws java.io.IOException
* @throws ExifInvalidFormatException
*/
protected void skipRemainingTagsInCurrentIfd() throws IOException, ExifInvalidFormatException {
int endOfTags = mIfdStartOffset + OFFSET_SIZE + TAG_SIZE * mNumOfTagInIfd;
int offset = mTiffStream.getReadByteCount();
if (offset > endOfTags) {
return;
}
if (mNeedToParseOffsetsInCurrentIfd) {
while (offset < endOfTags) {
mTag = readTag();
offset += TAG_SIZE;
if (mTag == null) {
continue;
}
checkOffsetOrImageTag(mTag);
}
} else {
skipTo(endOfTags);
}
long ifdOffset = readUnsignedLong();
// For ifd0, there is a link to ifd1 in the end of all tags
if (mIfdType == IfdId.TYPE_IFD_0
&& (isIfdRequested(IfdId.TYPE_IFD_1) || isThumbnailRequested())) {
if (ifdOffset > 0) {
registerIfd(IfdId.TYPE_IFD_1, ifdOffset);
}
}
}
private boolean needToParseOffsetsInCurrentIfd() {
switch (mIfdType) {
case IfdId.TYPE_IFD_0:
return isIfdRequested(IfdId.TYPE_IFD_EXIF) || isIfdRequested(IfdId.TYPE_IFD_GPS)
|| isIfdRequested(IfdId.TYPE_IFD_INTEROPERABILITY)
|| isIfdRequested(IfdId.TYPE_IFD_1);
case IfdId.TYPE_IFD_1:
return isThumbnailRequested();
case IfdId.TYPE_IFD_EXIF:
// The offset to interoperability IFD is located in Exif IFD
return isIfdRequested(IfdId.TYPE_IFD_INTEROPERABILITY);
default:
return false;
}
}
/**
* If {@link #next()} return {@link #EVENT_NEW_TAG} or
* {@link #EVENT_VALUE_OF_REGISTERED_TAG}, call this function to get the
* corresponding tag.
* <p>
* For {@link #EVENT_NEW_TAG}, the tag may not contain the value if the size
* of the value is greater than 4 bytes. One should call
* {@link ExifTag#hasValue()} to check if the tag contains value. If there
* is no value,call {@link #registerForTagValue(ExifTag)} to have the parser
* emit {@link #EVENT_VALUE_OF_REGISTERED_TAG} when it reaches the area
* pointed by the offset.
* <p>
* When {@link #EVENT_VALUE_OF_REGISTERED_TAG} is emitted, the value of the
* tag will have already been read except for tags of undefined type. For
* tags of undefined type, call one of the read methods to get the value.
*
* @see #registerForTagValue(ExifTag)
* @see #read(byte[])
* @see #read(byte[], int, int)
* @see #readLong()
* @see #readRational()
* @see #readString(int)
* @see #readString(int, java.nio.charset.Charset)
*/
protected ExifTag getTag() {
return mTag;
}
/**
* Gets number of tags in the current IFD area.
*/
protected int getTagCountInCurrentIfd() {
return mNumOfTagInIfd;
}
/**
* Gets the ID of current IFD.
*
* @see IfdId#TYPE_IFD_0
* @see IfdId#TYPE_IFD_1
* @see IfdId#TYPE_IFD_GPS
* @see IfdId#TYPE_IFD_INTEROPERABILITY
* @see IfdId#TYPE_IFD_EXIF
*/
protected int getCurrentIfd() {
return mIfdType;
}
/**
* When receiving {@link #EVENT_UNCOMPRESSED_STRIP}, call this function to
* get the index of this strip.
*
* @see #getStripCount()
*/
protected int getStripIndex() {
return mImageEvent.stripIndex;
}
/**
* When receiving {@link #EVENT_UNCOMPRESSED_STRIP}, call this function to
* get the number of strip data.
*
* @see #getStripIndex()
*/
protected int getStripCount() {
return mStripCount;
}
/**
* When receiving {@link #EVENT_UNCOMPRESSED_STRIP}, call this function to
* get the strip size.
*/
protected int getStripSize() {
if (mStripSizeTag == null) {
return 0;
}
return (int) mStripSizeTag.getValueAt(0);
}
/**
* When receiving {@link #EVENT_COMPRESSED_IMAGE}, call this function to get
* the image data size.
*/
protected int getCompressedImageSize() {
if (mJpegSizeTag == null) {
return 0;
}
return (int) mJpegSizeTag.getValueAt(0);
}
private void skipTo(int offset) throws IOException {
mTiffStream.skipTo(offset);
while (!mCorrespondingEvent.isEmpty() && mCorrespondingEvent.firstKey() < offset) {
mCorrespondingEvent.pollFirstEntry();
}
}
/**
* When getting {@link #EVENT_NEW_TAG} in the tag area of IFD, the tag may
* not contain the value if the size of the value is greater than 4 bytes.
* When the value is not available here, call this method so that the parser
* will emit {@link #EVENT_VALUE_OF_REGISTERED_TAG} when it reaches the area
* where the value is located.
*
* @see #EVENT_VALUE_OF_REGISTERED_TAG
*/
protected void registerForTagValue(ExifTag tag) {
if (tag.getOffset() >= mTiffStream.getReadByteCount()) {
mCorrespondingEvent.put(tag.getOffset(), new ExifTagEvent(tag, true));
}
}
private void registerIfd(int ifdType, long offset) {
// Cast unsigned int to int since the offset is always smaller
// than the size of APP1 (65536)
mCorrespondingEvent.put((int) offset, new IfdEvent(ifdType, isIfdRequested(ifdType)));
}
private void registerCompressedImage(long offset) {
mCorrespondingEvent.put((int) offset, new ImageEvent(EVENT_COMPRESSED_IMAGE));
}
private void registerUncompressedStrip(int stripIndex, long offset) {
mCorrespondingEvent.put((int) offset, new ImageEvent(EVENT_UNCOMPRESSED_STRIP
, stripIndex));
}
private ExifTag readTag() throws IOException, ExifInvalidFormatException {
short tagId = mTiffStream.readShort();
short dataFormat = mTiffStream.readShort();
long numOfComp = mTiffStream.readUnsignedInt();
if (numOfComp > Integer.MAX_VALUE) {
throw new ExifInvalidFormatException(
"Number of component is larger then Integer.MAX_VALUE");
}
// Some invalid image file contains invalid data type. Ignore those tags
if (!ExifTag.isValidType(dataFormat)) {
Log.w(TAG, String.format("Tag %04x: Invalid data type %d", tagId, dataFormat));
mTiffStream.skip(4);
return null;
}
// TODO: handle numOfComp overflow
ExifTag tag = new ExifTag(tagId, dataFormat, (int) numOfComp, mIfdType,
((int) numOfComp) != ExifTag.SIZE_UNDEFINED);
int dataSize = tag.getDataSize();
if (dataSize > 4) {
long offset = mTiffStream.readUnsignedInt();
if (offset > Integer.MAX_VALUE) {
throw new ExifInvalidFormatException(
"offset is larger then Integer.MAX_VALUE");
}
// Some invalid images put some undefined data before IFD0.
// Read the data here.
if ((offset < mIfd0Position) && (dataFormat == ExifTag.TYPE_UNDEFINED)) {
byte[] buf = new byte[(int) numOfComp];
System.arraycopy(mDataAboveIfd0, (int) offset - DEFAULT_IFD0_OFFSET,
buf, 0, (int) numOfComp);
tag.setValue(buf);
} else {
tag.setOffset((int) offset);
}
} else {
boolean defCount = tag.hasDefinedCount();
// Set defined count to 0 so we can add \0 to non-terminated strings
tag.setHasDefinedCount(false);
// Read value
readFullTagValue(tag);
tag.setHasDefinedCount(defCount);
mTiffStream.skip(4 - dataSize);
// Set the offset to the position of value.
tag.setOffset(mTiffStream.getReadByteCount() - 4);
}
return tag;
}
/**
* Check the tag, if the tag is one of the offset tag that points to the IFD
* or image the caller is interested in, register the IFD or image.
*/
private void checkOffsetOrImageTag(ExifTag tag) {
// Some invalid formattd image contains tag with 0 size.
if (tag.getComponentCount() == 0) {
return;
}
short tid = tag.getTagId();
int ifd = tag.getIfd();
if (tid == TAG_EXIF_IFD && checkAllowed(ifd, ExifInterface.TAG_EXIF_IFD)) {
if (isIfdRequested(IfdId.TYPE_IFD_EXIF)
|| isIfdRequested(IfdId.TYPE_IFD_INTEROPERABILITY)) {
registerIfd(IfdId.TYPE_IFD_EXIF, tag.getValueAt(0));
}
} else if (tid == TAG_GPS_IFD && checkAllowed(ifd, ExifInterface.TAG_GPS_IFD)) {
if (isIfdRequested(IfdId.TYPE_IFD_GPS)) {
registerIfd(IfdId.TYPE_IFD_GPS, tag.getValueAt(0));
}
} else if (tid == TAG_INTEROPERABILITY_IFD
&& checkAllowed(ifd, ExifInterface.TAG_INTEROPERABILITY_IFD)) {
if (isIfdRequested(IfdId.TYPE_IFD_INTEROPERABILITY)) {
registerIfd(IfdId.TYPE_IFD_INTEROPERABILITY, tag.getValueAt(0));
}
} else if (tid == TAG_JPEG_INTERCHANGE_FORMAT
&& checkAllowed(ifd, ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT)) {
if (isThumbnailRequested()) {
registerCompressedImage(tag.getValueAt(0));
}
} else if (tid == TAG_JPEG_INTERCHANGE_FORMAT_LENGTH
&& checkAllowed(ifd, ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH)) {
if (isThumbnailRequested()) {
mJpegSizeTag = tag;
}
} else if (tid == TAG_STRIP_OFFSETS && checkAllowed(ifd, ExifInterface.TAG_STRIP_OFFSETS)) {
if (isThumbnailRequested()) {
if (tag.hasValue()) {
for (int i = 0; i < tag.getComponentCount(); i++) {
if (tag.getDataType() == ExifTag.TYPE_UNSIGNED_SHORT) {
registerUncompressedStrip(i, tag.getValueAt(i));
} else {
registerUncompressedStrip(i, tag.getValueAt(i));
}
}
} else {
mCorrespondingEvent.put(tag.getOffset(), new ExifTagEvent(tag, false));
}
}
} else if (tid == TAG_STRIP_BYTE_COUNTS
&& checkAllowed(ifd, ExifInterface.TAG_STRIP_BYTE_COUNTS)
&& isThumbnailRequested() && tag.hasValue()) {
mStripSizeTag = tag;
}
}
private boolean checkAllowed(int ifd, int tagId) {
int info = mInterface.getTagInfo().get(tagId);
if (info == ExifInterface.DEFINITION_NULL) {
return false;
}
return ExifInterface.isIfdAllowed(info, ifd);
}
protected void readFullTagValue(ExifTag tag) throws IOException {
// Some invalid images contains tags with wrong size, check it here
short type = tag.getDataType();
if (type == ExifTag.TYPE_ASCII || type == ExifTag.TYPE_UNDEFINED ||
type == ExifTag.TYPE_UNSIGNED_BYTE) {
int size = tag.getComponentCount();
if (mCorrespondingEvent.size() > 0) {
if (mCorrespondingEvent.firstEntry().getKey() < mTiffStream.getReadByteCount()
+ size) {
Object event = mCorrespondingEvent.firstEntry().getValue();
if (event instanceof ImageEvent) {
// Tag value overlaps thumbnail, ignore thumbnail.
Log.w(TAG, "Thumbnail overlaps value for tag: \n" + tag.toString());
Entry<Integer, Object> entry = mCorrespondingEvent.pollFirstEntry();
Log.w(TAG, "Invalid thumbnail offset: " + entry.getKey());
} else {
// Tag value overlaps another tag, shorten count
if (event instanceof IfdEvent) {
Log.w(TAG, "Ifd " + ((IfdEvent) event).ifd
+ " overlaps value for tag: \n" + tag.toString());
} else if (event instanceof ExifTagEvent) {
Log.w(TAG, "Tag value for tag: \n"
+ ((ExifTagEvent) event).tag.toString()
+ " overlaps value for tag: \n" + tag.toString());
}
size = mCorrespondingEvent.firstEntry().getKey()
- mTiffStream.getReadByteCount();
Log.w(TAG, "Invalid size of tag: \n" + tag.toString()
+ " setting count to: " + size);
tag.forceSetComponentCount(size);
}
}
}
}
switch (tag.getDataType()) {
case ExifTag.TYPE_UNSIGNED_BYTE:
case ExifTag.TYPE_UNDEFINED: {
byte buf[] = new byte[tag.getComponentCount()];
read(buf);
tag.setValue(buf);
}
break;
case ExifTag.TYPE_ASCII:
tag.setValue(readString(tag.getComponentCount()));
break;
case ExifTag.TYPE_UNSIGNED_LONG: {
long value[] = new long[tag.getComponentCount()];
for (int i = 0, n = value.length; i < n; i++) {
value[i] = readUnsignedLong();
}
tag.setValue(value);
}
break;
case ExifTag.TYPE_UNSIGNED_RATIONAL: {
Rational value[] = new Rational[tag.getComponentCount()];
for (int i = 0, n = value.length; i < n; i++) {
value[i] = readUnsignedRational();
}
tag.setValue(value);
}
break;
case ExifTag.TYPE_UNSIGNED_SHORT: {
int value[] = new int[tag.getComponentCount()];
for (int i = 0, n = value.length; i < n; i++) {
value[i] = readUnsignedShort();
}
tag.setValue(value);
}
break;
case ExifTag.TYPE_LONG: {
int value[] = new int[tag.getComponentCount()];
for (int i = 0, n = value.length; i < n; i++) {
value[i] = readLong();
}
tag.setValue(value);
}
break;
case ExifTag.TYPE_RATIONAL: {
Rational value[] = new Rational[tag.getComponentCount()];
for (int i = 0, n = value.length; i < n; i++) {
value[i] = readRational();
}
tag.setValue(value);
}
break;
}
if (LOGV) {
Log.v(TAG, "\n" + tag.toString());
}
}
private void parseTiffHeader() throws IOException,
ExifInvalidFormatException {
short byteOrder = mTiffStream.readShort();
if (LITTLE_ENDIAN_TAG == byteOrder) {
mTiffStream.setByteOrder(ByteOrder.LITTLE_ENDIAN);
} else if (BIG_ENDIAN_TAG == byteOrder) {
mTiffStream.setByteOrder(ByteOrder.BIG_ENDIAN);
} else {
throw new ExifInvalidFormatException("Invalid TIFF header");
}
if (mTiffStream.readShort() != TIFF_HEADER_TAIL) {
throw new ExifInvalidFormatException("Invalid TIFF header");
}
}
private boolean seekTiffData(InputStream inputStream) throws IOException,
ExifInvalidFormatException {
CountedDataInputStream dataStream = new CountedDataInputStream(inputStream);
if (dataStream.readShort() != JpegHeader.SOI) {
throw new ExifInvalidFormatException("Invalid JPEG format");
}
short marker = dataStream.readShort();
while (marker != JpegHeader.EOI
&& !JpegHeader.isSofMarker(marker)) {
int length = dataStream.readUnsignedShort();
// Some invalid formatted image contains multiple APP1,
// try to find the one with Exif data.
if (marker == JpegHeader.APP1) {
int header = 0;
short headerTail = 0;
if (length >= 8) {
header = dataStream.readInt();
headerTail = dataStream.readShort();
length -= 6;
if (header == EXIF_HEADER && headerTail == EXIF_HEADER_TAIL) {
mTiffStartPosition = dataStream.getReadByteCount();
mApp1End = length;
mOffsetToApp1EndFromSOF = mTiffStartPosition + mApp1End;
return true;
}
}
}
if (length < 2 || (length - 2) != dataStream.skip(length - 2)) {
Log.w(TAG, "Invalid JPEG format.");
return false;
}
marker = dataStream.readShort();
}
return false;
}
protected int getOffsetToExifEndFromSOF() {
return mOffsetToApp1EndFromSOF;
}
protected int getTiffStartPosition() {
return mTiffStartPosition;
}
/**
* Reads bytes from the InputStream.
*/
protected int read(byte[] buffer, int offset, int length) throws IOException {
return mTiffStream.read(buffer, offset, length);
}
/**
* Equivalent to read(buffer, 0, buffer.length).
*/
protected int read(byte[] buffer) throws IOException {
return mTiffStream.read(buffer);
}
/**
* Reads a String from the InputStream with US-ASCII charset. The parser
* will read n bytes and convert it to ascii string. This is used for
* reading values of type {@link ExifTag#TYPE_ASCII}.
*/
protected String readString(int n) throws IOException {
return readString(n, US_ASCII);
}
/**
* Reads a String from the InputStream with the given charset. The parser
* will read n bytes and convert it to string. This is used for reading
* values of type {@link ExifTag#TYPE_ASCII}.
*/
protected String readString(int n, Charset charset) throws IOException {
if (n > 0) {
return mTiffStream.readString(n, charset);
} else {
return "";
}
}
/**
* Reads value of type {@link ExifTag#TYPE_UNSIGNED_SHORT} from the
* InputStream.
*/
protected int readUnsignedShort() throws IOException {
return mTiffStream.readShort() & 0xffff;
}
/**
* Reads value of type {@link ExifTag#TYPE_UNSIGNED_LONG} from the
* InputStream.
*/
protected long readUnsignedLong() throws IOException {
return readLong() & 0xffffffffL;
}
/**
* Reads value of type {@link ExifTag#TYPE_UNSIGNED_RATIONAL} from the
* InputStream.
*/
protected Rational readUnsignedRational() throws IOException {
long nomi = readUnsignedLong();
long denomi = readUnsignedLong();
return new Rational(nomi, denomi);
}
/**
* Reads value of type {@link ExifTag#TYPE_LONG} from the InputStream.
*/
protected int readLong() throws IOException {
return mTiffStream.readInt();
}
/**
* Reads value of type {@link ExifTag#TYPE_RATIONAL} from the InputStream.
*/
protected Rational readRational() throws IOException {
int nomi = readLong();
int denomi = readLong();
return new Rational(nomi, denomi);
}
private static class ImageEvent {
int stripIndex;
int type;
ImageEvent(int type) {
this.stripIndex = 0;
this.type = type;
}
ImageEvent(int type, int stripIndex) {
this.type = type;
this.stripIndex = stripIndex;
}
}
private static class IfdEvent {
int ifd;
boolean isRequested;
IfdEvent(int ifd, boolean isInterestedIfd) {
this.ifd = ifd;
this.isRequested = isInterestedIfd;
}
}
private static class ExifTagEvent {
ExifTag tag;
boolean isRequested;
ExifTagEvent(ExifTag tag, boolean isRequireByUser) {
this.tag = tag;
this.isRequested = isRequireByUser;
}
}
/**
* Gets the byte order of the current InputStream.
*/
protected ByteOrder getByteOrder() {
return mTiffStream.getByteOrder();
}
}
| [
"mdodd@google.com"
] | mdodd@google.com |
562429fabe85a57a4ccc9e9aa81bef516a9ea885 | f7ef6b0a32bde8351cf6235ea1f226a7fa4505a4 | /dubbo-demo/dubbo-demo-api/src/main/java/com/alibaba/dubbo/demo/extension/DynamicTraceBinding.java | 27e6521bd801917bbfdb5d0b945bc995bb5cac9c | [
"GPL-1.0-or-later",
"GPL-2.0-only",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | zcswl7961/dubbox | c0d5ba01c46f4a82f77e187cbf4eb58c1dc2b6d8 | ed7d9238b92c49bc55ad4cb1b55b9ef5c85f239a | refs/heads/master | 2022-12-04T19:12:36.737239 | 2019-11-13T10:32:15 | 2019-11-13T10:32:15 | 189,978,538 | 3 | 0 | Apache-2.0 | 2022-11-15T23:52:08 | 2019-06-03T09:49:23 | Java | UTF-8 | Java | false | false | 1,007 | java | /**
* Copyright 1999-2014 dangdang.com.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.dubbo.demo.extension;
import javax.ws.rs.container.DynamicFeature;
import javax.ws.rs.container.ResourceInfo;
import javax.ws.rs.core.FeatureContext;
/**
* @author lishen
*/
public class DynamicTraceBinding implements DynamicFeature {
public void configure(ResourceInfo resourceInfo, FeatureContext context) {
context.register(DynamicTraceInterceptor.class);
}
} | [
"26921832@qq.com"
] | 26921832@qq.com |
bf509939a1ae87c054a0c5f0525304e3791f17fa | b94ce4ccaccdb8bc1e079162502908205f052076 | /app/src/main/java/com/example/p1431658/listviewwithparse/CategoryActivity.java | 80ed64d3122e71e9ca17b10bbab6d34945450b78 | [] | no_license | srsonia2506/tag-along | fcece1c90ccda8032061c13a374f05d654321c43 | 59598a1a0c55d85006806496ee8e06305d8db61f | refs/heads/master | 2020-03-18T15:54:54.176556 | 2016-01-24T06:53:37 | 2016-01-24T06:53:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,310 | java | package com.example.p1431658.listviewwithparse;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.parse.FindCallback;
import com.parse.ParseException;
import com.parse.ParseObject;
import com.parse.ParseQuery;
import java.util.ArrayList;
import java.util.List;
/**
* Created by P1431658 on 23/1/2016.
*/
public class CategoryActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {//implements AdapterView.OnClickListener, View.OnClickListener{
private ListView mListView;
private CategoryAdapter mAdapter;
private Category clickedActivity;
private String id;
public void onCreate(Bundle savedInstance){
super.onCreate(savedInstance);
setContentView(R.layout.categorylist);
ParseObject.registerSubclass(Category.class);
mListView=(ListView)findViewById(R.id.listCat);
// mListView.setOnClickListener(this);
mListView.setOnItemClickListener(this);
mAdapter=new CategoryAdapter(this,new ArrayList<Category>());
mListView.setAdapter(mAdapter);
updateData();
}
@Override
public void onResume(){
super.onResume();
updateData();
}
public void updateData(){
ParseQuery<Category> query=ParseQuery.getQuery(Category.class);
query.setCachePolicy(ParseQuery.CachePolicy.CACHE_THEN_NETWORK);
query.findInBackground(new FindCallback<Category>() {//cache
@Override
public void done(List<Category> objects, ParseException e) {
if (objects != null) {
mAdapter.clear();
mAdapter.addAll(objects);
}
}
});
}
//this onclick for listview items
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Category category = mAdapter.getItem(position);
String roomId=category.getObjectId();
redirectToNextActivity(roomId);
}
public void redirectToNextActivity(String id){
Intent i=new Intent(this,ItemActivity.class);
i.putExtra("ID", id);
startActivity(i);
}
}
| [
"yourongl@hotmail.com"
] | yourongl@hotmail.com |
11f27d1afd57fbb2f79dd113418e81a6f6decb99 | d86d7c45271c1bbbf04eedfdcae0ccc8ed4d2322 | /src/model/Player.java | 90a0c1ea45fb71e226a1c23533b7ba2ab2cae64c | [] | no_license | empoknor1701/football | f8aba8e59cb5363fcbe33d844b11aca1bad5975b | a3cede41515d80e08ce5175f077e6c7d3bef1ca0 | refs/heads/master | 2021-01-23T22:53:07.088290 | 2011-05-21T05:03:40 | 2011-05-21T05:03:40 | 1,779,328 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 427 | java | package model;
public class Player {
private Integer id;
private String name;
private Team team;
public Integer getId() {
return id;
}
public void setId(Integer id) {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Team getTeam() {
return team;
}
public void setTeam(Team team) {
this.team = team;
}
}
| [
"fourside@gmail.com"
] | fourside@gmail.com |
3e12c26aecf4f6a3382b55f03d44b84e209390e1 | f05f1771f7e5cbcfbb8e48e66e31c1d8239dbf09 | /src/main/java/com/illusion/backend/BackendApplication.java | 42a13cd8ab200cc59c607a24f99aa828854886be | [] | no_license | ManMadeMachine/illusion-backend | 5abde400ccab72cf1163202790781464a29da07f | 4fea31a92bb9fcefc0a1038b3536e7f415003456 | refs/heads/master | 2023-03-08T01:00:35.841563 | 2021-02-04T16:09:57 | 2021-02-04T16:09:57 | 333,281,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | package com.illusion.backend;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class BackendApplication {
public static void main(String[] args) {
SpringApplication.run(BackendApplication.class, args);
}
}
| [
"Eetu.Suonpaa@hotmail.com"
] | Eetu.Suonpaa@hotmail.com |
a04142ae52b8af5d69e8a3489fd23a95d42c3403 | c304c580857500315fd51b1f1100feac2e7ec626 | /src/ru/astakhovmd/Arena_plugin/TextMode.java | f84c3177e4c58a561396eb5c00b1ff1eaf76a108 | [] | no_license | ProfessorZel/Arena_plugin | 60ea19056ea3be659c23a7f5a42ea577004ab210 | 90307843aff3b3afbf5b66229b3f01c73f356f10 | refs/heads/master | 2023-04-13T18:50:48.848627 | 2021-04-27T16:35:17 | 2021-04-27T16:35:17 | 362,179,820 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package ru.astakhovmd.Arena_plugin;
import org.bukkit.ChatColor;
public class TextMode
{
final static ChatColor Info = ChatColor.AQUA;
final static ChatColor Instr = ChatColor.YELLOW;
final static ChatColor Warn = ChatColor.GOLD;
final static ChatColor Err = ChatColor.RED;
final static ChatColor Success = ChatColor.GREEN;
}
| [
"rabota1schola11@gmail.com"
] | rabota1schola11@gmail.com |
4c037aa7ec05a4840a0902980ba24ce2825f0aed | e9189cc1141406ffeb092fcbab6b0492267d2c8c | /HttpServletDemo1.java | e96527dcb2b90b0d9d714e3907186f831bb8b621 | [] | no_license | sushovan47/Servlet-with-JSP | 21f05557ed933dfef3cffe33736643362eef3485 | dc1f2e25ecb53e6f695daf69acd2dfd1a3848f28 | refs/heads/master | 2020-04-26T10:21:27.219110 | 2019-03-02T18:41:34 | 2019-03-02T18:41:34 | 173,483,770 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,058 | java | package com.sushovan;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/HttpServletDemo1")
public class HttpServletDemo1 extends HttpServlet
{
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter pw=response.getWriter();
pw.println("I am in Get Method"+"<br/>");
String uname=request.getParameter("USERNAME");
String pawrd=request.getParameter("PASSWORD");
pw.println("User Name:"+uname+"<br/>");
pw.println("Password:"+pawrd+"<br/>");
if(uname.equals("sushovan47")&&pawrd.equals("12345"))
{
pw.println("Login Successful..."+uname);
}
else
{
pw.println("Invalid User Name or Password");
}
}
}
| [
"sushovanpaulme@gmail.com"
] | sushovanpaulme@gmail.com |
07bf10818fb32f9ce348b7c35cd121680331e3c7 | 614fff8847c03969932e38292140816fd622b22e | /PasswordSafe-master/src/goryachev/swing/theme/InsetsResource.java | b6aa0e66beefb4a90f4b885f7e33716bf4038952 | [
"Apache-2.0"
] | permissive | TAMUSA2018/Week12_Part1 | ea6e155a0a8c37a970afa02ef863512c86de0398 | 284d92028f0a6e86e5c7db0e18e7ed3e5ccffb30 | refs/heads/master | 2020-03-11T16:44:19.684150 | 2018-04-18T21:49:02 | 2018-04-18T21:49:02 | 130,124,057 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | // Copyright © 2013-2017 Andy Goryachev <andy@goryachev.com>
package goryachev.swing.theme;
import java.awt.Insets;
import javax.swing.plaf.UIResource;
public class InsetsResource extends Insets implements UIResource
{
public InsetsResource(int top, int left, int bottom, int right)
{
super(top, left, bottom, right);
}
} | [
"ialsmadi@DESKTOP-T2VSKJH"
] | ialsmadi@DESKTOP-T2VSKJH |
3c1d7663a9800443786b8bba8fc3b109d72ac872 | 7b73756ba240202ea92f8f0c5c51c8343c0efa5f | /classes/com/tencent/mobileqq/utils/QQCustomDialogThreeBtns.java | 21982aae8c58e5d54d9017d73583374b85042489 | [] | no_license | meeidol-luo/qooq | 588a4ca6d8ad579b28dec66ec8084399fb0991ef | e723920ac555e99d5325b1d4024552383713c28d | refs/heads/master | 2020-03-27T03:16:06.616300 | 2016-10-08T07:33:58 | 2016-10-08T07:33:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,205 | java | package com.tencent.mobileqq.utils;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils.TruncateAt;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.tencent.mobileqq.hotpatch.NotVerifyClass;
import com.tencent.widget.ListView;
import wbr;
import wbs;
import wbt;
import wbu;
import wbv;
import wbw;
import wbx;
public class QQCustomDialogThreeBtns
extends Dialog
{
public DialogInterface.OnClickListener a;
public LayoutInflater a;
private BaseAdapter jdField_a_of_type_AndroidWidgetBaseAdapter;
LinearLayout jdField_a_of_type_AndroidWidgetLinearLayout;
TextView jdField_a_of_type_AndroidWidgetTextView;
ListView jdField_a_of_type_ComTencentWidgetListView;
public String[] a;
TextView b;
TextView c;
TextView d;
TextView e;
TextView f;
public QQCustomDialogThreeBtns(Context paramContext)
{
super(paramContext);
boolean bool = NotVerifyClass.DO_VERIFY_CLASS;
this.jdField_a_of_type_AndroidWidgetBaseAdapter = new wbr(this);
}
public QQCustomDialogThreeBtns(Context paramContext, int paramInt)
{
super(paramContext, paramInt);
this.jdField_a_of_type_AndroidWidgetBaseAdapter = new wbr(this);
}
protected QQCustomDialogThreeBtns(Context paramContext, boolean paramBoolean, DialogInterface.OnCancelListener paramOnCancelListener)
{
super(paramContext, paramBoolean, paramOnCancelListener);
this.jdField_a_of_type_AndroidWidgetBaseAdapter = new wbr(this);
}
private void a()
{
b();
}
private void b()
{
TextView localTextView = null;
if (this.d.getVisibility() == 0) {
localTextView = this.d;
}
for (;;)
{
if (localTextView != null) {
localTextView.setTypeface(Typeface.defaultFromStyle(1));
}
return;
if (this.e.getVisibility() == 0) {
localTextView = this.e;
} else if (this.c.getVisibility() == 0) {
localTextView = this.c;
}
}
}
public int a(int paramInt)
{
return paramInt;
}
public QQCustomDialogThreeBtns a(int paramInt)
{
this.b.setText(paramInt);
this.b.setVisibility(0);
return this;
}
public QQCustomDialogThreeBtns a(int paramInt, DialogInterface.OnClickListener paramOnClickListener)
{
Object localObject = null;
try
{
String[] arrayOfString = getContext().getResources().getStringArray(paramInt);
localObject = arrayOfString;
}
catch (Resources.NotFoundException localNotFoundException)
{
for (;;)
{
localNotFoundException.printStackTrace();
}
}
return a((String[])localObject, paramOnClickListener);
}
public QQCustomDialogThreeBtns a(Drawable paramDrawable)
{
this.f.setPadding(0, 0, 0, 0);
this.f.setCompoundDrawablePadding(0);
this.f.setCompoundDrawables(paramDrawable, null, null, null);
if (paramDrawable != null)
{
this.f.setVisibility(0);
return this;
}
this.f.setVisibility(8);
return this;
}
public QQCustomDialogThreeBtns a(View paramView)
{
this.b.setVisibility(8);
LinearLayout.LayoutParams localLayoutParams = new LinearLayout.LayoutParams(-1, -2);
this.jdField_a_of_type_AndroidWidgetLinearLayout.addView(paramView, localLayoutParams);
return this;
}
public QQCustomDialogThreeBtns a(String paramString)
{
if (paramString != null)
{
this.jdField_a_of_type_AndroidWidgetTextView.setText(paramString);
this.jdField_a_of_type_AndroidWidgetTextView.setVisibility(0);
if (this.jdField_a_of_type_ArrayOfJavaLangString == null) {}
return this;
}
this.jdField_a_of_type_AndroidWidgetTextView.setVisibility(8);
return this;
}
public QQCustomDialogThreeBtns a(String paramString, int paramInt)
{
if ((findViewById(paramInt) instanceof TextView))
{
TextView localTextView = (TextView)findViewById(paramInt);
if (localTextView != null) {
localTextView.setText(paramString);
}
}
return this;
}
public QQCustomDialogThreeBtns a(String paramString, DialogInterface.OnClickListener paramOnClickListener)
{
if (paramOnClickListener == null)
{
this.c.setVisibility(8);
return this;
}
this.c.setText(paramString);
this.c.setVisibility(0);
this.c.setOnClickListener(new wbs(this, paramOnClickListener));
a();
return this;
}
public QQCustomDialogThreeBtns a(String[] paramArrayOfString, DialogInterface.OnClickListener paramOnClickListener)
{
this.jdField_a_of_type_ArrayOfJavaLangString = paramArrayOfString;
this.b.setVisibility(8);
this.c.setVisibility(8);
this.e.setVisibility(8);
this.d.setVisibility(8);
this.jdField_a_of_type_AndroidWidgetLinearLayout.setVisibility(8);
this.jdField_a_of_type_AndroidContentDialogInterface$OnClickListener = paramOnClickListener;
this.jdField_a_of_type_ComTencentWidgetListView.setVisibility(0);
this.jdField_a_of_type_ComTencentWidgetListView.setAdapter(this.jdField_a_of_type_AndroidWidgetBaseAdapter);
this.jdField_a_of_type_ComTencentWidgetListView.setDivider(null);
this.jdField_a_of_type_ComTencentWidgetListView.setDividerHeight(0);
return this;
}
public QQCustomDialogThreeBtns b(int paramInt)
{
if (this.b != null)
{
this.b.setMaxLines(paramInt);
this.b.setEllipsize(TextUtils.TruncateAt.END);
}
return this;
}
public QQCustomDialogThreeBtns b(int paramInt, DialogInterface.OnClickListener paramOnClickListener)
{
if (paramOnClickListener == null)
{
this.c.setVisibility(8);
return this;
}
this.c.setText(paramInt);
this.c.setVisibility(0);
this.c.setOnClickListener(new wbv(this, paramOnClickListener));
a();
return this;
}
public QQCustomDialogThreeBtns b(String paramString)
{
if (paramString != null)
{
this.b.setText(paramString);
this.b.setVisibility(0);
return this;
}
this.b.setVisibility(8);
return this;
}
public QQCustomDialogThreeBtns b(String paramString, DialogInterface.OnClickListener paramOnClickListener)
{
if (paramOnClickListener == null)
{
this.e.setVisibility(8);
return this;
}
this.e.setText(paramString);
this.e.setVisibility(0);
this.e.setOnClickListener(new wbt(this, paramOnClickListener));
a();
return this;
}
public QQCustomDialogThreeBtns c(int paramInt, DialogInterface.OnClickListener paramOnClickListener)
{
if (paramOnClickListener == null)
{
this.e.setVisibility(8);
return this;
}
this.e.setText(paramInt);
this.e.setVisibility(0);
this.e.setOnClickListener(new wbw(this, paramOnClickListener));
a();
return this;
}
public QQCustomDialogThreeBtns c(String paramString, DialogInterface.OnClickListener paramOnClickListener)
{
if (paramOnClickListener == null)
{
this.d.setVisibility(8);
return this;
}
this.d.setText(paramString);
this.d.setVisibility(0);
this.d.setOnClickListener(new wbu(this, paramOnClickListener));
a();
return this;
}
public QQCustomDialogThreeBtns d(int paramInt, DialogInterface.OnClickListener paramOnClickListener)
{
if (paramOnClickListener == null)
{
this.d.setVisibility(8);
return this;
}
this.d.setText(paramInt);
this.d.setVisibility(0);
this.d.setOnClickListener(new wbx(this, paramOnClickListener));
a();
return this;
}
public void dismiss()
{
try
{
super.dismiss();
return;
}
catch (Exception localException) {}
}
public void setContentView(int paramInt)
{
super.setContentView(paramInt);
this.jdField_a_of_type_AndroidWidgetTextView = ((TextView)findViewById(2131297840));
this.b = ((TextView)findViewById(2131296852));
this.f = ((TextView)findViewById(2131297848));
this.c = ((TextView)findViewById(2131297843));
this.e = ((TextView)findViewById(2131297861));
this.d = ((TextView)findViewById(2131297844));
this.c.setVisibility(8);
this.e.setVisibility(8);
this.d.setVisibility(8);
this.jdField_a_of_type_AndroidWidgetLinearLayout = ((LinearLayout)findViewById(2131297673));
this.jdField_a_of_type_ComTencentWidgetListView = ((ListView)findViewById(2131297845));
}
public void setTitle(int paramInt)
{
this.jdField_a_of_type_AndroidWidgetTextView.setText(paramInt);
this.jdField_a_of_type_AndroidWidgetTextView.setVisibility(0);
}
}
/* Location: E:\apk\QQ_91\classes-dex2jar.jar!\com\tencent\mobileqq\utils\QQCustomDialogThreeBtns.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
b102caebd9200a0c140425df0c612527dddc3db3 | 3917d3110a28b5fdd8360af2c3919d0b8b7148b2 | /app/src/main/java/com/laioffer/myapplication/MainActivity.java | 4243035cfdb44df0f32edff3b5e1a78fd51efaa6 | [] | no_license | maggieqin0506/MyApplication | 011c7005cf297b2600aafea0006158e1df46736c | a87dcfb0a31a59b15ff1f41ec85c6c295dba5322 | refs/heads/main | 2023-01-31T21:11:57.813987 | 2020-12-20T05:55:28 | 2020-12-20T05:55:28 | 323,003,925 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,311 | java | package com.laioffer.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// linke your file and the final java code
setContentView(R.layout.activity_main);
// R - resource
// all the variables in id are integers xml files linked in java class
// so we use R.id
final TextView welcomeTextView = findViewById(R.id.welcomeTextView);
final EditText nameEditText = findViewById(R.id.nameEditText);
final EditText emailEditText = findViewById(R.id.emailEditText);
Button submitButton = findViewById(R.id.submitButton);
submitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String name = nameEditText.getText().toString();
String email = emailEditText.getText().toString();
welcomeTextView.setText("Welcome " + name + ", your email is: " + email);
}
});
}
} | [
"yucong.qin@vanderbilt.edu"
] | yucong.qin@vanderbilt.edu |
3651537f0ccec155a35f34e35c455c9d380f9e14 | a3af0d126cd5e45a721920c8846eac7cc9c143a1 | /Ejemplos/POO/Prog2_Ej1/src/com/utn/frre/tsp/progii/Account.java | 9eab55ce60fbdd53f3680c99b0e9c562477a8720 | [] | no_license | progii-tsp-frre-utn/material | e2c8b99555f5f15acddcac6fe777e7a77207b593 | e31c9be7bf995a63ead321642f1670842f2abd41 | refs/heads/master | 2022-10-27T21:04:16.554455 | 2022-10-04T21:32:17 | 2022-10-04T21:32:17 | 100,069,867 | 17 | 9 | null | null | null | null | UTF-8 | Java | false | false | 1,194 | java | package com.utn.frre.tsp.progii;
public class Account {
private int nroCuenta = 1000;
private double balance = 0.0;
private double balanceDolar = 0.0;
public Account(double pesos) {
this.balance = pesos;
conectarInternet();
this.balanceDolar
= obtenerValorDolar(pesos);
obtenerValorTasaAnual();
}
public void setNroCuenta(int n) {
nroCuenta = n;
}
public void setBalance(double balance) {
this.balance = balance;
}
public double getBalance() {
return this.balance;
}
public double getBalanceDolar() {
return this.balanceDolar;
}
public void acreditar(double monto) {
if (monto > 0) {
balance += monto;
conectarInternet();
balanceDolar = obtenerValorDolar(balance);
}
}
public void debitar(double monto) {
if (monto > 0 && monto <= balance) {
balance -= monto;
}
}
private void conectarInternet() {
}
private double obtenerValorDolar(double pesos){
return pesos * 30.34;
}
private void obtenerValorTasaAnual(){
}
}
| [
"facundo.matoff@globant.com"
] | facundo.matoff@globant.com |
5c04c780ca9b977803711d036fba71125e1018ad | 7806a39c9abe05220813d25bd9b306625c953278 | /jkafka-console/src/main/java/me/bliss/kafka/web/home/controller/TopicController.java | 3d4459e5cd5f04c900c23047c1a1a0eb1f48ff26 | [
"Apache-2.0"
] | permissive | hmfms/Jkafka | 86ffe89bcc461a561b6a44e94bf20497eab86fdf | 95248f50271060e0e4610a0714128c01395e1c89 | refs/heads/master | 2020-04-29T18:28:40.923084 | 2017-07-06T11:54:42 | 2017-07-06T11:54:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,467 | java | package me.bliss.kafka.web.home.controller;
import me.bliss.kafka.core.component.ZookeeperComponent;
import me.bliss.kafka.model.Topic;
import me.bliss.kafka.model.TopicMessage;
import me.bliss.kafka.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
*
*
* @author lanjue
* @version $Id: me.bliss.kafka.web.controller, v 0.1 4/4/15
* Exp $
*/
@Controller
@RequestMapping(value = "/topic")
public class TopicController {
@Autowired
private TopicService topicService;
@Autowired
private ZookeeperComponent zookeeperComponent;
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public List<Topic> getList() {
return topicService.getAllTopics();
}
@RequestMapping(value = "/messages", method = RequestMethod.GET)
@ResponseBody
public List<TopicMessage> getAllMessages() {
return topicService.getAllMessages();
}
public void setTopicService(TopicService topicService) {
this.topicService = topicService;
}
public void setZookeeperComponent(ZookeeperComponent zookeeperComponent) {
this.zookeeperComponent = zookeeperComponent;
}
}
| [
"506526593@qq.com"
] | 506526593@qq.com |
0dbbbc582b9ddd77515220f1e44859f06cefb2f7 | e952c19688f7b4e8c7f2ea783c485233f138a6e4 | /src/main/java/com/kadet/handbook/server/dao/AbstractDAO.java | a86ee065bdb6685e72a5303899f3454500a57116 | [] | no_license | lehaSVV2009/handbookSpringServer | 3c2e48f9cbfd6cd150fc6f5238a421d06ad61a33 | e67cf9f4791b52c6cd69d1d4a3fd84d4470cec03 | refs/heads/master | 2016-09-06T08:46:38.923334 | 2013-12-24T03:45:31 | 2013-12-24T03:45:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 425 | java | package com.kadet.handbook.server.dao;
import java.io.Serializable;
import java.util.List;
/**
* Created with IntelliJ IDEA.
* User: admin
* Date: 28.08.13
* Time: 4:31
* To change this template use File | Settings | File Templates.
*/
public interface AbstractDAO<E, I extends Serializable> {
boolean save (E e);
E findById(I id);
boolean update(E e);
boolean delete(I id);
List<E> findAll();
}
| [
"lehaSVV2009@gmail.com"
] | lehaSVV2009@gmail.com |
ea0198dde2960fce4945ea72a416e1af3f8b0d1c | 93d6d6c8fa7fc6c8f60e0ff3df042228eeae4ff7 | /BanqueSI_Spring/src/main/java/org/glsid/entities/CompteCourant.java | ac5cdbaeec89b66a6e33eaa0c7aa942350892d59 | [] | no_license | MarweneElhechmi/BanqueSI | 318970effc9b4f9f5796832aa08674a1f0676123 | 8fab71268904700bb2073908ffdaddcad97eedf5 | refs/heads/master | 2021-09-08T12:54:55.764380 | 2018-03-09T21:41:13 | 2018-03-09T21:41:13 | 114,520,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 624 | java | package org.glsid.entities;
import java.util.Date;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
@Entity
@DiscriminatorValue("CC")
public class CompteCourant extends Compte{
private double decouvert;
public CompteCourant() {
super();
}
public double getDecouvert() {
return decouvert;
}
public void setDecouvert(double decouvert) {
this.decouvert = decouvert;
}
public CompteCourant(String codeCompte, Date dateCreation, double solde, double decouvert) {
super(codeCompte, dateCreation, solde);
this.decouvert = decouvert;
}
}
| [
"marwe@DESKTOP-H3KS6MS"
] | marwe@DESKTOP-H3KS6MS |
f135828a7851a57516d641932229912576a08f95 | f8b95b4dd190a74a79d8f44ba865bc638fb31328 | /com.google.dart.engine/src/com/google/dart/engine/error/BooleanErrorListener.java | ce1a39140f22066d4d65a3cf23111677e1dcce4e | [] | no_license | unreal0/java2dart | cdd790fc47ba6d9bd617bdd036fd7b7661249099 | 2bd245db46a7090e9298de28f5fd25bac4744957 | refs/heads/master | 2020-04-03T06:52:30.070916 | 2018-10-28T15:55:46 | 2018-10-28T15:55:46 | 155,086,502 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,427 | java | /*
* Copyright (c) 2013, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.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.eclipse.org/legal/epl-v10.html
*
* 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.google.dart.engine.error;
/**
* Instances of the class {@code BooleanErrorListener} implement a listener that keeps track of
* whether an error has been reported to it.
*/
public class BooleanErrorListener implements AnalysisErrorListener {
/**
* A flag indicating whether an error has been reported to this listener.
*/
private boolean errorReported = false;
/**
* Initialize a newly created error listener.
*/
public BooleanErrorListener() {
super();
}
/**
* Return {@code true} if an error has been reported to this listener.
*
* @return {@code true} if an error has been reported to this listener
*/
public boolean getErrorReported() {
return errorReported;
}
@Override
public void onError(AnalysisError error) {
errorReported = true;
}
}
| [
"unreal0@sina.cn"
] | unreal0@sina.cn |
4d21a717b9170abff57c742d63c69cffe1486ab5 | 38f3facd7924abfe300c0232bb3bca20c632ae24 | /src/main/java/com/coolspy3/hde/GUI.java | 0563d2e2c2f203bf86811205ea9a13272753fc1c | [] | no_license | CoolSpy3/HDE | f14fb3eb10b4169cc9346c546020105ae0365024 | 11ac524767342552c2deeae10113265e69be6530 | refs/heads/master | 2023-06-18T19:02:04.159694 | 2021-07-11T04:33:45 | 2021-07-11T04:33:45 | 380,643,729 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,388 | java | package com.coolspy3.hde;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static java.awt.event.InputEvent.*;
import static java.awt.event.KeyEvent.*;
import java.awt.event.WindowEvent;
import static java.awt.event.WindowEvent.*;
import java.awt.event.WindowListener;
import java.io.File;
import java.io.IOException;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import javax.swing.filechooser.FileNameExtensionFilter;
/**
* Manages the main frame which will be interacted with by the user.
* This class will load a number of panel classes which will display context-specific information to the user
*/
public class GUI extends JFrame implements ActionListener, WindowListener {
private static final long serialVersionUID = -131881419240091231L;
/**
* The refresh rate of the frame in frames per second
*/
public static final int FPS = 60;
/**
* The delay between paint updates of the frame. This is equal to a value of <code>1000/FPS</code>
*/
public static final int FDELAY = 1000/FPS;
private JMenuBar menuBar;
private JMenu fileMenu;
private JMenuItem newMenuItem;
private JMenuItem openMenuItem;
private JMenuItem closeMenuItem;
private JMenuItem saveMenuItem;
private JMenuItem saveAsMenuItem;
private JMenuItem exportMenuItem;
private JMenuItem quitMenuItem;
private JMenu optionsMenu;
private JCheckBoxMenuItem showGridMenuItem;
private String filename;
private ContentPanel contentPanel;
/**
* Creates a new GUI and initializes it with the default layout and a thread which repaints the frame every <code>FDELAY</code> milliseconds.
*/
@SuppressWarnings({"LeakingThisInConstructor", "CallToThreadStartDuringObjectConstruction"})
public GUI() {
// Setup window
super("Software Hardware Designer and Emulator");
setSize(1000, 1000);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setLocationRelativeTo(null);
// Add listeners and components
addWindowListener(this);
setupMenus();
// Set default vars
filename = null;
contentPanel = null;
// Make window visible
setVisible(true);
// Start render thread
@SuppressWarnings("SleepWhileInLoop")
Thread t = new Thread(() -> {
while(true) {
if(isVisible()) {
repaint();
try {
Thread.sleep(FDELAY);
} catch(InterruptedException e) {}
}
}
});
t.setDaemon(true);
t.start();
}
private void setupMenus() {
menuBar = new JMenuBar();
fileMenu = new JMenu("File");
newMenuItem = new JMenuItem("New Project");
newMenuItem.setAccelerator(KeyStroke.getKeyStroke(VK_N, CTRL_DOWN_MASK));
newMenuItem.addActionListener(this);
fileMenu.add(newMenuItem);
openMenuItem = new JMenuItem("Open Project");
openMenuItem.setAccelerator(KeyStroke.getKeyStroke(VK_O, CTRL_DOWN_MASK));
openMenuItem.addActionListener(this);
fileMenu.add(openMenuItem);
closeMenuItem = new JMenuItem("Close Project");
closeMenuItem.setAccelerator(KeyStroke.getKeyStroke(VK_W, CTRL_DOWN_MASK));
closeMenuItem.addActionListener(this);
fileMenu.add(closeMenuItem);
fileMenu.addSeparator();
saveMenuItem = new JMenuItem("Save Project");
saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(VK_S, CTRL_DOWN_MASK));
saveMenuItem.addActionListener(this);
saveMenuItem.setEnabled(false);
fileMenu.add(saveMenuItem);
saveAsMenuItem = new JMenuItem("Save Project As");
saveAsMenuItem.setAccelerator(KeyStroke.getKeyStroke(VK_S, CTRL_DOWN_MASK | SHIFT_DOWN_MASK));
saveAsMenuItem.addActionListener(this);
saveAsMenuItem.setEnabled(false);
fileMenu.add(saveAsMenuItem);
exportMenuItem = new JMenuItem("Export Project");
exportMenuItem.setAccelerator(KeyStroke.getKeyStroke(VK_E, CTRL_DOWN_MASK));
exportMenuItem.addActionListener(this);
exportMenuItem.setEnabled(false);
fileMenu.add(exportMenuItem);
fileMenu.addSeparator();
quitMenuItem = new JMenuItem("Exit");
quitMenuItem.addActionListener(this);
fileMenu.add(quitMenuItem);
menuBar.add(fileMenu);
optionsMenu = new JMenu("Options");
showGridMenuItem = new JCheckBoxMenuItem("Show Grid", true);
optionsMenu.add(showGridMenuItem);
menuBar.add(optionsMenu);
setJMenuBar(menuBar);
}
/**
* Checks the user's selection to see whether a grid should be shown behind displayed components
* @return Whether a grid should be shown behind components
*/
public boolean shouldShowGrid() {
return showGridMenuItem.isSelected();
}
/**
* Attempts to close the current content panel.
* The user will be prompted to save any unsaved data. The panel will then be closed and removed from the frame unless the operation was canceled by the user.
* @return Whether the operation was successful
* @throws IOException if an error occurs while saving
*/
public boolean closeContentPanel() throws IOException {
if(contentPanel != null) {
// If contentPanel is open, attempt to save data
if(saveUnsaved()) {
// Remove content panel
remove(contentPanel);
contentPanel = null;
// Disable saving
saveMenuItem.setEnabled(false);
saveAsMenuItem.setEnabled(false);
exportMenuItem.setEnabled(false);
// Revalidate frame
revalidate();
} else {
return false;
}
}
return true;
}
/**
* Prompts the user to save any unsaved data
* @return Whether the data was successfully saved
* @throws IOException if an error occurs while saving
*/
public boolean saveUnsaved() throws IOException {
int op = JOptionPane.showOptionDialog(this, "Would You Like to Save Your Changes?", "Save Changes",
JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, new String[] {"Save", "Discard", "Cancel"}, "Save");
switch(op) {
// "Save"
case 0:
return save();
// "Discard"
case 1:
return true;
// "Cancel" / Popup Closed
case 2:
case JOptionPane.DEFAULT_OPTION:
default:
return false;
}
}
/**
* Saves any unsaved data to the file it was read from or prompts the user for a file location if none was specified
* @return Whether the data was successfully saved
* @throws IOException if an error occurs while saving
*/
public boolean save() throws IOException {
if(!saveAsMenuItem.isEnabled()) {
// There is no data to save
return true;
}
// Save with same filename if possible
if(filename != null) {
return saveAs(filename);
} else {
return saveAs();
}
}
/**
* Prompts the user for a location and then saves any unsaved data to that location
* @return Whether the data was successfully saved
* @throws IOException if an error occurs while saving
*/
public boolean saveAs() throws IOException {
if(!saveAsMenuItem.isEnabled()) {
// There is no data to save
return true;
}
// Prompt user for file
JFileChooser fc = new JFileChooser();
fc.setAcceptAllFileFilterUsed(false);
fc.setFileFilter(new FileNameExtensionFilter("Logic Map Files", "lm"));
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setMultiSelectionEnabled(false);
fc.showSaveDialog(this);
File file = fc.getSelectedFile();
if(file == null) {
// User did not select a file
return false;
}
return saveAs(file);
}
/**
* Saves any unsaved data to the specified file
* @param filename The name of the file to which the data should be saved
* @return Whether the data was saved successfully
* @throws IOException if an error occurs while saving
*/
public boolean saveAs(String filename) throws IOException {
return saveAs(new File(filename));
}
/**
* Saves any unsaved data to the specified file
* @param file The file to which the data should be saved
* @return Whether the data was saved successfully
* @throws IOException if an error occurs while saving
*/
public boolean saveAs(File file) throws IOException {
if(!saveAsMenuItem.isEnabled()) {
// There is no data to save
return true;
}
if(file.exists()) {
// Ask to overwrite file
int op = JOptionPane.showConfirmDialog(this, "File Already Exists! Overwrite?", "Save Project", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(op == JOptionPane.NO_OPTION || op == JOptionPane.CLOSED_OPTION) {
return false;
}
} else {
// The file does not exist. Create it
file.createNewFile();
}
// Save the file name
filename = file.getCanonicalPath();
// Write data to file
contentPanel.save(file);
return true;
}
@Override
public void actionPerformed(ActionEvent e) {
try {
if(e.getSource() == newMenuItem) {
// Try to close open project
if(closeContentPanel()) {
// No file is associates with the new project
filename = null;
// Create a new editor
contentPanel = new ContentPanel(this);
add(contentPanel);
// Enable saving
saveMenuItem.setEnabled(true);
saveAsMenuItem.setEnabled(true);
exportMenuItem.setEnabled(true);
// Revalidate frame
revalidate();
}
} else if(e.getSource() == openMenuItem) {
// PRompt user to select file
JFileChooser fc = new JFileChooser();
fc.setAcceptAllFileFilterUsed(false);
fc.setFileFilter(new FileNameExtensionFilter("Logic Map Files", "lm"));
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setMultiSelectionEnabled(false);
fc.showOpenDialog(this);
File file = fc.getSelectedFile();
// If the file is not null, check if it exists. If it does, attempt to close the open project
if(file != null && file.exists() && closeContentPanel()) {
// Store the file name
filename = file.getCanonicalPath();
// Create a new editor
contentPanel = new ContentPanel(this, file);
add(contentPanel);
// Enable saving
saveMenuItem.setEnabled(true);
saveAsMenuItem.setEnabled(true);
exportMenuItem.setEnabled(true);
// Revalidate frame
revalidate();
}
} else if(e.getSource() == closeMenuItem) {
closeContentPanel();
} else if(e.getSource() == saveMenuItem) {
save();
} else if(e.getSource() == saveAsMenuItem) {
saveAs();
} else if(e.getSource() == exportMenuItem) {
JOptionPane.showMessageDialog(this, "Exporting is not yet supported!", "Export", JOptionPane.ERROR_MESSAGE);
} else if(e.getSource() == quitMenuItem) {
dispatchEvent(new WindowEvent(this, WINDOW_CLOSING));
}
} catch(IOException exc) {
exc.printStackTrace(System.err);
System.exit(1);
}
}
@Override
public void windowOpened(WindowEvent e) {
}
@Override
public void windowClosing(WindowEvent e) {
try {
// Attempt to close the open project
if(closeContentPanel()) {
// Hide and dispose frame
setVisible(false);
dispose();
}
} catch(IOException exc) {
exc.printStackTrace(System.err);
}
}
@Override
public void windowClosed(WindowEvent e) {
}
@Override
public void windowIconified(WindowEvent e) {
}
@Override
public void windowDeiconified(WindowEvent e) {
}
@Override
public void windowActivated(WindowEvent e) {
}
@Override
public void windowDeactivated(WindowEvent e) {
}
}
| [
"55305038+CoolSpy3@users.noreply.github.com"
] | 55305038+CoolSpy3@users.noreply.github.com |
9f2a15fa375f544bb788b77deaafd2096bf80ccb | a30e3a1631ad58ad43afaa1e8601471f9c281627 | /src/main/java/in/geekmj/resource/EmployeeResource.java | 366c4cb550140e523b3868035d3ca96da2681f23 | [
"Unlicense"
] | permissive | abeosoft/jersey-jax-rs-examples | d3fd43e109fdd5b6d16d7d5c02f25f79621c7eda | 01781f4c45f32d919602ab5bbb80a35b739968aa | refs/heads/master | 2020-04-06T06:34:53.226373 | 2016-05-05T06:23:02 | 2016-05-05T06:23:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,511 | java | package in.geekmj.resource;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import in.geekmj.domain.Employee;
@Path("/employees")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class EmployeeResource {
private final NamedParameterJdbcTemplate namedParameterJdbcTemplate;
@Autowired
public EmployeeResource(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
}
@POST
public String createEmployee(final Employee employee) {
String sql = "insert into EMPLOYEE values(DEFAULT, :name, :address, :createdOn, :modifiedOn)";
SqlParameterSource namedParameters = new BeanPropertySqlParameterSource(employee);
this.namedParameterJdbcTemplate.update(sql, namedParameters);
return "{\"status\": \"Record Added Successfully\"}";
}
@GET
@Path("/{employeeId}")
public Employee getEmployee(@PathParam("employeeId") Integer employeeId) {
String sql = "select * from EMPLOYEE where id=:employeeId";
SqlParameterSource namedParameters = new MapSqlParameterSource("employeeId", employeeId);
return namedParameterJdbcTemplate.query(sql, namedParameters, new EmployeeMapper()).get(0);
}
@PUT
@Path("/{employeeId}")
public Employee editEmployee(final Employee employee, @PathParam("employeeId") Integer employeeId) {
String sql = "update EMPLOYEE set name=:name, address=:address where id=:id";
SqlParameterSource namedParameters = new BeanPropertySqlParameterSource(employee);
this.namedParameterJdbcTemplate.update(sql, namedParameters);
sql = "select * from EMPLOYEE where id=:employeeId";
SqlParameterSource namedParameters2 = new MapSqlParameterSource("employeeId", employeeId);
return namedParameterJdbcTemplate.query(sql, namedParameters2, new EmployeeMapper()).get(0);
}
@GET
public List<Employee> ListEmployees() {
String sql = "select * from EMPLOYEE";
return namedParameterJdbcTemplate.query(sql, new EmployeeMapper());
}
@DELETE
@Path("/{employeeId}")
public String deleteEmployees(@PathParam("employeeId") Integer employeeId) {
String sql = "delete from EMPLOYEE where id=:employeeId";
SqlParameterSource namedParameters = new MapSqlParameterSource("employeeId", employeeId);
this.namedParameterJdbcTemplate.update(sql, namedParameters);
return "{\"status\": \"Record Deleted Successfully\"}";
}
private static final class EmployeeMapper implements RowMapper<Employee> {
public Employee mapRow(ResultSet rs, int rowNum) throws SQLException {
Employee employee = new Employee();
employee.setId(rs.getInt("id"));
employee.setName(rs.getString("name"));
employee.setAddress(rs.getString("address"));
employee.setCreatedOn(rs.getDate("created_on"));
employee.setModifiedOn(rs.getDate("modified_on"));
return employee;
}
}
}
| [
"m.kumar1982@gmail.com"
] | m.kumar1982@gmail.com |
25e028ef11f68fe917cbaa5da70e3ef7079b81be | 96838b1a99a67f16c449aaadebaae195a1186960 | /src/main/java/kz/dom/domkzbackendv2/util/ColumnRowMapper.java | 78fe033f0987042f755885e698888746a97a210f | [] | no_license | dtes/domkz-backend-v2 | 9c5ef2ceb35705bc36a50d63ebc03e0bc130646d | d483ea620bd52a12a1e88c9841f8b4e4bb60b2dc | refs/heads/master | 2023-07-03T08:07:41.344387 | 2021-08-06T06:48:34 | 2021-08-06T06:48:34 | 392,202,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,454 | java | package kz.dom.domkzbackendv2.util;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.util.StringUtils;
import java.lang.reflect.Field;
@Slf4j
public class ColumnRowMapper<T> extends BeanPropertyRowMapper<T> {
private ColumnRowMapper(final Class<T> mappedClass) {
super(mappedClass);
}
@Override
protected String underscoreName(final String name) {
final Column annotation;
final String columnName;
Field declaredField = null;
try {
declaredField = getMappedClass().getDeclaredField(name);
} catch (NoSuchFieldException | SecurityException e) {
log.warn("Ups, field «{}» not found in «{}».", name, getMappedClass());
}
if (declaredField == null || (annotation = declaredField.getAnnotation(Column.class)) == null
|| StringUtils.isEmpty(columnName = annotation.toString())) {
return super.underscoreName(name);
}
return columnName;
}
/**
* New instance.
*
* @param <T> the generic type
* @param mappedClass the mapped class
* @return the bean property row mapper
*/
public static <T> BeanPropertyRowMapper<T> newInstance(final Class<T> mappedClass) {
return new ColumnRowMapper<>(mappedClass);
}
} | [
"mygrnail@gmail.com"
] | mygrnail@gmail.com |
a773b24cd429d2655d44a956d9d00b42492546e4 | 58cb09db43faf7b48ad2af362f997c90c1789dcc | /src/com/pswiech/MashroomDecorator.java | 55616a7697c847d4231a6f2555b83125f67517d4 | [] | no_license | pswiech/decorator | 6e228a0fea6ce36fd22c2ea4f5fb5f54ca57947b | c6bb2a7c666c87095078e75e379917530d493fdc | refs/heads/master | 2021-08-27T23:42:00.837598 | 2017-12-10T20:19:33 | 2017-12-10T20:19:33 | 113,776,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 323 | java | package com.pswiech;
import java.math.BigDecimal;
public class MashroomDecorator implements PizzaDecorator {
private Pizza pizza;
MashroomDecorator(Pizza pizza) {
this.pizza = pizza;
}
@Override
public BigDecimal getPrice() {
return pizza.getPrice().add(new BigDecimal(6));
}
}
| [
"pawel.swiech@gmail.com"
] | pawel.swiech@gmail.com |
9174e1087498ae4d7fc4f4af1e9d9e0787a25e5e | caa05d82a3e0cf84ae664e18c37e5ca1cb85fd95 | /JAVA/src/kr/co/ch/day08/Manager01.java | c48d1add570f6caa3939af280f018509399fd3e0 | [] | no_license | park-cheonho/Polytech_JAVA | 060e56783a3d18eb47e1b8b82db6ae011aee4cc6 | ea52df76f151ce68e6c44bc8c245c443bcadbb45 | refs/heads/master | 2022-11-09T18:59:26.770482 | 2020-06-23T23:40:57 | 2020-06-23T23:40:57 | 266,079,918 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 986 | java | package kr.co.ch.day08;
public class Manager01 extends Employee {
Employee[] empList;
public Manager01() {
//super();
}
public Manager01(int no, String name, String grade, int salary, Employee[] empList) {
super(no, name, grade, salary);
//this.no = no; //super.no = no; 지만 원래 this로도 자기꺼처럼 사용가능하다는 것임
//this.name = name;
//this.grade = grade;
//this.salary = salary;
this.empList = empList;
}
public void info() {
super.info();
//System.out.println("사원번호 : " + no + "사원명 : " + name + "직급 : " + grade + "연봉 : " + salary + " 만원");
System.out.println("==========================================================");
System.out.println("\t\t < 관리사원 목록 > ");
System.out.println("==========================================================");
for(Employee e : empList) {
e.info();
}
System.out.println("==========================================================");
}
}
| [
"cheonho08@gmail.com"
] | cheonho08@gmail.com |
0e82666d6b731ca89bbfeeb6b61f0be153ef338c | f4aa43efb2b9183b2d3ea63959a4a30d865c0939 | /app/src/main/java/com/procreation/dagger2retrofit2/User.java | f6cf1b360c432153c8423ebeca4daea3c38bd226 | [] | no_license | maznievas/Dagger2Retrofit2 | a57e02420f885da9c42edaca73b63b8534aeb2ae | 09a4439cc55c43aeaf2b94bc5dee7e8df7870fe2 | refs/heads/master | 2021-07-10T22:21:25.563919 | 2017-10-11T11:03:51 | 2017-10-11T11:03:51 | 106,542,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,333 | java | package com.procreation.dagger2retrofit2;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class User {
@SerializedName("login")
@Expose
private String login;
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("avatar_url")
@Expose
private String avatarUrl;
@SerializedName("followers_url")
@Expose
private String followersUrl;
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAvatarUrl() {
return avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl;
}
public String getFollowersUrl() {
return followersUrl;
}
public void setFollowersUrl(String followersUrl) {
this.followersUrl = followersUrl;
}
@Override
public String toString() {
return "User{" +
"\nlogin='" + login + '\'' +
",\n id=" + id +
",\n avatarUrl='" + avatarUrl + '\'' +
",\n followersUrl='" + followersUrl + '\'' +
'}';
}
} | [
"andreymazniev2017@gmail.com"
] | andreymazniev2017@gmail.com |
b218c34d99a7e1cc373c0cafc9112076b2deedfd | dfae614001dbcd1d1fcaaf4291392367088e8a9a | /springboot-helloworld/src/main/java/com/wxn/HelloWorldApplication.java | 02f2a647a8ab92e2c2ee671bd1afbfd62735e600 | [] | no_license | 649733108/spring-boot-learn | b960ec5e9f645d481596d8e00c640a8f3c396d09 | 09e76b19fd6dce2cdaeaadac702f17b0097e22b9 | refs/heads/master | 2020-04-11T00:14:15.869127 | 2018-12-15T12:05:24 | 2018-12-15T12:05:24 | 161,380,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 351 | java | package com.wxn;
/*
* Created by wxn
* 2018/12/5 22:46
*/
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HelloWorldApplication {
public static void main(String args[]) {
SpringApplication.run(HelloWorldApplication.class,args);
}
}
| [
"649733108@qq.com"
] | 649733108@qq.com |
98dfdbeb1324f204bd60926065120e7fda37b57c | bd4697140d01c6b689ac2e9b1e4fdbe22dfa88e8 | /src/main/java/io/fip/client/ApiResponse.java | e0c49c7360b734d4f21cec960a53e8e64fa5caa6 | [] | no_license | APIHub-CdC/financial-index-profile-client-java | 4abc929dc802d0759d7fe7b6a44360cbd04e532b | 5f6674cfb484339f6424161f661dd3d8347be0e7 | refs/heads/master | 2022-06-15T01:06:24.858896 | 2020-04-27T21:31:39 | 2020-04-27T21:31:39 | 249,558,541 | 0 | 0 | null | 2022-05-20T21:30:35 | 2020-03-23T22:31:17 | Java | UTF-8 | Java | false | false | 648 | java | package io.fip.client;
import java.util.List;
import java.util.Map;
public class ApiResponse<T> {
final private int statusCode;
final private Map<String, List<String>> headers;
final private T data;
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
this(statusCode, headers, null);
}
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
this.statusCode = statusCode;
this.headers = headers;
this.data = data;
}
public int getStatusCode() {
return statusCode;
}
public Map<String, List<String>> getHeaders() {
return headers;
}
public T getData() {
return data;
}
}
| [
"macr243@gmail.com"
] | macr243@gmail.com |
1da9da2591ecc451d3c701b06bd5bd63db0c221b | c9150beb32bba6e8dd18b635c7df395c5bd4adf0 | /lec14/countmazepath.java | f9dfaec02be2cdc1aa4f1b748fb667fb7be94397 | [] | no_license | kadyanashish/Code | 9360ebac4dc6567bb47fd43724f20308ad3c19b3 | 3cb7ce8125f9c9e61a0e4d7c48b5088f30fbbb51 | refs/heads/master | 2020-03-22T13:58:29.326870 | 2018-07-08T06:55:54 | 2018-07-08T06:55:54 | 140,144,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,798 | java | package lec14;
import java.util.ArrayList;
public class countmazepath {
public static void main(String[] args) {
System.out.println(countmazepath(2, 2, 0, 0));
System.out.println(returnmazepath(2, 2, 0, 0));
preturnmazepath(2, 2, 0, 0, "");
}
public static int countmazepath(int endr, int endc, int currow, int curcol) {
if (endr == currow && endc == curcol) {
return 1;
}
if (currow > endr || curcol > endc) {
return 0;
}
int myresul;
int h = countmazepath(endr, endc, currow, curcol + 1);
int v = countmazepath(endr, endc, currow + 1, curcol);
myresul = h + v;
return myresul;
}
public static ArrayList<String> returnmazepath(int endr, int endc, int currow, int curcol) {
if (endr == currow && endc == curcol) {
ArrayList<String> base = new ArrayList<>();
base.add("");
return base;
}
if (currow > endr || curcol > endc) {
ArrayList<String> base = new ArrayList<>();
return base;
}
ArrayList<String> myresul = new ArrayList<>();
ArrayList<String> h = returnmazepath(endr, endc, currow, curcol + 1);
ArrayList<String> v = returnmazepath(endr, endc, currow + 1, curcol);
for (int i = 0; i < h.size(); i++) {
myresul.add("h" + h.get(i));
}
for (int i = 0; i < v.size(); i++) {
myresul.add("v" + v.get(i));
}
return myresul;
}
public static void preturnmazepath(int endr, int endc, int currow, int curcol, String s) {
if (endr == currow && endc == curcol) {
System.out.println(s);
return;
}
if (currow > endr || curcol > endc) {
return;
}
preturnmazepath(endr, endc, currow, curcol + 1, s + "h");
preturnmazepath(endr, endc, currow + 1, curcol, s + "v");
preturnmazepath(endr, endc, currow + 1, curcol + 1, s + "d");
}
}
| [
"kadyan1812@gmail.com"
] | kadyan1812@gmail.com |
d8b971027c1b86b26089f27a27a57644e84e7ac6 | 8c28c9d26ea931179f798288492362c9e0d0caa3 | /motel-dashboard/src/main/java/com/binh/motel/repository/MessageLineRepository.java | 58a34b6e70914560c681cab261ae583bc6708abc | [] | no_license | binhdep/motel_room | 982b951c6a025e0b825e52d9a8242e050eff8c6c | 81859752d302adc84673abad0e1464860213cf40 | refs/heads/main | 2023-08-19T07:48:19.368991 | 2021-10-07T03:58:46 | 2021-10-07T03:58:46 | 414,447,133 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 230 | java | package com.binh.motel.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.binh.motel.entity.MessageLine;
public interface MessageLineRepository extends JpaRepository<MessageLine, Integer> {
}
| [
"binh050598@gmail.com"
] | binh050598@gmail.com |
298db0058d3a4110130e1a61a651a5533df6a7e8 | cdd87204a5c8576f39daa7b027406a8787ca4628 | /app/src/main/java/yc/com/pinyin_study/base/activity/WebActivity.java | 1a6b714391b1dd39733fc0ffb7bdc91df221c475 | [] | no_license | YangChengTeam/pingyin-study | 0016b9662088b221da627f17131336ea541ce26c | d1724abadc989e946ab6e94449aaa0106d9b4493 | refs/heads/master | 2022-02-18T11:05:13.811404 | 2022-02-11T06:07:30 | 2022-02-11T06:07:30 | 174,971,529 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,240 | java | package yc.com.pinyin_study.base.activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.ProgressBar;
import butterknife.BindView;
import yc.com.base.BaseActivity;
import yc.com.pinyin_study.R;
import yc.com.pinyin_study.base.widget.CommonWebView;
import yc.com.pinyin_study.base.widget.MainToolBar;
/**
* Created by wanglin on 2018/11/8 15:03.
*/
public class WebActivity extends BaseActivity {
@BindView(R.id.main_toolbar)
MainToolBar mainToolbar;
@BindView(R.id.progressBar)
ProgressBar progressBar;
@BindView(R.id.commonWebView)
CommonWebView commonWebView;
private String url = "http://en.upkao.com/";
public static void startActivity(Context context, String url, String title) {
Intent intent = new Intent(context, WebActivity.class);
intent.putExtra("url", url);
intent.putExtra("title", title);
context.startActivity(intent);
}
@Override
public boolean isStatusBarMateria() {
return true;
}
@Override
public int getLayoutId() {
return R.layout.activity_web;
}
@Override
public void init() {
url = getIntent().getStringExtra("url");
String title = getIntent().getStringExtra("title");
mainToolbar.setTitle(title);
mainToolbar.showNavigationIcon();
mainToolbar.init(this);
mainToolbar.setRightContainerVisible(false);
commonWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
if (progressBar.getVisibility() == View.GONE) {
progressBar.setVisibility(View.VISIBLE);
}
progressBar.setProgress(newProgress);
if (newProgress == 100) {
progressBar.setVisibility(View.GONE);
}
}
});
commonWebView.loadUrl(url);
}
}
| [
"2037097758@qq.com"
] | 2037097758@qq.com |
17b898c26c3baa00f62deb63c2ba53af8ccb7c6d | 1729aacbae773659f73b6cc08efd1f51c1bb7060 | /frame/src/androidTest/java/com/dreampany/framekit/ExampleInstrumentedTest.java | 13e238c84e5b4dec093d40ebabf5216be5bb824c | [
"Apache-2.0"
] | permissive | NerdFaisal404/framework | e6b33a18bd2b4507a4ab508f08aef012523eac44 | e3bd049a89e9451a041e0208841e8736eb06cecf | refs/heads/master | 2021-06-27T06:54:41.673501 | 2017-09-18T15:59:52 | 2017-09-18T16:02:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package com.dreampany.frame;
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.*;
/**
* Instrumentation 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.ringbyte.framekit.test", appContext.getPackageName());
}
}
| [
"ringbyte@gmail.com"
] | ringbyte@gmail.com |
a317cdbd0a54f0f0dc1de0e3685f847460818afc | 8d73ca08c18d09ce8219be15a74e32102f520a24 | /src/main/java/utfpr/ct/dainf/pratica/PontoXZ.java | d5f3df4be0fae613f4957d5ef4e78def5911381a | [] | no_license | rlmpg/provaa2 | 7d2e99f0c183ba43f783716ac3a7b469433d3222 | a7f1ecdc99d76645194bbb84fffdf6adf07f76e1 | refs/heads/master | 2020-03-16T16:30:34.973404 | 2018-05-09T17:20:22 | 2018-05-09T17:20:22 | 132,791,297 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | 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 utfpr.ct.dainf.pratica;
/**
*
* @author Residente
*/
public class PontoXZ extends Ponto2D{
public PontoXZ(){
super();
}
public PontoXZ(double x, double z){
super(x, 0, z);
}
@Override
public String toString(){
//nome-da-classe(x,y,z)
String res = this.getNome()+"("+this.getX()+","+this.getZ()+")";
return res;
}
}
| [
"Filipe@Filipe-PC"
] | Filipe@Filipe-PC |
0feb113c8347bedc1ac6d96e5388f96280dc7644 | 26b7f30c6640b8017a06786e4a2414ad8a4d71dd | /src/number_of_direct_superinterfaces/i48109.java | b36535153682dd06e49a9b0c254b66814c38294b | [] | no_license | vincentclee/jvm-limits | b72a2f2dcc18caa458f1e77924221d585f23316b | 2fd1c26d1f7984ea8163bc103ad14b6d72282281 | refs/heads/master | 2020-05-18T11:18:41.711400 | 2014-09-14T04:25:18 | 2014-09-14T04:25:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69 | java | package number_of_direct_superinterfaces;
public interface i48109 {} | [
"vincentlee.dolbydigital@yahoo.com"
] | vincentlee.dolbydigital@yahoo.com |
3f00ebc8b3f61d613db8aaeadf600172e1965a85 | 4bb5c1c0a696389e4de37bae8b4105cf0aad54b2 | /src/main/java/com/howtographql/hackernews/LinkRepository.java | b473bee55f213bdde160e79efc08cc50b7a0aa15 | [] | no_license | CodecoolBP20172/hackernews-graphql-java-PeterBernath | e5ea9a205909b1c7f68b8dc5e7bdea5114da884f | 0eac6d3f21ace7218b26673fc2c482a1ee5686bb | refs/heads/master | 2020-03-21T21:12:23.233446 | 2018-06-28T17:57:56 | 2018-06-28T17:57:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,042 | java | package com.howtographql.hackernews;
import com.mongodb.client.MongoCollection;
import org.bson.Document;
import java.util.ArrayList;
import java.util.List;
public class LinkRepository {
private final MongoCollection<Document> links;
public LinkRepository(MongoCollection<Document> links) {
this.links = links;
}
public List<Link> getAllLinks() {
List<Link> allLinks = new ArrayList<>();
for (Document doc : links.find()) {
Link link = new Link(
doc.get("_id").toString(),
doc.getString("url"),
doc.getString("description"),
doc.getString("postedBy")
);
allLinks.add(link);
}
return allLinks;
}
public void saveLink(Link link) {
Document doc = new Document();
doc.append("url", link.getUrl());
doc.append("description", link.getDescription());
doc.append("postedBy", link.getUserId());
links.insertOne(doc);
}
}
| [
"berc0@Peters-MacBook-Pro.local"
] | berc0@Peters-MacBook-Pro.local |
3a5af16b9eaa3d1bd4f37bfb8258146d589a21ed | 62f35048e106e8df611a0bcdb0f24b8be7a303d8 | /qtiplayer/src/com/qtitools/player/client/controller/messages/ExtendedPopupPanelDisplayEventListener.java | 952300936914dfa39ab3d69422a55633d5dc50fb | [
"MIT"
] | permissive | aktet/qti-player | a207949c1e24b1f9c0a35482163cbfa40d43e3c7 | fcbf9298bc9f2851178e73e6ff4091add7c0e93a | refs/heads/master | 2020-04-05T23:46:29.536849 | 2011-12-04T13:52:10 | 2011-12-04T13:52:10 | 33,256,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 191 | java | package com.qtitools.player.client.controller.messages;
public interface ExtendedPopupPanelDisplayEventListener {
public void onMessageHided();
public void onMessageAttaching();
}
| [
"rafal.rybacki@17d68a0d-d843-0410-9017-7787d5464fed"
] | rafal.rybacki@17d68a0d-d843-0410-9017-7787d5464fed |
f1eb7bf7a3d8b49490b7df378af839f771aa90ab | 2f85d3c4d5bf44c61db1452b95403f31c204979e | /Documentos/[3.CONSTRUCCION]/Iteracion 5/MQPY_Codigo Fuente/Maquipuray_apk_V3/Maquipuray_apk_transporte/app/src/main/java/com/maquipuray/maquipuray_apk_transporte/data/remote/WebServicesAPIService.java | 627e2aad50d147ddfbf21cf596114460e9c5f56c | [] | no_license | aldolopezm/MAQUIPURAY | 699be3838afa0c0f09e95bbc9855d9db48ea6122 | 0e5d70c1efacca102e517e2c89b57e31a34b2d9b | refs/heads/master | 2022-12-08T04:37:30.168167 | 2020-08-25T23:50:51 | 2020-08-25T23:50:51 | 268,182,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,282 | java | package com.maquipuray.maquipuray_apk_transporte.data.remote;
import com.maquipuray.maquipuray_apk_transporte.data.remote.model.ApiResponse;
import com.maquipuray.maquipuray_apk_transporte.data.remote.model.PedidosResponse;
import com.maquipuray.maquipuray_apk_transporte.data.remote.model.Usuario;
import com.maquipuray.maquipuray_apk_transporte.data.remote.model.UsuarioResponse;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
public interface WebServicesAPIService {
//Sending Json Object - example php webservices
// @Headers("Content-Type: application/json")
// @POST("restaurante")
// Call<ResponseRestaurant> sendRestaurant(@Body Restaurante restaurante);
@FormUrlEncoded
@POST("enviarnotificacion.php")
Call<ResponseBody> sendnotificacion(@Field("nuevoToken") String email, @Field("imei") String password, @Field("appDetails") String appName);
// @Headers("Content-Type: application/json")
// @GET("CategoriaListarJson")
// Call<ApiResponse<CategoriaResponse> > getCategorias(@Header("Authorization") String token);
//
// @Headers("Content-Type: application/json")
// @GET("PromocionListarCategoriaJson")
// Call<ApiResponse<PromocionResponse> > getPromocionesXCategoria(@Header("Authorization") String token,
// @Query("idCategoria") int idCategoria);
@Headers("Content-Type: application/json")
@GET("PedidoListarJson")
Call<ApiResponse<PedidosResponse>> getPedidos(@Header("Authorization") String token);
@POST("PedidoRegistrarJson")
Call<ResponseBody> registrarPedido(@Header("Authorization") String token, @Field("idUsuario") int idUsuario, @Field("idPromocion") int idPromocion);
@FormUrlEncoded
@POST("UsuarioAutenticarMovilJson")
Call<ResponseBody> autenticarUsuario(@Field("email") String email, @Field("password") String password);
@Headers("Content-Type: application/json")
@POST("UsuarioRegistrarClienteMovilJson")
Call<ResponseBody> registrarUsuario(@Body Usuario usuario);
}
| [
"65749882+aldolopezm@users.noreply.github.com"
] | 65749882+aldolopezm@users.noreply.github.com |
db73da9fab06e23751e5cd6b9d327494cb52d30b | a0ccb9e6a54404bbb4bbf5b3adfec525bcbe6e69 | /app/src/main/java/com/windweather/android/chooseAreaFragement.java | ea82d124baa0fd1c91f75d5b05d8d046027dd685 | [
"Apache-2.0"
] | permissive | alonglooks/windweather | dfe335fb2f4fd388ca68da101aa88b7f7714793e | 18e752bb57328e2088e1a1781be3a009efda408b | refs/heads/master | 2020-03-18T20:35:34.061843 | 2018-07-04T12:50:28 | 2018-07-04T12:50:28 | 135,226,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,772 | java | package com.windweather.android;
;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
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.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.windweather.android.db.City;
import com.windweather.android.db.County;
import com.windweather.android.db.Province;
import com.windweather.android.util.OkHttpUtil;
import com.windweather.android.util.Utility;
import org.litepal.crud.DataSupport;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import okhttp3.Call;
import okhttp3.Response;
/**
* Created by jiepeng on 2018/6/13.
*/
public class chooseAreaFragement extends Fragment {
public static final int LEVEL_PROVINCE = 0;
public static final int LEVEL_CITY = 1;
public static final int LEVEL_COUNTY = 2;
public ProgressDialog progressDialog;
private boolean result;
private TextView titleText;
private Button backButton;
private ListView listView;
private ArrayAdapter<String> adapter;
private List<String> datalist = new ArrayList<>();
//省列表
private List<Province> provinceList;
//市列表
private List<City> cityList;
//县列表
private List<County> countyList;
//选中的省份
private Province selectedProvince;
//选中的市
private City selectedCity;
//当前选中的级别
private int currentLevel;
private String weatherId;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.choose_area, container, false);
titleText = view.findViewById(R.id.title_text);
backButton = view.findViewById(R.id.back_button);
listView = view.findViewById(R.id.list_view);
adapter = new ArrayAdapter<>(Myapplication.getMyapplication(), android.R.layout.simple_list_item_1, datalist);
listView.setAdapter(adapter);
return view;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if (currentLevel == LEVEL_PROVINCE){
selectedProvince = provinceList.get(i);
queryCities();
}else if (currentLevel == LEVEL_CITY){
selectedCity = cityList.get(i);
queryCounties();
}else if (currentLevel == LEVEL_COUNTY){
weatherId = countyList.get(i).getmWeatherId();
if (getActivity() instanceof MainActivity) {
Intent intent = new Intent(getActivity(), WeatherActivity.class);
intent.putExtra("weather_id", weatherId);
startActivity(intent);
getActivity().finish();
}else if (getActivity() instanceof WeatherActivity){
WeatherActivity weatherActivity = (WeatherActivity) getActivity();
weatherActivity.drawerLayout.closeDrawers();
weatherActivity.swipeRefresh.setRefreshing(true);
weatherActivity.requestWeathe(weatherId);
}
}
}
});
backButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (currentLevel == LEVEL_COUNTY){
queryCities();
}else if (currentLevel == LEVEL_CITY){
queryProvinces();
}
}
});
queryProvinces();
}
private void queryCities() {
titleText.setText(selectedProvince.getmProvinceName());
backButton.setVisibility(View.VISIBLE);
cityList = DataSupport.where("mprovinceid = ?",String.valueOf(selectedProvince.getId())).find(City.class);
if (cityList.size() > 0){
datalist.clear();
for (City city : cityList){
datalist.add(city.getmCityName());
}
adapter.notifyDataSetChanged();
listView.setSelection(0);
currentLevel = LEVEL_CITY;
}else {
int provinceCode = selectedProvince.getmProivinceCode();
String address = "http://guolin.tech/api/china/" + provinceCode;
queryFromServer(address,"city");
}
}
private void queryProvinces() {
titleText.setText("中国");
backButton.setVisibility(View.GONE);
provinceList = DataSupport.findAll(Province.class);
if (provinceList.size() > 0){
datalist.clear();
for (Province province:provinceList){
datalist.add(province.getmProvinceName());
}
adapter.notifyDataSetChanged();
listView.setSelection(0);
currentLevel = LEVEL_PROVINCE;
}else {
String address = "http://guolin.tech/api/china";
queryFromServer(address,"province");
}
}
private void queryFromServer(String address, final String type) {
OkHttpUtil.sendOkHttpRequest(address, new okhttp3.Callback() {
@Override
public void onFailure(Call call, IOException e) {
Toast.makeText(Myapplication.getMyapplication(),"数据失败",Toast.LENGTH_SHORT).show();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
showProgressDialog();
String responseText = response.body().string();
if ("province".equals(type)){
result = Utility.handleProvinceResponse(responseText);
}else if ("city".equals(type)){
result = Utility.handleCityResponse(responseText, selectedProvince.getId());
}else if ("county".equals(type)){
result = Utility.handCountyResponse(responseText,selectedCity.getId());
}
if (result){
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
closeProgessDialog();
if ("province".equals(type)){
queryProvinces();
}else if ("city".equals(type)){
queryCities();
}else if ("county".equals(type)){
queryCounties();
}
}
});
}
}
});
}
private void queryCounties() {
titleText.setText(selectedCity.getmCityName());
countyList = DataSupport.where(" mcityid = ?",String.valueOf(selectedCity.getId())).find(County.class);
if (countyList.size() > 0){
datalist.clear();
for (County county:countyList){
datalist.add(county.getmCountyName());
adapter.notifyDataSetChanged();
listView.setSelection(0);
currentLevel = LEVEL_COUNTY;
}
}else {
int provinceCode = selectedProvince.getmProivinceCode();
int cityCode = selectedCity.getmCityCode();
String address = "http://guolin.tech/api/china/" + provinceCode +"/" + cityCode;
queryFromServer(address,"county");
}
}
private void closeProgessDialog() {
if (progressDialog != null){
progressDialog.dismiss();
}
}
private void showProgressDialog() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (progressDialog == null){
progressDialog = new ProgressDialog(getActivity());
progressDialog.setMessage("正在加载");
progressDialog.setCanceledOnTouchOutside(false);
}
progressDialog.show();
}
});
}
}
| [
"tony@gmail.com"
] | tony@gmail.com |
d52aa60f4aa8dffcc2be4f103a3dbb1c8fcd5728 | ec443cf1351a30b8e98be0582e386c0067fa9040 | /src/main/java/br/org/vilicum/constant/Constantes.java | 6bedb5f5e4d23ffadab0f00fd7ec6af7517b4192 | [] | no_license | akctba/vilicum | f7ae6056e995f5c85bc36fe76a9e8dc34a6d155d | bd49de5dcc225580acdcef6794cb815d4cbf9fe1 | refs/heads/master | 2023-03-04T07:42:32.396870 | 2023-02-22T15:11:05 | 2023-02-22T15:11:05 | 206,687,263 | 0 | 0 | null | 2023-02-22T15:11:06 | 2019-09-06T01:24:21 | Java | UTF-8 | Java | false | false | 303 | java | package br.org.vilicum.constant;
public interface Constantes {
public static final String COMUNGANTES = "Comungantes";
public static final String NAO_COMUNGANTES = "Não-Comungantes";
public static final String HOME = "/home/alex/";
public static final String FOTOS = "/home/alex/fotos/";
}
| [
"akctba@gmail.com"
] | akctba@gmail.com |
e85f32a1031292a88c7f99adc3abdbf77931be96 | efe896deae81237795288edbaeaf80ff7920edd1 | /boot-with-axon/src/main/java/cn/boxfish/boot/Application.java | a2e4ef74e29fbf404011300301b5a26d3a7fc92c | [] | no_license | boxfish-project/boxfish-samples | 270178867366b2f50a4132f17c48de2d52c1eb43 | 4d0d42af15dc70dd73b454f514f42225aaf0db8e | refs/heads/master | 2016-09-06T14:53:36.001896 | 2015-09-26T02:42:10 | 2015-09-26T02:42:10 | 37,755,288 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 882 | java | package cn.boxfish.boot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.ImportResource;
/**
* Created by undancer on 15/6/20.
*/
@SpringBootApplication(exclude = {})
@ImportResource("classpath*:META-INF/spring.xml")
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
// System.exit(SpringApplication.exit(SpringApplication.run(Application.class, args)));
SpringApplication.run(Application.class, args);
}
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return super.configure(builder);
}
}
| [
"undancer@gmail.com"
] | undancer@gmail.com |
96b937c0829b24190892754dec1e1aef07fa7612 | 95aa0f474fe675cb45e66c43863dc697e0f13637 | /app/src/main/java/com/marverenic/music/ui/nowplaying/NowPlayingFragment.java | aa1c345ab7b181064e2731ec64c4ebc285df4538 | [
"Apache-2.0"
] | permissive | uzen/Jockey | 2d5a66b3182f3cc82127b431c9b05213677f732f | 38aa0ca61701ae790b27153b33dad60e388ab7a5 | refs/heads/master | 2021-08-16T11:42:25.436440 | 2017-11-18T18:27:19 | 2017-11-18T18:27:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,948 | java | package com.marverenic.music.ui.nowplaying;
import android.databinding.DataBindingUtil;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.Snackbar;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.marverenic.music.BR;
import com.marverenic.music.JockeyApplication;
import com.marverenic.music.R;
import com.marverenic.music.data.store.PreferenceStore;
import com.marverenic.music.databinding.FragmentNowPlayingBinding;
import com.marverenic.music.ui.common.playlist.AppendPlaylistDialogFragment;
import com.marverenic.music.ui.common.playlist.CreatePlaylistDialogFragment;
import com.marverenic.music.model.Song;
import com.marverenic.music.player.MusicPlayer;
import com.marverenic.music.player.PlayerController;
import com.marverenic.music.player.PlayerState;
import com.marverenic.music.ui.BaseFragment;
import com.marverenic.music.view.TimeView;
import com.trello.rxlifecycle.FragmentEvent;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import timber.log.Timber;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.support.design.widget.Snackbar.LENGTH_LONG;
import static android.support.design.widget.Snackbar.LENGTH_SHORT;
public class NowPlayingFragment extends BaseFragment implements Toolbar.OnMenuItemClickListener,
NumberPickerDialogFragment.OnNumberPickedListener,
DurationPickerDialogFragment.OnDurationPickedListener {
private static final String TAG_MAKE_PLAYLIST = "CreatePlaylistDialog";
private static final String TAG_APPEND_PLAYLIST = "AppendPlaylistDialog";
private static final String TAG_MULTI_REPEAT_PICKER = "MultiRepeatPickerDialog";
private static final String TAG_SLEEP_TIMER_PICKER = "SleepTimerPickerDialog";
private static final int DEFAULT_MULTI_REPEAT_VALUE = 3;
@Inject PreferenceStore mPrefStore;
@Inject PlayerController mPlayerController;
private FragmentNowPlayingBinding mBinding;
private NowPlayingArtworkViewModel mArtworkViewModel;
private MenuItem mCreatePlaylistMenuItem;
private MenuItem mAppendToPlaylistMenuItem;
private MenuItem mRepeatMenuItem;
private MenuItem mShuffleMenuItem;
private Subscription mSleepTimerSubscription;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
JockeyApplication.getComponent(this).inject(this);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_now_playing,
container, false);
mArtworkViewModel = new NowPlayingArtworkViewModel(this);
mBinding.setArtworkViewModel(mArtworkViewModel);
setupToolbar(mBinding.nowPlayingToolbar);
mPlayerController.getSleepTimerEndTime()
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(this::updateSleepTimerCounter, throwable -> {
Timber.e(throwable, "Failed to update sleep timer end timestamp");
});
mPlayerController.getInfo()
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(this::showSnackbar, throwable -> {
Timber.e(throwable, "Failed to display info message");
});
mPlayerController.getError()
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(this::showSnackbar, throwable -> {
Timber.e(throwable, "Failed to display error message");
});
return mBinding.getRoot();
}
@Override
public void onResume() {
mArtworkViewModel.notifyPropertyChanged(BR.gesturesEnabled);
super.onResume();
}
private void setupToolbar(Toolbar toolbar) {
if (getResources().getConfiguration().orientation != ORIENTATION_LANDSCAPE) {
toolbar.setBackground(new ColorDrawable(Color.TRANSPARENT));
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
toolbar.setElevation(getResources().getDimension(R.dimen.header_elevation));
}
toolbar.setTitle("");
toolbar.setNavigationIcon(R.drawable.ic_clear_24dp);
toolbar.inflateMenu(R.menu.activity_now_playing);
toolbar.setOnMenuItemClickListener(this);
toolbar.setNavigationOnClickListener(v -> {
getActivity().onBackPressed();
});
mCreatePlaylistMenuItem = toolbar.getMenu().findItem(R.id.menu_now_playing_save);
mAppendToPlaylistMenuItem = toolbar.getMenu().findItem(R.id.menu_now_playing_append);
mShuffleMenuItem = toolbar.getMenu().findItem(R.id.menu_now_playing_shuffle);
mRepeatMenuItem = toolbar.getMenu().findItem(R.id.menu_now_playing_repeat);
mPlayerController.getQueue()
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.map(this::queueContainsLocalSongs)
.subscribe(this::updatePlaylistActionEnabled, throwable -> {
Timber.e(throwable, "Failed to update playlist enabled state");
});
mPlayerController.isShuffleEnabled()
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(this::updateShuffleIcon, throwable -> {
Timber.e(throwable, "Failed to update shuffle icon");
});
mPlayerController.getRepeatMode()
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(this::updateRepeatIcon, throwable -> {
Timber.e(throwable, "Failed to update repeat icon");
});
}
private boolean queueContainsLocalSongs(List<Song> queue) {
for (Song song : queue) {
if (song.isInLibrary()) {
return true;
}
}
return false;
}
private void updatePlaylistActionEnabled(boolean canCreatePlaylist) {
mCreatePlaylistMenuItem.setEnabled(canCreatePlaylist);
mAppendToPlaylistMenuItem.setEnabled(canCreatePlaylist);
}
private void updateShuffleIcon(boolean shuffled) {
if (shuffled) {
mShuffleMenuItem.getIcon().setAlpha(255);
mShuffleMenuItem.setTitle(getResources().getString(R.string.action_disable_shuffle));
} else {
mShuffleMenuItem.getIcon().setAlpha(128);
mShuffleMenuItem.setTitle(getResources().getString(R.string.action_enable_shuffle));
}
}
private void updateRepeatIcon(int repeatMode) {
@DrawableRes int icon;
boolean active = true;
if (repeatMode > 1) {
switch (repeatMode) {
case 2:
icon = R.drawable.ic_repeat_two_24dp;
break;
case 3:
icon = R.drawable.ic_repeat_three_24dp;
break;
case 4:
icon = R.drawable.ic_repeat_four_24dp;
break;
case 5:
icon = R.drawable.ic_repeat_five_24dp;
break;
case 6:
icon = R.drawable.ic_repeat_six_24dp;
break;
case 7:
icon = R.drawable.ic_repeat_seven_24dp;
break;
case 8:
icon = R.drawable.ic_repeat_eight_24dp;
break;
case 9:
default:
icon = R.drawable.ic_repeat_nine_24dp;
break;
}
} else if (mPrefStore.getRepeatMode() == MusicPlayer.REPEAT_ALL) {
icon = R.drawable.ic_repeat_24dp;
} else if (mPrefStore.getRepeatMode() == MusicPlayer.REPEAT_ONE) {
icon = R.drawable.ic_repeat_one_24dp;
} else {
icon = R.drawable.ic_repeat_24dp;
active = false;
}
mRepeatMenuItem.setIcon(icon);
mRepeatMenuItem.getIcon().setAlpha(active ? 255 : 128);
}
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_now_playing_shuffle:
toggleShuffle();
return true;
case R.id.menu_now_playing_repeat:
showRepeatMenu();
return true;
case R.id.menu_now_playing_sleep_timer:
mPlayerController.getSleepTimerEndTime()
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.take(1)
.subscribe(this::showSleepTimerDialog, throwable -> {
Timber.e(throwable, "Failed to show sleep timer dialog");
});
return true;
case R.id.menu_now_playing_save:
saveQueueAsPlaylist();
return true;
case R.id.menu_now_playing_append:
addQueueToPlaylist();
return true;
case R.id.menu_now_playing_clear:
clearQueue();
return true;
}
return false;
}
private void toggleShuffle() {
mPrefStore.toggleShuffle();
mPlayerController.updatePlayerPreferences(mPrefStore);
if (mPrefStore.isShuffled()) {
showSnackbar(R.string.confirm_enable_shuffle);
} else {
showSnackbar(R.string.confirm_disable_shuffle);
}
}
private void showRepeatMenu() {
View anchor = mBinding.getRoot().findViewById(R.id.menu_now_playing_repeat);
PopupMenu menu = new PopupMenu(getContext(), anchor, Gravity.END);
menu.inflate(R.menu.activity_now_playing_repeat);
menu.setOnMenuItemClickListener(item -> {
switch (item.getItemId()) {
case R.id.menu_item_repeat_all:
changeRepeatMode(MusicPlayer.REPEAT_ALL, R.string.confirm_enable_repeat);
return true;
case R.id.menu_item_repeat_none:
changeRepeatMode(MusicPlayer.REPEAT_NONE, R.string.confirm_disable_repeat);
return true;
case R.id.menu_item_repeat_one:
changeRepeatMode(MusicPlayer.REPEAT_ONE, R.string.confirm_enable_repeat_one);
return true;
case R.id.menu_item_repeat_multi:
showMultiRepeatDialog();
return true;
default:
return false;
}
});
menu.show();
}
private void changeRepeatMode(int repeatMode, @StringRes int confirmationMessage) {
mPrefStore.setRepeatMode(repeatMode);
mPlayerController.setMultiRepeatCount(0);
mPlayerController.updatePlayerPreferences(mPrefStore);
showSnackbar(confirmationMessage);
}
private void showSleepTimerDialog(long currentSleepTimerEndTime) {
long timeLeftInMs = currentSleepTimerEndTime - System.currentTimeMillis();
int defaultValue;
if (timeLeftInMs > 0) {
long minutes = TimeUnit.MINUTES.convert(timeLeftInMs, TimeUnit.MILLISECONDS);
long seconds = TimeUnit.SECONDS.convert(timeLeftInMs, TimeUnit.MILLISECONDS) % 60;
defaultValue = (int) minutes + ((seconds >= 30) ? 1 : 0);
defaultValue = Math.max(defaultValue, 1);
} else {
long prevTimeInMillis = mPrefStore.getLastSleepTimerDuration();
defaultValue = (int) TimeUnit.MINUTES.convert(prevTimeInMillis, TimeUnit.MILLISECONDS);
}
new DurationPickerDialogFragment.Builder(this)
.setMinValue(1)
.setDefaultValue(defaultValue)
.setMaxValue(120)
.setTitle(getString(R.string.enable_sleep_timer))
.setDisableButtonText((timeLeftInMs > 0)
? getString(R.string.action_disable_sleep_timer)
: null)
.show(TAG_SLEEP_TIMER_PICKER);
}
@Override
public void onDurationPicked(int durationInMinutes) {
// Callback for when a sleep timer value is chosen
if (durationInMinutes == DurationPickerDialogFragment.NO_VALUE) {
mPlayerController.disableSleepTimer();
showSnackbar(R.string.confirm_disable_sleep_timer);
return;
}
long durationInMillis = TimeUnit.MILLISECONDS.convert(durationInMinutes, TimeUnit.MINUTES);
long endTimestamp = System.currentTimeMillis() + durationInMillis;
mPlayerController.setSleepTimerEndTime(endTimestamp);
String confirmationMessage = getResources().getQuantityString(
R.plurals.confirm_enable_sleep_timer, durationInMinutes, durationInMinutes);
showSnackbar(confirmationMessage);
mPrefStore.setLastSleepTimerDuration(durationInMillis);
}
private void updateSleepTimerCounter(long endTimestamp) {
TimeView sleepTimerCounter = mBinding.nowPlayingSleepTimer;
long sleepTimerValue = endTimestamp - System.currentTimeMillis();
if (mSleepTimerSubscription != null) {
mSleepTimerSubscription.unsubscribe();
}
if (sleepTimerValue <= 0) {
sleepTimerCounter.setVisibility(View.GONE);
} else {
sleepTimerCounter.setVisibility(View.VISIBLE);
sleepTimerCounter.setTime((int) sleepTimerValue);
mSleepTimerSubscription = Observable.interval(500, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.computation())
.map(tick -> (int) (sleepTimerValue - 500 * tick))
.observeOn(AndroidSchedulers.mainThread())
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.subscribe(time -> {
sleepTimerCounter.setTime(time);
if (time <= 0) {
mSleepTimerSubscription.unsubscribe();
animateOutSleepTimerCounter();
}
}, throwable -> {
Timber.e(throwable, "Failed to update sleep timer value");
});
}
}
private void animateOutSleepTimerCounter() {
TimeView sleepTimerCounter = mBinding.nowPlayingSleepTimer;
Animation transition = AnimationUtils.loadAnimation(getContext(), R.anim.tooltip_out_down);
transition.setStartOffset(250);
transition.setDuration(300);
transition.setInterpolator(getContext(), android.R.interpolator.accelerate_quint);
sleepTimerCounter.startAnimation(transition);
new Handler().postDelayed(() -> sleepTimerCounter.setVisibility(View.GONE), 550);
}
private void showMultiRepeatDialog() {
mPlayerController.getRepeatMode().take(1).subscribe(currentCount -> {
new NumberPickerDialogFragment.Builder(this)
.setMinValue(2)
.setMaxValue(10)
.setDefaultValue((currentCount > 1)
? currentCount
: DEFAULT_MULTI_REPEAT_VALUE)
.setWrapSelectorWheel(false)
.setTitle(getString(R.string.enable_multi_repeat_title))
.setMessage(getString(R.string.multi_repeat_description))
.show(TAG_MULTI_REPEAT_PICKER);
}, throwable -> {
Timber.e(throwable, "Failed to show multi repeat dialog");
});
}
@Override
public void onNumberPicked(int chosen) {
// Callback for when a Multi-Repeat value is chosen
mPlayerController.setMultiRepeatCount(chosen);
showSnackbar(getString(R.string.confirm_enable_multi_repeat, chosen));
}
private void saveQueueAsPlaylist() {
mPlayerController.getQueue().take(1).subscribe(queue -> {
new CreatePlaylistDialogFragment.Builder(getFragmentManager())
.setSongs(queue)
.showSnackbarIn(R.id.now_playing_artwork)
.show(TAG_MAKE_PLAYLIST);
}, throwable -> {
Timber.e(throwable, "Failed to save queue as playlist");
});
}
private void addQueueToPlaylist() {
mPlayerController.getQueue()
.compose(bindToLifecycle())
.take(1)
.subscribe(queue -> {
new AppendPlaylistDialogFragment.Builder(getContext(), getFragmentManager())
.setTitle(getString(R.string.header_add_queue_to_playlist))
.setSongs(queue)
.showSnackbarIn(R.id.now_playing_artwork)
.show(TAG_APPEND_PLAYLIST);
}, throwable -> {
Timber.e(throwable, "Failed to add queue to playlist");
});
}
private void clearQueue() {
mPlayerController.getPlayerState()
.compose(this.<PlayerState>bindToLifecycle().forSingle())
.subscribe(playerState -> {
mPlayerController.clearQueue();
Snackbar.make(mBinding.getRoot(), R.string.confirm_clear_queue, LENGTH_LONG)
.setAction(R.string.action_undo, view -> {
mPlayerController.restorePlayerState(playerState);
})
.show();
}, throwable -> {
Timber.e(throwable, "Failed to clear queue");
});
}
private void showSnackbar(@StringRes int stringId) {
showSnackbar(getString(stringId));
}
private void showSnackbar(String message) {
if (((View) mBinding.getRoot().getParent()).getVisibility() == View.VISIBLE) {
Snackbar.make(mBinding.getRoot(), message, LENGTH_SHORT).show();
}
}
}
| [
"marverenic@gmail.com"
] | marverenic@gmail.com |
da8618becac82e8b160051aac29a93aec1c285b4 | d0e7a6d5901b12249fd3d66b8d87e40b70b4646e | /Aufgabe_3_kalah/src/Kalah/MiniMax.java | 8a1ed0636a781da325bcf512ba1b06b5b6241621 | [] | no_license | IZeybek/AI | ba96d94515e09615bd7b0cafe8f1e4da79bfafe7 | 69b9fe2c00895af9304bb2596251570314626a7d | refs/heads/main | 2023-06-19T07:24:55.079147 | 2021-07-18T16:18:36 | 2021-07-18T16:18:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,773 | java | package Kalah;
import java.util.*;
public class MiniMax {
private static int size = 0;
public static int miniMax(KalahBoard board, int depth) {
int v = Integer.MIN_VALUE;
List<KalahBoard> boards = board.possibleActions();
KalahBoard action = null;
for (KalahBoard b : boards) {
int temp = v;
size++;
if(b.isBonus()){
v = Integer.max(v, max(b, depth - 1));
} else {
v = Integer.max(v, min(b, depth - 1));
}
if (temp != v){
action = b;
}
}
int actionIndex = boards.indexOf(action);
System.out.println("size: " + size);
System.out.println("action: " + actionIndex);
size = 0;
return actionIndex;
}
private static int min(KalahBoard board, int depth) {
if (depth == 0 || board.isFinished()){
return board.getAKalah();
}
int v = Integer.MAX_VALUE;
for (KalahBoard b : board.possibleActions()) {
size++;
if(b.isBonus()){
v = Integer.min(v, min(b, depth - 1));
} else {
v = Integer.min(v, max(b, depth - 1));
}
}
return v;
}
private static int max(KalahBoard board, int depth) {
if (depth == 0 || board.isFinished()){
return board.getBKalah();
}
int v = Integer.MIN_VALUE;
for (KalahBoard b : board.possibleActions()) {
size++;
if(b.isBonus()){
v = Integer.max(v, max(b, depth - 1));
} else {
v = Integer.max(v, min(b, depth - 1));
}
}
return v;
}
}
| [
"isyzeybek@outlook.com"
] | isyzeybek@outlook.com |
52c792d523ce9edb39445f4cd07cae5d1b60faac | b2b2f8f927b27855382a55c3d4534e75e94184c3 | /app/src/main/java/com/example/uastkbahmadsiddiq/adapterrumah.java | 0a9d644a415e7906736347831ec42048e54cdf57 | [] | no_license | Swildz/Academic | 25a66e614bedaf8acfdef435f6f247cbd34ad21d | 0a77923d1a51debf31477290f6319dff2194e0fa | refs/heads/main | 2023-06-17T07:07:29.991430 | 2021-07-13T10:25:39 | 2021-07-13T10:25:39 | 385,561,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,375 | java | package com.example.uastkbahmadsiddiq;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.util.List;
public class adapterrumah extends RecyclerView.Adapter<adapterrumah.ViewHolderRumah> {
Context context;
List<rumah> rumahList;
public adapterrumah(Context context, List<rumah> rumahList) {
this.context = context;
this.rumahList = rumahList;
}
@NonNull
@Override
public ViewHolderRumah onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout, null);
return new ViewHolderRumah(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolderRumah holder, int position) {
rumah rumah = rumahList.get(position);
Glide.with(context).load(rumahList.get(position).getGambar())
.into(holder.gambar);
holder.nama.setText(String.valueOf(rumah.getNama()));
holder.keterangan.setText(String.valueOf(rumah.getKeterangan()));
holder.harga.setText(String.valueOf(rumah.getHarga()));
holder.alamat.setText(String.valueOf(rumah.getAlamat()));
holder.latitude.setText(String.valueOf(rumah.getLatitude()));
holder.longitude.setText(String.valueOf(rumah.getLongitude()));
}
@Override
public int getItemCount() {
return rumahList.size();
}
public class ViewHolderRumah extends RecyclerView.ViewHolder {
private ImageView gambar;
private TextView nama, keterangan, harga, alamat, latitude, longitude;
public ViewHolderRumah(@NonNull View itemView) {
super(itemView);
nama = itemView.findViewById(R.id.txtNama);
keterangan = itemView.findViewById(R.id.txtKeterangan);
gambar = itemView.findViewById(R.id.imageRumah);
harga = itemView.findViewById(R.id.txtNama);
alamat = itemView.findViewById(R.id.txtAlamat);
latitude = itemView.findViewById(R.id.txtLat);
longitude = itemView.findViewById(R.id.txtLong);
}
}
} | [
"satupercobaan12@gmail.com"
] | satupercobaan12@gmail.com |
c52abad8b6537fa0b88169bd15a56f0ba2ef8a0c | 92225460ebca1bb6a594d77b6559b3629b7a94fa | /src/com/kingdee/eas/fdc/sellhouse/client/DefaultAmountCreatEditUI.java | cd30cef5e2f4f4d4fbc9dde7ffcac70b314d359a | [] | no_license | yangfan0725/sd | 45182d34575381be3bbdd55f3f68854a6900a362 | 39ebad6e2eb76286d551a9e21967f3f5dc4880da | refs/heads/master | 2023-04-29T01:56:43.770005 | 2023-04-24T05:41:13 | 2023-04-24T05:41:13 | 512,073,641 | 0 | 1 | null | null | null | null | GB18030 | Java | false | false | 13,873 | java | /**
* output package name
*/
package com.kingdee.eas.fdc.sellhouse.client;
import java.awt.event.ActionEvent;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import com.kingdee.bos.BOSException;
import com.kingdee.bos.ctrl.kdf.table.IRow;
import com.kingdee.bos.ctrl.kdf.table.KDTable;
import com.kingdee.bos.ctrl.kdf.table.event.KDTEditEvent;
import com.kingdee.bos.ctrl.kdf.util.editor.ICellEditor;
import com.kingdee.bos.ctrl.kdf.util.style.Styles.HorizontalAlignment;
import com.kingdee.bos.ctrl.swing.KDTextField;
import com.kingdee.bos.ctrl.swing.event.DataChangeEvent;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.framework.DynamicObjectFactory;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.bos.metadata.query.util.CompareType;
import com.kingdee.bos.service.formula.engine.FormulaEngine;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.bos.util.BOSUuid;
import com.kingdee.eas.base.codingrule.CodingRuleException;
import com.kingdee.eas.base.permission.UserInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.common.client.OprtState;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.fdc.basedata.FDCHelper;
import com.kingdee.eas.fdc.basedata.client.FDCClientVerifyHelper;
import com.kingdee.eas.fdc.basedata.client.FDCMsgBox;
import com.kingdee.eas.fdc.sellhouse.BusTypeEnum;
import com.kingdee.eas.fdc.sellhouse.CalculateTypedefaultEnum;
import com.kingdee.eas.fdc.sellhouse.DefaultAmountCreatEntryInfo;
import com.kingdee.eas.fdc.sellhouse.DefaultAmountCreatFactory;
import com.kingdee.eas.fdc.sellhouse.DefaultAmountCreatInfo;
import com.kingdee.eas.fdc.sellhouse.DefaultAmountMangerCollection;
import com.kingdee.eas.fdc.sellhouse.DefaultAmountMangerEntryCollection;
import com.kingdee.eas.fdc.sellhouse.DefaultAmountMangerEntryInfo;
import com.kingdee.eas.fdc.sellhouse.DefaultAmountMangerFactory;
import com.kingdee.eas.fdc.sellhouse.DefaultAmountMangerInfo;
import com.kingdee.eas.fdc.sellhouse.DefaultCollectionFactory;
import com.kingdee.eas.fdc.sellhouse.DefaultCollectionInfo;
import com.kingdee.eas.fdc.sellhouse.MoneyDefineCollection;
import com.kingdee.eas.fdc.sellhouse.MoneyDefineFactory;
import com.kingdee.eas.fdc.sellhouse.MoneyDefineInfo;
import com.kingdee.eas.fdc.sellhouse.PrePurchaseManageInfo;
import com.kingdee.eas.fdc.sellhouse.PrePurchasePayListEntryFactory;
import com.kingdee.eas.fdc.sellhouse.PrePurchasePayListEntryInfo;
import com.kingdee.eas.fdc.sellhouse.PurPayListEntryFactory;
import com.kingdee.eas.fdc.sellhouse.PurPayListEntryInfo;
import com.kingdee.eas.fdc.sellhouse.PurchaseManageInfo;
import com.kingdee.eas.fdc.sellhouse.SHEPayTypeFactory;
import com.kingdee.eas.fdc.sellhouse.SellProjectFactory;
import com.kingdee.eas.fdc.sellhouse.SellProjectInfo;
import com.kingdee.eas.fdc.sellhouse.SignManageFactory;
import com.kingdee.eas.fdc.sellhouse.SignManageInfo;
import com.kingdee.eas.fdc.sellhouse.SignPayListEntryFactory;
import com.kingdee.eas.fdc.sellhouse.SignPayListEntryInfo;
import com.kingdee.eas.fdc.sellhouse.TranBusinessOverViewFactory;
import com.kingdee.eas.fdc.sellhouse.TranBusinessOverViewInfo;
import com.kingdee.eas.fdc.sellhouse.TransactionFactory;
import com.kingdee.eas.fdc.sellhouse.TransactionInfo;
import com.kingdee.eas.framework.ICoreBase;
import com.kingdee.eas.util.SysUtil;
import com.kingdee.eas.util.client.MsgBox;
/**
* 生成违约金界面
*/
public class DefaultAmountCreatEditUI extends AbstractDefaultAmountCreatEditUI
{
private static final Logger logger = CoreUIObject.getLogger(DefaultAmountCreatEditUI.class);
public DefaultAmountCreatEditUI() throws Exception
{
super();
}
public void onLoad() throws Exception
{
this.kdtParent.checkParsed();
this.kdtParent.getStyleAttributes().setLocked(true);
this.kdtParent.getColumn("subDeAmount").getStyleAttributes().setLocked(false);
//计划费用
ICellEditor bigDecimalEditor = CommerceHelper.getKDFormattedTextDecimalEditor();
kdtParent.getColumn("carryAmount").setEditor(bigDecimalEditor);
kdtParent.getColumn("carryAmount").getStyleAttributes().setHorizontalAlign(HorizontalAlignment.RIGHT);
kdtParent.getColumn("carryAmount").getStyleAttributes().setNumberFormat(FDCHelper.getNumberFtm(2));
kdtParent.getColumn("refDeAmount").setEditor(bigDecimalEditor);
kdtParent.getColumn("refDeAmount").getStyleAttributes().setHorizontalAlign(HorizontalAlignment.RIGHT);
kdtParent.getColumn("refDeAmount").getStyleAttributes().setNumberFormat(FDCHelper.getNumberFtm(2));
kdtParent.getColumn("subDeAmount").setEditor(bigDecimalEditor);
kdtParent.getColumn("subDeAmount").getStyleAttributes().setHorizontalAlign(HorizontalAlignment.RIGHT);
kdtParent.getColumn("subDeAmount").getStyleAttributes().setNumberFormat(FDCHelper.getNumberFtm(2));
kdtParent.getColumn("contractAmount").setEditor(bigDecimalEditor);
kdtParent.getColumn("contractAmount").getStyleAttributes().setHorizontalAlign(HorizontalAlignment.RIGHT);
kdtParent.getColumn("contractAmount").getStyleAttributes().setNumberFormat(FDCHelper.getNumberFtm(2));
kdtParent.getColumn("argAmount").setEditor(bigDecimalEditor);
kdtParent.getColumn("argAmount").getStyleAttributes().setHorizontalAlign(HorizontalAlignment.RIGHT);
kdtParent.getColumn("argAmount").getStyleAttributes().setNumberFormat(FDCHelper.getNumberFtm(2));
kdtParent.getColumn("busType").getStyleAttributes().setHided(true);
super.onLoad();
this.txtNumber.setRequired(true);
this.prmtDefCalFormula.setRequired(true);
this.menuTable1.setVisible(false);
this.btnAddLine.setVisible(false);
this.btnInsertLine.setVisible(false);
this.btnRemoveLine.setVisible(false);
this.actionCreateFrom.setVisible(false);
this.actionTraceDown.setVisible(false);
this.actionTraceUp.setVisible(false);
this.actionCopy.setVisible(false);
this.actionCopyFrom.setVisible(false);
this.chkMenuItemSubmitAndAddNew.setVisible(false);
this.chkMenuItemSubmitAndAddNew.setSelected(false);
this.chkMenuItemSubmitAndPrint.setVisible(false);
this.chkMenuItemSubmitAndPrint.setSelected(false);
this.menuBiz.setVisible(false);
this.menuSubmitOption.setVisible(false);
this.actionSave.setVisible(false);
this.actionFirst.setVisible(false);
this.actionNext.setVisible(false);
this.actionLast.setVisible(false);
this.actionPre.setVisible(false);
this.actionViewDoProccess.setVisible(false);
this.actionAddNew.setVisible(false);
this.actionAuditResult.setVisible(false);
this.actionNextPerson.setVisible(false);
this.actionMultiapprove.setVisible(false);
this.actionWorkFlowG.setVisible(false);
this.actionPrint.setVisible(false);
this.actionPrintPreview.setVisible(false);
this.actionCalculator.setVisible(false);
this.actionAudit.setVisible(false);
this.actionEdit.setVisible(false);
this.actionAudit.setVisible(false);
EntityViewInfo view = new EntityViewInfo();
FilterInfo filter = new FilterInfo();
filter.getFilterItems().add(new FilterItemInfo("project.id", editData.getProject().getId()));
view.setFilter(filter);
this.prmtDefCalFormula.setEntityViewInfo(view);
this.pkDefCalDate.setEnabled(false);
this.prmtDefCalFormula.setRequired(true);
}
protected void verifyInput(ActionEvent e) throws Exception {
FDCClientVerifyHelper.verifyEmpty(this, this.prmtDefCalFormula);
}
/**
* 选择计算公式计算违约金
*/
protected void prmtDefCalFormula_dataChanged(DataChangeEvent e) throws Exception {
if (!STATUS_VIEW.equals(this.oprtState)) {
if (this.prmtDefCalFormula.getValue() != null) {
DefaultCollectionInfo dcInfo = (DefaultCollectionInfo) this.prmtDefCalFormula.getValue();
BigDecimal cal = dcInfo.getScale();
for(int i = 0; i < kdtParent.getRowCount(); i++){
IRow row = kdtParent.getRow(i);
DefaultAmountCreatEntryInfo entry=(DefaultAmountCreatEntryInfo)row.getUserObject();
DefaultAmountMangerEntryInfo entryInfo = entry.getDefaultAmountMangerEntry();
TranBusinessOverViewInfo tran=entry.getTranBusinessOverView();
SignPayListEntryInfo signEntryInfo =entry.getSignPayListEntry();
BigDecimal argAmount = entryInfo.getArgAmount();
if (argAmount == null) {
argAmount = FDCHelper.ZERO;
}
if (cal == null) {
cal = FDCHelper.ZERO;
}
if (CalculateTypedefaultEnum.GENERAL.equals(dcInfo.getCalculateType())) {
entryInfo.setReferAmount(argAmount.multiply(cal));// 参考违约金计算
} else if (CalculateTypedefaultEnum.PATULOUS.equals(dcInfo.getCalculateType())) { // 扩展模式
Map valuemap = new HashMap();
valuemap.put("DefaultAmountMangerEntry", entryInfo);
String stdFormulaScript = dcInfo.getStdFormulaScript();
if(stdFormulaScript==null){
entryInfo.setReferAmount(FDCHelper.ZERO);
}else{
Object result = FormulaEngine.runFormula(stdFormulaScript, valuemap);
entryInfo.setReferAmount(new BigDecimal(result != null ? result.toString() : "0"));
}
}
entryInfo.setCarryAmount(entryInfo.getReferAmount().subtract(entryInfo.getSubDeAmount()==null?FDCHelper.ZERO:entryInfo.getSubDeAmount()));
entryInfo.getHead().getEntry().get(entryInfo.getId()).setCarryAmount(entryInfo.getReferAmount().subtract(entryInfo.getSubDeAmount()==null?FDCHelper.ZERO:entryInfo.getSubDeAmount()));
tran.setAppAmount(entryInfo.getCarryAmount());
signEntryInfo.setAppAmount(entryInfo.getCarryAmount());
row.getCell("refDeAmount").setValue(entryInfo.getReferAmount());
row.getCell("carryAmount").setValue(entryInfo.getReferAmount().subtract(entryInfo.getSubDeAmount()==null?FDCHelper.ZERO:entryInfo.getSubDeAmount()));
}
}
}
}
/**
* 改变减免违约金
*/
protected void kdtParent_editStopped(KDTEditEvent e) throws Exception {
int rowIndex = kdtParent.getSelectManager().getActiveRowIndex();
IRow row = kdtParent.getRow(rowIndex);
BigDecimal refDeAmounts =(BigDecimal)row.getCell("refDeAmount").getValue()==null?FDCHelper.ZERO:(BigDecimal)row.getCell("refDeAmount").getValue();
BigDecimal subDeAmounts =(BigDecimal)row.getCell("subDeAmount").getValue()==null?FDCHelper.ZERO:(BigDecimal)row.getCell("subDeAmount").getValue();
DefaultAmountCreatEntryInfo entry=(DefaultAmountCreatEntryInfo)row.getUserObject();
DefaultAmountMangerEntryInfo entryInfo = entry.getDefaultAmountMangerEntry();
TranBusinessOverViewInfo tran=entry.getTranBusinessOverView();
SignPayListEntryInfo signEntryInfo =entry.getSignPayListEntry();
entryInfo.setSubDeAmount(subDeAmounts);
entryInfo.getHead().getEntry().get(entryInfo.getId()).setSubDeAmount(subDeAmounts);
entryInfo.setCarryAmount(refDeAmounts.subtract(subDeAmounts));
entryInfo.getHead().getEntry().get(entryInfo.getId()).setCarryAmount(refDeAmounts.subtract(subDeAmounts));
tran.setAppAmount(entryInfo.getCarryAmount());
signEntryInfo.setAppAmount(entryInfo.getCarryAmount());
row.getCell("carryAmount").setValue(refDeAmounts.subtract(subDeAmounts));
}
/**
* 改变分录减免违约金,同时改变违约金管理对象的减免违约金,结转违约金
*/
public void setDefaultAmountMangerCollection(IRow row){
String tracsationId = (String)row.getCell("remak").getValue();
BigDecimal subDeAmounts =(BigDecimal)row.getCell("subDeAmount").getValue();
BigDecimal carryAmount =(BigDecimal)row.getCell("carryAmount").getValue();
DefaultAmountMangerCollection damColl = (DefaultAmountMangerCollection)getUIContext().get("damColl");
for(int i=0;i<damColl.size();i++){
DefaultAmountMangerInfo defaultInfo = damColl.get(i);
if(tracsationId.equals(defaultInfo.getTransaction().getId().toString())){
defaultInfo.setSubDeAmount(subDeAmounts);
defaultInfo.setCarryAmount(carryAmount);
break;
}
}
}
protected void attachListeners() {
addDataChangeListener(this.prmtDefCalFormula);
}
protected void detachListeners() {
removeDataChangeListener(this.prmtDefCalFormula);
}
protected ICoreBase getBizInterface() throws Exception {
return DefaultAmountCreatFactory.getRemoteInstance();
}
protected KDTable getDetailTable() {
return this.kdtParent;
}
protected KDTextField getNumberCtrl() {
return txtNumber;
}
protected IObjectValue createNewData() {
DefaultAmountCreatInfo createInfo = (DefaultAmountCreatInfo)getUIContext().get("createInfo");
return createInfo ;
}
public void actionSubmit_actionPerformed(ActionEvent e) throws Exception {
super.actionSubmit_actionPerformed(e);
this.setOprtState(STATUS_VIEW);
super.destroyWindow();
}
public SelectorItemCollection getSelectors()
{
SelectorItemCollection sic=super.getSelectors();
sic.add("parent.tranBusinessOverView.*");
sic.add("parent.tranBusinessOverView.moneyDefine.*");
sic.add("parent.signPayListEntry.*");
sic.add("parent.signPayListEntry.moneyDefine.*");
sic.add("parent.defaultAmountMangerEntry.*");
sic.add("parent.defaultAmountMangerEntry.moneyDefine.*");
sic.add("parent.defaultAmountMangerEntry.tranOverView.*");
sic.add("parent.defaultAmountMangerEntry.head.*");
sic.add("parent.defaultAmountMangerEntry.head.project.*");
sic.add("parent.defaultAmountMangerEntry.head.transaction.*");
sic.add("parent.defaultAmountMangerEntry.head.room.productType.*");
return sic;
}
}
| [
"yfsmile@qq.com"
] | yfsmile@qq.com |
617d82f4aa7ca04b47cca73d59f96e11d3c681cc | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_a41b2c51ec5b88cd52889e6549751ea6a392a4b8/RenderableSizeTransformerBuilder/2_a41b2c51ec5b88cd52889e6549751ea6a392a4b8_RenderableSizeTransformerBuilder_s.java | 1e117d72685f600b619f28895d5174f161f2c7e3 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,189 | java | /*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian, Mathieu Jacomy, Julian Bilcke
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.ranking.plugin.transformer;
import org.gephi.graph.api.Renderable;
import org.gephi.ranking.api.Ranking;
import org.gephi.ranking.api.Transformer;
import org.gephi.ranking.spi.TransformerBuilder;
import org.openide.util.lookup.ServiceProvider;
/**
* Renderable size transformer builder. Builds <code>RenderableSizeTransformer</code>
* instances, that receives {@link Renderable} targets. Renderable can be nodes or
* edges data.
*
* @author Mathieu Bastian
*/
@ServiceProvider(service = TransformerBuilder.class, position = 200)
public class RenderableSizeTransformerBuilder implements TransformerBuilder {
@Override
public Transformer buildTransformer() {
return new RenderableSizeTransformer();
}
@Override
public boolean isTransformerForElement(String elementType) {
return elementType.equals(Ranking.NODE_ELEMENT) || elementType.equals(Ranking.EDGE_ELEMENT);
}
@Override
public String getName() {
return Transformer.RENDERABLE_SIZE;
}
public static class RenderableSizeTransformer extends AbstractSizeTransformer<Renderable> {
@Override
public Object transform(Renderable target, float normalizedValue) {
float size = getSize(normalizedValue);
target.setSize(size);
return Float.valueOf(size);
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
3c3f7ab84153ff118c2d97b068f65e14901db907 | 36bb18a593afe89fe2c98bb1739c04bd0bd5bbdf | /src/test/java/com/esotericsoftware/reflectasm/ClassLoaderTest.java | deee82c4641405f2823780890d5a9f46adf93390 | [
"BSD-3-Clause"
] | permissive | yuebo/reflectasm | 626553df1638517dad0b5120f090149ba0b188d1 | 98619c54f00a3c5142a43b1d8c76524c5eba481a | refs/heads/master | 2022-12-26T20:30:36.283627 | 2020-06-05T03:30:37 | 2020-06-05T03:30:37 | 269,520,481 | 0 | 0 | BSD-3-Clause | 2020-10-13T22:34:29 | 2020-06-05T03:18:04 | Java | UTF-8 | Java | false | false | 7,658 | java | /**
* Copyright (c) 2008, Nathan Sweet
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* 3. Neither the name of Esoteric Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.esotericsoftware.reflectasm;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import junit.framework.TestCase;
public class ClassLoaderTest extends TestCase {
public void testDifferentClassloaders () throws Exception {
// This classloader can see only the Test class and core Java classes.
ClassLoader testClassLoader = new TestClassLoader1();
Class testClass = testClassLoader.loadClass("com.esotericsoftware.reflectasm.ClassLoaderTest$Test");
Object testObject = testClass.newInstance();
// Ensure AccessClassLoader can access both the Test class and FieldAccess.
FieldAccess access = FieldAccess.get(testObject.getClass());
access.set(testObject, "name", "first");
assertEquals("first", testObject.toString());
assertEquals("first", access.get(testObject, "name"));
}
public void testAutoUnloadClassloaders () throws Exception {
reclaimLoaders();
int initialCount = AccessClassLoader.activeAccessClassLoaders();
ClassLoader testClassLoader1 = new TestClassLoader1();
Class testClass1 = testClassLoader1.loadClass("com.esotericsoftware.reflectasm.ClassLoaderTest$Test");
Object testObject1 = testClass1.newInstance();
FieldAccess access1 = FieldAccess.get(testObject1.getClass());
access1.set(testObject1, "name", "first");
assertEquals("first", testObject1.toString());
assertEquals("first", access1.get(testObject1, "name"));
ClassLoader testClassLoader2 = new TestClassLoader2();
Class testClass2 = testClassLoader2.loadClass("com.esotericsoftware.reflectasm.ClassLoaderTest$Test");
Object testObject2 = testClass2.newInstance();
FieldAccess access2 = FieldAccess.get(testObject2.getClass());
access2.set(testObject2, "name", "second");
assertEquals("second", testObject2.toString());
assertEquals("second", access2.get(testObject2, "name"));
assertEquals(access1.getClass().toString(), access2.getClass().toString()); // Same class names
assertFalse(access1.getClass().equals(access2.getClass())); // But different classes
assertEquals(initialCount + 2, AccessClassLoader.activeAccessClassLoaders());
testClassLoader1 = null;
testClass1 = null;
testObject1 = null;
access1 = null;
testClassLoader2 = null;
testClass2 = null;
testObject2 = null;
access2 = null;
reclaimLoaders();
// Yeah, reclaimed!
assertEquals(initialCount, AccessClassLoader.activeAccessClassLoaders());
}
private void reclaimLoaders () throws Exception {
// Force GC to reclaim unreachable (or only weak-reachable) objects
System.gc();
try {
Object[] array = new Object[(int)Runtime.getRuntime().maxMemory()];
System.out.println(array.length);
} catch (Throwable e) {
// Ignore OME
}
System.gc();
int times = 0;
while (AccessClassLoader.activeAccessClassLoaders() > 1 && times < 50) { // max 5 seconds, should be instant
Thread.sleep(100); // test again
times++;
}
}
public void testRemoveClassloaders () throws Exception {
int initialCount = AccessClassLoader.activeAccessClassLoaders();
ClassLoader testClassLoader1 = new TestClassLoader1();
Class testClass1 = testClassLoader1.loadClass("com.esotericsoftware.reflectasm.ClassLoaderTest$Test");
Object testObject1 = testClass1.newInstance();
FieldAccess access1 = FieldAccess.get(testObject1.getClass());
access1.set(testObject1, "name", "first");
assertEquals("first", testObject1.toString());
assertEquals("first", access1.get(testObject1, "name"));
ClassLoader testClassLoader2 = new TestClassLoader2();
Class testClass2 = testClassLoader2.loadClass("com.esotericsoftware.reflectasm.ClassLoaderTest$Test");
Object testObject2 = testClass2.newInstance();
FieldAccess access2 = FieldAccess.get(testObject2.getClass());
access2.set(testObject2, "name", "second");
assertEquals("second", testObject2.toString());
assertEquals("second", access2.get(testObject2, "name"));
assertEquals(access1.getClass().toString(), access2.getClass().toString()); // Same class names
assertFalse(access1.getClass().equals(access2.getClass())); // But different classes
assertEquals(initialCount + 2, AccessClassLoader.activeAccessClassLoaders());
AccessClassLoader.remove(testObject1.getClass().getClassLoader());
assertEquals(initialCount + 1, AccessClassLoader.activeAccessClassLoaders());
AccessClassLoader.remove(testObject2.getClass().getClassLoader());
assertEquals(initialCount + 0, AccessClassLoader.activeAccessClassLoaders());
AccessClassLoader.remove(this.getClass().getClassLoader());
assertEquals(initialCount - 1, AccessClassLoader.activeAccessClassLoaders());
}
static public class Test {
public String name;
public String toString () {
return name;
}
}
static public class TestClassLoader1 extends ClassLoader {
protected synchronized Class<?> loadClass (String name, boolean resolve) throws ClassNotFoundException {
Class c = findLoadedClass(name);
if (c != null) return c;
if (name.startsWith("java.")) return super.loadClass(name, resolve);
if (!name.equals("com.esotericsoftware.reflectasm.ClassLoaderTest$Test"))
throw new ClassNotFoundException("Class not found on purpose: " + name);
ByteArrayOutputStream output = new ByteArrayOutputStream(32 * 1024);
InputStream input = ClassLoaderTest.class.getResourceAsStream("/" + name.replace('.', '/') + ".class");
if (input == null) return null;
try {
byte[] buffer = new byte[4096];
int total = 0;
while (true) {
int length = input.read(buffer, 0, buffer.length);
if (length == -1) break;
output.write(buffer, 0, length);
}
} catch (IOException ex) {
throw new ClassNotFoundException("Error reading class file.", ex);
} finally {
try {
input.close();
} catch (IOException ignored) {
}
}
byte[] buffer = output.toByteArray();
return defineClass(name, buffer, 0, buffer.length);
}
}
static public class TestClassLoader2 extends TestClassLoader1 {
}
}
| [
"317728991@qq.com"
] | 317728991@qq.com |
3156d8f9809b2d1bd58b90870cd4c20728c08131 | 12b6d37358987811146e856b4ef1e1bc7aa119cf | /src/main/java/com/library/Student/StudentModel.java | 4a9f961ca96f54284e5097ff0a9bd868a07c2db1 | [
"MIT"
] | permissive | AmilaViduranga/LibraryApi | 3a1c7b257a87683e8fe42e27346908c0b4aba1d6 | ce359e8b5da6c6b02b55e14255b024bd4faa6138 | refs/heads/master | 2020-03-21T19:54:49.815438 | 2018-09-09T07:20:24 | 2018-09-09T07:20:24 | 138,977,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,507 | java | package com.library.Student;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import com.library.Comment.CommentModel;
import com.library.StudentBorrow.StudentBorrowModel;
@Entity
@Table(name="student_info")
public class StudentModel {
@Id @GeneratedValue
@Column(name = "id")
private int id;
@Column(name="student_id")
private String StudentId;
@Column(name = "user_name")
private String userName;
@Column(name = "password")
private String password;
@Column(name = "display_name")
private String displayName;
@Column(name = "contact_info")
private String contactInfo;
@Column(name = "faculty")
private String faculty;
@Column(name = "year")
private Integer year;
@Column(name = "degree")
private String degree;
@Column(name = "black_listed_count")
private Integer blackListedCount;
@Column(name = "clean_count")
private Integer cleanReturnCount;
@Column(name = "total_panelty_payments")
private Double totalPaneltyPayments;
@Column(name = "panelty_returned_counts")
private Integer paneltyReturnedCounts;
@OneToMany(mappedBy = "student")
private Set<StudentBorrowModel> borrowings = new HashSet<StudentBorrowModel>();
@OneToMany(mappedBy = "student")
private Set<CommentModel> comments = new HashSet<CommentModel>();
public Set<StudentBorrowModel> getBorrowings() {
return borrowings;
}
public void setBorrowings(Set<StudentBorrowModel> borrowings) {
this.borrowings = borrowings;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getContactInfo() {
return contactInfo;
}
public void setContactInfo(String contactInfo) {
this.contactInfo = contactInfo;
}
public String getFaculty() {
return faculty;
}
public void setFaculty(String faculty) {
this.faculty = faculty;
}
public Integer getYear() {
return year;
}
public void setYear(Integer year) {
this.year = year;
}
public String getDegree() {
return degree;
}
public void setDegree(String degree) {
this.degree = degree;
}
public Integer getBlackListedCount() {
return blackListedCount;
}
public void setBlackListedCount(Integer blackListedCount) {
this.blackListedCount = blackListedCount;
}
public Integer getCleanReturnCount() {
return cleanReturnCount;
}
public void setCleanReturnCount(Integer cleanReturnCount) {
this.cleanReturnCount = cleanReturnCount;
}
public Double getTotalPaneltyPayments() {
return totalPaneltyPayments;
}
public void setTotalPaneltyPayments(Double totalPaneltyPayments) {
this.totalPaneltyPayments = totalPaneltyPayments;
}
public Integer getPaneltyReturnedCounts() {
return paneltyReturnedCounts;
}
public void setPaneltyReturnedCounts(Integer paneltyReturnedCounts) {
this.paneltyReturnedCounts = paneltyReturnedCounts;
}
}
| [
"amila.v@sliit.lk"
] | amila.v@sliit.lk |
97ffd594d8a066b0c3f498c427ac22a928e989ba | 8055b532077b515c13920180e901b7c4e51eefab | /HelloJava/src/cn/ucai/day08/pa6/Animal.java | 0b59719449285a98556e39f95f83d4dccb879332 | [] | no_license | MyCloudream/java1017 | 1950629c3ea0079b126272d9b25d54870b79cafd | b111df2547e76d7aff8f91ec8ee74de0dc208d76 | refs/heads/master | 2021-01-12T06:31:47.897270 | 2016-12-26T09:52:48 | 2016-12-26T09:52:48 | 77,374,635 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 210 | java | package cn.ucai.day08.pa6;
/**
* 动物类
*/
public class Animal {
public void eat(){
System.out.println("吃...");
}
public void animlMethod(){
System.out.println("父类的其他方法");
}
}
| [
"chenjun_work@163.com"
] | chenjun_work@163.com |
9076dfd2de8594e12efcec972e76cc57ea5d7bce | f88ca54b7eb1850c123b8770fa25621664a62334 | /src/architecturesimulator/Virtualline.java | d2332b963fd3f2b5b4d903b9c286104fb886168b | [
"Apache-2.0"
] | permissive | aokolovskis/Architecture-Simulator | 648d713a0842f9ad65e8168a26b9da5f91b457cc | 55343c74b75f53d79d1e56ef51becbb1e6ce91f5 | refs/heads/master | 2021-01-10T19:12:13.902697 | 2013-05-06T21:09:55 | 2013-05-06T21:09:55 | 4,248,790 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,395 | java | /*
* Copyright 2012 Aleksejs Okolovskis <oko@aloko.de>.
*
* 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 architecturesimulator;
/**
*
* @author Aleksejs Okolovskis (oko@aloko.de)
*/
public class Virtualline {
public enum Oriantation {horizontal,vertical};
private Oriantation oriantation = Oriantation.horizontal;
private int position = 0;
public Virtualline() {
}
public Virtualline(int position, Oriantation oriantation) {
this.position = position;
this.oriantation = oriantation;
}
public Oriantation getOriantation() {
return oriantation;
}
public void setOriantation(Oriantation oriantation) {
this.oriantation = oriantation;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
}
| [
"okolovskis.aleksejs@gmail.com"
] | okolovskis.aleksejs@gmail.com |
be1fb0c7921b772365f4c30fae21488c72f0c36a | d2a4f2deb814dbdede0a162336ae517817ec7a3c | /src/jp/co/sss/crud/servlet/Update.java | 1f8ddef54dd7e6b9f15680a2147e648a5006c31c | [] | no_license | zhangakira/JSP_CRUD | 168bd10e57eb9705bda5b960ca71468715e558f6 | d245ca7af61218722aa9f1a1cab1efb3d198f8cf | refs/heads/master | 2020-07-31T06:58:01.011565 | 2019-05-31T08:05:54 | 2019-05-31T08:05:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,943 | java | package jp.co.sss.crud.servlet;
import java.io.IOException;
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 javax.servlet.http.HttpSession;
import jp.co.sss.crud.bean.Employee;
import jp.co.sss.crud.db.EmployeeDAO;
/**
* Servlet implementation class Update
*/
@WebServlet(urlPatterns={"/update/update"})
public class Update extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
HttpSession session = request.getSession();
String emp_id = request.getParameter("emp_id");
if(session.getAttribute("update_emp_id")!=null){
emp_id = (String)session.getAttribute("update_emp_id");
}
Employee emp = new Employee();
emp = EmployeeDAO.selectWhereSQLForUpdate("employee", emp_id);
session.setAttribute("update_emp_id", emp_id);
session.setAttribute("emp_name", emp.getEmp_name());
session.setAttribute("emp_pass", emp.getEmp_pass());
session.setAttribute("gender", emp.getGender());
session.setAttribute("emp_birth", emp.getBirthday());
session.setAttribute("emp_addr", emp.getAddress());
session.setAttribute("authority", emp.getAuthority());
session.setAttribute("dept_id", emp.getDept_id());
request.getRequestDispatcher("/update/update_input.jsp").forward(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"0.wave73.1@gmail.com"
] | 0.wave73.1@gmail.com |
29aac7613d712b44cf4fd8cf0aa00268e796d3be | bef5f7b0420b62f5287fa3908f01a46c3e93fe53 | /src/main/java/ru/barabo/observer/config/task/p440/out/xml/AbstractToFns.java | f7b199dfa6f73b3c20e5a5c02d4f3749965621c8 | [] | no_license | dbarabo/observer | b6a214b8fbf82f4df3dd7a22cb054ad334b5b2dc | fe4b441639e3dff01004ca26dcd9344317abc91c | refs/heads/master | 2023-08-03T12:36:55.083992 | 2023-07-24T08:59:41 | 2023-07-24T08:59:41 | 115,834,557 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,156 | java | package ru.barabo.observer.config.task.p440.out.xml;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import org.apache.log4j.Logger;
import ru.barabo.observer.config.barabo.p440.out.ResponseData;
import java.util.UUID;
public class AbstractToFns {
final static transient protected Logger logger = Logger.getLogger(AbstractToFns.class.getName());
@XStreamAlias("ИдЭС")
final protected String guid = UUID.randomUUID().toString();
@XStreamAlias("ВерсПрог")
final protected String versionProgram = "JAFINA 5.1";
@XStreamAlias("ТелОтпр")
final protected String pnoneSender = "(423)222-98-82";
@XStreamAlias("ФамОтпр")
final protected String familySender = "БРЫКИНА";
@XStreamAlias("ДолжнОтпр")
final protected String fnsPostSender = "Специалист по сопровождению";
@XStreamAlias("ВерсФорм")
final protected String fnsFormatVersion = "3.00";
@XStreamAlias("ТипИнф")
private String typeInfo;
public AbstractToFns(ResponseData responseData) {
this.typeInfo = responseData.typeInfo();
}
public String getTypeInfo() {
return typeInfo;
}
}
| [
"dbarabo@gmail.com"
] | dbarabo@gmail.com |
14abf28e079c630ab99715257cee8abfd985b92e | 2fbda1e9420e8855e4a20d8d34f19110e40f382c | /src/com/BiTechX/physics_assistant/formula4/Motion304Activity.java | 01110d85cbaa4cd3534ed3cfb2449a32711333ad | [] | no_license | shariarriday/Physics-Assistant | de6fae87139df0a50c49443eb803656639b7c501 | 2255b2be884da41a187c73023afed93c8ed76f56 | refs/heads/master | 2021-05-08T02:43:25.964583 | 2017-10-10T19:12:44 | 2017-10-10T19:12:44 | 106,458,821 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,454 | java | package com.BiTechX.physics_assistant.formula4;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import com.BiTechX.physics_assistant.R;
public class Motion304Activity extends Activity {
Button formulaButton;
EditText val1;
EditText val2;
EditText val3;
EditText val4;
Button okButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_motion304);
formulaButton = (Button) findViewById(R.id.formulamotion);
okButton = (Button) findViewById(R.id.okbut);
val1 = (EditText) findViewById(R.id.val1);
val2 = (EditText) findViewById(R.id.val2);
val3 = (EditText) findViewById(R.id.val3);
val4 = (EditText) findViewById(R.id.val4);
okButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Motion304Activity.this,
Motion304ResActivity.class);
String value1=val1.getText().toString();
String value2=val2.getText().toString();
String value3=val3.getText().toString();
String value4=val4.getText().toString();
intent.putExtra("val1", value1);
intent.putExtra("val2", value2);
intent.putExtra("val3", value3);
intent.putExtra("val4", value4);
startActivity(intent);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.motion304, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"shariarriday@gmail.com"
] | shariarriday@gmail.com |
39840336c5b9878638c4bfdd4a524f1cf0d35ec6 | 66604244a42b1cb1223f2c59a78933ff71c25044 | /udemy-reactive/src/test/java/com/springreactive/udemyreactive/fluxandplayground/FluxAndMonoTransformTest.java | cd5cefc422d5a156d2cf7d88a5c730c489bddbbb | [] | no_license | Dvimer/MyKnowledge | 832ea7a87659fd98c041d9b5b70486398ba8558f | d3a7c7f410939cc018fea6f3444159f395f9c035 | refs/heads/master | 2022-09-22T08:06:26.824036 | 2020-11-07T08:00:04 | 2020-11-07T08:00:04 | 184,614,957 | 0 | 0 | null | 2022-09-08T01:03:25 | 2019-05-02T16:29:09 | Java | UTF-8 | Java | false | false | 3,244 | java | package com.springreactive.udemyreactive.fluxandplayground;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;
import reactor.test.StepVerifier;
import java.util.Arrays;
import java.util.List;
import static reactor.core.scheduler.Schedulers.parallel;
class FluxAndMonoTransformTest {
List<String> names = Arrays.asList("adam", "anna", "jack", "jenny");
@Test
void transformUsingMap() {
Flux<String> nameFlux = Flux.fromIterable(names)
.map(String::toUpperCase)
.log();
StepVerifier.create(nameFlux)
.expectNext("ADAM", "ANNA", "JACK", "JENNY")
.verifyComplete();
}
@Test
void transformUsingMap_Length_repeat() {
Flux<Integer> nameFlux = Flux.fromIterable(names)
.map(String::length)
.repeat(1)
.log();
StepVerifier.create(nameFlux)
.expectNext(4, 4, 4, 5, 4, 4, 4, 5)
.verifyComplete();
}
@Test
void transformUsingMap_filter() {
Flux<String> nameFlux = Flux.fromIterable(names)
.filter(p -> p.length() > 4)
.map(String::toUpperCase)
.repeat(2)
.log();
StepVerifier.create(nameFlux)
.expectNext("JENNY", "JENNY", "JENNY")
.verifyComplete();
}
@Test
void ransformUsingFlatMap() {
Flux<String> stringFlux = Flux.fromIterable(Arrays.asList("A", "B", "C", "D", "E", "F"))
.flatMap(p -> Flux.fromIterable(convertToList(p)))
.log();
StepVerifier.create(stringFlux)
.expectNextCount(12)
.verifyComplete();
}
private List<String> convertToList(String character) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return Arrays.asList(character, "newValue");
}
@Test
void ransformUsingFlatMap_usingParallel() {
Flux<String> stringFlux = Flux.fromIterable(Arrays.asList("A", "B", "C", "D", "E", "F"))
.window(2)
.flatMap(p ->
p.map(this::convertToList).subscribeOn(parallel())
.flatMap(Flux::fromIterable)
)
.log();
StepVerifier.create(stringFlux)
.expectNextCount(12)
.verifyComplete();
}
@Test
void ransformUsingFlatMap_parallel_maintain_order() {
Flux<String> stringFlux = Flux.fromIterable(Arrays.asList("A", "B", "C", "D", "E", "F"))
.window(2)
// .concatMap(p ->
// p.map(this::convertToList).subscribeOn(parallel())
// .flatMap(Flux::fromIterable)
// )
.flatMapSequential(p ->
p.map(this::convertToList).subscribeOn(parallel())
.flatMap(Flux::fromIterable)
)
.log();
StepVerifier.create(stringFlux)
.expectNextCount(12)
.verifyComplete();
}
}
| [
"anosov@seven.tech"
] | anosov@seven.tech |
f62705bd84e29c3e2525d53625465dc895387aa3 | bb3829c7863f38239b71ae83f2cb20aa93a99318 | /Study/src/storm_falcon/pattern/decorater/coffee/HouseBlend.java | da241ee471051ccc01117c43cd6029662c367e0e | [] | no_license | Armyadviser/test | 66997b25c1306af0510748248e47888072e561a0 | 05e63aee222905e2de21662f025388f37c95db97 | refs/heads/master | 2020-04-12T06:15:39.406882 | 2018-07-16T01:23:48 | 2018-07-16T01:23:48 | 63,514,557 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 323 | java | package storm_falcon.pattern.decorater.coffee;
import storm_falcon.pattern.decorater.Beverage;
/**
* 黑咖啡
* (混合咖啡)
*/
public class HouseBlend extends Beverage {
public HouseBlend() {
description = "House Blend";
}
@Override
public double cost() {
return .89;
}
}
| [
"gewanpeng@ge-soft.com"
] | gewanpeng@ge-soft.com |
1544b03f737e7679f3bea70275e2a4bdbdd3fdec | d03142402e2e050d68d083fa84b25cb8223221fb | /gcj/y2013/round2/A.java | a946d830f19cf0dffed922fc3380af9fc712ccac | [
"Unlicense"
] | permissive | mikhail-dvorkin/competitions | b859028712d69d6a14ac1b6194e43059e262d227 | 4e781da37faf8c82183f42d2789a78963f9d79c3 | refs/heads/master | 2023-09-01T03:45:21.589421 | 2023-08-24T20:24:58 | 2023-08-24T20:24:58 | 93,438,157 | 10 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,263 | java | package gcj.y2013.round2;
import java.io.*;
import java.util.*;
public class A {
private static String fileName = A.class.getSimpleName().replaceFirst("_.*", "").toLowerCase();
private static String inputFileName = fileName + ".in";
private static String outputFileName = fileName + ".out";
private static Scanner in;
private static PrintWriter out;
final int M = 1000002013;
private void solve() {
int n = in.nextInt();
int m = in.nextInt();
int[] from = new int[m];
int[] to = new int[m];
int[] amount = new int[m];
Set<Integer> imp = new TreeSet<Integer>();
long honest = 0;
for (int i = 0; i < m; i++) {
from[i] = in.nextInt() - 1;
to[i] = in.nextInt() - 1;
amount[i] = in.nextInt();
imp.add(from[i]);
imp.add(to[i]);
int dist = to[i] - from[i];
long h = (n + n - dist + 1L) * dist / 2;
h %= M;
honest += amount[i] * h;
honest %= M;
}
long cheat = 0;
TreeMap<Integer, Long> people = new TreeMap<Integer, Long>();
for (int x : imp) {
long plus = 0;
for (int i = 0; i < m; i++) {
if (from[i] == x) {
plus += amount[i];
}
}
if (plus > 0) {
people.put(x, plus);
}
long minus = 0;
for (int i = 0; i < m; i++) {
if (to[i] == x) {
minus += amount[i];
}
}
while (minus > 0) {
int y = people.lastKey();
long z = Math.min(minus, people.get(y));
int dist = x - y;
long h = (n + n - dist + 1L) * dist / 2;
h %= M;
cheat += (z % M) * h;
cheat %= M;
minus -= z;
z = people.get(y) - z;
if (z == 0) {
people.remove(y);
} else {
people.put(y, z);
}
}
}
if (!people.isEmpty()) {
throw new RuntimeException();
}
long ans = (honest - cheat) % M;
ans += M;
ans %= M;
out.println(ans);
}
public static void main(String[] args) throws IOException {
Locale.setDefault(Locale.US);
if (args.length >= 2) {
inputFileName = args[0];
outputFileName = args[1];
}
in = new Scanner(new File(inputFileName));
out = new PrintWriter(outputFileName);
int tests = in.nextInt();
in.nextLine();
for (int t = 1; t <= tests; t++) {
out.print("Case #" + t + ": ");
new A().solve();
System.out.println("Case #" + t + ": solved");
}
in.close();
out.close();
}
}
| [
"mikhail.dvorkin@gmail.com"
] | mikhail.dvorkin@gmail.com |
6a57a11cf98b985b330b68452190d68661f4640c | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Math-1/org.apache.commons.math3.fraction.BigFraction/BBC-F0-opt-60/tests/18/org/apache/commons/math3/fraction/BigFraction_ESTest.java | 28ac586503e2d7f5ed2040824d627ea332752d16 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 45,031 | java | /*
* This file was automatically generated by EvoSuite
* Thu Oct 21 05:58:35 GMT 2021
*/
package org.apache.commons.math3.fraction;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.math3.fraction.BigFraction;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.util.MockRandom;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class BigFraction_ESTest extends BigFraction_ESTest_scaffolding {
@Test(timeout = 4000)
public void test000() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
BigInteger bigInteger0 = BigInteger.ZERO;
BigFraction bigFraction1 = bigFraction0.subtract(bigInteger0);
bigFraction0.subtract(bigFraction1);
}
@Test(timeout = 4000)
public void test001() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
BigInteger bigInteger0 = BigInteger.ZERO;
bigFraction0.pow(bigInteger0);
}
@Test(timeout = 4000)
public void test002() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO;
bigFraction0.ONE_HALF.pow((long) 0);
}
@Test(timeout = 4000)
public void test003() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction((-2854), 4);
BigFraction bigFraction1 = bigFraction0.ONE.reduce();
BigInteger bigInteger0 = BigInteger.TEN;
BigFraction bigFraction2 = new BigFraction(bigInteger0);
bigFraction2.add(bigFraction1);
}
@Test(timeout = 4000)
public void test004() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-1.0));
}
@Test(timeout = 4000)
public void test005() throws Throwable {
BigInteger bigInteger0 = BigInteger.ONE;
BigFraction bigFraction0 = new BigFraction(bigInteger0, bigInteger0);
}
@Test(timeout = 4000)
public void test006() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
BigFraction bigFraction1 = new BigFraction(1118.283313158778, 1030);
bigFraction1.subtract(bigFraction0);
}
@Test(timeout = 4000)
public void test007() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2.6392156860310934E-4);
BigInteger bigInteger0 = BigInteger.ONE;
bigFraction0.subtract(bigInteger0);
}
@Test(timeout = 4000)
public void test008() throws Throwable {
BigFraction bigFraction0 = new BigFraction(525.27413983);
bigFraction0.subtract((long) 2147483637);
}
@Test(timeout = 4000)
public void test009() throws Throwable {
BigFraction bigFraction0 = new BigFraction((double) 0);
bigFraction0.subtract(0);
}
@Test(timeout = 4000)
public void test010() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction((-2854), 4);
BigFraction bigFraction1 = bigFraction0.ONE.reduce();
bigFraction0.subtract(bigFraction1);
}
@Test(timeout = 4000)
public void test011() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO;
bigFraction0.reciprocal();
}
@Test(timeout = 4000)
public void test012() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2.6392156860310934E-4);
bigFraction0.reciprocal();
}
@Test(timeout = 4000)
public void test013() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
BigInteger bigInteger0 = BigInteger.ONE;
bigFraction0.pow(bigInteger0);
}
@Test(timeout = 4000)
public void test014() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_FIFTHS;
byte[] byteArray0 = new byte[1];
byteArray0[0] = (byte)52;
BigInteger bigInteger0 = new BigInteger(byteArray0);
BigFraction bigFraction1 = new BigFraction(bigInteger0);
BigFraction bigFraction2 = bigFraction1.add(bigFraction0);
bigFraction2.pow(bigInteger0);
}
@Test(timeout = 4000)
public void test015() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_QUARTERS;
bigFraction0.ONE_THIRD.pow((-1339L));
}
@Test(timeout = 4000)
public void test016() throws Throwable {
BigFraction bigFraction0 = new BigFraction(495, 495);
bigFraction0.pow((long) 495);
}
@Test(timeout = 4000)
public void test017() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_THIRDS;
bigFraction0.pow((-3682L));
}
@Test(timeout = 4000)
public void test018() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_FIFTH;
bigFraction0.pow((-3456));
}
@Test(timeout = 4000)
public void test019() throws Throwable {
BigFraction bigFraction0 = BigFraction.FOUR_FIFTHS;
bigFraction0.pow(0);
}
@Test(timeout = 4000)
public void test020() throws Throwable {
BigFraction bigFraction0 = new BigFraction(866, (-2808));
bigFraction0.THREE_QUARTERS.pow((-2808));
}
@Test(timeout = 4000)
public void test021() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2962L);
bigFraction0.TWO_QUARTERS.pow((double) 2962L);
}
@Test(timeout = 4000)
public void test022() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_THIRD;
bigFraction0.TWO_QUARTERS.pow((double) (byte) (-50));
}
@Test(timeout = 4000)
public void test023() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-831.04564782218), 1);
bigFraction0.pow((double) 1);
}
@Test(timeout = 4000)
public void test024() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_QUARTERS;
bigFraction0.percentageValue();
}
@Test(timeout = 4000)
public void test025() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_THIRD;
bigFraction0.MINUS_ONE.percentageValue();
}
@Test(timeout = 4000)
public void test026() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO;
BigFraction bigFraction1 = bigFraction0.MINUS_ONE.reduce();
bigFraction1.negate();
}
@Test(timeout = 4000)
public void test027() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE;
bigFraction0.negate();
}
@Test(timeout = 4000)
public void test028() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_THIRDS;
BigFraction bigFraction1 = bigFraction0.TWO_THIRDS.subtract(2085L);
bigFraction1.multiply(bigFraction0);
}
@Test(timeout = 4000)
public void test029() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-328.7182968687));
BigInteger bigInteger0 = BigInteger.ONE;
bigFraction0.multiply(bigInteger0);
}
@Test(timeout = 4000)
public void test030() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_HALF;
BigFraction bigFraction1 = bigFraction0.reciprocal();
BigInteger bigInteger0 = BigInteger.ONE;
bigFraction1.multiply(bigInteger0);
}
@Test(timeout = 4000)
public void test031() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_FIFTH;
bigFraction0.multiply((-1078L));
}
@Test(timeout = 4000)
public void test032() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_QUARTERS;
bigFraction0.multiply((-1));
}
@Test(timeout = 4000)
public void test033() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
bigFraction0.multiply(102300422);
}
@Test(timeout = 4000)
public void test034() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
bigFraction0.longValue();
}
@Test(timeout = 4000)
public void test035() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_THIRD;
BigFraction bigFraction1 = bigFraction0.ONE.multiply((long) (byte) (-50));
bigFraction1.longValue();
}
@Test(timeout = 4000)
public void test036() throws Throwable {
BigFraction bigFraction0 = new BigFraction(495, 495);
bigFraction0.TWO.intValue();
}
@Test(timeout = 4000)
public void test037() throws Throwable {
BigFraction bigFraction0 = BigFraction.ZERO;
BigFraction bigFraction1 = bigFraction0.THREE_QUARTERS.multiply((-3080));
bigFraction1.intValue();
}
@Test(timeout = 4000)
public void test038() throws Throwable {
BigFraction.getReducedFraction(1030, 7);
}
@Test(timeout = 4000)
public void test039() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_THIRD;
bigFraction0.ZERO.getNumeratorAsLong();
}
@Test(timeout = 4000)
public void test040() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_FIFTH;
bigFraction0.MINUS_ONE.getNumeratorAsLong();
}
@Test(timeout = 4000)
public void test041() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_QUARTERS;
byte[] byteArray0 = new byte[4];
byteArray0[0] = (byte) (-77);
BigInteger bigInteger0 = new BigInteger(byteArray0);
BigFraction bigFraction1 = bigFraction0.THREE_QUARTERS.multiply(bigInteger0);
bigFraction1.getNumeratorAsInt();
}
@Test(timeout = 4000)
public void test042() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_QUARTERS;
BigFraction bigFraction1 = bigFraction0.multiply((-2074L));
bigFraction1.getNumerator();
}
@Test(timeout = 4000)
public void test043() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.2297456769063303E-80);
bigFraction0.getDenominatorAsLong();
}
@Test(timeout = 4000)
public void test044() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
BigFraction bigFraction1 = bigFraction0.multiply((-9223372036854775808L));
BigFraction bigFraction2 = bigFraction0.divide(bigFraction1);
bigFraction2.getDenominatorAsLong();
}
@Test(timeout = 4000)
public void test045() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.2297456769063303E-80);
bigFraction0.getDenominatorAsInt();
}
@Test(timeout = 4000)
public void test046() throws Throwable {
BigFraction bigFraction0 = new BigFraction(752L, 2861891059712L);
bigFraction0.getDenominatorAsInt();
}
@Test(timeout = 4000)
public void test047() throws Throwable {
BigFraction bigFraction0 = BigFraction.ZERO;
bigFraction0.getDenominator();
}
@Test(timeout = 4000)
public void test048() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction((-2854), 4);
bigFraction0.floatValue();
}
@Test(timeout = 4000)
public void test049() throws Throwable {
BigInteger bigInteger0 = BigInteger.ZERO;
BigFraction bigFraction0 = new BigFraction(bigInteger0);
bigFraction0.doubleValue();
}
@Test(timeout = 4000)
public void test050() throws Throwable {
BigFraction bigFraction0 = new BigFraction(0L);
BigInteger bigInteger0 = BigInteger.TEN;
BigFraction bigFraction1 = bigFraction0.THREE_QUARTERS.subtract(bigInteger0);
bigFraction1.doubleValue();
}
@Test(timeout = 4000)
public void test051() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
BigFraction bigFraction1 = BigFraction.MINUS_ONE;
bigFraction1.divide(bigFraction0);
}
@Test(timeout = 4000)
public void test052() throws Throwable {
BigFraction bigFraction0 = new BigFraction(0.0);
MockRandom mockRandom0 = new MockRandom();
BigInteger bigInteger0 = new BigInteger(1994, mockRandom0);
bigFraction0.divide(bigInteger0);
}
@Test(timeout = 4000)
public void test053() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_HALF;
BigInteger bigInteger0 = BigInteger.ONE;
bigFraction0.TWO.divide(bigInteger0);
}
@Test(timeout = 4000)
public void test054() throws Throwable {
BigFraction bigFraction0 = BigFraction.ZERO;
bigFraction0.divide(2962L);
}
@Test(timeout = 4000)
public void test055() throws Throwable {
BigFraction bigFraction0 = new BigFraction(5);
bigFraction0.divide((long) 5);
}
@Test(timeout = 4000)
public void test056() throws Throwable {
BigFraction bigFraction0 = new BigFraction(525.27413983);
BigFraction bigFraction1 = bigFraction0.multiply(2147483637);
bigFraction1.divide((-1447));
}
@Test(timeout = 4000)
public void test057() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
byte[] byteArray0 = new byte[7];
byteArray0[0] = (byte) (-88);
byteArray0[2] = (byte)38;
byteArray0[5] = (byte) (-93);
BigInteger bigInteger0 = new BigInteger(byteArray0);
BigFraction bigFraction1 = bigFraction0.add(bigInteger0);
bigFraction1.divide(5);
}
@Test(timeout = 4000)
public void test058() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_THIRDS;
BigFraction bigFraction1 = BigFraction.ONE_THIRD;
bigFraction0.compareTo(bigFraction1);
}
@Test(timeout = 4000)
public void test059() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_QUARTERS;
bigFraction0.ZERO.compareTo(bigFraction0);
}
@Test(timeout = 4000)
public void test060() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_THIRDS;
bigFraction0.bigDecimalValue(72, 0);
}
@Test(timeout = 4000)
public void test061() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction(3, 3);
bigFraction0.bigDecimalValue(3, 3);
}
@Test(timeout = 4000)
public void test062() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_FIFTH;
BigFraction bigFraction1 = bigFraction0.subtract(614);
bigFraction1.bigDecimalValue(614, 1);
}
@Test(timeout = 4000)
public void test063() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_QUARTERS;
bigFraction0.bigDecimalValue(5);
}
@Test(timeout = 4000)
public void test064() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
bigFraction0.bigDecimalValue(1);
}
@Test(timeout = 4000)
public void test065() throws Throwable {
BigFraction bigFraction0 = BigFraction.MINUS_ONE;
bigFraction0.bigDecimalValue(0);
}
@Test(timeout = 4000)
public void test066() throws Throwable {
BigFraction bigFraction0 = new BigFraction(0L);
bigFraction0.TWO.bigDecimalValue();
}
@Test(timeout = 4000)
public void test067() throws Throwable {
BigFraction bigFraction0 = BigFraction.MINUS_ONE;
bigFraction0.bigDecimalValue();
}
@Test(timeout = 4000)
public void test068() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_FIFTHS;
byte[] byteArray0 = new byte[2];
byteArray0[0] = (byte) (-82);
BigInteger bigInteger0 = new BigInteger(byteArray0);
BigFraction bigFraction1 = new BigFraction(bigInteger0);
bigFraction0.add(bigFraction1);
}
@Test(timeout = 4000)
public void test069() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_QUARTERS;
BigFraction bigFraction1 = new BigFraction(391411904L);
bigFraction0.add(bigFraction1);
}
@Test(timeout = 4000)
public void test070() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_QUARTERS;
BigInteger bigInteger0 = BigInteger.ONE;
bigFraction0.ONE_HALF.add(bigInteger0);
}
@Test(timeout = 4000)
public void test071() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
BigInteger bigInteger0 = BigInteger.ZERO;
bigFraction0.MINUS_ONE.add(bigInteger0);
}
@Test(timeout = 4000)
public void test072() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction((-1364), (-1364));
bigFraction0.ONE_THIRD.add((long) (-1364));
}
@Test(timeout = 4000)
public void test073() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2583.776847091137, (-1));
BigFraction bigFraction1 = bigFraction0.pow((long) (-1));
bigFraction1.add(0L);
}
@Test(timeout = 4000)
public void test074() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction((-1364), (-1364));
bigFraction0.ONE.add(2L);
}
@Test(timeout = 4000)
public void test075() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
bigFraction0.add((-552));
}
@Test(timeout = 4000)
public void test076() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
bigFraction0.MINUS_ONE.add(1);
}
@Test(timeout = 4000)
public void test077() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
bigFraction0.add(3937);
}
@Test(timeout = 4000)
public void test078() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
bigFraction0.ONE.abs();
}
@Test(timeout = 4000)
public void test079() throws Throwable {
BigInteger bigInteger0 = BigInteger.TEN;
BigFraction bigFraction0 = new BigFraction(bigInteger0);
// Undeclared exception!
try {
bigFraction0.ZERO.reciprocal();
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test080() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_HALF;
// Undeclared exception!
try {
bigFraction0.TWO_THIRDS.pow((BigInteger) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test081() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2.47452589974273E-7, 526);
// Undeclared exception!
try {
bigFraction0.pow((-1608L));
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test082() throws Throwable {
BigFraction bigFraction0 = new BigFraction(866, (-2808));
// Undeclared exception!
try {
bigFraction0.pow(2147483646);
fail("Expecting exception: ArithmeticException");
} catch(ArithmeticException e) {
//
// BigInteger would overflow supported range
//
verifyException("java.math.BigInteger", e);
}
}
@Test(timeout = 4000)
public void test083() throws Throwable {
// Undeclared exception!
try {
BigFraction.getReducedFraction(37, 0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test084() throws Throwable {
BigFraction bigFraction0 = BigFraction.MINUS_ONE;
// Undeclared exception!
try {
bigFraction0.divide(0);
fail("Expecting exception: ArithmeticException");
} catch(ArithmeticException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test085() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_HALF;
// Undeclared exception!
try {
bigFraction0.compareTo((BigFraction) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test086() throws Throwable {
BigFraction bigFraction0 = new BigFraction(0);
// Undeclared exception!
try {
bigFraction0.bigDecimalValue(0, 100);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Invalid rounding mode
//
verifyException("java.math.BigDecimal", e);
}
}
@Test(timeout = 4000)
public void test087() throws Throwable {
BigFraction bigFraction0 = BigFraction.MINUS_ONE;
// Undeclared exception!
try {
bigFraction0.bigDecimalValue(111);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Invalid rounding mode
//
verifyException("java.math.BigDecimal", e);
}
}
@Test(timeout = 4000)
public void test088() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2147483596, 1623);
// Undeclared exception!
try {
bigFraction0.bigDecimalValue();
fail("Expecting exception: ArithmeticException");
} catch(ArithmeticException e) {
//
// Non-terminating decimal expansion; no exact representable decimal result.
//
verifyException("java.math.BigDecimal", e);
}
}
@Test(timeout = 4000)
public void test089() throws Throwable {
BigFraction bigFraction0 = BigFraction.THREE_QUARTERS;
try {
bigFraction0.add((BigInteger) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// null is not allowed
//
verifyException("org.apache.commons.math3.util.MathUtils", e);
}
}
@Test(timeout = 4000)
public void test090() throws Throwable {
BigInteger bigInteger0 = BigInteger.ZERO;
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction(bigInteger0, bigInteger0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test091() throws Throwable {
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction((BigInteger) null, (BigInteger) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// numerator
//
verifyException("org.apache.commons.math3.util.MathUtils", e);
}
}
@Test(timeout = 4000)
public void test092() throws Throwable {
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction((long) 0, (long) 0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test093() throws Throwable {
BigFraction bigFraction0 = new BigFraction(525.27413983);
BigInteger bigInteger0 = BigInteger.ONE;
bigFraction0.subtract(bigInteger0);
}
@Test(timeout = 4000)
public void test094() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.9387755099492532E-4);
bigFraction0.multiply(bigFraction0);
}
@Test(timeout = 4000)
public void test095() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction((-1364), (-1364));
BigFraction bigFraction1 = BigFraction.getReducedFraction((-1364), (-1364));
bigFraction0.equals(bigFraction1);
}
@Test(timeout = 4000)
public void test096() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.2297456769063303E-80);
BigFraction bigFraction1 = BigFraction.TWO_FIFTHS;
bigFraction0.equals(bigFraction1);
}
@Test(timeout = 4000)
public void test097() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-0.8935451767258605));
bigFraction0.THREE_QUARTERS.doubleValue();
}
@Test(timeout = 4000)
public void test098() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO;
BigFraction bigFraction1 = bigFraction0.ZERO.abs();
BigInteger bigInteger0 = bigFraction1.getNumerator();
// Undeclared exception!
try {
bigFraction0.divide(bigInteger0);
fail("Expecting exception: ArithmeticException");
} catch(ArithmeticException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test099() throws Throwable {
BigFraction bigFraction0 = BigFraction.MINUS_ONE;
BigInteger bigInteger0 = BigInteger.ONE;
bigFraction0.divide(bigInteger0);
}
@Test(timeout = 4000)
public void test100() throws Throwable {
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction((-584), 0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test101() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.9387755099492532E-4);
BigFraction bigFraction1 = bigFraction0.reciprocal();
bigFraction1.multiply(bigFraction0);
}
@Test(timeout = 4000)
public void test102() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.9387755099492532E-4);
bigFraction0.TWO_FIFTHS.reduce();
}
@Test(timeout = 4000)
public void test103() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
byte[] byteArray0 = new byte[7];
BigInteger bigInteger0 = new BigInteger(byteArray0);
bigFraction0.add(bigInteger0);
}
@Test(timeout = 4000)
public void test104() throws Throwable {
BigFraction bigFraction0 = BigFraction.ZERO;
bigFraction0.toString();
}
@Test(timeout = 4000)
public void test105() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
bigFraction0.ONE_HALF.toString();
}
@Test(timeout = 4000)
public void test106() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2962L);
BigFraction bigFraction1 = BigFraction.ZERO;
bigFraction0.subtract(bigFraction1);
}
@Test(timeout = 4000)
public void test107() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO;
// Undeclared exception!
try {
bigFraction0.ONE_FIFTH.subtract((BigFraction) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// fraction
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test108() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
// Undeclared exception!
try {
bigFraction0.subtract((BigInteger) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// null is not allowed
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test109() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
BigInteger bigInteger0 = BigInteger.TEN;
bigFraction0.pow(bigInteger0);
}
@Test(timeout = 4000)
public void test110() throws Throwable {
BigFraction bigFraction0 = new BigFraction(7.355246953011374E-5);
// Undeclared exception!
try {
bigFraction0.pow((-9223372036854775808L));
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// exponent (-9,223,372,036,854,775,808)
//
verifyException("org.apache.commons.math3.util.ArithmeticUtils", e);
}
}
@Test(timeout = 4000)
public void test111() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.9387755099492532E-4);
bigFraction0.pow(989);
}
@Test(timeout = 4000)
public void test112() throws Throwable {
BigFraction bigFraction0 = new BigFraction(0L);
bigFraction0.ONE_QUARTER.multiply(bigFraction0);
}
@Test(timeout = 4000)
public void test113() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
BigFraction bigFraction1 = BigFraction.ZERO;
bigFraction1.multiply(bigFraction0);
}
@Test(timeout = 4000)
public void test114() throws Throwable {
BigFraction bigFraction0 = new BigFraction(3779, (-1550));
// Undeclared exception!
try {
bigFraction0.FOUR_FIFTHS.multiply((BigFraction) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// fraction
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test115() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_HALF;
bigFraction0.THREE_QUARTERS.floatValue();
}
@Test(timeout = 4000)
public void test116() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_HALF;
BigFraction bigFraction1 = new BigFraction(10L, 10L);
bigFraction0.equals(bigFraction1);
}
@Test(timeout = 4000)
public void test117() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
Object object0 = new Object();
bigFraction0.ONE_QUARTER.equals(object0);
}
@Test(timeout = 4000)
public void test118() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
bigFraction0.equals(bigFraction0);
}
@Test(timeout = 4000)
public void test119() throws Throwable {
BigFraction bigFraction0 = BigFraction.ZERO;
// Undeclared exception!
try {
bigFraction0.divide(bigFraction0);
fail("Expecting exception: ArithmeticException");
} catch(ArithmeticException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test120() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_QUARTER;
// Undeclared exception!
try {
bigFraction0.divide((BigFraction) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// fraction
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test121() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE;
// Undeclared exception!
try {
bigFraction0.divide(0L);
fail("Expecting exception: ArithmeticException");
} catch(ArithmeticException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test122() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_THIRD;
// Undeclared exception!
try {
bigFraction0.divide((BigInteger) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// fraction
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test123() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.2297456769063303E-80);
BigFraction bigFraction1 = BigFraction.TWO_FIFTHS;
BigFraction bigFraction2 = bigFraction0.add(bigFraction1);
bigFraction2.floatValue();
}
@Test(timeout = 4000)
public void test124() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_THIRDS;
BigInteger bigInteger0 = BigInteger.ZERO;
BigFraction bigFraction1 = new BigFraction(bigInteger0);
bigFraction0.add(bigFraction1);
}
@Test(timeout = 4000)
public void test125() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2694, 2694);
// Undeclared exception!
try {
bigFraction0.add((BigFraction) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// fraction
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test126() throws Throwable {
BigFraction bigFraction0 = new BigFraction((double) 2147450880);
bigFraction0.abs();
}
@Test(timeout = 4000)
public void test127() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction((-2854), 4);
bigFraction0.abs();
}
@Test(timeout = 4000)
public void test128() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction(0, 0);
bigFraction0.floatValue();
}
@Test(timeout = 4000)
public void test129() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-4584.63411872), 2147483639);
// Undeclared exception!
try {
bigFraction0.multiply((BigInteger) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// null is not allowed
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test130() throws Throwable {
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction((double) 1, 2147450880);
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// illegal state: Overflow trying to convert 1 to fraction (-9,223,372,036,854,775,808/9,223,372,036,854,775,807)
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test131() throws Throwable {
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction((double) Integer.MAX_VALUE, Integer.MAX_VALUE);
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// illegal state: Overflow trying to convert 2,147,483,647 to fraction (9,223,372,034,707,292,162/9,223,372,036,854,775,807)
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test132() throws Throwable {
BigFraction bigFraction0 = new BigFraction(0.004005666666671459, 4048.0, (-2890));
}
@Test(timeout = 4000)
public void test133() throws Throwable {
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction(1.0361722296739479E11, 1476);
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// illegal state: Overflow trying to convert 103,617,222,967.395 to fraction (103,617,222,967/1)
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test134() throws Throwable {
BigFraction bigFraction0 = new BigFraction((double) 0);
bigFraction0.toString();
}
@Test(timeout = 4000)
public void test135() throws Throwable {
BigFraction bigFraction0 = BigFraction.ZERO;
// Undeclared exception!
try {
bigFraction0.pow((-1));
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test136() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-328.7182968687));
bigFraction0.ONE_THIRD.getNumeratorAsLong();
}
@Test(timeout = 4000)
public void test137() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
bigFraction0.divide(160L);
}
@Test(timeout = 4000)
public void test138() throws Throwable {
BigFraction bigFraction0 = new BigFraction((double) 2147450880);
bigFraction0.getDenominatorAsInt();
}
@Test(timeout = 4000)
public void test139() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
bigFraction0.multiply((-929L));
}
@Test(timeout = 4000)
public void test140() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_THIRDS;
// Undeclared exception!
try {
bigFraction0.bigDecimalValue(2142733103, 1);
fail("Expecting exception: ArithmeticException");
} catch(ArithmeticException e) {
//
// BigInteger would overflow supported range
//
verifyException("java.math.BigInteger", e);
}
}
@Test(timeout = 4000)
public void test141() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
bigFraction0.ONE_THIRD.multiply(2082408385);
}
@Test(timeout = 4000)
public void test142() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_HALF;
bigFraction0.ONE.longValue();
}
@Test(timeout = 4000)
public void test143() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
bigFraction0.THREE_QUARTERS.negate();
}
@Test(timeout = 4000)
public void test144() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-328.7182968687));
bigFraction0.getDenominator();
}
@Test(timeout = 4000)
public void test145() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-328.7182968687));
BigFraction bigFraction1 = bigFraction0.subtract((-675));
BigFraction bigFraction2 = bigFraction1.pow((-675));
BigInteger bigInteger0 = bigFraction2.getDenominator();
assertEquals((short)346, bigFraction1.shortValue());
assertEquals((short) (-25139), bigInteger0.shortValue());
}
@Test(timeout = 4000)
public void test146() throws Throwable {
BigFraction bigFraction0 = BigFraction.ONE_HALF;
bigFraction0.FOUR_FIFTHS.hashCode();
}
@Test(timeout = 4000)
public void test147() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-328.7182968687));
bigFraction0.MINUS_ONE.getDenominatorAsLong();
assertEquals((short) (-328), bigFraction0.shortValue());
}
@Test(timeout = 4000)
public void test148() throws Throwable {
BigFraction bigFraction0 = new BigFraction(2.47452589974273E-7, 526);
double double0 = bigFraction0.percentageValue();
assertEquals(0.0, double0, 0.01);
}
@Test(timeout = 4000)
public void test149() throws Throwable {
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction((-3740.6429427837), (-1806.9152), (-2448));
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// illegal state: Unable to convert -3,740.643 to fraction after -2,448 iterations
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test150() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.9387755099492532E-4);
BigDecimal bigDecimal0 = bigFraction0.bigDecimalValue();
assertEquals((short)0, bigDecimal0.shortValue());
}
@Test(timeout = 4000)
public void test151() throws Throwable {
BigFraction bigFraction0 = BigFraction.ZERO;
int int0 = bigFraction0.compareTo(bigFraction0);
assertEquals(0, int0);
}
@Test(timeout = 4000)
public void test152() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
BigFraction bigFraction1 = bigFraction0.THREE_QUARTERS.subtract(0L);
BigFraction bigFraction2 = bigFraction1.subtract(bigFraction0);
assertEquals((short)436, bigFraction2.shortValue());
assertFalse(bigFraction2.equals((Object)bigFraction0));
}
@Test(timeout = 4000)
public void test153() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.9387755099492532E-4);
BigFraction bigFraction1 = bigFraction0.divide(797);
assertFalse(bigFraction1.equals((Object)bigFraction0));
BigFraction bigFraction2 = bigFraction1.reciprocal();
assertEquals((short) (-17926), bigFraction2.shortValue());
}
@Test(timeout = 4000)
public void test154() throws Throwable {
BigFraction bigFraction0 = BigFraction.TWO_THIRDS;
int int0 = bigFraction0.getNumeratorAsInt();
assertEquals(2, int0);
}
@Test(timeout = 4000)
public void test155() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
bigFraction0.MINUS_ONE.getField();
assertEquals((short) (-436), bigFraction0.shortValue());
assertEquals((byte)76, bigFraction0.byteValue());
}
@Test(timeout = 4000)
public void test156() throws Throwable {
BigFraction bigFraction0 = null;
try {
bigFraction0 = new BigFraction((BigInteger) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// numerator
//
verifyException("org.apache.commons.math3.util.MathUtils", e);
}
}
@Test(timeout = 4000)
public void test157() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-1856));
byte[] byteArray0 = new byte[8];
byteArray0[0] = (byte) (-48);
BigInteger bigInteger0 = new BigInteger(byteArray0);
// Undeclared exception!
try {
bigFraction0.ZERO.pow(bigInteger0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// denominator must be different from 0
//
verifyException("org.apache.commons.math3.fraction.BigFraction", e);
}
}
@Test(timeout = 4000)
public void test158() throws Throwable {
BigFraction bigFraction0 = BigFraction.getReducedFraction((-1364), (-1364));
BigInteger bigInteger0 = bigFraction0.getNumerator();
assertEquals((short)1, bigFraction0.shortValue());
assertEquals((byte)1, bigInteger0.byteValue());
}
@Test(timeout = 4000)
public void test159() throws Throwable {
BigFraction bigFraction0 = new BigFraction((-436.1100410484729));
bigFraction0.ONE_HALF.intValue();
assertEquals((short) (-436), bigFraction0.shortValue());
}
@Test(timeout = 4000)
public void test160() throws Throwable {
BigFraction bigFraction0 = new BigFraction(1.9387755099492532E-4);
BigFraction bigFraction1 = bigFraction0.TWO_FIFTHS.divide(bigFraction0);
assertEquals((short)2063, bigFraction1.shortValue());
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
86c22bc23a5638758c12fae7933b922130b7d6ab | 7dc4d1c21a6ddbcd1a7530d594498ae7ab5e94c3 | /runescape-client/src/main/java/MusicTrack.java | 6f340aae239838812d4b265116c52567d8bf56c8 | [
"BSD-2-Clause"
] | permissive | sansfromf0rtnite/runelite | 33a83f075e59b9661457183d963f1a48fa02c7ec | ba45ae896d5ebd71235046eadc9e15aae42b95e5 | refs/heads/master | 2020-06-09T22:02:09.052840 | 2019-06-25T13:09:56 | 2019-06-25T13:09:56 | 193,514,085 | 0 | 0 | BSD-2-Clause | 2019-06-24T13:46:22 | 2019-06-24T13:46:21 | null | UTF-8 | Java | false | false | 13,420 | java | import net.runelite.mapping.Export;
import net.runelite.mapping.Implements;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
@ObfuscatedName("he")
@Implements("MusicTrack")
public class MusicTrack extends Node {
@ObfuscatedName("m")
@ObfuscatedSignature(
signature = "Lld;"
)
@Export("table")
NodeHashTable table;
@ObfuscatedName("f")
@Export("midi")
byte[] midi;
@ObfuscatedSignature(
signature = "(Lgr;)V"
)
MusicTrack(Buffer var1) {
var1.index = var1.array.length - 3;
int var2 = var1.readUnsignedByte();
int var3 = var1.__ag_302();
int var4 = var2 * 10 + 14;
var1.index = 0;
int var5 = 0;
int var6 = 0;
int var7 = 0;
int var8 = 0;
int var9 = 0;
int var10 = 0;
int var11 = 0;
int var12 = 0;
int var13;
int var14;
int var15;
for(var13 = 0; var13 < var2; ++var13) {
var14 = -1;
while(true) {
var15 = var1.readUnsignedByte();
if(var15 != var14) {
++var4;
}
var14 = var15 & 15;
if(var15 == 7) {
break;
}
if(var15 == 23) {
++var5;
} else if(var14 == 0) {
++var7;
} else if(var14 == 1) {
++var8;
} else if(var14 == 2) {
++var6;
} else if(var14 == 3) {
++var9;
} else if(var14 == 4) {
++var10;
} else if(var14 == 5) {
++var11;
} else {
if(var14 != 6) {
throw new RuntimeException();
}
++var12;
}
}
}
var4 += var5 * 5;
var4 += (var7 + var8 + var6 + var9 + var11) * 2;
var4 = var4 + var10 + var12;
var13 = var1.index;
var14 = var2 + var5 + var6 + var7 + var8 + var9 + var10 + var11 + var12;
for(var15 = 0; var15 < var14; ++var15) {
var1.__as_311();
}
var4 += var1.index - var13;
var15 = var1.index;
int var16 = 0;
int var17 = 0;
int var18 = 0;
int var19 = 0;
int var20 = 0;
int var21 = 0;
int var22 = 0;
int var23 = 0;
int var24 = 0;
int var25 = 0;
int var26 = 0;
int var27 = 0;
int var28 = 0;
int var29;
for(var29 = 0; var29 < var6; ++var29) {
var28 = var28 + var1.readUnsignedByte() & 127;
if(var28 != 0 && var28 != 32) {
if(var28 == 1) {
++var16;
} else if(var28 == 33) {
++var17;
} else if(var28 == 7) {
++var18;
} else if(var28 == 39) {
++var19;
} else if(var28 == 10) {
++var20;
} else if(var28 == 42) {
++var21;
} else if(var28 == 99) {
++var22;
} else if(var28 == 98) {
++var23;
} else if(var28 == 101) {
++var24;
} else if(var28 == 100) {
++var25;
} else if(var28 != 64 && var28 != 65 && var28 != 120 && var28 != 121 && var28 != 123) {
++var27;
} else {
++var26;
}
} else {
++var12;
}
}
var29 = 0;
int var30 = var1.index;
var1.index += var26;
int var31 = var1.index;
var1.index += var11;
int var32 = var1.index;
var1.index += var10;
int var33 = var1.index;
var1.index += var9;
int var34 = var1.index;
var1.index += var16;
int var35 = var1.index;
var1.index += var18;
int var36 = var1.index;
var1.index += var20;
int var37 = var1.index;
var1.index += var7 + var8 + var11;
int var38 = var1.index;
var1.index += var7;
int var39 = var1.index;
var1.index += var27;
int var40 = var1.index;
var1.index += var8;
int var41 = var1.index;
var1.index += var17;
int var42 = var1.index;
var1.index += var19;
int var43 = var1.index;
var1.index += var21;
int var44 = var1.index;
var1.index += var12;
int var45 = var1.index;
var1.index += var9;
int var46 = var1.index;
var1.index += var22;
int var47 = var1.index;
var1.index += var23;
int var48 = var1.index;
var1.index += var24;
int var49 = var1.index;
var1.index += var25;
int var50 = var1.index;
var1.index += var5 * 3;
this.midi = new byte[var4];
Buffer var51 = new Buffer(this.midi);
var51.writeInt(1297377380);
var51.writeInt(6);
var51.writeShort(var2 > 1?1:0);
var51.writeShort(var2);
var51.writeShort(var3);
var1.index = var13;
int var52 = 0;
int var53 = 0;
int var54 = 0;
int var55 = 0;
int var56 = 0;
int var57 = 0;
int var58 = 0;
int[] var59 = new int[128];
var28 = 0;
label231:
for(int var60 = 0; var60 < var2; ++var60) {
var51.writeInt(1297379947);
var51.index += 4;
int var61 = var51.index;
int var62 = -1;
while(true) {
while(true) {
int var63 = var1.__as_311();
var51.__c_301(var63);
int var64 = var1.array[var29++] & 255;
boolean var65 = var64 != var62;
var62 = var64 & 15;
if(var64 == 7) {
if(var65) {
var51.writeByte(255);
}
var51.writeByte(47);
var51.writeByte(0);
var51.__t_298(var51.index - var61);
continue label231;
}
if(var64 == 23) {
if(var65) {
var51.writeByte(255);
}
var51.writeByte(81);
var51.writeByte(3);
var51.writeByte(var1.array[var50++]);
var51.writeByte(var1.array[var50++]);
var51.writeByte(var1.array[var50++]);
} else {
var52 ^= var64 >> 4;
if(var62 == 0) {
if(var65) {
var51.writeByte(var52 + 144);
}
var53 += var1.array[var37++];
var54 += var1.array[var38++];
var51.writeByte(var53 & 127);
var51.writeByte(var54 & 127);
} else if(var62 == 1) {
if(var65) {
var51.writeByte(var52 + 128);
}
var53 += var1.array[var37++];
var55 += var1.array[var40++];
var51.writeByte(var53 & 127);
var51.writeByte(var55 & 127);
} else if(var62 == 2) {
if(var65) {
var51.writeByte(var52 + 176);
}
var28 = var28 + var1.array[var15++] & 127;
var51.writeByte(var28);
byte var66;
if(var28 != 0 && var28 != 32) {
if(var28 == 1) {
var66 = var1.array[var34++];
} else if(var28 == 33) {
var66 = var1.array[var41++];
} else if(var28 == 7) {
var66 = var1.array[var35++];
} else if(var28 == 39) {
var66 = var1.array[var42++];
} else if(var28 == 10) {
var66 = var1.array[var36++];
} else if(var28 == 42) {
var66 = var1.array[var43++];
} else if(var28 == 99) {
var66 = var1.array[var46++];
} else if(var28 == 98) {
var66 = var1.array[var47++];
} else if(var28 == 101) {
var66 = var1.array[var48++];
} else if(var28 == 100) {
var66 = var1.array[var49++];
} else if(var28 != 64 && var28 != 65 && var28 != 120 && var28 != 121 && var28 != 123) {
var66 = var1.array[var39++];
} else {
var66 = var1.array[var30++];
}
} else {
var66 = var1.array[var44++];
}
int var67 = var66 + var59[var28];
var59[var28] = var67;
var51.writeByte(var67 & 127);
} else if(var62 == 3) {
if(var65) {
var51.writeByte(var52 + 224);
}
var56 += var1.array[var45++];
var56 += var1.array[var33++] << 7;
var51.writeByte(var56 & 127);
var51.writeByte(var56 >> 7 & 127);
} else if(var62 == 4) {
if(var65) {
var51.writeByte(var52 + 208);
}
var57 += var1.array[var32++];
var51.writeByte(var57 & 127);
} else if(var62 == 5) {
if(var65) {
var51.writeByte(var52 + 160);
}
var53 += var1.array[var37++];
var58 += var1.array[var31++];
var51.writeByte(var53 & 127);
var51.writeByte(var58 & 127);
} else {
if(var62 != 6) {
throw new RuntimeException();
}
if(var65) {
var51.writeByte(var52 + 192);
}
var51.writeByte(var1.array[var44++]);
}
}
}
}
}
}
@ObfuscatedName("f")
@Export("__f_381")
void __f_381() {
if(this.table == null) {
this.table = new NodeHashTable(16);
int[] var1 = new int[16];
int[] var2 = new int[16];
var2[9] = 128;
var1[9] = 128;
MidiFileReader var4 = new MidiFileReader(this.midi);
int var5 = var4.trackCount();
int var6;
for(var6 = 0; var6 < var5; ++var6) {
var4.gotoTrack(var6);
var4.readTrackLength(var6);
var4.markTrackPosition(var6);
}
label53:
do {
while(true) {
var6 = var4.getPrioritizedTrack();
int var7 = var4.trackLengths[var6];
while(var7 == var4.trackLengths[var6]) {
var4.gotoTrack(var6);
int var8 = var4.readMessage(var6);
if(var8 == 1) {
var4.setTrackDone();
var4.markTrackPosition(var6);
continue label53;
}
int var9 = var8 & 240;
int var10;
int var11;
int var12;
if(var9 == 176) {
var10 = var8 & 15;
var11 = var8 >> 8 & 127;
var12 = var8 >> 16 & 127;
if(var11 == 0) {
var1[var10] = (var12 << 14) + (var1[var10] & -2080769);
}
if(var11 == 32) {
var1[var10] = (var1[var10] & -16257) + (var12 << 7);
}
}
if(var9 == 192) {
var10 = var8 & 15;
var11 = var8 >> 8 & 127;
var2[var10] = var11 + var1[var10];
}
if(var9 == 144) {
var10 = var8 & 15;
var11 = var8 >> 8 & 127;
var12 = var8 >> 16 & 127;
if(var12 > 0) {
int var13 = var2[var10];
ByteArrayNode var14 = (ByteArrayNode)this.table.get((long)var13);
if(var14 == null) {
var14 = new ByteArrayNode(new byte[128]);
this.table.put(var14, (long)var13);
}
var14.byteArray[var11] = 1;
}
}
var4.readTrackLength(var6);
var4.markTrackPosition(var6);
}
}
} while(!var4.isDone());
}
}
@ObfuscatedName("q")
@Export("clear")
void clear() {
this.table = null;
}
@ObfuscatedName("m")
@ObfuscatedSignature(
signature = "(Lir;II)Lhe;"
)
@Export("readTrack")
public static MusicTrack readTrack(AbstractIndexCache var0, int var1, int var2) {
byte[] var3 = var0.takeRecord(var1, var2);
return var3 == null?null:new MusicTrack(new Buffer(var3));
}
}
| [
"TheRealNull@gmail.com"
] | TheRealNull@gmail.com |
4240bc63905149c5e567e4b99aba923d5af001c1 | 4a01b592169c2ce7ec1b6676873e3a295a4cd892 | /New_app/app/src/androidTest/java/com/example/lakshaysharma/new_app/ExampleInstrumentedTest.java | 792dd471b7684b0290ab41272c3a098a220b8286 | [] | no_license | lakshay994/Android_HandsOn_Stanford | abec257cc2580a9bda000fe1146e0a5a4593af79 | 63ae4b26b9ecd8e44d3e1884e6168e9f658ef8e2 | refs/heads/master | 2020-03-21T14:24:39.476382 | 2018-06-25T22:16:19 | 2018-06-25T22:16:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 750 | java | package com.example.lakshaysharma.new_app;
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.example.lakshaysharma.new_app", appContext.getPackageName());
}
}
| [
"lakshay.sharma994@gmail.com"
] | lakshay.sharma994@gmail.com |
438e24921892a82081dcea41ae058c09df3b847a | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Math-6/org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer/BBC-F0-opt-100/tests/22/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer_ESTest.java | 1602055392fa9214206ca70a59e845bf1a0b2e86 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 13,937 | java | /*
* This file was automatically generated by EvoSuite
* Sat Oct 23 15:19:25 GMT 2021
*/
package org.apache.commons.math3.optim.nonlinear.scalar.noderiv;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.List;
import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.optim.ConvergenceChecker;
import org.apache.commons.math3.optim.InitialGuess;
import org.apache.commons.math3.optim.OptimizationData;
import org.apache.commons.math3.optim.PointValuePair;
import org.apache.commons.math3.optim.SimpleBounds;
import org.apache.commons.math3.optim.SimplePointChecker;
import org.apache.commons.math3.optim.SimpleValueChecker;
import org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer;
import org.apache.commons.math3.random.RandomAdaptor;
import org.apache.commons.math3.random.RandomGenerator;
import org.apache.commons.math3.random.Well19937a;
import org.apache.commons.math3.random.Well19937c;
import org.apache.commons.math3.random.Well44497a;
import org.apache.commons.math3.random.Well44497b;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class CMAESOptimizer_ESTest extends CMAESOptimizer_ESTest_scaffolding {
@Test(timeout = 4000)
public void test00() throws Throwable {
Well44497b well44497b0 = new Well44497b((long) 3714);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(122, 2661.14, true, 3714, (-3329), well44497b0, true, (ConvergenceChecker<PointValuePair>) null);
double[] doubleArray0 = new double[4];
CMAESOptimizer.Sigma cMAESOptimizer_Sigma0 = new CMAESOptimizer.Sigma(doubleArray0);
double[] doubleArray1 = new double[7];
InitialGuess initialGuess0 = new InitialGuess(doubleArray1);
OptimizationData[] optimizationDataArray0 = new OptimizationData[4];
optimizationDataArray0[1] = (OptimizationData) cMAESOptimizer_Sigma0;
optimizationDataArray0[3] = (OptimizationData) initialGuess0;
// Undeclared exception!
try {
cMAESOptimizer0.parseOptimizationData(optimizationDataArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 4 != 7
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer", e);
}
}
@Test(timeout = 4000)
public void test01() throws Throwable {
CMAESOptimizer.PopulationSize cMAESOptimizer_PopulationSize0 = null;
try {
cMAESOptimizer_PopulationSize0 = new CMAESOptimizer.PopulationSize((-1677));
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// -1,677 is smaller than, or equal to, the minimum (0)
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer$PopulationSize", e);
}
}
@Test(timeout = 4000)
public void test02() throws Throwable {
Well19937a well19937a0 = new Well19937a(492);
SimpleValueChecker simpleValueChecker0 = new SimpleValueChecker(492, 1724);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(1724, (-3433.057384549), false, 1724, (-1168), well19937a0, false, simpleValueChecker0);
OptimizationData[] optimizationDataArray0 = new OptimizationData[4];
cMAESOptimizer0.parseOptimizationData(optimizationDataArray0);
assertNull(cMAESOptimizer0.getGoalType());
}
@Test(timeout = 4000)
public void test03() throws Throwable {
double[] doubleArray0 = new double[2];
CMAESOptimizer.Sigma cMAESOptimizer_Sigma0 = new CMAESOptimizer.Sigma(doubleArray0);
Well19937c well19937c0 = new Well19937c();
SimpleValueChecker simpleValueChecker0 = new SimpleValueChecker((-3685.9), 100000.0);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer((-1727483681), 100000.0, true, 3, 1190, well19937c0, false, simpleValueChecker0);
OptimizationData[] optimizationDataArray0 = new OptimizationData[9];
optimizationDataArray0[0] = (OptimizationData) cMAESOptimizer_Sigma0;
// Undeclared exception!
try {
cMAESOptimizer0.parseOptimizationData(optimizationDataArray0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer", e);
}
}
@Test(timeout = 4000)
public void test04() throws Throwable {
Well44497b well44497b0 = new Well44497b((long) 17);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer((-1509), 3448.7905766197787, false, (-4555), 17, well44497b0, false, (ConvergenceChecker<PointValuePair>) null);
// Undeclared exception!
try {
cMAESOptimizer0.doOptimize();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer", e);
}
}
@Test(timeout = 4000)
public void test05() throws Throwable {
double[] doubleArray0 = new double[2];
CMAESOptimizer.Sigma cMAESOptimizer_Sigma0 = new CMAESOptimizer.Sigma(doubleArray0);
double[] doubleArray1 = cMAESOptimizer_Sigma0.getSigma();
assertArrayEquals(new double[] {0.0, 0.0}, doubleArray1, 0.01);
}
@Test(timeout = 4000)
public void test06() throws Throwable {
Well19937a well19937a0 = new Well19937a(2104L);
RandomAdaptor randomAdaptor0 = new RandomAdaptor(well19937a0);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer((-512), 0.0, false, (-512), 0, randomAdaptor0, false, (ConvergenceChecker<PointValuePair>) null);
OptimizationData[] optimizationDataArray0 = new OptimizationData[9];
double[] doubleArray0 = new double[2];
doubleArray0[1] = (double) 2104L;
SimpleBounds simpleBounds0 = new SimpleBounds(doubleArray0, doubleArray0);
optimizationDataArray0[0] = (OptimizationData) simpleBounds0;
CMAESOptimizer.Sigma cMAESOptimizer_Sigma0 = new CMAESOptimizer.Sigma(doubleArray0);
optimizationDataArray0[4] = (OptimizationData) cMAESOptimizer_Sigma0;
InitialGuess initialGuess0 = new InitialGuess(doubleArray0);
optimizationDataArray0[5] = (OptimizationData) initialGuess0;
// Undeclared exception!
try {
cMAESOptimizer0.optimize(optimizationDataArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 2,104 out of [0, 0] range
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer", e);
}
}
@Test(timeout = 4000)
public void test07() throws Throwable {
Well19937a well19937a0 = new Well19937a(2598L);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(86, (-1235.8), true, 86, (-3500), well19937a0, false, (ConvergenceChecker<PointValuePair>) null);
double[] doubleArray0 = new double[7];
OptimizationData[] optimizationDataArray0 = new OptimizationData[9];
SimpleBounds simpleBounds0 = new SimpleBounds(doubleArray0, doubleArray0);
optimizationDataArray0[1] = (OptimizationData) simpleBounds0;
InitialGuess initialGuess0 = new InitialGuess(doubleArray0);
optimizationDataArray0[4] = (OptimizationData) initialGuess0;
CMAESOptimizer.Sigma cMAESOptimizer_Sigma0 = new CMAESOptimizer.Sigma(doubleArray0);
optimizationDataArray0[8] = (OptimizationData) cMAESOptimizer_Sigma0;
// Undeclared exception!
try {
cMAESOptimizer0.optimize(optimizationDataArray0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer", e);
}
}
@Test(timeout = 4000)
public void test08() throws Throwable {
double[] doubleArray0 = new double[0];
SimplePointChecker<PointValuePair> simplePointChecker0 = new SimplePointChecker<PointValuePair>(9.959152908532152E194, 0.25, 4);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(0, 0.25, false, 4, 134, (RandomGenerator) null, false, simplePointChecker0);
double[] doubleArray1 = new double[2];
CMAESOptimizer.Sigma cMAESOptimizer_Sigma0 = new CMAESOptimizer.Sigma(doubleArray1);
InitialGuess initialGuess0 = new InitialGuess(doubleArray0);
OptimizationData[] optimizationDataArray0 = new OptimizationData[4];
optimizationDataArray0[0] = (OptimizationData) initialGuess0;
optimizationDataArray0[2] = (OptimizationData) cMAESOptimizer_Sigma0;
try {
cMAESOptimizer0.optimize(optimizationDataArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 2 != 0
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer", e);
}
}
@Test(timeout = 4000)
public void test09() throws Throwable {
int[] intArray0 = new int[9];
Well19937c well19937c0 = new Well19937c(intArray0);
SimplePointChecker<PointValuePair> simplePointChecker0 = new SimplePointChecker<PointValuePair>(1165, 1798.899342108872);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(1165, 1165, false, 1165, 1165, well19937c0, false, simplePointChecker0);
OptimizationData[] optimizationDataArray0 = new OptimizationData[8];
CMAESOptimizer.PopulationSize cMAESOptimizer_PopulationSize0 = new CMAESOptimizer.PopulationSize(1165);
optimizationDataArray0[0] = (OptimizationData) cMAESOptimizer_PopulationSize0;
// Undeclared exception!
try {
cMAESOptimizer0.optimize(optimizationDataArray0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer", e);
}
}
@Test(timeout = 4000)
public void test10() throws Throwable {
CMAESOptimizer.PopulationSize cMAESOptimizer_PopulationSize0 = null;
try {
cMAESOptimizer_PopulationSize0 = new CMAESOptimizer.PopulationSize(0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 0 is smaller than, or equal to, the minimum (0)
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer$PopulationSize", e);
}
}
@Test(timeout = 4000)
public void test11() throws Throwable {
double[] doubleArray0 = new double[8];
doubleArray0[1] = (-455.965010299);
CMAESOptimizer.Sigma cMAESOptimizer_Sigma0 = null;
try {
cMAESOptimizer_Sigma0 = new CMAESOptimizer.Sigma(doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// -455.965 is smaller than the minimum (0)
//
verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.CMAESOptimizer$Sigma", e);
}
}
@Test(timeout = 4000)
public void test12() throws Throwable {
Well19937a well19937a0 = new Well19937a(2598L);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(81, (-1235.8), true, 81, (-3500), well19937a0, false, (ConvergenceChecker<PointValuePair>) null);
List<RealMatrix> list0 = cMAESOptimizer0.getStatisticsMeanHistory();
assertTrue(list0.isEmpty());
}
@Test(timeout = 4000)
public void test13() throws Throwable {
Well19937a well19937a0 = new Well19937a();
SimpleValueChecker simpleValueChecker0 = new SimpleValueChecker(492, 1724);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(1724, (-3433.057384549), false, 1724, (-1168), well19937a0, false, simpleValueChecker0);
List<Double> list0 = cMAESOptimizer0.getStatisticsFitnessHistory();
assertFalse(list0.contains((-3433.057384549)));
}
@Test(timeout = 4000)
public void test14() throws Throwable {
Well44497a well44497a0 = new Well44497a((-1L));
SimpleValueChecker simpleValueChecker0 = new SimpleValueChecker((-1L), (-1L));
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(0, 0.0, true, 3070, 3070, well44497a0, false, simpleValueChecker0);
List<RealMatrix> list0 = cMAESOptimizer0.getStatisticsDHistory();
assertTrue(list0.isEmpty());
}
@Test(timeout = 4000)
public void test15() throws Throwable {
Well19937a well19937a0 = new Well19937a();
SimpleValueChecker simpleValueChecker0 = new SimpleValueChecker(492, 1724);
CMAESOptimizer cMAESOptimizer0 = new CMAESOptimizer(1724, (-3433.057384549), false, 1724, (-1168), well19937a0, false, simpleValueChecker0);
List<Double> list0 = cMAESOptimizer0.getStatisticsSigmaHistory();
assertTrue(list0.isEmpty());
}
@Test(timeout = 4000)
public void test16() throws Throwable {
CMAESOptimizer.PopulationSize cMAESOptimizer_PopulationSize0 = new CMAESOptimizer.PopulationSize(81);
int int0 = cMAESOptimizer_PopulationSize0.getPopulationSize();
assertEquals(81, int0);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
a2558800ec846bbad463ed8cf3387f44222bc576 | 085cb964c0f30b641723c24fc7b8a96b607d321c | /RedDonor/src/com/reddonor/dao/RedDonorDaoImpl.java | a05341326e1da517024ca50d90c49fbba2da0918 | [] | no_license | YashodharPalkuru/RedDonor1 | 6fad97bce7c096ed5398bbe02b73cdb06b46b451 | 690bc3028fcdaeff597d88b1643c11e63e26f9b5 | refs/heads/master | 2020-12-11T07:33:03.475565 | 2015-07-27T20:01:32 | 2015-07-27T20:01:32 | 34,218,420 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,026 | java | package com.reddonor.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.reddonor.db.DbManager;
public class RedDonorDaoImpl implements RedDonorDao{
@Override
public void register(int drMobile, int drPswd, String drEmail, int drciId,
int drArId, int drCoId, int drBgId, String drFirstName,
String drLastName) {
}
@Override
public void isAvailable(int drMobile) {
}
@Override
public boolean login(int drMobile, String drPswd) throws SQLException
{
ResultSet rs = null;
PreparedStatement ps = null;
Connection conn = null;
try
{
conn = DbManager.getConnection();
ps = conn.prepareStatement("select count(*) from donor_login where dl_mobile = ? and dl_pswd = ?");
ps.setInt(1, drMobile);
ps.setString(2, drPswd);
rs = ps.executeQuery();
if(rs.next())
{
if(rs.getInt(1) > 0)
{
return Boolean.TRUE;
}
else
{
return Boolean.FALSE;
}
}
}
catch(SQLException e)
{
throw new SQLException(e);
}
return Boolean.FALSE;
}
@Override
public void insertCsrfToken(int drMobile, String drPswd, String csrfToken) throws SQLException
{
PreparedStatement ps = null;
Connection conn = null;
conn = DbManager.getConnection();
ps = conn.prepareStatement("update donor_login set dl_csrf_token = ? where dl_mobile = ? and dl_pswd = ?");
ps.setString(1, csrfToken);
ps.setInt(2, drMobile);
ps.setString(3, drPswd);
if(ps.executeUpdate() > 0)
{
System.out.println("csrf token inserted");
}
else
{
throw new SQLException();
}
}
}
| [
"pravn1729@gmail.com"
] | pravn1729@gmail.com |
d727aa859500781a923cf8dc64d388b7088fbd2b | 0cf2b499f9658460f8e8ca59afa01206e431fb27 | /iteratorWithDS/arraylist/CustomArrayListIterator.java | c0aa9c33d6b3db6c41dc015933f21c9a2a2b1f52 | [] | no_license | Aziz-Mattar/Data_Structure | 0e26d793d4893cc2c0299ae117ee8d308471b1df | 8ad7654a60d0998254642f7b97fe376166840d9f | refs/heads/main | 2023-02-20T18:13:11.884552 | 2021-01-21T00:44:57 | 2021-01-21T00:44:57 | 331,472,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,445 | java | package iteratorWithDS.arraylist;
import iteratorWithDS.iterator.Iterator;
public class CustomArrayListIterator<E> implements Iterator {
private CustomArrayList<E> customArrayList;
private int movingIndex;
/**
*
* @param customArrayList to tell the iterator which Arraylist he should work for.
*/
public CustomArrayListIterator(CustomArrayList<E> customArrayList) {
this.customArrayList = customArrayList;
}
/**
* Tests whether the iterator can stand in the index before the first index in ArrayList
*
* @return true if he can stand, false otherwise.
*/
@Override
public boolean fromFirst() {
if (customArrayList.size() > 0) {
movingIndex = 0;
return true;
} else {
return false;
}
}
/**
* Tests whether the iterator can stand in the index after the last index in ArrayList
*
* @return true if he can stand, false otherwise.
*/
@Override
public boolean fromLast() {
if (customArrayList.size() > 0) {
movingIndex = customArrayList.size() - 1;
return true;
} else {
return false;
}
}
/**
* Tests whether the ArrayList has a next object from a specific index.
*
* @return true if there are further objects, false otherwise.
*/
@Override
public boolean hasNext() {
if (movingIndex <= customArrayList.size() - 1) {
return true;
} else {
return false;
}
}
/**
* Tests whether the ArrayList has a previous object from a specific index.
*
* @return true if there are previous objects, false otherwise.
*/
@Override
public boolean hasPrevious() {
if (movingIndex >= 0) {
return true;
} else {
return false;
}
}
/**
* Returns the next object in the ArrayList.
*
* @return next object.
*/
@Override
public E next() {
E element = customArrayList.get(movingIndex);
movingIndex = movingIndex + 1;
return element;
}
/**
* Returns the previous object in the ArrayList.
*
* @return previous object.
*/
@Override
public E previous() {
E element = customArrayList.get(movingIndex);
movingIndex = movingIndex - 1;
return element;
}
} | [
"aziz.balaha@hotmail.com"
] | aziz.balaha@hotmail.com |
cc0b9e83b40f06bd09144904148a5bebda36e59f | 6addf1b43b3a188f9913d2498b0e0703f5eea7ba | /hrms/src/main/java/project/hrms/business/abstracts/JobPositionService.java | 7e42f9bcc6bcd63263a5041f964b428fa8240b60 | [] | no_license | alperenmutlu/HRMS | 3e65215b7dcd3300cac181ad44c963fc966ad110 | 6fece7c398dd18841dbb77384d41bedee1398edb | refs/heads/master | 2023-06-05T03:49:25.378214 | 2021-06-23T15:11:04 | 2021-06-23T15:11:04 | 369,799,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package project.hrms.business.abstracts;
import java.util.List;
import project.hrms.core.utilities.results.DataResult;
import project.hrms.core.utilities.results.Result;
import project.hrms.entities.concretes.JobPosition;
public interface JobPositionService {
Result add(JobPosition jobPostion);
DataResult<List<JobPosition>> getAll();
DataResult<JobPosition> getJobByTitle(String title);
}
| [
"chetto_17@hotmail.com"
] | chetto_17@hotmail.com |
e87c520a4455e9356c9b3fc2413019cc12f031e6 | 055aaba9cf6e6f7aad977cfb53ceed7f2b03d1ae | /src/com/kobra/nateghi/exercise1/CalculatorTest.java | ed928365115823b762fbe337a5f32ed102acfe77 | [] | no_license | knateghi/GUI_FORM | df4e9e9073d6190b124729ecb2f25b68032db175 | 45af2663ef87e770fecdd1782824179631a04650 | refs/heads/master | 2020-06-19T09:00:29.828077 | 2019-08-21T07:28:23 | 2019-08-21T07:28:23 | 196,652,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 184 | java | package com.kobra.nateghi.exercise1;
public class CalculatorTest {
public static void main(String args[]) {
Calculator calculator = new Calculator("Calculator");
}
}
| [
"nateghikoby@gmail.com"
] | nateghikoby@gmail.com |
bb07a4e2cde5160043eb62d2dd2a8e117eb9a38e | 87f65518efac82683b3bf0844fd1daf295d7aab4 | /android.warrior/src/com/warrior/main/MyLog.java | f0da0490185745963d017f51620cba53d4e28fdb | [] | no_license | futuristixa/AndroidWarrior | dc20f7c2d99f2d4031d1b7e393942b6ee3b80356 | 41739645ffbe8b15e22b643026aefc6b5da74ae1 | refs/heads/master | 2021-01-21T04:11:32.906339 | 2013-04-03T06:41:21 | 2013-04-03T06:41:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 270 | java | package com.warrior.main;
public class MyLog {
public static final String APP = "MyApp";
public static final String MAIN_ACTIVITY = "mainActivity";
public static final String BLUETOOTH = "bluetooth";
public static final String MY_ACTIVITY = "myActivity";
}
| [
"ilan_harel@hotmail.com"
] | ilan_harel@hotmail.com |
4a14b4777d856db145c560e068d245a46bd6b811 | 181f4a2817253e23dd86d8fda9503ca494cdeab5 | /src/main/java/com/javadub1/weseler_spring/user/UserService.java | 4930547b85c167cf1faed89efb1a9e093230ae5d | [] | no_license | wrsz2010/weseler_spring | 93ed402d7f0b9ae3b5c5984bcc4de37db49f0c95 | c85bdeb5c3c158d4556da5e357a630546ed49b2a | refs/heads/master | 2020-07-25T20:05:25.486700 | 2019-09-15T11:36:00 | 2019-09-15T11:36:00 | 208,411,095 | 0 | 0 | null | 2019-09-15T11:36:01 | 2019-09-14T08:24:11 | Java | UTF-8 | Java | false | false | 690 | java | package com.javadub1.weseler_spring.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class UserService {
private UserRepository userRepository;
public UserService(@Qualifier("inMemoryUserRepository") UserRepository userRepository) {
this.userRepository = userRepository;
}
public User findById(Long id) {
return userRepository.findById(id).orElseThrow(() -> new UserNotFoundException(id));
}
public List<User> findAll() {
return userRepository.findAll();
}
}
| [
"wrsz2010@gmail.com"
] | wrsz2010@gmail.com |
80340aead2ed9b6be75ceda50fc6e042e5a22e29 | 08601b89f882f2e89d44ff545949203c8aa7a4d2 | /src/main/java/ink/czyhandsome/threads/NotPerfect.java | 041bfe4a0cbae7eeec8ff79773fcc138dbe88b05 | [] | no_license | Czyhandsome/threads | 4916da15b1fe9754602b10b40bb1f931dad6f340 | b99e4ccc9a9d98e6f2a539504e3712fd1f6c1592 | refs/heads/master | 2020-04-12T18:16:23.988513 | 2018-12-26T01:37:33 | 2018-12-26T01:37:33 | 162,674,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 125 | java | package ink.czyhandsome.threads;
/**
* $DESC
*
* @author 曹子钰, 2018/12/19 0019
*/
public @interface NotPerfect {
}
| [
"594125582@qq.com"
] | 594125582@qq.com |
c91335a6d99dd35a7733faa522506e0fba8d775f | eaf56b4aaf14650532ee4d5e045dd031a61135c3 | /Tornado/src/edu/purdue/cs/tornado/index/local/LocalHybridIndex.java | cbc55d1bf29a8b79bd1dd70b76e72c2f632f7a66 | [] | no_license | purduedb/tornadostreaming | 00d4cea01ad24761d065c74a804bd0d10eee4a56 | a1457a0422ac6d2369214c4900b6254b1fe7c521 | refs/heads/master | 2020-04-10T20:36:33.384625 | 2019-02-03T22:14:58 | 2019-02-03T22:14:58 | 161,273,123 | 1 | 3 | null | 2021-11-23T21:55:49 | 2018-12-11T03:41:44 | Java | UTF-8 | Java | false | false | 2,512 | java | package edu.purdue.cs.tornado.index.local;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import edu.purdue.cs.tornado.helper.IndexCell;
import edu.purdue.cs.tornado.helper.IndexCellCoordinates;
import edu.purdue.cs.tornado.helper.Point;
import edu.purdue.cs.tornado.helper.Rectangle;
import edu.purdue.cs.tornado.loadbalance.Cell;
import edu.purdue.cs.tornado.messages.DataObject;
import edu.purdue.cs.tornado.messages.Query;
public abstract class LocalHybridIndex {
public Long beginCleanUpTime;
public LocalHybridIndex(){}
public abstract Boolean addContinousQuery(Query query) ;
public abstract IndexCell addDataObject(DataObject dataObject) ;
public abstract Boolean dropContinousQuery(Query query) ;
public abstract Integer getCountPerKeywrodsAll(ArrayList<String> keywords);
public abstract Integer getCountPerKeywrodsAll(ArrayList<String> keywords, Rectangle rect) ;
public abstract Integer getCountPerKeywrodsAny(ArrayList<String> keywords);
public abstract Integer getCountPerKeywrodsAny(ArrayList<String> keywords, Rectangle rect) ;
public abstract Integer getCountPerRec(Rectangle rec) ;
public abstract IndexCell getOverlappingIndexCells(Point point);
public abstract ArrayList<IndexCell> getOverlappingIndexCells(Rectangle rectangle) ;
public abstract ArrayList<IndexCell> getOverlappingIndexCellWithData(Rectangle rectangle) ;
public abstract ArrayList<IndexCell> getOverlappingIndexCellWithData(Rectangle rectangle,ArrayList<String> keywords) ;
public abstract ArrayList<IndexCell> getOverlappingIndexCellWithData(ArrayList<String> keywords) ;
public abstract Map<String, Query> getReleventQueries(DataObject dataObject, Boolean fromNeighbour);
public abstract ArrayList<List<Query>> getReleventSpatialKeywordRangeQueries(DataObject dataObject, Boolean fromNeighbour);
public abstract LocalIndexKNNIterator KNNIterator(Point focalPoint, Double distance) ;
public abstract LocalIndexKNNIterator LocalKNNIterator(Point focalPoint) ;
public abstract IndexCell mapDataObjectToIndexCell(DataObject dataObject) ;
public abstract ArrayList<IndexCell> getIndexCellsFromPartition(Cell partition) ;
public abstract Boolean updateContinousQuery(Query oldQuery, Query query) ;
public abstract Set<String> getUpdatedTextSummery() ;
public abstract void cleanUp() ;
public abstract IndexCellCoordinates mapDataPointToPartition(Point point) ;
public abstract IndexCell getIndexCellFromCoordinates(IndexCellCoordinates indexCell);
}
| [
"ar8ahmed@gmail.com"
] | ar8ahmed@gmail.com |
038f2c1cb44538da1c8316b8656a1612d43a3f5f | 4b1be5987928b7bd9d36a3f7899114ab27e82d5e | /src/main/java/com/baoquan/shuxin/service/spi/product/ProductInterfaceCodeService.java | abc90cc28c146a4f8f8662e3791189a66d836d30 | [] | no_license | maozhibin/shuxin-java | 0f0a93c2c36770f54d9404a0a82f84eca70c7b5a | 81d8f1b733bc39747448e21dc76ca9123ae218f3 | refs/heads/master | 2021-09-02T23:09:20.799758 | 2018-01-04T01:59:25 | 2018-01-04T01:59:25 | 116,202,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | package com.baoquan.shuxin.service.spi.product;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.baoquan.shuxin.model.product.ProductInterfaceCode;
public interface ProductInterfaceCodeService {
List<ProductInterfaceCode> interfaceCodeList(Integer idValue);
Boolean setCode(Integer productId, Integer productInterfaceId, JSONObject data);
}
| [
"maozhi2764147"
] | maozhi2764147 |
d648cdec45de5aa41fe95ceec1a0a66f8b7f0f5f | 6997d5a2f862e3c699daec36e8ffa8f71b6f531b | /src/src/product/DagingDomba.java | d5740119d4731f22f578832ec365dc94f808a394 | [] | no_license | irenairm/Engi-s-Farm | 2bfaf6903e306adf6d7a97b68abb076688f31ab1 | 539750a47e2eb10f51cfc99641a78cc64891228e | refs/heads/master | 2020-12-20T16:49:43.076209 | 2020-01-25T08:37:14 | 2020-01-25T08:37:14 | 236,143,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package product;
public class DagingDomba extends FarmProduct {
public DagingDomba() {
// TODO Auto-generated constructor stub
super("Daging Domba", 20000);
}
}
| [
"13517100@std.stei.itb.ac.id"
] | 13517100@std.stei.itb.ac.id |
3eb3f392e15b04ead8088d0acac616e2afa0d094 | 5c23d6703e3dbfae406315a8fe9dee997e6ec8b6 | /jhs-loan-entity/src/main/java/com/jhh/jhs/loan/entity/manager_vo/PhoneBookVo.java | 9ff5a2f6089b3359b2c7439b939eaa96c3c3c457 | [] | no_license | soldiers1989/loan-uhs | 1dc4e766fce56ca21bc34e5a5b060eaf7116a8b0 | 77b06a67651898c4f1734e6c323becd0df639c22 | refs/heads/master | 2020-03-28T09:27:29.670311 | 2018-06-12T07:53:52 | 2018-06-12T07:53:52 | 148,038,503 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 610 | java | package com.jhh.jhs.loan.entity.manager_vo;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* Create by Jxl on 2017/9/15
*/
public class PhoneBookVo implements Serializable {
@Excel(name="电话号码",width = 14.0)
private String phone;
@Excel(name="姓名")
private String name;
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"xingmin@jinhuhang.com.cn"
] | xingmin@jinhuhang.com.cn |
c231f7107ed5716ea51a21c4e274c95b970f843f | 82aef44edb5ad16213c37df8cdb2d11356899ff6 | /src/main/java/nl/knmi/adaguc/security/user/User.java | 153fc51a4c28629a7644474f1163957e159656f2 | [] | no_license | ernstdevreedeKNMI/adaguc-services | ce75e8fa63a91a2eb18b157164acf1dac10eb9df | 70bdcb553f9695820d3c8624e337de1d37532fc7 | refs/heads/master | 2020-06-02T17:20:47.711919 | 2017-06-22T14:55:56 | 2017-06-22T14:55:56 | 94,100,136 | 0 | 2 | null | 2017-06-20T13:23:58 | 2017-06-12T13:37:26 | Java | UTF-8 | Java | false | false | 1,082 | java | package nl.knmi.adaguc.security.user;
import java.io.IOException;
import lombok.Getter;
import nl.knmi.adaguc.config.ConfigurationItemNotFoundException;
import nl.knmi.adaguc.config.MainServicesConfigurator;
import nl.knmi.adaguc.tools.Debug;
import nl.knmi.adaguc.tools.Tools;
public class User {
@Getter
String homeDir = null;
@Getter
String userId = null;
@Getter
String dataDir = null;
public static String makePosixUserId(String userId){
if (userId == null)
return null;
userId = userId.replace("http://", "");
userId = userId.replace("https://", "");
userId = userId.replaceAll("/", ".");
return userId;
}
public User(String _id) throws IOException, ConfigurationItemNotFoundException {
Debug.println("New user ID is made :["+_id+"]");
String userWorkspace = MainServicesConfigurator.getUserWorkspace();
userId = makePosixUserId(_id);
homeDir=userWorkspace+"/"+userId;
dataDir = homeDir+"/data";
Tools.mksubdirs(homeDir);
Tools.mksubdirs(dataDir);
Debug.println("User Home Dir: "+homeDir);
}
}
| [
"maartenplieger@gmail.com"
] | maartenplieger@gmail.com |
417fd34442909b09ecbea618be4f82877e2d3d1d | c2f4654ad76bb64a34eaa9950000e58b70b3acdc | /src/org/drip/xva/pde/ParabolicDifferentialOperator.java | bf60ae818762d0404132d6c8eee6a31fe8e9c8b8 | [
"Apache-2.0"
] | permissive | IanMadlenya/DROP | 0a1361a1f6fd46d9dc8d9795edf04ee8f928b437 | 872d93bbae48ce071bcd9bae2b5ce1570bbbc862 | refs/heads/master | 2021-07-23T01:41:01.575353 | 2017-11-03T14:45:49 | 2017-11-03T14:45:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,938 | java |
package org.drip.xva.pde;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/
/*!
* Copyright (C) 2017 Lakshmi Krishnamurthy
*
* This file is part of DRIP, a free-software/open-source library for buy/side financial/trading model
* libraries targeting analysts and developers
* https://lakshmidrip.github.io/DRIP/
*
* DRIP is composed of four main libraries:
*
* - DRIP Fixed Income - https://lakshmidrip.github.io/DRIP-Fixed-Income/
* - DRIP Asset Allocation - https://lakshmidrip.github.io/DRIP-Asset-Allocation/
* - DRIP Numerical Optimizer - https://lakshmidrip.github.io/DRIP-Numerical-Optimizer/
* - DRIP Statistical Learning - https://lakshmidrip.github.io/DRIP-Statistical-Learning/
*
* - DRIP Fixed Income: Library for Instrument/Trading Conventions, Treasury Futures/Options,
* Funding/Forward/Overnight Curves, Multi-Curve Construction/Valuation, Collateral Valuation and XVA
* Metric Generation, Calibration and Hedge Attributions, Statistical Curve Construction, Bond RV
* Metrics, Stochastic Evolution and Option Pricing, Interest Rate Dynamics and Option Pricing, LMM
* Extensions/Calibrations/Greeks, Algorithmic Differentiation, and Asset Backed Models and Analytics.
*
* - DRIP Asset Allocation: Library for model libraries for MPT framework, Black Litterman Strategy
* Incorporator, Holdings Constraint, and Transaction Costs.
*
* - DRIP Numerical Optimizer: Library for Numerical Optimization and Spline Functionality.
*
* - DRIP Statistical Learning: Library for Statistical Evaluation and Machine Learning.
*
* 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.
*/
/**
* ParabolicDifferentialOperator sets up the Parabolic Differential Equation based on the Ito Evolution
* Differential for the Reference Underlier Asset, as laid out in Burgard and Kjaer (2014). The References
* are:
*
* - Burgard, C., and M. Kjaer (2014): PDE Representations of Derivatives with Bilateral Counter-party Risk
* and Funding Costs, Journal of Credit Risk, 7 (3) 1-19.
*
* - Cesari, G., J. Aquilina, N. Charpillon, X. Filipovic, G. Lee, and L. Manda (2009): Modeling, Pricing,
* and Hedging Counter-party Credit Exposure - A Technical Guide, Springer Finance, New York.
*
* - Gregory, J. (2009): Being Two-faced over Counter-party Credit Risk, Risk 20 (2) 86-90.
*
* - Li, B., and Y. Tang (2007): Quantitative Analysis, Derivatives Modeling, and Trading Strategies in the
* Presence of Counter-party Credit Risk for the Fixed Income Market, World Scientific Publishing,
* Singapore.
*
* - Piterbarg, V. (2010): Funding Beyond Discounting: Collateral Agreements and Derivatives Pricing, Risk
* 21 (2) 97-102.
*
* @author Lakshmi Krishnamurthy
*/
public class ParabolicDifferentialOperator {
private org.drip.xva.universe.Tradeable _t = null;
/**
* ParabolicDifferentialOperator Constructor
*
* @param t The Trade-able Asset
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
*/
public ParabolicDifferentialOperator (
final org.drip.xva.universe.Tradeable t)
throws java.lang.Exception
{
if (null == (_t = t))
throw new java.lang.Exception ("ParabolicDifferentialOperator Constructor => Invalid Inputs");
}
/**
* Retrieve the Reference Trade-able Asset
*
* @return The Reference Trade-able Asset
*/
public org.drip.xva.universe.Tradeable asset()
{
return _t;
}
/**
* Compute the Theta for the Derivative from the Asset Edge Value
*
* @param etv The Derivative's Evolution Trajectory Vertex
* @param dblAssetNumeraireVertex The Asset Numeraire Vertex Value
*
* @return The Theta
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
*/
public double theta (
final org.drip.xva.derivative.EvolutionTrajectoryVertex etv,
final double dblAssetNumeraireVertex)
throws java.lang.Exception
{
if (null == etv || !org.drip.quant.common.NumberUtil.IsValid (dblAssetNumeraireVertex))
throw new java.lang.Exception ("ParabolicDifferentialOperator::theta => Invalid Inputs");
org.drip.xva.derivative.AssetGreekVertex agv = etv.assetGreekVertex();
double dblVolatility = _t.numeraireEvolver().evaluator().volatility().value (new
org.drip.measure.realization.JumpDiffusionVertex (etv.time(), dblAssetNumeraireVertex, 0.,
false));
return 0.5 * dblVolatility * dblVolatility * dblAssetNumeraireVertex * dblAssetNumeraireVertex *
agv.derivativeXVAValueGamma() - _t.cashAccumulationRate() * dblAssetNumeraireVertex *
agv.derivativeXVAValueDelta();
}
/**
* Compute the Up/Down Thetas
*
* @param etv The Derivative's Evolution Trajectory Vertex
* @param dblAssetNumeraireVertex The Asset Numeraire Vertex Value
* @param dblShift The Amount to Shift the Reference Underlier Numeraire By
*
* @return The Array of the Up/Down Thetas
*/
public double[] thetaUpDown (
final org.drip.xva.derivative.EvolutionTrajectoryVertex etv,
final double dblAssetNumeraireVertex,
final double dblShift)
{
if (null == etv || !org.drip.quant.common.NumberUtil.IsValid (dblAssetNumeraireVertex) ||
!org.drip.quant.common.NumberUtil.IsValid (dblShift))
return null;
org.drip.xva.derivative.AssetGreekVertex agv = etv.assetGreekVertex();
double dblAssetNumeraireVertexDown = dblAssetNumeraireVertex - dblShift;
double dblAssetNumeraireVertexUp = dblAssetNumeraireVertex + dblShift;
double dblVolatility = java.lang.Double.NaN;
try {
dblVolatility = _t.numeraireEvolver().evaluator().volatility().value (new
org.drip.measure.realization.JumpDiffusionVertex (etv.time(), dblAssetNumeraireVertex, 0.,
false));
} catch (java.lang.Exception e) {
e.printStackTrace();
return null;
}
double dblGammaCoefficient = 0.5 * dblVolatility * dblVolatility * agv.derivativeXVAValueGamma();
double dblDeltaCoefficient = -1. * _t.cashAccumulationRate() * agv.derivativeXVAValueDelta();
return new double[] {dblGammaCoefficient * dblAssetNumeraireVertexDown * dblAssetNumeraireVertexDown
+ dblDeltaCoefficient * dblAssetNumeraireVertexDown, dblGammaCoefficient *
dblAssetNumeraireVertex * dblAssetNumeraireVertex + dblDeltaCoefficient *
dblAssetNumeraireVertex, dblGammaCoefficient * dblAssetNumeraireVertexUp *
dblAssetNumeraireVertexUp + dblDeltaCoefficient * dblAssetNumeraireVertexUp};
}
}
| [
"lakshmi7977@gmail.com"
] | lakshmi7977@gmail.com |
d4f425cc1c1ce5bb03e5f32773dfb726869e3cc5 | a0451215148eaecf53119664417c9e577926ee48 | /ax-boot-initialzr/src/main/resources/templates/java/domain/scheduler/SchedulerService.java | fd6eca4411b981b52c3fcc844ff9b4380687ab9a | [
"MIT"
] | permissive | neoguru/axboot-base | b828f6b9635cd54376f442b3b67268aed932b1d6 | 5f8cd3a76b3df34463ebcb234b88732b60a5d85c | refs/heads/master | 2020-04-26T02:44:52.758990 | 2019-04-27T04:20:57 | 2019-04-27T04:20:57 | 173,244,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,076 | java | package ${basePackage}.domain.scheduler;
import ${basePackage}.domain.user.User;
import ${basePackage}.domain.BaseService;
import ${basePackage}.domain.scheduler.repeat.SchedulerRepeatService;
import ${basePackage}.domain.scheduler.repeat.change.SchedulerRepeatChange;
import ${basePackage}.domain.scheduler.repeat.change.SchedulerRepeatChangeService;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
import javax.transaction.Transactional;
import com.chequer.axboot.core.parameter.RequestParams;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.dsl.Expressions;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Service
public class SchedulerService extends BaseService<Scheduler, Integer> {
private SchedulerRepository schedulerRepository;
@Inject
private SchedulerRepeatService schedulerRepeatService;
@Inject
private SchedulerRepeatChangeService schedulerRepeatChangeService;
@Inject
public SchedulerService(SchedulerRepository schedulerRepository) {
super(schedulerRepository);
this.schedulerRepository = schedulerRepository;
}
@Transactional
public void deleteSchedule(List<Scheduler> schedulers) throws Exception {
if (isNotEmpty(schedulers)) {
for (Scheduler scheduler: schedulers) {
delete(scheduler.getId());
}
}
}
/*
@Transactional
public void repeatDelete(List<Scheduler> schedulers) throws Exception {
if (isNotEmpty(schedulers)) {
for (Scheduler scheduler: schedulers) {
schedulerRepeatService.delete(scheduler.getId());
schedulerRepeatChangeService.delete(scheduler.getId());
delete(scheduler.getId());
}
}
}
*/
@Transactional
public void saveSchedule(List<Scheduler> schedulers) throws Exception {
/*
* 신규등록과 전체일정 수정의 경우 실행되는 method
*/
if (isNotEmpty(schedulers)) {
for (Scheduler scheduler: schedulers) {
//Scheduler save
save(scheduler);
//SchedulerRepeat save
if (scheduler.getRepeatSave() != null) {
scheduler.getRepeatSave().setNoSchedule(scheduler.getNoSchedule());
schedulerRepeatService.save(scheduler.getRepeatSave());
}
List<SchedulerRepeatChange> changeList = schedulerRepeatChangeService.getChangeList(scheduler.getId());
if (isNotEmpty(changeList))
schedulerRepeatChangeService.delete(changeList);
}
}
}
public Scheduler getScheduler(RequestParams requestParams) {
Scheduler scheduler = gets(requestParams).stream().findAny().orElse(null);
return scheduler;
}
public List<Scheduler> gets(RequestParams requestParams) {
String baseDate = requestParams.getString("baseDate");
Integer noEmployee = requestParams.getInt("noEmployee");
Integer noSchedule = requestParams.getInt("noSchedule");
BooleanBuilder builder = new BooleanBuilder();
builder.and(qScheduler.ynRepeat.eq("NONE")); //반복없는 event만 get
if (noEmployee > 0)
builder.and(qScheduler.noEmployee.eq(noEmployee));
if (noSchedule > 0)
builder.and(qScheduler.noSchedule.eq(noSchedule));
if (isNotEmpty(baseDate)) {
LocalDate localDate = LocalDate.parse(baseDate);
LocalDate dtStart = LocalDate.parse(baseDate);
LocalDate dtEnd = LocalDate.parse(baseDate);
dtStart = dtStart.minusMonths(1);
dtEnd = dtEnd.plusMonths(1);
dtStart = LocalDate.of(dtStart.getYear(), dtStart.getMonthValue(), 01);
dtEnd = LocalDate.of(dtEnd.getYear(), dtEnd.getMonthValue(), dtEnd.lengthOfMonth());
builder.and(qScheduler.start.between(dtStart, dtEnd));
}
List<Scheduler> schedules = select().from(qScheduler).where(builder).fetch();
return schedules;
}
}
| [
"kwpark@localhost"
] | kwpark@localhost |
5a7cfa65b3306d9047c51eedf4ffc4df18580df1 | fddb62f3bb3952b4c383288ae352b8960e26edfc | /SanchezLuis-lab04/MyJavaLab04.java | 938f7c7f3de3cf9afcb446a72d5eb02561f90746 | [] | no_license | lsanch03/CS1101 | bf37d145a9c94e8014bf1f8d325501e884725608 | ff33d779ddf9571f8bef15161d1b6cf4f17e6fbe | refs/heads/master | 2020-04-25T06:20:25.590419 | 2019-02-25T20:23:53 | 2019-02-25T20:23:53 | 171,748,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,360 | java | import java.util.*;
public class MyJavaLab04 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Scanner sc2 = new Scanner(System.in);
//Adds a extra line before running the code.
System.out.println(" ");
//Declaration of variables.
String first = "Luis";
String last = "Sanchez";
int id = 80580022, numReviewers = 0, numMovies = 0;
String choice = "";
int key = 0;
//Prints student info.
System.out.println(last + ", " + first + ", " + id);
//Asks how many people will be reviewing movies, then we will use this number to know the length of the Reviewers array.
System.out.println("How many movie reviewers are going to enter reviews?");
numReviewers = sc.nextInt();
String[] Reviewers = new String[numReviewers];
// Ask the names of the reviewers.
for (int i = 0; i < numReviewers; i++) {
System.out.println("Enter movie reviewer #" + (1 + i));
Reviewers[i] = sc2.nextLine();
}
//Here we ask the number of movies, then we will use this number to know the length of the Movie array.
System.out.println("How many movies will be reviewed?");
numMovies = sc.nextInt();
//Here we create the 1D array that will contain the names of the movies.
String[] Movies = new String[numMovies];
//Here we prompt user to enter the Movie names.
for (int j = 0; j < numMovies; j++) {
System.out.println("Enter movie #" + (1 + j));
Movies[j] = sc2.nextLine();
}
//Create the 2D-array where we will be sotring the feedback of each Reviewee
String[][] Reviews = new String[numReviewers][numMovies];
//Here we create a double for loop in which we take the reviews of everyone, movie by movie, and store them in a 2D-array.
for (int k = 0; k < numReviewers; k++) {
for (int l = 0; l < numMovies; l++) {
System.out.println(Reviewers[k] + ": Enter review for " + Movies[l]);
Reviews[k][l] = sc2.nextLine();
}
}
//Adds a extra line for aesthetic purposes.
System.out.println(" ");
//This is where we print out the Reviews of each reviewer along with their comments.
for (int m = 0; m < numReviewers; m++) {
for (int n = 0; n < numMovies; n++) {
System.out.println(Reviewers[m] + " reviewed " + Movies[n]);
System.out.println(" " + Reviews[m][n]);
}
}
//Adds a extra line for aesthetic purposes.
System.out.println(" ");
}
} | [
"luis.d.san03@gmail.com"
] | luis.d.san03@gmail.com |
408c010aca07339bdcc725e5d5f36d91dc4c9123 | c81395987f614f0cadd131304f1aeda687b05920 | /src/main/java/com/hrportal/service/impl/EmployeeSalaryServiceImpl.java | 890601216ca53eefbbebbd002de9d849f6302767 | [] | no_license | pardhasm/hrportal | 9844108f6777ba5d4917feabdf244767620b74ce | 336cec046651edbd1fcc9dc622eab0a6551a4c28 | refs/heads/master | 2021-03-24T11:01:37.808765 | 2017-09-22T15:25:20 | 2017-09-22T15:25:20 | 103,821,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,069 | java | package com.hrportal.service.impl;
import com.hrportal.model.EmployeeSalary;
import com.hrportal.model.RecordStatus;
import com.hrportal.repository.EmployeeSalaryRepository;
import com.hrportal.service.IEmployeeSalaryService;
import javassist.NotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* Created by Lalith leela vishnu on 20-09-2017.
*/
@Service
public class EmployeeSalaryServiceImpl implements IEmployeeSalaryService {
@Autowired
private EmployeeSalaryRepository employeeSalaryRepository;
@Override
public List<EmployeeSalary> getAll() {
return employeeSalaryRepository.findAll();
}
@Override
public EmployeeSalary get(Long id) throws NotFoundException {
EmployeeSalary employeeSalary = employeeSalaryRepository.findOne(id);
if (Objects.isNull(employeeSalary)) {
throw new NotFoundException("EmployeeSalary Not found with given id : " + id);
}
return employeeSalary;
}
@Override
public EmployeeSalary save(EmployeeSalary employeeSalary) {
return employeeSalaryRepository.save(employeeSalary);
}
@Override
public EmployeeSalary update(Long id, EmployeeSalary employeeSalary) throws NotFoundException {
if (!employeeSalaryRepository.exists(employeeSalary.getId())) {
throw new NotFoundException("EmployeeSalary Not found with given id : " + employeeSalary.getId());
}
return employeeSalaryRepository.save(employeeSalary);
}
@Override
public EmployeeSalary delete(Long id) throws NotFoundException {
EmployeeSalary employeeSalary = employeeSalaryRepository.findOne(id);
if (!Objects.isNull(employeeSalary)) {
throw new NotFoundException("EmployeeSalary Not found with given id : " + id);
}
employeeSalary.setRecordStatus(RecordStatus.INACTIVE);
return employeeSalaryRepository.save(employeeSalary);
}
}
| [
"lalithleelavishnu@gmail.com"
] | lalithleelavishnu@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.