Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java

DON'T DO THAT WITH YOU, go to python!
Comment

java

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.
Comment

java

Java is fast, secure, and reliable.Developers use Java to construct 
applications in laptops, data centres, game consoles, scientific 
supercomputers, cell phones, and other devices.
Comment

Java

Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let application developers write once, run anywhere (WORA),[17] meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.[18] Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities (such as reflection and runtime code modification) that are typically not available in traditional compiled languages. As of 2019, Java was one of the most popular programming languages in use according to GitHub,[19][20] particularly for client-server web applications, with a reported 9 million developers.[21]
Comment

java

System.out.println(something)
Comment

java

	An incredible language that receives far more hate than it deserves
because of it's poor beginnings.
	Everyone remembers the slow java applets but often fail to understand
Java's many positives including:
 - compatability with many different systems
 - Just-In-Time compilation making it almost as fast as a native language
 - the wide range of high-quality and open source libraries developed over
   many years

	Sure, it may not look as sexy as Python or NodeJS, but when you're
debugging the call stack 50 functions deep, you'll be glad you picked Java
Comment

java

function test2()
{
    // defer the execution of anonymous function for 
    // 3 seconds and go to next line of code.
    setTimeout(function(){ 

        alert('hello');
    }, 3000);  

    alert('hi');
}
Comment

java

As a grepper community member, I am recommanding you to learn any programming
language by making your hands dirty in it.
Dont't just watch videos to learn it as it is same as learn to swim by watching 
youtube videos.
You can learn this language on a website that teaches you with giving some relevant 
exercises on learning.
I am listing you some of the good websites that I know to learn a new programming
language in a right way,
1. https://www.w3schools.com/java/
2. https://www.learnjavaonline.org/
3. https://www.programiz.com/java-programming
Comment

java

public class Example {
  public static void main(String[] args) {
  	System.out.println("Hello, world!"); 
  }
}
Comment

java

import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicInteger;

public class WeightRandom<T> {

    private final List<T> items = new ArrayList<>();
    private double[] weights;

    public WeightRandom(List<ItemWithWeight<T>> itemsWithWeight) {
        this.calWeights(itemsWithWeight);
    }

    /**
     * 計算權重,初始化或者重新定義權重時使用
     * 
     */
    public void calWeights(List<ItemWithWeight<T>> itemsWithWeight) {
        items.clear();

        // 計算權重總和
        double originWeightSum = 0;
        for (ItemWithWeight<T> itemWithWeight : itemsWithWeight) {
            double weight = itemWithWeight.getWeight();
            if (weight <= 0) {
                continue;
            }

            items.add(itemWithWeight.getItem());
            if (Double.isInfinite(weight)) {
                weight = 10000.0D;
            }
            if (Double.isNaN(weight)) {
                weight = 1.0D;
            }
            originWeightSum += weight;
        }

        // 計算每個item的實際權重比例
        double[] actualWeightRatios = new double[items.size()];
        int index = 0;
        for (ItemWithWeight<T> itemWithWeight : itemsWithWeight) {
            double weight = itemWithWeight.getWeight();
            if (weight <= 0) {
                continue;
            }
            actualWeightRatios[index++] = weight / originWeightSum;
        }

        // 計算每個item的權重范圍
        // 權重范圍起始位置
        weights = new double[items.size()];
        double weightRangeStartPos = 0;
        for (int i = 0; i < index; i++) {
            weights[i] = weightRangeStartPos + actualWeightRatios[i];
            weightRangeStartPos += actualWeightRatios[i];
        }
    }

    /**
     * 基於權重隨機算法選擇
     * 
     */
    public T choose() {
        double random = ThreadLocalRandom.current().nextDouble();
        int index = Arrays.binarySearch(weights, random);
        if (index < 0) {
            index = -index - 1;
        } else {
            return items.get(index);
        }

        if (index < weights.length && random < weights[index]) {
            return items.get(index);
        }

        // 通常不會走到這裡,為瞭保證能得到正確的返回,這裡隨便返回一個
        return items.get(0);
    }

    public static class ItemWithWeight<T> {
        T item;
        double weight;

        public ItemWithWeight() {
        }

        public ItemWithWeight(T item, double weight) {
            this.item = item;
            this.weight = weight;
        }

        public T getItem() {
            return item;
        }

        public void setItem(T item) {
            this.item = item;
        }

        public double getWeight() {
            return weight;
        }

        public void setWeight(double weight) {
            this.weight = weight;
        }
    }

