lang
stringclasses 10
values | seed
stringlengths 5
2.12k
|
---|---|
java | public class DifficultyTest {
@Test
public void targetTest() {
assertTrue(getTarget(454983370).toString(16).equals("1e7eca000000000000000000000000000000000000000000000000"));
}
@Test
public void compactTargetTest() {
assertTrue(getEncodedDifficulty(getTarget(454983370)) == 454983370);
assertTrue(getEncodedDifficulty(new BigInteger("ffff0000000000000000000000000000000000000000000000000000", 16)) == 486604799); |
java | mBitmap = bitmap;
}
public Point getPoint() {
return mPoint;
}
public void setPoint(Point point) {
mPoint = point;
}
public boolean isVisiblity() { |
java | new ToTest().bar(() -> 13);
}
@Test(timeout=1000)
@Points(exID = "TestMethodRef", bonus = 0.00001) |
java | */
public Uploader(final HttpServletRequest request, final Map<String, Object> conf, final UploadHandler uploader) {
this.request = request;
this.conf = conf;
this.uploader = uploader;
} |
java | package ru.job4j;
public class Info {
}
|
java | {
Execute v_Execute = new Execute(new JU_Execute_LongWaitNewObject() ,"newObject");
v_Execute.start(1000 * 5 * 2);
v_Execute.waitting(System.out);
System.out.println("\n-- 运行开始时间:" + v_Execute.getRunBeginTime().toString());
System.out.println( "-- 运行结束时间:" + v_Execute.getRunEndTime() .toString());
System.out.println( "-- 运行用时时长:" + Date.toTimeLen(v_Execute.getRunTimeLen()));
if ( v_Execute.isError() )
{
if ( v_Execute.isTimeout() )
|
java | }
double trailSpace = 0;
if (cellIdx == endCell) {
// space after the rightmost cell
trailSpace = (hssfUnits > 0)
? dim * (hssfUnits-endD)/(double)hssfUnits
: dim - endD;
} |
java | * @Date on 2021/10/23
* @Version 1.0.0
* @Description
*/
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TaskEntity {
/**
* 文档索引名
*/
@JsonProperty("index") |
java |
import java.util.ArrayList;
import java.util.List;
/** |
java | */
import java.io.Serializable;
import java.util.Optional;
import com.thinkbiganalytics.metadata.api.template.ChangeComment;
import org.joda.time.DateTime;
|
java | package org.bakasoft.framboyan.util.functions;
public interface F0 {
Object apply() throws Exception;
}
|
java | public SizePrefixedDeserializer(Deserializer<T> deserializer, boolean safe) {
this.deserializer = deserializer;
this.safe = safe;
}
@NotNull @Override public T deserialize(InputStream s) throws IOException { |
java | * Creates new form FCh
*/
public FCh() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
java | m_aDistanceListBest = new TIntArrayList ();
}
@Override
protected void internalOnNewPopulation (@Nonnull final IPopulation aPopulation)
{
final IChromosome aFittest = aPopulation.getFittestChromosome ();
final int nDistance = (int) m_aFF.getDistance (aFittest);
m_aDistanceListPerPopulation.add (nDistance);
if (m_aDistanceListBest.isEmpty ())
m_aDistanceListBest.add (nDistance); |
java | * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs;
import java.io.File;
import org.apache.tools.ant.BuildException; |
java | */
auth.userDetailsService(userDetailsService).passwordEncoder(
new PasswordEncoder() {
@Override
public String encode(CharSequence rawPassword) {
return MD5Util.encode((String) rawPassword);
}
@Override
public boolean matches(CharSequence rawPassword, String encodedPassword) {
return encodedPassword.equals(MD5Util.encode((String) rawPassword));
} |
java |
private final CategoryCustomMapper categoryMapperCustom;
@Override
public List<Category> queryAllRootLevelCats() {
Example categoryExample = new Example(Category.class);
Example.Criteria categoryCriteria = categoryExample.createCriteria();
categoryCriteria.andEqualTo("fatherId", 0);
return categoryMapper.selectByExample(categoryExample);
}
/**
* @param rootCatId father id |
java | protected String getEncodedJwtToken(ContainerRequestContext requestContext) {
String auth = requestContext.getHeaderString(HttpHeaders.AUTHORIZATION);
String[] parts = auth == null ? null : auth.split(" ");
if (parts == null || !expectedAuthScheme.equals(parts[0]) || parts.length != 2) {
throw new JoseException(expectedAuthScheme + " scheme is expected");
}
return parts[1];
}
public void setExpectedAuthScheme(String expectedAuthScheme) {
this.expectedAuthScheme = expectedAuthScheme;
}
|
java | */
public class TrojansInfo implements Serializable {
private String trojansName;
private String trojansHash;
private String trojansClass;
public TrojansInfo() {
super();
}
public TrojansInfo(String trojansName, String trojansHash, String trojansClass) {
super();
this.trojansName = trojansName; |
java | package me.devnatan.events4m.fight.event;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@EqualsAndHashCode
@Data
public class EventPlayer {
|
java | {
final StatSet newNpcData = new StatSet();
try
{
newNpcData.set("npcId", commandSplit[1]);
final String statToSet = commandSplit[2];
String value = ""; |
java | */
@Bean
public ErrorDecoder feignError() {
return (methodKey, response) -> {
int code = response.status();
String body = response.body().toString();
//401,AccessToken失效重试
if (code == HttpStatus.UNAUTHORIZED.value()) {
//AccessToken失效时,可再次重试 |
java | public static Uri createCropFile(){
return Uri.parse
(FileUtil.createFile("crop_image",
FileUtil.getFileNameByTime("IMG","jpg")).getPath());
}
public static void start(PermissionCheckFragment delegate){
new CameraHandler(delegate).beginCameraDialog();
} |
java | return rowsUpdated;
}
// 2.4
public int countAndDeleteCompletedNoFailure(Job job) throws SQLException {
Connection c = null;
PreparedStatement pp = null;
try {
c = connectionProperties.getConnection();
pp = c.prepareStatement("DELETE FROM unit_job WHERE processed = 1 AND job_id = ? AND status = '" + UnitJobStatus.COMPLETED_OK + "' AND confirmed = 0 AND unconfirmed = 0");
pp.setInt(1, job.getId()); |
java |
public TimestampLogger(Logger logger) {
this.logger = logger;
}
public void println(int level, String msg) {
logger.println(level, new Date().toString() + ": " + msg); |
java | if (textToSpeech == null) {
throw new IllegalStateException("You forgot to call AndroidTextToSpeech.initialize!");
}
try {
waitForInitializationToFinish();
return textToSpeech.isLanguageAvailable(locale) == LANG_COUNTRY_VAR_AVAILABLE;
} catch (InterruptedException e) {
RobotLog.ww(TAG, e, "InterruptedException thrown while waiting for TTS initialization");
Thread.currentThread().interrupt();
return false;
} |
java | boolean moveResult = false;
switch(request.getDirection()) {
case UP :
moveResult = submenuCoreService.moveUp(request.getMenuId(), request.getMenuContentId());
break; |
java | static int ssf = sf + MemberClasses.sf;
int snf = sf + MemberClasses.sf;
}
class NonStaticMemberClass {
int nnf1 = sf + nf;
int nnf2 = MemberClasses.sf + MemberClasses.this.nf;
}
void nonstaticmethod() {
// Non Static method in Top Level Class
// The local innser class in the method can use non-static
// Top Level members
class LocalClass {
int m(int p) { |
java |
public interface ConstantPoolEntry {
void checkAndSetArguments(String arg, String comment) throws Exception;
String getRawStringValue();
void setRawStringValue(String s);
String getComment();
String getDisplayName();
String lookupValue(MiniConstantPool mcp); |
java | package hu.klenium.tetris.util;
public class Dimension {
public final int width;
public final int height;
public Dimension(int width, int height) { |
java |
public String type() {
return type;
}
public String topicArn() { |
java | .addComponent(lblusMab, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
.addComponent(lblUsBreak))
.addContainerGap(136, Short.MAX_VALUE))
.addGroup(gl_contentPanel.createSequentialGroup()
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(btnReset))))
);
gl_contentPanel.setVerticalGroup(
gl_contentPanel.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPanel.createSequentialGroup()
.addContainerGap()
.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
.addComponent(btnBreakTime)
.addComponent(comboBoxBreakTime, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(lblUsBreak)) |
java | Assert.assertEquals("Wrong number of tasks!", 1, controller.getTasks(project).size());
Assert.assertEquals("Wrong task!", task, controller.getTasks(project).get(0));
Assert.assertEquals("Wrong task!", "tsk", controller.getTasks(project).get(0).getName());
}
|
java | import com.crazicrafter1.tfplugin.boss.TFBoss;
import com.crazicrafter1.tfplugin.TFGlobal;
import com.crazicrafter1.tfplugin.generation.TFBossStructure;
public class TFLichTower extends TFBossStructure {
//private HashMap<TFComponent
|
java | import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* establishes the database connection and creates connection, command and resultset |
java |
recordArr.add(msgRecord);
GenericRecord composeAvroRecord = AvroUtils.composeInnerAvroRecord(msgSchemal, recordArr, tagTime, logicalTag);
DataFileWriter dataFileWriter = AvroUtils.getDataFileWriter(msgSchemal);
String msgLine = AvroUtils.getAvroBinaryString(composeAvroRecord, dataFileWriter);
ConvertResult result = converter.getListObjects("20181225180059", msgLine, new String[]{"c1"});
assertEquals(Lists.newArrayList(3.14d), result.getObjListResult().get(0));
}
@Test |
java |
// This should be non-null when connection type is EXTERNAL
checkNotNull(conduitConnections);
NetworkExternalConnection networkExternalConnection = conduitConnections.get(conduitType.getNetworkType()); |
java | import java.io.FileOutputStream;
import com.rs.cache.Cache;
public class DumpCS2 {
public static void main(String[] args) throws Throwable {
Cache.init(); |
java | /**
* Give information about Customer, is
* Customer in line or is Customer is first
* @param c
*/
public void addNewCustomer(Customer c);
/**
|
java | package com.dp.others.dependencyinversion;
public class SuperWorkerWithoutDI {
public void work() {
// .... working much more
}
} |
java | package org.jmade.core.message.transport;
public interface Producer {
void send(String channelName, String data);
}
|
java | return typeTache;
}
public void setTypeTache(String typeTache) {
this.typeTache = typeTache;
}
public String getEstimationTache() {
return estimationTache; |
java | /**
* Copyright © 2018-2025 <a href="http://www.greathiit.com">哈尔滨信息工程学院</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.visitor.dao;
import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.visitor.entity.TmVisitor;
/**
* 访客信息DAO接口
* @author 赵俊飞
* @version 2017-11-25
*/ |
java |
BookComparatorByPageCount comparatorByPageCount = new BookComparatorByPageCount();
Set<Book> sortedBooksByPageCount = new TreeSet<Book>(comparatorByPageCount);
sortedBooksByPageCount.addAll(books);
System.out.println("sayfa sayısına göre");
|
java | Value<Boolean> Pickaxe = new ValueBuilder().withDescriptor("Pickaxe").withValue(false).withAction(s -> {}).register(this);
public NoMiningTrace() {
super("NoMiningTrace", Feature.Category.Misc);
INSTANCE = this; |
java | default:
// 設定の読み込み時に値が設定されていない場合にエラーとしているため、ここには到達しません。
throw new IllegalStateException(
"map entry has no key definition.");
}
switch(entry.getValueType()) {
case COMPONENT:
value = container.getComponentById(entry.getValueId()); |
java | public boolean accept(File file) {
return file.isDirectory()
|| getExtension(file).equalsIgnoreCase("kml");
}
|
java | boolean positive = true;
if (m.group(1).equals("-")) {
positive = false;
}
int variableNumber = Integer.parseInt(m.group(2));
Variable.setResult(variableNumber, positive); |
java |
private Integer heCityId;
}
|
java | };
@Override
public boolean remove(final Widget w) {
final boolean result = viewBasePanel.remove(w);
return result;
|
java | * 创建者: Leon
* 创建时间: 2016/10/16 19:13
* 描述: TODO
*/
public interface SplashPresenter {
public static final String TAG = "SplashPresenter";
|
java |
package com.wuman.android.auth;
import android.annotation.TargetApi;
import android.os.Build;
import androidx.fragment.app.Fragment; |
java | socket = socketo.establishConn(Nickname);
//Vamos a usar un RecyclerView
MessageList = new ArrayList<>();
//Ligamos el componente al código
myRecylerView = (RecyclerView) findViewById(R.id.messagelist);
//Creamos un objeto LayoutManager con el contexto de la aplicación y lo asignamos al RecyclerView
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext()); |
java | package net.thebyrdnest.aoc.aoc2015;
public interface DayTemplate {
int solve1(String input);
int solve2(String input);
}
|
java | addConsentCacheTable(model);
}
protected List<GroupPrivilege> generateGroupPrivilege(){
return Arrays.asList(
new GroupPrivilege(FhirSchemaConstants.FHIR_OAUTH_GRANT_GROUP, Privilege.SELECT),
new GroupPrivilege(FhirSchemaConstants.FHIR_OAUTH_GRANT_GROUP, Privilege.INSERT),
new GroupPrivilege(FhirSchemaConstants.FHIR_OAUTH_GRANT_GROUP, Privilege.DELETE), |
java | package com.testdemo.util;
import java.util.Random;
/**
* @AUTHOR:<EMAIL> |
java | import java.util.Optional;
@Slf4j
@RequiredArgsConstructor
public class SetNetworkProfileHandler implements OcppRequestHandler<SetNetworkProfileRequest> { |
java |
public class Mutex {
private Thread owner = null;
private int lock_count = 0;
|
java | *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. |
java | prefMinSumHeight = totalHeight - totalMinHeight;
for (int i = 0; i < numChildren; i++) {
int amntShrinkCurrentHeight = 0;
int prefHeight = prefSizes[i].height; |
java | import java.util.HashMap;
class CallRecord {
CallRecord() {}
String formattedNumber;
String number;
String callType;
String name;
long date;
long duration;
HashMap<String, Object> toMap() { |
java | import com.me.harris.androidanimations.utils.CrashHandler;
import com.me.harris.androidanimations.utils.LogUtil;
/**
* Created by Harris on 2016/10/13.
*/
public class App extends Application {
public static final String TAG = App.class.getSimpleName();
@Override
public void onCreate() {
super.onCreate(); |
java | /**
*
* @author fbonin
*
*/
public class SourceTarget
{
/**
* Option 3 (highest priority). Provide explicit target path for each source dependency
*
* @since 0.0.6
*/
@Parameter( )
public String targetDir; |
java | long graph[][] = new long[n][n];
for(int i = 0; i < edges.size(); i++) {
graph[edges.get(i).U][edges.get(i).V] = edges.get(i).weight;
graph[edges.get(i).V][edges.get(i).U] = edges.get(i).weight;
}
primMST(graph);
} |
java | final TrackFlag flag = new TrackFlag();
DataEyeAnalyticsSDK.allInstances(new DataEyeAnalyticsSDK.InstanceProcessor() {
@Override
public void process(DataEyeAnalyticsSDK instance) {
if (instance.getToken().equals(token)) {
flag.tracked();
instance.trackFromH5(event);
}
}
}); |
java | * <p>
* ================等待Callable执行==========
* 副线程开始...Thread[MvcAsync1,5,main]当前时间:1583217200167
* 副线程结束...Thread[MvcAsync1,5,main]当前时间:1583217202168
* ================Callable执行完成==========
* <p>
* ================再次收到之前重发过来的请求======== |
java | }
@Override
public String preparedStatement() {
if (from != null && until != null) {
return "SELECT " + selectAttrName + " from " + tableName + " WHERE " + "date_trunc('second'," + timstampAttrName
+ ")=date_trunc('second',?::timestamp)" + " OR " + "date_trunc('second'," + timstampAttrName
+ ")=date_trunc('second',?::timestamp)" + " OR " + "(extract(seconds from AGE(" + timstampAttrName + ",?)) >1" + " AND "
+ "extract (seconds from AGE(?," + timstampAttrName + ")) >1)";
} else if (from != null) { // until == null |
java |
this.context = this;
CommonFunction.sendMsg(getApplicationContext());
this.mAuth = FirebaseAuth.getInstance();
this.user = this.mAuth.getCurrentUser();
ActionBar actionBar = this.getSupportActionBar();
actionBar.setDisplayShowCustomEnabled(true); //true설정을 해주셔야 합니다.
actionBar.setDisplayHomeAsUpEnabled(false); //액션바 아이콘을 업 네비게이션 형태로 표시합니다.
actionBar.setDisplayShowTitleEnabled(false); //액션바에 표시되는 제목의 표시유무를 설정합니다.
actionBar.setDisplayShowHomeEnabled(false); //홈 아이콘을 숨김처리합니다.
actionBar.setBackgroundDrawable(new ColorDrawable(Color.argb(255,255,255,255))); |
java | package cn.elvea.platform.commons.web.servlet.language;
/**
* 语言解析器
*
* @author elvea
* @since 0.0.1
*/
public interface LanguageResolver {
String resolveLanguage();
}
|
java |
NxtOrderForm nxtOrderForm = nxtOrderFormService.queryById(id);
if (nxtOrderForm != null && nxtOrderForm.getUserId().equals(userId)){
return new NxtStructApiResult(nxtOrderForm.getStatusPaid());
}
else {
return new NxtStructApiResult(34,"未找到订单或该订单不属于你");
}
}
|
java | readFully(channel, ByteBuffer.wrap(columnName));
i.clear();
readFully(channel, i);
columnType = new byte[i.getInt(0)]; |
java | *
* Given a string, find the length of the longest substring without repeating
* characters.
*
*
* Example 1:
* |
java | }
return list;
}
public static String string(Object actual) {
String str = Caster.toString(actual);
|
java | * limitations under the License.
*/
package org.apache.commons.jexl.util;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.logging.Log;
/** |
java | private String uploadContentType;
private String savePath = "/upload";
public File getUpload() {
return upload;
}
public void setUpload(File upload) {
this.upload = upload; |
java |
/**
* Tests the expected values of the RPC message.
*/
@Test
public void testRpcValues() {
// Test Values
int customName = ((OnButtonPress) msg).getCustomButtonID();
ButtonName buttonName = ((OnButtonPress) msg).getButtonName();
ButtonPressMode buttonPressMode = ((OnButtonPress) msg).getButtonPressMode();
// Valid Tests
assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, customName);
assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONNAME, buttonName);
assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONPRESSMODE, buttonPressMode); |
java |
@FunctionalInterface
public interface Feed<in, out> {
public out get(in input);
} |
java | package com.anthonynahas.autocallrecorder.events.loading;
/**
* Created by anahas on 22.06.2017.
*/
public class OnLoadingDone {
public OnLoadingDone() { |
java | private final List<Category> categories = ImmutableList.of(create("1", "Articles"), create("2", "Notes"),
create("3", "Bookmarks"));
@Override
public List<Category> getCategories() { |
java |
private HUDManager(){
}
private static HUDManager instance = null;
|
java |
import java.util.List;
import de.w11k.speakerrating_android.R;
import de.w11k.speakerrating_android.SelectTalkActivity;
import de.w11k.speakerrating_android.data.Conference;
public class ConferenceAdapter extends RecyclerView.Adapter<ConferenceAdapter.ConferenceViewHolder> { |
java | Response response = RestAssured
.given()
.header(CORRELATION_ID_HEADER_NAME, "fdc29e15-9f8c-45df-aaf1-9122f3ae6089")
.header(X_AUTHORIZATION_HEADER_NAME, Base64.getEncoder()
.encodeToString((CLIENT_NAME + ":" + CLIENT_PASSWORD).getBytes()))
.contentType(ContentType.JSON) |
java | // Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.signalr.generated;
import com.azure.core.util.Context;
/** Samples for SignalRCustomCertificates Delete. */
public final class SignalRCustomCertificatesDeleteSamples { |
java |
import java.io.IOException;
public class BankReader implements Reader<Bank>{
/**
* Method that reads a Bank from the System.in |
java | * Entity model.
*
* @author mauriciofernandesdecastro
*/
public interface EntityModel
extends ContextModel {
/**
* Entity alias.
*/
String getAlias();
} |
java | /**
* Fake persistence service implementation ( entity "Entry" )
*
* @author Telosys Tools Generator
*/
public class EntryPersistenceFAKE extends GenericFakeService<EntryEntity> implements EntryPersistence {
public EntryPersistenceFAKE () {
super(EntryEntity.class);
}
protected EntryEntity buildEntity(int index) {
EntryEntity entity = new EntryEntity();
// Init fields with mock values
entity.setIdentry( nextInteger() ) ; |
java | import java.util.List;
import com.google.gwt.cell.client.NumberCell;
import com.google.gwt.i18n.client.NumberFormat;
import com.technology.jep.jepria.client.ui.form.list.StandardListFormViewImpl;
import com.technology.jep.jepria.client.widget.list.JepColumn;
public class AllShopGoodsListFormViewImpl extends StandardListFormViewImpl {
public AllShopGoodsListFormViewImpl() {
super(AllShopGoodsListFormViewImpl.class.getCanonicalName());
grid.setWrapHeaders(true);
list.setDndEnabled(true);
}
|
java | }
default IntUnaryOperator uncheck() {
return (int t) -> {
try {
return applyAsInt(t);
} catch(IOException e) {
throw WrapperException.hide(e, IOException.class);
}
}; |
java |
/**
* Returns the expression-to-bitvector conversion specified by the given operator.
* @ensures expr.apply(op)
*/
public static final IntExpression cast(ExprCastOperator op, Expression expr) {
try {
return expr.apply(op);
} catch (RuntimeException ex) {
throw new ActionException(ex.getMessage(), ex); // wrap
}
} |
java |
return com.sun.tools.apt.Main.process(apf, args.toArray(new String[args.size()]));
}
/**
* Get the source file directory given the specified subdirectory name relative to
* the base directory, specified by the system property 'enunciate.sample.src.dir'.
*
* @return The source file directory.
*/
public static File getSourceFileDirectory(String subdir) {
String srcDirPath = System.getProperty("enunciate.sample.src.dir"); |
java | */
public class AdultWork extends WorkAlgorithm {
// 成年人的工作
@Override
public void work() {
System.out.println("成年人的工作就是先养活自己,然后为社会做贡献!");
}
} |
java | dp[0] = nums[0]; // 初始情况下,只有一家可以偷
dp[1] = Math.max(nums[0], nums[1]); // 有两家可以偷的时候,我们就选最大值
for(int i = 2; i < len; ++i) {
// 如果偷当前第i家,那就是偷到的i - 2家总金额再加上第i家的金额数,否则就是不偷第i家,那就是只算到
// i - 1家的总金额
dp[i] = Math.max(dp[i - 2] + nums[i], dp[i - 1]);
}
return dp[len - 1];
}
} |
java | return client;
}
void setClient(HMSClient client) {
this.client = client;
}
}
|
java | }
public AsyncHttpRequest get() {
this.request = Dsl.get(this.host);
return this;
}
public AsyncHttpRequest delete() {
this.request = Dsl.delete(this.host);
return this;
}
public AsyncHttpRequest post() {
this.request = Dsl.post(this.host); |
java | *
* @return a string.
*/
@Override
@JsonValue
public String toString() {
return this.toString(':');
}
/**
* Output the algorithm and value as one whole, separated by joinChar.
*
* @param aJoinChar
* the character to join algorithm and value. |
java | builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
|
java | this.comparator = comparator;
this.operator = operator;
}
@Override
public boolean eval(T obj) {
int c = comparator.compare(this.obj, obj);
return operator.calc(c); |
java | import java.util.List;
import java.util.Map;
/**
* Created by frren on 2015-08-13.
*/
public class CalendarManager extends ClientManager<Calendar> {
|
java |
import com.trendyol.cart.domain.discount.enums.DiscountType;
import org.junit.Test;
import java.math.BigDecimal;
import java.util.Objects;
import static org.junit.Assert.*;
public class DiscountTest {
@Test
public void constructorCreate_SetAllParameter_FieldsNotChange() {
BigDecimal value = new BigDecimal("100.0");
DiscountType discountType = DiscountType.RATE; |
java | import java.util.List;
/**
* ソースのパス
*/
public class SourcePaths {
|
Subsets and Splits