Skip to content

Instantly share code, notes, and snippets.

View hsaputra's full-sized avatar

Henry Saputra hsaputra

View GitHub Profile
@kennedyj
kennedyj / parse-pom.py
Created February 23, 2012 22:10
quick maven pom parser for group, artifact, and version
#!/usr/bin/python
from xml.etree import ElementTree as et
import sys
if __name__ == "__main__":
ns = "http://maven.apache.org/POM/4.0.0"
for filename in sys.argv[1:len(sys.argv)]:
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@debasishg
debasishg / gist:8172796
Last active November 11, 2024 07:10
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
Endpoint: http://65.19.181.3/client/api
D0:
API Key: Posq3l0kyg3kXrl3h-df9vLwtcClH2-cXYn4pFDrI4ewPsOTxBSlxV2XKS2Zzf7h9Cv9os-N8fjJbL4CaYTK7w
Secret Key: OB8yMZ95zUuDDOq7nNCoUrGFp1JVq29mdjwGirnqSADyNMawyfR3xTCSaKH2sbC3kPbFYqreqxgHR1gHcUKR4Q
D1:
APIKEY: g__DUYqXwHxtyIrzu_nwTlMFv3x9tXgQPLZTQLfFeOJyQA1jZ7C-PbdtkziUHDuLmg4FZ0EhmQGg94MCQNEZ3A
Secret Key: Z0EOwcfaVVAEL7hBkOexs3sLkBEKpSym5swFwHNgYaUOSLaNaDXoYQQTIEJWTr_6vqA23MyKjAbZUDxDx2qKyw
@hsaputra
hsaputra / gist:96997ab2f50b0a454986
Last active January 26, 2021 06:25
Apache Flink Job execution Flow Sequence
Apache Flink Job Flow from client API to JobGraph
https://cwiki.apache.org/confluence/display/FLINK/Data+exchange+between+tasks
=============================================
WordCount
ExecutionEnvironment#getExecutionEnvironment
ExecutionEnvironment#readTextFile => DataSet<String>
DataSet#flatMap(FlatMapFunction) => FlatMapOperator<T, R>
class Solution {
private int lo, maxLen;
public String longestPalindrome(String s) {
int len = s.length();
if (len < 2)
return s;
for (int i = 0; i < len-1; i++) {
extendPalindrome(s, i, i); //assume odd length, try to extend Palindrome as possible
class Solution {
public int uniquePaths(int m, int n) {
// m is columns
// n is rows
if (m < 1 || n < 1) {
return 0;
}
if (m == 1 && m == 1) {