    public static void main(String[] args) {
        // for test
        int sampleCount = 1_000_000;

        ItemWithWeight<String> server1 = new ItemWithWeight<>("server1", 1.0);
        ItemWithWeight<String> server2 = new ItemWithWeight<>("server2", 3.0);
        ItemWithWeight<String> server3 = new ItemWithWeight<>("server3", 2.0);

        WeightRandom<String> weightRandom = new WeightRandom<>(Arrays.asList(server1, server2, server3));

        // 統計 (這裡用 AtomicInteger 僅僅是因為寫起來比較方便,這是一個單線程測試)
        Map<String, AtomicInteger> statistics = new HashMap<>();

        for (int i = 0; i < sampleCount; i++) {
            statistics
                    .computeIfAbsent(weightRandom.choose(), (k) -> new AtomicInteger())
                    .incrementAndGet();
        }

        statistics.forEach((k, v) -> {
            double hit = (double) v.get() / sampleCount;
            System.out.println(k + ", hit:" + hit);
        });
    }
}
Comment

java

create an application containing an array that stores eight integers. the application should call five methods that in turn (1) display all the integers, (2) display all the integers in reverse order ,(3) display the sum of the integers and (4) display all values that are higher than the calculated average value. Save the file as ArrayMethodDemo.java.
Comment

Java

if (return == true){
  	Do something...
}
Comment

Java

var isFetching: boolean = false;
Comment

Java

public class demo{
public static void main(String []args){
System.out.println("hello world in Java");
}
}
Comment

Java

# import sys
# rop=[]
# for line in sys.stdin:
#     rop.append(line.strip())
# for i in rop:
#     print(i)
    
