profile
viewpoint

alex/what-happens-when 27583

An attempt to answer the age old interview question "What happens when you type google.com into your browser and press enter?"

chanzuckerberg/sorbet-rails 421

A set of tools to make the Sorbet typechecker work with Ruby on Rails seamlessly.

frewsxcv/alert-after 227

Get a desktop notification after a command finishes executing.

disqus/nexus 209

A centralized, pluggable admin app for Django

dherman/tc39-codex-wiki 48

New and improved TC39 wiki, built with codex

educreations/django-ormcache 14

An ORM cache for Django.

educreations/python-iap 13

Python utilities for working with Apple In-App Purchases (IAP)

educreations/django-mysql-fuzzycount 10

Approximate query counts for MySQL and Django.

push eventrust-fuzz/trophy-case

PSeitz

commit sha 2e6dca475185cebb7afbf19a377197e52d008474

lz4_flex heap-buffer-overflow

view details

Corey Farwell

commit sha 1a878baa446fceee238b5657e2bfd1c5d6297631

Merge pull request #99 from PSeitz/patch-2 lz4_flex heap-buffer-overflow

view details

push time in 3 hours

PR merged rust-fuzz/trophy-case

lz4_flex heap-buffer-overflow
+1 -0

0 comment

1 changed file

PSeitz

pr closed time in 3 hours

PullRequestReviewEvent

pull request commentrust-lang/rust

Clean up small, surprising bits of code

oh and looks like it was already approved, oops

bugadani

comment created time in a day

pull request commentrust-lang/rust

Clean up small, surprising bits of code

first time i've attempted to approve a pr in a while, guess i lost privileges 😅

bugadani

comment created time in a day

pull request commentrust-lang/rust

Clean up small, surprising bits of code

@bors r+

bugadani

comment created time in a day

PullRequestReviewEvent
PullRequestReviewEvent

issue commentgeorust/topojson

Relax geojson crate version requirements

We don't have an official stance or recommendation between the two, though I also personally prefer GitHub Actions so that'd be my vote

pjsier

comment created time in a day

issue commentgeorust/topojson

Relax geojson crate version requirements

If you've verified that all of those geojson versions are compatible with the topojson crate, then relaxing the requirements seems like an improvement. Ideally we would have CI test each version of the geojson crate in a test matrix, but not a blocker to moving forward with this

pjsier

comment created time in a day

issue closedgeorust/topojson

Added to crates.io?

Why does TopoJSON has not been added to (crates.io) ?

closed time in a day

tredoe

issue commentgeorust/topojson

Added to crates.io?

as of https://github.com/georust/topojson/pull/6, the topojson crate is on crates.io

tredoe

comment created time in a day

push eventrust-fuzz/trophy-case

PSeitz

commit sha a03f158b19a577f9a2d1440d37ff275beebfde49

Update README.md

view details

Corey Farwell

commit sha 9bd9c96e5667ec257caa75faa7f836023efa4a89

Merge pull request #98 from PSeitz/patch-1 add lz4_flex issue

view details

push time in a day

PR merged rust-fuzz/trophy-case

add lz4_flex issue
+1 -0

0 comment

1 changed file

PSeitz

pr closed time in a day

PullRequestReviewEvent

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha d74b59b53a01295acc945ea9e2c801db505bdbbe

pipenv update

view details

Corey Farwell

commit sha 3cccbce4bc3afcae71104b04aea0e7a974f863ef

install python 3.8

view details

push time in 3 days

PR closed rust-fuzz/afl.rs

CAPTAIN AMERICA
+2 -0

0 comment

1 changed file

KORLA25

pr closed time in 3 days

startedEloston/ungoogled-chromium

started time in 4 days

Pull request review commentgeorust/geo

