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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8de4c71abe9c36fcb0b7e2a4ebdbfbe543bef44c | 253c824459294edac88b292b035528c9a07b45ac | /app/src/main/java/com/azero/sampleapp/activity/weather/fragment/WeatherForecastInfoFragment.java | 92aa6510120eccd6d67507b761ba4f072409e606 | [
"Apache-2.0"
] | permissive | azerodeveloper/Azero_SDK_for_Android | 276f7810b475baa773b889d4d72eb66308ca1568 | 36feb0054ee3395b89f403c64f264240da47ef62 | refs/heads/master | 2023-06-28T17:52:09.128144 | 2021-07-31T06:29:25 | 2021-07-31T06:29:25 | 216,775,682 | 0 | 0 | Apache-2.0 | 2023-06-26T04:05:38 | 2019-10-22T09:33:39 | Java | UTF-8 | Java | false | false | 2,666 | java |
/*
* Copyright (c) 2019 SoundAI. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. 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.azero.sampleapp.activity.weather.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.azero.sampleapp.R;
import com.bumptech.glide.Glide;
import com.azero.sampleapp.activity.weather.data.WeatherDaily;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
* A simple {@link } subclass.
* Use the {@link WeatherForecastInfoFragment#} factory method to
* create an instance of this fragment.
*/
public class WeatherForecastInfoFragment extends WeatherFragmentBase {
private static final String ARG_WEATHER_INFO = "ARG_WEATHER_INFO";
private ImageView weatherIcon;
private ImageView backgroundView;
private TextView weatherTmpDay;
public WeatherForecastInfoFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.weather_fragment_weather_forecast_info_layout, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initView(view);
updateView();
}
public void initView(View view) {
weatherIcon = view.findViewById(R.id.weather_icon);
backgroundView = view.findViewById(R.id.bg);
weatherTmpDay = view.findViewById(R.id.weather_tmp_day);
}
protected void updateView() {
WeatherDaily weatherDaily =weather.getWeather();
weatherTmpDay.setText(getString(R.string.weather_day_temprure, weatherDaily.getLow(), weatherDaily.getHigh()));
Glide.with(this).load(weatherDaily.getIconUrl()).into(weatherIcon);
Glide.with(this).load(weatherDaily.getBackgroundUrl()).into(backgroundView);
}
}
| [
"azero_developer@soundai.com"
] | azero_developer@soundai.com |
b00019b86bce55abe76a45fd4887718633b61e62 | 703e00ed539ecf22fb880c959adad5df307e4a8f | /src/main/java/com/fh/service/bmf/statistics/ProductBrowseService.java | 67c2ef1cbf38816ff9e20ccea3c834bfe90e69ee | [] | no_license | Anthrax1985/bumofang | a4894cc03ca89848b5233667901bc18604b38f21 | be342b3e6f94c29195de7e389c7a4b8da6a12f6b | refs/heads/master | 2020-03-18T16:00:56.326852 | 2018-05-26T08:11:43 | 2018-05-26T08:11:43 | 134,942,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 465 | java | package com.fh.service.bmf.statistics;
import org.springframework.stereotype.Service;
import com.fh.service.BaseService;
import com.fh.entity.bmf.statistics.ProductBrowse;
/**
* 类名称:ProductBrowse
* 创建人:tyj
* 创建时间:2017-08-02
*/
@Service("productBrowseService")
public class ProductBrowseService extends BaseService<ProductBrowse>{
protected String getNamespace() {
return "ProductBrowseMapper";
}
}
| [
"wuzhenyi@yuniu-inc.com"
] | wuzhenyi@yuniu-inc.com |
85bc7e964210299add234db4e95a558db3966a99 | 72cbd420d57f970a6bfbf9cf4dc62f662e6a0ebb | /plugin/core/src/com/perl5/lang/perl/idea/editor/smartkeys/options/PerlSmartKeyOptions.java | a02f6c7dcfc320a8095be7fe56d983665c0cc812 | [
"Apache-2.0"
] | permissive | xcodejoy/Perl5-IDEA | e36061de84cc1780ed76711190bb5ce4b05fa3f0 | 2179a9ab2e9006d4c5501a878f484293220046ac | refs/heads/master | 2020-09-19T09:15:35.960543 | 2019-11-23T08:46:28 | 2019-11-23T08:46:28 | 224,215,081 | 1 | 0 | NOASSERTION | 2019-11-26T14:44:56 | 2019-11-26T14:44:55 | null | UTF-8 | Java | false | false | 1,987 | java | /*
* Copyright 2015-2019 Alexandr Evstigneev
*
* 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.perl5.lang.perl.idea.editor.smartkeys.options;
import com.intellij.openapi.options.BeanConfigurable;
import com.intellij.openapi.options.UnnamedConfigurable;
import com.intellij.ui.IdeBorderFactory;
import com.perl5.PerlBundle;
import com.perl5.lang.perl.idea.codeInsight.Perl5CodeInsightSettings;
import javax.swing.*;
public class PerlSmartKeyOptions extends BeanConfigurable<Perl5CodeInsightSettings> implements UnnamedConfigurable {
public PerlSmartKeyOptions() {
super(Perl5CodeInsightSettings.getInstance());
checkBox(PerlBundle.message("perl.options.auto.heredoc"),
() -> getInstance().HEREDOC_AUTO_INSERTION,
value -> getInstance().HEREDOC_AUTO_INSERTION = value);
checkBox(PerlBundle.message("perl.options.auto.colon"),
() -> getInstance().AUTO_INSERT_COLON,
value -> getInstance().AUTO_INSERT_COLON = value);
checkBox(PerlBundle.message("perl.options.smart.comma.sequence"),
() -> getInstance().SMART_COMMA_SEQUENCE_TYPING,
value -> getInstance().SMART_COMMA_SEQUENCE_TYPING = value);
}
@Override
public JComponent createComponent() {
JComponent panel = super.createComponent();
if (panel != null) {
panel.setBorder(IdeBorderFactory.PlainSmallWithIndent.createTitledBorder(null, "Perl5", 0, 0, null, null));
}
return panel;
}
}
| [
"hurricup@gmail.com"
] | hurricup@gmail.com |
6ef4699a52420965897113ea84a1715f0a445f1b | ad894c109141f30022b71baf67c0997baaf48f58 | /src/test/java/com/mycompany/myapp/service/mapper/DepartmentMapperTest.java | e2dd1c4cfe3f9845bedd8f64ba393ee91ea271ff | [] | no_license | henrique-barreto/jhipster-sample-application | c646be5001c3c391b7e1bd79dcd257a1df9516af | 81b99155a92c894060cf29d103143ff2d98fe8d5 | refs/heads/master | 2022-12-24T14:56:28.176605 | 2020-01-30T18:15:39 | 2020-01-30T18:15:39 | 237,275,221 | 0 | 0 | null | 2022-12-16T04:43:44 | 2020-01-30T18:13:53 | Java | UTF-8 | Java | false | false | 578 | java | package com.mycompany.myapp.service.mapper;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class DepartmentMapperTest {
private DepartmentMapper departmentMapper;
@BeforeEach
public void setUp() {
departmentMapper = new DepartmentMapperImpl();
}
@Test
public void testEntityFromId() {
Long id = 2L;
assertThat(departmentMapper.fromId(id).getId()).isEqualTo(id);
assertThat(departmentMapper.fromId(null)).isNull();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
dbb8f34ace6736f228aa054693d14162da0fe283 | acfc6b4cced7713292b5f11e169e357239cdc488 | /gen/com/deadshot/andengine2/BuildConfig.java | 08f67837a9f40660904cca6a050fd09813eda96a | [] | no_license | Deadshot-tawsoft/GameEngineFirstGame | f3b3665c653ab96c78c3d8aa3079098325778191 | 3a1f4a50c551894bfbb50179bd70529dcb4bdd0c | refs/heads/master | 2020-04-17T08:11:46.001408 | 2014-05-20T18:02:35 | 2014-05-20T18:02:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 165 | java | /** Automatically generated file. DO NOT MODIFY */
package com.deadshot.andengine2;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"tawaasalage@gmail.com"
] | tawaasalage@gmail.com |
055d97ea7f602ef12c8da36f0b11faf550a855b8 | ecb108d9f820a91c78ae771d1da8e33b8e6016df | /app/src/main/java/com/dong/easy/image/view/AspectImageView.java | 9b3315d6ba62875419215b157eeb471dbc7dbd9e | [] | no_license | jadong/EasyUtil | c9408306ef4297358e8c994db5e0880f0e3f3f62 | 0f96477ea557390f6beeb324609c9532a64c17ea | refs/heads/master | 2021-05-06T00:57:12.094307 | 2019-03-29T02:59:56 | 2019-03-29T02:59:56 | 114,338,369 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,096 | java | package com.dong.easy.image.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import com.dong.easy.R;
public class AspectImageView extends android.support.v7.widget.AppCompatImageView {
public static final float DEFAULT_ASPECT = 16f / 9f;
private static final int VERTICAL = 0;
private static final int HORIZONTAL = 0;
private float aspect = DEFAULT_ASPECT;
public AspectImageView(Context context) {
super(context);
}
public AspectImageView(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray arr = context.obtainStyledAttributes(attrs, new int[] { R.attr.aspect });
aspect = arr.getFloat(0, aspect);
arr.recycle();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
if (widthMode == MeasureSpec.EXACTLY || widthMode == MeasureSpec.AT_MOST) {
height = calculate(width, aspect, VERTICAL);
} else if (heightMode == MeasureSpec.EXACTLY || heightMode == MeasureSpec.AT_MOST) {
width = calculate(height, aspect, HORIZONTAL);
} else {
throw new IllegalArgumentException("Either width or height should have exact value");
}
int specWidth = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);
int specHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
super.onMeasure(specWidth, specHeight);
}
private int calculate(int size, float aspect, int direction) {
int wp = getPaddingLeft() + getPaddingRight();
int hp = getPaddingTop() + getPaddingBottom();
return direction == VERTICAL
? Math.round((size - wp) / aspect) + hp
: Math.round((size - hp) * aspect) + wp;
}
}
| [
"wendongz@jumei.com"
] | wendongz@jumei.com |
6e1bf74cdefb06ce2d99ce90f63328c4252c4d59 | 9cc817f1b15bc941c3def18ef7ccd6b3f12fe211 | /src/main/java/com/xinhuanet/pay/service/QuartzService.java | 4bbc488659a975b103701b280d758800e01c9e1e | [] | no_license | liveqmock/xh_pay | a3948e69f2a9c124ed0e59226f914395617d8bed | 0ea5db2212f45ee80723d3de01f3163c6432cd60 | refs/heads/master | 2020-12-28T23:34:53.290914 | 2014-08-25T09:13:31 | 2014-08-25T09:13:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 164 | java | package com.xinhuanet.pay.service;
/**
* Created with IntelliJ IDEA.
* User: 李野
* Date: 13-5-28
* Time: 上午11:20
*/
public interface QuartzService {
}
| [
"bahaidong@163.com"
] | bahaidong@163.com |
1ee408aebafcacb5188ff40d4289fc76dfee80ba | dd70c26cbd7204e0b403ead6a6b8297b57bb3966 | /src/main/java/dev/selena/olympicssite/controllers/EventController.java | 59c88a790ddabedd66ccd4225b8a074f6fa02a90 | [] | no_license | selenacl/olympics-api | b2a5a2a024da0500d2e13c182a3ba397422f3f21 | d038a8ac505ef1673d210386c54fe5505aacb6cb | refs/heads/master | 2022-04-21T22:58:29.662504 | 2020-04-19T00:41:56 | 2020-04-19T00:41:56 | 256,361,318 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 79 | java | package dev.selena.olympicssite.controllers;
public class EventController {
}
| [
"selenacl22@gmail.com"
] | selenacl22@gmail.com |
2190dc52dbe159e4ce479fa8d46a2e42ce20cd4d | 3f3b3c9b21fb37ea40971b8fc8d1a5548ae1a2d4 | /src/main/java/hisense/fdp/cfa/observersubject/impl/ReceiveMsgMQ.java | 1c9b2dfe1385700990a778a50c1e08e21a397ff1 | [] | no_license | lvxczhuce22/lvxcDeom | 94a5e8737028cfcd7e611f941221a5bd9c5dc8e4 | d24aebff4accf1ebbbe11a0da95661036573a4cb | refs/heads/master | 2022-11-06T08:54:21.406263 | 2020-06-19T03:07:13 | 2020-06-19T03:07:13 | 262,730,322 | 0 | 0 | null | 2020-06-19T03:07:14 | 2020-05-10T06:58:34 | Java | UTF-8 | Java | false | false | 1,571 | java | package hisense.fdp.cfa.observersubject.impl;
import hisense.fdp.cfa.model.ConnectorTask;
import hisense.fdp.cfa.util.VariableInit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 接收设备状态变化协议mq处理类
*/
public class ReceiveMsgMQ {
// 打印日志
public static Logger log = LoggerFactory.getLogger(ConnectorMQ.class);
// mq实例
private ConnectorMQ connectorMQ = null;
// 接收设备状态变化协议mq唯一实例
private static ReceiveMsgMQ recevieMsgInstance = new ReceiveMsgMQ(VariableInit.MQ_MAINTAININF_TOPIC);
/**
* 默认构造函数
*/
private ReceiveMsgMQ(String mqName) {
connectorMQ = new ConnectorMQ(mqName);
connectorMQ.setConnectorTask(initConnectorTask());
}
/**
* 获取实例
*
* @return 实例
*/
public static ReceiveMsgMQ getInstance() {
return recevieMsgInstance;
}
/**
* 初始化mq连接任务
*
* @return mq连接任务
*/
private ConnectorTask initConnectorTask() {
ConnectorTask connectorTask = new ConnectorTask();
connectorTask.setServerStr(VariableInit.MQ_SEND_URL);
connectorTask.setUser(VariableInit.MQ_SEND_USER);
connectorTask.setPassword(VariableInit.MQ_SEND_PWD);
connectorTask.setIdentify("");
return connectorTask;
}
/**
* 向mq发送消息协议
*
* @param message
* 消息协议
*/
public void sendMsgToMQ(String message) {
//TODO 与每分钟短线重现检测重复!!!
// if (!connectorMQ.checkAvailable()) {
// connectorMQ.startConnector();
// }
connectorMQ.sendMsgToMQ(message);
}
}
| [
"938706428@qq.com"
] | 938706428@qq.com |
bff1eb3ce0118a85da524fa9cdd43ad016de7527 | 59ea12023da4a0b23d86498f1ea839917116885a | /ACMICPC/2020 Local Programming Contest/solutions/badtree/badtree.java | 649868b54257aa975d5182af98b03856ac649ace | [] | no_license | electricpants01/ACMicpc-contest | 2da6403080d7669f391be255e038909686c46c9d | 2fb6a23b9a88f8bbf4a8223525d1aaa1d7724310 | refs/heads/master | 2022-02-14T07:52:50.112624 | 2022-01-30T15:15:14 | 2022-01-30T15:15:14 | 131,452,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,615 | java | // Arup Guha
// 9/11/2020
// Solution to UCF 2020 Locals Final Round Problem: Bad Tree
import java.util.*;
public class badtree {
public static void main(String[] args) {
// Get size and rank.
Scanner stdin = new Scanner(System.in);
int n = stdin.nextInt();
long rank = stdin.nextLong()-1;
// When we can't do it.
if (n <= 60 && rank+1 > (1L<<(n-1)) )
System.out.println(-1);
// Key idea behind the solution is that # of valid perms is 2^(n-1), at each
// juncture except the last, you can either insert the smallest or largest value
// that hasn't been inserted, and half of the trees are formed with the smallest
// and the other half with the largest. So, you just see how many more ranks you
// have to advance to decide whether or not to take the smallest or largest value
// not yet placed and adjust the remaining rank accordingly. Last issue to watch
// out for is an overflow if you bit shift too far...
else {
// Just need to keep pointers to the beginning
// and end of the list of values not placed yet.
int low = 1, high = n;
// Store answer here.
int[] res = new int[n];
// Go bit by bit.
for (int i=0; i<n; i++) {
// If count is too high or rank is too low, we go with low.
if (n-i-2 >= 60 || rank < (1L<<(n-i-2)) )
res[i] = low++;
// Otherwise, we take from the high end and subtract the bit value from rank.
else {
res[i] = high--;
rank -= (1L<<(n-i-2));
}
}
// Ta da!
for (int i=0; i<n-1; i++)
System.out.print(res[i]+" ");
System.out.println(res[n-1]);
}
}
} | [
"chtorrico@ecisolutions.com"
] | chtorrico@ecisolutions.com |
c1ad37eae28999a8c6f6e32e43271fea87a164fc | 64a5366368f36b25e47b6d754880475022cdcc05 | /src/main/java/pl/motorola/sklep/model/Cart.java | b7c1babe8b66cb83dc04b89e412e1c504b965447 | [] | no_license | karmilanowski/Sklep | 9c7896ccce49e25bc224292c6e8325994e966fad | 3b695559aa99994cf54951c3bcceb4d3c29cb00d | refs/heads/master | 2023-08-21T18:14:53.943670 | 2021-09-27T12:30:10 | 2021-09-27T12:30:10 | 405,642,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | package pl.motorola.sklep.model;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import pl.motorola.sklep.registration.AppUser;
import javax.persistence.*;
import java.util.List;
@Entity
@Getter
@Setter
@NoArgsConstructor
public class Cart {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToMany
private List<CartItem> cartItmes;
@OneToOne
private AppUser appUser;
}
| [
"karol.milanowski91@gmail.com"
] | karol.milanowski91@gmail.com |
65ef165a869de2f7991d0c377064ce050c1b7525 | 39dfc8bfcaa16a599fe1937ad653c381606e2d34 | /contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepository.java | ed673e8d550a1263bee90dc5de0368e701eeff42 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | astra-zhao/cosin | 64cbd876551be0c9472d837d84e291660dbc37c6 | a038fc2e143a1a1f7e2bf00c03f1d86eb29168b2 | refs/heads/osc | 2020-12-11T06:57:50.875210 | 2020-02-27T06:29:24 | 2020-02-27T06:29:24 | 233,794,241 | 0 | 0 | NOASSERTION | 2020-02-27T06:29:25 | 2020-01-14T08:34:23 | null | UTF-8 | Java | false | false | 1,018 | java | /*
* Copyright (C) 2017 优客服-多渠道客服系统
* Modifications copyright (C) 2018-2019 Chatopera Inc, <https://www.chatopera.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.chatopera.cc.persistence.es;
import com.chatopera.cc.model.QuickReply;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
public interface QuickReplyRepository extends ElasticsearchRepository<QuickReply, String> , QuickReplyEsCommonRepository {
}
| [
"hain@chatopera.com"
] | hain@chatopera.com |
9f43b21ac280da686831f7914253fc82f472c03b | b2b894782b931e000af2323cd888f38d14b493bc | /src/main/java/ch05_01/ProduceDataServlet.java | c239b8a90897a1beeb329185249c4d4ddf85f865 | [] | no_license | tacticalandy/jspExercise | 6b5cfa4ea324d6184402680e8cdd190399f53887 | a7c0a74feb85e2c21bdea72665079191f9bcf45e | refs/heads/master | 2023-08-16T15:37:11.343044 | 2020-06-10T08:56:52 | 2020-06-10T08:56:52 | 249,900,209 | 0 | 0 | null | 2023-07-23T09:47:45 | 2020-03-25T06:06:17 | Java | UTF-8 | Java | false | false | 1,860 | java | package ch05_01;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.RequestDispatcher;
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("/ch05_01/ProduceDataServlet")
public class ProduceDataServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 本程式將產生資料,然後轉交給JSP,由JSP顯示出來。
// 第一份資料為字串物件,它將會以"Customer"為識別字串,存放在request範圍(requestScope)
String str1 = "史努比先生";
request.setAttribute("Customer", str1);
// 第二份資料為JavaBean物件,它將會以"PB"為識別字串,存放在request範圍(requestScope)
ProductBean pb0 = new ProductBean("A0001", "橡皮擦", 15.0, 0.15);
request.setAttribute("PB", pb0);
// 第三份資料為Map物件,它將會以"MapKey"為識別字串,存放在request範圍(requestScope)
Map<String , ProductBean> map = new HashMap<String, ProductBean>();
ProductBean pb1 = new ProductBean("H0251", "2B鉛筆", 12.0, 0.10);
ProductBean pb2 = new ProductBean("H0252", "藍色原子筆", 15.0, 0.12);
map.put("key001", pb1);
map.put("key002", pb2);
request.setAttribute("MapKey", map);
RequestDispatcher rd = request.getRequestDispatcher("/ch05_01/ShowData.jsp");
rd.forward(request, response);
return;
}
}
| [
"tacticalandy4@gmail.com"
] | tacticalandy4@gmail.com |
eb606df67c908d07911ba20a9e644a5423612f8d | 9a6ea6087367965359d644665b8d244982d1b8b6 | /src/main/java/X/AnonymousClass3B7.java | a064976f820e2d2d97eac2be2101b2fbe7b6c70f | [] | no_license | technocode/com.wa_2.21.2 | a3dd842758ff54f207f1640531374d3da132b1d2 | 3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9 | refs/heads/master | 2023-02-12T11:20:28.666116 | 2021-01-14T10:22:21 | 2021-01-14T10:22:21 | 329,578,591 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,032 | java | package X;
import android.content.Context;
import java.io.IOException;
import java.util.Properties;
/* renamed from: X.3B7 reason: invalid class name */
public class AnonymousClass3B7 {
public AnonymousClass3BE A00;
public AnonymousClass3BI A01;
public final Context A02;
public final Properties A03;
public final AnonymousClass3B6 A04;
public final AnonymousClass3BL A05;
public AnonymousClass3B7(Context context, AnonymousClass3BL r5) {
String str;
this.A05 = r5;
this.A02 = context;
this.A00 = r5.A03;
Properties properties = new Properties();
try {
properties.load(this.A02.getAssets().open("version.properties"));
this.A03 = properties;
this.A04 = new AnonymousClass3B6(this);
if (r5.A03 != null && (str = r5.A00) != null) {
this.A01 = new AnonymousClass3BI(this.A00, str);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
| [
"madeinborneo@gmail.com"
] | madeinborneo@gmail.com |
37ae1e660c1f3af8a37b8c275b52537e6bc78407 | 47db1842e0885b9c8907f47c07acb2ac8cc33604 | /src/test/java/com/ido/fdexsercise/dao/FarmStatsDAOImplMemTest.java | f16c1c1d938d7f784ef753672fc077ba79073ed5 | [] | no_license | IdoZilberberg/fdexercise | 097582da2bf9c1cb7d2d6e311f3ae14af180ec02 | 8dd09a43ab1e8dc43603c3913d6c8c5809c9e718 | refs/heads/master | 2021-01-10T17:56:20.376015 | 2015-11-15T10:34:16 | 2015-11-15T10:34:16 | 45,504,381 | 1 | 0 | null | 2015-11-15T10:04:45 | 2015-11-04T00:16:33 | Java | UTF-8 | Java | false | false | 1,001 | java | package com.ido.fdexsercise.dao;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import static org.junit.Assert.*;
/**
* Created by Ido on 11/4/2015.
*/
public class FarmStatsDAOImplMemTest {
private EmbeddedDatabase db;
@Before
public void setUp() {
// creates a HSQL in-memory db populated from default scripts classpath:schema.sql and classpath:test-data.sql
db = new EmbeddedDatabaseBuilder().addDefaultScripts().build();
}
@Ignore
@Test
public void testDataAccess() {
JdbcTemplate template = new JdbcTemplate(db);
Integer count = template.queryForObject("select count(*) from stats", Integer.class);
assertEquals(Integer.valueOf(2), count);
}
@After
public void tearDown() {
db.shutdown();
}
} | [
"izilberberg@gmail.com"
] | izilberberg@gmail.com |
9c73cfcb69cc309a05645a2cf03fb59267394338 | 216f8e613ddcc304d193c9d508337980cb064ae5 | /src/index/N001_TwoSum.java | ea084a8b16a4c1befa79691fa297193571c9522f | [] | no_license | jbaek7023/LeetCode-Java | 349649662c49c10c36c79f326d6fd8b97101bea5 | 810dbb42baa7d1c8268b0a17dde9f8949a5ac741 | refs/heads/master | 2021-01-19T08:28:18.579141 | 2017-04-13T05:14:21 | 2017-04-13T05:14:21 | 87,633,937 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,016 | java | package index;
import java.util.HashMap;
import java.util.Map;
/**
* Given nums = [2, 7, 11, 15], target = 9,
Because nums[0] + nums[1] = 2 + 7 = 9,
return [0, 1].
* @author jaeminbaek
*
*/
public class N001_TwoSum {
public static void main(String[] args) {
int[] nums = {2, 3, 7, 11, 15};
int[] output = twoSum(nums, 9);
for(Integer i: output) {
System.out.println(i);
}
}
public static int[] twoSum(int[] nums, int target) {
int[] result = new int[2];
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for (int i = 0; i < nums.length; i++) {
if (map.containsKey(target - nums[i])) {
result[1] = i + 1;
result[0] = map.get(target - nums[i]);
//result(=0) => 2
//result(=1) => 3
return result; //(3,2)
}
//target(=9) - nums[i] = 7
//(2, 1), (3, 2),
//putting takes log(n) time
map.put(nums[i], i + 1);
}
return result;
}
}
| [
"jaeminbaek7023@gmail.com"
] | jaeminbaek7023@gmail.com |
eda77910b45606b530ce2231e80bff423cc81ba5 | 121a43924c0a57d2dcf4b7854c7b9550c1ff78d1 | /src/main/java/db/Way.java | d4503121a2c43fa4404256ea8b4d1c04611f371d | [] | no_license | zy1230/shop | f01ccd121e4d32b1f2ea07289786507edb7cffec | 87f03c67aa0e155b5c2a00dc987bbbb6f1123ff6 | refs/heads/master | 2022-06-29T15:13:56.813052 | 2019-10-26T09:05:55 | 2019-10-26T09:05:55 | 217,683,423 | 1 | 0 | null | 2020-07-02T01:01:32 | 2019-10-26T09:04:58 | Java | UTF-8 | Java | false | false | 2,238 | java | package db;
import object.Fruit;
import object.User;
import java.sql.*;
public class Way {
public static User select(String name,String password) {
Connection conn = null;
PreparedStatement pre = null;
ResultSet set = null;
try {
conn = DB.getConn();
pre = conn.prepareStatement("select * from user where name =? and pass = ?");
pre.setString(1,name);
pre.setString(2,password);
set = pre.executeQuery();
while (set.next()){
User user = new User();
user.setName(set.getString(1));
user.setPassword(set.getString(2));
return user;
}
} catch (SQLException e){
e.printStackTrace();
} finally {
DB.release(set,pre,conn);
}
return null;
}
public static int insert(String name,String password){
int a = 0;
Connection conn = null;
PreparedStatement pre = null;
try {
conn = DB.getConn();
pre = conn.prepareStatement("insert into user values(?,?)");
pre.setString(1,name);
pre.setString(2,password);
a = pre.executeUpdate();
return a;
}catch (SQLException e){
e.printStackTrace();
}finally {
DB.release(null,pre,conn);
}
return a;
}
public static Fruit selectF(String name) {
Connection conn = null;
PreparedStatement pre = null;
ResultSet set = null;
try {
Fruit fruit = new Fruit();
conn = DB.getConn();
pre = conn.prepareStatement("select * from fruit where name = ?");
pre.setString(1,name);
set = pre.executeQuery();
while (set.next()) {
fruit.setName(set.getString("name"));
fruit.setPhoto(set.getString("photo"));
fruit.setPrice(set.getDouble("price"));
}
return fruit;
} catch (SQLException e) {
e.printStackTrace();
} finally {
DB.release(set, pre, conn);
}
return null;
}
}
| [
"1746813424@qq.com"
] | 1746813424@qq.com |
6c8d9c90e1cae992faf2c249a90fef2d9fad7400 | 375f62237d93e0da0040a6c508a7175b59f53793 | /src/test/java/com/wwt/sda/EmailPage.java | 67109474b360a92d3fdec42598ef7d0d474975cc | [] | no_license | buchireddy76/sda | 72caa5eb3de91e1ccbeb30fe65ff7203e171281f | 7e1714218a18258a1b18805459516a473311f483 | refs/heads/master | 2021-01-25T10:00:31.587167 | 2013-10-28T20:29:20 | 2013-10-28T20:29:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,614 | java | package com.wwt.sda;
import java.util.ArrayList;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class EmailPage {
protected final WebDriver driver;
@FindBy(xpath = "//*[@class='sub']")
private WebElement subjectHeader;
@FindBy(xpath = "//*[@class='bdy']//h1")
private WebElement bodyFirstLine;
@FindBy(xpath = "//*[@class='bdy']//div//table[2]//tbody//tr//td[2]")
private WebElement releaseType;
@FindBy(xpath = "//*[@class='bdy']//div//table[2]//tbody//tr[5]//td[2]")
private WebElement ShpFrom;
@FindBy(xpath = "//*[@class='bdy']//div//table[2]//tbody//tr[9]//td[2]")
private WebElement ShpTo;
@FindBy(xpath = "//*[@class='bdy']//div//table[3]//tbody//tr[4]//table//tbody//tr")
private List<WebElement> tableRowsHFlex;
@FindBy(xpath = "//*[@class='bdy']//div//table[3]//tbody//tr[2]//table//tbody//tr")
private List<WebElement> tableRowsCM;
@FindBy(xpath = "//*[@class='bdy']//div//table[3]//tbody//tr[6]//table//tbody//tr")
private List<WebElement> tableRowsRFDS;
public EmailPage(WebDriver driver) {
this.driver = driver;
}
// For Outlook Interaction
public void LoginOutlook() throws InterruptedException{
System.out.println("Logging to the Webmail account");
driver.navigate().to("https://webmail.wwt.com/");
driver.findElement(By.id("username")).sendKeys("ramidib");
driver.findElement(By.id("password")).sendKeys("Hello123");
driver.findElement(By.className("btn")).click();
Thread.sleep(10000);
}
public void clickInbox() throws InterruptedException{
driver.findElement(By.linkText("Inbox")).click();
Thread.sleep(3000);
}
public boolean verifyFirstMailSubject(String siteDetails){
boolean email=false;
String subject = subjectHeader.getText();
System.out.println("Subject of First email in the Inbox is : "+subject);
if (subject.contains("Order Submitted") && subject.contains(siteDetails)) {
email = true;
} else {
email = false;
}
return email;
}
public void clickFirstEmail() throws InterruptedException {
System.out.println("Click on the First email in the Inbox");
driver.findElement(By.xpath("//tr[3]/td[@class='frst'][6]/h1/a")).click();;
Thread.sleep(1000);
}
public boolean verifySalesOrder(String sOrder) {
String firstLineInBody[] = bodyFirstLine.getText().split(":");
String salesOrderInMailBdy = firstLineInBody[1];
String salesOrderInMail = salesOrderInMailBdy.trim();
System.out.println("The first line in Email body is : "+salesOrderInMail);
if (salesOrderInMail.equals(sOrder)) {
return true;
} else {
return false;
}
}
public boolean verifyReleaseType(String typeRelease) {
String releaseTypeInMail = releaseType.getText();
System.out.println("Release Type in email is : "+releaseTypeInMail);
if (releaseTypeInMail.equals(typeRelease)) {
return true;
} else {
return false;
}
}
public boolean verifyShipFrom(String frmLocation) {
String shpFromInMail = ShpFrom.getText();
System.out.println("Shipping location from in Email is : "+shpFromInMail);
if (shpFromInMail.equals(frmLocation)) {
return true;
} else {
return false;
}
}
public boolean verifyShipTo(String toLocation) {
String shpToInMail = ShpTo.getText();
System.out.println("Location to ship in Email is : "+shpToInMail);
if (shpToInMail.equals(toLocation)) {
return true;
} else {
return false;
}
}
public boolean verifyTables(){
boolean flag=false;
String consMtrlTable = driver.findElement(By.xpath("//h3[contains(text(),'CONSTRUCTION MATERIALS')]")).getText();
String hybriFlexTable = driver.findElement(By.xpath("//h3[contains(text(),'HYBRIFLEX')]")).getText();
String rfdsTable = driver.findElement(By.xpath("//h3[contains(text(),'RFDS MATERIALS')]")).getText();
if(consMtrlTable.contains("CONSTRUCTION") && hybriFlexTable.equals("HYBRIFLEX") && rfdsTable.contains("RFDS")){
System.out.println("RFDS, Hybriflex and Construction Material Tables are verified");
flag=true;
}
return flag;
}
public List emlReadTable(String tableName)
{
List emlCateg=new ArrayList();
List emlPart=new ArrayList();
List emlDesc=new ArrayList();
List emlCurDesg=new ArrayList();
List emlMainList=new ArrayList();
int m=0;
if (tableName.equals("RFDS"))
m =6;
else if (tableName.equals("HFlex"))
m =4;
else if (tableName.equals("CM"))
m =2;
List<WebElement> list= driver.findElements(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr"));
System.out.println(" ");
System.out.println("************** Printing values for " +tableName+ " Table for "+list.size()+" rows from the Email ***************");
for(int rows =2; rows <=list.size(); rows++){
String emlCategory= driver.findElement(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr["+rows+"]/td[5]")).getText();
emlCateg.add(emlCategory);
System.out.print(emlCategory+" ");
String emlPartNo= driver.findElement(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr["+rows+"]/td[4]")).getText();
emlPart.add(emlPartNo);
System.out.print(emlPartNo+" ");
String emlDescription= driver.findElement(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr["+rows+"]/td[6]")).getText();
emlDesc.add(emlDescription);
System.out.print(emlDescription+" ");
String appCrDsgn= driver.findElement(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr["+rows+"]/td[1]")).getText();
emlCurDesg.add(appCrDsgn);
System.out.print(appCrDsgn);
System.out.println(" ");
}
System.out.println(" ");
emlMainList.add(emlCateg);
emlMainList.add(emlPart);
emlMainList.add(emlDesc);
emlMainList.add(emlCurDesg);
return emlMainList;
}
public boolean verifyLists(List<List> appList, List<List> emlList, String table)
{
boolean b=true;
if (table.equals("RFDS")) {
System.out.println("Verifying Email values with the Application Values for RFDS Table");
} else if (table.equals("HFlex")) {
System.out.println("Verifying Email values with the Application Values for HybriFlex Table");
} else if (table.equals("CM")) {
System.out.println("Verifying Email values with the Application Values for Construction Material Table");
}
for(int i=0;i<appList.size();i++)
{
if(!appList.get(i).containsAll(emlList.get(i)))
{
System.out.println("We have a miss match in comparing both the list values");
b=false;
break;
}
}
return b;
}
}
| [
"buchi.reddy@yahoo.com"
] | buchi.reddy@yahoo.com |
e2a3e14490eba1740596d3c81bb51a1b159f89d5 | 7fcf2f870809b1c4458fdafe37b64f049566e3dd | /set/src/Data2/Branch.java | c68db5ba39fd05fb8eb8234a15ad29c3e38cab37 | [] | no_license | lilianzz/data2 | 1c21c18009871a8d3de709ce95596ece73e1be2e | c4ac4e4541112391275643b3bd0dee3f5a1fea32 | refs/heads/master | 2020-06-04T09:41:37.103086 | 2015-04-07T23:58:27 | 2015-04-07T23:58:27 | 33,280,152 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,029 | 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 Data2;
import static java.lang.Integer.min;
/**
*
* @author 栗粒盐
*/
public class Branch <T extends Comparable<T>> implements Multiset<T>{
Multiset left;
T key;
Multiset right;
int number;
private int depth;
// return a new leaf to create an empty finite set
public static Multiset empty() {
return new Leaf();
}
//constructor
Branch(Multiset left, T key, Multiset right, int n) {
this.left = left;
this.key = key;
this.right = right;
this.number = n;
if (left.isEmptyHuh() && right.isEmptyHuh())
this.depth =1;
else if (left.isEmptyHuh())
this.depth = right.getDepth()+ 1;
else if (right.isEmptyHuh())
this.depth = left.getDepth()+ 1;
else
depth = (Math.max(left.getDepth(), right.getDepth()) + 1);
}
public T getKey() {
return this.key;
}
public Multiset right() {
return this.right;
}
public Multiset left() {
return this.left;
}
public int getDepth() {
return this.depth;
}
//add the cardinality of left subtree and right
//subtree and 1 for the node itself
public int cardinality() {
return (this.number+left.cardinality() +right.cardinality());
}
//since it's not a Leaf, it's not empty, return false
public boolean isEmptyHuh() {
return false;
}
private int balance() {
int L = this.left.getDepth();
int R = this.right.getDepth();
if (L - R >= 2)
return -1;
else if (L - R <= -2)
return 1;
return 0;
}
//add an element to the Multiset
public Multiset<T> add( T x ) {
int k = x.compareTo(this.key);
Branch q;
if ( k < 0 ) {
q= new Branch( this.left.add(x),
this.key,
this.right,
this.number);
} else if (k==0) {
q= new Branch( this.left,
this.key,
this.right,
(this.number+1));}
else { /* if k >= 0 */
q= new Branch( this.left,
this.key,
this.right.add(x),
this.number);
}
if (this.balance()==1) {
return q.rotateL();
} else {
if (this.balance() == -1) {
return q.rotateR();
} else {
return q;
}
}
}
public Multiset add(T x, int n) {
Branch q;
int k = x.compareTo(this.key);
if ( k < 0 ) {
q = new Branch( this.left.add(x,n),
this.key,
this.right,
this.number);
} else if (k==0) {
q = new Branch( this.left,
this.key,
this.right,
(this.number+n));}
else { /* if k >= 0 */
q = new Branch( this.left,
this.key,
this.right.add(x,n),
this.number);
}
if (this.balance()==1) {
return q.rotateL();
} else {
if (this.balance() == -1) {
return q.rotateR();
} else {
return q;
}
}
}
//search if x is in the tree
public boolean member(T x) {
int k = x.compareTo(this.key);
// return true if x equals its value
if (k == 0) {
return true;
}
//otherwise see if x in the left subtree or
//in the right subree
else
if (k < 0) {
return this.left.member(x);
}
else return this.right.member(x);
}
public Multiset remove(T x) {
Branch q;
int k = x.compareTo(this.key);
if (k == 0) {
if (this.number ==1 ) {
q = (Branch) this.left.union(this.right);
} else
q = new Branch(this.left,
this.key,
this.right,
(this.number-1));
}
else
if (k < 0) {
q = new Branch(this.left.remove(x), key, right,this.number);
}
else q = new Branch(left,key,this.right.remove(x),this.number);
if (this.balance()==1) {
return q.rotateL();
} else {
if (this.balance() == -1) {
return q.rotateR();
} else {
return q;
}
}
}
public Multiset remove(T x, int n) {
int k = x.compareTo(this.key);
if (n==0) {return this;} else {
if (k == 0) {
if (this.number<=n) {
return this.left.union(this.right);
} else {
return new Branch(this.left,
this.key,
this.right,
(this.number-n));
}
}
else
if (k < 0) {
return new Branch(this.left.remove(x,n), key, right,this.number);
}
else return new Branch(left,key,this.right.remove(x,n),this.number);
}
}
public Multiset union(Multiset u) {
return u.union(left).union(right).add(key,this.number);
}
public Multiset inter(Multiset u) {
if (u.member(key)) {
return u.inter(this.removeall(key)).add(key,min(this.number,u.count(key)));
}
else {
return u.inter(this.removeall(key));
}
}
public boolean subset(Multiset u) {
Multiset temp = new Leaf();
temp = temp.union(u);
boolean t = true;
for (int i = 0; i<(number-1); i++) {
temp = temp.remove(this.key);
}
if (temp.member(this.key)) {
return left.subset(u) && right.subset(u);
}
else
return false;
}
public boolean equal(Multiset u) {
return (u.subset(this) && this.subset(u));
}
//
public Multiset diff(Multiset u) {
return this.remove(key).diff(u.remove(key));
}
public String toString() {
String t = "";
for (int i=0; i<number;i++) {
t = t+key+" ";
}
return left.toString() + " " + t + right.toString();
}
@Override
public int count(T x) {
int k = x.compareTo(this.key);
if (k == 0) {
return (this.number);
}
else
if (k < 0) {
return this.left.count(x);
}
else return this.right.count(x);
}
public Multiset filter(T x) {
int k = x.compareTo(this.key);
if (k==0) {
return (new Branch(this.left,this.key,this.right,1));
} else
if (k<0) {
return (new Branch(this.left.filter(x),key,this.right,this.number));
} else
return (new Branch(this.left, key, this.right.filter(x),this.number));
}
@Override
public Multiset removeall(T x) {
int k = x.compareTo(this.key);
if (k == 0) {
return this.left.union(this.right);
}
else
if (k < 0) {
return (new Branch(this.left.removeall(x), key, right,number));
}
else return (new Branch(left,key,this.right.removeall(x),number));
}
/*
public int sumItS () {
int sum = 0;
Sequence as = this;
while ( as.notEmpty() ) {
sum = sum + this.here();
as = as.next();
}
return sum;
}
*/
public T nth(int n) {
Sequence as = this.seq();
for (int i = n; i>0; i--) {
as = as.next();
System.out.println(as.here());
}
return (T) as.here();
}
public int sum() {
Sequence as = this.seq();
int sum = 0;
while ( as.notEmpty() ) {
System.out.println(as.here());
sum = sum + ((Integer) as.here());
as = as.next();
}
return sum;
}
public Sequence seq() {
return new AS_Branch(key, number, (new AS_Cat(left.seq(), right.seq())));
}
/*public Multiset rotateR() {
Multiset r = this.right;
if (r.isEmptyHuh()) {
return new Leaf();
} else {
Branch t = (Branch) this.right;
return (new Branch(t.right,t.key,
new Branch(this.left,this.key,t.left,this.number),t.number));
}
}*/
private Multiset<T> rotateR () {
Branch q = this;
Multiset p = q.left();
Multiset c = q.right();
Multiset a = p.left();
Multiset b = p.right();
q = new Branch(b,q.key,c,q.number);
if (p.isEmptyHuh()) {
return a.union(q);
} else {
p = new Branch(a, p.getKey(), q, ((Branch) p).number);
return p;
}
}
public Multiset<T> rotateL() {
Branch q = this;
Multiset p = this.right();
Multiset c = this.left();
Multiset a = p.left();
Multiset b = p.right();
q = new Branch(c,q.key,a,this.number);
if (p.isEmptyHuh()) {
return q.union(b);
} else {
p = new Branch(q,this.right().getKey(),b,((Branch) p).number);
return p;
}
}
}
| [
"lizhao@vassar.edu"
] | lizhao@vassar.edu |
8a6b86decf42b7b814a6d76fe21a2d1318767588 | df4c718be25f1d6d0e58d39fc38c32ca7989c700 | /app/src/main/java/eu/inloop/stockquery/provider/NasdaqHttpStockRetriever.java | 82867b5e380e38766b37bc32d9473483b2e90fd5 | [
"MIT"
] | permissive | Moergil/stockquery | e2aea01e8acf038ed55c10e2869433dfe9246b9e | 1a5f0bc4c9175bc0cc4eb08810136080fdbfc1f5 | refs/heads/master | 2020-12-25T14:48:18.550069 | 2016-08-04T19:47:56 | 2016-08-04T19:51:34 | 64,922,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,322 | java | package eu.inloop.stockquery.provider;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import eu.inloop.stockquery.data.StockItem;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
public class NasdaqHttpStockRetriever implements StockRetriever {
private final Gson gson;
private final GoogleFinanceService googleFinanceService;
{
gson = new GsonBuilder().create();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://www.google.com/finance/")
.build();
googleFinanceService = retrofit.create(GoogleFinanceService.class);
}
@Override
public List<StockItem> retrieveStockValue(List<String> symbols) throws IOException {
String query = assembleQuery(symbols);
ResponseBody body = googleFinanceService.listStocksRaw(query).execute().body();
String responseString = extractResponseString(body);
return parseStockItems(responseString);
}
private String assembleQuery(List<String> symbols) {
StringBuilder builder = new StringBuilder("NASDAQ:");
boolean first = true;
for (String symbol : symbols) {
if (!first) {
builder.append(",");
} else {
first = false;
}
builder.append(symbol);
}
return builder.toString();
}
private String extractResponseString(ResponseBody body) throws IOException {
byte[] bytes = body.bytes();
String result = new String(bytes);
result = result.replace("//", "");
result = result.replace("\n", "");
return result;
}
private List<StockItem> parseStockItems(String json) {
List<StockItem> stockItems = new ArrayList<>();
JsonArray array = gson.fromJson(json, JsonArray.class);
for (int i = 0; i < array.size(); i++) {
JsonObject stockItemObject = array.get(i).getAsJsonObject();
String symbol = stockItemObject.get("t").getAsString();
BigDecimal value = stockItemObject.get("l").getAsBigDecimal();
StockItem stockItem = new StockItem(symbol, value);
stockItems.add(stockItem);
}
return stockItems;
}
private interface GoogleFinanceService {
@GET("info")
Call<ResponseBody> listStocksRaw(@Query("q") String query);
}
private class NasdaqStockItem {
String id;
String t;
String e;
String l;
String l_fix;
String l_cur;
String s;
String ltt;
String lt;
String lt_dts;
String c;
String c_fix;
String cp;
String cp_fix;
String ccol;
String pcls_fix;
}
}
| [
"matej.istenik@inloop.eu"
] | matej.istenik@inloop.eu |
974befb31a2fbc27bc583f5e3e97543fda7320ed | dca28901fb2e0fbb4b6b04a8dca852d2b2449e91 | /jtransc-media-game/src/com/jtransc/game/batch/BatchBuilder.java | 05f57974824f02d796289e34438543e3d012f499 | [] | no_license | wiltonlazary/jtransc-media | 73f2afe60de0736afa66ecc7d13194fd0d747ffe | 6f5f8a4cbdcad4208efb897621fdb864493de036 | refs/heads/master | 2021-01-12T03:48:27.034325 | 2016-12-04T15:03:27 | 2016-12-04T15:03:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,754 | java | package com.jtransc.game.batch;
import com.jtransc.FastMemory;
import com.jtransc.FastMemory4Float;
import com.jtransc.FastMemory4Int;
import com.jtransc.Mem;
import com.jtransc.game.math.Point;
import com.jtransc.media.JTranscRender;
public class BatchBuilder {
public FastMemory vertices = FastMemory.alloc(4 * 6 * 16 * 1024);
public FastMemory4Float verticesFloat = new FastMemory4Float(vertices);
public FastMemory4Int verticesInt = new FastMemory4Int(vertices);
public short[] indices = new short[6 * 1024 * 6];
public int[] batches = new int[16 * 256];
public int verticesIndex = 0;
public int indicesIndex = 0;
public int batchCount = 0;
// Data
public Batch current = new Batch();
public void start() {
Mem.select(vertices);
}
public void reset() {
verticesIndex = 0;
indicesIndex = 0;
batchCount = 0;
current.reset();
}
private void flush() {
if (current.triangleCount <= 0) return;
current.write(batches, batchCount * 16);
batchCount++;
current.startIndex = indicesIndex;
current.triangleCount = 0;
}
public void quad(int texture, Point p0, Point p1, Point p2, Point p3, float tx0, float ty0, float tx1, float ty1, int color1, int color2) {
if (current.texture != texture) {
flush();
current.texture = texture;
}
int vii = verticesIndex;
int vi = vii * 6;
short[] i = indices;
int ii = indicesIndex;
//println("${p0.x}, ${p0.y}, ${p1.x}, ${p1.y} :: $x, $y, $w, $h :: $matrix")
Mem.sf32(vi + 0, (float) p0.x);
Mem.sf32(vi + 1, (float) p0.y);
Mem.sf32(vi + 2, tx0);
Mem.sf32(vi + 3, ty0);
Mem.si32(vi + 4, color1);
Mem.si32(vi + 5, color2);
Mem.sf32(vi + 6, (float) p1.x);
Mem.sf32(vi + 7, (float) p1.y);
Mem.sf32(vi + 8, tx1);
Mem.sf32(vi + 9, ty0);
Mem.si32(vi + 10, color1);
Mem.si32(vi + 11, color2);
Mem.sf32(vi + 12, (float) p2.x);
Mem.sf32(vi + 13, (float) p2.y);
Mem.sf32(vi + 14, tx0);
Mem.sf32(vi + 15, ty1);
Mem.si32(vi + 16, color1);
Mem.si32(vi + 17, color2);
Mem.sf32(vi + 18, (float) p3.x);
Mem.sf32(vi + 19, (float) p3.y);
Mem.sf32(vi + 20, tx1);
Mem.sf32(vi + 21, ty1);
Mem.si32(vi + 22, color1);
Mem.si32(vi + 23, color2);
i[ii + 0] = (short) (vii + 0);
i[ii + 1] = (short) (vii + 1);
i[ii + 2] = (short) (vii + 2);
i[ii + 3] = (short) (vii + 1);
i[ii + 4] = (short) (vii + 3);
i[ii + 5] = (short) (vii + 2);
verticesIndex += 4;
indicesIndex += 6;
current.triangleCount += 2;
}
public void render() {
flush();
//println(vertices.slice(0 until 4 * 6))
//println(indices.slice(0 until 6))
//println(batches[0])
//println(batches[1])
//println(batches[2])
//println(batches[3])
JTranscRender.render(vertices, verticesIndex, indices, indicesIndex, batches, batchCount);
}
}
| [
"soywiz@gmail.com"
] | soywiz@gmail.com |
8927d5fdd22fe14fe2120e8066feea23680b4703 | aa0b5ca75dcf4cee8a4f1b26310e536bb7c11dc0 | /java/akka-java/src/main/java/com/asiafrank/akka/eventstream/Main.java | 80e33c8aa2bdef4a6a2ae81a116dbb2c8784b6c6 | [] | no_license | asiafrank/learn | fc50267af2de743b75ef052aea448292bb8b6216 | 0c5098afa5a1b9e00aa68c9f93e594540e7a62dd | refs/heads/master | 2022-10-21T18:28:33.829430 | 2021-03-04T03:05:27 | 2021-03-04T03:05:27 | 125,231,597 | 1 | 0 | null | 2022-10-12T20:27:35 | 2018-03-14T15:10:08 | C++ | UTF-8 | Java | false | false | 1,118 | java | package com.asiafrank.akka.eventstream;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.DeadLetter;
import akka.actor.Props;
/**
* Main
*
* Created by zhangxf on 12/1/2016.
*/
class Main {
public static void main(String[] args){
ActorSystem system = ActorSystem.apply();
final ActorRef actor = system.actorOf(Props.create(DeadLetterActor.class));
system.eventStream().subscribe(actor, DeadLetter.class);
final ActorRef jazzListener = system.actorOf(Props.create(Listener.class));
final ActorRef musicListener = system.actorOf(Props.create(Listener.class));
system.eventStream().subscribe(jazzListener, Jazz.class);
system.eventStream().subscribe(musicListener, AllKindsOfMusic.class);
// only musicListener gets this message, since it listens to *all* kinds of music:
system.eventStream().publish(new Electronic("Parov Stelar"));
// jazzListener and musicListener will be notified about Jazz:
system.eventStream().publish(new Jazz("Sonny Rollins"));
system.terminate();
}
}
| [
"zhangxfdev@gmail.com"
] | zhangxfdev@gmail.com |
f369631e78167d2e489ba6a9ee825e01105dd97d | fb4419262dee2d4ae3b3d33c5b9993ef1e724715 | /src/main/java/mx/bidg/model/BudgetConceptDistributor.java | 4069658667391da67a1ea22a2450ce76a6e6bb0a | [] | no_license | josueolvera/respaldo | e896389c8da6b0ddbec27c3076ba9fdb48800c0f | 154277496408fd4fae6097c71963847f41658651 | refs/heads/master | 2021-01-01T04:46:44.178271 | 2017-07-11T18:49:01 | 2017-07-11T18:49:01 | 97,240,709 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,867 | java | package mx.bidg.model;
import com.fasterxml.jackson.annotation.JsonView;
import mx.bidg.config.JsonViews;
import javax.persistence.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
*
* @author rafael
*/
@Entity
@Table(
name = "BUDGET_CONCEPT_DISTRIBUTOR",
uniqueConstraints = {
@UniqueConstraint(
name = "UNIQUE_CONCEPT_DISTRIBUTOR", columnNames = {"ID_BUDGET_MONTH_CONCEPT", "ID_DISTRIBUTOR"}
)
}
)
public class BudgetConceptDistributor implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID_BUDGET_CONCEPT_DISTRIBUTOR")
@JsonView(JsonViews.Root.class)
private Integer idBudgetConceptDistributor;
@Column(name = "ID_BUDGET_MONTH_CONCEPT", insertable = false, updatable = false)
@JsonView(JsonViews.Root.class)
private Integer idBudgetMonthConcept;
@Basic(optional = false)
@NotNull
@Column(name = "ID_DISTRIBUTOR", insertable = false, updatable = false)
@JsonView(JsonViews.Root.class)
private int idDistributor;
@Basic(optional = false)
@NotNull
@Column(name = "AMOUNT")
@JsonView(JsonViews.Root.class)
private BigDecimal amount;
@Max(value = 1)
@Basic(optional = false)
@NotNull
@Column(name = "PERCENT")
@JsonView(JsonViews.Root.class)
private BigDecimal percent;
@JoinColumn(name = "ID_DISTRIBUTOR", referencedColumnName = "ID_DISTRIBUTOR")
@ManyToOne(optional = false)
@JsonView(JsonViews.Embedded.class)
private CDistributors distributor;
@JoinColumn(name = "ID_BUDGET_MONTH_CONCEPT", referencedColumnName = "ID_BUDGET_MONTH_CONCEPT")
@ManyToOne(optional = false)
@JsonView(JsonViews.Embedded.class)
private BudgetMonthConcepts budgetMonthConcept;
public BudgetConceptDistributor() {
}
public BudgetConceptDistributor(Integer idBudgetConceptDistributor) {
this.idBudgetConceptDistributor = idBudgetConceptDistributor;
}
public BudgetConceptDistributor(Integer idBudgetConceptDistributor, int idDistributor, BigDecimal amount, BigDecimal percent) {
this.idBudgetConceptDistributor = idBudgetConceptDistributor;
this.idDistributor = idDistributor;
this.amount = amount;
this.percent = percent;
}
public Integer getIdBudgetConceptDistributor() {
return idBudgetConceptDistributor;
}
public void setIdBudgetConceptDistributor(Integer idBudgetConceptDistributor) {
this.idBudgetConceptDistributor = idBudgetConceptDistributor;
}
public int getIdDistributor() {
return idDistributor;
}
public void setIdDistributor(int idDistributor) {
this.idDistributor = idDistributor;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getPercent() {
return percent;
}
public void setPercent(BigDecimal percent) {
this.percent = percent;
}
public Integer getIdBudgetMonthConcept() {
return idBudgetMonthConcept;
}
public void setIdBudgetMonthConcept(Integer idBudgetMonthConcept) {
this.idBudgetMonthConcept = idBudgetMonthConcept;
}
public CDistributors getDistributor() {
return distributor;
}
public void setDistributor(CDistributors distributor) {
this.distributor = distributor;
}
public BudgetMonthConcepts getBudgetMonthConcept() {
return budgetMonthConcept;
}
public void setBudgetMonthConcept(BudgetMonthConcepts budgetMonthConcept) {
this.budgetMonthConcept = budgetMonthConcept;
}
@Override
public int hashCode() {
int hash = 0;
hash += (idBudgetConceptDistributor != null ? idBudgetConceptDistributor.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof BudgetConceptDistributor)) {
return false;
}
BudgetConceptDistributor other = (BudgetConceptDistributor) object;
if ((this.idBudgetConceptDistributor == null && other.idBudgetConceptDistributor != null) || (this.idBudgetConceptDistributor != null && !this.idBudgetConceptDistributor.equals(other.idBudgetConceptDistributor))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.bidg.model.BudgetConceptDistributor[ idBudgetConceptDistributor=" + idBudgetConceptDistributor + " ]";
}
}
| [
"rafaelvb25@gmail.com"
] | rafaelvb25@gmail.com |
229a44e9e84980abb28a32ac6869d7c083ac7ab5 | fb65e9ce54a7211f2eb384a7a0ecbda9ac9f6d4f | /LATIHAN3/TestSiswa.java | 95403e1531fa5c8309ab10301d4a2185ade108f0 | [] | no_license | Syihabuddinsanni/Tugas_PBO2 | 150347a8a018ba51d8d080a7003cc328e29a2dd3 | ed404bfbb5edab3706b1ebb3789605eb4ac89022 | refs/heads/master | 2020-08-23T05:58:11.494369 | 2019-10-21T13:53:49 | 2019-10-21T13:53:49 | 216,557,890 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java |
package LATIHAN3;
public class TestSiswa {
public static void main(String[] args) {
EncapSiswa siswa = new EncapSiswa();
siswa.setName("Syihab");
siswa.setAge(16);
siswa.setAdress("Malang");
System.out.println("Name : "+siswa.getName());
System.out.println("Age : "+siswa.getAge());
System.out.println("Adress : "+siswa.getAdress());
}
}
| [
"muhammad_izzul_28rpl@student.smktelkom-mlg.sch.id"
] | muhammad_izzul_28rpl@student.smktelkom-mlg.sch.id |
80db739e9872c6e796940fab75316d44925d2535 | 7eae0f11062da665e703f46e3e791e0f53d70aa8 | /src/test/java/com/Morning_batch/pom_miniproject.java | cd894d8b00b849e3869c95cdf915bdfc39ca9750 | [] | no_license | durai678/JavaData | 8ad57022ce1f3a46a25522b4d3503c560c0cd2db | 0b933ba2f1aeafac454bbe5a8ffe6b09b94d4d0d | refs/heads/master | 2023-08-14T19:32:07.545434 | 2021-10-05T06:55:40 | 2021-10-05T06:55:40 | 413,711,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,213 | java | package com.Morning_batch;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class pom_miniproject {
//login page
@FindBy(xpath="//*[@id=\'email\']")
public static WebElement username;
@FindBy(xpath="//*[@id=\'passwd\']")
public static WebElement passward;
@FindBy(xpath="//*[@id=\"SubmitLogin\"]/span")
public static WebElement login;
//Dress page
@FindBy(xpath="//*[@id=\"block_top_menu\"]/ul/li[2]/a")
public static WebElement dress_page;
@FindBy(xpath="//*[@id=\"subcategories\"]/ul/li[1]/div[1]/a/img")
public static WebElement casual_dress;
@FindBy(xpath="/html/body/div/div[2]/div/div[3]/div[2]/ul/li/div/div[1]/div/a[1]/img")
public static WebElement dress;
//add to cart
@FindBy(xpath="/html/body/div[2]/div/div/div/div/iframe")
public static WebElement framee;
@FindBy(xpath="/html/body/div/div/div[3]/form/div/div[2]/p[1]/a[2]/span")
public static WebElement qty;
@FindBy(xpath="/html/body/div/div/div[3]/form/div/div[2]/div/fieldset[1]/div/div/select")
public static WebElement size;
@FindBy(xpath="/html/body/div/div/div[3]/form/div/div[3]/div[1]/p/button/span")
public static WebElement add_to_cart;
//checkout page
@FindBy(xpath="/html/body/div/div[1]/header/div[3]/div/div/div[4]/div[1]/div[2]/div[4]/a/span")
public static WebElement proceed;
@FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/p[2]/a[1]/span")
public static WebElement proceed1;
@FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/form/p/button/span")
public static WebElement proceed2;
@FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/div/form/div/p[2]/div/span/input")
public static WebElement agreee;
@FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/div/form/p/button/span")
public static WebElement proceed3;
@FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/div/div[3]/div[2]/div/p/a")
public static WebElement pay_by_cheak;
//order page
@FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/form/p/button/span")
public static WebElement confirm_order;
@FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/p[2]/a")
public static WebElement back_to_order;
}
| [
"jabasdhoni678@gmail.com"
] | jabasdhoni678@gmail.com |
d2ddefc94aaf37d884ae346da6d58351ef77ebff | 1f207999be869a53c773c4b3dc4cff3d78f60aca | /pay-java-parent/pay-java-demo/src/main/java/com/egzosn/pay/demo/controller/PayTestController.java | 4ac98df2da7be6b4b4016ce3cfcd35969b936b86 | [
"Apache-2.0"
] | permissive | BrendaHub/quanmin_admin | 8b4f1643112910b728adc172324b8fb8a2f672dc | 866548dc219a2eaee0a09efbc3b6410eb3c2beb9 | refs/heads/master | 2021-05-09T04:17:03.818182 | 2018-01-28T15:00:12 | 2018-01-28T15:00:12 | 119,267,872 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package com.egzosn.pay.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.Api;
@Api(tags="支付模块")
@Controller
public class PayTestController {
@RequestMapping("/pay/testindex.do")
public String index() {
return "/demo/index";
}
}
| [
"13552666934@139.com"
] | 13552666934@139.com |
96d0e12544c21615b261c607ed1544d2291a4cbf | 66b2d0cc86ec6717464053113f72b46e67b1dfec | /17_电商虚拟交易(项目)/day95_电商虚拟交易(项目)/代码/sleuth_parent/sleuth_client1/src/main/java/com/sleuth/Application1.java | 1d218214452f5bee6763d6d68fcdb63a05b0e159 | [] | no_license | wjphappy90/360Java | c33ca9bbb85b310f01ee42c585dd1aa28682e7b4 | 867dfb7f4788ca4df44e14dd21ffa9322a5dbb43 | refs/heads/master | 2022-11-28T09:03:28.791935 | 2020-08-10T02:20:48 | 2020-08-10T02:20:48 | 285,675,392 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 546 | java | package com.sleuth;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
/**
* Created by 传智播客*黑马程序员.
*/
@SpringBootApplication
public class Application1 {
@Bean
RestTemplate restTemplate() {
return new RestTemplate();
}
public static void main(String[] args) {
SpringApplication.run(Application1.class, args);
}
}
| [
"981146457@qq.com"
] | 981146457@qq.com |
4a1df13566a6c6a63e9ced2d6867a063660bb154 | cc6243837f70bd001af3905efc345ec210bd6e76 | /javalib/src/main/java/com/bhargavaroyal/javalib/collections/arraylist/ArrayListSortExample.java | fa3bb2d293c51e8a1d950ac6ae8b91b485d6beff | [] | no_license | bhargavaroyal/OutlineAndJav | 01ddb3e30e4c7b1db4ea869d587335a0b9fd9efa | 526ce6b697078226a8428ee6219d3a49063ed05c | refs/heads/main | 2023-08-03T09:11:06.291351 | 2021-09-18T16:52:56 | 2021-09-18T16:52:56 | 387,354,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | package com.bhargavaroyal.javalib.collections.arraylist;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
public class ArrayListSortExample {
public static void main(String[] args) {
List<String> names = new ArrayList<>();
names.add("Lisa");
names.add("Jennifer");
names.add("Mark");
names.add("David");
System.out.println("Names : " + names);
// Sort an ArrayList using its sort() method. You must pass a Comparator to the ArrayList.sort() method.
names.sort(new Comparator<String>() {
@Override
public int compare(String name1, String name2) {
return name1.compareTo(name2);
}
});
// The above `sort()` method call can also be written simply using lambda expression
/* names.sort((name1, name2) -> name1.compareTo(name2));
// Following is an even more concise solution
names.sort(Comparator.naturalOrder());*/
System.out.println("Sorted Names : " + names);
}
}
| [
"bhargavaroyal@gmail.com"
] | bhargavaroyal@gmail.com |
930f95b08afc4b58d82fd429390475124255ec99 | e52c2c98a5ebb3ddee4b19d302d9701e7c90541b | /LeetCode-Java/src/base/offer/J25.java | d9271ab4cb31a7da0a2dcce469f32c28c687d567 | [] | no_license | EvAn-HuAngBiu/Leetcode | bc578cf320b380d59727b6d4aa31a63555e5c9e6 | b5b8104973a99dab13ea6040cba4fe85e0408504 | refs/heads/master | 2023-08-02T07:03:07.722680 | 2021-10-09T08:46:52 | 2021-10-09T08:46:52 | 279,460,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 922 | java | package base.offer;
/**
* Project: LeetCode-Java
* File: J25
*
* @author evan
* @date 2021/4/21
*/
public class J25 {
public ListNode mergeTwoLists(ListNode l1, ListNode l2) {
ListNode head = new ListNode(-1), p = l1, q = l2, t = head;
while (p != null & q != null) {
if (p.val < q.val) {
t.next = p;
p = p.next;
} else {
t.next = q;
q = q.next;
}
t = t.next;
}
if (p != null) {
t.next = p;
} else {
t.next = q;
}
return head.next;
}
public static void main(String[] args) {
ListNode l1 = new ListNode(1, new ListNode(2, new ListNode(4)));
ListNode l2 = new ListNode(1, new ListNode(3, new ListNode(4)));
ListNode merge = new J25().mergeTwoLists(l1, l2);
merge.print();
}
}
| [
"17321168224@163.com"
] | 17321168224@163.com |
7535d126691e48f402c495ac1859cbba169f2031 | 0d037449b455913f394acf2e25060155f324ffce | /vvaras.acsBaciCodeGen.model.edit/src/baciCodeGen/BACIProperties/provider/RObooleanItemProvider.java | a82a392b7a02c5a212d7110e7e00c00fe59d5d65 | [] | no_license | javarias/acsBaciCodeGen | 7e018dc645d70e6abb43a6f79ae8242e242a02be | acd30a0ad4fc60a96a48e86f3cccc57998165069 | refs/heads/master | 2020-04-26T04:29:48.131471 | 2019-03-01T12:50:42 | 2019-03-01T12:50:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,072 | java | /**
*/
package baciCodeGen.BACIProperties.provider;
import baciCodeGen.BACIProperties.BACIPropertiesPackage;
import baciCodeGen.BACIProperties.ROboolean;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link baciCodeGen.BACIProperties.ROboolean} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class RObooleanItemProvider extends Pboolean1ItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RObooleanItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addAlarmFaultFamilyPropertyDescriptor(object);
addAlarmFaultMemberPropertyDescriptor(object);
addAlarmLevelPropertyDescriptor(object);
addAlarmOnPropertyDescriptor(object);
addAlarmTimerTrigPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Alarm Fault Family feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAlarmFaultFamilyPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ROboolean_alarmFaultFamily_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmFaultFamily_feature", "_UI_ROboolean_type"),
BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_FAULT_FAMILY,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Alarm Fault Member feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAlarmFaultMemberPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ROboolean_alarmFaultMember_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmFaultMember_feature", "_UI_ROboolean_type"),
BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_FAULT_MEMBER,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Alarm Level feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAlarmLevelPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ROboolean_alarmLevel_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmLevel_feature", "_UI_ROboolean_type"),
BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_LEVEL,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Alarm On feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAlarmOnPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ROboolean_alarmOn_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmOn_feature", "_UI_ROboolean_type"),
BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_ON,
true,
false,
false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Alarm Timer Trig feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAlarmTimerTrigPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ROboolean_alarmTimerTrig_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmTimerTrig_feature", "_UI_ROboolean_type"),
BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_TIMER_TRIG,
true,
false,
false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE,
null,
null));
}
/**
* This returns ROboolean.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/ROboolean"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
ROboolean rOboolean = (ROboolean)object;
return getString("_UI_ROboolean_type") + " " + rOboolean.getArchiveMaxInt();
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(ROboolean.class)) {
case BACIPropertiesPackage.ROBOOLEAN__ALARM_FAULT_FAMILY:
case BACIPropertiesPackage.ROBOOLEAN__ALARM_FAULT_MEMBER:
case BACIPropertiesPackage.ROBOOLEAN__ALARM_LEVEL:
case BACIPropertiesPackage.ROBOOLEAN__ALARM_ON:
case BACIPropertiesPackage.ROBOOLEAN__ALARM_TIMER_TRIG:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
| [
"vvaras@udec.cl"
] | vvaras@udec.cl |
42f5748b62be3f5a44546d16cc4a562c883ce89f | 7b73756ba240202ea92f8f0c5c51c8343c0efa5f | /classes2/vyw.java | 8e98f6b4f49a98f2f224e47b211732394f1bf0fa | [] | 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 | 653 | java | import android.os.Bundle;
import com.tencent.mobileqq.hotpatch.NotVerifyClass;
import com.tencent.mobileqq.nearby.business.NearbyCardHandler;
public final class vyw
implements Runnable
{
public vyw(NearbyCardHandler paramNearbyCardHandler, Bundle paramBundle)
{
boolean bool = NotVerifyClass.DO_VERIFY_CLASS;
}
public void run()
{
this.jdField_a_of_type_ComTencentMobileqqNearbyBusinessNearbyCardHandler.a(this.jdField_a_of_type_AndroidOsBundle, null, null, false, false, false);
}
}
/* Location: E:\apk\QQ_91\classes2-dex2jar.jar!\vyw.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
602df737e9ecaea4b9c862513c27150fdff10dec | 0e4756fbda5832b02258425dd0e94382fdcb40d1 | /netty/chat_netty3/server/src/main/java/com/cn/server/Server.java | 9df52b38f17f9848bd8feccf5589abb402393203 | [] | no_license | bobobokey/learndemo | d1da80636864825a8d1a6e6fe1168b599de119d9 | 24d6200e39d49362ce37023367627f536ecfa814 | refs/heads/master | 2022-04-28T14:44:17.970284 | 2022-04-28T04:33:01 | 2022-04-28T04:33:01 | 486,090,706 | 0 | 0 | null | 2022-04-28T04:33:02 | 2022-04-27T07:30:09 | null | UTF-8 | Java | false | false | 1,583 | java | package com.cn.server;
import java.net.InetSocketAddress;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import org.springframework.stereotype.Component;
import com.cn.common.core.codc.RequestDecoder;
import com.cn.common.core.codc.ResponseEncoder;
/**
* netty服务端入门
*
*
*/
@Component
public class Server {
/**
* 启动
*/
public void start() {
//服务类
ServerBootstrap bootstrap = new ServerBootstrap();
//boss线程监听端口,worker线程负责数据读写
ExecutorService boss = Executors.newCachedThreadPool();
ExecutorService worker = Executors.newCachedThreadPool();
//设置niosocket工厂
bootstrap.setFactory(new NioServerSocketChannelFactory(boss, worker));
//设置管道的工厂
bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("decoder", new RequestDecoder());
pipeline.addLast("encoder", new ResponseEncoder());
pipeline.addLast("helloHandler", new ServerHandler());
return pipeline;
}
});
bootstrap.setOption("backlog", 1024);
bootstrap.bind(new InetSocketAddress(10102));
System.out.println("start!!!");
}
}
| [
"32060663+csy512889371@users.noreply.github.com"
] | 32060663+csy512889371@users.noreply.github.com |
2eea8251ddc20ed9c4ba3e13c85a36c38a9eb0f2 | 6cac09e70051fb70a44fdf3b5e10493b718a1484 | /src/main/java/cn/mmf/lastsmith/blades/BladeRoukanken.java | c445f3208086ebd49e2f839dc90b9ec202a7de5a | [
"MIT"
] | permissive | Nanamiya738/The-Last-Smith | bf5e9c526139c62a093920c5df93c54365dccfe2 | 23702d9e16eb203651223257cdf27e65c5ad11cb | refs/heads/master | 2022-09-03T23:51:25.095138 | 2020-03-18T17:55:35 | 2020-03-18T17:55:35 | 267,525,039 | 0 | 0 | MIT | 2020-05-29T04:41:25 | 2020-05-28T07:39:28 | null | UTF-8 | Java | false | false | 7,798 | java | package cn.mmf.lastsmith.blades;
import cn.mcmod_mmf.mmlib.util.RecipesUtil;
import cn.mmf.lastsmith.TLSMain;
import cn.mmf.lastsmith.event.RegisterSlashBladeEvent;
import cn.mmf.lastsmith.event.RegisterSlashBladeRecipeEvent;
import cn.mmf.lastsmith.item.ItemSlashBladeNamedTLS;
import cn.mmf.lastsmith.recipe.RecipeAwakeBladeTLS;
import cn.mmf.lastsmith.se.SELoader;
import cn.mmf.lastsmith.util.BladeUtil;
import mods.flammpfeil.slashblade.ItemSlashBladeNamed;
import mods.flammpfeil.slashblade.SlashBlade;
import mods.flammpfeil.slashblade.item.ItemSlashBlade;
import mods.flammpfeil.slashblade.specialeffect.SpecialEffects;
import net.minecraft.init.Enchantments;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@EventBusSubscriber
public class BladeRoukanken {
@SubscribeEvent
public static void BladeRegister(RegisterSlashBladeEvent event) {
ItemStack customblade = new ItemStack(BladeLoader.bladeNamed, 1, 0);
NBTTagCompound tag1 = new NBTTagCompound();
customblade.setTagCompound(tag1);
BladeUtil.IsFakeBlade.set(tag1, true);
ItemSlashBladeNamed.CurrentItemName.set(tag1, "flammpfeil.slashblade.named.kanrou_fake");
ItemSlashBladeNamed.CustomMaxDamage.set(tag1, 70);
ItemSlashBlade.setBaseAttackModifier(tag1, 7.0F);
ItemSlashBlade.TextureName.set(tag1, "named/roukan/texture_fake_0");
ItemSlashBlade.ModelName.set(tag1, "named/agito");
BladeLoader.registerCustomItemStack("flammpfeil.slashblade.named.kanrou_fake", customblade);
ItemSlashBladeNamedTLS.NamedBlades.add("flammpfeil.slashblade.named.kanrou_fake");
ItemStack customblade2 = new ItemStack(BladeLoader.bladeNamed, 1, 0);
NBTTagCompound tag2 = new NBTTagCompound();
customblade2.setTagCompound(tag2);
ItemSlashBladeNamed.CurrentItemName.set(tag2, "flammpfeil.slashblade.named.kanrou");
ItemSlashBladeNamed.CustomMaxDamage.set(tag2, 70);
ItemSlashBlade.setBaseAttackModifier(tag2, 9.0F);
ItemSlashBlade.TextureName.set(tag2, "named/roukan/texture_fake");
ItemSlashBlade.ModelName.set(tag2, "named/agito");
BladeLoader.registerCustomItemStack("flammpfeil.slashblade.named.kanrou", customblade2);
ItemSlashBladeNamedTLS.NamedBlades.add("flammpfeil.slashblade.named.kanrou");
ItemStack customblade3 = new ItemStack(BladeLoader.bladeNamed, 1, 0);
NBTTagCompound tag3 = new NBTTagCompound();
customblade3.setTagCompound(tag3);
ItemSlashBladeNamed.IsDefaultBewitched.set(tag3, true);
BladeUtil.IsBewitchedActived.set(tag3, true);
ItemSlashBladeNamed.CurrentItemName.set(tag3, "flammpfeil.slashblade.named.roukan");
ItemSlashBladeNamed.CustomMaxDamage.set(tag3, 40);
ItemSlashBlade.setBaseAttackModifier(tag3, 15.0F);
ItemSlashBlade.SpecialAttackType.set(tag3, 8);
customblade3.addEnchantment(Enchantments.UNBREAKING, 2);
customblade3.addEnchantment(Enchantments.KNOCKBACK, 1);
customblade3.addEnchantment(Enchantments.SHARPNESS, 4);
SpecialEffects.addEffect(customblade3, SELoader.EXTREME_SHARPNESS);
ItemSlashBlade.TextureName.set(tag3, "named/roukan/texture");
ItemSlashBlade.ModelName.set(tag3, "named/roukan/model");
BladeLoader.registerCustomItemStack("flammpfeil.slashblade.named.roukan", customblade3);
ItemSlashBladeNamedTLS.NamedBlades.add("flammpfeil.slashblade.named.roukan");
ItemStack customblade4 = new ItemStack(BladeLoader.bladeNamed, 1, 0);
NBTTagCompound tag4 = new NBTTagCompound();
customblade4.setTagCompound(tag4);
ItemSlashBladeNamed.IsDefaultBewitched.set(tag4, true);
BladeUtil.IsBewitchedActived.set(tag4, true);
ItemSlashBladeNamed.CurrentItemName.set(tag4, "flammpfeil.slashblade.named.roukan_nether");
ItemSlashBladeNamed.CustomMaxDamage.set(tag4, 40);
ItemSlashBlade.AttackAmplifier.set(tag4, 4F);
ItemSlashBlade.setBaseAttackModifier(tag4, 16.0F);
ItemSlashBlade.SpecialAttackType.set(tag4, 9);
customblade4.addEnchantment(Enchantments.UNBREAKING, 3);
customblade4.addEnchantment(Enchantments.KNOCKBACK, 2);
customblade4.addEnchantment(Enchantments.SHARPNESS, 5);
customblade4.addEnchantment(Enchantments.FIRE_ASPECT, 2);
SpecialEffects.addEffect(customblade4, SELoader.EXTREME_SHARPNESS);
ItemSlashBlade.TextureName.set(tag4, "named/roukan/texture_tx");
ItemSlashBlade.ModelName.set(tag4, "named/roukan/model");
BladeLoader.registerCustomItemStack("flammpfeil.slashblade.named.roukan_nether", customblade4);
ItemSlashBladeNamedTLS.NamedBlades.add("flammpfeil.slashblade.named.roukan_nether");
}
@SubscribeEvent
public static void onRecipeRegister(RegisterSlashBladeRecipeEvent event) {
ItemStack request_1 = new ItemStack(BladeLoader.blade);
NBTTagCompound tag1 = new NBTTagCompound();
ItemSlashBlade.KillCount.set(tag1, 50);
request_1.setTagCompound(tag1);
RecipesUtil.addRecipe(TLSMain.MODID,"flammpfeil.slashblade.named.kanrou_fake", new RecipeAwakeBladeTLS(
new ResourceLocation(TLSMain.MODID, "flammpfeil.slashblade.named.kanrou_fake"),
"sakura_blade", BladeLoader.getCustomBlade("flammpfeil.slashblade.named.kanrou_fake"), request_1,
new Object[] {
"PDP",
"DSD",
"PBP",
'D', "leafSakura",
'P', "ingotGold",
'S', SlashBlade.getCustomBlade(SlashBlade.ProudSoulStr),
'B', request_1
}));
ItemStack request_2 = BladeLoader.getCustomBlade("flammpfeil.slashblade.named.kanrou_fake");
NBTTagCompound tag2 = ItemSlashBlade.getItemTagCompound(request_2);
ItemSlashBlade.KillCount.set(tag2, 200);
ItemSlashBlade.ProudSoul.set(tag2, 1000);
request_2.setTagCompound(tag2);
RecipesUtil.addRecipe(TLSMain.MODID,"flammpfeil.slashblade.named.kanrou", new RecipeAwakeBladeTLS(
new ResourceLocation(TLSMain.MODID, "flammpfeil.slashblade.named.kanrou"),
"sakura_blade", BladeLoader.getCustomBlade("flammpfeil.slashblade.named.kanrou"), request_2,
new Object[] {
"PSD",
"SDS",
"BSP",
'D', SlashBlade.getCustomBlade(SlashBlade.IngotBladeSoulStr),
'P', "gemDiamond",
'S', "fullSakura",
'B', request_2
}));
ItemStack request_3 = BladeLoader.getCustomBlade("flammpfeil.slashblade.named.kanrou");
NBTTagCompound tag3 = ItemSlashBlade.getItemTagCompound(request_3);
ItemSlashBlade.KillCount.set(tag3, 1000);
ItemSlashBlade.ProudSoul.set(tag3, 5000);
ItemSlashBlade.RepairCount.set(tag3, 1);
request_3.addEnchantment(Enchantments.SHARPNESS, 1);
request_3.setTagCompound(tag3);
RecipesUtil.addRecipe(TLSMain.MODID,"flammpfeil.slashblade.named.roukan", new RecipeAwakeBladeTLS(
new ResourceLocation(TLSMain.MODID, "flammpfeil.slashblade.named.roukan"),
"sakura_blade", BladeLoader.getCustomBlade("flammpfeil.slashblade.named.roukan"), request_3,
new Object[] {
"SPD",
"PBP",
"DPS",
'D', "blockSakura",
'P', "blockDiamond",
'S', SlashBlade.getCustomBlade(SlashBlade.SphereBladeSoulStr),
'B', request_3
}));
ItemStack request_4 = BladeLoader.getCustomBlade("flammpfeil.slashblade.named.roukan");
NBTTagCompound tag4 = ItemSlashBlade.getItemTagCompound(request_4);
ItemSlashBlade.KillCount.set(tag4, 2500);
ItemSlashBlade.ProudSoul.set(tag4, 25000);
ItemSlashBlade.RepairCount.set(tag4, 5);
request_4.addEnchantment(Enchantments.FIRE_ASPECT, 1);
request_4.setTagCompound(tag4);
RecipesUtil.addRecipe(TLSMain.MODID,"flammpfeil.slashblade.named.roukan_nether", new RecipeAwakeBladeTLS(
new ResourceLocation(TLSMain.MODID, "flammpfeil.slashblade.named.roukan_nether"),
"sharpness", BladeLoader.getCustomBlade("flammpfeil.slashblade.named.roukan_nether"), request_4,
new Object[] {
"DSD",
"PBP",
"DSD",
'D', "sphereSakura",
'P', "blockDiamond",
'S', "netherStar",
'B', request_4
}));
}
}
| [
"617510630@qq.com"
] | 617510630@qq.com |
e2d42914105b17c32701f35d06f981eb7a21007e | 8a52d8b76638d247a247d2bf36eb80c3d74f1334 | /service-ui/src/main/java/com/example/demo/model/Employee.java | dc043189834143b048ccb8e6faef5cfb8517dc1f | [] | no_license | prosenjit-techHubGit/SpringTestProject | 67f23187c1a24c01781fb4e92db5ae6d1fe299a1 | c5810ce9043717f0e553b6cd48ae5217bf6eb4ad | refs/heads/master | 2020-04-03T10:30:04.816954 | 2018-10-31T14:02:11 | 2018-10-31T14:02:11 | 155,194,619 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | package com.example.demo.model;
public class Employee {
public Employee(String name, String email, String phone, String department, String manager) {
super();
this.name = name;
this.email = email;
this.phone = phone;
this.department = department;
this.manager = manager;
}
public Employee() {
super();
// TODO Auto-generated constructor stub
}
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getManager() {
return manager;
}
public void setManager(String manager) {
this.manager = manager;
}
private String email;
private String phone;
private String department;
private String manager;
}
| [
"cosypro@gmail.com"
] | cosypro@gmail.com |
8ab4f9fe7fa4ac71a19fa3cc1961e90c8603a239 | 43113a5f50d8765e37872a57d9de2474b2c309fa | /hedera-service/src/main/java/com/enzitechnologies/hederaservice/domain/Key.java | bf364140194ee5f6c8803214159467ee1ef1aa02 | [] | no_license | KahigaKiguru/Hedera-Test-Service | ad2f7c0ee43600862841cf0376dddb4f45b5bf7e | 21d8704265e15e2b25d0184cc10be040c6e45ebe | refs/heads/master | 2023-04-04T08:37:27.092190 | 2021-03-31T20:19:16 | 2021-03-31T20:19:16 | 353,333,984 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 71 | java | package com.enzitechnologies.hederaservice.domain;public class Key {
}
| [
"dev.enzitechnologies@gmail.com"
] | dev.enzitechnologies@gmail.com |
5e7d9e6ba3a8426b5efc510a1a7e9c86dc314116 | b10171080f469c7e1f8b3150eb0b9e35f9fabc90 | /src/fenetre_table_1/Fenetre.java | 4824222124c5555bbe20688ec3522e383540800e | [] | no_license | jamnaranjo/Fenetres | 293ad06edc2cb9d0fe611506ec9d799351ccbb55 | 8066eebcc6ae0235b4746a6863ebddfa60039d18 | refs/heads/master | 2020-03-16T15:44:33.796385 | 2018-05-09T13:00:34 | 2018-05-09T13:00:34 | 132,756,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,288 | 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 fenetre_table_1;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
/**
*
* @author jalvaro
*/
public class Fenetre extends JFrame {
private JPanel panneauFond;
private JTable table;
private JScrollPane defileur;
public Fenetre(String s,
Vector<String> colonnes,
Vector<Vector<Object>> lignes) {
super(s);
addWindowListener(new EcouteFenetre());
panneauFond = new JPanel();
panneauFond.setLayout(new BorderLayout());
panneauFond.setPreferredSize(new Dimension(500, 120));
table = new JTable(lignes, colonnes);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
defileur = new JScrollPane(table);
defileur.getViewport().setBackground(Color.pink);
panneauFond.add(defileur);
getContentPane().add(panneauFond);
pack();
setVisible(true);
}
}
| [
"juanalvaro83@gmail.com"
] | juanalvaro83@gmail.com |
71321b35d100cfc2c6e4b4ae9415443a1e59eea9 | 7120f0438c1a4a20d67e88c822a601ad61ef5c4d | /zyr-web/src/main/java/com/zgm/zen/jkglyz/PettyGirl.java | 7ea98734cb8654f9faa6004498c533f87c646fd6 | [] | no_license | zgmzyr/zyr | f94dea3d7f7f962b6df5e18185d3e61d77dc009a | fea3c44fe6fbe0c110805487096f203fcb8b823b | refs/heads/master | 2021-01-17T15:09:02.961884 | 2016-06-26T08:38:14 | 2016-06-26T08:38:14 | 9,864,102 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 523 | java | package com.zgm.zen.jkglyz;
public class PettyGirl implements IGoodBodyGirl, IGreatTemperamentGirl {
private String name;
public PettyGirl(String name){
this.name = name;
}
@Override
public void goodLooking() {
System.out.println(this.name + "---脸蛋很漂亮!");
}
@Override
public void niceFigure() {
System.out.println(this.name + "---身材很棒!");
}
@Override
public void greatTemperament() {
System.out.println(this.name + "---气质非常好!");
}
}
| [
"Administrator@zgm"
] | Administrator@zgm |
074cc6e82893a10e56396a433e24d66f1930d0e7 | 8eb283df69ff7c8999e299adb00f201cc1a26691 | /app/src/main/java/misao/alarmproject/AlarmReceiver.java | 0634f20a08082ad3042bb7c17e57e2e19f5aab90 | [] | no_license | Raj-Misao/alarm | 0a7519ffbaad5b1a8abace6bec43ccb000a043a8 | 036fa97f22faa6499ff6cd0d449ac95e4d9069e9 | refs/heads/master | 2021-01-09T06:06:20.657770 | 2017-02-04T11:18:19 | 2017-02-04T11:18:19 | 80,914,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 833 | java | package misao.alarmproject;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.widget.Toast;
/**
* Created by Sonu on 1/23/2017.
*/
public class AlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context,"Wake Up Wake up",Toast.LENGTH_LONG).show();
Uri alarmURi = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
if(alarmURi == null)
{
alarmURi = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
}
Ringtone ringtone = RingtoneManager.getRingtone(context,alarmURi);
ringtone.play();
}
}
| [
"errajsharma01@gmail.com"
] | errajsharma01@gmail.com |
07e3c6ea6ca6fcd1b80a137f445a748042dfb260 | 5b23eaed078f1add4fe8592c899b24887f709458 | /scenario/Level4KeyCamera.java | 388894c33b057a42c46ce860bda76e2dec575da1 | [] | no_license | alexsaalberg/restart | 2c495c212daedaff12a7ff0e00330d75aa168ca3 | 2b5ac0b198ee46f4c35a3b5fa840a538c65b06f6 | refs/heads/master | 2020-04-06T20:29:02.930243 | 2018-11-15T21:20:36 | 2018-11-15T21:20:36 | 157,773,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class SecurityCamera here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Level4KeyCamera extends ConeEnemy
{
/**
* Act - do whatever the SecurityCamera wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
super.act();
// Add your action code here.
}
protected void addedToWorld(World world){
super.addedToWorld(world);
GreenfootImage img = getImage();
img.rotate(90);
setSightLength(200);
setSightAngle(90);
}
}
| [
"alexsaalberg@gmail.com"
] | alexsaalberg@gmail.com |
0d6bd2556706126d65ee3e33d5567dd262e8a5ea | e947d158b7d201da124d2afa822dc434a2e971c3 | /app/src/main/java/com/example/jeff/jsonloginreg/Bind.java | ece57af61d1ce6ff24cd22b64377c4c1965a436f | [] | no_license | jeffatakora/jsonLoginReg | dff55849718bb2895dc84b8561532f35b910dde9 | 453594f89e65dd72c8084c213e258a0f9bcae599 | refs/heads/master | 2020-09-29T15:02:04.979324 | 2019-12-10T07:48:36 | 2019-12-10T07:48:36 | 227,059,008 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 100 | java | package com.example.jeff.jsonloginreg;
/**
* Created by jeff on 7/10/19.
*/
@interface Bind {
}
| [
"nanaboatengjeff63@gmail.com"
] | nanaboatengjeff63@gmail.com |
5bd51f17d5790ee939f32d409a69011a207a40df | 75265848f9a0d5b1b3167b143614d8df0a3c311f | /app/src/main/java/com/microacademylabs/hellobottomnav/MainActivity.java | 8f9db85d3296aea3685a8043ecc324d622cf9048 | [] | no_license | karenfreemansmith/BottomNavigation | bcc96c5b396d0d58003501e26091d8134b83b276 | 0adbc78fc6b06fc97c3e1b45897029786ffbf0b0 | refs/heads/master | 2021-01-21T18:05:18.075404 | 2017-05-22T03:55:34 | 2017-05-22T03:55:34 | 92,009,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,460 | java | package com.microacademylabs.hellobottomnav;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private TextView mTextMessage;
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
= new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.navigation_home:
mTextMessage.setText(R.string.title_home);
return true;
case R.id.navigation_dashboard:
mTextMessage.setText(R.string.title_dashboard);
return true;
case R.id.navigation_notifications:
mTextMessage.setText(R.string.title_notifications);
return true;
}
return false;
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTextMessage = (TextView) findViewById(R.id.message);
BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
}
}
| [
"karenfreemansmith@gmail.com"
] | karenfreemansmith@gmail.com |
a08624e20b8d2d72760f045e89fe91e0a3c0f31e | a978bb8dbc2ea3efdd100a8e7b4b6f8935a7bea8 | /src/main/java/com/caleb/project/controller/ClienteRestController.java | 843dcf955fd32b35042825416b54d6fe7bcd60a9 | [] | no_license | JoelCalebPA/Spring | 868e9dbf86f18f5777622986a171e281a0ea18f9 | a8b480aae6b37716e0cf72fce323b81969f60ec3 | refs/heads/master | 2020-03-24T05:42:25.679274 | 2018-08-11T02:32:25 | 2018-08-11T02:32:25 | 142,498,653 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 985 | java | package com.caleb.project.controller;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.caleb.project.entity.Cliente;
import com.caleb.project.repository.ClienteRepository;
@RestController
@RequestMapping("/api/cliente")
public class ClienteRestController {
private final ClienteRepository repository;
@Autowired
public ClienteRestController(ClienteRepository repository) {
this.repository = repository;
}
@GetMapping
public List<Cliente> getClientes() {
return repository.findAll();
}
@GetMapping("/{idCliente}")
public Optional<Cliente> getCLiente(@PathVariable("idCliente") int idCliente) {
return repository.findById(idCliente);
}
}
| [
"joel.caleb.pa@gmail.com"
] | joel.caleb.pa@gmail.com |
e3eb36e3fba7371b8bd612ce96f765e463ec8feb | 4e8d52f594b89fa356e8278265b5c17f22db1210 | /WebServiceArtifacts/WeatherV1SoapService/com/flightstats/weather/service/v1/VisibilityV1.java | acb7b90ade787ef9d880ca4c3d912e1127d343c5 | [] | no_license | ouniali/WSantipatterns | dc2e5b653d943199872ea0e34bcc3be6ed74c82e | d406c67efd0baa95990d5ee6a6a9d48ef93c7d32 | refs/heads/master | 2021-01-10T05:22:19.631231 | 2015-05-26T06:27:52 | 2015-05-26T06:27:52 | 36,153,404 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,548 | java |
package com.flightstats.weather.service.v1;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for visibilityV1 complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="visibilityV1">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="miles" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="lessThan" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="cavok" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "visibilityV1", propOrder = {
"miles",
"lessThan",
"cavok"
})
public class VisibilityV1 {
protected String miles;
protected Boolean lessThan;
protected Boolean cavok;
/**
* Gets the value of the miles property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMiles() {
return miles;
}
/**
* Sets the value of the miles property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMiles(String value) {
this.miles = value;
}
/**
* Gets the value of the lessThan property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isLessThan() {
return lessThan;
}
/**
* Sets the value of the lessThan property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setLessThan(Boolean value) {
this.lessThan = value;
}
/**
* Gets the value of the cavok property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isCavok() {
return cavok;
}
/**
* Sets the value of the cavok property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setCavok(Boolean value) {
this.cavok = value;
}
}
| [
"ouni_ali@yahoo.fr"
] | ouni_ali@yahoo.fr |
6739a33fff2f835470736cefbb33ec1d8bd80e44 | e3ee8bda887b00c627b904c894adaf9fe07a2a84 | /src/main/java/miasi/handlarz/security/web/controller/AdminController.java | fb6bdffe795e24be4147dbd651194dbd783d3688 | [] | no_license | PatrykBrzuchacz/handlarz | 262c1abb8209482a4dd6ecf16cff84924f377ede | 9c7a6b45176924209c255b2d1bf25d58ddd01e9e | refs/heads/master | 2023-04-30T04:58:46.089414 | 2021-05-24T20:53:15 | 2021-05-24T20:53:15 | 365,549,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,271 | java | package miasi.handlarz.security.web.controller;
import miasi.handlarz.security.web.dto.UserCriteria;
import miasi.handlarz.security.web.dto.UserDto;
import miasi.handlarz.security.web.dto.UserStatusChangeDto;
import miasi.handlarz.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/users")
public class AdminController {
@Autowired
private UserService userService;
@PreAuthorize("hasRole('ROLE_ADMIN')")
@PostMapping
public Page<UserDto> getAllUsers(@RequestBody UserCriteria userCriteria) {
return userService.getAllUsers(userCriteria);
}
@PreAuthorize("hasRole('ROLE_ADMIN')")
@PutMapping("/change-active")
public UserDto changeActive(@RequestBody UserStatusChangeDto dto) {
return userService.updateUserActive(dto.getId(), dto.isActive() );
}
@PreAuthorize("hasRole('ROLE_ADMIN')")
@PutMapping("/change-request")
public UserDto changeRequest(@RequestBody UserStatusChangeDto dto) {
return userService.updateUserRequest(dto.getId(), dto.getStatus());
}
} | [
"pbrzucha@softsystem.pl"
] | pbrzucha@softsystem.pl |
bbb6b305263ed7b612878dc3941f549faec0d579 | d6ab38714f7a5f0dc6d7446ec20626f8f539406a | /backend/collecting/collectedFiles/Java/edited/iluwatarjava-design-patternsblobfaa29f8025f6fb90472dacb6e8ad8569605f8d61facadesrcmainjavacomiluwatarfacadeDwarvenGoldmineFacade.java | 5b1377d9baea9b0063996641028835486d13dbb0 | [] | no_license | haditabatabaei/webproject | 8db7178affaca835b5d66daa7d47c28443b53c3d | 86b3f253e894f4368a517711bbfbe257be0259fd | refs/heads/master | 2020-04-10T09:26:25.819406 | 2018-12-08T12:21:52 | 2018-12-08T12:21:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 965 | java |
package com.iluwatar.facade;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class DwarvenGoldmineFacade {
private final List<DwarvenMineWorker> workers;
public DwarvenGoldmineFacade() {
workers = new ArrayList<>();
workers.add(new DwarvenGoldDigger());
workers.add(new DwarvenCartOperator());
workers.add(new DwarvenTunnelDigger());
}
public void startNewDay() {
makeActions(workers, DwarvenMineWorker.Action.WAKE_UP, DwarvenMineWorker.Action.GO_TO_MINE);
}
public void digOutGold() {
makeActions(workers, DwarvenMineWorker.Action.WORK);
}
public void endDay() {
makeActions(workers, DwarvenMineWorker.Action.GO_HOME, DwarvenMineWorker.Action.GO_TO_SLEEP);
}
private static void makeActions(Collection<DwarvenMineWorker> workers,
DwarvenMineWorker.Action... actions) {
for (DwarvenMineWorker worker : workers) {
worker.action(actions);
}
}
}
| [
"mahdisadeghzadeh24@gamil.com"
] | mahdisadeghzadeh24@gamil.com |
8ff06d9551c9f17286d0b11683166fd83ec3bbef | ddeac49aa8e95d3496d4c3fe24505763098e2d3d | /src/main/java/com/daduo/api/tiktokapi/model/UserFinancialInfoResponse.java | 47576ff0f6f38a55a75c3cd0a95c446b71aa5b95 | [] | no_license | woodyyan/tiktok-api | 22e46af5d0281ca8e587f45fa2b4b53c20e4d48e | b26f7a0fa2d1116df263c15f531d174b4c128492 | refs/heads/master | 2020-04-24T08:10:59.598883 | 2019-05-05T09:56:28 | 2019-05-05T09:56:28 | 171,823,017 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.daduo.api.tiktokapi.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
@ApiModel("用户财务数据")
public class UserFinancialInfoResponse {
@ApiModelProperty(value = "用户财务数据列表")
private List<UserFinancialInfo> data = new ArrayList<>();
}
| [
"colorguitar@hotmail.com"
] | colorguitar@hotmail.com |
c26afa897445d20a4a3d4cdd7975a8155f0b3fe7 | cebecde4fe43bc012b9cd736f25733375787c7c1 | /src/main/java/com/bzb/talentmarket/mapper/TalentmarketKfMapper.java | 275c63e43458ce9d8fc8cf6be455a1125a7af7c5 | [] | no_license | bzbstar/talentmarket | e6830d3eb0a5f3f700806cb75256fd19e12863b3 | 7439c57c03db3b3988e0a09c29540bcf61e22b0a | refs/heads/master | 2020-04-05T15:07:53.240541 | 2018-11-25T15:03:06 | 2018-11-25T15:03:06 | 156,954,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package com.bzb.talentmarket.mapper;
import com.bzb.talentmarket.entity.TalentmarketKf;
import org.springframework.stereotype.Repository;
@Repository
public interface TalentmarketKfMapper {
int deleteByPrimaryKey(Integer id);
int insert(TalentmarketKf record);
int insertSelective(TalentmarketKf record);
TalentmarketKf selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TalentmarketKf record);
int updateByPrimaryKey(TalentmarketKf record);
} | [
"13140132880@163.com"
] | 13140132880@163.com |
dbfefd25bac947f4265f28f9fe60623c3ca6e105 | e0e8af3654e716d12764c5bc2e17068babe1b5e1 | /app/src/main/java/test/test/utils/Base64.java | 49530f90e45f9ccca881c3893d2cf063049458ba | [] | no_license | gouptosee/Test | 770b43bdc05753119dd739c71fd535bb354679c4 | f3f27526d0cb974fee03f67beb9327ced5fcaec7 | refs/heads/master | 2021-01-21T12:11:24.952747 | 2017-08-09T02:24:12 | 2017-08-09T02:24:12 | 91,780,389 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29,150 | java | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.test.utils;
import java.io.UnsupportedEncodingException;
/**
* Utilities for encoding and decoding the Base64 representation of
* binary data. See RFCs <a
* href="http://www.ietf.org/rfc/rfc2045.txt">2045</a> and <a
* href="http://www.ietf.org/rfc/rfc3548.txt">3548</a>.
*/
public class Base64 {
/**
* Default values for encoder/decoder flags.
*/
public static final int DEFAULT = 0;
/**
* Encoder flag bit to omit the padding '=' characters at the end
* of the output (if any).
*/
public static final int NO_PADDING = 1;
/**
* Encoder flag bit to omit all line terminators (i.e., the output
* will be on one long line).
*/
public static final int NO_WRAP = 2;
/**
* Encoder flag bit to indicate lines should be terminated with a
* CRLF pair instead of just an LF. Has no effect if {@code
* NO_WRAP} is specified as well.
*/
public static final int CRLF = 4;
/**
* Encoder/decoder flag bit to indicate using the "URL and
* filename safe" variant of Base64 (see RFC 3548 section 4) where
* {@code -} and {@code _} are used in place of {@code +} and
* {@code /}.
*/
public static final int URL_SAFE = 8;
/**
* Flag to pass to {@link } to indicate that it
* should not close the output stream it is wrapping when it
* itself is closed.
*/
public static final int NO_CLOSE = 16;
// --------------------------------------------------------
// shared code
// --------------------------------------------------------
/* package */ static abstract class Coder {
public byte[] output;
public int op;
/**
* Encode/decode another block of input data. this.output is
* provided by the caller, and must be big enough to hold all
* the coded data. On exit, this.opwill be set to the length
* of the coded data.
*
* @param finish true if this is the final call to process for
* this object. Will finalize the coder state and
* include any final bytes in the output.
*
* @return true if the input so far is good; false if some
* error has been detected in the input stream..
*/
public abstract boolean process(byte[] input, int offset, int len, boolean finish);
/**
* @return the maximum number of bytes a call to process()
* could produce for the given number of input bytes. This may
* be an overestimate.
*/
public abstract int maxOutputSize(int len);
}
// --------------------------------------------------------
// decoding
// --------------------------------------------------------
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param str the input String to decode, which is converted to
* bytes using the default charset
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
*
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(String str, int flags) {
return decode(str.getBytes(), flags);
}
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param input the input array to decode
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
*
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(byte[] input, int flags) {
return decode(input, 0, input.length, flags);
}
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param input the data to decode
* @param offset the position within the input array at which to start
* @param len the number of bytes of input to decode
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
*
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(byte[] input, int offset, int len, int flags) {
// Allocate space for the most data the input could represent.
// (It could contain less if it contains whitespace, etc.)
Decoder decoder = new Decoder(flags, new byte[len*3/4]);
if (!decoder.process(input, offset, len, true)) {
throw new IllegalArgumentException("bad base-64");
}
// Maybe we got lucky and allocated exactly enough output space.
if (decoder.op == decoder.output.length) {
return decoder.output;
}
// Need to shorten the array, so allocate a new one of the
// right size and copy.
byte[] temp = new byte[decoder.op];
System.arraycopy(decoder.output, 0, temp, 0, decoder.op);
return temp;
}
/* package */ static class Decoder extends Coder {
/**
* Lookup table for turning bytes into their position in the
* Base64 alphabet.
*/
private static final int DECODE[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
/**
* Decode lookup table for the "web safe" variant (RFC 3548
* sec. 4) where - and _ replace + and /.
*/
private static final int DECODE_WEBSAFE[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
/** Non-data values in the DECODE arrays. */
private static final int SKIP = -1;
private static final int EQUALS = -2;
/**
* States 0-3 are reading through the next input tuple.
* State 4 is having read one '=' and expecting exactly
* one more.
* State 5 is expecting no more data or padding characters
* in the input.
* State 6 is the error state; an error has been detected
* in the input and no future input can "fix" it.
*/
private int state; // state number (0 to 6)
private int value;
final private int[] alphabet;
public Decoder(int flags, byte[] output) {
this.output = output;
alphabet = ((flags & URL_SAFE) == 0) ? DECODE : DECODE_WEBSAFE;
state = 0;
value = 0;
}
/**
* @return an overestimate for the number of bytes {@code
* len} bytes could decode to.
*/
public int maxOutputSize(int len) {
return len * 3/4 + 10;
}
/**
* Decode another block of input data.
*
* @return true if the state machine is still healthy. false if
* bad base-64 data has been detected in the input stream.
*/
public boolean process(byte[] input, int offset, int len, boolean finish) {
if (this.state == 6) return false;
int p = offset;
len += offset;
// Using local variables makes the decoder about 12%
// faster than if we manipulate the member variables in
// the loop. (Even alphabet makes a measurable
// difference, which is somewhat surprising to me since
// the member variable is final.)
int state = this.state;
int value = this.value;
int op = 0;
final byte[] output = this.output;
final int[] alphabet = this.alphabet;
while (p < len) {
// Try the fast path: we're starting a new tuple and the
// next four bytes of the input stream are all data
// bytes. This corresponds to going through states
// 0-1-2-3-0. We expect to use this method for most of
// the data.
//
// If any of the next four bytes of input are non-data
// (whitespace, etc.), value will end up negative. (All
// the non-data values in decode are small negative
// numbers, so shifting any of them up and or'ing them
// together will result in a value with its top bit set.)
//
// You can remove this whole block and the output should
// be the same, just slower.
if (state == 0) {
while (p+4 <= len &&
(value = ((alphabet[input[p] & 0xff] << 18) |
(alphabet[input[p+1] & 0xff] << 12) |
(alphabet[input[p+2] & 0xff] << 6) |
(alphabet[input[p+3] & 0xff]))) >= 0) {
output[op+2] = (byte) value;
output[op+1] = (byte) (value >> 8);
output[op] = (byte) (value >> 16);
op += 3;
p += 4;
}
if (p >= len) break;
}
// The fast path isn't available -- either we've read a
// partial tuple, or the next four input bytes aren't all
// data, or whatever. Fall back to the slower state
// machine implementation.
int d = alphabet[input[p++] & 0xff];
switch (state) {
case 0:
if (d >= 0) {
value = d;
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 1:
if (d >= 0) {
value = (value << 6) | d;
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 2:
if (d >= 0) {
value = (value << 6) | d;
++state;
} else if (d == EQUALS) {
// Emit the last (partial) output tuple;
// expect exactly one more padding character.
output[op++] = (byte) (value >> 4);
state = 4;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 3:
if (d >= 0) {
// Emit the output triple and return to state 0.
value = (value << 6) | d;
output[op+2] = (byte) value;
output[op+1] = (byte) (value >> 8);
output[op] = (byte) (value >> 16);
op += 3;
state = 0;
} else if (d == EQUALS) {
// Emit the last (partial) output tuple;
// expect no further data or padding characters.
output[op+1] = (byte) (value >> 2);
output[op] = (byte) (value >> 10);
op += 2;
state = 5;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 4:
if (d == EQUALS) {
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 5:
if (d != SKIP) {
this.state = 6;
return false;
}
break;
}
}
if (!finish) {
// We're out of input, but a future call could provide
// more.
this.state = state;
this.value = value;
this.op = op;
return true;
}
// Done reading input. Now figure out where we are left in
// the state machine and finish up.
switch (state) {
case 0:
// Output length is a multiple of three. Fine.
break;
case 1:
// Read one extra input byte, which isn't enough to
// make another output byte. Illegal.
this.state = 6;
return false;
case 2:
// Read two extra input bytes, enough to emit 1 more
// output byte. Fine.
output[op++] = (byte) (value >> 4);
break;
case 3:
// Read three extra input bytes, enough to emit 2 more
// output bytes. Fine.
output[op++] = (byte) (value >> 10);
output[op++] = (byte) (value >> 2);
break;
case 4:
// Read one padding '=' when we expected 2. Illegal.
this.state = 6;
return false;
case 5:
// Read all the padding '='s we expected and no more.
// Fine.
break;
}
this.state = state;
this.op = op;
return true;
}
}
// --------------------------------------------------------
// encoding
// --------------------------------------------------------
/**
* Base64-encode the given data and return a newly allocated
* String with the result.
*
* @param input the data to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static String encodeToString(byte[] input, int flags) {
try {
return new String(encode(input, flags), "US-ASCII");
} catch (UnsupportedEncodingException e) {
// US-ASCII is guaranteed to be available.
throw new AssertionError(e);
}
}
/**
* Base64-encode the given data and return a newly allocated
* String with the result.
*
* @param input the data to encode
* @param offset the position within the input array at which to
* start
* @param len the number of bytes of input to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static String encodeToString(byte[] input, int offset, int len, int flags) {
try {
return new String(encode(input, offset, len, flags), "US-ASCII");
} catch (UnsupportedEncodingException e) {
// US-ASCII is guaranteed to be available.
throw new AssertionError(e);
}
}
/**
* Base64-encode the given data and return a newly allocated
* byte[] with the result.
*
* @param input the data to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static byte[] encode(byte[] input, int flags) {
return encode(input, 0, input.length, flags);
}
/**
* Base64-encode the given data and return a newly allocated
* byte[] with the result.
*
* @param input the data to encode
* @param offset the position within the input array at which to
* start
* @param len the number of bytes of input to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static byte[] encode(byte[] input, int offset, int len, int flags) {
Encoder encoder = new Encoder(flags, null);
// Compute the exact length of the array we will produce.
int output_len = len / 3 * 4;
// Account for the tail of the data and the padding bytes, if any.
if (encoder.do_padding) {
if (len % 3 > 0) {
output_len += 4;
}
} else {
switch (len % 3) {
case 0: break;
case 1: output_len += 2; break;
case 2: output_len += 3; break;
}
}
// Account for the newlines, if any.
if (encoder.do_newline && len > 0) {
output_len += (((len-1) / (3 * Encoder.LINE_GROUPS)) + 1) *
(encoder.do_cr ? 2 : 1);
}
encoder.output = new byte[output_len];
encoder.process(input, offset, len, true);
assert encoder.op == output_len;
return encoder.output;
}
/* package */ static class Encoder extends Coder {
/**
* Emit a new line every this many output tuples. Corresponds to
* a 76-character line length (the maximum allowable according to
* <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>).
*/
public static final int LINE_GROUPS = 19;
/**
* Lookup table for turning Base64 alphabet positions (6 bits)
* into output bytes.
*/
private static final byte ENCODE[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/',
};
/**
* Lookup table for turning Base64 alphabet positions (6 bits)
* into output bytes.
*/
private static final byte ENCODE_WEBSAFE[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_',
};
final private byte[] tail;
/* package */ int tailLen;
private int count;
final public boolean do_padding;
final public boolean do_newline;
final public boolean do_cr;
final private byte[] alphabet;
public Encoder(int flags, byte[] output) {
this.output = output;
do_padding = (flags & NO_PADDING) == 0;
do_newline = (flags & NO_WRAP) == 0;
do_cr = (flags & CRLF) != 0;
alphabet = ((flags & URL_SAFE) == 0) ? ENCODE : ENCODE_WEBSAFE;
tail = new byte[2];
tailLen = 0;
count = do_newline ? LINE_GROUPS : -1;
}
/**
* @return an overestimate for the number of bytes {@code
* len} bytes could encode to.
*/
public int maxOutputSize(int len) {
return len * 8/5 + 10;
}
public boolean process(byte[] input, int offset, int len, boolean finish) {
// Using local variables makes the encoder about 9% faster.
final byte[] alphabet = this.alphabet;
final byte[] output = this.output;
int op = 0;
int count = this.count;
int p = offset;
len += offset;
int v = -1;
// First we need to concatenate the tail of the previous call
// with any input bytes available now and see if we can empty
// the tail.
switch (tailLen) {
case 0:
// There was no tail.
break;
case 1:
if (p+2 <= len) {
// A 1-byte tail with at least 2 bytes of
// input available now.
v = ((tail[0] & 0xff) << 16) |
((input[p++] & 0xff) << 8) |
(input[p++] & 0xff);
tailLen = 0;
};
break;
case 2:
if (p+1 <= len) {
// A 2-byte tail with at least 1 byte of input.
v = ((tail[0] & 0xff) << 16) |
((tail[1] & 0xff) << 8) |
(input[p++] & 0xff);
tailLen = 0;
}
break;
}
if (v != -1) {
output[op++] = alphabet[(v >> 18) & 0x3f];
output[op++] = alphabet[(v >> 12) & 0x3f];
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (--count == 0) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
count = LINE_GROUPS;
}
}
// At this point either there is no tail, or there are fewer
// than 3 bytes of input available.
// The main loop, turning 3 input bytes into 4 output bytes on
// each iteration.
while (p+3 <= len) {
v = ((input[p] & 0xff) << 16) |
((input[p+1] & 0xff) << 8) |
(input[p+2] & 0xff);
output[op] = alphabet[(v >> 18) & 0x3f];
output[op+1] = alphabet[(v >> 12) & 0x3f];
output[op+2] = alphabet[(v >> 6) & 0x3f];
output[op+3] = alphabet[v & 0x3f];
p += 3;
op += 4;
if (--count == 0) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
count = LINE_GROUPS;
}
}
if (finish) {
// Finish up the tail of the input. Note that we need to
// consume any bytes in tail before any bytes
// remaining in input; there should be at most two bytes
// total.
if (p-tailLen == len-1) {
int t = 0;
v = ((tailLen > 0 ? tail[t++] : input[p++]) & 0xff) << 4;
tailLen -= t;
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (do_padding) {
output[op++] = '=';
output[op++] = '=';
}
if (do_newline) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
} else if (p-tailLen == len-2) {
int t = 0;
v = (((tailLen > 1 ? tail[t++] : input[p++]) & 0xff) << 10) |
(((tailLen > 0 ? tail[t++] : input[p++]) & 0xff) << 2);
tailLen -= t;
output[op++] = alphabet[(v >> 12) & 0x3f];
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (do_padding) {
output[op++] = '=';
}
if (do_newline) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
} else if (do_newline && op > 0 && count != LINE_GROUPS) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
assert tailLen == 0;
assert p == len;
} else {
// Save the leftovers in tail to be consumed on the next
// call to encodeInternal.
if (p == len-1) {
tail[tailLen++] = input[p];
} else if (p == len-2) {
tail[tailLen++] = input[p];
tail[tailLen++] = input[p+1];
}
}
this.op = op;
this.count = count;
return true;
}
}
private Base64() { } // don't instantiate
}
| [
"1542218540@qq.com"
] | 1542218540@qq.com |
187d1304b68c005556cd3bb22c9de07983b3007a | 7c2c6f24966b3eb9b876497581264d02c53ef9cd | /LibraryHandler/src/iohandlers/XMLParser.java | 5055172a282b42de286c5b4e5a769091c7600027 | [] | no_license | nagydani98/AB2-JP-bead | 837cc9040fa986ea90ba46acd4abc090459e6889 | 7ca1eefc3d138dcd393a9480873c0a850414454a | refs/heads/master | 2020-04-28T10:30:12.392984 | 2019-04-29T05:07:54 | 2019-04-29T05:07:54 | 175,203,342 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,380 | java | package iohandlers;
import java.io.File;
import java.sql.Date;
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.ArrayList;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import models.Member;
public class XMLParser {
public static ArrayList<Element> parseDocument(String path) {
ArrayList<Element> returnlist = new ArrayList<>();
try {
File file = null;
if((!path.isEmpty()) && path.contains(".xml")) {
file = new File(path);
}
if(file.isFile()) {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(file);
Element docelement = doc.getDocumentElement();
for (int i = 0; i < docelement.getChildNodes().getLength(); i++) {
if(!(docelement.getChildNodes().item(i).getNodeName().equals("#text"))) {
Element childElement = (Element) docelement.getChildNodes().item(i);
returnlist.add(childElement);
}
}
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return returnlist;
}
public static Document createDocument() {
Document doc = null;
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
doc = docBuilder.newDocument();
}
catch (ParserConfigurationException e) {
e.printStackTrace();
}
return doc;
}
public static void saveDocument(Document doc, String path) {
try {
DOMSource source = new DOMSource(doc);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
StreamResult result = new StreamResult(path);
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.transform(source, result);
}
catch (TransformerException e) {
e.printStackTrace();
}
}
}
| [
"n.dani9812@gmail.com"
] | n.dani9812@gmail.com |
2a1ceb1757fb896b1d18c80ebb577b2bdf2930d2 | d312ffae3a5c7dae52753b77da90f44a12e4fd9e | /src/main/java/com/gilmarcarlos/developer/gcursos/service/eventos/online/CertificadoOnlineService.java | edf0935a51c2d46439e44d058ad92400331bd5d5 | [] | no_license | gilmardeveloper/java-cursos | 46b42502914d1c953f904a0508238192a5b72963 | ed2a9543365bf995896487bcaf957b5a746204df | refs/heads/master | 2020-04-03T11:45:40.593463 | 2018-10-29T15:21:45 | 2018-10-29T15:21:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,983 | java | package com.gilmarcarlos.developer.gcursos.service.eventos.online;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gilmarcarlos.developer.gcursos.model.eventos.online.CertificadoOnline;
import com.gilmarcarlos.developer.gcursos.repository.eventos.online.CertificadoOnlineRepository;
/**
* Classe com serviços de persistência para entidade (CertificadoOnline)
*
* @author Gilmar Carlos
*
*/
@Service
public class CertificadoOnlineService {
@Autowired
private CertificadoOnlineRepository repository;
public CertificadoOnline salvar(CertificadoOnline certificado) {
return repository.save(certificado);
}
/**
* Método que atualiza o conteudo do certificado
*
* @param certificado representa um certificado
* @return CertificadoOnline
*
*/
public CertificadoOnline atualizarConteudo(CertificadoOnline certificado) {
CertificadoOnline temp = buscarPor(certificado.getEventoOnline().getId());
temp.setConteudo(certificado.getConteudo());
return salvar(temp);
}
/**
* Método que atualiza a imagem de fundo do certificado
*
* @param certificado representa um certificado
* @return CertificadoOnline
*
*/
public CertificadoOnline atualizarImagemFundo(CertificadoOnline certificado) {
CertificadoOnline temp = buscarPor(certificado.getEventoOnline().getId());
temp.setImagemFundo(certificado.getImagemFundo());
return salvar(temp);
}
public void deletar(Long id) {
repository.deleteById(id);
}
public CertificadoOnline buscarPor(Long id) {
return repository.buscarPor(id);
}
/**
* Método que verifica as dimenssões de uma imagem
*
* @param imagem representa um buffer
* @param altura representa a altura de uma imagem
* @param largura representa a largura de uma imagem
* @return BufferedImage
*
*/
public BufferedImage verifica(BufferedImage imagem, Integer altura, Integer largura) {
if(imagem.getHeight() > altura || imagem.getWidth() > largura) {
imagem = redimensionar(imagem, largura, altura);
}
if(imagem.getHeight() < altura || imagem.getWidth() < largura) {
imagem = redimensionar(imagem, largura, altura);
}
return imagem;
}
/**
* Método que redimensiona as dimenssões de uma imagem
*
* @param imagem representa um buffer
* @param altura representa a altura de uma imagem
* @param largura representa a largura de uma imagem
* @return BufferedImage
*
*/
private BufferedImage redimensionar(BufferedImage imagem, Integer largura, Integer altura) {
Image tmp = imagem.getScaledInstance(largura, altura, Image.SCALE_DEFAULT); // .SCALE_SMOOTH);
imagem = new BufferedImage(largura, altura, BufferedImage.SCALE_DEFAULT); // .TYPE_INT_ARGB);
Graphics2D g2d = imagem.createGraphics();
g2d.drawImage(tmp, 0, 0, null);
g2d.dispose();
return imagem;
}
}
| [
"gilmarcarlos.developer@gmail.com"
] | gilmarcarlos.developer@gmail.com |
b79748afbf2bf11dfc9a86e965e7e1912b6df974 | 0ac05e3da06d78292fdfb64141ead86ff6ca038f | /OSWE/oswe/openCRX/rtjar/rt.jar.src/org/w3c/dom/html/HTMLMapElement.java | 580af11c94296dd80d7e888b3ad6efacc895b1f3 | [] | no_license | qoo7972365/timmy | 31581cdcbb8858ac19a8bb7b773441a68b6c390a | 2fc8baba4f53d38dfe9c2b3afd89dcf87cbef578 | refs/heads/master | 2023-07-26T12:26:35.266587 | 2023-07-17T12:35:19 | 2023-07-17T12:35:19 | 353,889,195 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package org.w3c.dom.html;
public interface HTMLMapElement extends HTMLElement {
HTMLCollection getAreas();
String getName();
void setName(String paramString);
}
/* Location: /Users/timmy/timmy/OSWE/oswe/openCRX/rt.jar!/org/w3c/dom/html/HTMLMapElement.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"t0984456716"
] | t0984456716 |
38291927d742198d5f8faeca3cd3331d2480725e | 7da844fd5430720a389854d7e0180f826d65b1ba | /src/main/java/gs/ui/tests/cosmo/pages/TestBeansContext.java | 44d6f45a90475ee6386f65ce79f4ed183eaf4270 | [] | no_license | hagaiGS/cosmo-selenium-tests | c37e31b7f096bcd983d3d8643c2d680f8f7f777b | abe94949425d78d5ed6db4f36c4a9cabce954026 | refs/heads/master | 2021-01-17T16:06:46.611898 | 2014-09-30T14:07:26 | 2014-09-30T14:07:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,013 | java | package gs.ui.tests.cosmo.pages;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/**
* Created by Itsik on 24-Apr-14.
*/
public class TestBeansContext implements ApplicationContextAware {
private static TestBeansContext instance = null;
private static ApplicationContext applicationContext;
public static TestBeansContext get() {
if (instance == null) {
instance = applicationContext.getBean(TestBeansContext.class);
}
return instance;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
public BlueprintPage getBlueprintPage() {
return applicationContext.getBean(BlueprintPage.class);
}
} | [
"extropia@gmail.com"
] | extropia@gmail.com |
a70aa24b02679c9125bca5bd50351a120ff394cd | 1beeca547186f508e61d55b4b2ca59e20b851825 | /src/co/edu/uniminuto/dyv/ParMasCercano.java | cedfdb39b21eb8321b3906a8312c288bdc1507c6 | [] | no_license | DavidPineda/DisenoSoftware | 0c92f4ad1dc46f98be957cd48fe94785b937b4a1 | 79228711d4e435fbbbc62fc685082ce88eac85d5 | refs/heads/master | 2021-01-19T17:47:32.973341 | 2015-06-04T04:43:00 | 2015-06-04T04:43:00 | 36,848,567 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,066 | java | /**
* Clase que evalua la distancia de puntos en el plano para retornar el par mas
* cercano, por medio de la tecnica de divide y vencerar
*
* Problema: Dado un conjunto de puntos en el plano cartesiano (x,y) el problema
* es encontrar aquellos dos puntos que se encuentran más cerca el uno del otro.
*/
package co.edu.uniminuto.dyv;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
public class ParMasCercano {
/**
* Funcion publica encargada llamar el metodo de ordenacion del array y
* luego llamar al proceso principal
*
* @param puntos Array con todos los puntos cargados
* @return Retorna mensaje indicando cual fue el par mas cercano encontrado
*/
public String divideYvenceras(Punto[] puntos) {
// Se ordena el array de acuerdo a la cordenada X
Arrays.sort(puntos, new OrdenPointX());
// Se obtiene el par de puntos con menor distancia
ParPuntos dmin = divideYvenceras(puntos, 0, puntos.length - 1);
pintarPuntos(puntos);
return "El par de puntos mas cercano es: " + dmin.toString();
}
/**
* Funcion recursiva en la cual se aplica la tecnica divide y venceras
*
* @param p Arreglo con todos los puntos ingresados
* @param inf Parte inferior del array(Desde donde empezar)
* @param sup Parte Superior del array(Hasta donde ir)
* @return El par de puntos mas cercano
*/
private ParPuntos divideYvenceras(Punto[] p, int inf, int sup) {
if ((sup - inf) <= 2) {
return fuerzaBruta(p, inf, sup);
}
int medio = (inf + sup) / 2;
double xMed = p[medio].getX();
// parIzquierda Representa el par de puntos con menor distancia de la parte izquierda de la division
ParPuntos parIzquierda = divideYvenceras(p, inf, medio); // Evalua la parte izquierda
// parDerecha Representa el par de puntos con menor distancia de la parte dercha de la division
ParPuntos parDerecha = divideYvenceras(p, medio + 1, sup); // Evalua la parte derecha
// parResult Representa el par de puntos mas cercano entre el par izquierdo y el derecho
ParPuntos parResult = minDistancia(parIzquierda, parDerecha);
// Se buscan los puntos que quedaron separados por la division, y que pudene estar mas cerca que
// los que quedaron a cada lado de la division
Punto[] p1 = Arrays.copyOfRange(p, inf, sup + 1); // Se hace un array con la cantidad de puntos evaluados
ArrayList<Punto> tempList = new ArrayList<>(); // Lista de puntos temporal en la que se almacenan los que podrian ser menores
Arrays.sort(p1, new OrdenPointY()); // Se ordena el nuevo array por la posicion Y
for (int i = inf; i < p1.length; i++) {
if (Math.abs(xMed - ((Punto) p1[i]).getX()) < parResult.distancia()) {
tempList.add(p1[i]);
}
}
for (int i = 0; i < tempList.size() - 1; i++) {
Punto pTemp1 = tempList.get(i);
for (int j = i + 1; j < tempList.size(); j++) {
Punto pTemp2 = tempList.get(j);
ParPuntos parTemp = new ParPuntos(pTemp1, pTemp2);
if (parTemp.distancia() < parResult.distancia()) // Si el punto es menor se actualiza el resultado a retornar
{
parResult = parTemp;
}
}
}
return parResult;
}
/**
* Valida la distancia que existe entre dos pares para retornar el de menor
* distancia
*
* @param parIzquierda par de puntos izquierdo
* @param parDerecha par de puntos derecho
* @return retorna el par de puntos cuya distancia sea menor
*/
ParPuntos minDistancia(ParPuntos parIzquierda, ParPuntos parDerecha) {
return (parIzquierda.distancia() - parDerecha.distancia()) < 0 ? parIzquierda : parDerecha;
}
/**
* Algortimo Voraz para encontrar la menor distancia entre dos puntos
*
* @param p Arreglo con los puntos
* @param inf Posicion inferior de donde inicar el recorrido
* @param sup Posicion final hasta donde terminar el recorrido
* @return Par de puntos con la distancia mas cercana
*/
private ParPuntos fuerzaBruta(Punto[] p, int inf, int sup) {
int rango = sup - inf;
if (rango < 1) {
return null;
}
ParPuntos parOrigen = new ParPuntos(p[inf], p[inf + 1]);
if (rango > 1) {
for (int i = inf; i < sup; i++) {
for (int j = i + 1; j < sup + 1; j++) {
ParPuntos parComparacion = new ParPuntos(p[i], p[j]);
if (parComparacion.distancia() < parOrigen.distancia()) {
parOrigen = parComparacion;
}
}
}
}
return parOrigen;
}
private void pintarPuntos(Punto[] puntos){
for(Punto p: puntos){
System.out.println(p.toString());
}
}
/**
* Clase que implementa la interfaz Comparator para realizar la ordenacion
* del array por la posicion x del punto
*/
class OrdenPointX implements Comparator<Punto> {
@Override
public int compare(Punto punto1, Punto punto2) {
if (punto1.getX() < punto2.getX()) {
return -1;
}
if (punto1.getX() > punto2.getX()) {
return 1;
}
return 0;
}
}
class OrdenPointY implements Comparator<Punto> {
@Override
public int compare(Punto punto1, Punto punto2) {
if (punto1.getY() < punto2.getY()) {
return -1;
}
if (punto1.getY() > punto2.getY()) {
return 1;
}
return 0;
}
}
}
| [
"david@david-Inspiron-5547"
] | david@david-Inspiron-5547 |
ed3078b867df4a80f558684e14cae56258eece5d | 4312a71c36d8a233de2741f51a2a9d28443cd95b | /RawExperiments/Math/math99/2/AstorMain-math_99/src/default/org/apache/commons/math/fraction/Fraction.java | bca4f2386b11e02634ef6ec3ebd14257a419e056 | [] | no_license | SajjadZaidi/AutoRepair | 5c7aa7a689747c143cafd267db64f1e365de4d98 | e21eb9384197bae4d9b23af93df73b6e46bb749a | refs/heads/master | 2021-05-07T00:07:06.345617 | 2017-12-02T18:48:14 | 2017-12-02T18:48:14 | 112,858,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,427 | java | package org.apache.commons.math.fraction;
public class Fraction extends java.lang.Number implements java.lang.Comparable<org.apache.commons.math.fraction.Fraction> {
public static final org.apache.commons.math.fraction.Fraction TWO = new org.apache.commons.math.fraction.Fraction(2 , 1);
public static final org.apache.commons.math.fraction.Fraction ONE = new org.apache.commons.math.fraction.Fraction(1 , 1);
public static final org.apache.commons.math.fraction.Fraction ZERO = new org.apache.commons.math.fraction.Fraction(0 , 1);
public static final org.apache.commons.math.fraction.Fraction MINUS_ONE = new org.apache.commons.math.fraction.Fraction((-1) , 1);
private static final long serialVersionUID = 3071409609509774764L;
private final int denominator;
private final int numerator;
public Fraction(double value) throws org.apache.commons.math.fraction.FractionConversionException {
this(value, 1.0E-5, 100);
}
public Fraction(double value ,double epsilon ,int maxIterations) throws org.apache.commons.math.fraction.FractionConversionException {
this(value, epsilon, java.lang.Integer.MAX_VALUE, maxIterations);
}
public Fraction(double value ,int maxDenominator) throws org.apache.commons.math.fraction.FractionConversionException {
this(value, 0, maxDenominator, 100);
}
private Fraction(double value ,double epsilon ,int maxDenominator ,int maxIterations) throws org.apache.commons.math.fraction.FractionConversionException {
long overflow = java.lang.Integer.MAX_VALUE;
double r0 = value;
long a0 = ((long)(java.lang.Math.floor(r0)));
if (a0 > overflow) {
throw new org.apache.commons.math.fraction.FractionConversionException(value , a0 , 1L);
}
if ((java.lang.Math.abs((a0 - value))) < epsilon) {
this.numerator = ((int)(a0));
this.denominator = 1;
return ;
}
long p0 = 1;
long q0 = 0;
long p1 = a0;
long q1 = 1;
long p2 = 0;
long q2 = 1;
int n = 0;
boolean stop = false;
do {
++n;
double r1 = 1.0 / (r0 - a0);
long a1 = ((long)(java.lang.Math.floor(r1)));
p2 = (a1 * p1) + p0;
q2 = (a1 * q1) + q0;
if ((p2 > overflow) || (q2 > overflow)) {
throw new org.apache.commons.math.fraction.FractionConversionException(value , p2 , q2);
}
double convergent = ((double)(p2)) / ((double)(q2));
if (((n < maxIterations) && ((java.lang.Math.abs((convergent - value))) > epsilon)) && (q2 < maxDenominator)) {
p0 = p1;
p1 = p2;
q0 = q1;
q1 = q2;
a0 = a1;
r0 = r1;
} else {
stop = true;
}
} while (!stop );
if (n >= maxIterations) {
throw new org.apache.commons.math.fraction.FractionConversionException(value , maxIterations);
}
if (q2 < maxDenominator) {
this.numerator = ((int)(p2));
this.denominator = ((int)(q2));
} else {
this.numerator = ((int)(p1));
this.denominator = ((int)(q1));
}
}
public Fraction(int num ,int den) {
super();
if (den == 0) {
throw org.apache.commons.math.MathRuntimeException.createArithmeticException("zero denominator in fraction {0}/{1}", new java.lang.Object[]{ num , den });
}
if (den < 0) {
if ((num == (java.lang.Integer.MIN_VALUE)) || (den == (java.lang.Integer.MIN_VALUE))) {
throw org.apache.commons.math.MathRuntimeException.createArithmeticException("overflow in fraction {0}/{1}, cannot negate", new java.lang.Object[]{ num , den });
}
num = -num;
den = -den;
}
int d = org.apache.commons.math.util.MathUtils.gcd(num, den);
if (d > 1) {
num /= d;
den /= d;
}
if (den < 0) {
num *= -1;
den *= -1;
}
this.numerator = num;
this.denominator = den;
}
public org.apache.commons.math.fraction.Fraction abs() {
org.apache.commons.math.fraction.Fraction ret;
if ((numerator) >= 0) {
ret = org.apache.commons.math.fraction.Fraction.this;
} else {
ret = negate();
}
return ret;
}
public int compareTo(org.apache.commons.math.fraction.Fraction object) {
int ret = 0;
if ((org.apache.commons.math.fraction.Fraction.this) != object) {
double first = doubleValue();
double second = object.doubleValue();
if (first < second) {
ret = -1;
} else if (first > second) {
ret = 1;
}
}
return ret;
}
public double doubleValue() {
return ((double)(numerator)) / ((double)(denominator));
}
public boolean equals(java.lang.Object other) {
boolean ret;
if ((org.apache.commons.math.fraction.Fraction.this) == other) {
ret = true;
} else if (other == null) {
ret = false;
} else {
try {
org.apache.commons.math.fraction.Fraction rhs = ((org.apache.commons.math.fraction.Fraction)(other));
ret = ((numerator) == (rhs.numerator)) && ((denominator) == (rhs.denominator));
} catch (java.lang.ClassCastException ex) {
ret = false;
}
}
return ret;
}
public float floatValue() {
return ((float)(doubleValue()));
}
public int getDenominator() {
return denominator;
}
public int getNumerator() {
return numerator;
}
public int hashCode() {
return (37 * ((37 * 17) + (getNumerator()))) + (getDenominator());
}
public int intValue() {
return ((int)(doubleValue()));
}
public long longValue() {
return ((long)(doubleValue()));
}
public org.apache.commons.math.fraction.Fraction negate() {
if ((numerator) == (java.lang.Integer.MIN_VALUE)) {
throw org.apache.commons.math.MathRuntimeException.createArithmeticException("overflow in fraction {0}/{1}, cannot negate", new java.lang.Object[]{ numerator , denominator });
}
return new org.apache.commons.math.fraction.Fraction((-(numerator)) , denominator);
}
public org.apache.commons.math.fraction.Fraction reciprocal() {
return new org.apache.commons.math.fraction.Fraction(denominator , numerator);
}
public org.apache.commons.math.fraction.Fraction add(org.apache.commons.math.fraction.Fraction fraction) {
return addSub(fraction, true);
}
public org.apache.commons.math.fraction.Fraction subtract(org.apache.commons.math.fraction.Fraction fraction) {
return addSub(fraction, false);
}
private org.apache.commons.math.fraction.Fraction addSub(org.apache.commons.math.fraction.Fraction fraction, boolean isAdd) {
if (fraction == null) {
throw new java.lang.IllegalArgumentException("The fraction must not be null");
}
if ((numerator) == 0) {
return isAdd ? fraction : fraction.negate();
}
if ((fraction.numerator) == 0) {
return org.apache.commons.math.fraction.Fraction.this;
}
int d1 = org.apache.commons.math.util.MathUtils.gcd(denominator, fraction.denominator);
if (d1 == 1) {
int uvp = org.apache.commons.math.util.MathUtils.mulAndCheck(numerator, fraction.denominator);
int upv = org.apache.commons.math.util.MathUtils.mulAndCheck(fraction.numerator, denominator);
return new org.apache.commons.math.fraction.Fraction((isAdd ? org.apache.commons.math.util.MathUtils.addAndCheck(uvp, upv) : org.apache.commons.math.util.MathUtils.subAndCheck(uvp, upv)) , org.apache.commons.math.util.MathUtils.mulAndCheck(denominator, fraction.denominator));
}
java.math.BigInteger uvp = java.math.BigInteger.valueOf(numerator).multiply(java.math.BigInteger.valueOf(((fraction.denominator) / d1)));
java.math.BigInteger upv = java.math.BigInteger.valueOf(fraction.numerator).multiply(java.math.BigInteger.valueOf(((denominator) / d1)));
java.math.BigInteger t = isAdd ? uvp.add(upv) : uvp.subtract(upv);
int tmodd1 = t.mod(java.math.BigInteger.valueOf(d1)).intValue();
int d2 = tmodd1 == 0 ? d1 : org.apache.commons.math.util.MathUtils.gcd(tmodd1, d1);
java.math.BigInteger w = t.divide(java.math.BigInteger.valueOf(d2));
if ((w.bitLength()) > 31) {
throw org.apache.commons.math.MathRuntimeException.createArithmeticException("overflow, numerator too large after multiply: {0}", new java.lang.Object[]{ w });
}
return new org.apache.commons.math.fraction.Fraction(w.intValue() , org.apache.commons.math.util.MathUtils.mulAndCheck(((denominator) / d1), ((fraction.denominator) / d2)));
}
public org.apache.commons.math.fraction.Fraction multiply(org.apache.commons.math.fraction.Fraction fraction) {
if (fraction == null) {
throw new java.lang.IllegalArgumentException("The fraction must not be null");
}
if (((numerator) == 0) || ((fraction.numerator) == 0)) {
return org.apache.commons.math.fraction.Fraction.ZERO;
}
int d1 = org.apache.commons.math.util.MathUtils.gcd(numerator, fraction.denominator);
int d2 = org.apache.commons.math.util.MathUtils.gcd(fraction.numerator, denominator);
return org.apache.commons.math.fraction.Fraction.getReducedFraction(org.apache.commons.math.util.MathUtils.mulAndCheck(((numerator) / d1), ((fraction.numerator) / d2)), org.apache.commons.math.util.MathUtils.mulAndCheck(((denominator) / d2), ((fraction.denominator) / d1)));
}
public org.apache.commons.math.fraction.Fraction divide(org.apache.commons.math.fraction.Fraction fraction) {
if (fraction == null) {
throw new java.lang.IllegalArgumentException("The fraction must not be null");
}
if ((fraction.numerator) == 0) {
throw org.apache.commons.math.MathRuntimeException.createArithmeticException("the fraction to divide by must not be zero: {0}/{1}", new java.lang.Object[]{ fraction.numerator , fraction.denominator });
}
return multiply(fraction.reciprocal());
}
public static org.apache.commons.math.fraction.Fraction getReducedFraction(int numerator, int denominator) {
if (denominator == 0) {
throw org.apache.commons.math.MathRuntimeException.createArithmeticException("zero denominator in fraction {0}/{1}", new java.lang.Object[]{ numerator , denominator });
}
if (numerator == 0) {
return org.apache.commons.math.fraction.Fraction.ZERO;
}
if ((denominator == (java.lang.Integer.MIN_VALUE)) && ((numerator & 1) == 0)) {
numerator /= 2;
denominator /= 2;
}
if (denominator < 0) {
if ((numerator == (java.lang.Integer.MIN_VALUE)) || (denominator == (java.lang.Integer.MIN_VALUE))) {
throw org.apache.commons.math.MathRuntimeException.createArithmeticException("overflow in fraction {0}/{1}, cannot negate", new java.lang.Object[]{ numerator , denominator });
}
numerator = -numerator;
denominator = -denominator;
}
int gcd = org.apache.commons.math.util.MathUtils.gcd(numerator, denominator);
numerator /= gcd;
denominator /= gcd;
return new org.apache.commons.math.fraction.Fraction(numerator , denominator);
}
}
| [
"sajjad.syed@ucalgary.ca"
] | sajjad.syed@ucalgary.ca |
6e45e47e98c65c38ef548ac9f56cbb042b7dae79 | b68ea8b705cd3c6e35e42b2d9e77395d37a586c4 | /4/EarthquakeFilterStarterProgram/DepthFilter.java | 1ab2a5d245e50e015b027fc337ba08c3b9d19d60 | [] | no_license | misstong/Java-Programming_DUKE | 66a6fa8966fb3e90a824a61d1a4e617b8052e167 | 43bebd9082631102689e2a60875f8c948e7aa295 | refs/heads/master | 2021-08-08T20:41:30.384518 | 2017-11-11T04:50:14 | 2017-11-11T04:50:14 | 110,318,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 560 | java |
/**
* Write a description of DepthFilter here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class DepthFilter implements Filter{
private double minDepth;
private double maxDepth;
public DepthFilter(double min,double max){
maxDepth=max;
minDepth=min;
}
public boolean satisfies(QuakeEntry qe){
if(qe.getDepth()>=minDepth&&qe.getDepth()<=maxDepth){
return true;
}
return false;
}
public String getName(){
return "DepthFilter";
}
}
| [
"1962788480@qq.com"
] | 1962788480@qq.com |
4df9b64e91752483a5d679fb9b852f926a92e7f2 | 4aba828da7ecabfc4363dda79807436a2470f316 | /src/test/java/com/ning/atlas/spi/TestUri.java | 93411c419ce0f67a926ea0bdd224421d06b2682b | [
"MIT",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | darthjoel/atlas | 2290db32accf9cba7a78f1a57b84df3839216de9 | 94e6764da3f791b179fda8bcbdc9d1b89de3bcd2 | refs/heads/master | 2020-12-25T09:57:52.249902 | 2012-04-19T00:15:02 | 2012-04-19T00:15:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,195 | java | package com.ning.atlas.spi;
import com.google.common.collect.ImmutableMap;
import com.ning.atlas.Base;
import org.junit.Test;
import org.stringtemplate.v4.ST;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import static java.util.Arrays.asList;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItem;
public class TestUri
{
@Test
public void testScheme() throws Exception
{
Uri uri = Uri.valueOf("provisioner:galaxy:v2");
assertThat(uri.getScheme(), equalTo("provisioner"));
}
@Test
public void testJustScheme() throws Exception
{
Uri uri = Uri.valueOf("waffle");
assertThat(uri.getScheme(), equalTo("waffle"));
assertThat(uri.getFragment(), equalTo(""));
}
@Test
public void testFragment() throws Exception
{
Uri uri = Uri.valueOf("provisioner:galaxy:v2");
assertThat(uri.getFragment(), equalTo("galaxy:v2"));
}
@Test
public void testFragmentExcludesParams() throws Exception
{
Uri uri = Uri.valueOf("hello:world?a=1&b=2");
assertThat(uri.getFragment(), equalTo("world"));
}
@Test
public void testParams1() throws Exception
{
Uri uri = Uri.valueOf("hello:world?a=1&b=2");
Map<String, Collection<String>> params = uri.getFullParams();
assertThat(params.get("a"), hasItem("1"));
assertThat(params.get("b"), hasItem("2"));
}
@Test
public void testParams2() throws Exception
{
Uri uri = Uri.valueOf("hello?a=1&b=2");
Map<String, Collection<String>> params = uri.getFullParams();
assertThat(params.get("a"), hasItem("1"));
assertThat(params.get("b"), hasItem("2"));
}
@Test
public void testParams3() throws Exception
{
Uri uri = Uri.valueOf("hello:?a=1&b=2");
Map<String, Collection<String>> params = uri.getFullParams();
assertThat(params.get("a"), hasItem("1"));
assertThat(params.get("b"), hasItem("2"));
}
@Test
public void testAdditionalParams() throws Exception
{
Uri uri = Uri.valueOf("hello:?a=1", ImmutableMap.<String, Collection<String>>of("b", Arrays.asList("2")));
Map<String, Collection<String>> params = uri.getFullParams();
assertThat(params.get("a"), hasItem("1"));
assertThat(params.get("b"), hasItem("2"));
}
@Test
public void testAdditionalParams2() throws Exception
{
Uri uri = Uri.valueOf("hello",
ImmutableMap.<String, Collection<String>>of("a", Arrays.asList("1"),
"b", Arrays.asList("2")));
Map<String, Collection<String>> params = uri.getFullParams();
assertThat(params.get("a"), hasItem("1"));
assertThat(params.get("b"), hasItem("2"));
}
@Test
public void testCanonicalization() throws Exception
{
Uri uri = new Uri("hello",
"world",
ImmutableMap.<String, Collection<String>>of("a", Arrays.asList("hello", "world"),
"b", Arrays.asList("hello world")));
assertThat(uri.toString(), equalTo("hello:world?a=hello&a=world&b=hello world"));
}
@Test
public void testSchemeWithNoStuff() throws Exception
{
Uri uri = new Uri("rds", "", ImmutableMap.<String, Collection<String>>of("hello", Arrays.asList("world")));
assertThat(uri.getScheme(), equalTo("rds"));
}
@Test
public void testSchemeWithNoStuff2() throws Exception
{
Uri uri = Uri.valueOf("rds", ImmutableMap.<String, Collection<String>>of("hello", Arrays.asList("world")));
assertThat(uri.getScheme(), equalTo("rds"));
}
@Test
public void testSchemeWithNoStuff3() throws Exception
{
Uri uri = Uri.valueOf("rds", ImmutableMap.<String, Collection<String>>of("hello", Arrays.asList("world")));
Uri dup = Uri.valueOf(uri.toString());
assertThat(dup.getScheme(), equalTo("rds"));
}
@Test
public void testTemplateInUri() throws Exception
{
Uri uri = Uri.valueOf("hello:{name}");
assertThat(uri.isTemplate(), equalTo(true));
}
@Test
public void testTemplateInUri2() throws Exception
{
Uri uri = Uri.valueOf("hello:name?{key}=value");
assertThat(uri.isTemplate(), equalTo(true));
}
@Test
public void testTemplateInUri3() throws Exception
{
Uri uri = Uri.valueOf("hello:name?key={value}");
assertThat(uri.isTemplate(), equalTo(true));
}
@Test
public void testTemplateInUri4() throws Exception
{
Uri uri = Uri.valueOf("{hello}:name?key=value");
assertThat(uri.isTemplate(), equalTo(true));
}
@Test
public void testTemplateUri5() throws Exception
{
Uri uri = Uri.valueOf("hello:{name}?key={value}", Collections.<String, Collection<String>>emptyMap());
assertThat(uri.toStringUnEscaped(), equalTo("hello:{name}?key={value}"));
assertThat(uri.isTemplate(), equalTo(true));
}
@Test
public void testUgh() throws Exception
{
Uri uri = Uri.valueOf("{base.fragment}?port={my.port}", Collections.<String, Collection<String>>emptyMap());
}
@Test
public void testNotTemplateInUri() throws Exception
{
Uri uri = Uri.valueOf("!hello:{name}");
assertThat(uri.isTemplate(), equalTo(false));
assertThat(uri.getScheme(), equalTo("hello"));
}
@Test
public void testNotTemplateInUri2() throws Exception
{
Uri uri = Uri.valueOf("!hello:name?{key}=value");
assertThat(uri.isTemplate(), equalTo(false));
}
@Test
public void testNotTemplateInUri3() throws Exception
{
Uri uri = Uri.valueOf("!hello:name?key={value}");
assertThat(uri.isTemplate(), equalTo(false));
}
@Test
public void testNotTemplateInUri4() throws Exception
{
Uri uri = Uri.valueOf("!{hello}:name?key=value");
assertThat(uri.isTemplate(), equalTo(false));
assertThat(uri.getScheme(), equalTo("{hello}"));
}
@Test
public void testActuallyApplyTemplate() throws Exception
{
Uri<Base> base_uri = Uri.valueOf("mysql:blog");
Uri<Provisioner> uri = Uri.valueOf("rds?name={base.fragment}&engine=MySQL");
assertThat(uri.toStringUnEscaped(), equalTo("rds?engine=MySQL&name={base.fragment}"));
ST st = new ST(uri.toStringUnEscaped(), '{', '}');
st.add("base", base_uri);
assertThat(st.render(), equalTo("rds?engine=MySQL&name=blog"));
}
@Test
public void testSpaces() throws Exception
{
Uri<String> u = Uri.valueOf("script:sculptor/install.sh {virtual.fragment}?unwind=sculptor/uninstall.sh {virtual.fragment}");
String unwind = u.getParams().get("unwind");
assertThat(unwind, equalTo("sculptor/uninstall.sh {virtual.fragment}"));
}
}
| [
"brianm@skife.org"
] | brianm@skife.org |
df2f94eb82af6d1e043538c020d81960e70a7bd6 | 18d96ffa6f5dd781ad57835196f91fb8587469f4 | /znylg-backend/znylg/src/main/java/com/xuanxuan/csu/model/Reply.java | e4c14b7b078c8f04b677fc43688b87113fded9cb | [] | no_license | zongyuantong/comment | ff7ab17e572221f2278b0837685936f03ad94a07 | 310c717b2566780c17a616b54783a9d32256b8b9 | refs/heads/master | 2022-11-25T14:46:54.585925 | 2020-08-01T04:15:44 | 2020-08-01T04:15:44 | 284,176,456 | 0 | 0 | null | 2020-08-01T03:11:58 | 2020-08-01T03:11:58 | null | UTF-8 | Java | false | false | 885 | java | package com.xuanxuan.csu.model;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Data
@Table(name = "reply")
public class Reply {
@Id
@GeneratedValue(generator = "UUID")
private String id;
@Column(name = "comment_id")
private String commentId;
@Column(name = "reply_id")
private String replyId;
@Column(name = "reply_type")
private Integer replyType;//回复评论为1,回复回复为2
@Column(name = "content")
private String content;
@Column(name = "from_uid")
private String fromUid;
@Column(name = "create_time")
private Date createTime = new Date();
@Column(name = "star_number")
private Integer zanNum = 0;
@Column(name = "verified")
private Integer verified;
} | [
"1174959916@qq.com"
] | 1174959916@qq.com |
6d4b2dc22750e57f250477ac027b6ee93678831d | 387308db3dc207129ef44d6f414c8007421e2be6 | /src/main/java/com/redrain/service/impl/SysMenuServiceImpl.java | 6cfc742b3b23b0e27790a1f9b1dc90caca7ec7e4 | [] | no_license | ywwj001/test | 42d058192a04cdce7997575cddd6cd4906c11cfe | 2961f004eca0b6eec3408926731868cbf0c26a22 | refs/heads/main | 2023-08-13T23:49:20.837648 | 2021-09-29T14:27:59 | 2021-09-29T14:27:59 | 411,688,525 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,300 | java | package com.redrain.service.impl;
import com.redrain.common.result.ReturnData;
import com.redrain.entity.ReturnDataForLayui;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.redrain.entity.SysMenu;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.redrain.mapper.SysMenuMapper;
import com.redrain.service.SysMenuService;
import com.redrain.common.utils.UpdateOrInsertResultDeal;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* @author redrain
* @Description SysMenuservice实现类
* @date 2021-04
* @qq 1351150492
*/
@Service
public class SysMenuServiceImpl implements SysMenuService {
@Autowired
private SysMenuMapper sysMenuMapper;
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
@Override
public ReturnDataForLayui getList(SysMenu sysMenu) {
PageHelper.startPage(sysMenu.getPage(), sysMenu.getLimit());
List<SysMenu> list = sysMenuMapper.getList(sysMenu);
PageInfo<SysMenu> info = new PageInfo<>(list);
return ReturnDataForLayui.success(list, info.getTotal());
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Override
public ReturnData add(SysMenu sysMenu) {
int i = sysMenuMapper.add(sysMenu);
return UpdateOrInsertResultDeal.dealWith(i);
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Override
public ReturnData delete(SysMenu sysMenu) {
int i = sysMenuMapper.delete(sysMenu);
return UpdateOrInsertResultDeal.dealWith(i);
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Override
public ReturnData update(SysMenu sysMenu) {
int i = sysMenuMapper.update(sysMenu);
return UpdateOrInsertResultDeal.dealWith(i);
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Override
public ReturnData updateState(SysMenu sysMenu) {
int i = sysMenuMapper.updateState(sysMenu);
return UpdateOrInsertResultDeal.dealWith(i);
}
}
| [
"2351983938@qq.com"
] | 2351983938@qq.com |
427f4e263727242c2b81d3d97bc9a2b29c59d22e | 88f6cfe62b9d357dd7e52257bc5e013652472565 | /Android_code/Robot/app/src/androidTest/java/com/example/rajitha/robot/ExampleInstrumentedTest.java | 8c5c5bea75f72d8118bbc7843f1544b15aa675f0 | [
"Apache-2.0"
] | permissive | rajutewari/WiFi-Robot | 87e2409b24f565a585f67354297c1a434c31086b | 78b6818747bc540ee19d781b7950ca85d63d3cb9 | refs/heads/master | 2021-04-26T23:43:15.676308 | 2017-12-06T15:55:03 | 2017-12-06T15:55:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package com.example.rajitha.robot;
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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.rajitha.robot", appContext.getPackageName());
}
}
| [
"tmrkumara.15@cse.mrt.ac.lk"
] | tmrkumara.15@cse.mrt.ac.lk |
673d6d3828afb9f47ff9d50cf24bf3cc616ee89f | 651e7db4a33840f541326f9591ee79f839d8a0e3 | /mall_0906_keywords/src/main/java/com/atguigu/util/MySolrUtil.java | 518b9f0d0a602df6eaa6299cdf95ab2e1958d325 | [] | no_license | Silence03/DianshangProject | 3cadd201010495716deaf2c9adf4849471192193 | 5c198492ec336486d189c274bb085cac717e84e7 | refs/heads/master | 2021-05-10T08:52:26.293800 | 2018-02-26T12:45:03 | 2018-02-26T12:45:03 | 118,908,237 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,162 | java | package com.atguigu.util;
import java.util.List;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.impl.XMLResponseParser;
import org.apache.solr.client.solrj.response.QueryResponse;
import com.atguigu.bean.KEYWORDS_T_MALL_SKU;
public class MySolrUtil {
public static HttpSolrServer getMySolr(String properties,String solr_url) {
//获取solr客户端连接
HttpSolrServer solr = new HttpSolrServer(MyPropertiesUtil.getMyProperty(properties, solr_url));
solr.setParser(new XMLResponseParser());
return solr;
}
public static <T> List<T> getMySolrData(HttpSolrServer solr,Class<T> t,String keywords) {
//设置solr
SolrQuery solrQuery = new SolrQuery();
solrQuery.setQuery(keywords);
solrQuery.setRows(50);
QueryResponse query = null;
try {
query = solr.query(solrQuery);
} catch (SolrServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
List<T> list_keywords = query.getBeans(t);
return list_keywords;
}
}
| [
"Administrator@SC-201801312220"
] | Administrator@SC-201801312220 |
dcbfd574fa569d0385c4f0a0932191b23dac32cd | ea16de2020ab8fdefc8327a906f7aa79c65e4ad4 | /src/main/java/com/hellogood/domain/NoteExample.java | f53910202d3e664849438b1eabf28308a7423215 | [] | no_license | scaukejian/hellogood_admin | 3cca6d4f8572e967c6d47b6afe097663201c80fd | f5754d1e55e1f322085805d9446077666f696485 | refs/heads/master | 2021-09-07T18:21:26.784742 | 2018-02-27T08:19:46 | 2018-02-27T08:19:46 | 104,710,472 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 32,923 | java | package com.hellogood.domain;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class NoteExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public NoteExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Integer value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Integer value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Integer value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Integer value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Integer value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Integer value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Integer> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Integer> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Integer value1, Integer value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Integer value1, Integer value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeIsNull() {
addCriterion("phone_unique_code is null");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeIsNotNull() {
addCriterion("phone_unique_code is not null");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeEqualTo(String value) {
addCriterion("phone_unique_code =", value, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeNotEqualTo(String value) {
addCriterion("phone_unique_code <>", value, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeGreaterThan(String value) {
addCriterion("phone_unique_code >", value, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeGreaterThanOrEqualTo(String value) {
addCriterion("phone_unique_code >=", value, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeLessThan(String value) {
addCriterion("phone_unique_code <", value, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeLessThanOrEqualTo(String value) {
addCriterion("phone_unique_code <=", value, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeLike(String value) {
addCriterion("phone_unique_code like", value, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeNotLike(String value) {
addCriterion("phone_unique_code not like", value, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeIn(List<String> values) {
addCriterion("phone_unique_code in", values, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeNotIn(List<String> values) {
addCriterion("phone_unique_code not in", values, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeBetween(String value1, String value2) {
addCriterion("phone_unique_code between", value1, value2, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andPhoneUniqueCodeNotBetween(String value1, String value2) {
addCriterion("phone_unique_code not between", value1, value2, "phoneUniqueCode");
return (Criteria) this;
}
public Criteria andContentIsNull() {
addCriterion("content is null");
return (Criteria) this;
}
public Criteria andContentIsNotNull() {
addCriterion("content is not null");
return (Criteria) this;
}
public Criteria andContentEqualTo(String value) {
addCriterion("content =", value, "content");
return (Criteria) this;
}
public Criteria andContentNotEqualTo(String value) {
addCriterion("content <>", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThan(String value) {
addCriterion("content >", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThanOrEqualTo(String value) {
addCriterion("content >=", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThan(String value) {
addCriterion("content <", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThanOrEqualTo(String value) {
addCriterion("content <=", value, "content");
return (Criteria) this;
}
public Criteria andContentLike(String value) {
addCriterion("content like", value, "content");
return (Criteria) this;
}
public Criteria andContentNotLike(String value) {
addCriterion("content not like", value, "content");
return (Criteria) this;
}
public Criteria andContentIn(List<String> values) {
addCriterion("content in", values, "content");
return (Criteria) this;
}
public Criteria andContentNotIn(List<String> values) {
addCriterion("content not in", values, "content");
return (Criteria) this;
}
public Criteria andContentBetween(String value1, String value2) {
addCriterion("content between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andContentNotBetween(String value1, String value2) {
addCriterion("content not between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andValidStatusIsNull() {
addCriterion("valid_status is null");
return (Criteria) this;
}
public Criteria andValidStatusIsNotNull() {
addCriterion("valid_status is not null");
return (Criteria) this;
}
public Criteria andValidStatusEqualTo(Integer value) {
addCriterion("valid_status =", value, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusNotEqualTo(Integer value) {
addCriterion("valid_status <>", value, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusGreaterThan(Integer value) {
addCriterion("valid_status >", value, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("valid_status >=", value, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusLessThan(Integer value) {
addCriterion("valid_status <", value, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusLessThanOrEqualTo(Integer value) {
addCriterion("valid_status <=", value, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusIn(List<Integer> values) {
addCriterion("valid_status in", values, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusNotIn(List<Integer> values) {
addCriterion("valid_status not in", values, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusBetween(Integer value1, Integer value2) {
addCriterion("valid_status between", value1, value2, "validStatus");
return (Criteria) this;
}
public Criteria andValidStatusNotBetween(Integer value1, Integer value2) {
addCriterion("valid_status not between", value1, value2, "validStatus");
return (Criteria) this;
}
public Criteria andDisplayIsNull() {
addCriterion("display is null");
return (Criteria) this;
}
public Criteria andDisplayIsNotNull() {
addCriterion("display is not null");
return (Criteria) this;
}
public Criteria andDisplayEqualTo(Integer value) {
addCriterion("display =", value, "display");
return (Criteria) this;
}
public Criteria andDisplayNotEqualTo(Integer value) {
addCriterion("display <>", value, "display");
return (Criteria) this;
}
public Criteria andDisplayGreaterThan(Integer value) {
addCriterion("display >", value, "display");
return (Criteria) this;
}
public Criteria andDisplayGreaterThanOrEqualTo(Integer value) {
addCriterion("display >=", value, "display");
return (Criteria) this;
}
public Criteria andDisplayLessThan(Integer value) {
addCriterion("display <", value, "display");
return (Criteria) this;
}
public Criteria andDisplayLessThanOrEqualTo(Integer value) {
addCriterion("display <=", value, "display");
return (Criteria) this;
}
public Criteria andDisplayIn(List<Integer> values) {
addCriterion("display in", values, "display");
return (Criteria) this;
}
public Criteria andDisplayNotIn(List<Integer> values) {
addCriterion("display not in", values, "display");
return (Criteria) this;
}
public Criteria andDisplayBetween(Integer value1, Integer value2) {
addCriterion("display between", value1, value2, "display");
return (Criteria) this;
}
public Criteria andDisplayNotBetween(Integer value1, Integer value2) {
addCriterion("display not between", value1, value2, "display");
return (Criteria) this;
}
public Criteria andTopIsNull() {
addCriterion("top is null");
return (Criteria) this;
}
public Criteria andTopIsNotNull() {
addCriterion("top is not null");
return (Criteria) this;
}
public Criteria andTopEqualTo(Integer value) {
addCriterion("top =", value, "top");
return (Criteria) this;
}
public Criteria andTopNotEqualTo(Integer value) {
addCriterion("top <>", value, "top");
return (Criteria) this;
}
public Criteria andTopGreaterThan(Integer value) {
addCriterion("top >", value, "top");
return (Criteria) this;
}
public Criteria andTopGreaterThanOrEqualTo(Integer value) {
addCriterion("top >=", value, "top");
return (Criteria) this;
}
public Criteria andTopLessThan(Integer value) {
addCriterion("top <", value, "top");
return (Criteria) this;
}
public Criteria andTopLessThanOrEqualTo(Integer value) {
addCriterion("top <=", value, "top");
return (Criteria) this;
}
public Criteria andTopIn(List<Integer> values) {
addCriterion("top in", values, "top");
return (Criteria) this;
}
public Criteria andTopNotIn(List<Integer> values) {
addCriterion("top not in", values, "top");
return (Criteria) this;
}
public Criteria andTopBetween(Integer value1, Integer value2) {
addCriterion("top between", value1, value2, "top");
return (Criteria) this;
}
public Criteria andTopNotBetween(Integer value1, Integer value2) {
addCriterion("top not between", value1, value2, "top");
return (Criteria) this;
}
public Criteria andFinishIsNull() {
addCriterion("finish is null");
return (Criteria) this;
}
public Criteria andFinishIsNotNull() {
addCriterion("finish is not null");
return (Criteria) this;
}
public Criteria andFinishEqualTo(Integer value) {
addCriterion("finish =", value, "finish");
return (Criteria) this;
}
public Criteria andFinishNotEqualTo(Integer value) {
addCriterion("finish <>", value, "finish");
return (Criteria) this;
}
public Criteria andFinishGreaterThan(Integer value) {
addCriterion("finish >", value, "finish");
return (Criteria) this;
}
public Criteria andFinishGreaterThanOrEqualTo(Integer value) {
addCriterion("finish >=", value, "finish");
return (Criteria) this;
}
public Criteria andFinishLessThan(Integer value) {
addCriterion("finish <", value, "finish");
return (Criteria) this;
}
public Criteria andFinishLessThanOrEqualTo(Integer value) {
addCriterion("finish <=", value, "finish");
return (Criteria) this;
}
public Criteria andFinishIn(List<Integer> values) {
addCriterion("finish in", values, "finish");
return (Criteria) this;
}
public Criteria andFinishNotIn(List<Integer> values) {
addCriterion("finish not in", values, "finish");
return (Criteria) this;
}
public Criteria andFinishBetween(Integer value1, Integer value2) {
addCriterion("finish between", value1, value2, "finish");
return (Criteria) this;
}
public Criteria andFinishNotBetween(Integer value1, Integer value2) {
addCriterion("finish not between", value1, value2, "finish");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(String value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(String value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(String value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(String value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(String value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(String value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLike(String value) {
addCriterion("type like", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotLike(String value) {
addCriterion("type not like", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<String> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(String value1, String value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(String value1, String value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andColorIsNull() {
addCriterion("color is null");
return (Criteria) this;
}
public Criteria andColorIsNotNull() {
addCriterion("color is not null");
return (Criteria) this;
}
public Criteria andColorEqualTo(String value) {
addCriterion("color =", value, "color");
return (Criteria) this;
}
public Criteria andColorNotEqualTo(String value) {
addCriterion("color <>", value, "color");
return (Criteria) this;
}
public Criteria andColorGreaterThan(String value) {
addCriterion("color >", value, "color");
return (Criteria) this;
}
public Criteria andColorGreaterThanOrEqualTo(String value) {
addCriterion("color >=", value, "color");
return (Criteria) this;
}
public Criteria andColorLessThan(String value) {
addCriterion("color <", value, "color");
return (Criteria) this;
}
public Criteria andColorLessThanOrEqualTo(String value) {
addCriterion("color <=", value, "color");
return (Criteria) this;
}
public Criteria andColorLike(String value) {
addCriterion("color like", value, "color");
return (Criteria) this;
}
public Criteria andColorNotLike(String value) {
addCriterion("color not like", value, "color");
return (Criteria) this;
}
public Criteria andColorIn(List<String> values) {
addCriterion("color in", values, "color");
return (Criteria) this;
}
public Criteria andColorNotIn(List<String> values) {
addCriterion("color not in", values, "color");
return (Criteria) this;
}
public Criteria andColorBetween(String value1, String value2) {
addCriterion("color between", value1, value2, "color");
return (Criteria) this;
}
public Criteria andColorNotBetween(String value1, String value2) {
addCriterion("color not between", value1, value2, "color");
return (Criteria) this;
}
public Criteria andFolderIdIsNull() {
addCriterion("folder_id is null");
return (Criteria) this;
}
public Criteria andFolderIdIsNotNull() {
addCriterion("folder_id is not null");
return (Criteria) this;
}
public Criteria andFolderIdEqualTo(Integer value) {
addCriterion("folder_id =", value, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdNotEqualTo(Integer value) {
addCriterion("folder_id <>", value, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdGreaterThan(Integer value) {
addCriterion("folder_id >", value, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdGreaterThanOrEqualTo(Integer value) {
addCriterion("folder_id >=", value, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdLessThan(Integer value) {
addCriterion("folder_id <", value, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdLessThanOrEqualTo(Integer value) {
addCriterion("folder_id <=", value, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdIn(List<Integer> values) {
addCriterion("folder_id in", values, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdNotIn(List<Integer> values) {
addCriterion("folder_id not in", values, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdBetween(Integer value1, Integer value2) {
addCriterion("folder_id between", value1, value2, "folderId");
return (Criteria) this;
}
public Criteria andFolderIdNotBetween(Integer value1, Integer value2) {
addCriterion("folder_id not between", value1, value2, "folderId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"954657344@qq.com"
] | 954657344@qq.com |
aeb79bba67130adc320aa2b7050cdd0d2a18a4c8 | ad3ccd97f33dfca06fb12ca3bd1fba62729b9b11 | /main/src/Logic/GameListener.java | 4162fa82f7685b8e9c40a06b32155fdfe1bb6c38 | [] | no_license | TalBarami/Reversi | 441d899d80a628fc8cdcd4fb31dbb5cd68c7dd4b | e648f122e17bbba8310ce8fffaecd34fa0c3408d | refs/heads/master | 2021-06-07T07:42:57.109530 | 2017-12-24T20:42:24 | 2017-12-24T20:42:24 | 59,599,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,256 | java | package Logic;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseListener;
/**
* Created by Tal on 24/05/2016.
*/
public class GameListener implements ActionListener, MouseListener {
public GameBoard gameBoard;
private int x;
private int y;
private JButton button;
public GameListener(GameBoard game, int x, int y, JButton button){
this.gameBoard = game;
this.x = x;
this.y = y;
this.button = button;
}
public void actionPerformed(ActionEvent e){
if(gameBoard.isValidMove(x, y))
gameBoard.playMove(x, y);
}
@Override
public void mouseClicked(java.awt.event.MouseEvent arg0) {}
@Override
public void mouseEntered(java.awt.event.MouseEvent arg0) {
if(gameBoard.isValidMove(x,y))
gameBoard.paintSequence(x, y, false);
}
@Override
public void mouseExited(java.awt.event.MouseEvent arg0) {
if(gameBoard.isValidMove(x,y))
gameBoard.paintSequence(x, y, true);
}
@Override
public void mousePressed(java.awt.event.MouseEvent arg0) {}
@Override
public void mouseReleased(java.awt.event.MouseEvent arg0) {}
}
| [
"talbaramii@gmail.com"
] | talbaramii@gmail.com |
2a27e662e2100ae4b5d9f8db927b7adcd934ed19 | 8058cb838e5d0c226774ae7fcd296c7fff6234c2 | /alibaba-sentinel-server/src/test/java/com/demo/alibaba/AlibabaSentinelServerApplicationTests.java | 696746f11edaa825719ffe6250ad419175097e0b | [] | no_license | lichangtong/spring-alibaba | 28b7eba984dcc7fdc66cea313b6ce962514d05f2 | b9ddc42068177db645194b412c5ddf4cfe1964ba | refs/heads/master | 2023-02-12T19:53:11.583875 | 2021-01-06T08:22:40 | 2021-01-06T08:22:40 | 288,068,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 232 | java | package com.demo.alibaba;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class AlibabaSentinelServerApplicationTests {
@Test
void contextLoads() {
}
}
| [
"18513781024@163.com"
] | 18513781024@163.com |
74b676ce7a9e04fc318b7dc53e466ae285e1dd1b | 4324852a7338c4ded0ca84e2178602cc9a461e12 | /src/main/java/inz/controller/OrderController.java | b569e525ff4b5718a6e905108b2423cc4f143bc8 | [
"Apache-2.0"
] | permissive | Shhad/rozproszone-bazki-rest | 11ffd65aebc5059f03d3796b47a7f45197ae8a88 | c2378a7ee019b95548cde16969ae9313828bb079 | refs/heads/master | 2022-11-30T18:40:23.057379 | 2019-12-05T08:52:23 | 2019-12-05T08:52:23 | 225,826,383 | 0 | 0 | Apache-2.0 | 2022-11-24T07:43:24 | 2019-12-04T09:17:02 | Java | UTF-8 | Java | false | false | 4,156 | java | package inz.controller;
import inz.model.Order;
import inz.model.OrderProducts;
import inz.repository.OrderProductsRepository;
import inz.repository.OrderRepository;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("api/favourite")
public class OrderController {
@Autowired
private OrderRepository favouriteRepository;
@Autowired
private OrderProductsRepository orderProductsRepository;
@Autowired
private OrderProductsRepository fpRepository;
@PostMapping("/add")
public ResponseEntity<?> addFavourite(@RequestBody Order order) {
JSONObject response = new JSONObject();
try {
order.setFavouriteId(new Integer((int)favouriteRepository.count() + 1));
favouriteRepository.saveAndFlush(order);
response.put("status", "ok");
return new ResponseEntity<String>(response.toJSONString(), HttpStatus.OK);
} catch(Exception e) {
response.put("status","failure");
response.put("msg", e.getMessage());
return new ResponseEntity<String>(response.toJSONString(), HttpStatus.OK);
}
}
@PostMapping("/add2")
public ResponseEntity<?> addFavouriteProduct(@RequestBody String body) {
JSONObject response = new JSONObject();
try {
JSONParser parser = new JSONParser();
JSONObject json = (JSONObject) parser.parse(body);
OrderProducts orderProducts = new OrderProducts();
orderProducts.setFavouriteId(new Integer(json.get("favouriteid").toString()));
orderProducts.setFavouriteId(new Integer(json.get("productid").toString()));
orderProducts.setId(new Integer((int) orderProductsRepository.count() + 1));
orderProductsRepository.saveAndFlush(orderProducts);
response.put("status", "ok");
return new ResponseEntity<String>(response.toJSONString(), HttpStatus.OK);
} catch(Exception e) {
response.put("status","failure");
response.put("msg", e.getMessage());
return new ResponseEntity<String>(response.toJSONString(), HttpStatus.OK);
}
}
@GetMapping("/favourites/{userid}")
public ResponseEntity<?> getUserFavourites(@PathVariable("userid") int userid) {
JSONObject response = new JSONObject();
try {
response.put("status", "ok");
response.put("data", favouriteRepository.getUserFavourites(userid));
return new ResponseEntity<String>(response.toJSONString(), HttpStatus.OK);
} catch(Exception e) {
response.put("status","failure");
response.put("msg", e.getMessage());
return new ResponseEntity<String>(response.toJSONString(), HttpStatus.OK);
}
}
@DeleteMapping("/delete/{favouriteid}/{productid}")
public ResponseEntity<?> deleteProductFromFavourite(@PathVariable("favouriteid") int favouriteid, @PathVariable("productid") int productid) {
JSONObject response = new JSONObject();
try {
orderProductsRepository.deleteProduct(productid, favouriteid);
response.put("status", "ok");
return new ResponseEntity<String>(response.toJSONString(), HttpStatus.OK);
} catch(Exception e) {
response.put("status","failure");
response.put("msg", e.getMessage());
return new ResponseEntity<String>(response.toJSONString(), HttpStatus.OK);
}
}
}
| [
"filip.baszak@nokia.com"
] | filip.baszak@nokia.com |
a1505330206193bcdd564567053af1f0774c0a85 | cd59aea73f9a73a798f75cb9d3345ed35f7caf78 | /src/cs3500/music/modelUpdated/MusicEditorModel.java | 02c49ad5234bcf547bc9fe0304faaa7cb55d577c | [] | no_license | ruisi-su/MusicEditor | 3f7c0ff04c9de1d2474cea250ae18e9df148400d | fd055b23bfb4023de1419a9fcb16fdbeb717eea3 | refs/heads/master | 2021-05-30T13:27:58.256617 | 2016-02-11T00:44:42 | 2016-02-11T00:44:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,577 | java | package cs3500.music.modelUpdated;
import java.io.IOException;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collection;
/**
* Created by alexgomez on 11/1/15.
*/
public interface MusicEditorModel {
/**
* Representing a Pitch
*/
enum Pitch {
C("C", 0), CSHARP("C#", 1), D("D", 2), DSHARP("D#", 3),
E("E", 4), F("F", 5),
FSHARP("F#", 6), G("G", 7),
GSHARP("G#", 8), A("A", 9), ASHARP("A#", 10), B("B", 11);
public String value;
public int order;
Pitch(String value, int order) {
this.value = value;
this.order = order;
}
}
/**
* Adds a unique note to the piece
*
* @param newNote the newNote you would like to add exists
* @return true if it adds, return false if it doesn't
*/
boolean addNote(ANote newNote);
/**
* @param editedNote the note you want to edit
* @param newPitch the new pitch for the note
* @param newOctave the new octave for the note
* @param newStart the new start for the note
* @param newDuration the new duration for the note
*/
void edit(ANote editedNote, Pitch newPitch, int newOctave, int newStart, int newDuration,
int newInstrument, int newVolume);
/**
* removes the note from the piece
*
* @param n the note you will remove
* @throws IllegalArgumentException this note cannot be found
*/
void remove(ANote n);
/**
* Find the notes playing at this time
*
* @param time at what time are we looking for the notes
* @return a collection of notes playing
*/
Collection<ANote> notesPlaying(int time);
/**
* @return the last beat where a note is played
*/
int getEnd();
/**
* Gets the tempo
*
* @return the tempo
*/
int getTempo();
/**
* Get the low note
*
* @param note high or low note?
* @param desiredOctave in which octave?
* @return the low note
*/
int getLowOrHighNote(String note, int desiredOctave);
/**
* @param maxOrMin is this a max or min
* @return the max or min octave
*/
int getMinOrMaxOctave(String maxOrMin);
/**
* Gets the lines
*
* @return the lines
*/
AbstractMap<Integer, ArrayList<ANote>> getLines();
/**
* prints the Notes in this octave
*/
void printNotes(int octave, int minNote, int maxNote, int time, Appendable output) throws
IOException;
/**
* increments the current beat it is on
*/
void increment();
/**
* Gives the current beat you are on
*
* @return the beat number
*/
int getBeat();
}
| [
"su.ruis@husky.neu.edu"
] | su.ruis@husky.neu.edu |
124eae0f98855f316148bb9b9c868fdda76ef057 | de26c0eba14a4e4e51638a52ae210dbd292c8161 | /hrTask/src/java/org/infotechdept/hr/task/model/AdcShiftMeals.java | 843d208530bbd8e1aafb377f1053c60c92878244 | [] | no_license | xuyanatsyxl/hrTask | 29bbcce1523fe58849537eed4526c96a257aa6db | ed383df4840e4367d6e4e4b0c925c1f2beb0332b | refs/heads/master | 2021-01-09T21:52:11.276029 | 2015-12-18T09:20:13 | 2015-12-18T09:20:13 | 46,342,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,437 | java | package org.infotechdept.hr.task.model;
import java.util.Date;
public class AdcShiftMeals {
private Long id;
private Date mealsDate;
private Long deptid;
private Long empid;
private String roomId;
private String mealsType;
private Integer mealsTimes;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getMealsDate() {
return mealsDate;
}
public void setMealsDate(Date mealsDate) {
this.mealsDate = mealsDate;
}
public Long getDeptid() {
return deptid;
}
public void setDeptid(Long deptid) {
this.deptid = deptid;
}
public Long getEmpid() {
return empid;
}
public void setEmpid(Long empid) {
this.empid = empid;
}
public String getRoomId() {
return roomId;
}
public void setRoomId(String roomId) {
this.roomId = roomId == null ? null : roomId.trim();
}
public String getMealsType() {
return mealsType;
}
public void setMealsType(String mealsType) {
this.mealsType = mealsType == null ? null : mealsType.trim();
}
public Integer getMealsTimes() {
return mealsTimes;
}
public void setMealsTimes(Integer mealsTimes) {
this.mealsTimes = mealsTimes;
}
} | [
"xuyan76@xinglonggroup.com"
] | xuyan76@xinglonggroup.com |
210632a71062568085ea9b02002275a7a9481771 | 1d4fc62d5785c761120a778777a7b92fea8f7f3b | /src/main/java/com/sogou/map/android/Voting.java | a67eade757b2a4a8185fb810241116560ec8195f | [] | no_license | liudave/FoodVoting | d583b27b252659673252d2c191c106067474ac34 | 75cd39d6c4870b776f881728ea031d2ea67be4c3 | refs/heads/master | 2021-01-20T16:54:30.233633 | 2016-08-04T09:17:14 | 2016-08-04T09:17:14 | 64,920,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,675 | java | package com.sogou.map.android;
import com.sogou.map.android.com.sogou.map.android.com.sogou.map.android.reponse.LoginInfo;
import com.sogou.map.android.com.sogou.map.android.com.sogou.map.android.reponse.RestaurantResultEntity;
import com.sogou.map.android.com.sogou.map.android.com.sogou.map.android.reponse.Upload;
import com.sogou.map.android.com.sogou.map.android.com.sogou.map.android.reponse.VotingResultEntity;
import com.sogou.map.android.com.sogou.map.android.model.Restaurant;
import com.sogou.map.android.com.sogou.map.android.model.User;
import com.sogou.map.android.com.sogou.map.android.util.NullUtils;
import com.sogou.map.android.com.sogou.map.android.util.RestaurantManager;
import com.sogou.map.android.com.sogou.map.android.util.UserManger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.MarkerManager;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* Created by liudawei on 2016/7/29.
*/
@Path("/vote")
public class Voting {
public static List<User> userList=new ArrayList<User>();
public static List<Restaurant> restaurantList=new ArrayList<Restaurant>();
private static final Logger logger = LogManager.getLogger(Voting.class.getName());
@GET
@Path("/login")
// @Produces(MediaType.APPLICATION_JSON+";"+MediaType.CHARSET_PARAMETER+"=utf-8")
@Produces(MediaType.APPLICATION_JSON)
public ResponseDTO login(@QueryParam("name") String name,@QueryParam("pass") String pass,@QueryParam("deveid") String deveid){
LoginInfo loginInfo=outhUser(name,pass);
ResponseDTO responseDTO;
if(loginInfo!=null){
responseDTO=new ResponseDTO(0,"你成功了!",loginInfo);
}else{
responseDTO=new ResponseDTO(1,"登录失败",loginInfo);
}
// return (new Gson()).toJson(responseDTO);
logger.debug(new MarkerManager.Log4jMarker("login"),"name="+name);
return responseDTO;
}
private LoginInfo outhUser(String name,String pwd){
LoginInfo loginInfo=null;
if(userList!=null&&userList.size()>0){
for (User user:userList) {
if(user.getName().equals(name)&&user.getPwd().equals(pwd)){
loginInfo=new LoginInfo();
loginInfo.setName(name);
loginInfo.setReal_name(user.getReal_name());
loginInfo.setId(user.getId());
break;
}
}
}
return loginInfo;
}
@GET
@Path("/uploadPicks")
@Produces(MediaType.APPLICATION_JSON+";"+MediaType.CHARSET_PARAMETER+"=utf-8")
public ResponseDTO uploadPicks(@QueryParam("name") String name,@QueryParam("dinner") String dinner,@QueryParam("launch") String launch,@QueryParam("deveid") String deveid){
logger.debug(new MarkerManager.Log4jMarker("uploadPicks"),"name="+name+";dinner="+dinner+";launch="+launch);
if(isValidUser(name)){
Upload upload=new Upload();
upload.setName(name);
ResponseDTO responseDTO=new ResponseDTO(0,"提交成功",upload);
String validDinnerToSave="";
String validLaunchToSave="";
if(!dinnerVotingForUser.containsKey(name)){
upatePickLst(dinnerVotingResult,dinner);
validDinnerToSave=dinner;
}
if(!launchVotingForUser.containsKey(name)){
upatePickLst(launchVotingResult,launch);
validLaunchToSave=launch;
}
saveUserVotingInfo(name,validLaunchToSave,validDinnerToSave);
if(NullUtils.isNull(validLaunchToSave)&&NullUtils.isNull(validDinnerToSave)){
return new ResponseDTO(2,"提交失败,重复提交",null);
}
return responseDTO;
}else{
return new ResponseDTO(1,"提交失败",null);
}
}
/**
* 累加本地的投票结果数据
* @param pickMap
* @param votings
*/
private void upatePickLst(HashMap<String,Integer> pickMap,String votings){
if(votings!=null){
String[] voteResults=votings.split(",");
for(int i=0;i<voteResults.length;i++){
if(pickMap.containsKey(voteResults[i])){
int voteNo= pickMap.get(voteResults[i]);
pickMap.put(voteResults[i],++voteNo);
}else{
pickMap.put(voteResults[i],1);
}
}
}
}
@GET
@Path("/getRestaurants")
@Produces(MediaType.APPLICATION_JSON)
public ResponseDTO getRestaurants(@QueryParam("name") String name,@QueryParam("deveid") String deveid){
logger.debug(new MarkerManager.Log4jMarker("getRestaurants"),"name="+name);
if(NullUtils.isNull(name)){
return new ResponseDTO(2,"缺少参数-name","");
}
if(!isValidUser(name)){
return new ResponseDTO(1,"获取餐厅列表失败","");
}
RestaurantResultEntity resultEntity=new RestaurantResultEntity();
resultEntity.setRestaurants(this.restaurantList);
if(restaurantList!=null){
return new ResponseDTO(0,"获取餐厅列表成功",resultEntity);
}
return new ResponseDTO(1,"获取餐厅列表失败",resultEntity);
}
@GET
@Path("/resume")
@Produces(MediaType.APPLICATION_JSON)
public ResponseDTO resumeVoting(@QueryParam("name") String name,@QueryParam("deveid") String deveid){
logger.debug(new MarkerManager.Log4jMarker("resume"),"name="+name);
if(NullUtils.isNull(name)){
return new ResponseDTO(2,"缺少参数-name","");
}
if(!isValidUser(name)){
return new ResponseDTO(1,"获取失败","");
}
doResume();
if(restaurantList!=null){
return new ResponseDTO(0,"重新投票设置完成",null);
}
return new ResponseDTO(1,"重新投票设置失败",null);
}
private void doResume(){
dinnerVotingResult.clear();
launchVotingResult.clear();
launchVotingForUser.clear();
dinnerVotingForUser.clear();
}
@GET
@Path("/getCurrentPicks")
@Produces(MediaType.APPLICATION_JSON+";"+MediaType.CHARSET_PARAMETER+"=utf-8")
public ResponseDTO getCurrentPicks(@QueryParam("name") String name,@QueryParam("deveid") String deveid){
logger.debug(new MarkerManager.Log4jMarker("getCurrentPicks"),"name="+name);
if(NullUtils.isNull(name)){
return new ResponseDTO(2,"缺少参数-name","");
}
if(!isValidUser(name)){
return new ResponseDTO(1,"获取失败","");
}
VotingResultEntity resultEntity=new VotingResultEntity();
resultEntity.setName(name);
List<VotingResultEntity.RestaurantVotingRes> dinnerVotingResLst=new ArrayList<VotingResultEntity.RestaurantVotingRes>();
List<VotingResultEntity.RestaurantVotingRes> launchVotingResLst=new ArrayList<VotingResultEntity.RestaurantVotingRes>();
for (Restaurant restaurant:restaurantList) {
VotingResultEntity.RestaurantVotingRes dinnerVotingRes=new VotingResultEntity.RestaurantVotingRes();
VotingResultEntity.RestaurantVotingRes launchVotingRes=new VotingResultEntity.RestaurantVotingRes();
dinnerVotingRes.setId(restaurant.getId());
dinnerVotingRes.setName(restaurant.getName());
launchVotingRes.setId(restaurant.getId());
launchVotingRes.setName(restaurant.getName());
if(dinnerVotingResult.containsKey(restaurant.getId())){
dinnerVotingRes.setVote_num(dinnerVotingResult.get(restaurant.getId()));
}
if(launchVotingResult.containsKey(restaurant.getId())){
launchVotingRes.setVote_num(launchVotingResult.get(restaurant.getId()));
}
dinnerVotingResLst.add(dinnerVotingRes);
launchVotingResLst.add(launchVotingRes);
}
resultEntity.setDinnerVotingRes(dinnerVotingResLst);
resultEntity.setLaunchVotingRes(launchVotingResLst);
ResponseDTO responseDTO=new ResponseDTO(0,"获取成功",resultEntity);
return responseDTO;
}
@GET
@Path("/reloadUser")
@Produces(MediaType.APPLICATION_JSON+";"+MediaType.CHARSET_PARAMETER+"=utf-8")
public ResponseDTO reloadUser(@QueryParam("name") String name,@QueryParam("deveid") String deveid){
if(NullUtils.isNull(name)){
return new ResponseDTO(2,"缺少参数-name","");
}
if(!isValidUser(name)){
return new ResponseDTO(1,"重新加载用户失败","");
}
Voting.userList= UserManger.getInstance().loadUserInfo();
doResume();
return new ResponseDTO(0,"重新加载用户成功","");
}
@GET
@Path("/reloadRestaurant")
@Produces(MediaType.APPLICATION_JSON+";"+MediaType.CHARSET_PARAMETER+"=utf-8")
public ResponseDTO reloadRestaurant(@QueryParam("name") String name,@QueryParam("deveid") String deveid){
if(!isValidUser(name)){
return new ResponseDTO(1,"操作失败","");
}
Voting.restaurantList= RestaurantManager.getInstance().loadRestaurantInfo();
doResume();
return new ResponseDTO(0,"重新加载餐厅成功","");
}
private static HashMap<String,Integer> dinnerVotingResult =new HashMap<String, Integer>();
private static HashMap<String,Integer> launchVotingResult=new HashMap<String, Integer>();
/**
* 是否是有效用户
* @return
*/
private boolean isValidUser(String name){
boolean ret=false;
if(userList.size()>0&&name!=null){
for (User user:userList) {
if(user.getName().equals(name)){
ret=true;
break;
}
}
}
return ret;
}
private static HashMap<String,String> dinnerVotingForUser =new HashMap<String, String>();
private static HashMap<String,String> launchVotingForUser=new HashMap<String, String>();
private void saveUserVotingInfo(String name,String launchVoting,String dinnerVoting){
if(launchVoting!=null&&!launchVoting.equals(""))
launchVotingForUser.put(name,launchVoting);
if(dinnerVoting!=null&&!dinnerVoting.equals(""))
dinnerVotingForUser.put(name,dinnerVoting);
}
}
| [
"liudawei@sogou-inc.com"
] | liudawei@sogou-inc.com |
d02cabed745a4ab10200c845d011a171b9e6c55f | e80b4403081d6fbd94a9272a3b6b309f9e94a147 | /app/src/main/java/org/tsofen/ourstory/UserModel/RegistrationPage2.java | 4ee3685ed9958b49ba5db21518abeaf140dc4a6e | [] | no_license | huda163/OurStory | c9235f6121321a04a66d71ab9dbd7cb8d661c906 | 63f645453661941a050bfe3d6c0fdbf1b547b160 | refs/heads/master | 2020-07-16T13:17:22.602142 | 2019-09-01T17:55:08 | 2019-09-01T17:55:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,765 | java | package org.tsofen.ourstory.UserModel;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.RadioButton;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.DialogFragment;
import com.example.ourstory.R;
public class RegistrationPage2 extends AppCompatActivity {
public String emailString;
public String firstNameString;
public String lastNameString;
public String passwordString;
public String stateString;
public String cityString;
public String dateOfBirth;
public String dateOfSignIn;
public String dateOfLastSignIn;
public String profilePicture;
public String gender;
//will be later used as date format.
// public Date dateOfBirth;
// public Date dateOfSignIn;
// public Date dateOfLastSignIn;
public EditText EditText6;
public EditText EditText7;
public EditText EditText8;
public EditText DateOfB;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration_page2);
Intent currIntent = getIntent();
emailString = currIntent.getStringExtra("email");
firstNameString = currIntent.getStringExtra("first_name");
lastNameString = currIntent.getStringExtra("last_name");
passwordString = currIntent.getStringExtra("password");
DateOfB=findViewById(R.id.showDate);
Log.d("log4", "values received from registrationPage1:"
+ emailString + " " + firstNameString + " "
+ lastNameString + " " + passwordString);
}
public void showDatePicker(View view) {
DialogFragment newFragment = new DatePickerFragment();
newFragment.show(getSupportFragmentManager(),"datePicker");
}
public void processDatePickerResult(int year, int month, int day) {
String month_string = Integer.toString(month+1);
String day_string = Integer.toString(day);
String year_string = Integer.toString(year);
String dateString = (month_string +
"/" + day_string + "/" + year_string);
dateOfBirth = dateString;
DateOfB.setText(dateOfBirth);
}
public void Go2RegistrationPage3andSave(View view) {
Intent regIntent3 = new Intent (this, LogIn.class);
EditText6 = (EditText)findViewById(R.id.showState);
EditText7 = (EditText)findViewById(R.id.showCity);
stateString = EditText6.getText().toString();
cityString = EditText7.getText().toString();
regIntent3.putExtra("email", emailString);
regIntent3.putExtra("first_name", firstNameString );
regIntent3.putExtra("last_name", lastNameString );
regIntent3.putExtra("password", passwordString);
regIntent3.putExtra("state", stateString);
regIntent3.putExtra("city", cityString );
regIntent3.putExtra("dateOfBirth", dateOfBirth );
regIntent3.putExtra("gender",gender);
Log.d("log-saved", "values sent to registrationPage3:"
+ emailString + " " + firstNameString + " "
+ lastNameString + " " + passwordString + " "
+ stateString + " " + cityString + " " + dateOfBirth+" "+gender);
startActivity(regIntent3);
}
public void Go2RegistrationPage3andDontSave(View view) {
Intent regIntent3 = new Intent (this, LogIn.class);
regIntent3.putExtra("email", emailString);
regIntent3.putExtra("first_name", firstNameString );
regIntent3.putExtra("last_name", lastNameString );
regIntent3.putExtra("password", passwordString);
Log.d("log-not saved", "values sent to registrationPage3:"
+ emailString + " " + firstNameString + " "
+ lastNameString + " " +passwordString + " ");
startActivity(regIntent3);
}
public void UploadPicture(View view) {
//still null
}
public void closeActivity(View view)
{
Intent back=new Intent(this,LogIn.class);
startActivity(back);
}
public void onRadioButtonClicked(View view) {
// Is the button now checked?
boolean checked = ((RadioButton) view).isChecked();
// Check which radio button was clicked.
switch (view.getId()) {
case R.id.MaleRB:
if (checked)
gender="Male";
break;
case R.id.FemaleRB:
if (checked)
gender="Female";
break;
default:
// Do nothing.
break;
}
}
}
| [
"halardr.ac97@gmail.com"
] | halardr.ac97@gmail.com |
3f1577294980849a35e701762159bfceed4d3520 | 260fd57608a85b564bb8bbb1e2b2f7efc9d91b5d | /pv-report/src/main/java/cn/medsci/pv/report/service/impl/IRolesServiceImpl.java | e5b75229d6cd267a69dd37d131498fe6ab635c6e | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | msnetc/pv | 25ebbb500d2cbe7854170dff2195531035c3e15a | 0e99bb6338b546a776cfad21570e7269c960fb7a | refs/heads/master | 2021-04-06T11:13:16.477010 | 2018-03-16T07:23:45 | 2018-03-16T07:23:45 | 125,312,872 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package cn.medsci.pv.report.service.impl;
import cn.medsci.pv.report.entity.Roles;
import cn.medsci.pv.report.mapper.RolesMapper;
import cn.medsci.pv.report.service.IRolesService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author wenhao.wang
* @since 2018-03-16
*/
@Service
public class IRolesServiceImpl extends ServiceImpl<RolesMapper, Roles> implements IRolesService {
}
| [
"msnetc@gmail.com"
] | msnetc@gmail.com |
fc0b077bbf5b9cd3583a02ddece08b54fc9aaf50 | 55413f8c3542bedf3fc2bb79bbf878e058663bac | /src/main/java/com/hackerrank/ClimbingTheLeaderboard.java | b72eaea7ee765e400bba32b5420ccedc5284e8ec | [
"MIT"
] | permissive | aucd29/algs-progfun | 73ca37a1fb63dca662b81224c81272238449e6e2 | a89b0d332a3d4a257618e9ae6c7f898cb1695246 | refs/heads/master | 2021-08-28T00:49:18.192680 | 2017-12-10T23:18:36 | 2017-12-10T23:18:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 809 | java | package com.hackerrank;
import java.util.Scanner;
import java.util.Stack;
public class ClimbingTheLeaderboard {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
Stack<Integer> stack = new Stack<>();
for (int i = 0; i < n; i++) {
int score = in.nextInt();
if (i == 0 || stack.peek() != score) {
stack.push(score);
}
}
int m = in.nextInt();
int[] alice = new int[m];
for (int i = 0; i < m; i++) {
alice[i] = in.nextInt();
while (!stack.empty() && stack.peek() <= alice[i]) {
stack.pop();
}
System.out.println(stack.isEmpty() ? "1" : stack.size() + 1);
}
}
}
| [
"karolina.rusin@gmail.com"
] | karolina.rusin@gmail.com |
16e25ec67f22ada62c8b3312bfb2e3abb04169ee | 3fa5d21853ee1ca88daef58b5e1f93c99b502743 | /src/main/java/Fruta.java | 979f78404eb86258566d5d9b3f2e9c7810cbc318 | [] | no_license | MiguelAngelderobles/TrabajoPNT | 2f5fa492e390c2c863f49da0b0dadabcff4426df | 70bd156c4709259b00a1af59e3f1f97a7bb4d79e | refs/heads/master | 2020-05-22T20:34:03.717914 | 2019-05-17T04:41:52 | 2019-05-17T04:41:52 | 186,508,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | public class Fruta extends Producto{
private Integer kilo;
public Fruta(String nombre, Integer precio, Integer kilo) {
super(nombre, precio);
this.kilo = kilo;
}
public Integer getKilo() {
return kilo;
}
}
| [
"miguel.angelderobles@hotmail.com"
] | miguel.angelderobles@hotmail.com |
183423f3315bdee3eddc4daf6aa5fb2af32bb254 | 41ae993d4698e3f692857f4b1107dcce87914014 | /app/src/main/java/com/example/ordersystem/AdminLookServerPwdDialog.java | 184145523fc7bdf3087d381a9675964942b17650 | [] | no_license | yushihai/OrderSystem | dbe64816eeb1d652b36b81783a48e3ba8baab2f1 | 19a0d1b0e971a608d8d12a1c29f0542dd7da88f7 | refs/heads/master | 2021-05-17T23:25:33.551155 | 2020-03-29T10:23:19 | 2020-03-29T10:23:19 | 250,999,718 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,980 | java | package com.example.ordersystem;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class AdminLookServerPwdDialog extends Dialog implements View.OnClickListener {
EditText lookserverpwd_account;
SQLiteDatabase db;
AdminLookServerPwdResultDialog adminLookServerPwdResultDialog;
public AdminLookServerPwdDialog(Context context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.admin_lookserverpwd_dialog);
setCanceledOnTouchOutside(false);
setCancelable(false);
db=PublicData.dbHelper.getWritableDatabase();
lookserverpwd_account=findViewById(R.id.lookserverpwd_account);
Button lookserverpwd_cancel=findViewById(R.id.lookserverpwd_cancel);
Button lookserverpwd_submit=findViewById(R.id.lookserverpwd_submit);
lookserverpwd_cancel.setOnClickListener(this);
lookserverpwd_submit.setOnClickListener(this);
}
protected void setAdminLookServerPwdResultDialog(AdminLookServerPwdResultDialog dialog){
adminLookServerPwdResultDialog=dialog;
}
@Override
public void onClick(View v){
switch (v.getId()){
case R.id.lookserverpwd_cancel:
dismiss();
break;
case R.id.lookserverpwd_submit:
if(TextUtils.isEmpty(lookserverpwd_account.getText()))
Toast.makeText(getContext(),"账号不能为空",Toast.LENGTH_SHORT).show();
else{
Cursor cursor=db.query("Server",null,"account=?",new String[]{lookserverpwd_account.getText().toString().trim()},null,null,null);
if(cursor.moveToFirst()) {
String account=cursor.getString(cursor.getColumnIndex("account"));
String pwd=cursor.getString(cursor.getColumnIndex("password"));
if(Build.VERSION.SDK_INT>=21)
adminLookServerPwdResultDialog.create();
adminLookServerPwdResultDialog.setAccount(account);
adminLookServerPwdResultDialog.setPwd(pwd);
adminLookServerPwdResultDialog.show();
dismiss();
}
else {
Toast.makeText(getContext(), "没有该服务员!", Toast.LENGTH_SHORT).show();
lookserverpwd_account.setText("");
}
}
break;
}
}
}
| [
"yushihai2020@163.com"
] | yushihai2020@163.com |
370a7f77e4746d955d743c6aef7d7cd80ed2e1b9 | c3a7fb2b30deb69c3d0935c6b1dfe822d7d19095 | /src/main/java/org/dstadler/jgit/api/ResolveRef.java | 026b2b240f38c0af9ba2ae4dcf930b13d8af74af | [
"Apache-2.0"
] | permissive | choffmeister/jgit-cookbook | 2c1e65dff94006a38daeef0b3410adf86248d9e1 | 182bb1cc6ca807d9065a29dd967bdf389809914b | refs/heads/master | 2023-08-30T12:45:33.501982 | 2014-09-11T19:55:47 | 2014-09-11T19:56:04 | 24,249,150 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,429 | java | package org.dstadler.jgit.api;
/*
Copyright 2013, 2014 Dominik Stadler
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.
*/
import java.io.IOException;
import org.dstadler.jgit.helper.CookbookHelper;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
/**
* Simple snippet which shows how to retrieve an ObjectId for some name.
*/
public class ResolveRef {
public static void main(String[] args) throws IOException {
Repository repository = CookbookHelper.openJGitCookbookRepository();
// basic syntax is similar to getRef()
ObjectId id = repository.resolve("HEAD");
System.out.println("ObjectId of HEAD: " + id);
// however resolve() supports almost all of the git-syntax, where getRef() only works on names
id = repository.resolve("HEAD^1");
System.out.println("ObjectId of HEAD: " + id);
repository.close();
}
}
| [
"dominik.stadler@gmx.at"
] | dominik.stadler@gmx.at |
0a98d6a1a0c31e200225dd5d9514671916e1b41c | e96b0019599c7d410a896a20b006a07648172622 | /src/main/java/com/iqmsoft/mongo/solr/controller/SpringMongoSolrController.java | 06ffee11a7050a772cb2c99c8d181f1782a1b8a7 | [] | no_license | Murugar/SpringBootMongoSolr | a94aedd83ceb0a1074db173c2a001f1a658dccac | 820c0366f3bca75bec427468b678b0b0173a4a98 | refs/heads/master | 2021-01-22T05:24:05.506251 | 2017-02-11T14:17:02 | 2017-02-11T14:17:02 | 81,657,194 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,748 | java | package com.iqmsoft.mongo.solr.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.iqmsoft.mongo.solr.mongo.model.TestDocument;
import com.iqmsoft.mongo.solr.service.TestDocumentService;
import com.iqmsoft.mongo.solr.solr.model.TestSolrDocument;
@RestController
@SuppressWarnings("all")
public class SpringMongoSolrController {
@Autowired
private TestDocumentService testDocumentService;
@RequestMapping(
path = "createDocument",
method = RequestMethod.POST,
consumes = {"application/x-www-form-urlencoded;charset=UTF-8"},
produces = "application/json;charset=UTF-8")
@ResponseBody
public TestSolrDocument createDocument(TestDocument document) {
return testDocumentService.saveMongoAndIndex(document);
}
@RequestMapping(path = "clearAll", method = RequestMethod.GET)
public String clearAll() {
testDocumentService.clear();
return "Clear All Success!";
}
@RequestMapping(path = "indexMongo", method = RequestMethod.GET)
public String indexMongo() {
testDocumentService.indexMongo();
return "Index Mongo Success!";
}
@RequestMapping(path = "createDocument", method = RequestMethod.GET)
public ModelAndView newDocument() {
ModelAndView view = new ModelAndView("/createDocumentForm");
view.addObject(new TestDocument());
return view;
}
}
| [
"davanon2014@gmail.com"
] | davanon2014@gmail.com |
3cb7eca25f219b8ac2971d6d0b790f37e7f45c01 | 67c17ceb882006cf46ee1b8dd3598bfdaa1bd113 | /jagathkalyani/src/Interfaceprograms/Example7.java | c229bf22e7ea75337fcf879cc5cd4d1743911f52 | [] | no_license | TechieFrogs-Warriors/JavaBasics | f235205bcbe557d89409bf6cb74bae1c5279ebcd | 79a83f8db96fc9f57da872a0571497df4551d01b | refs/heads/main | 2023-05-04T15:43:41.130753 | 2021-05-17T07:41:45 | 2021-05-17T07:41:45 | 321,665,844 | 1 | 0 | null | 2020-12-16T04:43:34 | 2020-12-15T12:47:49 | null | UTF-8 | Java | false | false | 438 | java | package Interfaceprograms;
public class Example7 {
}
interface A{
public void x();
}
interface B{
public int x();
}
class C implements A,B{
public void x(){ //error--------two interfaces have same method name with diff return types
}
public int x(){
}
public static void main(String[] args) {
// System.out.println(x);
System.out.println(A.x);
System.out.println(B.x);
}
| [
"jkalyaniee@gmail.com"
] | jkalyaniee@gmail.com |
ea5d904f1d5f2aa961f12b23b8e193a8f9b21157 | dd0d56024cda671b04035062bc8203d3e851860c | /app/src/main/java/com/egova/eagleyes/adapter/PersonSearchAdapter.java | d67833f78f47c6960fd4d4b2c10a35d3295abe80 | [] | no_license | leegle/Eagleyes | 987b9870ba7d387754e7700cf7f79bb471614e37 | bf698047eb6ea5e540f598490d73d0a12773a204 | refs/heads/master | 2020-12-04T01:30:16.959662 | 2019-04-12T09:17:16 | 2019-04-12T09:17:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 991 | java | package com.egova.eagleyes.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.egova.eagleyes.R;
import com.egova.eagleyes.model.respose.PersonInfo;
import java.util.List;
import androidx.annotation.Nullable;
public class PersonSearchAdapter extends BaseQuickAdapter<PersonInfo, BaseViewHolder> {
public PersonSearchAdapter(int layoutResId, @Nullable List<PersonInfo> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, PersonInfo item) {
int position = helper.getLayoutPosition();
if (position == 0 || !mData.get(position - 1).getFirstLetter().equals(item.getFirstLetter())) {
helper.setText(R.id.letter, item.getFirstLetter());
helper.setVisible(R.id.letter, true);
} else {
helper.setVisible(R.id.letter, false);
}
helper.setText(R.id.name, item.getName());
}
}
| [
"843453966@qq.com"
] | 843453966@qq.com |
c3fb4dfba8c18031b6dfac0365a886fa51ef2050 | ab6dcb8a454e2d9748d605ea6f83d438f94a17c8 | /app/src/main/java/com/example/edut/qrscanner/LocationListActivity.java | 394cc6e59d66f02cc2640bdf144aad3b84488ed8 | [] | no_license | omeredut/FindLocation | 63b8d1ef6543480a2070ce4e353ed1e410655772 | 1c359e0339828bb1a3efdb4b17b3bdb706de490f | refs/heads/master | 2021-01-25T05:56:27.427736 | 2017-02-02T08:57:42 | 2017-02-02T08:57:42 | 80,705,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,662 | java | package com.example.edut.qrscanner;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.DragEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import static com.example.edut.qrscanner.MainActivity.HIGHT_INDEX;
import static com.example.edut.qrscanner.MainActivity.SAVED;
import static com.example.edut.qrscanner.MainActivity.SHOW_LOCATION;
import static com.example.edut.qrscanner.MainActivity.TYPE;
import static com.example.edut.qrscanner.MainActivity.sharedPreferencesLocations;
public class LocationListActivity extends Activity {
public static final String NULL = "NULL";
private String[] locationsList;
private String location;
ListView listViewLocations;
ArrayAdapter listAdapter;
int index;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_location_list);
index = sharedPreferencesLocations.getInt(HIGHT_INDEX, 0);
listViewLocations = (ListView) findViewById(R.id.list_view_locations);
locationsList = new String[index];
for (int i = 0; i < index; i++) {
location = sharedPreferencesLocations.getString(String.valueOf(i), NULL);
locationsList[i] = location;
}
listAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, locationsList);
listViewLocations.setAdapter(listAdapter);
listViewLocations.setOnItemClickListener(showLocation);
listViewLocations.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(LocationListActivity.this, "long item click", Toast.LENGTH_SHORT).show();
//TODO: option to remove location
return false;
}
});
}
AdapterView.OnItemClickListener showLocation = new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intentShowSaveLocation = new Intent(LocationListActivity.this, MapsActivity.class);
String savedLocation = locationsList[position];
intentShowSaveLocation.putExtra(TYPE, SAVED);
intentShowSaveLocation.putExtra(SHOW_LOCATION, savedLocation);
startActivity(intentShowSaveLocation);
}
};
}
| [
"omeredut@gmail.com"
] | omeredut@gmail.com |
1874fd303aa1d6b7de7a3424a84fcccd217ef928 | a1e92f98a7cc7294467edc8c79bd9f9f1c197350 | /Bet Parsing Software/Client + GUI/Kelembets/src/client/interfaces/Manager.java | 746f31dc7c55fa1432710dbb223ae0e16c852395 | [] | no_license | vkaliteevsky/Bet-Parsing-Software | 9bb36fc23324dc74e11f4d7f9f65ac0121dc9401 | b02228da503aaf0d1b95cabf8119ab52e5e37158 | refs/heads/master | 2020-08-01T00:57:59.688118 | 2019-09-25T09:26:44 | 2019-09-25T09:26:44 | 210,806,796 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | java | package client.interfaces;
import client.enums.YieldType;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.SortedSet;
import java.util.function.Function;
/**
* Manages work process. Works with storages, filters
*/
public interface Manager {
/**
* @return Array of currently applied filters
*/
SortedSet<Fork> getFilteredForks();
/**
* @return Array of forks with filters applied
*/
Set<Fork> getAllForks();
/**
* Setting all filters.
* @param allFilters
*/
void setFilters(List<Filter<Object[]>> allFilters);
/**
* Resetting all filters.
*/
void resetFilters();
/**
* Place a fork to done forks storage.
*/
void markForkAsDone(Fork fork);
/**
* Hides given fork.
* @param fork
*/
void hideFork(Fork fork);
/**
* Hides given match.
* @param firstTeam
* @param secondTeam
* @param date
*/
void hideMatch(String firstTeam, String secondTeam, Date date);
/**
* Restores all hidden forks.
*/
void restoreHiddenForks();
/**
* @param yieldType
* @return functions which corresponds to the given yield type
*/
Function<Fork, Double> getYieldFunction(YieldType yieldType);
/**
* @param fork
* @return file name with one fork stored.
*/
String storeForkInFile(Fork fork);
/**
* Removes all forks from storage.
*/
void clearForksStorage();
}
| [
"vkalit@gmail.com"
] | vkalit@gmail.com |
3f1c35a5e2d4ca99d4cface2b02d65c908d843a6 | 554a5dd12e6157b729d4da4f6b53a133319e4b4b | /iHappy/src/com/xiaohan/ihappy/helpers/lastfm/ItemFactory.java | ba841892bec3916c0b8d3233bccd54ea46e391a0 | [] | no_license | 2014-1/001 | 166728a516973258f736192a46235643d9504031 | abe2e94a9b66c3760240628b86d840ef2dfb1e1d | refs/heads/master | 2020-05-25T12:22:43.365771 | 2014-06-09T13:24:49 | 2014-06-09T13:24:49 | 16,660,737 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,094 | java | /*
* Copyright (c) 2012, the Last.fm Java Project and Committers
* All rights reserved.
*
* Redistribution and use of this software in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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.xiaohan.ihappy.helpers.lastfm;
import com.xiaohan.ihappy.helpers.DomElement;
/**
* An <code>ItemFactory</code> can be used to instantiate a value object - such as Artist, Album, Track, Tag - from an XML element. Use the
* {@link ItemFactoryBuilder} to obtain item factories for a specific type.
*
* @author Janni Kovacs
* @see com.xiaohan.ihappy.helpers.lastfm.ItemFactoryBuilder
* @see ResponseBuilder
*/
interface ItemFactory<T> {
/**
* Create a new instance of the type <code>T</code>, based on the passed {@link DomElement}.
*
* @param element the XML element
* @return a new object
*/
public T createItemFromElement(DomElement element);
}
| [
"username@email.com"
] | username@email.com |
77db8eb90cc0be8bccf0ae487afc168b529d23a7 | 033d4ab75541e23e2829417f9e3c681e9cbf8678 | /Lab1.7/src/my/test/Main.java | 3fef400319e5eb32ad51468333f93495d2f2929b | [] | no_license | dezmond-necros/JavaLabs | 1abcf37122e6dcd3bd48e5ac25fd3cf9db219bb5 | 37323f7a5fd870919e0aee96541e028f818fb921 | refs/heads/master | 2023-02-12T13:48:08.545768 | 2021-01-10T14:11:22 | 2021-01-10T14:11:22 | 304,716,418 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,063 | java | package my.test;
import java.io.Console;
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("введи код города: ");
int num = in.nextInt();
double time = 10;
switch (num)
{
case 905:
System.out.printf("Москва, стоимость разговора: %s \n",time*4.15);
break;
case 194:
System.out.printf("Ростов, стоимость разговора: %s \n",time*1.98);
break;
case 491:
System.out.printf("Краснодар, стоимость разговора: %s \n",time*2.69);
break;
case 800:
System.out.printf("Киров, стоимость разговора: %s \n",time*5.00);
break;
default:
System.out.println("неверный код города");
}
}
}
| [
"dezmondn6666@gmail.com"
] | dezmondn6666@gmail.com |
dd298d80fc7667e071a7b040ebeac36230c360a7 | 38a49a2882cfc942ffcf1dbbd4d241bc264e193d | /src/etc/Dependencies.java | aac4edb63c1753397f1322bdcc3b9eed50e32916 | [
"MIT"
] | permissive | mccccopley/java-boggle-solver-etc | 0778c674aaeea2a8498f7943510a006c6bb87775 | e6c84ef469db96d66d6fb5a458bc7436eedac7d2 | refs/heads/master | 2021-01-11T14:50:51.372075 | 2017-02-07T20:44:54 | 2017-02-07T20:44:54 | 80,231,773 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,711 | java | package etc;
/**
* Created by mccccopley on 1/19/2017.
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
public class Dependencies {
public static class Dependency {
int id;
int dependsOnId;
public Dependency(int id, int dependsOnId) {
this.id = id;
this.dependsOnId = dependsOnId;
}
}
public static List<Integer> GetDependencyOrder(int[] ids, Dependency[] dependencies) {
HashMap<Integer, List<Integer>> dependents = new HashMap<>();
HashMap<Integer, Integer> dependencyCounts = new HashMap<>();
LinkedList<Integer> order = new LinkedList<>();
for (int id : ids) {
dependencyCounts.put(id, 0);
dependents.put(id, new LinkedList<>());
}
for (Dependency dependency : dependencies) {
dependencyCounts.put(dependency.id, dependencyCounts.get(dependency.id) + 1);
dependents.get(dependency.dependsOnId).add(dependency.id);
}
while (order.size() < ids.length) {
boolean wereIdsAdded = false;
for (int id : dependencyCounts.keySet()) {
if (dependencyCounts.get(id) == 0) {
wereIdsAdded = true;
order.add(id);
dependencyCounts.put(id, -1);
for (int dependent : dependents.get(id)) {
dependencyCounts.put(dependent, dependencyCounts.get(dependent) - 1);
}
}
}
if (!wereIdsAdded) {
return null;
}
}
return order;
}
}
| [
"mccccopley@gmail.com"
] | mccccopley@gmail.com |
c7745d76b4d5afbac0eb67a03d2deb68600db989 | 8054d4f937961027e936ca8cc9cb30236ab93009 | /src/main/java/com/umanizales/apibatallanaval/model/dto/CoordenadaDTO.java | 7ef1d75634580cf084686c9afac234bae5695cc2 | [] | no_license | CatalinaGomezJ/ApiBatallaNaval | 74f526efb8c4fb217aa58c1e28c4d70b3bbd32ba | 2735ba5c10b12a1d5a89cf84cb0306d97eaa36bd | refs/heads/master | 2023-05-09T23:53:47.752545 | 2021-06-03T19:16:06 | 2021-06-03T19:16:06 | 371,487,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package com.umanizales.apibatallanaval.model.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Getter
@Setter
@AllArgsConstructor
public class CoordenadaDTO implements Serializable {
private int x;
private int y;
private boolean estado;
}
| [
"catalinagj_08@hotmail.com"
] | catalinagj_08@hotmail.com |
7ce34813bed6dff763634cec3d9d9a8ae5cd6f1f | 9699d8b4db7d88ffea9e67c23b8fe9c3918c5d20 | /Lab/untitled/src/Main.java | d05fe5edc3caeb38a1422f8795d39de2c19f0f55 | [] | no_license | suiyschn/9331-19T2 | b32e452df9466c41337f3b684832ceeaf85a0137 | 29b97942aa30b713d8821ba51a71fd70775d8ab5 | refs/heads/master | 2020-07-08T16:57:34.108748 | 2019-08-23T07:19:11 | 2019-08-23T07:19:11 | 203,727,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,085 | java | import java.util.*;
import java.lang.*;
public class Main {
/** 主方法 */
public static void main(String[] args) {
String q = "originally designed for computer clusters built from commodity hardware it has also found use on clusters of higher end hardware. hadoop is a part of apache foundation.";
System.out.println(Arrays.toString(ngrams(q, 2)));
}
/** 返回两个整数变量较大的值 */
public static String[] ngrams(String s, int len) {
String[] parts = s.split(" ");
String[] result = new String[parts.length - len + 1];
for(int i = 0; i < parts.length - len + 1; i++) {
StringBuilder sb = new StringBuilder();
int k = 0;
do {
if(k > 0) sb.append(' ');
sb.append(parts[i+k]);
k++;
}while (k < len);
result[i] = sb.toString();
}
return result;
}
}
// for(int k = 0; k < len; k++) {
// if(k > 0) sb.append(' ');
// sb.append(parts[i+k]);
| [
"suiyschn@gmail.com"
] | suiyschn@gmail.com |
2a72cb772edf97fb8be6f6a379b7a2842bcb1f29 | 498dd2daff74247c83a698135e4fe728de93585a | /clients/google-api-services-bigquery/v2/1.29.2/com/google/api/services/bigquery/model/JobConfigurationLoad.java | 1ec059aecf7e93a3f983edfc5792c9f26af58770 | [
"Apache-2.0"
] | permissive | googleapis/google-api-java-client-services | 0e2d474988d9b692c2404d444c248ea57b1f453d | eb359dd2ad555431c5bc7deaeafca11af08eee43 | refs/heads/main | 2023-08-23T00:17:30.601626 | 2023-08-20T02:16:12 | 2023-08-20T02:16:12 | 147,399,159 | 545 | 390 | Apache-2.0 | 2023-09-14T02:14:14 | 2018-09-04T19:11:33 | null | UTF-8 | Java | false | false | 39,550 | java | /*
* 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.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.bigquery.model;
/**
* Model definition for JobConfigurationLoad.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the BigQuery API. For a detailed explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class JobConfigurationLoad extends com.google.api.client.json.GenericJson {
/**
* [Optional] Accept rows that are missing trailing optional columns. The missing values are
* treated as nulls. If false, records with missing trailing columns are treated as bad records,
* and if there are too many bad records, an invalid error is returned in the job result. The
* default value is false. Only applicable to CSV, ignored for other formats.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean allowJaggedRows;
/**
* Indicates if BigQuery should allow quoted data sections that contain newline characters in a
* CSV file. The default value is false.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean allowQuotedNewlines;
/**
* [Optional] Indicates if we should automatically infer the options and schema for CSV and JSON
* sources.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean autodetect;
/**
* [Beta] Clustering specification for the destination table. Must be specified with time-based
* partitioning, data in the table will be first partitioned and subsequently clustered.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private Clustering clustering;
/**
* [Optional] Specifies whether the job is allowed to create new tables. The following values are
* supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table.
* CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in
* the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions
* occur as one atomic update upon job completion.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String createDisposition;
/**
* Custom encryption configuration (e.g., Cloud KMS keys).
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private EncryptionConfiguration destinationEncryptionConfiguration;
/**
* [Required] The destination table to load the data into.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private TableReference destinationTable;
/**
* [Beta] [Optional] Properties with which to create the destination table if it is new.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private DestinationTableProperties destinationTableProperties;
/**
* [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1.
* The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split
* using the values of the quote and fieldDelimiter properties.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String encoding;
/**
* [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-
* byte character. To use a character in the range 128-255, you must encode the character as UTF8.
* BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the
* encoded string to split the data in its raw, binary state. BigQuery also supports the escape
* sequence "\t" to specify a tab separator. The default value is a comma (',').
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String fieldDelimiter;
/**
* [Optional, Trusted Tester] Deprecated, do not use. Please set hivePartitioningOptions instead.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String hivePartitioningMode;
/**
* [Optional, Trusted Tester] Options to configure hive partitioning support.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private HivePartitioningOptions hivePartitioningOptions;
/**
* [Optional] Indicates if BigQuery should allow extra values that are not represented in the
* table schema. If true, the extra values are ignored. If false, records with extra columns are
* treated as bad records, and if there are too many bad records, an invalid error is returned in
* the job result. The default value is false. The sourceFormat property determines what BigQuery
* treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column
* names
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean ignoreUnknownValues;
/**
* [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If
* the number of bad records exceeds this value, an invalid error is returned in the job result.
* This is only valid for CSV and JSON. The default value is 0, which requires that all records
* are valid.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer maxBadRecords;
/**
* [Optional] Specifies a string that represents a null value in a CSV file. For example, if you
* specify "\N", BigQuery interprets "\N" as a null value when loading a CSV file. The default
* value is the empty string. If you set this property to a custom value, BigQuery throws an error
* if an empty string is present for all data types except for STRING and BYTE. For STRING and
* BYTE columns, BigQuery interprets the empty string as an empty value.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String nullMarker;
/**
* If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into
* BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level
* properties. If no properties are specified, BigQuery loads all properties. If any named
* property isn't found in the Cloud Datastore backup, an invalid error is returned in the job
* result.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List<java.lang.String> projectionFields;
/**
* [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the
* string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the
* data in its raw, binary state. The default value is a double-quote ('"'). If your data does not
* contain quoted sections, set the property value to an empty string. If your data contains
* quoted newline characters, you must also set the allowQuotedNewlines property to true.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String quote;
/**
* [TrustedTester] Range partitioning specification for this table. Only one of timePartitioning
* and rangePartitioning should be specified.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private RangePartitioning rangePartitioning;
/**
* [Optional] The schema for the destination table. The schema can be omitted if the destination
* table already exists, or if you're loading data from Google Cloud Datastore.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private TableSchema schema;
/**
* [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For
* example, "foo:STRING, bar:INTEGER, baz:FLOAT".
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String schemaInline;
/**
* [Deprecated] The format of the schemaInline property.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String schemaInlineFormat;
/**
* Allows the schema of the destination table to be updated as a side effect of the load job if a
* schema is autodetected or supplied in the job configuration. Schema update options are
* supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is
* WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition
* decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of
* the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the
* schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to
* nullable.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List<java.lang.String> schemaUpdateOptions;
/**
* [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the
* data. The default value is 0. This property is useful if you have header rows in the file that
* should be skipped.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer skipLeadingRows;
/**
* [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups,
* specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For
* Avro, specify "AVRO". For parquet, specify "PARQUET". For orc, specify "ORC". The default value
* is CSV.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String sourceFormat;
/**
* [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud
* Storage URIs: Each URI can contain one '*' wildcard character and it must come after the
* 'bucket' name. Size limits related to load jobs apply to external data sources. For Google
* Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid
* HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly one
* URI can be specified. Also, the '*' wildcard character is not allowed.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List<java.lang.String> sourceUris;
/**
* Time-based partitioning specification for the destination table. Only one of timePartitioning
* and rangePartitioning should be specified.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private TimePartitioning timePartitioning;
/**
* [Optional] If sourceFormat is set to "AVRO", indicates whether to enable interpreting logical
* types into their corresponding types (ie. TIMESTAMP), instead of only using their raw types
* (ie. INTEGER).
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean useAvroLogicalTypes;
/**
* [Optional] Specifies the action that occurs if the destination table already exists. The
* following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery
* overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data
* to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error
* is returned in the job result. The default value is WRITE_APPEND. Each action is atomic and
* only occurs if BigQuery is able to complete the job successfully. Creation, truncation and
* append actions occur as one atomic update upon job completion.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String writeDisposition;
/**
* [Optional] Accept rows that are missing trailing optional columns. The missing values are
* treated as nulls. If false, records with missing trailing columns are treated as bad records,
* and if there are too many bad records, an invalid error is returned in the job result. The
* default value is false. Only applicable to CSV, ignored for other formats.
* @return value or {@code null} for none
*/
public java.lang.Boolean getAllowJaggedRows() {
return allowJaggedRows;
}
/**
* [Optional] Accept rows that are missing trailing optional columns. The missing values are
* treated as nulls. If false, records with missing trailing columns are treated as bad records,
* and if there are too many bad records, an invalid error is returned in the job result. The
* default value is false. Only applicable to CSV, ignored for other formats.
* @param allowJaggedRows allowJaggedRows or {@code null} for none
*/
public JobConfigurationLoad setAllowJaggedRows(java.lang.Boolean allowJaggedRows) {
this.allowJaggedRows = allowJaggedRows;
return this;
}
/**
* Indicates if BigQuery should allow quoted data sections that contain newline characters in a
* CSV file. The default value is false.
* @return value or {@code null} for none
*/
public java.lang.Boolean getAllowQuotedNewlines() {
return allowQuotedNewlines;
}
/**
* Indicates if BigQuery should allow quoted data sections that contain newline characters in a
* CSV file. The default value is false.
* @param allowQuotedNewlines allowQuotedNewlines or {@code null} for none
*/
public JobConfigurationLoad setAllowQuotedNewlines(java.lang.Boolean allowQuotedNewlines) {
this.allowQuotedNewlines = allowQuotedNewlines;
return this;
}
/**
* [Optional] Indicates if we should automatically infer the options and schema for CSV and JSON
* sources.
* @return value or {@code null} for none
*/
public java.lang.Boolean getAutodetect() {
return autodetect;
}
/**
* [Optional] Indicates if we should automatically infer the options and schema for CSV and JSON
* sources.
* @param autodetect autodetect or {@code null} for none
*/
public JobConfigurationLoad setAutodetect(java.lang.Boolean autodetect) {
this.autodetect = autodetect;
return this;
}
/**
* [Beta] Clustering specification for the destination table. Must be specified with time-based
* partitioning, data in the table will be first partitioned and subsequently clustered.
* @return value or {@code null} for none
*/
public Clustering getClustering() {
return clustering;
}
/**
* [Beta] Clustering specification for the destination table. Must be specified with time-based
* partitioning, data in the table will be first partitioned and subsequently clustered.
* @param clustering clustering or {@code null} for none
*/
public JobConfigurationLoad setClustering(Clustering clustering) {
this.clustering = clustering;
return this;
}
/**
* [Optional] Specifies whether the job is allowed to create new tables. The following values are
* supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table.
* CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in
* the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions
* occur as one atomic update upon job completion.
* @return value or {@code null} for none
*/
public java.lang.String getCreateDisposition() {
return createDisposition;
}
/**
* [Optional] Specifies whether the job is allowed to create new tables. The following values are
* supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table.
* CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in
* the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions
* occur as one atomic update upon job completion.
* @param createDisposition createDisposition or {@code null} for none
*/
public JobConfigurationLoad setCreateDisposition(java.lang.String createDisposition) {
this.createDisposition = createDisposition;
return this;
}
/**
* Custom encryption configuration (e.g., Cloud KMS keys).
* @return value or {@code null} for none
*/
public EncryptionConfiguration getDestinationEncryptionConfiguration() {
return destinationEncryptionConfiguration;
}
/**
* Custom encryption configuration (e.g., Cloud KMS keys).
* @param destinationEncryptionConfiguration destinationEncryptionConfiguration or {@code null} for none
*/
public JobConfigurationLoad setDestinationEncryptionConfiguration(EncryptionConfiguration destinationEncryptionConfiguration) {
this.destinationEncryptionConfiguration = destinationEncryptionConfiguration;
return this;
}
/**
* [Required] The destination table to load the data into.
* @return value or {@code null} for none
*/
public TableReference getDestinationTable() {
return destinationTable;
}
/**
* [Required] The destination table to load the data into.
* @param destinationTable destinationTable or {@code null} for none
*/
public JobConfigurationLoad setDestinationTable(TableReference destinationTable) {
this.destinationTable = destinationTable;
return this;
}
/**
* [Beta] [Optional] Properties with which to create the destination table if it is new.
* @return value or {@code null} for none
*/
public DestinationTableProperties getDestinationTableProperties() {
return destinationTableProperties;
}
/**
* [Beta] [Optional] Properties with which to create the destination table if it is new.
* @param destinationTableProperties destinationTableProperties or {@code null} for none
*/
public JobConfigurationLoad setDestinationTableProperties(DestinationTableProperties destinationTableProperties) {
this.destinationTableProperties = destinationTableProperties;
return this;
}
/**
* [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1.
* The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split
* using the values of the quote and fieldDelimiter properties.
* @return value or {@code null} for none
*/
public java.lang.String getEncoding() {
return encoding;
}
/**
* [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1.
* The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split
* using the values of the quote and fieldDelimiter properties.
* @param encoding encoding or {@code null} for none
*/
public JobConfigurationLoad setEncoding(java.lang.String encoding) {
this.encoding = encoding;
return this;
}
/**
* [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-
* byte character. To use a character in the range 128-255, you must encode the character as UTF8.
* BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the
* encoded string to split the data in its raw, binary state. BigQuery also supports the escape
* sequence "\t" to specify a tab separator. The default value is a comma (',').
* @return value or {@code null} for none
*/
public java.lang.String getFieldDelimiter() {
return fieldDelimiter;
}
/**
* [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-
* byte character. To use a character in the range 128-255, you must encode the character as UTF8.
* BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the
* encoded string to split the data in its raw, binary state. BigQuery also supports the escape
* sequence "\t" to specify a tab separator. The default value is a comma (',').
* @param fieldDelimiter fieldDelimiter or {@code null} for none
*/
public JobConfigurationLoad setFieldDelimiter(java.lang.String fieldDelimiter) {
this.fieldDelimiter = fieldDelimiter;
return this;
}
/**
* [Optional, Trusted Tester] Deprecated, do not use. Please set hivePartitioningOptions instead.
* @return value or {@code null} for none
*/
public java.lang.String getHivePartitioningMode() {
return hivePartitioningMode;
}
/**
* [Optional, Trusted Tester] Deprecated, do not use. Please set hivePartitioningOptions instead.
* @param hivePartitioningMode hivePartitioningMode or {@code null} for none
*/
public JobConfigurationLoad setHivePartitioningMode(java.lang.String hivePartitioningMode) {
this.hivePartitioningMode = hivePartitioningMode;
return this;
}
/**
* [Optional, Trusted Tester] Options to configure hive partitioning support.
* @return value or {@code null} for none
*/
public HivePartitioningOptions getHivePartitioningOptions() {
return hivePartitioningOptions;
}
/**
* [Optional, Trusted Tester] Options to configure hive partitioning support.
* @param hivePartitioningOptions hivePartitioningOptions or {@code null} for none
*/
public JobConfigurationLoad setHivePartitioningOptions(HivePartitioningOptions hivePartitioningOptions) {
this.hivePartitioningOptions = hivePartitioningOptions;
return this;
}
/**
* [Optional] Indicates if BigQuery should allow extra values that are not represented in the
* table schema. If true, the extra values are ignored. If false, records with extra columns are
* treated as bad records, and if there are too many bad records, an invalid error is returned in
* the job result. The default value is false. The sourceFormat property determines what BigQuery
* treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column
* names
* @return value or {@code null} for none
*/
public java.lang.Boolean getIgnoreUnknownValues() {
return ignoreUnknownValues;
}
/**
* [Optional] Indicates if BigQuery should allow extra values that are not represented in the
* table schema. If true, the extra values are ignored. If false, records with extra columns are
* treated as bad records, and if there are too many bad records, an invalid error is returned in
* the job result. The default value is false. The sourceFormat property determines what BigQuery
* treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column
* names
* @param ignoreUnknownValues ignoreUnknownValues or {@code null} for none
*/
public JobConfigurationLoad setIgnoreUnknownValues(java.lang.Boolean ignoreUnknownValues) {
this.ignoreUnknownValues = ignoreUnknownValues;
return this;
}
/**
* [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If
* the number of bad records exceeds this value, an invalid error is returned in the job result.
* This is only valid for CSV and JSON. The default value is 0, which requires that all records
* are valid.
* @return value or {@code null} for none
*/
public java.lang.Integer getMaxBadRecords() {
return maxBadRecords;
}
/**
* [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If
* the number of bad records exceeds this value, an invalid error is returned in the job result.
* This is only valid for CSV and JSON. The default value is 0, which requires that all records
* are valid.
* @param maxBadRecords maxBadRecords or {@code null} for none
*/
public JobConfigurationLoad setMaxBadRecords(java.lang.Integer maxBadRecords) {
this.maxBadRecords = maxBadRecords;
return this;
}
/**
* [Optional] Specifies a string that represents a null value in a CSV file. For example, if you
* specify "\N", BigQuery interprets "\N" as a null value when loading a CSV file. The default
* value is the empty string. If you set this property to a custom value, BigQuery throws an error
* if an empty string is present for all data types except for STRING and BYTE. For STRING and
* BYTE columns, BigQuery interprets the empty string as an empty value.
* @return value or {@code null} for none
*/
public java.lang.String getNullMarker() {
return nullMarker;
}
/**
* [Optional] Specifies a string that represents a null value in a CSV file. For example, if you
* specify "\N", BigQuery interprets "\N" as a null value when loading a CSV file. The default
* value is the empty string. If you set this property to a custom value, BigQuery throws an error
* if an empty string is present for all data types except for STRING and BYTE. For STRING and
* BYTE columns, BigQuery interprets the empty string as an empty value.
* @param nullMarker nullMarker or {@code null} for none
*/
public JobConfigurationLoad setNullMarker(java.lang.String nullMarker) {
this.nullMarker = nullMarker;
return this;
}
/**
* If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into
* BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level
* properties. If no properties are specified, BigQuery loads all properties. If any named
* property isn't found in the Cloud Datastore backup, an invalid error is returned in the job
* result.
* @return value or {@code null} for none
*/
public java.util.List<java.lang.String> getProjectionFields() {
return projectionFields;
}
/**
* If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into
* BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level
* properties. If no properties are specified, BigQuery loads all properties. If any named
* property isn't found in the Cloud Datastore backup, an invalid error is returned in the job
* result.
* @param projectionFields projectionFields or {@code null} for none
*/
public JobConfigurationLoad setProjectionFields(java.util.List<java.lang.String> projectionFields) {
this.projectionFields = projectionFields;
return this;
}
/**
* [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the
* string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the
* data in its raw, binary state. The default value is a double-quote ('"'). If your data does not
* contain quoted sections, set the property value to an empty string. If your data contains
* quoted newline characters, you must also set the allowQuotedNewlines property to true.
* @return value or {@code null} for none
*/
public java.lang.String getQuote() {
return quote;
}
/**
* [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the
* string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the
* data in its raw, binary state. The default value is a double-quote ('"'). If your data does not
* contain quoted sections, set the property value to an empty string. If your data contains
* quoted newline characters, you must also set the allowQuotedNewlines property to true.
* @param quote quote or {@code null} for none
*/
public JobConfigurationLoad setQuote(java.lang.String quote) {
this.quote = quote;
return this;
}
/**
* [TrustedTester] Range partitioning specification for this table. Only one of timePartitioning
* and rangePartitioning should be specified.
* @return value or {@code null} for none
*/
public RangePartitioning getRangePartitioning() {
return rangePartitioning;
}
/**
* [TrustedTester] Range partitioning specification for this table. Only one of timePartitioning
* and rangePartitioning should be specified.
* @param rangePartitioning rangePartitioning or {@code null} for none
*/
public JobConfigurationLoad setRangePartitioning(RangePartitioning rangePartitioning) {
this.rangePartitioning = rangePartitioning;
return this;
}
/**
* [Optional] The schema for the destination table. The schema can be omitted if the destination
* table already exists, or if you're loading data from Google Cloud Datastore.
* @return value or {@code null} for none
*/
public TableSchema getSchema() {
return schema;
}
/**
* [Optional] The schema for the destination table. The schema can be omitted if the destination
* table already exists, or if you're loading data from Google Cloud Datastore.
* @param schema schema or {@code null} for none
*/
public JobConfigurationLoad setSchema(TableSchema schema) {
this.schema = schema;
return this;
}
/**
* [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For
* example, "foo:STRING, bar:INTEGER, baz:FLOAT".
* @return value or {@code null} for none
*/
public java.lang.String getSchemaInline() {
return schemaInline;
}
/**
* [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For
* example, "foo:STRING, bar:INTEGER, baz:FLOAT".
* @param schemaInline schemaInline or {@code null} for none
*/
public JobConfigurationLoad setSchemaInline(java.lang.String schemaInline) {
this.schemaInline = schemaInline;
return this;
}
/**
* [Deprecated] The format of the schemaInline property.
* @return value or {@code null} for none
*/
public java.lang.String getSchemaInlineFormat() {
return schemaInlineFormat;
}
/**
* [Deprecated] The format of the schemaInline property.
* @param schemaInlineFormat schemaInlineFormat or {@code null} for none
*/
public JobConfigurationLoad setSchemaInlineFormat(java.lang.String schemaInlineFormat) {
this.schemaInlineFormat = schemaInlineFormat;
return this;
}
/**
* Allows the schema of the destination table to be updated as a side effect of the load job if a
* schema is autodetected or supplied in the job configuration. Schema update options are
* supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is
* WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition
* decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of
* the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the
* schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to
* nullable.
* @return value or {@code null} for none
*/
public java.util.List<java.lang.String> getSchemaUpdateOptions() {
return schemaUpdateOptions;
}
/**
* Allows the schema of the destination table to be updated as a side effect of the load job if a
* schema is autodetected or supplied in the job configuration. Schema update options are
* supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is
* WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition
* decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of
* the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the
* schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to
* nullable.
* @param schemaUpdateOptions schemaUpdateOptions or {@code null} for none
*/
public JobConfigurationLoad setSchemaUpdateOptions(java.util.List<java.lang.String> schemaUpdateOptions) {
this.schemaUpdateOptions = schemaUpdateOptions;
return this;
}
/**
* [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the
* data. The default value is 0. This property is useful if you have header rows in the file that
* should be skipped.
* @return value or {@code null} for none
*/
public java.lang.Integer getSkipLeadingRows() {
return skipLeadingRows;
}
/**
* [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the
* data. The default value is 0. This property is useful if you have header rows in the file that
* should be skipped.
* @param skipLeadingRows skipLeadingRows or {@code null} for none
*/
public JobConfigurationLoad setSkipLeadingRows(java.lang.Integer skipLeadingRows) {
this.skipLeadingRows = skipLeadingRows;
return this;
}
/**
* [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups,
* specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For
* Avro, specify "AVRO". For parquet, specify "PARQUET". For orc, specify "ORC". The default value
* is CSV.
* @return value or {@code null} for none
*/
public java.lang.String getSourceFormat() {
return sourceFormat;
}
/**
* [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups,
* specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For
* Avro, specify "AVRO". For parquet, specify "PARQUET". For orc, specify "ORC". The default value
* is CSV.
* @param sourceFormat sourceFormat or {@code null} for none
*/
public JobConfigurationLoad setSourceFormat(java.lang.String sourceFormat) {
this.sourceFormat = sourceFormat;
return this;
}
/**
* [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud
* Storage URIs: Each URI can contain one '*' wildcard character and it must come after the
* 'bucket' name. Size limits related to load jobs apply to external data sources. For Google
* Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid
* HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly one
* URI can be specified. Also, the '*' wildcard character is not allowed.
* @return value or {@code null} for none
*/
public java.util.List<java.lang.String> getSourceUris() {
return sourceUris;
}
/**
* [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud
* Storage URIs: Each URI can contain one '*' wildcard character and it must come after the
* 'bucket' name. Size limits related to load jobs apply to external data sources. For Google
* Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid
* HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly one
* URI can be specified. Also, the '*' wildcard character is not allowed.
* @param sourceUris sourceUris or {@code null} for none
*/
public JobConfigurationLoad setSourceUris(java.util.List<java.lang.String> sourceUris) {
this.sourceUris = sourceUris;
return this;
}
/**
* Time-based partitioning specification for the destination table. Only one of timePartitioning
* and rangePartitioning should be specified.
* @return value or {@code null} for none
*/
public TimePartitioning getTimePartitioning() {
return timePartitioning;
}
/**
* Time-based partitioning specification for the destination table. Only one of timePartitioning
* and rangePartitioning should be specified.
* @param timePartitioning timePartitioning or {@code null} for none
*/
public JobConfigurationLoad setTimePartitioning(TimePartitioning timePartitioning) {
this.timePartitioning = timePartitioning;
return this;
}
/**
* [Optional] If sourceFormat is set to "AVRO", indicates whether to enable interpreting logical
* types into their corresponding types (ie. TIMESTAMP), instead of only using their raw types
* (ie. INTEGER).
* @return value or {@code null} for none
*/
public java.lang.Boolean getUseAvroLogicalTypes() {
return useAvroLogicalTypes;
}
/**
* [Optional] If sourceFormat is set to "AVRO", indicates whether to enable interpreting logical
* types into their corresponding types (ie. TIMESTAMP), instead of only using their raw types
* (ie. INTEGER).
* @param useAvroLogicalTypes useAvroLogicalTypes or {@code null} for none
*/
public JobConfigurationLoad setUseAvroLogicalTypes(java.lang.Boolean useAvroLogicalTypes) {
this.useAvroLogicalTypes = useAvroLogicalTypes;
return this;
}
/**
* [Optional] Specifies the action that occurs if the destination table already exists. The
* following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery
* overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data
* to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error
* is returned in the job result. The default value is WRITE_APPEND. Each action is atomic and
* only occurs if BigQuery is able to complete the job successfully. Creation, truncation and
* append actions occur as one atomic update upon job completion.
* @return value or {@code null} for none
*/
public java.lang.String getWriteDisposition() {
return writeDisposition;
}
/**
* [Optional] Specifies the action that occurs if the destination table already exists. The
* following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery
* overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data
* to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error
* is returned in the job result. The default value is WRITE_APPEND. Each action is atomic and
* only occurs if BigQuery is able to complete the job successfully. Creation, truncation and
* append actions occur as one atomic update upon job completion.
* @param writeDisposition writeDisposition or {@code null} for none
*/
public JobConfigurationLoad setWriteDisposition(java.lang.String writeDisposition) {
this.writeDisposition = writeDisposition;
return this;
}
@Override
public JobConfigurationLoad set(String fieldName, Object value) {
return (JobConfigurationLoad) super.set(fieldName, value);
}
@Override
public JobConfigurationLoad clone() {
return (JobConfigurationLoad) super.clone();
}
}
| [
"chingor@google.com"
] | chingor@google.com |
604b6d8068e39d33d729b62c14dc77419ba7b331 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/30/30_8e2477a6e9856d62263da1432e585b212e08a56f/SupplierService/30_8e2477a6e9856d62263da1432e585b212e08a56f_SupplierService_t.java | f377868c83185495966e731653c94716e8e0a1f2 | [] | 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 | 835 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package aic2010.services;
import aic2010.exception.UnknownProductException;
import aic2010.model.Product;
import java.math.BigDecimal;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
/**
*
* @author rudolf
*/
@WebService(targetNamespace="http://infosys.tuwien.ac.at/aic10/ass1/dto/supplier")
@SOAPBinding(style=SOAPBinding.Style.RPC, parameterStyle=SOAPBinding.ParameterStyle.BARE)
public interface SupplierService {
@WebMethod(operationName="order")
public BigDecimal order(@WebParam(name="product") Product product,
@WebParam(name="amount")Integer amount)
throws UnknownProductException;
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
ae473fd06862cd8138489eef17cf43feeac3704c | f5d00e89ec62c2b65b2398158f0889efe2c2a548 | /cloud-client/src/main/java/cn/phukety/cloudclient/controller/HelloController.java | 5e99c52ceb024d92076f5ff6f7083cf8594a1a1e | [] | no_license | Phukety/spring-cloud-modules | 190c9badda70ae85dea1588e26d8e98053d75786 | e57eb5ee4ce54cef46813df8d16de7b6c7f18382 | refs/heads/main | 2023-02-08T08:43:59.447206 | 2021-01-04T11:36:50 | 2021-01-04T11:36:50 | 313,338,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | package cn.phukety.cloudclient.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@RestController
public class HelloController {
@Resource
private DiscoveryClient client;
@GetMapping(value = "/hello")
public String hello() {
List<String> services = client.getServices();
services.forEach(System.out::println);
return "this is cloud client";
}
}
| [
"1252615137@qq.com"
] | 1252615137@qq.com |
731d7437595107399cfda150aa2e5e58f09e4848 | 33a10e9a3ab2b489dc982e0cba6756395cc00aef | /Calc.java | ba0e3d4ed14133b55df6e63095107102ea2d248c | [] | no_license | DevilDarkSider/Calc_WTL | 44d4103845e3ae2087f9edcb5c3fd942467553d9 | cd2c47e9ac75f07551e079befb3add3c93df7140 | refs/heads/master | 2021-01-25T11:27:20.423772 | 2018-03-02T05:21:12 | 2018-03-02T05:21:12 | 123,397,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 116 | java | public class Calc {
public static void main(String [] args) {
System.out.println("Calc on WTL");
}
} | [
"senkivarsen@gmail.com"
] | senkivarsen@gmail.com |
29c5fac6b81307b1a615290131401ab834108a41 | 08deccdb56475ccb2d0a4992be99e236c9a22264 | /hongbao-api-web/src/main/java/com/yanbao/vo/HotGoodsVo.java | 31d91c0850f8717bd1a3d8dad8d76d794833bd36 | [] | no_license | dream-home/hongbao | 92a70099c236855b32aebe3b252192c782e93c87 | a660cc02ba0fd218b7c3a171ad4a217edfd4713d | refs/heads/master | 2021-07-05T12:29:06.735635 | 2017-09-28T04:02:52 | 2017-09-28T04:02:52 | 105,000,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,361 | java | package com.yanbao.vo;
import com.yanbao.core.model.SimpleModel;
/**
* 商品表
*
* @date 2016年3月28日
*/
public class HotGoodsVo extends SimpleModel {
private static final long serialVersionUID = 6468123345520931799L;
/** 商品分类ID */
private String goodsSortId;
/** 商铺Id */
private String storeId;
/** 商铺名称 */
private String storeName;
/** 名称 */
private String name;
/** 图片 */
private String icon;
/** 商品价格 */
private Double price;
/** 竞拍价 */
private Double drawPrice;
/** 参与竞拍人数 */
private Integer drawNum;
/** 商品介绍 */
private String detail;
/** 商品类型:0:系统发布:1:商家发布 */
private Integer goodsType;
/** 库存 */
private Integer stock;
/** 当前期数编号 */
private Integer curIssueNo;
/** 当前期数Id */
private String curIssueId;
/** 是否置顶:0:否,1:是 */
private Integer isTop;
/** 是否推荐:0:否;1:是 */
private Integer isRecommend;
/** 是否委托出售:0:否,1:是 */
private Integer saleSwitch;
/** 一级分销比例 */
private Double firstReferrerScale = 0d;
/** 二级分销比例 */
private Double secondReferrerScale = 0d;
/** 三级分销比例 */
private Double thirdReferrerScale = 0d;
/** 商家赠送Ep */
private Double businessSendEp = 0d;
/** 分类名称 **/
private String goodsSortName;
public String getGoodsSortName() {
return goodsSortName;
}
public void setGoodsSortName(String goodsSortName) {
this.goodsSortName = goodsSortName;
}
public String getGoodsSortId() {
return goodsSortId;
}
public void setGoodsSortId(String goodsSortId) {
this.goodsSortId = goodsSortId;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public Double getDrawPrice() {
return drawPrice;
}
public void setDrawPrice(Double drawPrice) {
this.drawPrice = drawPrice;
}
public Integer getDrawNum() {
return drawNum;
}
public void setDrawNum(Integer drawNum) {
this.drawNum = drawNum;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public Integer getGoodsType() {
return goodsType;
}
public void setGoodsType(Integer goodsType) {
this.goodsType = goodsType;
}
public Integer getStock() {
return stock;
}
public void setStock(Integer stock) {
this.stock = stock;
}
public Integer getCurIssueNo() {
return curIssueNo;
}
public void setCurIssueNo(Integer curIssueNo) {
this.curIssueNo = curIssueNo;
}
public String getCurIssueId() {
return curIssueId;
}
public void setCurIssueId(String curIssueId) {
this.curIssueId = curIssueId;
}
public Integer getIsTop() {
return isTop;
}
public void setIsTop(Integer isTop) {
this.isTop = isTop;
}
public Integer getIsRecommend() {
return isRecommend;
}
public void setIsRecommend(Integer isRecommend) {
this.isRecommend = isRecommend;
}
public Integer getSaleSwitch() {
return saleSwitch;
}
public void setSaleSwitch(Integer saleSwitch) {
this.saleSwitch = saleSwitch;
}
public Double getFirstReferrerScale() {
return firstReferrerScale;
}
public void setFirstReferrerScale(Double firstReferrerScale) {
this.firstReferrerScale = firstReferrerScale;
}
public Double getSecondReferrerScale() {
return secondReferrerScale;
}
public void setSecondReferrerScale(Double secondReferrerScale) {
this.secondReferrerScale = secondReferrerScale;
}
public Double getThirdReferrerScale() {
return thirdReferrerScale;
}
public void setThirdReferrerScale(Double thirdReferrerScale) {
this.thirdReferrerScale = thirdReferrerScale;
}
public Double getBusinessSendEp() {
return businessSendEp;
}
public void setBusinessSendEp(Double businessSendEp) {
this.businessSendEp = businessSendEp;
}
}
| [
"1510331524@qq.com"
] | 1510331524@qq.com |
80aa84e398310dfac670525e80ef4718e3e7f9d3 | b063ab697bf63613df10fa19dadb48bc0dbce2fd | /src/main/java/com/github/ejahns/WebElementFunction.java | aa7b9d89e602f067e0b584a373cd959773f64205 | [] | no_license | ejahns/selenium-stateful | 10bd68463265d3680d111b171458f671293b4604 | 1efbf3cc90da945759df698659f4d8db2b5ed92b | refs/heads/master | 2021-01-19T22:55:42.813957 | 2017-06-05T22:09:50 | 2017-06-05T22:09:50 | 88,894,449 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package com.github.ejahns;
import java.io.Serializable;
import java.util.function.Function;
import org.openqa.selenium.WebElement;
public abstract class WebElementFunction implements Function<WebElement, Serializable> {
}
| [
"ejahns@digitalmeasures.com"
] | ejahns@digitalmeasures.com |
fb1ba2e98b2765e4e53092542040d26419acc79c | abf4be5b577249d52ba0f9cfe8aa9cb338221aff | /gen/com/handmark/pulltorefresh/library/R.java | 5127e7497bcbbc1b731357eef94a4aa3d45c750b | [] | no_license | bjzhou/DirectMsg | 295944758a947db6bcd1da39e63cd01598e94367 | 09628e48a68553bc99e173821615de51d040000d | refs/heads/master | 2020-06-26T09:01:30.318034 | 2013-03-21T01:10:56 | 2013-03-21T01:10:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,613 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.handmark.pulltorefresh.library;
public final class R {
public static final class id {
public static final int pullFromStart = 0x7f050001;
public static final int pull_to_refresh_progress = 0x7f050018;
public static final int rotate = 0x7f050007;
public static final int both = 0x7f050003;
public static final int webview = 0x7f05000a;
public static final int pull_to_refresh_text = 0x7f050019;
public static final int pullDownFromTop = 0x7f050005;
public static final int gridview = 0x7f050009;
public static final int pullUpFromBottom = 0x7f050006;
public static final int scrollview = 0x7f05000b;
public static final int pullFromEnd = 0x7f050002;
public static final int pull_to_refresh_image = 0x7f050017;
public static final int fl_inner = 0x7f050016;
public static final int pull_to_refresh_sub_text = 0x7f05001a;
public static final int disabled = 0x7f050000;
public static final int flip = 0x7f050008;
public static final int manualOnly = 0x7f050004;
}
public static final class anim {
public static final int slide_out_to_bottom = 0x7f040003;
public static final int slide_out_to_top = 0x7f040004;
public static final int slide_in_from_bottom = 0x7f040001;
public static final int slide_in_from_top = 0x7f040002;
}
public static final class string {
public static final int pull_to_refresh_refreshing_label = 0x7f070002;
public static final int pull_to_refresh_release_label = 0x7f070001;
public static final int pull_to_refresh_from_bottom_pull_label = 0x7f070003;
public static final int pull_to_refresh_from_bottom_refreshing_label = 0x7f070005;
public static final int pull_to_refresh_pull_label = 0x7f070000;
public static final int pull_to_refresh_from_bottom_release_label = 0x7f070004;
}
public static final class layout {
public static final int pull_to_refresh_header_horizontal = 0x7f030006;
public static final int pull_to_refresh_header_vertical = 0x7f030007;
}
public static final class styleable {
public static final int PullToRefresh_ptrDrawableStart = 7;
public static final int PullToRefresh_ptrShowIndicator = 5;
public static final int[] PullToRefresh = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012 };
public static final int PullToRefresh_ptrHeaderTextAppearance = 10;
public static final int PullToRefresh_ptrRefreshableViewBackground = 0;
public static final int PullToRefresh_ptrAnimationStyle = 12;
public static final int PullToRefresh_ptrScrollingWhileRefreshingEnabled = 13;
public static final int PullToRefresh_ptrAdapterViewBackground = 16;
public static final int PullToRefresh_ptrMode = 4;
public static final int PullToRefresh_ptrHeaderTextColor = 2;
public static final int PullToRefresh_ptrListViewExtrasEnabled = 14;
public static final int PullToRefresh_ptrDrawableBottom = 18;
public static final int PullToRefresh_ptrHeaderBackground = 1;
public static final int PullToRefresh_ptrDrawableTop = 17;
public static final int PullToRefresh_ptrOverScroll = 9;
public static final int PullToRefresh_ptrDrawableEnd = 8;
public static final int PullToRefresh_ptrRotateDrawableWhilePulling = 15;
public static final int PullToRefresh_ptrSubHeaderTextAppearance = 11;
public static final int PullToRefresh_ptrDrawable = 6;
public static final int PullToRefresh_ptrHeaderSubTextColor = 3;
}
public static final class drawable {
public static final int indicator_bg_top = 0x7f020008;
public static final int default_ptr_flip = 0x7f020000;
public static final int indicator_arrow = 0x7f020006;
public static final int indicator_bg_bottom = 0x7f020007;
public static final int default_ptr_rotate = 0x7f020001;
}
public static final class attr {
public static final int ptrHeaderBackground = 0x7f010001;
public static final int ptrMode = 0x7f010004;
public static final int ptrScrollingWhileRefreshingEnabled = 0x7f01000d;
public static final int ptrAdapterViewBackground = 0x7f010010;
public static final int ptrRotateDrawableWhilePulling = 0x7f01000f;
public static final int ptrDrawableStart = 0x7f010007;
public static final int ptrSubHeaderTextAppearance = 0x7f01000b;
public static final int ptrAnimationStyle = 0x7f01000c;
public static final int ptrDrawableEnd = 0x7f010008;
public static final int ptrShowIndicator = 0x7f010005;
public static final int ptrDrawableTop = 0x7f010011;
public static final int ptrDrawable = 0x7f010006;
public static final int ptrHeaderTextAppearance = 0x7f01000a;
public static final int ptrDrawableBottom = 0x7f010012;
public static final int ptrHeaderSubTextColor = 0x7f010003;
public static final int ptrListViewExtrasEnabled = 0x7f01000e;
public static final int ptrOverScroll = 0x7f010009;
public static final int ptrHeaderTextColor = 0x7f010002;
public static final int ptrRefreshableViewBackground = 0x7f010000;
}
public static final class dimen {
public static final int indicator_right_padding = 0x7f060000;
public static final int indicator_corner_radius = 0x7f060001;
public static final int indicator_internal_padding = 0x7f060002;
public static final int header_footer_top_bottom_padding = 0x7f060004;
public static final int header_footer_left_right_padding = 0x7f060003;
}
}
| [
"zbj543720@gmail.com"
] | zbj543720@gmail.com |
45cc44c77e3ead13b74a4e60919f8defc338d642 | 005a019cfef75e6bef358c10e93a3ea5e3407a43 | /app/src/main/java/software/doit/boxio/model/data/User.java | 1552a4a248d18f28290532d746712663225e1d21 | [] | no_license | RAZER-KIEV/Box_io | 91a40faea609c3ea324fb387aaa205eeaed4df8a | b0aaa10815dee407eb94e1a1d166df634bfeac83 | refs/heads/master | 2020-03-28T09:36:28.951130 | 2019-12-20T15:07:23 | 2019-12-20T15:07:23 | 148,045,947 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,787 | java | package software.doit.boxio.model.data;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;
@Entity
public class User {
@NonNull
@PrimaryKey
private String email;
private long timeStamp;
private String name, password, userInfo;
public User(long timestamp, @NonNull String email, String name, String password, String userInfo) {
this.timeStamp = timestamp;
this.email = email;
this.name = name;
this.password = password;
this.userInfo = userInfo;
}
public User() {
}
public void setTimestamp(long timestamp) {
this.timeStamp = timestamp;
}
public long getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(long timeStamp) {
this.timeStamp = timeStamp;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUserInfo() {
return userInfo;
}
public void setUserInfo(String userInfo) {
this.userInfo = userInfo;
}
@Override
public String toString() {
return "User{" +
"timestamp=" + timeStamp +
", email='" + email + '\'' +
", name='" + name + '\'' +
", password='" + password + '\'' +
", userInfo='" + userInfo + '\'' +
'}';
}
}
| [
"sdlan-razer@ukr.net"
] | sdlan-razer@ukr.net |
1b435d2c2dd5e93f0702b7ef21fdcf27d8ed12fa | bfb8198e6554bbc21694ce83745f0915a3d6de07 | /src/main/java/com/lhf/mango/entity/Article.java | af68643a220be016a23676149ab5b2f082409ac7 | [] | no_license | JavaCodeMood/mango-example1 | 4207ec4f9c1b6ddd42f64e8ae394c08139b6ed59 | 01401e52cf8454c94bbb2c4898048b8695f93da6 | refs/heads/master | 2020-04-24T15:06:19.698996 | 2019-02-22T11:10:12 | 2019-02-22T11:10:12 | 172,051,856 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,395 | java | package com.lhf.mango.entity;
import org.jfaster.mango.annotation.ID;
import java.util.Date;
/**
* @ClassName: Article
* @Desc: 文章实体
* @Author: liuhefei
* @Date: 2018/12/20 19:26
*/
public class Article {
@ID
private Integer id;
private String title;
private String content;
private String author;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return "Article{" +
"id=" + id +
", title='" + title + '\'' +
", content='" + content + '\'' +
", author='" + author + '\'' +
", updateTime=" + updateTime +
'}';
}
}
| [
"2510736432@qq.com"
] | 2510736432@qq.com |
54aa59167c42b231db82004ec0151c674e323f98 | 4bd826b3689838c924a366bde078dc2088216a2e | /src/main/java/com/angelchanquin/pharmacrm/config/WebConfigurer.java | 190bb8b7f86531c3e366797889e7f5c1a399f1e2 | [] | no_license | p-jacobo2012240/PharmaCRM | ec79a1da916b79ee9f1517c78926a3e6b6b3382a | 78a716f4a2380fc12da26ebe3fd7e86f92186d3d | refs/heads/master | 2020-09-03T23:42:41.669947 | 2018-01-28T19:08:38 | 2018-01-29T00:54:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,720 | java | package com.angelchanquin.pharmacrm.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.github.jhipster.web.filter.CachingHttpHeadersFilter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.servlet.InstrumentedFilter;
import com.codahale.metrics.servlets.MetricsServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.*;
import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory;
import io.undertow.UndertowOptions;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.http.MediaType;
import java.io.File;
import java.nio.file.Paths;
import java.util.*;
import javax.servlet.*;
/**
* Configuration of web application with Servlet 3.0 APIs.
*/
@Configuration
public class WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer {
private final Logger log = LoggerFactory.getLogger(WebConfigurer.class);
private final Environment env;
private final JHipsterProperties jHipsterProperties;
private MetricRegistry metricRegistry;
public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) {
this.env = env;
this.jHipsterProperties = jHipsterProperties;
}
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
if (env.getActiveProfiles().length != 0) {
log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles());
}
EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC);
initMetrics(servletContext, disps);
if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) {
initCachingHttpHeadersFilter(servletContext, disps);
}
if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
initH2Console(servletContext);
}
log.info("Web application fully configured");
}
/**
* Customize the Servlet engine: Mime types, the document root, the cache.
*/
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
// IE issue, see https://github.com/jhipster/generator-jhipster/pull/711
mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=utf-8");
// CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64
mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=utf-8");
container.setMimeMappings(mappings);
// When running in an IDE or with ./gradlew bootRun, set location of the static web assets.
setLocationForStaticAssets(container);
/*
* Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288
* HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1.
* See the JHipsterProperties class and your application-*.yml configuration files
* for more information.
*/
if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) &&
container instanceof UndertowEmbeddedServletContainerFactory) {
((UndertowEmbeddedServletContainerFactory) container)
.addBuilderCustomizers(builder ->
builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true));
}
}
private void setLocationForStaticAssets(ConfigurableEmbeddedServletContainer container) {
File root;
String prefixPath = resolvePathPrefix();
root = new File(prefixPath + "build/www/");
if (root.exists() && root.isDirectory()) {
container.setDocumentRoot(root);
}
}
/**
* Resolve path prefix to static resources.
*/
private String resolvePathPrefix() {
String fullExecutablePath = this.getClass().getResource("").getPath();
String rootPath = Paths.get(".").toUri().normalize().getPath();
String extractedPath = fullExecutablePath.replace(rootPath, "");
int extractionEndIndex = extractedPath.indexOf("build/");
if (extractionEndIndex <= 0) {
return "";
}
return extractedPath.substring(0, extractionEndIndex);
}
/**
* Initializes the caching HTTP Headers Filter.
*/
private void initCachingHttpHeadersFilter(ServletContext servletContext,
EnumSet<DispatcherType> disps) {
log.debug("Registering Caching HTTP Headers Filter");
FilterRegistration.Dynamic cachingHttpHeadersFilter =
servletContext.addFilter("cachingHttpHeadersFilter",
new CachingHttpHeadersFilter(jHipsterProperties));
cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/content/*");
cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/app/*");
cachingHttpHeadersFilter.setAsyncSupported(true);
}
/**
* Initializes Metrics.
*/
private void initMetrics(ServletContext servletContext, EnumSet<DispatcherType> disps) {
log.debug("Initializing Metrics registries");
servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE,
metricRegistry);
servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY,
metricRegistry);
log.debug("Registering Metrics Filter");
FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter",
new InstrumentedFilter());
metricsFilter.addMappingForUrlPatterns(disps, true, "/*");
metricsFilter.setAsyncSupported(true);
log.debug("Registering Metrics Servlet");
ServletRegistration.Dynamic metricsAdminServlet =
servletContext.addServlet("metricsServlet", new MetricsServlet());
metricsAdminServlet.addMapping("/management/metrics/*");
metricsAdminServlet.setAsyncSupported(true);
metricsAdminServlet.setLoadOnStartup(2);
}
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = jHipsterProperties.getCors();
if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
log.debug("Registering CORS filter");
source.registerCorsConfiguration("/api/**", config);
source.registerCorsConfiguration("/management/**", config);
source.registerCorsConfiguration("/v2/api-docs", config);
}
return new CorsFilter(source);
}
/**
* Initializes H2 console.
*/
private void initH2Console(ServletContext servletContext) {
log.debug("Initialize H2 console");
try {
// We don't want to include H2 when we are packaging for the "prod" profile and won't
// actually need it, so we have to load / invoke things at runtime through reflection.
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Class<?> servletClass = Class.forName("org.h2.server.web.WebServlet", true, loader);
Servlet servlet = (Servlet) servletClass.newInstance();
ServletRegistration.Dynamic h2ConsoleServlet = servletContext.addServlet("H2Console", servlet);
h2ConsoleServlet.addMapping("/h2-console/*");
h2ConsoleServlet.setInitParameter("-properties", "src/main/resources/");
h2ConsoleServlet.setLoadOnStartup(1);
} catch (ClassNotFoundException | LinkageError e) {
throw new RuntimeException("Failed to load and initialize org.h2.server.web.WebServlet", e);
} catch (IllegalAccessException | InstantiationException e) {
throw new RuntimeException("Failed to instantiate org.h2.server.web.WebServlet", e);
}
}
@Autowired(required = false)
public void setMetricRegistry(MetricRegistry metricRegistry) {
this.metricRegistry = metricRegistry;
}
}
| [
"ajchanquin@gmail.com"
] | ajchanquin@gmail.com |
7237100dd422af3c9abbb104a29d4211abb53e2d | 250defa7d1a33187c48cbd58c550dc1070ee9011 | /Application/app/src/main/java/com/virmana/flix/ui/views/ClickableViewPager.java | 731613409182950081395fbbd37e00ec6842c442 | [] | no_license | sunilkumararava/SunilFlix | 90903a232aea38a0ed93e026d57e1948c83d7379 | c45aca36b4be45c15349769413d64c7a2aee51fa | refs/heads/master | 2023-02-04T11:38:01.780958 | 2020-12-29T04:02:41 | 2020-12-29T04:02:41 | 325,181,355 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,589 | java | package com.virmana.flix.ui.views;
import android.content.Context;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import androidx.viewpager.widget.ViewPager;
/**
* Created by Tamim on 28/09/2019.
*/
public class ClickableViewPager extends ViewPager {
private OnItemClickListener mOnItemClickListener;
public ClickableViewPager(Context context) {
super(context);
setup();
}
public ClickableViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
setup();
}
private void setup() {
final GestureDetector tapGestureDetector = new GestureDetector(getContext(), new TapGestureListener());
setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
tapGestureDetector.onTouchEvent(event);
return false;
}
});
}
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
mOnItemClickListener = onItemClickListener;
}
public interface OnItemClickListener {
void onItemClick(int position);
}
private class TapGestureListener extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
if(mOnItemClickListener != null) {
mOnItemClickListener.onItemClick(getCurrentItem());
}
return true;
}
}
} | [
"anil.koppolu@shell.com"
] | anil.koppolu@shell.com |
8e9ea9fdc161f77693dcb886fe3bf64091f422e3 | 0ab9b096276583a795ea962b14278da34f8997c4 | /src/main/java/org/dependencytrack/util/HttpUtil.java | 819e0aa1f738d849337006176f2dcbab5c16091c | [
"Apache-2.0"
] | permissive | Ramos-dev/dependency-track | e048b7006dad526b4f6832a307ef3e083721ffb9 | 01b86792fa03aae76cc800b8249b72c751b4c8ae | refs/heads/master | 2022-10-05T18:04:51.530566 | 2019-01-05T03:28:45 | 2019-01-05T03:28:45 | 164,811,876 | 0 | 1 | Apache-2.0 | 2022-09-15T09:03:07 | 2019-01-09T07:30:21 | Java | UTF-8 | Java | false | false | 1,340 | java | /*
* This file is part of Dependency-Track.
*
* 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.
*
* Copyright (c) Steve Springett. All Rights Reserved.
*/
package org.dependencytrack.util;
import java.util.Base64;
import static org.apache.http.HttpHeaders.AUTHORIZATION;
public class HttpUtil {
/**
* Private constructor.
*/
private HttpUtil() {
}
public static String basicAuthHeader(String username, String password) {
return AUTHORIZATION + ": " + basicAuthHeader(username, password);
}
public static String basicAuthHeaderValue(String username, String password) {
return "Basic " +
Base64.getEncoder().encodeToString(
String.format("%s:%s", username,password)
.getBytes()
);
}
}
| [
"steve@springett.us"
] | steve@springett.us |
5c879ceb7bf0915a74a28502f93150461e54f18e | e184c682e85b9d63cc800957e6daf0cc404ca747 | /src/test/java/com/disney/comparator/JsonComparatorTest.java | 8e4b875ef50a972aeecdee8d4f82e8f1e792eda5 | [] | no_license | Pbryant88/Practice | 3be0563b866a92034e679cd5dbf065969519979d | 6cbcd963391c92bb37cf1fcd8500fb2fa3873996 | refs/heads/master | 2022-04-16T17:01:57.127583 | 2020-04-05T17:33:30 | 2020-04-05T17:33:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,462 | java | package com.disney.comparator;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import org.junit.Test;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import junit.framework.TestCase;
public class JsonComparatorTest extends TestCase {
/**
* Tests that generated paths are correct for the path given
* @throws JsonProcessingException
* @throws IOException
*/
@Test
public void testGeneratedPaths() throws JsonProcessingException, IOException {
ObjectMapper mapper = new ObjectMapper();
JsonComparator comparator = new JsonComparator();
JsonNode jsonSource = mapper.readTree(this.getClass().getResourceAsStream("/json/jsonResource.json"));
// JsonNode JsonDestination=
// mapper.readTree(this.getClass().getResourceAsStream("/json/jsonDestination.json"));
String[] paths = new String[] { "/descriptions/*/type" };
String[] pathsExpected = new String[] {
"descriptions/shortDescription/type",
"descriptions/shortDescriptionMobile/type",
"descriptions/entityCard1/type",
"descriptions/entityCard2/type",
"descriptions/entityCard3/type" };
ArrayList<StringBuilder> result = comparator.generatePaths(paths[0], jsonSource);
String[] resultArray = result.stream().map(String::new).toArray(String[]::new);
assertTrue(Arrays.equals(resultArray, pathsExpected));
}
}
| [
"glenhyatt1@gmail.com"
] | glenhyatt1@gmail.com |
394a71877bb4bda0f64d892d2c844b46f4bb5db3 | 9e0451cde8c5d0647c91308af987d2c7581ef51e | /src/main/java/es/vicenteqs/ecommercetest/model/repository/PriceProductRepository.java | 9033ac2798f1ee601439b134a27fa4b65b4890f9 | [] | no_license | vicenteqs/ecommercetest | 4d552da03b80ca1f7dd55c3888996716719609f3 | 976fa567056fa35b1144cb5b0095be55ec8e0eb4 | refs/heads/master | 2023-03-05T23:43:24.183798 | 2021-02-17T22:40:32 | 2021-02-17T22:40:32 | 339,874,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,363 | java | package es.vicenteqs.ecommercetest.model.repository;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import es.vicenteqs.ecommercetest.dto.PriceProductDto;
import es.vicenteqs.ecommercetest.model.domain.PriceProduct;
public interface PriceProductRepository extends BaseRepository<PriceProduct> {
@Query("select new es.vicenteqs.ecommercetest.dto.PriceProductDto(pp.id, b.id, p.id, pp.startDate, pp.endDate, pp.priority, pp.price, pp.currency) "
+ "from PriceProduct pp " + "join pp.product p " + "join pp.brand b "
+ "where pp.startDate <= ?1 and pp.endDate >= ?1 and pp.product.id = ?2 and pp.brand.id = ?3 "
+ "order by pp.priority desc")
List<PriceProductDto> findByBrandProductDate(Date date, Long productId, Long brandId, Pageable pageable);
@Query("select pp " + "from PriceProduct pp "
+ "where pp.startDate <= ?1 and pp.endDate >= ?1 and pp.product.id = ?2 and pp.brand.id = ?3 "
+ "order by priority desc")
List<PriceProduct> findByBrandProductDateNoDto(Date date, Long productId, Long brandId, Pageable pageable);
Optional<PriceProduct> findFirstByStartDateLessThanEqualAndEndDateGreaterThanEqualAndProductIdAndBrandIdOrderByPriorityDesc(
Date start, Date end, Long productId, Long brandId);
}
| [
"vquiles@teralco.com"
] | vquiles@teralco.com |
2bf064a2c9008c707e77b72e7fe2a435e318198e | 7f147d20461b3239051c0196d13e1dae3a978480 | /src/gourmet/Table.java | 07735ab0d9ca9d575700d1828096a0cca8b738e9 | [] | no_license | 10Kbis/Gourmet | a0d34c2076cf89644aac6d87c393c9d1e0f5ff0d | 3a15c901ae8f322b541ec5d99bf232361d6750f3 | refs/heads/master | 2020-03-19T01:47:46.152663 | 2018-06-07T09:00:21 | 2018-06-07T09:00:21 | 135,572,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,660 | 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 gourmet;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
/**
*
* @author user
*/
public class Table {
private String num;
private ArrayList<CommandePlat> commandes = new ArrayList<>();
private ArrayList<CommandePlat> commandes_envoyer = new ArrayList<>();
private int max_couverts = 0;
private int couverts = 0;
private Boolean addition_payee = false;
private String nom_serveur;
public Table() {
}
public Table(String num, int max_couverts) {
this.num = num;
this.max_couverts = max_couverts;
}
public String getNumero() {
return num;
}
@XmlElement
public void setNumero(String num) {
this.num = num;
}
public int getMaxCouverts() {
return max_couverts;
}
@XmlElement
public void setMaxCouverts(int max_couverts) {
this.max_couverts = max_couverts;
}
public int getCouverts() {
return couverts;
}
@XmlElement
public void setCouverts(int quantite) {
this.couverts = quantite;
}
public void trySetCouverts(int quantite) throws TooManyCoversException {
if (quantite > getMaxCouverts()) {
throw new TooManyCoversException();
}
this.couverts = quantite;
}
public Boolean getAdditionPayee() {
return addition_payee;
}
@XmlElement
public void setAdditionPayee(Boolean addition_payee) {
this.addition_payee = addition_payee;
}
public ArrayList<CommandePlat> getCommandes() {
return commandes;
}
@XmlElementWrapper
@XmlElement(name = "commande")
public void setCommandes(ArrayList<CommandePlat> commandes) {
this.commandes = commandes;
}
public void ajoutCommande(CommandePlat commande) {
commandes.add(commande);
}
public ArrayList<CommandePlat> getCommandesAEnvoyer() {
return commandes_envoyer;
}
@XmlElementWrapper
@XmlElement(name = "commandeEnvoyer")
public void setCommandesAEnvoyer(ArrayList<CommandePlat> commandes) {
commandes_envoyer = commandes;
}
public void ajoutCommandeAEnvoyer(CommandePlat commande) {
commandes_envoyer.add(commande);
}
public void envoyerCommandes() {
commandes_envoyer.clear();
}
}
| [
"user@work"
] | user@work |
57c6835ef6d42420d7572508e8e251fb71c63fdd | cef574e01bfae9cdde1bb92763c06185aab74e3b | /app/src/main/java/com/igrs/callback/callbackapp/MyService.java | baabeaf381eb595eb59f2a9b01a4457f5af48514 | [] | no_license | 2164love/CallbackApp | 792a4c6555d1034d180493fbef1f3abf31f80eb1 | 89427eaa38f0bf13915e2fc903c42c8d19af297d | refs/heads/master | 2021-01-11T09:56:26.204682 | 2017-02-07T08:00:14 | 2017-02-07T08:00:14 | 81,152,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.igrs.callback.callbackapp;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
public class MyService extends Service {
public MyService() {
}
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
}
}
| [
"408799272@qq.com"
] | 408799272@qq.com |
6305d1ff14beb58f34a2f4ed97cf4d0911f85758 | cd7c8919c0c058716975f12cc0802f4f057adf34 | /app/src/main/java/com/live/cunix/UpgradesActivity.java | 4b8bfc943812c9fe66de1ffb113c6a8fd1104277 | [] | no_license | itssai91/datingApp | 564a355c55db222630fb6699ac432edb24aa6dda | ff2e3bf0672dc243739a44efc1c41e9f822ddee6 | refs/heads/main | 2023-02-09T22:08:55.046368 | 2020-12-28T14:24:27 | 2020-12-28T14:24:27 | 324,607,237 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,275 | java | package com.live.cunix;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import com.live.cunix.common.ActivityBase;
public class UpgradesActivity extends ActivityBase {
Toolbar mToolbar;
Fragment fragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upgrades);
mToolbar = findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
if (savedInstanceState != null) {
fragment = getSupportFragmentManager().getFragment(savedInstanceState, "currentFragment");
} else {
fragment = new UpgradesFragment();
}
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.container_body, fragment)
.commit();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
getSupportFragmentManager().putFragment(outState, "currentFragment", fragment);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
fragment.onActivityResult(requestCode, resultCode, data);
}
@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.
switch (item.getItemId()) {
case android.R.id.home: {
finish();
return true;
}
default: {
return super.onOptionsItemSelected(item);
}
}
}
@Override
public void onBackPressed() {
// your code.
finish();
}
}
| [
"itssai91@gmail.com"
] | itssai91@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.