def ratatouille():
    N, P = map(int, input().strip().split())
    R = list(map(int, input().strip().split()))
    Q = []
    for _ in range(N):
        Q.append(list(map(int, input().strip().split())))
    # print(Q,R)
    choices = []
    for i in range(N):
        for j in range(P):
            q, r = Q[i][j], R[i]
            lower = max(1, (10 * q + 11 * r - 1) // (11 * r))
            upper = (10 * q) // (9 * r)
            if lower > upper: continue
            choices.append((lower, False, i, q))
            choices.append((upper, True, i, q))
    choices.sort()

    count = 0
    quantities = [[] for _ in range(N)]
    for (_, is_upper, i, q) in choices:
        if is_upper:
            if q in quantities[i]:
                quantities[i].remove(q)
        else:
            quantities[i].append(q)
            if all(quantities):
                count += 1
                for j in range(N):
                    del quantities[j][0]
    return count

for case in range(1):
    print(ratatouille())
Comment

java

Java is a high-level, class-based, object-oriented programming language
that is designed to have as few implementation dependencies as possible.
Comment

Java

// Hello World in Java

class HelloWorld {
  static public void main( String args[] ) {
    System.out.println( "Hello World!" );
  }
}
Comment

java

Java is a programming language and 
computing platform first released by Sun Microsystems in 1995. 

It has evolved from humble beginnings to power a large share 
of today’s digital world, 
by providing the reliable platform upon which many services 
and applications are built. 

New, innovative products and digital services designed 
for the future continue to rely on Java, as well.
Comment

java

public class Main {
	public static void main(String[] args) {
		System.out.println("Hello, World!"); 
    }
}
Comment

Java

# import sys
# rop=[]
# for line in sys.stdin:
#     rop.append(line.strip())
# for i in rop:
#     print(i)
    
def ratatouille():
    N, P = map(int, input().strip().split())
    R = list(map(int, input().strip().split()))
    Q = []
    for _ in range(N):
        Q.append(list(map(int, input().strip().split())))
    # print(Q,R)
    choices = []
    for i in range(N):
        for j in range(P):
            q, r = Q[i][j], R[i]
            lower = max(1, (10 * q + 11 * r - 1) // (11 * r))
            upper = (10 * q) // (9 * r)
            if lower > upper: continue
            choices.append((lower, False, i, q))
            choices.append((upper, True, i, q))
    choices.sort()

    count = 0
    quantities = [[] for _ in range(N)]
    for (_, is_upper, i, q) in choices:
        if is_upper:
            if q in quantities[i]:
                quantities[i].remove(q)
        else:
            quantities[i].append(q)
            if all(quantities):
                count += 1
                for j in range(N):
                    del quantities[j][0]
    return count

for case in range(1):
    print(ratatouille())
Comment

java

File file = new File("validFile.txt");
Scanner fileReader = null;
try {
    fileReader = new Scanner(file);
} catch(FileNotFoundException e) {
    System.exit(1);
}
while(fileReader.hasNext()) {
    //code here
}
Comment

java

go for it if and only if u wanted pure OOP. rather go for python
Comment

java

Java is a high-level, class-based, 
object-oriented programming language 
that is designed to have as few 
implementation dependencies as possible.
Comment

java

"java is a coding language"
Comment

java

Hello, I would like to know if it is possible to somehow configure the ore for the excavator in the config?

Is it possible to change the amount of ore in the vein and its composition?
Comment

java

            A1.setArregloA((Math.random()*30));
Comment

java

3 //t
3  //n
1 3 2  //pi
2  //n
0 3  //pi
1  //n
1  //pi
1  //n
1  //pi
1  //n
2  //pi
1  //n
1  //pi
Comment

java

1. select | total: 1 . SELECT * FROM `settings` WHERE id = 2 ;
Comment

java

int i = 0;
i += 1;
system.out.printlln(i);
Comment

java

import java.text.DecimalFormat
Comment

java

Object.defineproperty(logger, 'enabled', {
    get() {
      return test();
    },
    configurable: true,
    enumerable: true
});
Comment

java

print("hrrlp")
Comment

java

 public void showDetails()
    {
        System.out.println("Name: " + name +"
Employee Number: " + empNo +"
Age: "+ age);
        
Comment

java

{
    "html_attributions": [],
    "result": {
        "formatted_address": "1207 I St, Modesto, CA 95354, USA",
        "icon": "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/generic_business-71.png",
        "name": "Arata, Swingle, Van Egmond &amp; Heitlinger",
        "rating": 4.0999999999999996447286321199499070644378662109375,
        "reviews": [
            {
                "author_name": "Michele Martin",
                "author_url": "https://www.google.com/maps/contrib/116825151572202670365/reviews",
                "language": "en",
                "profile_photo_url": "https://lh3.googleusercontent.com/a/AATXAJydT6892qyPV4kviIVBfY-d0pocWWgXCJgx3Xvh=s128-c0x00000000-cc-rp-mo-ba3",
                "rating": 5,
                "relative_time_description": "5 months ago",
                "text": "The best experience with a lawyer. They listen to you and are taking care of my case in less time than I thought it would take. If you have any employer issues, I highly recommend them. They take care of everything.",
                "time": 1614462143
            },
            {
                "author_name": "L Good",
                "author_url": "https://www.google.com/maps/contrib/108568469152316385738/reviews",
                "language": "en",
                "profile_photo_url": "https://lh3.googleusercontent.com/a/AATXAJxZ1vUaiIosnO2Yq2pWA-HPolyxDvGKGxe3T-cB=s128-c0x00000000-cc-rp-mo",
                "rating": 1,
                "relative_time_description": "2 years ago",
                "text": "Richard Moths whom was hired by a beneficiary of my mothers estate is very crooked, I have told him of my mothers credit cards possibly being used after her death, fraudulently signed documents with my name on them that I never signed and have proof that I never signed them and my wishes not to have the house divided amongst family that does not get along, but instead sold so everyone can go about there way peacefully , but no he has dragged this thing out 2yrs now, and is definitely trying to look out for his best interest and the beneficiary that hired him whom is also crooked. Don't know how the firm allows him to keep working there.",
                "time": 1553525174
            },
            {
                "author_name": "john goertz",
                "author_url": "https://www.google.com/maps/contrib/114830096952165097254/reviews",
                "language": "en",
                "profile_photo_url": "https://lh3.googleusercontent.com/a/AATXAJwPV5oXIsEht4qnNFfu2m1UU9vViMxbMfn8OmYp=s128-c0x00000000-cc-rp-mo-ba4",
                "rating": 4,
                "relative_time_description": "a year ago",
                "text": "Looking for a no-nonsense approach a good place to call for personal injury",
                "time": 1576751459
            },
            {
                "author_name": "James Moore",
                "author_url": "https://www.google.com/maps/contrib/116532586667191438218/reviews",
                "language": "en",
                "profile_photo_url": "https://lh3.googleusercontent.com/a-/AOh14GjGL4ryxQUytdsNJ7SCWfMl2qWm373wGIlgFndmoAE=s128-c0x00000000-cc-rp-mo-ba5",
                "rating": 5,
                "relative_time_description": "a year ago",
                "text": "This firm exemplifies how a multi-faceted group of attorneys can work together to achieve positive results. Their secretary Sally listened to my initial call and coordinated a meeting with their legal team. From there, they successfully handled everything from setting up a conservatorship, litigation, initiating a special needs trust, and then nagivated through the probate process. Despite MY flaws and misconceptions, they continuously and patiently educated me each step of the way using the highest and best legal practices as their guide.",
                "time": 1575071201
            },
            {
                "author_name": "Jose bedoya",
                "author_url": "https://www.google.com/maps/contrib/113810295694646765542/reviews",
                "language": "en",
                "profile_photo_url": "https://lh3.googleusercontent.com/a/AATXAJztCmQ2wr_Bn4JfNxPP-HuxTz3bUzAGPujhPd22=s128-c0x00000000-cc-rp-mo-ba4",
                "rating": 5,
                "relative_time_description": "a year ago",
                "text": "Best lawyers around. George and Amanda are awesome.",
                "time": 1578389891
            }
        ],
        "url": "https://maps.google.com/?cid=1023383271885861136",
        "user_ratings_total": 19,
        "vicinity": "1207 I Street, Modesto"
    },
    "status": "OK"
}
Comment

Java

// This is an example of a single line comment using two slashes

/*
 * This is an example of a multiple line comment using the slash and asterisk.
 * This type of comment can be used to hold a lot of information or deactivate
 * code, but it is very important to remember to close the comment.
 */

package fibsandlies;

import java.util.Map;
import java.util.HashMap;

/**
 * This is an example of a Javadoc comment; Javadoc can compile documentation
 * from this text. Javadoc comments must immediately precede the class, method,
 * or field being documented.
 * @author Wikipedia Volunteers
 */
public class FibCalculator extends Fibonacci implements Calculator {
    private static Map<Integer, Integer> memoized = new HashMap<>();

    /*
     * The main method written as follows is used by the JVM as a starting point
     * for the program.
     */
    public static void main(String[] args) {
        memoized.put(1, 1);
        memoized.put(2, 1);
        System.out.println(fibonacci(12)); // Get the 12th Fibonacci number and print to console
    }

    /**
     * An example of a method written in Java, wrapped in a class.
     * Given a non-negative number FIBINDEX, returns
     * the Nth Fibonacci number, where N equals FIBINDEX.
     * 
     * @param fibIndex The index of the Fibonacci number
     * @return the Fibonacci number
     */
    public static int fibonacci(int fibIndex) {
        if (memoized.containsKey(fibIndex)) {
            return memoized.get(fibIndex);
        }

        int answer = fibonacci(fibIndex - 1) + fibonacci(fibIndex - 2);
        memoized.put(fibIndex, answer);
        return answer;
    }
}
Comment

java

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

class TextValidation extends JFrame{
JTextField text;
JLabel label;
JPanel p;
TextValidation(){
text=new JTextField(15);
label=new JLabel("Enter number:");
p=new JPanel();
p.add(label);
p.add(text);
text.addKeyListener(new KeyAdapter(){
            public void keyPressed(KeyEvent e){

                char ch = e.getKeyChar();
                if(Character.isDigit(ch)){
                }
                else{
                    JOptionPane.showMessageDialog(null, "Only numbers are allowed!");
                    text.setText(" ");
                }
            }
});
add(p);
setVisible(true);
setSize(300,100);
}
public static void main(String[]args){
TextValidation v=new TextValidation();
}
}
Comment

java

Guava!
Comment

java

 Highlight all paragraphs in the web page:<br>
      <input type="button" onclick="tryit()" value="Try it">
    
Comment

java

// getting all required elements
const searchWrapper = document.querySelector(".search-input");
const inputBox = searchWrapper.querySelector("input");
const suggBox = searchWrapper.querySelector(".autocom-box");
const icon = searchWrapper.querySelector(".icon");
let linkTag = searchWrapper.querySelector("a");
let webLink;

// if user press any key and release
inputBox.onkeyup = (e)=>{
    let userData = e.target.value; //user enetered data
    let emptyArray = [];
    if(userData){
        icon.onclick = ()=>{
            webLink = `https://www.marhabantvtube.com/search?q=${userData}`;
            linkTag.setAttribute("href", webLink);
            linkTag.click();
        }
        emptyArray = suggestions.filter((data)=>{
            //filtering array value and user characters to lowercase and return only those words which are start with user enetered chars
            return data.toLocaleLowerCase().startsWith(userData.toLocaleLowerCase());
        });
        emptyArray = emptyArray.map((data)=>{
            // passing return data inside li tag
            return data = `<li>${data}</li>`;
        });
        searchWrapper.classList.add("active"); //show autocomplete box
        showSuggestions(emptyArray);
        let allList = suggBox.querySelectorAll("li");
        for (let i = 0; i < allList.length; i++) {
            //adding onclick attribute in all li tag
            allList[i].setAttribute("onclick", "select(this)");
        }
    }else{
        searchWrapper.classList.remove("active"); //hide autocomplete box
    }
}

function select(element){
    let selectData = element.textContent;
    inputBox.value = selectData;
    icon.onclick = ()={
        webLink = 'https://www.marhabantvtube.com/search?q=${selectData}';
        linkTag.setAttribute("href", webLink);
        linkTag.click();
    }
    searchWrapper.classList.remove("active");
}

function showSuggestions(list){
    let listData;
    if(!list.length){
        userValue = inputBox.value;
        listData = '<li>${userValue}</li>';
    }else{
      listData = list.join('');
    }
    suggBox.innerHTML = listData;
}
Comment

java

5
2
5 9
5
1 5 5 5 9
8
2 5 5 2 9 9 9 12
4
12 12 18 18
5
12 15 10 5 9
Comment

java

Hard But AMAZING
Comment

java

$ java DecisionTreeApp

GENERATE DECISION TREE
======================
Created root node 1
Added node 2 onto "yes" branch of node 1
Added node 3 onto "no" branch of node 1
Added node 4 onto "yes" branch of node 2
Added node 5 onto "no" branch of node 2
Added node 6 onto "yes" branch of node 3
Added node 7 onto "no" branch of node 3

OUTPUT DECISION TREE
====================
[1] nodeID = 1, question/answer = Does animal eat meat?
[1.1] nodeID = 2, question/answer = Does animal have stripes?
[1.1.1] nodeID = 4, question/answer = Animal is a Tiger
[1.1.2] nodeID = 5, question/answer = Animal is a Leopard
[1.2] nodeID = 3, question/answer = Does animal have stripes?
[1.2.1] nodeID = 6, question/answer = Animal is a Zebra
[1.2.2] nodeID = 7, question/answer = Animal is a Horse

QUERY DECISION TREE
===================
Does animal eat meat? (enter "Yes" or "No")
Yes
Does animal have stripes? (enter "Yes" or "No")
Yes
Animal is a Tiger
Exit? (enter "Yes" or "No")
No

QUERY DECISION TREE
===================
Does animal eat meat? (enter "Yes" or "No")
No
Does animal have stripes? (enter "Yes" or "No")
No
Animal is a Horse
Exit? (enter "Yes" or "No")
Yes
Comment

java

@echo off
title Activate Microsoft Office 2016 ALL versions for FREE!&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2016&echo - Microsoft Office Professional Plus 2016&echo.&echo.&(if exist "%ProgramFiles%Microsoft OfficeOffice16ospp.vbs" cd /d "%ProgramFiles%Microsoft OfficeOffice16")&(if exist "%ProgramFiles(x86)%Microsoft OfficeOffice16ospp.vbs" cd /d "%ProgramFiles(x86)%Microsoft OfficeOffice16")&(for /f %%x in ('dir /b ..
ootLicenses16proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..
ootLicenses16\%%x" >nul)&(for /f %%x in ('dir /b ..
ootLicenses16proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..
ootLicenses16\%%x" >nul)&echo.&echo ============================================================================&echo Activating your Office...&cscript //nologo ospp.vbs /setprt:1688 >nul&cscript //nologo ospp.vbs /unpkey:WFG99 >nul&cscript //nologo ospp.vbs /unpkey:DRTFM >nul&cscript //nologo ospp.vbs /unpkey:BTDRB >nul&cscript //nologo ospp.vbs /unpkey:CPQVG >nul&cscript //nologo ospp.vbs /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99 >nul&set i=1
:server
if %i%==1 set KMS=kms7.MSGuides.com
if %i%==2 set KMS=kms8.MSGuides.com
if %i%==3 set KMS=kms9.MSGuides.com
if %i%==4 goto notsupported
cscript //nologo ospp.vbs /sethst:%KMS% >nul&echo ============================================================================&echo.&echo.
cscript //nologo ospp.vbs /act | find /i "successful" && (echo.&echo ============================================================================&echo.&echo #My official blog: MSGuides.com&echo.&echo #How it works: bit.ly/kms-server&echo.&echo #Please feel free to contact me at msguides.com@gmail.com if you have any questions or concerns.&echo.&echo #Please consider supporting this project: donate.msguides.com&echo #Your support is helping me keep my servers running everyday!&echo.&echo ============================================================================&choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto server)
explorer "http://MSGuides.com"&goto halt
:notsupported
echo.&echo ============================================================================&echo Sorry! Your version is not supported.&echo Please try installing the latest version here: bit.ly/downloadmsp
:halt
pause
Comment

java

public class min_max_array {
 public static void main(String[] args) {
 int maxVal = Integer.MAX_VALUE;
 int minVal = Integer.MIN_VALUE;
 
 int array[] = {51, 24, 19, 5, 37, 76, 61, 99, 101, 36};
 
 for (int nombre:array)
 System.out.print(nombre+" ");
 
 for(int i = 0; i < array.length; i++){
 if(array[i] < maxVal)
 maxVal = array[i];
 if(array[i] > minVal)
 minVal = array[i];
 }
 
 System.out.print("
Valeur minimale = "+maxVal);
 System.out.print("
Valeur maximale = "+minVal);
 }
}
Comment

java

function longRunningFunction(array) {
  for ( i = 0; i < length(array); i++ ) {
    idx = i
    for ( j = i + 1; j < length(array); j++ ) {
      if ( array[idx] > array[j] ) {
        idx = j
      }
    }
    swap( array[i], array[idx] )
  }
}
Comment

java

#include <iostream>
using namespace std;
// main() is where program execution begins.
int main() {
cout << "Hello World"; // prints Hello World
return 0;
//Shessh ka dong
}
Comment

java

Class Overload{
	void show(){
		System.out.println("sum");
	}
	void show(int a){
		System.out.println("multiply");
	}
	public static void main(String args[]){
		Overload t = new overload();
		t.show();
		t.show(10);
	}
}
Comment

java

wget https://cdn.cs50.net/2021/fall/labs/7/songs.z
Comment

java

Find and return the sum of the given two integer inputs

Example

Input: 

5

6

Output

11
Comment

java

Find and return the sum of the given two integer inputs

Example

Input: 

5

6

Output

11
Comment

java

[
    {
      "userId": 1,
      "id": 1,
      "title": "Sample is ready for lab"
    },
    {
      "userId": 1,
      "id": 2,
      "title": "New order"
    },
    {
      "userId": 1,
      "id": 3,
      "title": "Sample is ready for lab"
    },
    {
      "userId": 1,
      "id": 4,
      "title": "New order"
    },
    {
      "userId": 1,
      "id": 5,
      "title": "New order"
    },
    {
      "userId": 1,
      "id": 6,
      "title": "New order"
    },
    {
      "userId": 1,
      "id": 7,
      "title": "New order"
    },
    {
      "userId": 1,
      "id": 8,
      "title": "sample is in the lab"
    },
    {
      "userId": 1,
      "id": 9,
      "title": "sample is in the lab"
    },
    {
      "userId": 1,
      "id": 10,
      "title": "sample is in the lab"
    },
    {
      "userId": 2,
      "id": 11,
      "title": "sample is in the lab"
    },
    {
      "userId": 2,
      "id": 12,
      "title": "sample is in the lab"
    },
    {
      "userId": 2,
      "id": 13,
      "title": "sample is in the lab"
    },
    {
      "userId": 2,
      "id": 14,
      "title": "sample is in the lab"
    },
    {
      "userId": 2,
      "id": 15,
      "title": "sample is in the lab"
    },
    {
      "userId": 2,
      "id": 16,
      "title": "New order"
    },
    {
      "userId": 2,
      "id": 17,
      "title": "New order"
    },
    {
      "userId": 2,
      "id": 18,
      "title": "New order"
    },
    {
      "userId": 2,
      "id": 19,
      "title": "New order"
    },
    {
      "userId": 2,
      "id": 20,
      "title": "New order"
     }
  ]
Comment

java

5
2
5 9
5
1 5 5 5 9
8
2 5 5 2 9 9 9 12
4
12 12 18 18
5
12 15 10 5 9
Comment

java

0
3
5
2
0
Comment

java

/*

Java is a popular programming language, created in 1995.

It is owned by Oracle, and more than 3 billion devices run Java.

It is used for:

Mobile applications (specially Android apps)
Desktop applications
Web applications
Web servers and application servers
Games
Database connection
And much, much more!

*/
Comment

java

public class IfExample {  
public static void main(String[] args) {  
    //defining an 'age' variable  
    int age=20;  
    //checking the age  
    if(age>18){  
        System.out.print("Age is greater than 18");  
    }  
}  
}  
Comment

java

4
1
()
3
()(())
3
((()))
4
(())(())
Comment

java

{"error":"Login required"}
Comment

java

    *
   #*#
  ##*##
 ###*###
 
 
 
Comment

java

*
   #*#
  ##*##
 ###*###
 
 
 
 import java.util.Scanner;

public class Main {

	
	public static void main(String[] args) {
		
        
        Scanner sc= new Scanner(System.in);
        
        int n= sc.nextInt();
        
       for(int row=1;row<=n;row++)
       {
           for(int space=1;space<=n-row;rpw++)
           {
               System.out.print(" ");
           }
           
           for(int num=1;num<=row;num++)
           {
               System.out.print("*")
           }
       }

	}

}
Comment

java

Input: ransomNote = "a", magazine = "b"
Output: false
Comment

java

class A {
    public A() {
        System.out.print("A");
    }
}

class B extends A {
    public B() {
        super();
        System.out.print("B");
    }
Comment

java

you meant -errors and bugs- right ? 
Comment

java

important mcqs
Comment

java

public class JavaFirst {

   /* Đây là chương trình Java đầu tiên của tôi.
    * Nó sẽ in 'Hello World' ra màn hình
    */

   public static void main(String []args) {
      System.out.println("Hello World by Quantrimang"); // in Hello World
   }
}
Comment

java

503.3
623.4
5.5
2.1
5.6
Comment

java

NotFoundError: Not Found
    at /home/tcb/Mange/NodeApps/vehiclePlate/app.js:40:8
    at Layer.handle [as handle_request] (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:317:13)
    at /home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:335:12)
    at next (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:275:10)
    at /home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:635:15
    at next (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:260:14)
    at Function.handle (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:174:3)
    at router (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:47:12)
Comment

Java

1
2
3
4
5
#include <stdio.h>
int main () {
    printf ("Hello World " );
    return 0;
}
Comment

java

import json 
import pycountry
from tkinter import Tk, Label, Button, Entry
from phone_iso3166.country import phone_country


class Location_Tracker:
    def __init__(self, App):
        self.window = App
        self.window.title("Phone number Tracker")
        self.window.geometry("500x400")
        self.window.configure(bg="#3f5efb")
        self.window.resizable(False, False)

        #___________Application menu_____________
        Label(App, text="Enter a phone number",fg="white", font=("Times", 20), bg="#3f5efb").place(x=150,y= 30)
        self.phone_number = Entry(App, width=16, font=("Arial", 15), relief="flat")
        self.track_button = Button(App, text="Track Country", bg="#22c1c3", relief="sunken")
        self.country_label = Label(App,fg="white", font=("Times", 20), bg="#3f5efb")

        #___________Place widgets on the window______
        self.phone_number.place(x=170, y=120)
        self.track_button.place(x=200, y=200)
        self.country_label.place(x=100, y=280)

        #__________Linking button with countries ________
        self.track_button.bind("<Button-1>", self.Track_location)
        #255757294146
    
    def Track_location(self,event):
        phone_number = self.phone_number.get()
        country = "Country is Unknown"
        if phone_number:
            tracked = pycountry.countries.get(alpha_2=phone_country(phone_number))
            print(tracked)
            if tracked:
                    if hasattr(tracked, "official_name"):
                        country = tracked.official_name
                    else:
                        country = tracked.name
        self.country_label.configure(text=country)



PhoneTracker = Tk()
MyApp = Location_Tracker(PhoneTracker)
PhoneTracker.mainloop()
Comment

java

<!-- Dataset with restricted access -->
Comment

java

NotFoundError: Not Found
    at /home/tcb/Mange/NodeApps/vehiclePlate/app.js:40:8
    at Layer.handle [as handle_request] (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:317:13)
    at /home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:335:12)
    at next (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:275:10)
    at /home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:635:15
    at next (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:260:14)
    at Function.handle (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:174:3)
    at router (/home/tcb/Mange/NodeApps/vehiclePlate/node_modules/express/lib/router/index.js:47:12)
Comment

java

Why is there no grepper answer here
Comment

java

This project has received too many requests, rdgsd again later.
Comment

java

This project has received too m=ase try again later.
Comment

java

public void doubleSquare(double number)
{
 double square = number * number; 
 System.out.printIn("Method with double Argument Called:"+square);
}
Comment

java

quise conquistar el corason de una informática pero no se deJAVA
Comment

java

import java.util.HashMap;import java.util.HashSet;import java.util.Map;import java.util.Scanner;import java.util.Set; public class FibonacciIsh { 	public static void main(String[] args) {		Scanner sc = new Scanner(System.in);		int size = sc.nextInt();		int arr[] = new int[size];		for (int i = 0; i < size; i++) {			arr[i] = sc.nextInt();		}		getMaxFibIshCount(arr);	} 	public static int getMaxFibIshCount(int[] arr) {		Map<Integer, Integer> freq = new HashMap<>();		Set<Double> set = new HashSet<>();		for (int i : arr) {			int c = freq.getOrDefault(i, 0);			freq.put(i, ++c);		} 		int max = 0;		for (int i = 0; i < arr.length; i++) {			for (int j = 0; j < arr.length; j++) {				if (i != j) {					int a = arr[i];					int b = arr[j];					if (set.contains(a + 1d / b))						continue;					else						set.add(a + 1d / b);					if (a == b && a == 0)						max = Math.max(max, freq.get(0));					else {						int aFreq = freq.get(a);						freq.put(a, --aFreq);						int bFreq = freq.get(b);						freq.put(b, --bFreq);						int count = 2;						while (true) {							int c = a + b;							int frq = freq.getOrDefault(c, 0);							if (frq > 0) {								freq.put(c, --frq);								count++;								a = b;								b = c;							} else {								resetFreqMap(freq, count, a, b);								break;							}						}						max = Math.max(count, max);					}				}			}		}		System.out.println(max);		return max;	} 	static void resetFreqMap(Map<Integer, Integer> frqMap, int count, int a, int b) {		int f = frqMap.get(a);		frqMap.replace(a, ++f);		f = frqMap.get(b);		frqMap.replace(b, ++f);		while (count - 2 > 0) {			int c = b - a;			f = frqMap.get(c);			frqMap.replace(c, ++f);			b = a;			a = c;			count--;		}	}}
Comment

java

Java is a programming lanuaguge
Comment

java

The best of the best
Comment

java

public class java {
  public static void main (String args[]){
  }}
Comment

java

//Head First Java
System.out.println("Knock knock its Java here");
Comment

java

Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere
Comment

java

CREATE ROLE {db_use_name} WITH
  LOGIN
  NOSUPERUSER
  INHERIT
  NOCREATEDB
  NOCREATEROLE
  NOREPLICATION
  ENCRYPTED PASSWORD 'md5{md5_encrypted_password}';
Comment

java

Looks like we have been locked in a Abandoned Carnival by an EVIL CLOWN! We must find a way to ESCAPE!

Travel though the Carnival and avoid the Traps and Obstacles that get in your way. Hop onto the Rides and RollerCoaster to get to next area. Escape a CRAZY Funhouse and watch out for the EVIL CLOWN! (WARNING MILD JUMPSCARES)

Over 25 challenging Obstacles to beat, CAN YOU ESCAPE THE CARNIVAL OF TERROR?sus amog us

Please Leave a Like and Favourite if you enjoy my games. That would really help out a lot :) 
Comment

java

return Integer.MAX_VALUE;
Comment

java

import java.util.Arrays;import java.util.Scanner; public class Lambda {	public static int getC(int a[], int b[], int k) {		int c = 0;		int l = 0;		for (int ii = 0; ii < a.length; ii++) {			int ds = a[ii] - k;			int ds1 = a[ii] + k;			int h = b.length - 1; 			while (l <= h) {				if (b[l] >= ds) {					if (b[l] <= ds1) {						l = l + 1;						c++;					}					break;				} else					l++;			}			if (l == b.length - 1)				break; 		}		return c;	} 	public static void main(String[] args) {		Scanner sc = new Scanner(System.in);		int i = sc.nextInt();		int j = sc.nextInt();		int k = sc.nextInt(); 		int a[] = new int[i];		for (int l = 0; l < i; l++) {			a[l] = sc.nextInt();		}		Arrays.sort(a);		int b[] = new int[j];		for (int l = 0; l < j; l++) {			b[l] = sc.nextInt();		}		Arrays.sort(b);		System.out.println(getC(a, b, k));	}}
Comment

java

Good choice! i love java
Comment

java

this is the best programming language
Comment

java

console.log('What you want to log herehttps://docs.google.com/document/d/1kYDI7jWN8ryLE3SP7wxi5bXMJU6fB3YPBKI2R-iO1b4/edit
Comment

java

int x = 50;
int y = 30;
int z = 70;

y = x;
x = z;
z = y;
Comment

java

import java.io.File;
import java.io.IOException;

import org.apache.pdfbox.pdmodel.PDDocument;

public class RemovingPages {

   public static void main(String args[]) throws IOException {

      //Loading an existing document
      File file = new File("C:/PdfBox_Examples/sample.pdf");
      PDDocument document = PDDocument. load (file);
       
      //Listing the number of existing pages
      int noOfPages= document.getNumberOfPages();
      System.out.print(noOfPages);
       
      //Removing the pages
      document.removePage(2);
      
      System.out.println("page removed");

      //Saving the document
      document.save("C:/PdfBox_Examples/sample.pdf");

      //Closing the document
      document.close();

   }
}
Comment

java

public class tryit{

	public static void main(String[] args) {
		System.out.println("hello world");
	}

}
Comment

java

//base Hello World program

public class HelloWorld
{
  public static void main(String[] args)
  {
    System.out.println("Hello World!");
  }
}
Comment

java

                                    MINECRAFT
                                   JAVA EDITION
Comment

java

Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.
Comment

java

// This is how to write hello world in Java//


public class Hello World {
   
   public static void main(String[] args) {
   
      System.out.println("Hello World")
        
     }
}

Comment

java

public class Main {
	public static void main(String[] args) {
    	System.out.println("Hello, World!");
    }
}
Comment

java

Java is a computer language developed by Sun Microsystems. It was released in 1995 as a core part of Sun's Java platform. Although its syntax is very similar to the C, C Plus plus, it is based on a simpler object model
Comment

PREVIOUS NEXT
Code Example
Java :: java how to get all threads 
Java :: java stream distinct by key 
Java :: play mp3 android java 
Java :: lambda comparator java 
Java :: how to get data from combobox in java 
Java :: string reverse in java 
Java :: string to byte array java utf-8 
Java :: jbutton close jframe java 
Java :: sqlite java gradle 
Java :: java loop over string 
Java :: method returns arraylist java 
Java :: square root of a number in java without sqrt 
Java :: java int 
Java :: How to determine if a graph contains a cycle, in Java? 
Java :: timestamp to date java 
Java :: string tokenizer java 
Java :: how to convert a number into a decimal number in java 
Java :: intent pick action video android 
Java :: joining an array of strings in java 
Java :: charat(0).touppercase() java 
Java :: android application manifest 
Java :: for each loop java string array 
Java :: javac clear 
Java :: get length of a string java 
Java :: sorting in java 
Java :: how to use sql file in java 
Java :: Java push() Method 
Java :: start async task android 
Java :: java get month 
Java :: map java 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =