Skip to content

Instantly share code, notes, and snippets.

Jupyter Notebook notes

ssh -L 8888:localhost:8888 your_server_username@your_server_ip

Tips for json 2 POJO

  • Lombok

  • Jackson

  • Use ** @JsonDesrialize ** @Value ** @Builder

@pluto-atom-4
pluto-atom-4 / CSVtoDynamoDB.json
Last active January 30, 2019 14:09
AWS Data Pipeline sample CSV on S3 to DynamoDB
{
"objects": [
{
"myComment" : "Activity used to run the hive script to import CSV data",
"output": {
"ref": "DataNodeId_cnlSW"
},
"input": {
"ref": "DataNodeId_1ERqq"
},
@pluto-atom-4
pluto-atom-4 / NioTest.java
Created December 14, 2018 14:05
Exercising Java NIO2
import org.junit.Test;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileAttribute;
import java.io.*;
import java.util.*;
class BracketMatch {
static int bracketMatch(String text) {
if (text == null || text.isEmpty()) {
throw new IllegalArgumentException("Provide a text");
}
if (!text.replaceAll("[()]", "").isEmpty()) {
package pramp.string;
import java.util.*;
public class WordCountEngine {
static String[][] count(String document) {
Map<String, Integer> map = new HashMap<>();
String[] tokens = document.toLowerCase().replaceAll("[^a-z ]", "").split("\\s+");
@pluto-atom-4
pluto-atom-4 / AwaitilityDSLTest.java
Last active April 29, 2023 12:23
Example Awaitility + AssertJ + Rest Assured
package internal.example.awaitility;
import org.awaitility.Awaitility;
import org.junit.Before;
import org.junit.Test;
import static io.restassured.RestAssured.get;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
from .test_list import TextsToBeInspect
def pytest_assertrepr_compare(op, left, right):
def details(*args):
details = []
details.append('----')
for i in args:
details.append('%s: ' % i.context)
details.extend([' %s' % i for i in i.texts])
package internal.example.after_x;
import org.testng.ITestResult;
import org.testng.Reporter;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.Collections;
import java.util.HashMap;