This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
public class BRC { | |
public static void main(String[] args) throws FileNotFoundException { | |
long millis = System.currentTimeMillis(); | |
System.out.println(calculateMinMeanMaxPerStation(readCSV())); | |
System.out.println("Time taken = " + (System.currentTimeMillis() - millis)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.springbootwebcsocket.demo; | |
import java.util.concurrent.Semaphore; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.concurrent.locks.ReentrantLock; | |
//@SpringBootApplication | |
public class DemoApplication { | |
public static void main(String[] args) throws InterruptedException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Customer { | |
public String type; | |
} | |
public class ProcessOrder | |
{ | |
public int getOrderGrandTotal(Customer customer, int subTotal) | |
{ | |
if (customer.type.equals("EMPLOYEE")) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum COLOR { | |
WHITE, BLACK | |
} | |
enum PIECE { | |
NONE, BISHOP, KING // etc. | |
} | |
class Cell { | |
private COLOR color; // Enum, white or black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Employee { | |
private int id; | |
private int yearOfBirth; | |
private int monthOfBirth; | |
private int dateOfBirth; | |
private String addressFlat; | |
private String addressStreet; | |
private String city; | |
private String state; | |
private String pincode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String doStuff(StringBuffer data) { | |
if(data != null) { | |
for (int i = 0; i < 10; i++) { | |
for (int j = 0; j < 10; j++) { | |
data.append(String.valueOf(i+j)); | |
} | |
data.append("\n"); | |
} | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Library (val books: MutableList<Book>) { | |
fun getBooks(): MutableList<Book> { | |
... | |
} | |
fun addBook(book: Book) { | |
... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Library (var books: MutableList<Book>) { | |
fun getBooks(): MutableList<Book> { | |
... | |
} | |
fun setBooks(newBooks: MutableList<Book>) { | |
... | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
val s = Square(2.0) | |
println(s.area()) // Prints 4.0, duh! | |
println(s - Square(3.0)) // Prints -5.0, Sweet! | |
} | |
data class Square (val side: Double) { | |
operator fun minus(other: Square): Double { | |
return this.area() - other.area() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//.. Imports | |
public class ReportGenerator { | |
private final HttpServletRequest request; | |
private final WebDriver webDriver; | |
public ReportGenerator(HttpServletRequest request){ | |
this.request = request; | |
this.webDriver = new ChromeDriver(...); | |
} |
NewerOlder