Skip to content

Instantly share code, notes, and snippets.

View rectang's full-sized avatar

Marvin Humphrey rectang

View GitHub Profile
@rectang
rectang / diameter.rs
Created March 7, 2020 19:42
Rust Solution to LeetCode "Diameter of Binary Tree"
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
// pub struct TreeNode {
// pub val: i32,
// pub left: Option<Rc<RefCell<TreeNode>>>,
// pub right: Option<Rc<RefCell<TreeNode>>>,
// }
//
// impl TreeNode {
// #[inline]
@rectang
rectang / unreleased_dist_v2_v3.diff
Created August 29, 2015 09:58
Interdiff of asfrelease between unreleased_dist_v2 and unreleased_dist_v3 branches.
diff --git a/release.md b/release.md
index a73754b..45f911d 100644
--- a/release.md
+++ b/release.md
@@ -35,7 +35,7 @@ and the [design goals of this policy](mirrors).
Generically, a release is anything that is published beyond the group
that owns it. For an Apache project, that means any publication outside the
-developer community, defined as individuals actively participating in
+development community, defined as individuals actively participating in
@rectang
rectang / v1v2.diff
Last active August 26, 2015 05:49
Interdiff between unreleased_dist_v1 and unreleased_dist_v2
$ git diff unreleased_dist_v1 unreleased_dist_v2
diff --git a/release.md b/release.md
index a9570c1..a73754b 100644
--- a/release.md
+++ b/release.md
@@ -35,7 +35,8 @@ and the [design goals of this policy](mirrors).
Generically, a release is anything that is published beyond the group
that owns it. For an Apache project, that means any publication outside the
-developer community, approximated as the subscribers to a product dev list.
use strict;
use warnings;
my $title = "Hello";
print qq|
<html>
<head>
<title>$title</title>
</head>
@rectang
rectang / gist:003f7095b0fb3c743c78
Created May 27, 2015 22:51
Interdiff from CLOWNFISH-47-fix-final-methods to CLOWNFISH-47-fix-final-methods-v2
diff --git a/compiler/src/CFCBindMethod.c b/compiler/src/CFCBindMethod.c
index f6ff216..925f481 100644
--- a/compiler/src/CFCBindMethod.c
+++ b/compiler/src/CFCBindMethod.c
@@ -25,6 +25,7 @@
#include "CFCVariable.h"
#include "CFCSymbol.h"
#include "CFCClass.h"
+#include "CFCParcel.h"
@rectang
rectang / maybe_size_t.c
Last active August 29, 2015 14:21
Illustration of "maybe" data type in C using size_t and flags.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAYBE_SUCCESS_FLAG 1
#define MAYBE_SUCCESS_MASK (((size_t)-1) ^ MAYBE_SUCCESS_FLAG)
typedef enum {
OBJ,
ERR,
--- autogen-go-v1.diff 2015-05-03 17:32:28.000000000 -0700
+++ autogen-go-v2.diff 2015-05-03 17:38:34.000000000 -0700
@@ -1,5 +1,5 @@
diff --git a/compiler/go/cfc/cfc.go b/compiler/go/cfc/cfc.go
-index 1f30cd2..fa9b8d7 100644
+index 1f30cd2..1b47beb 100644
--- a/compiler/go/cfc/cfc.go
+++ b/compiler/go/cfc/cfc.go
@@ -87,6 +87,10 @@ type BindGo struct {
@@ -13,7 +13,7 @@
@rectang
rectang / gist:720462b157c884331b96
Created April 28, 2015 04:44
Fix for segment merging test.
diff --git a/perl/t/213-segment_merging.t b/perl/t/213-segment_merging.t
index 900976e..afe05d5 100644
--- a/perl/t/213-segment_merging.t
+++ b/perl/t/213-segment_merging.t
@@ -164,7 +164,7 @@ is( num_segmeta($index_loc), 1, "merged segment files successfully deleted" );
schema => $schema,
manager => NonMergingIndexManager->new,
);
- $indexer->add_doc( { content => $number++ } ) for 1 .. 20;
+ $indexer->add_doc( { content => $number++ } ) for 1 .. 100;