Skip to content

Instantly share code, notes, and snippets.

// This code is for Java 7
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import java.security.*;
public class Solution {
function createFolders(inputFolderNames) {
let folderMap = {}
let createdFolderNames = []
inputFolderNames.forEach(pFolderName => {
if(folderMap[pFolderName] !== undefined){
let folderTime = folderMap[pFolderName] + 1;
let toBeAddedFolderName = pFolderName + "(" + folderTime + ")"
while(folderMap[toBeAddedFolderName] !== undefined){
folderTime++
toBeAddedFolderName = pFolderName + "(" + folderTime + ")"
1. Open terminal then type: touch ~/.bash_profile
2. Open the ~/.bash_profile by Finder or using vi command and put below contents:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export ANDROID_SDK_HOME=~/Library/Android/sdk
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
## Download
* https://www.selenium.dev/downloads/ | Previous Version | Server standalone 3.141.59
* Custom Matcher | https://github.com/TuHuynhVan/custom-matcher-selenium-grid-with-appium/tree/master/3.149.build
## Hub config | hubConfig.json
```
{
"host": "192.168.1.202",
"port": 4444,
"newSessionWaitTimeout": 60,
package test;
import driver.DriverFactoryEx;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.qameta.allure.Allure;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.testng.ITestResult;
package exercises.constructor;
import java.util.Arrays;
import java.util.List;
public class Vehicle {
private final double BYCICLE_PRICE = 1;
private final double ELECTRIC_BYCICLE_PRICE = 3;
private final double MOTOR_BYCICLE_PRICE = 5;
package exercises.constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class BaigiuXe {
/*
* Bac bao ve:
package arraylist.practice;
public class MyArrayList {
static final int INITIAL_ARRAY_LENGHT = 10;
private Integer[] container;
private int nodeIndexToStoreData;
public static void main(String[] args) {
MyArrayList arrList = new MyArrayList();
package practice;
/**
* Fibonacci: 0, 1, 1, 2, 3, 5, 8, 13...
* n: 1, 2, 3, 4, 5, 6 Input an number n.
* Output the Fibonacci number with that position
*/
public class FibonacciFinder {
public static void main(String[] args) {
package practice;
public class SumArray {
public static void main(String[] args) {
int[] arr_1 = { 1, 2, 3, 4 };
System.out.println(sumArray(arr_1));
}
public static int sumArray(int[] a) {