This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <assert.h> | |
| typedef struct _car { | |
| char model[20]; | |
| char brand[20]; | |
| int year; | |
| long worth; |
This file contains hidden or 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
| /* | |
| * Name: | |
| * Pawprint: | |
| */ | |
| typedef struct student { | |
| char FName[20]; | |
| char LName[20]; |
This file contains hidden or 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
| def rule(num: Long) = (1 to 10).map(digit => (num / Math.pow(10, 10 - digit).toInt) % digit).forall(_==0) | |
| "123456789".permutations.map(number => number ++ "0").map(_.toLong).filter(rule) |
This file contains hidden or 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 abstract class RichFsSinkFunction<IN> extends RichSinkFunction<IN> { | |
| private Collector<Path> collector; | |
| public void setCollector(Collector<Path> collector) { | |
| this.collector = collector; | |
| } | |
| public void collect(Path finalPath) { | |
| /// Or something to this regard that can forward on paths |
This file contains hidden or 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 org.apache.flink.api.common.functions.AggregateFunction; | |
| import org.apache.flink.api.common.state.ListState; | |
| import org.apache.flink.api.common.state.ListStateDescriptor; | |
| import org.apache.flink.api.common.typeinfo.BasicArrayTypeInfo; | |
| import org.apache.flink.api.common.typeinfo.TypeInformation; | |
| import org.apache.flink.api.common.typeutils.TypeSerializer; | |
| import org.apache.flink.api.java.functions.KeySelector; | |
| import org.apache.flink.api.java.tuple.Tuple2; | |
| import org.apache.flink.api.java.tuple.Tuple3; | |
| import org.apache.flink.api.java.typeutils.TupleTypeInfo; |
This file contains hidden or 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
| -- https://adventofcode.com/2019/day/4 | |
| SELECT COUNT(DISTINCT CAST( | |
| ((codes.passcode[1] * 100000) + | |
| (codes.passcode[2] * 10000) + | |
| (codes.passcode[3] * 1000) + | |
| (codes.passcode[4] * 100) + | |
| (codes.passcode[5] * 10) + | |
| codes.passcode[6]) AS VARCHAR) | |
| FROM digits |
This file contains hidden or 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
| CREATE TABLE kafka_table ( | |
| user_id STRING, | |
| order_amount double, | |
| log_ts TIMESTAMP(3), | |
| WATERMARK FOR log_ts AS log_ts - INTERVAL '5' SECOND | |
| ) WITH ( | |
| 'connector.type' = 'kafka', | |
| 'connector.topic' = 'users', | |
| 'connector.properties.bootstrap.servers' = 'localhost:9092', | |
| 'connector.properties.group.id' = 'parquet-writer', |
This file contains hidden or 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
| from dataclasses import dataclass | |
| from enum import Enum | |
| from typing import Optional, AsyncGenerator, TypeVar, Callable, Generator | |
| from psycopg import sql | |
| from psycopg.rows import dict_row | |
| from psycopg_pool import AsyncConnectionPool | |
| t = TypeVar("t") |