lang
stringclasses
10 values
seed
stringlengths
5
2.12k
java
* 如何解决: * 把在元素之间游走的责任交给迭代器,而不是聚合对象。 * 关键代码: * 定义接口:hasNext, next。 * 应用实例: * JAVA 中的 iterator。 * 优点: * 1、它支持以不同的方式遍历一个聚合对象。 * 2、迭代器简化了聚合类。 * 3、在同一个聚合上可以有多个遍历。 * 4、在迭代器模式中,增加新的聚合类和迭代器类都很方便,无须修改原有代码。 * 缺点: * 由于迭代器模式将存储数据和遍历数据的职责分离,增加新的聚合类需要对应增加新的迭代器类,类的个数成对增加,这在一定程度上增加了系统的复杂性。
java
Session mailSession = Session.getDefaultInstance(props, null); MimeMessage emailMessage = new MimeMessage(mailSession); emailMessage.setFrom(new InternetAddress("<EMAIL>"));
java
exports com.fasterxml.jackson.dataformat.csv; // exports com.fasterxml.jackson.dataformat.csv.impl; provides com.fasterxml.jackson.core.TokenStreamFactory with com.fasterxml.jackson.dataformat.csv.CsvFactory; provides com.fasterxml.jackson.databind.ObjectMapper with com.fasterxml.jackson.dataformat.csv.CsvMapper; }
java
public interface Resource { String getResourcePath(); URL getURL(); Instant getLastModified(); long getLength(); boolean isDirectory();
java
Stream<Payment> payments = paymentDao.findAll(); assertNotNull(payments); assertEquals(payments.count(), TOTAL_COUNT); }
java
@SuppressWarnings("unchecked") private E removeAt(int i) { modCount++; int s = --size; if (s == i) { queue[i] = null; } else { E moved = (E) queue[s]; queue[s] = null; siftDown(i, moved); if (queue[i] == moved) { siftUp(i, moved); if (queue[i] != moved) { return moved; }
java
@Override public void clickFunction() { try{ refresh = false; tailer.setValue(false); table.removeAllItems(); UiHelper helper = UiHelper.getHelper(); helper.sendLog(info.session, info.name, start.getValue().getTime(), end.getValue().getTime(), level.getValue(), text.getValue(),target); }
java
super(message, cause); } public FunctionConfigurationException(String message) { super(message); } }
java
import com.wty.ution.widget.AppMsg; public class MapPickActivity extends MapDisplayActivity{ protected SuggestionSearch mSuggestionSearch; @Override protected void onCreate(Bundle savedInstanceState) {
java
*/ NOT_ANNOTATION_STATE(DataStateCodeConstant.NOT_ANNOTATION_STATE, "notAnnotationState","未标注"), /** * 手动标注中 */ MANUAL_ANNOTATION_STATE(DataStateCodeConstant.MANUAL_ANNOTATION_STATE, "manualAnnotationState","手动标注中"), /**
java
* Shows all the style data */ public static final int D_FLAG_01_STYLE = 1 << 0; public static final int D_FLAG_03_STRINGER = 1 << 2; /** * When flag is set, ignore GraphicsX data */ public static final int D_FLAG_26_GRAPHCISX = 1 << 25;
java
try { OutputStream os = response.getOutputStream(); os.write(robotsResponse.toString().getBytes()); } catch (IOException e) {
java
import com.fasterxml.jackson.annotation.JsonProperty; public class EventInfo { @JsonProperty("EventSource") private String eventSource; @JsonProperty("EventID") private String eventId;
java
* limitations under the License. */ package com.intellij.ide.actions; import com.intellij.codeInsight.navigation.NavigationUtil; import com.intellij.navigation.GotoRelatedItem; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.ui.popup.JBPopup; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
java
* * @param toExhaustive the to exhaustive */ public void setToExhaustive(String toExhaustive); /** * Sets the from exhaustive.
java
{ lastAttackTick = -100; nextAttackTick = -100; lastAttackStyle = null; currentAttackStyle = null; lastAnimationId = -1; currentPhase = Phase.START;
java
* @return the character used for percent sign. */ public char getPercent() { return formatSymbols.getPercent(); } /** * Sets the character used for percent sign. * @param percent the precent character
java
package com.vidi.tutorial.lambda.base; import org.junit.Test; public class Executor {
java
package top.yhmi; import java.util.Arrays; import java.util.List; import java.util.stream.Collector; public class CustomerCollectorAction { public static void main(String[] args) { Collector<String, List<String>,List<String>> collector=new TolistCollector(); String [] arrs=new String[]{"Alex","Wang","Hello","Lambda","Collector","Java 8","Stream"}; List<String> result = Arrays.stream(arrs)
java
System.arraycopy(args, 2, sourcePath, 0, sourcePath.length); Class<?> clazz = Class.forName(clazzName); gen.setSourcePath(sourcePath); gen.setClassSourcePath(classSource); gen.generate(new ReflectClass(clazz));
java
package com.light.calendar.application.controller; import com.light.calendar.application.model.CalendarEventResource; import java.util.Date; import java.util.List; public interface CalendarEventController { void createEvent(Long calendarId, CalendarEventResource resource); List<CalendarEventResource> listEvents(Long calendarId, String locale, Date startDate, Date endDate); }
java
int newElement = array[firstUnsortedIndex]; int i; for (i = firstUnsortedIndex; i > 0 && array[i - 1] > newElement; i--) { array[i] = array[i - 1]; }
java
throw new ForbiddenException("It is not allowed to download the private key"); } RSAPrivateKey key = signatureService.getKey(); return key == null ? new byte[0] : key.getEncoded(); } @Override public void setEncodedKey(byte[] key) throws IOException { if (!allowUploadPrivateKey) { throw new ForbiddenException("It is not allowed to upload a private key"); } try { signatureService.setKey(key.length == 0 ? null : KeyUtils.fromPKCS8(key));
java
/** * 信息 */ @RequestMapping("/infoByRecordNo/{recordNo}") public R infoByRecordNo(@PathVariable("recordNo") String recordNo){ AssetScrapEntity assetScrap = assetScrapService.getByRecordNo(recordNo); return R.ok().put("assetScrap", assetScrap); } /** * 保存
java
// TitleLayout llTitle = getTitleLayout(); // llTitle.getTvTitle().setText("xxxx"); // String platName = getPlatformName(); // if ("SinaWeibo".equals(platName) // || "TencentWeibo".equals(platName)) { // initUi(platName); // interceptPlatformActionListener(platName); // return; // } //
java
*/ public interface IExecutionAdder { public abstract void addCommand(ICommand command); }
java
return "UPDATE "+buildTableWithAliasSql(update, table)+" \n"+ "SET "+buildUpdateAssignmentsSql(update)+ (update.hasWhereCondition() ? " \nWHERE "+ buildConditionSql(update.getWhereCondition(), update) : "")+ ";"; } protected String buildUpdateAssignmentsSql(Update update) { List<UpdateSet> sets = update.getSets();
java
return picUrl; } public void setPicUrl(String picUrl) { this.picUrl = picUrl; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; }
java
public int getColumn() { return column; } public boolean isNil() { return token.equals("nil"); } public boolean isInteger() {
java
import com.freebasicacc.util.FileUtil; import java.io.FileInputStream; import java.util.Properties; public class LogService { /*public void intiallizeLogger() throws Exception{ Properties logProperties = new Properties(); logProperties.load(new FileInputStream(FileUtil.getCurrentJarPath()+"/config/log4j.properties")); PropertyConfigurator.configure(logProperties); }*/
java
@Override public boolean onCreate() { return(true); } @Override public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { ParcelFileDescriptor[] pipe=null;
java
public void setEndpointName(String endpointName) { this.endpointName = endpointName; } public String getEndpointName() { return endpointName; } public CreateEndpointRequest withEndpointName(String endpointName) { this.setEndpointName(endpointName); return this;
java
* @return String output. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("type: " + type + ", energy: " + correctedEnergy + ", energyError: " + energyError + ", "); sb.append("position: (" + positionVec.x() + ", " + positionVec.y() + ", " + positionVec.z() + "), "); sb.append("id: 0x" + getIdentifier().toHexString() + ", time: " + time); return sb.toString(); } }
java
try { //获取软件版本号,对应AndroidManifest.xml下android:versionCode versionCode = mContext.getPackageManager(). getPackageInfo(mContext.getPackageName(), 0).versionCode; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); }
java
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * Provides details on either the delivering or receiving parties. *
java
@ResponseBody @RequestMapping(value = "AddUserIcon",method = RequestMethod.POST,produces = "text/plain;charset=UTF-8") public String addUserIcon(HttpServletRequest request){ String userName=request.getParameter("userName"); String s=request.getParameter("userIconContent"); //获取服务器存放图片的路径 String path=request.getSession().getServletContext().getRealPath("/img/user_icon"); //生成图片的随 // 机数 Date date=new Date(); DateFormat dateFormat=new SimpleDateFormat("yyyyMMddHHmmss"); String time=dateFormat.format(date); //图片文件的名称 String fileName="/"+userName.trim()+time.trim()+".png";
java
* copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package org.diorite.impl.command.defaults;
java
private void initializeTransformationRecursive(Animator animator, long defaultDuration) { long duration = animator.getDuration(); if (duration == 0) { duration = defaultDuration; } if (animator instanceof AnimatorSet) { ArrayList<Animator> children = ((AnimatorSet) animator).getChildAnimations(); for (int i = children.size() - 1; i >= 0; i--) { initializeTransformationRecursive(children.get(i), duration); } } else if (animator instanceof ValueAnimator) { ValueAnimator valueAnim = ((ValueAnimator) animator); // DIP to pixel, save back to duration valueAnim.setDuration((long) TypedValue.applyDimension(
java
import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * ValueMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class ValueMarshaller { private static final MarshallingInfo<List> ARRAYVALUES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("arrayValues").build();
java
<gh_stars>10-100 package com.ibm.drl.hbcp.predictor.quantization; /** * Turns a continuous number into a quantum (a value part of a smaller, often finite set). * @author marting * @param <T> The type of numbers the quantum handles (Double or Integer basically) */ public interface Quantizer<T extends Number & Comparable<T>> { /** Returns a quantized/discretized version of a number */ Quantum<T> quantize(T number); }
java
public class ReadTimeConsoleController { @Autowired private JavaShellUtil javaShellUtil; @GetMapping("") public JSONObject getConsoleLog(){ try { javaShellUtil.execDi(new String[]{"ping", "baidu.com"}); } catch (IOException e) { e.printStackTrace(); }
java
redSelected = !redSelected; } if (e.getKeyCode() == KeyEvent.VK_G) { greenSelected = !greenSelected; }
java
package com.deepoove.poi.render.processor; import org.apache.commons.lang3.ClassUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
java
import com.ycsoft.commons.exception.ReportException; public class SerializeUtil { public static byte[] serialize(Serializable object) throws ReportException { ObjectOutputStream oos = null; ByteArrayOutputStream baos = null; try { // 序列化 baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(object); byte[] bytes = baos.toByteArray(); return bytes;
java
this.loanCollection = loanCollection; } public float getSavingsDeposit() { return savingsDeposit; }
java
* * @see StateManagementBot */ public class UserProfile { private String name; public String getName() { return name; }
java
adicionarCoordenador(ry);//gossip removerCoordenador(rx); if (p[rx].getRank()== p[ry].getRank()) p[ry].incRank(); } } } void adicionarCoordenador(int x){ if(!coordenadores.contains(x)) coordenadores.add(x);
java
public Map<String, Object> toMap() { Map<String, Object> mapResult = super.toMap(); if(nonce != null) mapResult.put("nonce", nonce); if(created != null) mapResult.put("created", created); return mapResult;
java
@Override public String getReducedRawType() { return reducedRawType; } @Override public void setReducedRawType(String reducedRawType) { this.reducedRawType = reducedRawType; } @Override public FunctionNode getSetterNode() { for (Dependency d : getDependencies()) if (d instanceof SetterDependency)
java
return viewHolder; } @Override public void onBindViewHolder(ViewHolder holder, int position) { Recommend recommend = mRecommendList.get(position); holder.simpleDraweeView.setImageURI(recommend.getPictureUrl()); holder.textView.setText(recommend.getRecommendIngredientsName()); }
java
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Scope; import javax.inject.Inject; @SpringBootApplication public class Application { public static void main(String[] args) { ConfigurableApplicationContext ctx1 = SpringApplication.run(Application.class, args); System.out.println(ctx1.getBean(BeanA.class));
java
@SuppressWarnings("unused") @JsonValue public String toValue() { return toString().toLowerCase(); } }
java
/** * 批量删除入库申请 * * @param ids 需要删除的数据ID * @return 结果
java
// In case there are no annotations // -- detect if camel case if (str==""){ str = namedproperty.getIRI().getFragment(); // System.out.println("DEBUG " + str); }
java
public MicroserviceBuilder withId(Long id) { this.id = id; return this; } public MicroserviceBuilder withName(String name){ this.name = name; return this; }
java
// =================================================================================== // Various Info // ============ // =================================================================================== // Type Name
java
public List<GrayEvent> getGrayEvents() { return grayEvents; } public Long getMaxSortMark() { return maxSortMark; }
java
import java.net.SocketException; import java.util.Enumeration; /** * @author zhangjuwa * @apiNote * @Date 2019-11-12 17:13 * @since jdk1.8 */ @SpringBootApplication
java
/** * Recursive method for getting all the {@link Branch}es of this tree. * The current branch is added, with this method called for each of its children. * @param curr the branch to be added */ private void getAllBranches(Branch curr) { if (curr == null) return; branches.add(curr); // add this to the list if (curr.getChildren() == null) return; for (int i = 0; i < curr.getChildren().length; i++) { getAllBranches(curr.getChildren()[i]); }
java
Record.Header header = record.getHeader(); Assert.assertEquals( NAMESPACE1_URI, header.getAttribute(XmlCharDataParser.RECORD_ATTRIBUTE_NAMESPACE_PREFIX+NAMESPACE1_OUTPUT_PREFIX) ); Assert.assertEquals( NAMESPACE2_URI,
java
protected String getKeyword(Step step) { String keyword = step.getKeyword(); return null == keyword ? "" : keyword.trim(); } } }
java
* @return */ protected abstract String productId(); protected void init(@NonNull UnionpayConfig config) { // 1.配置
java
//Simulation of three chains. long diff = 300000L; for (int i = 0; i < 15; i++) { BlockHeader lastHeaderA = chainA.getLastHeader(); Block currentA = chainA.getBlock(lastHeaderA).get(); Function<String, Block> blockLookupChainA = hash -> chainA.getBlock(hash).get(); long difficultyNextBlock = BlockUtils.getDifficultyForNextBlock(currentA, blockLookupChainA); long ts = currentA.getTimestamp() + diff; Block rawBlockA = new Block(currentA.getIndex() + 1, "", currentA.getHash(), ts, 0,
java
* Increase Operation * * @author dennis * */
java
} @Override public Location getLocationByLatLong(Double latitude, Double longitude) { Request request = new Request(Verb.GET, GEOCODE_URL); //request.addQuerystringParameter("limit", SEARCH_LIMIT.toString()); String latlng = latitude.toString()+","+longitude.toString(); request.addQuerystringParameter("latlng", latlng); Location location = getLocationFromRequest(request,false); location.setLatitude(latitude); location.setLongitude(longitude); log.info("Using ####################### latitude {} and longitude {}", new Object[]{latitude, longitude}); log.info("Got ####################### Location {}",location); return location;
java
// find matching strings while (sm.find()) { if (index == null) index = new LineNumberIndex(str); final int off = sm.getStart(); final int lineOffset = index.getLineNumber(off); final String line = index.getLine(off); final StringMatch match = new StringMatch(file, line, lineOffset, off); visitor.found(match); } } } public static void findThreaded( final int threadCount,
java
private String type; private String timestamp; private String version; private Map<String, Object> data;
java
public NovoAvisoBuilder semIp() { this.ip = null; return this; } public NovoAvisoBuilder ipInvalido() { this.ip = "1"; return this; }
java
} /** * Sets the value of the esig property. * * @param value * allowed object is * {@link String } * */ public void setEsig(String value) {
java
holder.bind(newsEntities.get(position)); } @Override public int getItemCount() { return newsEntities.size(); } public void setNewsEntities(List<NewsEntity> newsEntities) { this.newsEntities = newsEntities; notifyItemRangeInserted(0, newsEntities.size());
java
public NotAuthorizedException(String propertyName, String id, CodeException code) { super(code.getMessage()); this.code = code; LOGGER.info("{}: {} - Reason: {}", propertyName, id, code); }
java
public void setPrice(String price) { this.price = price; } public int getAmount() { return amount; } public void setAmount(int amount) { this.amount = amount; } String abs; String price; int amount;
java
import java.io.Serializable; public enum CounterType implements Serializable { BYTES_READ, BYTES_WRITE,
java
public class RequestHeaderAnnotationMapper extends WebBindAnnotationMapper<Header> { @Override Class<Header> annotationType() { return Header.class; } @Override public String getName() { return "org.springframework.web.bind.annotation.RequestHeader"; }
java
package com.xkcoding.mq.kafka.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * @author qsmy */ @RestController public class ProduceController { @Autowired
java
import java.io.Serializable; public class ConfiguracionClienteDto implements Serializable { private String clientId; private String clientSecret; private String endpoint; private String redirectUrl;
java
} } if (e.getKeyCode() == KeyEvent.VK_RIGHT) { if (sliderValue<this.slider.getMaximum()) { sliderValue++;
java
return winner; } @Override public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder source, RecyclerView.ViewHolder target) { if (source.getItemViewType() != target.getItemViewType()) { return false; }
java
} catch (Exception ex) { throw new RuntimeException(ex); } } @Override public void test(Integer port, final RpcAction action) { port = getPort(port); try { RpcConfig.getInstance().setTestMode(true); Tomcat tomcat = createTomcat(port); final String id = action.getClass().getName(); final String url; if (action instanceof HttpAction) { url = "http://localhost:" + port + "/rpc/repo/?hash=http-services/" + id;
java
} boolean isNotCollidingBefore = worldserver.getCollisionBoxes(riddenEntity, riddenEntity.getEntityBoundingBox()).isEmpty(); double preEntityPosX = riddenEntity.posX; double preEntityPosY = riddenEntity.posY;
java
public class ComparaPorNombre implements Comparator <Alumno>{ public int compare(Alumno o1, Alumno o2) { String nombreo1 = o1.getNombre(); String nombreo2 = o2.getNombre();
java
this.ch2 = ch2; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; }
java
"2LKREGMON Heap lock: owner \"Signal dispatcher\" (0x880E28), entry count 1", "2LKREGMON Monitor Cache lock: owner \"Signal dispatcher\" (0x880E28), entry count 1", "2LKREGMON JNI Pinning lock: <unowned>", "2LKREGMON JNI Global Reference lock: <unowned>", "2LKREGMON Classloader lock: <unowned>", "2LKREGMON Binclass lock: <unowned>",
java
} @Test public void shouldExtractEntityConfigsWithOptionalRefsFromChoice() { //change to the OptionalRef xsd didSchemaParser.setExtensionXsdLocation("classpath:test-schema/OptionalRefChoice-Extension.xsd"); didSchemaParser.setup(); Map<String, DidEntityConfig> entityConfigs = didSchemaParser.getEntityConfigs(); Assert.assertEquals("Should extract 1 entity config for the 1 complexType containing a did ref (OptionalRefExample)", 1, entityConfigs.size()); //check the entity configs extracted are for the correct types Assert.assertTrue(entityConfigs.containsKey(OPTIONAL_REF_TYPE));
java
enableOverrides.setActions(enableActions); disableOverrides.setRcas(disableRcas); disableOverrides.setDeciders(disableDeciders); disableOverrides.setActions(disableActions);
java
WebUtils.loadKeyStore( webConfig.getTrustStoreType(), webConfig.getTrustStorePath(), webConfig.getTrustStorePassword()); sslContext = WebUtils.createSSLContext(keyStore, trustStore, webConfig.getKeyStorePassword()); server.addHttpsListener(webConfig.getSslPort(), "localhost", sslContext);
java
import org.moodminds.route.Flowing; /** * Action route definition by the {@link Flow} and argument value functional interface. * * @param <I> the type of the input argument * @param <E> the type of possible exception */ @FunctionalInterface public interface Action1<I, E extends Exception> extends RouteMain1<I, E, Statements<?>, Flowing<?>> {}
java
import org.junit.runner.RunWith; import org.junit.runners.Suite; import com.vaadin.spreadsheet.charts.interactiontests.InteractionTests; import com.vaadin.spreadsheet.charts.typetests.LineAreaScatterTests; import com.vaadin.spreadsheet.charts.typetests.ColumnAndBarTests; import com.vaadin.spreadsheet.charts.typetests.PieAndDonutTests; @RunWith(Suite.class)
java
package com.crowdfunder.control.forms; import java.math.BigDecimal; import javax.validation.constraints.DecimalMax; import javax.validation.constraints.DecimalMin; import com.crowdfunder.control.validation.annotations.ProjectPledgeable; import com.crowdfunder.control.validation.annotations.UserCanPledge;
java
public GlobalMouseWheelListener(Storage data, StatusArea statusConsole) { this.statusConsole = statusConsole; this.record = data; } public void nativeMouseWheelMoved(NativeMouseWheelEvent e) { record.addCommand(new Command(statusConsole, CommandType.MOUSE_WHEEL_MOVE, e.getWheelRotation())); }
java
import java.util.Collection; import jp.gr.java_conf.kgd.library.cool.framework.input.inputs.IConstInputStore; import jp.gr.java_conf.kgd.library.cool.jsfml.input.keys.IConstJSFMLInput; public interface IConstJSFMLInputStore extends IConstInputStore { int INPUT_NUM_MAX = 8;
java
Map.ofEntries( Map.entry(ClimbState.kStartingPosition, new ParallelCommandGroup( new MoveFrontClimberCommand(frontClimber, Rotation2d.fromDegrees(70)), new BackClimbAngleCommand(backClimber, Rotation2d.fromDegrees(45), -Constants.kMaxBackClimberSpeedIn, 0.5) )), // Fully auto section Map.entry(ClimbState.kSequence1, new SequentialCommandGroup( new ParallelCommandGroup( new BackClimbAngleCommand(backClimber, Rotation2d.fromDegrees(90), -Constants.kMaxBackClimberSpeedIn, 0.5), new SequentialCommandGroup( new WaitUntilCommand(() -> backClimber.getAngle().getDegrees() >= 75), new MoveFrontClimberCommand(frontClimber, Rotation2d.fromDegrees(10), 0.6)
java
final Map<String, YObject> source = y.asMap(); final Properties target = new Properties(); for (Map.Entry<String, YObject> entry : source.entrySet()) { target.setProperty(entry.getKey(), entry.getValue().map(String.class)); } return target; } }
java
import codeine.model.Constants; public class ExperimentalConfJsonStore extends JsonStore<ExperimentalConfJson>{ public ExperimentalConfJsonStore() { super(Constants.getExperimentalConfPath(), ExperimentalConfJson.class); }
java
public class SpecialLimits extends org.apache.spark.sql.execution.SparkStrategy { public SpecialLimits () { throw new RuntimeException(); } public scala.collection.Seq<org.apache.spark.sql.execution.SparkPlan> apply (org.apache.spark.sql.catalyst.plans.logical.LogicalPlan plan) { throw new RuntimeException(); } } public org.apache.spark.sql.execution.SparkStrategies.SpecialLimits$ SpecialLimits () { throw new RuntimeException(); }
java
<gh_stars>0 package repository.emprestimo; public class EmprestimoDuplicadoException extends Exception { public EmprestimoDuplicadoException() { super("Não é possível empresta o mesmo livro duas vezes"); } }
java
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (true){ String line = scanner.nextLine(); if (line.equals("end")){ break; } StringBuilder result = new StringBuilder(line).reverse();
java
HSSFRow row = sheet.getRow(j); if (row != null) { int num = row.getLastCellNum(); maxCol = num > maxCol ? num : maxCol; } } return maxCol; } private static int maxCols(XSSFSheet sheet) { int maxCol = 0; for (int j = 0; j < sheet.getLastRowNum() + 1; j++) { XSSFRow row = sheet.getRow(j); if (row != null) { int num = row.getLastCellNum();
java
public String deleteUser(final Model model, final @PathVariable Long userId) { LOGGER.debug("Delete user action {}", userId); userService.delete(userId); setAllUsers(model); return "fragments/user::usersList";
java
public double getTotal() { return value * this.getQuantity(); } }