content stringlengths 263 5.24M | pred_label stringclasses 1
value | pred_score_pos float64 0.6 1 |
|---|---|---|
package com.apress.springrecipes.social;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import com.apress.springrecipes.social.config.SocialConfig;
import com.apress.springrecipes.social.config.WebConfig;
/**
* Created by marten on 14-07-14.
*/
public class Soc... | __label__POS | 0.999932 |
using System;
namespace Atlass.Framework.Enum
{
/// <summary>
/// 数据状态字段
/// </summary>
public class DataStatusConstant
{
/// <summary>
/// 正常
/// </summary>
public static int ENABLE = 1;
/// <summary>
/// 停用
/// </summary>
public sta... | __label__POS | 0.999374 |
using Atlass.Framework.ViewModels;
using Atlass.Framework.ViewModels.YmlConfigs;
using FreeSql;
using System;
namespace Atlass.Framework.DbContext
{
public class DbInstanceFactory
{
private static IFreeSql _freeSql;
private static readonly object locker = new object();
public static Db... | __label__POS | 0.995407 |
using Atlass.Framework.DbContext;
using Atlass.Framework.Models;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
namespace Atlass.Framework.Cache
{
public class TemplateManagerCache
{
private static ConcurrentDictionary<int,cms_template> _templat... | __label__POS | 0.90949 |
<?php
/**
* \AppserverIo\Appserver\PersistenceContainer\CalendarTimerBuilder
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* PHP version 5
*
* @author T... | __label__POS | 0.620146 |
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Atlass.Framework.Cache
{
public class FileChunkCache
{
private static ConcurrentDictionary<string, bool> ChunkCache = new ConcurrentDiction... | __label__POS | 0.698565 |
using Atlass.Framework.Models;
using Atlass.Framework.Models.CmsSet;
using EasyCaching.Core;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
namespace Atlass.Framework.Cache
{
public static class SiteManagerCache
{
... | __label__POS | 0.937346 |
using Atlass.Framework.DbContext;
using Atlass.Framework.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace Atlass.Framework.Cache
{
public static class CmsCacheInit
{
public static void Init()
{
var sqlDb = DbInstanceFactory.GetInstance();
... | __label__POS | 0.840294 |
using System;
using System.Collections.Generic;
using System.Text;
namespace Atlass.Framework.Cache
{
/// <summary>
/// https://www.cnblogs.com/refuge/p/13774008.html
/// </summary>
public class RedisLockHelper
{
private readonly static string _lockKey = "lockKey";
private readonl... | __label__POS | 0.730592 |
<?php
/**
* \AppserverIo\Appserver\PersistenceContainer\TimerBuilder
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* PHP version 5
*
* @author Tim Wagne... | __label__POS | 0.905027 |
/* ***********************************************
* Author : kingthy
* Email : kingthy@gmail.com
* Description : ExpressionParser
*
* ***********************************************/
using System;
using System.Collections.Generic;
using System.Text;
namespace VTemplate.Engine.Evaluator
{
/// <summary>
... | __label__POS | 0.603702 |
defmodule AppsignalTest.Utils do
require ExUnit.Assertions
# Remove loaded from the app so the module is recompiled when called. Do this
# if the module is already loaded before the test env, such as in `mix.exs`.
def purge(mod) do
:code.purge(mod)
:code.delete(mod)
end
def with_frozen_environment... | __label__POS | 0.890555 |
using Atlass.Framework.Common.Log;
using Atlass.Framework.Core.HangfireExtend;
using Atlass.Framework.DbContext;
using Atlass.Framework.Models.Admin;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace Atlass.Framework.Jobs
{
public class TestJob:IJob
{
... | __label__POS | 0.843354 |
package com.appsflyer.unity;
import android.util.Log;
import com.appsflyer.api.InAppPurchaseEvent;
import com.appsflyer.api.SubscriptionPurchaseEvent;
import com.appsflyer.api.PurchaseClient;
import com.appsflyer.api.Store;
import com.appsflyer.internal.models.InAppPurchaseValidationResult;
import com.appsflyer.intern... | __label__POS | 0.7739 |
package com.appsflyer.unity;
import android.annotation.SuppressLint;
import android.os.Build;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.appsflyer.api.InAppPurchaseEvent;
import com.appsflyer.api.PurchaseClient;... | __label__POS | 0.835188 |
// JAVA METHODS II
public class ExtraMethodConcepts {
public static void main(String[] args) {
// Call the method to print the welcome message
printWelcomeMessage();
}
// Method that print a welcome message
public static void printWelcomeMessage() {
System.out.println("Welcome ... | __label__POS | 0.894772 |
// METHOD OVERLOADING IN JAVA
/*
Method overloading in java refers to the ability to define multiple methods in a class witht the same
names but with different parameters. These methods can have different numbers or type of parameters
When you call an overloaded metho, the java compiler determine which version of th... | __label__POS | 0.631437 |
// RETURN VALUES IN JAVA METHODS
// if you want the method to return a value you can use a primitive
// data type such as int, char and so on instead of void to return a keyword inside the method
public class MethodReturnType {
// Method to add two numbers and return the sum
public static double add_numbers(... | __label__POS | 0.99733 |
// METHODS AND CONTROL STATEMENTS IN JAVA.
public class ControlStatementInMEthods {
// Method to check access based on age
static void Checker(int age) {
// Print the age being checked
System.out.println("My age is: " + age);
// Check if the age is less than 18
if (age < 18) {
... | __label__POS | 0.994153 |
# Chapter 01 - Java Basics
## Overview
This chapter of the project contains simple Java programs that introduce basic concepts of Java programming. It is divided into three parts, each focusing on different fundamental aspects of the language.
## Parts
### Part 01 - Java Basics
This part of the project covers the ... | __label__POS | 0.635106 |
public class StringManipulations {
public static void main(String[] args) {
// Introduction to Strings
String message = "Welcome to Java";
// Getting the length of a string
int length = message.length();
System.out.println("The length of \"" + message + "\" is " + l... | __label__POS | 0.75263 |
### Examples
It's our goal to create a wide variety of example of how Tether
can be used. Here's what we have so far, please send a PR with
any examples you might create.
#### Beginner
- [simple](../../examples/simple): A simple example to get you started
- [out-of-bounds](../../examples/out-of-bounds): How to hide... | __label__POS | 0.941365 |
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Data;
namespace Atlass.Framework.Common
{
public static partial class ToJsonEx
{
public static readonly JsonSerialize... | __label__POS | 0.995984 |
public class Character {
public static void main(String[] args) {
// char Data Type Examples
char letter = 'A';
char numChar = '4';
System.out.println("char Data Type Examples:");
System.out.println("letter: " + letter); // Output: letter: A
System.out.println("numC... | __label__POS | 0.842896 |
import java.util.Scanner;
public class StringHandling {
public static void main(String[] args) {
// 1. Reading Strings from the Console
// Explanation:
// Creates a Scanner object to read input from the console.
// input.next() reads the next token (word) from the input, d... | __label__POS | 0.941419 |
public class MaxMinAbs {
public static void main(String[] args) {
/*
### Max, Min, and Abs Methods
The Math class in Java provides methods to find the maximum, minimum, and absolute
values of given numbers. These methods are useful for comparing values and ensuring
non-nega... | __label__POS | 0.933776 |
public class CharacterTesting {
public static void main(String[] args) {
// Comparing Characters Using Relational Operators
char char1 = 'a';
char char2 = 'b';
char char3 = 'A';
char char4 = '1';
char char5 = '8';
// Compare using relational operators
... | __label__POS | 0.999467 |
import java.util.Scanner;
public class StringHandlingAndFormatting {
public static void main(String[] args) {
// 1. Reading Strings from the Console
Scanner input = new Scanner(System.in);
// Read three strings separated by spaces
System.out.print("Enter three words separat... | __label__POS | 0.713227 |
public class Tribonacci {
public static int tribonacci(int n) {
if (n == 0) {
return 0; // Base case: T(0) = 0
} else if (n == 1 || n == 2) {
return 1; // Base case: T(1) = T(2) = 1
} else {
// Recursive case: T(n) = T(n-1) + T(n-2) + T(n-3)
re... | __label__POS | 0.999695 |
// RECURSION CONCEPT cdIN JAVA
/*
Recursion in Java refers to the process where a method calls itself to solve a problem. In recursive programming, a
method solves a problem by dividing it into smaller, similar subproblems. These subproblems are solved by calling the
same method recursively until a base case is reach... | __label__POS | 0.99661 |
public class Fibonacci {
// Method to calculate the nth Fibonacci term
public static int calculateFibonacciTerm(int termIndex) {
// Base case: if termIndex is 0 or 1, return termIndex
if (termIndex == 0 || termIndex == 1) {
return termIndex; // Fibonacci sequence starts with 0 and 1
... | __label__POS | 0.996448 |
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Snowflake.Core;
using Yitter.IdGenerator;
namespace Atlass.Framework.Common
{
public class IdHelper
{
/// <summary>
/// snowflake
/// </... | __label__POS | 0.661595 |
public class SumOfDigits {
public static int sumOfDigits(int number) {
// Base case: if the number is a single digit, return the number itself
if (number < 10) {
return number;
}
// Recursive case: calculate sum of digits of the number by summing the last digit
//... | __label__POS | 1.000002 |
public class GCDCalculator {
public static int calculate_gcd(int a, int b) {
// Base case: if one of the numbers is 0, the other number is the GCD
if (b == 0) {
return a;
}
// Recursive case: GCD(a, b) = GCD(b, a % b)
else {
return calculate_g... | __label__POS | 0.995732 |
#import <AppMetricaHostState/AppMetricaHostState.h>
#import "AMAHostStateControllerFactory.h"
#import "AMAApplicationHostStateProvider.h"
#import "AMAExtensionHostStateProvider.h"
#import "AMAHostStateControlling.h"
@interface AMAHostStateControllerFactory ()
@property (nonatomic, assign, readonly) BOOL isExtension;... | __label__POS | 0.63415 |
package com.appsflyer.reactnative;
/**
* Created by maxim on 11/17/16.
*/
public class RNAppsFlyerConstants {
final static String PLUGIN_VERSION = "6.17.5";
final static String NO_DEVKEY_FOUND = "No 'devKey' found or its empty";
final static String UNKNOWN_ERROR = "AF Unknown Error";
final static S... | __label__POS | 0.847763 |
package chapter_03.ClassesAndObjects;
/**
* This is a simple Java program that demonstrates the basics of
* creating classes and objects without using constructors.
*/
/**
* This is the ClassBasics class, which contains the main method.
* The main method is the entry point of every Java application.
*/
public clas... | __label__POS | 0.79331 |
package chapter_03.ClassesAndObjects;
/*
1. Creating Multiple Objects from a Single Class:
- You can create multiple objects from the same class.
- Each object will have its own set of attributes, meaning they can have different values.
2. Creating Multiple Classes in a Single File:
- In a single Java file... | __label__POS | 0.804269 |
defmodule Appsignal.Test.Nif do
use Appsignal.Test.Wrapper
alias Appsignal.Nif
def create_root_span(namespace) do
add(:create_root_span, {namespace})
Nif.create_root_span(namespace)
end
def create_root_span_with_timestamp(namespace, sec, nsec) do
add(:create_root_span_with_timestamp, {namespace,... | __label__POS | 0.757162 |
package chapter_01.part_02;
// OPERATORS IN JAVA
// operators in java are used perform operations in variables and value
/* Operators in java are categorized in the following:
1: - arithmentic 0perators:
Arithmetic Operators are used to perform normal Arithmetic operations like:
Example +, -, /, *, %, ++, ... | __label__POS | 0.678757 |
package chapter_01.part_02;
// BOOLEANS IN JAVA
/*
In programming, booleans are a data type that can have only one of two values: true or false.
Java provides a boolean data type to represent these values.
A boolean data type is declared using the boolean keyword,
similar to how integers are declared using int, or f... | __label__POS | 0.995442 |
package chapter_01.part_02;
// MATHEMATICS IN JAVA
/*
In java, The java Math class has more and many methods that allows java programmers like you to perform
mathematical tasks on numbers the math class has methods to find minimum, maximum and square root of a number
It also allow you to find the random nu... | __label__POS | 0.609266 |
package chapter_01.part_01;
/*
Hello World: Your first Java program.
Every line of code that is inside a class is executed.
In our code below, a class called Main is declared.
A class name should always start with an uppercase letter.
Java is case-sensitive. Main and MaiN are two different things.
*/
public class M... | __label__POS | 0.987648 |
package chapter_01.part_01;
// NUMERIC DATA TYPE IN JAVA
/*
In Java, you can work with various types of numerals,
including integers and floating-point numbers. You can use
println() method to print numbers, but you do not enclose them
in double quotes.
Let's explore some examples below:
*/
public class Numerals {
... | __label__POS | 0.984166 |
public class Main {
public static void main(String[] args) {
System.out.println("Welcome to the Java Basics Part 03");
System.out.println("This project contains various examples to help you understand the fundamentals of Java programming.");
System.out.println("Here is an overview of what yo... | __label__POS | 0.802966 |
/*
In Java, control statements are used to control the flow of execution in a program. They determine the order in which
statements are executed based on certain conditions or loops. Control statements allow developers to make decisions,
repeat code blocks, and perform various actions based on specific conditions.
The... | __label__POS | 0.728769 |
/*
2. Advanced While Loop Concepts:
This file includes more complex examples of while loops, including the use of sentinel values,
input redirection, and loop design strategies.
*/
import java.util.Scanner;
public class SentinelAndInputRedirection{
public static void main(String[] args) {
// Example 1: ... | __label__POS | 0.913825 |
// FOR LOOPS IN JAVA
/*
Certainly! Let's explore the for loop in Java.
For Loop:
A for loop in Java is used to iterate over a range of values.
It consists of three parts: initialization, condition, and increment/decrement.
When you know exactly how many times you want to loop through a block of code, use the for loo... | __label__POS | 0.904753 |
// BREAK KEYWORD
//1. break Keyword:
// The break keyword is used to terminate the loop prematurely.
// When encountered, it immediately exits the loop, and the control flow
// moves to the statement immediately following the loop.
public class BreakContinue {
public stati... | __label__POS | 0.984397 |
/*
Advanced For Loop Concepts in Java
This file provides a detailed explanation of how for loops work in Java, including
initialization, loop continuation conditions, and iteration actions. It includes various
examples to illustrate different for loop constructs and best practices.
*/
public class ForLoopAdvancedConc... | __label__POS | 0.897088 |
/*
5.2 The while Loop
Key Points:
- A while loop executes statements repeatedly while the condition is true.
- The syntax for the while loop is:
while (loop-continuation-condition) {
// Loop body
Statement(s);
}
- The part of the loop that contains the statements to be repeated is called the loop body.
- Eac... | __label__POS | 0.98722 |
/*
Loop Design Strategies
Writing a correct loop is a critical skill in programming.
Consider these three steps when designing a loop:
Step 1: Identify the statements that need to be repeated.
Step 2: Wrap these statements in a loop structure.
Step 3: Add the loop-continuation-condition and appropriate control mechan... | __label__POS | 0.988105 |
/*
1. While Loop:
A while loop in Java repeatedly executes a block of code as long as a given condition is true. Here's the syntax:
while (condition) {
// Code block to be executed
}
The condition is evaluated before each iteration. If the condition is true, the code block is executed.
If the condition is false... | __label__POS | 0.991466 |
package arrays;
public class ArrayCopyExample {
public static void main(String[] args) {
// Source array
int[] sourceArray = {1, 2, 3, 4, 5};
// Destination array with the same length as source array
int[] destinationArray = new int[sourceArray.length];
// Copy elements f... | __label__POS | 0.989528 |
/*
* Theme: Number Analysis with Arrays in Java
*
* This Java program allows users to input a set of numbers, calculates their sum, product,
* and average, and then displays the results. It demonstrates the use of arrays in Java
* for storing and processing numerical data, along with exception handling for inpu... | __label__POS | 0.961705 |
/*
* This Java program demonstrates how to copy the contents of one array into another array.
*
* The process of copying arrays involves the following steps:
*
* 1. Declaration and Initialization:
* - Declare and initialize the source array with the elements to be copied.
* - Declare the target array wit... | __label__POS | 0.984751 |
package arrays;
// MULT DIMENSIONAL ARRAYS
//
//A multidimensional array in Java is an array that contains other arrays as its elements. Unlike a
// one-dimensional array, which represents a list of elements in a single line, a multidimensional array represents a
// tabular or grid-like structure where elements are org... | __label__POS | 0.851456 |
/*
* JAVA ARRAYS AND USER INPUTS
*/
package arrays;
import java.util.Scanner;
public class UserInput {
public static void main(String[] args) {
int size = 5; // size of the array
// an array to store user input
double[] numbers = new double[size];
// Using try-with-re... | __label__POS | 0.862129 |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Atlass.Framework.Common
{
public static class PathUtils
{
public static readonly char SeparatorChar = Path.DirectorySeparatorChar;
public stat... | __label__POS | 0.970935 |
package arrays;
// ARRAY IN JAVA.
/*
In Java, an array is a data structure that allows you to store a fixed-size sequence of elements of the same type.
It provides a convenient way to group multiple variables of the same type under a single name. Arrays are used to store
multiple values in a single variable, instead o... | __label__POS | 0.964009 |
package arrays;
/*
The import statement import java.util.Arrays; is necessary to bring the Arrays class into your program's scope.
The Arrays class is a utility class provided by the Java standard library (java.util package) that contains several
static methods for working with arrays. In this particular example, we u... | __label__POS | 0.860537 |
public class BasicOperation {
public static int operation(String a, String b, String op) {
// Convert strings to integers
int num1 = Integer.parseInt(a);
int num2 = Integer.parseInt(b);
// Perform the operation based on the given 'op'
if(op.equals("add")){
return num1 + num2... | __label__POS | 1.000001 |
defmodule Appsignal.NifBehaviour do
@moduledoc false
@callback loaded?() :: boolean()
@callback running_in_container?() :: boolean()
end
defmodule Appsignal.Nif do
@behaviour Appsignal.NifBehaviour
@moduledoc false
@on_load :init
def init do
path = :filename.join(:code.priv_dir(:appsignal), ~c"apps... | __label__POS | 0.984233 |
public class AnyPrimeNumberInRange {
// Helper function to check if a number is prime
public static boolean isPrime(int num) {
if (num <= 1) {
return false; // Numbers 0 and 1 are not prime
}
for (int i = 2; i * i <= num; i++) {
if (num % i == 0) {
... | __label__POS | 0.999962 |
# Edabit Java Solutions - Very Easy
This directory contains Java solutions for the [very easy](https://edabit.com/) difficulty level challenges on the Edabit platform.
## programming solutions
1. **[AreaOfTriangle.java](AreaOfTriangle.java)**: Computes the area of a triangle given its base and height.
2. **[AreTheNu... | __label__POS | 0.77458 |
package DanielLiang.FundamentalOfProgramming.ElementaryProgramming;
import java.util.Scanner;
public class FutureInvestmentValue {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
// user prompt
System.out.print("What is Your Investment Amou... | __label__POS | 0.858799 |
package DanielLiang.FundamentalOfProgramming.ElementaryProgramming;
import java.util.Scanner;
public class ShowCurrentTimeGMT {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
// enter the time zone offset to GMT
System.out.print("Enter the t... | __label__POS | 0.943248 |
package DanielLiang.FundamentalOfProgramming.ElementaryProgramming;
import java.util.Scanner;
public class TriangleArea {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
System.out.print("Enter three Points of the triangle: ");
double x1 = i... | __label__POS | 0.917833 |
package DanielLiang.FundamentalOfProgramming.ElementaryProgramming;
import java.util.*;
public class DrivingCost {
public static void main(String[] args) {
try (// user prompt
Scanner input = new Scanner(System.in)) {
System.out.print("Driving cost calculator.");
System.ou... | __label__POS | 0.91874 |
defmodule Appsignal.Ecto do
require Logger
@tracer Application.compile_env(:appsignal, :appsignal_tracer, Appsignal.Tracer)
@span Application.compile_env(:appsignal, :appsignal_span, Appsignal.Span)
import Appsignal.Utils, only: [module_name: 1]
@doc """
Attaches `Appsignal.Ecto` to the Ecto telemetry cha... | __label__POS | 0.777636 |
package DanielLiang.FundamentalOfProgramming.ElementaryProgramming;
import java.util.Scanner;
public class Acceleration {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
// user prompt:
// starting velocity, final velocity and time taken
... | __label__POS | 0.997596 |
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
namespace Atlass.Framework.Common
{
public static class DirectoryUtils
{
public static void Copy(string sourcePath, string targetPath)
{
Copy(sourcePath, targetPath, true);
... | __label__POS | 0.855218 |
package DanielLiang.FundamentalOfProgramming.ElementaryProgramming;
import java.util.Scanner;
public class CompoundValue {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
// scanner object and user input
System.out.print("Enter the monthly s... | __label__POS | 0.876064 |
package DanielLiang.FundamentalOfProgramming.ElementaryProgramming;
import java.util.Scanner;
public class ComputeChange {
public static void main(String[] args) {
try (// Create a Scanner
Scanner input = new Scanner(System.in)) {
// Receive the amount as an integer
// with... | __label__POS | 0.992054 |
package DanielLiang.FundamentalOfProgramming.ElementaryProgramming;
import java.util.Scanner;
public class BodyMassIndex {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
// user prompt
System.out.println("BMI Calculator: mass is in punds a... | __label__POS | 0.981361 |
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
namespace Atlass.Framework.Common
{
public class NpoiHelper
{
/// <summary>
/// 获取... | __label__POS | 0.904363 |
defmodule Appsignal.Test.Span do
@moduledoc false
use Appsignal.Test.Wrapper
alias Appsignal.Span
def create_root(namespace, pid) do
add(:create_root, {namespace, pid})
Span.create_root(namespace, pid)
end
def add_error(span, exception, stacktrace) do
add(:add_error, {span, exception, stacktra... | __label__POS | 0.748927 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class FutureDates {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// prompt for today's day
System.out.print("Enter today's day (Sunday is 0, Monday is 1, ..., Sat... | __label__POS | 0.942255 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class ISBNChecker {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// user prompt to enter the first 9 digits of the ISBN as integer
System.out.print("Enter the fi... | __label__POS | 0.9976 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class HeadOrTail {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
System.out.println("Enter q to exit.");
while (true) {
int random = ... | __label__POS | 0.998603 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class Quadratic {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// user prmpt for a, b, and c
System.out.print("Enter a, b, c: ");
double a = input.nextDou... | __label__POS | 0.844305 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class CompareCosts {
public static void main(String[] args) {
try (Scanner scanner = new Scanner(System.in)) {
// user prompt to enter weight and price for package 1
System.out.print("Enter we... | __label__POS | 0.969384 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class ShippingCost {
public static void main(String[] args) {
try (// user prompt to enter the weight of the package
Scanner scanner = new Scanner(System.in)) {
System.out.print("Enter the weight ... | __label__POS | 0.997454 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class AdditionQuiz {
public static void main(String[] args) {
// generate three random numbers
int number1 = (int)(System.currentTimeMillis() % 10);
int number2 = (int)(System.currentTimeMillis() / 7 ... | __label__POS | 0.998574 |
using Atlass.Framework.Common;
using Atlass.Framework.Common.Extends;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace System
{
public static class StringExtensions
{
#region 字符串扩展判断
/// <summary>
/// 判断是否是手机号码
... | __label__POS | 0.762063 |
package com.apress.springrecipes.social.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.social.twitter.api.Twitter;
import org.springframework.stereotype.... | __label__POS | 0.90584 |
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks... | __label__POS | 0.873471 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class Lottery {
@SuppressWarnings("resource")
public static void main(String[] args) {
// random lottery number generation
// Generates a number between 100 and 999 (inclusive)
int lottery = (int... | __label__POS | 0.953926 |
defmodule Appsignal.Error.Backend do
@moduledoc false
require Logger
@tracer Application.compile_env(:appsignal, :appsignal_tracer, Appsignal.Tracer)
@span Application.compile_env(:appsignal, :appsignal_span, Appsignal.Span)
@behaviour :gen_event
def init(opts), do: {:ok, opts}
def attach do
case... | __label__POS | 0.961992 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Atlass.Framework.Common
{
public static partial class Ext
{
#region 数值转换
/// <summary>
/// 转换为可空整型
/// </summary>
/// <param name="data">数据</param>
public static i... | __label__POS | 0.758264 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class ComputeChange {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
// receive the amount
System.out.print("Enter an amount in double, for example 11.... | __label__POS | 0.988353 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class ShowCurrentTime {
public static void main(String[] args) {
try (Scanner scanner = new Scanner(System.in)) {
// prompt the user to enter the time zone offset to GMT
System.out.print("Ente... | __label__POS | 0.838472 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class SortThreeNumbers {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
// user prompt for three numbers
System.out.print("Enter three integers: ");
... | __label__POS | 0.996482 |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace Atlass.Framework.Common
{
public class ShellHelper
{
public static string Bash(string command)
{
var escapedArgs = command.Replace("\"", "\\\"");
var process = new Pro... | __label__POS | 0.997161 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class BodyMassIndex {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
// weight in pounds
System.out.print("Enter weight in pounds: ");
int... | __label__POS | 0.817524 |
package DanielLiang.FundamentalOfProgramming.Selections;
import java.util.Scanner;
public class TrianglePerimeter {
public static void main(String[] args) {
try (// user prompt to enter the edges of the triangle
Scanner scanner = new Scanner(System.in)) {
System.out.println("Enter the ... | __label__POS | 0.865724 |
import java.util.Scanner;
public class TwoHighestScores {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the number of students: ");
int numStudents = scanner.nextInt();
scanner.nextLine(); // Consume newline character
... | __label__POS | 0.908153 |
import java.util.Scanner;
public class NumberAnalyzer {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int positiveCount = 0;
int negativeCount = 0;
int total = 0;
int count = 0;
System.out.print("Enter an integer, the input ends... | __label__POS | 0.999321 |
import java.util.Scanner;
public class AdditionQuizLoop {
public static void main(String[] args) {
final int NUMBER_OF_QUESTIONS = 10;
int correctCount = 0;
int count = 0;
long startTime = System.currentTimeMillis();
String output = "";
Scanner input = new Scanner(Sy... | __label__POS | 0.999562 |
import java.util.Scanner;
public class DisplayPyramids {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// enter the number of lines
System.out.print("Enter the number of lines (1 to 15): ");
int n = scanner.nextInt();
//... | __label__POS | 0.998907 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.