Skip to content

Instantly share code, notes, and snippets.

View feliperazeek's full-sized avatar
💭
Be there and give a shit

Felipe Oliveira feliperazeek

💭
Be there and give a shit
View GitHub Profile
@feliperazeek
feliperazeek / IcebergTableStatsTest.scala
Created April 8, 2024 16:10
Iceberg Lower/Upper Bounds in Data Files (Parquet vs Avro)
import org.apache.hadoop.conf.Configuration
import org.apache.iceberg.hadoop.HadoopFileIO
import org.apache.iceberg.spark.Spark3Util
import org.apache.iceberg.{DataFile, Snapshot, TableProperties, Table => IcebergTable}
import org.apache.spark.SparkConf
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types.{StringType, StructField, StructType, TimestampType}
import org.apache.spark.sql.{DataFrame, Row, SparkSession}
import org.junit.runner.RunWith
import org.scalatest.BeforeAndAfterAll
@feliperazeek
feliperazeek / IcebergResidual2Test.scala
Created March 14, 2024 19:26
Iceberg Residual Test
import org.apache.hadoop.conf.Configuration
import org.apache.iceberg.hadoop.HadoopFileIO
import org.apache.iceberg.spark.Spark3Util
import org.apache.iceberg.{DataFile, PartitionSpec, Schema, Snapshot, TableMetadata, TableMetadataParser, Table => IcebergTable}
import org.apache.spark.SparkConf
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types.{StringType, StructField, StructType, TimestampType}
import org.apache.spark.sql.{DataFrame, Row, SparkSession}
import org.junit.runner.RunWith
import org.scalatest.BeforeAndAfterAll
@feliperazeek
feliperazeek / ty-turtle-jump.py
Created May 24, 2022 20:04
Ty's Python Turtle Game
import turtle
import random
t = turtle.Turtle()
scorey = turtle.Turtle()
score = 0
t.goto(0,0)
scorey.penup()
scorey.goto(200,200)
t.setheading(90)
c = turtle.Turtle()
{
"type" : "record",
"name" : "twitter_schema",
"namespace" : "foo.bar",
"fields" : [ {
"name" : "username",
"type" : "string",
"doc" : "Name of the user account on Twitter.com"
}, {
"name" : "tweet",
### My publicly-auditable identity:
https://keybase.io/felipera
### From the command line:
Consider the [keybase command line program](https://keybase.io/download).
```bash
# look me up
@feliperazeek
feliperazeek / gist:8feb499216851612ed9de2def805aaae
Created October 27, 2016 04:07
HackerRank - Cracking the Code Interview - Sorting: Bubble Sort (https://www.hackerrank.com/challenges/ctci-bubble-sort)
import java.io.*;
import java.util.*;
public class Solution {
private static void work(int[] a) {
int swaps = 0;
int n = a.length;
@feliperazeek
feliperazeek / Solution.java
Created October 18, 2016 05:41
HackerRank - Cracking the Code Interview - Time Complexity: Primality (https://www.hackerrank.com/challenges/ctci-big-o)
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
private static boolean isPrime(int n) {
if (n <= 1) return false;
@feliperazeek
feliperazeek / Solution.java
Created October 18, 2016 05:13
HackerRank - Cracking the Code Interview - Bit Manipulation: Lonely Integer (https://www.hackerrank.com/challenges/ctci-lonely-integer)
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static int lonelyInteger(int[] a) {
int i = 0;
@feliperazeek
feliperazeek / Solution.java
Created October 15, 2016 04:41
HackerRank - Cracking the Code Interview - Queues: A Tale of Two Stacks (https://www.hackerrank.com/challenges/ctci-queue-using-two-stacks)
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
private static class MyQueue<T> {
@feliperazeek
feliperazeek / Checker.java
Created October 14, 2016 22:09
HackerRank - Cracking the Code Interview - Sorting: Comparator (https://www.hackerrank.com/challenges/ctci-comparator-sorting)
public class Checker implements Comparator<Player> {
public int compare(Player p1, Player p2) {
int score = Integer.compare(p2.score, p1.score);
if (score != 0) return score;
else return p1.name.compareTo(p2.name);
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);