Topic/length zero linestring locate

 use crate::{ ///     [0.0, 1.0] /// ].into(); ///-/// assert_eq!(linestring.line_interpolate_point(&-1.0), point!(x: -1.0, y: 0.0));-/// assert_eq!(linestring.line_interpolate_point(&0.25), point!(x: -0.5, y: 0.0));-/// assert_eq!(linestring.line_interpolate_point(&0.5), point!(x: 0.0, y: 0.0));-/// assert_eq!(linestring.line_interpolate_point(&0.75), point!(x: 0.0, y: 0.5));-/// assert_eq!(linestring.line_interpolate_point(&2.0), point!(x: 0.0, y: 1.0));+/// assert_eq!(linestring.line_interpolate_point(&-1.0), Some(point!(x: -1.0, y: 0.0)));+/// assert_eq!(linestring.line_interpolate_point(&0.25), Some(point!(x: -0.5, y: 0.0)));+/// assert_eq!(linestring.line_interpolate_point(&0.5), Some(point!(x: 0.0, y: 0.0)));+/// assert_eq!(linestring.line_interpolate_point(&0.75), Some(point!(x: 0.0, y: 0.5)));+/// assert_eq!(linestring.line_interpolate_point(&2.0), Some(point!(x: 0.0, y: 1.0))); /// ``` pub trait LineInterpolatePoint<F: Float> {     type Output;      fn line_interpolate_point(&self, fraction: &F) -> Self::Output; } + impl<T> LineInterpolatePoint<T> for Line<T> where     T: CoordinateType + Float + Zero + One, {-    type Output = Point<T>;+    type Output = Option<Point<T>>;      fn line_interpolate_point(&self, fraction: &T) -> Self::Output {-        if fraction < &T::zero() {-            return self.start.into();-        };-        if fraction > &T::one() {-            return self.end.into();+        match fraction.partial_cmp(&T::zero()) {+            Some(o) => match o {+                Ordering::Less => return Some(self.start.into()),+                Ordering::Equal => return Some(self.start.into()),+                Ordering::Greater => {+                    match fraction.partial_cmp(&T::one()) {+                        Some(p) => match p {+                            Ordering::Greater => return Some(self.end.into()),+                            Ordering::Equal => return Some(self.end.into()),+                            Ordering::Less => {}+                        },+                        None => return None+                    }+                }+            },+            None => return None         };

you can use ? here to flatten this a bit

        match fraction.partial_cmp(&T::zero())? {
            Ordering::Less => return Some(self.start.into()),
            Ordering::Equal => return Some(self.start.into()),
            Ordering::Greater => {
                match fraction.partial_cmp(&T::one())? {
                    Ordering::Greater => return Some(self.end.into()),
                    Ordering::Equal => return Some(self.end.into()),
                    Ordering::Less => {}
                }
            }
        };
mattswoon

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

issue openedfrewsxcv/tech-organizing-handbook

onboarding / engagement ladder

https://docs.google.com/document/d/1kc2byl5thcIy-N4kI092c5qTO-8dZ3pjBReolJ_rTkQ/edit

https://docs.google.com/drawings/d/1cF2TeShqKvdQZsGNhSMdWUqgsq5um3kJNjjsqLr-HNE/edit

created time in 6 days

issue commentrust-lang/crates.io

Show github teams in "Manage owners" view

this appears to be resolved https://crates.io/crates/rustfix/owners

killercup

comment created time in 6 days

issue openedfrewsxcv/tech-organizing-handbook

https://twitter.com/MNYCWorkers/following

https://twitter.com/MNYCWorkers/following

created time in 7 days

startedralfbiedert/cheats.rs

started time in 7 days

issue commentgeorust/shapefile

Can we archive this project?

sgtm! ✅

michaelkirk

comment created time in 7 days

issue commentfrewsxcv/cargo-all-features

Add flags to print dry run of commands to support concurrent runs

So if there was a way to obtain the series of commands used to test each unique combination of features, then it would be possible to cut down on our wall clock time by a significant factor.

Not currently, but it can be added! Are you thinking something like cargo test-all-features --print-commands that prints all the cargo test commands that will be invoked (one per line)?

echeran

comment created time in 7 days

issue openedfrewsxcv/tech-organizing-handbook

legal rights

https://www.opeiu.org/NeedAUnion/WhatAreMyLegalRights.aspx

created time in 8 days

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha 9a663ac1db8688e994a61b19d29593b250304be1

there is a new column

view details

push time in 8 days

PullRequestReviewEvent

startedHironsan/HateSonar

started time in 11 days

push eventrust-fuzz/trophy-case

Alexander Kjäll

commit sha cb6418b7c55bf1317e4fedc934d1416b467609f2

added my latest fuzzing findings

view details

Corey Farwell

commit sha f6eed333921ea55cf956351620e5823a311cde66

Merge pull request #97 from alexanderkjall/patch-3 added my latest fuzzing findings

view details

push time in 11 days

PullRequestReviewEvent

pull request commentrust-lang/mdBook

Remove leading $, > and # chars from clipboard of console snippets

I'm a little concerned this would be surprising behavior more than it'd be helpful behavior, so I don't feel comfortable merging it. Especially since it's trivial for a user to remove special leading characters from console output. Not blocking though in case someone else approves.

diegocn

comment created time in 11 days

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha 43de436616af63dbd195d341d3337b402b096cc7

Revert "Temporary whois usage to debug CI" This reverts commit d567aa5e7b56a8f6ca01bbf89e308a13d9cc72da.

view details

Corey Farwell

commit sha 690bf1de7989b901cd9c482050fa98ded916a1d3

Do not whois for now

view details

push time in 11 days

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha d567aa5e7b56a8f6ca01bbf89e308a13d9cc72da

Temporary whois usage to debug CI

view details

push time in 11 days

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha 760b6eec06c692dfc2925f570796da55bf30ae8e

use new variable name

view details

push time in 12 days

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha a33960e1af63147112551651b1d6d3e43890d9c6

sudo?

view details

push time in 12 days

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha 7630dc7cd344565e75988cf1bb614cab8ec1e424

whitespace

view details

Corey Farwell

commit sha 393a42a2bb8c83630f893f27a0e59d890b381189

install whois

view details

push time in 12 days

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha 3d140b5f3e712c4744b637284635a06a6e83bbc4

bump to python 3.8

view details

Corey Farwell

commit sha 19760624ce8d08dfef61ba8b7905aa38d6eb112e

add classification to csv; add domain registrar

view details

Corey Farwell

commit sha 58ff9195c88879c555befb65428801187f932f7b

merge from originmaster

view details

push time in 12 days

issue closedfrewsxcv/who-hosts-hate

github actions cron

closed time in 12 days

frewsxcv

issue commentfrewsxcv/who-hosts-hate

github actions cron

https://github.com/frewsxcv/who-hosts-hate/commit/ec35113ee42205417151bcc689ecc4729446a88c

frewsxcv

comment created time in 12 days

push eventfrewsxcv/who-hosts-hate

Corey Farwell

commit sha ec35113ee42205417151bcc689ecc4729446a88c

Update main.yml

view details

push time in 12 days

PullRequestReviewEvent

Pull request review commentgeorust/geo

Add Concave Hull algorithm

+use crate::algorithm::convex_hull::qhull;+use crate::algorithm::euclidean_distance::EuclideanDistance;+use crate::algorithm::euclidean_length::EuclideanLength;+use crate::algorithm::kernels::HasKernel;+use crate::prelude::Centroid;+use crate::utils::partial_min;+use crate::{Line, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon};+use geo_types::{Coordinate, CoordinateType};+use num_traits::Float;+use rstar::{RTree, RTreeNum};+use std::collections::VecDeque;++/// Returns a polygon which covers a geometry. Unlike convex hulls, which also cover+/// their geometry, a concave hull does so while trying to further minimize its area by+/// constructing edges such that the exterior of the polygon incorporates points that would+/// be interior points in a convex hull.+///+/// This implementation is inspired by https://github.com/mapbox/concaveman+/// and also uses ideas from the following paper:+/// www.iis.sinica.edu.tw/page/jise/2012/201205_10.pdf+///+/// # Example
/// # Examples
///

https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#using-markdown

RestitutorOrbis

comment created time in 13 days

Pull request review commentgeorust/geo

Add Concave Hull algorithm

+use crate::algorithm::convex_hull::qhull;+use crate::algorithm::euclidean_distance::EuclideanDistance;+use crate::algorithm::euclidean_length::EuclideanLength;+use crate::algorithm::kernels::HasKernel;+use crate::prelude::Centroid;+use crate::utils::partial_min;+use crate::{Line, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon};+use geo_types::{Coordinate, CoordinateType};+use num_traits::Float;+use rstar::{RTree, RTreeNum};+use std::collections::VecDeque;++/// Returns a polygon which covers a geometry. Unlike convex hulls, which also cover+/// their geometry, a concave hull does so while trying to further minimize its area by+/// constructing edges such that the exterior of the polygon incorporates points that would+/// be interior points in a convex hull.+///+/// This implementation is inspired by https://github.com/mapbox/concaveman+/// and also uses ideas from the following paper:+/// www.iis.sinica.edu.tw/page/jise/2012/201205_10.pdf+///+/// # Example+/// ```+/// use geo::{line_string, polygon};+/// use geo::algorithm::concave_hull::ConcaveHull;+///+/// // a square shape+/// let poly = polygon![+///     (x: 0.0, y: 0.0),+///     (x: 4.0, y: 0.0),+///     (x: 4.0, y: 4.0),+///     (x: 0.0, y: 4.0),+/// ];+///+/// // The correct concave hull coordinates+/// let correct_hull = line_string![+///     (x: 4.0, y: 0.0),+///     (x: 4.0, y: 4.0),+///     (x: 0.0, y: 4.0),+///     (x: 0.0, y: 0.0),+///     (x: 4.0, y: 0.0),+/// ];+///+/// let res = poly.concave_hull(2.0);+/// assert_eq!(res.exterior(), &correct_hull);+/// ```+pub trait ConcaveHull {+    type Scalar: CoordinateType;+    fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar>;+}++impl<T> ConcaveHull for Polygon<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar> {+        let mut points: Vec<_> = self.exterior().0.clone();+        Polygon::new(concave_hull(&mut points, concavity), vec![])+    }+}++impl<T> ConcaveHull for MultiPolygon<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar> {+        let mut aggregated: Vec<Coordinate<Self::Scalar>> = self+            .0+            .iter()+            .flat_map(|elem| elem.exterior().0.clone())+            .collect();+        Polygon::new(concave_hull(&mut aggregated, concavity), vec![])+    }+}++impl<T> ConcaveHull for LineString<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar> {+        Polygon::new(concave_hull(&mut self.0.clone(), concavity), vec![])+    }+}++impl<T> ConcaveHull for MultiLineString<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: T) -> Polygon<T> {+        let mut aggregated: Vec<Coordinate<T>> =+            self.0.iter().flat_map(|elem| elem.0.clone()).collect();+        Polygon::new(concave_hull(&mut aggregated, concavity), vec![])+    }+}++impl<T> ConcaveHull for MultiPoint<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: T) -> Polygon<T> {+        let mut coordinates: Vec<Coordinate<T>> = self.0.iter().map(|point| point.0).collect();+        Polygon::new(concave_hull(&mut coordinates, concavity), vec![])+    }+}++fn find_point_closest_to_line<T>(+    interior_coords_tree: &RTree<Coordinate<T>>,+    line: Line<T>,+    max_dist: T,+    edge_length: T,+    concavity: T,+    line_tree: &RTree<Line<T>>,+) -> Option<Coordinate<T>>+where+    T: Float + RTreeNum,+{+    let h = max_dist + max_dist;+    let w = line.euclidean_length() + h;+    let two = T::add(T::one(), T::one());+    let search_dist = T::div(T::sqrt(T::powi(w, 2) + T::powi(h, 2)), two);+    let centroid = line.centroid();+    let centroid_coord = Coordinate {+        x: centroid.x(),+        y: centroid.y(),+    };+    let mut candidates = interior_coords_tree+        .locate_within_distance(centroid_coord, search_dist)+        .peekable();+    let peek = candidates.peek();

if you add a ? here, you can avoid doing the big match below

    let peek = candidates.peek()?;
RestitutorOrbis

comment created time in 13 days

Pull request review commentgeorust/geo

Add Concave Hull algorithm

+use crate::algorithm::convex_hull::qhull;+use crate::algorithm::euclidean_distance::EuclideanDistance;+use crate::algorithm::euclidean_length::EuclideanLength;+use crate::algorithm::kernels::HasKernel;+use crate::prelude::Centroid;+use crate::utils::partial_min;+use crate::{Line, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon};+use geo_types::{Coordinate, CoordinateType};+use num_traits::Float;+use rstar::{RTree, RTreeNum};+use std::collections::VecDeque;++/// Returns a polygon which covers a geometry. Unlike convex hulls, which also cover+/// their geometry, a concave hull does so while trying to further minimize its area by+/// constructing edges such that the exterior of the polygon incorporates points that would+/// be interior points in a convex hull.+///+/// This implementation is inspired by https://github.com/mapbox/concaveman+/// and also uses ideas from the following paper:+/// www.iis.sinica.edu.tw/page/jise/2012/201205_10.pdf+///+/// # Example+/// ```+/// use geo::{line_string, polygon};+/// use geo::algorithm::concave_hull::ConcaveHull;+///+/// // a square shape+/// let poly = polygon![+///     (x: 0.0, y: 0.0),+///     (x: 4.0, y: 0.0),+///     (x: 4.0, y: 4.0),+///     (x: 0.0, y: 4.0),+/// ];+///+/// // The correct concave hull coordinates+/// let correct_hull = line_string![+///     (x: 4.0, y: 0.0),+///     (x: 4.0, y: 4.0),+///     (x: 0.0, y: 4.0),+///     (x: 0.0, y: 0.0),+///     (x: 4.0, y: 0.0),+/// ];+///+/// let res = poly.concave_hull(2.0);+/// assert_eq!(res.exterior(), &correct_hull);+/// ```+pub trait ConcaveHull {+    type Scalar: CoordinateType;+    fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar>;+}++impl<T> ConcaveHull for Polygon<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar> {+        let mut points: Vec<_> = self.exterior().0.clone();+        Polygon::new(concave_hull(&mut points, concavity), vec![])+    }+}++impl<T> ConcaveHull for MultiPolygon<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar> {+        let mut aggregated: Vec<Coordinate<Self::Scalar>> = self+            .0+            .iter()+            .flat_map(|elem| elem.exterior().0.clone())+            .collect();+        Polygon::new(concave_hull(&mut aggregated, concavity), vec![])+    }+}++impl<T> ConcaveHull for LineString<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar> {+        Polygon::new(concave_hull(&mut self.0.clone(), concavity), vec![])+    }+}++impl<T> ConcaveHull for MultiLineString<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: T) -> Polygon<T> {+        let mut aggregated: Vec<Coordinate<T>> =+            self.0.iter().flat_map(|elem| elem.0.clone()).collect();+        Polygon::new(concave_hull(&mut aggregated, concavity), vec![])+    }+}++impl<T> ConcaveHull for MultiPoint<T>+where+    T: Float + RTreeNum + HasKernel,+{+    type Scalar = T;+    fn concave_hull(&self, concavity: T) -> Polygon<T> {+        let mut coordinates: Vec<Coordinate<T>> = self.0.iter().map(|point| point.0).collect();+        Polygon::new(concave_hull(&mut coordinates, concavity), vec![])+    }+}++fn find_point_closest_to_line<T>(+    interior_coords_tree: &RTree<Coordinate<T>>,+    line: Line<T>,+    max_dist: T,+    edge_length: T,+    concavity: T,+    line_tree: &RTree<Line<T>>,+) -> Option<Coordinate<T>>+where+    T: Float + RTreeNum,+{+    let h = max_dist + max_dist;+    let w = line.euclidean_length() + h;+    let two = T::add(T::one(), T::one());+    let search_dist = T::div(T::sqrt(T::powi(w, 2) + T::powi(h, 2)), two);+    let centroid = line.centroid();+    let centroid_coord = Coordinate {+        x: centroid.x(),+        y: centroid.y(),+    };+    let mut candidates = interior_coords_tree+        .locate_within_distance(centroid_coord, search_dist)+        .peekable();+    let peek = candidates.peek();+    match peek {+        None => None,+        Some(&point) => {+            let closest_point =+                candidates.fold(Point::new(point.x, point.y), |acc_point, candidate| {+                    let candidate_point = Point::new(candidate.x, candidate.y);+                    if line.euclidean_distance(&acc_point)+                        > line.euclidean_distance(&candidate_point)+                    {+                        candidate_point+                    } else {+                        acc_point+                    }+                });+            let mut edges_nearby_point = line_tree+                .locate_within_distance(closest_point, search_dist)+                .peekable();+            let peeked_edge = edges_nearby_point.peek();+            let closest_edge_option = match peeked_edge {+                None => None,+                Some(&edge) => Some(edges_nearby_point.fold(*edge, |acc, candidate| {+                    if closest_point.euclidean_distance(&acc)+                        > closest_point.euclidean_distance(candidate)+                    {+                        *candidate+                    } else {+                        acc+                    }+                })),+            };+            let decision_distance = partial_min(+                closest_point.euclidean_distance(&line.start_point()),+                closest_point.euclidean_distance(&line.end_point()),+            );+            if let Some(closest_edge) = closest_edge_option {+                let far_enough = edge_length / decision_distance > concavity;+                let are_edges_equal = closest_edge == line;+                if far_enough && are_edges_equal {+                    Some(Coordinate {+                        x: closest_point.x(),+                        y: closest_point.y(),+                    })+                } else {+                    None+                }+            } else {+                None+            }+        }+    }+}++// This takes significant inspiration from:+// https://github.com/mapbox/concaveman/blob/54838e1/index.js#L11+fn concave_hull<T>(coords: &mut [Coordinate<T>], concavity: T) -> LineString<T>+where+    T: Float + RTreeNum + HasKernel,+{+    let hull = qhull::quick_hull(coords);++    if coords.len() < 4 {+        return hull;+    }++    //Get points in overall dataset that aren't on the exterior linestring of the hull+    let hull_tree: RTree<Coordinate<T>> = RTree::bulk_load(hull.clone().0);++    let interior_coords: Vec<Coordinate<T>> = coords+        .iter()+        .filter_map(|coord| {+            if !hull_tree.contains(coord) {+                Some(*coord)+            } else {+                None+            }+        })

i think this is the same?

        .filter(|coord| !hull_tree.contains(coord))
RestitutorOrbis

comment created time in 13 days

PullRequestReviewEvent
PullRequestReviewEvent

issue openedfrewsxcv/tech-organizing-handbook

James baldwin outreach quote

https://quotationcelebration.wordpress.com/2017/12/11/not-everything-that-is-faced-can-be-changed-but-nothing-can-be-changed-until-it-is-faced-james-baldwin/

created time in 13 days

created tagfrewsxcv/rust-chunked-transfer

tag1.3.0

Encoder and decoder for HTTP chunked transfer coding (RFC 7230 § 4.1)

created time in 13 days

push eventfrewsxcv/rust-chunked-transfer

Corey Farwell

commit sha 5404933038a8663ad20248a0d99cb3632ce5a16d

Prepare for 1.3.0 release

view details

push time in 13 days

push eventfrewsxcv/rust-chunked-transfer

Jacob Hoffman-Andrews

commit sha dc7577b123f782ada61b5a61de04e63b238a961e

Performance: One write syscall per chunk. This ports over an optimization from https://github.com/algesten/ureq/pull/44, to do just one write syscall per chunk. It does so efficiently by always reserving space for the chunk size at the beginning of the buffer, so we don't have to copy lots of memory around when it comes time to write the chunk.

view details

Jacob Hoffman-Andrews

commit sha cd1dfcacd58ee2025b8d9bd905c18e9a842e46ec

Use chunks.min(MAX_CHUNK_SIZE) Co-authored-by: Corey Farwell <coreyf@rwell.org>

view details

Jacob Hoffman-Andrews

commit sha 8a816e4a98a129d4e690265a4b03ddd279d3b6cd

Remove stray println

view details

Jacob Hoffman-Andrews

commit sha 9befa34cbed84f776143af139736afa86600657f

Merge branch 'just-one-write' of github.com:jsha/rust-chunked-transfer into just-one-write

view details

Corey Farwell

commit sha 3c3b5196aeb71d731cb44b29d001c1a4bb63e863

Merge remote-tracking branch 'origin/master' into just-one-write

view details

Corey Farwell

commit sha d80fc6b4be11dcd1abf6ee23d3777e4e061d5b8e

Prefix boolean method with is_

view details

Corey Farwell

commit sha 218ba3b9fbdffd1a742273b59c4abacac9ec4aa5

Replace conditional+panic with assert

view details

Corey Farwell

commit sha 3dbd1eceadc94be1a6950c560f4bf3ed0ad54ad9

Rename header constant; add helper method to find size of buffer data

view details

Corey Farwell

commit sha deb1a60b66512005521772a3501ff41c4ae62f9b

Prefer `resize` over populating with an arbitrary string.

view details

Corey Farwell

commit sha 7e8712d93cc765ce4fb2ab1fa5cd7cfb8937bb33

Fix bug with reversed assertion condition

view details

Jacob Hoffman-Andrews

commit sha e27823ac29bb3db5f16314ac3ceaf21e2a3b3f66

Remove placeholder in favor of MAX_HEADER_SIZE.

view details

Corey Farwell

commit sha d29434fea0279606d9dd71c766d65a88036c180a

Merge pull request #6 from jsha/just-one-write Performance: One write syscall per chunk.

view details

push time in 13 days

PR merged frewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

This ports over an optimization from https://github.com/algesten/ureq/pull/44, to do just one write syscall per chunk. It does so efficiently by always reserving space for the chunk size at the beginning of the buffer, so we don't have to copy lots of memory around when it comes time to write the chunk.

+79 -40

0 comment

1 changed file

jsha

pr closed time in 13 days

PullRequestReviewEvent

Pull request review commentfrewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

 where     fn reset_buffer(&mut self) {         // Reset buffer         self.buffer.clear();-        // Arbitrary bytes to take up space. Should never be seen in output.-        let placeholder: [u8; PLACEHOLDER_HEADER_SIZE] = *b"DACE\r\n";-        self.buffer.extend_from_slice(&placeholder);+        // Reserve space for the chunk size. This space will be populated once+        // we know the size of the chunk.+        self.buffer.resize(PLACEHOLDER_HEADER_SIZE, 0);

Nvm, we initialize the buffer vec to have 6 elements, so I think truncate should work

jsha

comment created time in 13 days

PullRequestReviewEvent

Pull request review commentfrewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

 where     fn reset_buffer(&mut self) {         // Reset buffer         self.buffer.clear();-        // Arbitrary bytes to take up space. Should never be seen in output.-        let placeholder: [u8; PLACEHOLDER_HEADER_SIZE] = *b"DACE\r\n";-        self.buffer.extend_from_slice(&placeholder);+        // Reserve space for the chunk size. This space will be populated once+        // we know the size of the chunk.+        self.buffer.resize(PLACEHOLDER_HEADER_SIZE, 0);

The problem with truncate is that it won't grow the Vec if the length is 0, and we need it to grow in the initialization case. I'm going to merge as is for now, but if you find a way to make truncate work, we can open a new PR for that!

jsha

comment created time in 13 days

PullRequestReviewEvent

push eventrust-fuzz/book

Corey Farwell

commit sha fda3e5ef7aac3767cbedadf79f015bf5ad8e07de

rebuild pages at

view details

push time in 13 days

Pull request review commentfrewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

 where     fn reset_buffer(&mut self) {         // Reset buffer         self.buffer.clear();-        // Arbitrary bytes to take up space. Should never be seen in output.-        let placeholder: [u8; PLACEHOLDER_HEADER_SIZE] = *b"DACE\r\n";-        self.buffer.extend_from_slice(&placeholder);+        // Reserve space for the chunk size. This space will be populated once+        // we know the size of the chunk.+        self.buffer.resize(PLACEHOLDER_HEADER_SIZE, 0);

@jsha This change seem okay? We don't need to fill this allocation in with meaningful data, it's slightly more performant just to zero it out

https://godbolt.org/z/n7d7cq

https://editor.mergely.com/Z9UMLCvs/

jsha

comment created time in 14 days

PullRequestReviewEvent

push eventjsha/rust-chunked-transfer

Corey Farwell

commit sha 7e8712d93cc765ce4fb2ab1fa5cd7cfb8937bb33

Fix bug with reversed assertion condition

view details

push time in 14 days

push eventjsha/rust-chunked-transfer

Corey Farwell

commit sha deb1a60b66512005521772a3501ff41c4ae62f9b

Prefer `resize` over populating with an arbitrary string.

view details

push time in 14 days

push eventjsha/rust-chunked-transfer

Jacob Hoffman-Andrews

commit sha 86e5e9a66fad21e2eff07eaf665d0286cf49f0cf

Update documentation link to point to docs.rs. The current documentation on github.io was out-of-date. This seemed like a quick fix to point to the most up-to-date docs.

view details

Corey Farwell

commit sha 426c2d3cdaf6613061d94e5a904a8102e90b2892

Merge pull request #5 from jsha/update-documentation-link Update documentation link to point to docs.rs.

view details

Corey Farwell

commit sha a27d73f5b837c4d9cffb76fdd4abeac307d8ef47

Add benchmark for encoding

view details

Corey Farwell

commit sha 3c3b5196aeb71d731cb44b29d001c1a4bb63e863

Merge remote-tracking branch 'origin/master' into just-one-write

view details

Corey Farwell

commit sha d80fc6b4be11dcd1abf6ee23d3777e4e061d5b8e

Prefix boolean method with is_

view details

Corey Farwell

commit sha 218ba3b9fbdffd1a742273b59c4abacac9ec4aa5

Replace conditional+panic with assert

view details

Corey Farwell

commit sha 3dbd1eceadc94be1a6950c560f4bf3ed0ad54ad9

Rename header constant; add helper method to find size of buffer data

view details

push time in 14 days

created tagfrewsxcv/cargo-all-features

tag1.2.1

A Cargo subcommand to build and test all feature flag combinations.

created time in 14 days

push eventfrewsxcv/cargo-all-features

Corey Farwell

commit sha 448d3f6eaf39df7af438673d01870c1df6ad5387

Prepare for 1.2.1 release

view details

push time in 14 days

push eventfrewsxcv/cargo-all-features

Corey Farwell

commit sha 8e90e014369327300fcbfb5e45ffc50eeaf53286

Prepare for 1.2.1 release

view details

push time in 14 days

push eventfrewsxcv/cargo-all-features

Ossi Herrala

commit sha 5c32159213b47799ccfe9903cb077aaccc0cf785

Add support for using renamed optional dependency

view details

Ossi Herrala

commit sha 5e18c1dc7447c06666dd90bb581a0b2da240a0a5

Filter out features starting with "__"

view details

Corey Farwell

commit sha 15b71a3fd9543dd355b6e80d4d9eda885142f0c7

Merge pull request #6 from oherrala/renamed-crates Renamed crates and filter out features staring with "__"

view details

push time in 14 days

PR merged frewsxcv/cargo-all-features

Renamed crates and filter out features staring with "__"

Two issues found while trying to get this crate to work with reqwest crate:

  • Add support for renamed dependencies. For example reqwest has renamed cookie to cookie_crate. See https://github.com/seanmonstar/reqwest/blob/dbd887c262a47cdda8a4a006a53a330eb0ddab6a/Cargo.toml#L103

  • Filter out features which start with double underscore (__). This might not be standardized convention in cargo, but commonly used naming scheme in many programming languages, etc. See https://github.com/seanmonstar/reqwest/blob/dbd887c262a47cdda8a4a006a53a330eb0ddab6a/Cargo.toml#L55-L62

+12 -3

1 comment

2 changed files

oherrala

pr closed time in 14 days

pull request commentfrewsxcv/cargo-all-features

Renamed crates and filter out features staring with "__"

thanks!

oherrala

comment created time in 14 days

PullRequestReviewEvent

push eventfrewsxcv/rust-chunked-transfer

Corey Farwell

commit sha eed12723329866c70a917795b800f5d7c18856e5

Black box the test

view details

push time in 15 days

push eventfrewsxcv/rust-chunked-transfer

Corey Farwell

commit sha a27d73f5b837c4d9cffb76fdd4abeac307d8ef47

Add benchmark for encoding

view details

push time in 15 days

PR opened frewsxcv/who-hosts-hate

beginnings of a restyling
+23 -5

0 comment

2 changed files

pr created time in 16 days

create barnchfrewsxcv/who-hosts-hate

branch : style

created branch time in 16 days

push eventfrewsxcv/tech-organizing-handbook

Corey Farwell

commit sha 6747ab4adb4c2e7a8b20a6da0a7402430a9d8130

resources

view details

Corey Farwell

commit sha 5cb93d1acf7182e97533f4fe6eb78a39069295fe

Merge branch 'master' of github.com:frewsxcv/organizing

view details

push time in 16 days

startedbuttplugio/buttplug

started time in 16 days

issue openedfrewsxcv/tech-organizing-handbook

union busting: companies paying dissenters a severance package to get them to quit

amazon: https://hbr.org/2014/04/why-amazon-is-copying-zappos-and-paying-employees-to-quit

zappos: https://hbr.org/2008/05/why-zappos-pays-new-employees

coinbase: https://www.theblockcrypto.com/post/79247/coinbase-offers-exit-package-for-employees-not-comfortable-with-its-mission

created time in 18 days

issue openedfrewsxcv/tech-organizing-handbook

neutrality agreement

created time in 18 days

issue openedfrewsxcv/tech-organizing-handbook

handling leaks

created time in 18 days

issue openedfrewsxcv/tech-organizing-handbook

sonotone election

Board agent had a question about titles in the bargaining unit. Suggested a “Sonotone election”. Some of the titles might involve advanced training, which would mean they are eligible to vote but they’d have a separate ballot. They’d be asked two questions - Do you want to be in a union? Do you want to be in a union with non professionals? It’s a way to create division. Kate contends that these titles are common in tech, and there is no specialization required. The board agent also asked Kickstarter their position on the sonotone election. Kickstarter is making it seem like the board is making them do this. The board is saying that Kickstarter is looking into whether the sonotone election makes sense.

https://www.nlrb.gov/sites/default/files/attachments/region-page/region-18/publication9_0_0.pdf (third page)

created time in 18 days

Pull request review commentfrewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

 where     }      pub fn with_chunks_size(output: W, chunks: usize) -> Encoder<W> {-        Encoder {+        let chunks_size = if chunks > MAX_CHUNK_SIZE {+            MAX_CHUNK_SIZE+        } else {+            chunks+        };+        let mut encoder = Encoder {             output,-            chunks_size: chunks,+            chunks_size,             buffer: Vec::with_capacity(0),             flush_after_write: false,-        }+        };+        encoder.reset_buffer();+        encoder     }      pub fn with_flush_after_write(output: W) -> Encoder<W> {-        Encoder {+        let mut encoder = Encoder {             output,             chunks_size: 8192,             buffer: Vec::with_capacity(0),             flush_after_write: true,-        }+        };+        encoder.reset_buffer();+        encoder     }-} -fn send<W>(output: &mut W, data: &[u8]) -> IoResult<()>-where-    W: Write,-{-    write!(output, "{:x}\r\n", data.len())?;-    output.write_all(data)?;-    write!(output, "\r\n")?;-    Ok(())+    fn reset_buffer(&mut self) {+        // Reset buffer+        self.buffer.clear();+        // Arbitrary bytes to take up space. Should never be seen in output.+        let placeholder: [u8; HEADER_SIZE] = *b"DACE\r\n";+        self.buffer.extend_from_slice(&placeholder);

thanks for the write-up. my brain is a little fried right now, but i'll revisit this again tomorrow and let you know if i have any follow-up q's

jsha

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentfrewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

 where     }      pub fn with_chunks_size(output: W, chunks: usize) -> Encoder<W> {-        Encoder {+        let chunks_size = if chunks > MAX_CHUNK_SIZE {+            MAX_CHUNK_SIZE+        } else {+            chunks+        };

it comes from the Ord trait which is implemented for usize

jsha

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentfrewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

 where     }      pub fn with_chunks_size(output: W, chunks: usize) -> Encoder<W> {-        Encoder {+        let chunks_size = if chunks > MAX_CHUNK_SIZE {+            MAX_CHUNK_SIZE+        } else {+            chunks+        };

are these lines the same as:

        let chunks_size = chunks.min(MAX_CHUNK_SIZE);

if so, thoughts on using it?

jsha

comment created time in 19 days

Pull request review commentfrewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

 where     }      pub fn with_chunks_size(output: W, chunks: usize) -> Encoder<W> {-        Encoder {+        let chunks_size = if chunks > MAX_CHUNK_SIZE {+            MAX_CHUNK_SIZE+        } else {+            chunks+        };+        let mut encoder = Encoder {             output,-            chunks_size: chunks,+            chunks_size,             buffer: Vec::with_capacity(0),             flush_after_write: false,-        }+        };+        encoder.reset_buffer();+        encoder     }      pub fn with_flush_after_write(output: W) -> Encoder<W> {-        Encoder {+        let mut encoder = Encoder {             output,             chunks_size: 8192,             buffer: Vec::with_capacity(0),             flush_after_write: true,-        }+        };+        encoder.reset_buffer();+        encoder     }-} -fn send<W>(output: &mut W, data: &[u8]) -> IoResult<()>-where-    W: Write,-{-    write!(output, "{:x}\r\n", data.len())?;-    output.write_all(data)?;-    write!(output, "\r\n")?;-    Ok(())+    fn reset_buffer(&mut self) {+        // Reset buffer+        self.buffer.clear();+        // Arbitrary bytes to take up space. Should never be seen in output.+        let placeholder: [u8; HEADER_SIZE] = *b"DACE\r\n";+        self.buffer.extend_from_slice(&placeholder);

are these the lines responsible for the optimization? how would this differ from doing self.buffer.reserve(HEADER_SIZE)?

https://doc.rust-lang.org/std/vec/struct.Vec.html#method.reserve

then we wouldn't need a buffer_empty method since we can just do self.buffer.is_empty()

jsha

comment created time in 19 days

Pull request review commentfrewsxcv/rust-chunked-transfer

Performance: One write syscall per chunk.

 where     }      pub fn with_chunks_size(output: W, chunks: usize) -> Encoder<W> {-        Encoder {+        let chunks_size = if chunks > MAX_CHUNK_SIZE {+            MAX_CHUNK_SIZE+        } else {+            chunks+        };+        let mut encoder = Encoder {             output,-            chunks_size: chunks,+            chunks_size,             buffer: Vec::with_capacity(0),             flush_after_write: false,-        }+        };+        encoder.reset_buffer();+        encoder     }      pub fn with_flush_after_write(output: W) -> Encoder<W> {-        Encoder {+        let mut encoder = Encoder {             output,             chunks_size: 8192,             buffer: Vec::with_capacity(0),             flush_after_write: true,-        }+        };+        encoder.reset_buffer();+        encoder     }-} -fn send<W>(output: &mut W, data: &[u8]) -> IoResult<()>-where-    W: Write,-{-    write!(output, "{:x}\r\n", data.len())?;-    output.write_all(data)?;-    write!(output, "\r\n")?;-    Ok(())+    fn reset_buffer(&mut self) {+        // Reset buffer+        self.buffer.clear();+        // Arbitrary bytes to take up space. Should never be seen in output.+        let placeholder: [u8; HEADER_SIZE] = *b"DACE\r\n";+        self.buffer.extend_from_slice(&placeholder);+    }++    fn buffer_empty(&self) -> bool {+        self.buffer.len() == HEADER_SIZE+    }++    fn send(&mut self) -> IoResult<()> {+        // Never send an empty buffer, because that would be interpreted+        // as the end of the stream, which we indicate explicitly on drop.+        if self.buffer_empty() {+            return Ok(());+        }+        // Prepend the length and \r\n to the buffer.+        let prelude = format!("{:x}\r\n", self.buffer.len() - HEADER_SIZE);+        let prelude = prelude.as_bytes();+        if prelude.len() > HEADER_SIZE {+            // This should never happen because MAX_CHUNK_SIZE of u32::MAX+            // can always be encoded in 4 hex bytes.+            panic!("invariant failed: prelude longer than HEADER_SIZE");+        }+        // Copy the prelude into the buffer. For small chunks, this won't necessarily+        // take up all the space that was reserved for the prelude.+        let offset = HEADER_SIZE - prelude.len();+        self.buffer[offset..HEADER_SIZE].clone_from_slice(&prelude);++        // Append the chunk-finishing \r\n to the buffer.+        self.buffer.write_all(b"\r\n")?;++        self.output.write_all(&self.buffer[offset..])?;+        self.reset_buffer();++        Ok(())+    } }  impl<W> Write for Encoder<W> where     W: Write, {-    fn write(&mut self, buf: &[u8]) -> IoResult<usize> {-        self.buffer.write_all(buf)?;--        while self.buffer.len() >= self.chunks_size {-            let rest = {-                let (to_send, rest) = self.buffer.split_at_mut(self.chunks_size);-                send(&mut self.output, to_send)?;-                rest.to_vec()-            };-            self.buffer = rest;-        }-        if self.flush_after_write {-            self.flush()?;+    fn write(&mut self, data: &[u8]) -> IoResult<usize> {+        println!("writing to buffer: {:?}", data);

is this supposed to be here?

jsha

comment created time in 19 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventfrewsxcv/tech-organizing-handbook

Corey Farwell

commit sha d817b5e366cc1d4e32a22b44dcacb6601def5911

expand opeiu sectino

view details

Corey Farwell

commit sha 6b666285bb954403552345301cba73ee9788c621

add source of COI, and expand heading

view details

Corey Farwell

commit sha 876d1cd3a469ea0bbd4ddde2cdee46003e8166f4

add page for NLRB election

view details

Corey Farwell

commit sha bf61e87b9ad5a62c2ccfd6420b817f27c611fed8

remove whitespace

view details

Corey Farwell

commit sha 1f9df6437dd3bd3e24c84c059d8372764a7a33c7

remove duplicate summary section

view details

push time in 19 days

push eventfrewsxcv/tech-organizing-handbook

Corey Farwell

commit sha 9ec7d3ed5bfa55d233daab47691edc5e2d81582f

add community of interest section

view details

push time in 19 days

PullRequestReviewEvent

Pull request review commentgeorust/docker-images

proj-ci containers (and extract out shared libproj-builder container)

+# https://hub.docker.com/orgs/georust/proj-ci-without-system-proj++# This container is based on the libproj-builder container, which has built+# libproj, and thus has all the dependencies for building proj from source, but+# we intentionaly have not installed it to a system path.
# we intentionally have not installed it to a system path.
michaelkirk

comment created time in 19 days

PullRequestReviewEvent
more