alex/what-happens-when 27639
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 422
A set of tools to make the Sorbet typechecker work with Ruby on Rails seamlessly.
Get a desktop notification after a command finishes executing.
disqus/nexus 209
A centralized, pluggable admin app for Django
New and improved TC39 wiki, built with codex
educreations/django-ormcache 14
An ORM cache for Django.
Python utilities for working with Apple In-App Purchases (IAP)
educreations/django-mysql-fuzzycount 10
Approximate query counts for MySQL and Django.
pull request commentgeorust/topojson
Relax geojson version requirements
if you feel comfortable doing that then go for it! it should be just a cargo publish and ideally tagging the commit in git
comment created time in 5 days
Pull request review commentgeorust/geo
Geometry dimensions via HasDimensions trait
+use crate::{+ CoordinateType, Geometry, GeometryCollection, Line, LineString, MultiLineString, MultiPoint,+ MultiPolygon, Point, Polygon, Rect, Triangle,+};++/// Geometries can have 0, 1, or two dimensions. Or, in the case of an [`empty`](#is_empty)+/// geometry, a special `Empty` dimensionality.+///+/// ## Examples+///+/// ```+/// use geo_types::{Point, Rect, line_string};+/// use geo::algorithm::dimensions::{HasDimensions, Dimensions};+///+/// let point = Point::new(0.0, 5.0);+/// let line_string = line_string![(x: 0.0, y: 0.0), (x: 5.0, y: 5.0), (x: 0.0, y: 5.0)];+/// let rect = Rect::new((0.0, 0.0), (10.0, 10.0));+/// assert_eq!(Dimensions::ZeroDimensional, point.get_dimensions());+/// assert_eq!(Dimensions::OneDimensional, line_string.get_dimensions());+/// assert_eq!(Dimensions::TwoDimensional, rect.get_dimensions());+///+/// assert!(point.get_dimensions() < line_string.get_dimensions());+/// assert!(rect.get_dimensions() > line_string.get_dimensions());+/// ```+#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd)]+pub enum Dimensions {+ /// Some geometries, like a `MultiPoint` or `GeometryColletion` may have no elements - thus no+ /// dimensions. Note that this is distinct from being `ZeroDimensional`, like a `Point`.+ Empty,+ /// Dimension of a point+ ZeroDimensional,+ /// Dimension of a line or curve+ OneDimensional,+ /// Dimension of a surface+ TwoDimensional,+}++/// Operate on the dimensionality of geometries.+pub trait HasDimensions {+ /// Some geometries, like a `MultiPoint`, can have zero coordinates - we call these `empty`.+ ///+ /// Types like `Point` and `Rect`, which have at least one coordinate by construction, can+ /// never be considered empty.+ /// ```+ /// use geo_types::{Point, Coordinate, LineString};+ /// use geo::algorithm::dimensions::HasDimensions;+ ///+ /// let line_string = LineString(vec![+ /// Coordinate { x: 0., y: 0. },+ /// Coordinate { x: 10., y: 0. },+ /// ]);+ /// assert!(!line_string.is_empty());+ ///+ /// let empty_line_string: LineString<f64> = LineString(vec![]);+ /// assert!(empty_line_string.is_empty());+ ///+ /// let point = Point::new(0.0, 0.0);+ /// assert!(!point.is_empty());+ /// ```+ fn is_empty(&self) -> bool;++ /// The dimensions of some geometries are fixed, e.g. a Point always has 0 dimensions. However+ /// for others, the dimensionality depends on the specific geometry instance - for example+ /// typical `Rect`s are 2-dimensional, but it's possible to create degenerate `Rect`s which+ /// have either 1 or 0 dimensions.+ ///+ /// ## Examples+ ///+ /// ```+ /// use geo_types::{GeometryCollection, Rect, Point};+ /// use geo::algorithm::dimensions::{Dimensions, HasDimensions};+ ///+ /// // normal rectangle+ /// let rect = Rect::new((0.0, 0.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::TwoDimensional, rect.get_dimensions());+ ///+ /// // "rectangle" with zero height degenerates to a line+ /// let degenerate_line_rect = Rect::new((0.0, 10.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::OneDimensional, degenerate_line_rect.get_dimensions());+ ///+ /// // "rectangle" with zero height and zero width degenerates to a point+ /// let degenerate_point_rect = Rect::new((10.0, 10.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::ZeroDimensional, degenerate_point_rect.get_dimensions());+ ///+ /// // collections inherit the greatest dimensionality of their elements+ /// let geometry_collection = GeometryCollection(vec![degenerate_line_rect.into(), degenerate_point_rect.into()]);+ /// assert_eq!(Dimensions::OneDimensional, geometry_collection.get_dimensions());+ ///+ /// let point = Point::new(10.0, 10.0);+ /// assert_eq!(Dimensions::ZeroDimensional, point.get_dimensions());+ ///+ /// // An `Empty` dimensionality is distinct from, and less than, being 0-dimensional+ /// let empty_collection = GeometryCollection::<f32>(vec![]);+ /// assert_eq!(Dimensions::Empty, empty_collection.get_dimensions());+ /// assert!(empty_collection.get_dimensions() < point.get_dimensions());+ /// ```+ fn get_dimensions(&self) -> Dimensions;++ /// The dimensions of the `Geometry`'s boundary, as used by OGC-SFA.+ ///+ /// ## Examples+ ///+ /// ```+ /// use geo_types::{GeometryCollection, Rect, Point};+ /// use geo::algorithm::dimensions::{Dimensions, HasDimensions};+ ///+ /// // a point has no boundary+ /// let point = Point::new(10.0, 10.0);+ /// assert_eq!(Dimensions::Empty, point.get_boundary_dimensions());+ ///+ /// // a typical rectangle has a *line* (one dimensional) boundary+ /// let rect = Rect::new((0.0, 0.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::OneDimensional, rect.get_boundary_dimensions());+ ///+ /// // a "rectangle" with zero height degenerates to a line, whose boundary is two points+ /// let degenerate_line_rect = Rect::new((0.0, 10.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::ZeroDimensional, degenerate_line_rect.get_boundary_dimensions());+ ///+ /// // a "rectangle" with zero height and zero width degenerates to a point,+ /// // and points have no boundary+ /// let degenerate_point_rect = Rect::new((10.0, 10.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::Empty, degenerate_point_rect.get_boundary_dimensions());+ ///+ /// // collections inherit the greatest dimensionality of their elements+ /// let geometry_collection = GeometryCollection(vec![degenerate_line_rect.into(), degenerate_point_rect.into()]);+ /// assert_eq!(Dimensions::ZeroDimensional, geometry_collection.get_boundary_dimensions());+ ///+ /// let geometry_collection = GeometryCollection::<f32>(vec![]);+ /// assert_eq!(Dimensions::Empty, geometry_collection.get_boundary_dimensions());+ /// ```+ fn get_boundary_dimensions(&self) -> Dimensions;+}++impl<C: CoordinateType> HasDimensions for Geometry<C> {+ fn is_empty(&self) -> bool {+ match self {+ Geometry::Point(g) => g.is_empty(),+ Geometry::Line(g) => g.is_empty(),+ Geometry::LineString(g) => g.is_empty(),+ Geometry::Polygon(g) => g.is_empty(),+ Geometry::MultiPoint(g) => g.is_empty(),+ Geometry::MultiLineString(g) => g.is_empty(),+ Geometry::MultiPolygon(g) => g.is_empty(),+ Geometry::GeometryCollection(g) => g.is_empty(),+ Geometry::Rect(g) => g.is_empty(),+ Geometry::Triangle(g) => g.is_empty(),+ }+ }++ fn get_dimensions(&self) -> Dimensions {+ match self {+ Geometry::Point(g) => g.get_dimensions(),+ Geometry::Line(g) => g.get_dimensions(),+ Geometry::LineString(g) => g.get_dimensions(),+ Geometry::Polygon(g) => g.get_dimensions(),+ Geometry::MultiPoint(g) => g.get_dimensions(),+ Geometry::MultiLineString(g) => g.get_dimensions(),+ Geometry::MultiPolygon(g) => g.get_dimensions(),+ Geometry::GeometryCollection(g) => g.get_dimensions(),+ Geometry::Rect(g) => g.get_dimensions(),+ Geometry::Triangle(g) => g.get_dimensions(),+ }+ }++ fn get_boundary_dimensions(&self) -> Dimensions {+ match self {+ Geometry::Point(g) => g.get_boundary_dimensions(),+ Geometry::Line(g) => g.get_boundary_dimensions(),+ Geometry::LineString(g) => g.get_boundary_dimensions(),+ Geometry::Polygon(g) => g.get_boundary_dimensions(),+ Geometry::MultiPoint(g) => g.get_boundary_dimensions(),+ Geometry::MultiLineString(g) => g.get_boundary_dimensions(),+ Geometry::MultiPolygon(g) => g.get_boundary_dimensions(),+ Geometry::GeometryCollection(g) => g.get_boundary_dimensions(),+ Geometry::Rect(g) => g.get_boundary_dimensions(),+ Geometry::Triangle(g) => g.get_boundary_dimensions(),+ }+ }+}++impl<C: CoordinateType> HasDimensions for Point<C> {+ fn is_empty(&self) -> bool {+ false+ }++ fn get_dimensions(&self) -> Dimensions {+ Dimensions::ZeroDimensional+ }++ fn get_boundary_dimensions(&self) -> Dimensions {+ Dimensions::Empty+ }+}++impl<C: CoordinateType> HasDimensions for Line<C> {+ fn is_empty(&self) -> bool {+ false+ }++ fn get_dimensions(&self) -> Dimensions {+ if self.start == self.end {+ // degenerate line is a point+ Dimensions::ZeroDimensional+ } else {+ Dimensions::OneDimensional+ }+ }++ fn get_boundary_dimensions(&self) -> Dimensions {+ if self.start == self.end {+ // degenerate line is a point, which has no boundary+ Dimensions::Empty+ } else {+ Dimensions::ZeroDimensional+ }+ }+}++impl<C: CoordinateType> HasDimensions for LineString<C> {+ fn is_empty(&self) -> bool {+ self.0.is_empty()+ }++ fn get_dimensions(&self) -> Dimensions {+ if self.0.is_empty() {+ return Dimensions::Empty;+ }++ debug_assert!(self.0.len() > 1, "invalid line_string with 1 coord");+ let first = self.0[0];+ if self.0.iter().any(|&coord| first != coord) {+ Dimensions::OneDimensional+ } else {+ // all coords are the same - i.e. a point+ Dimensions::ZeroDimensional+ }+ }++ ///```
/// ```
comment created time in 5 days
Pull request review commentgeorust/geo
Geometry dimensions via HasDimensions trait
pub mod concave_hull; pub mod contains; /// Calculate the convex hull of a `Geometry`. pub mod convex_hull;+/// Dimensionality of a geometry and it's boundary, based on OGC-SFA.
/// Dimensionality of a geometry and its boundary, based on OGC-SFA.
comment created time in 6 days
Pull request review commentgeorust/geo
Geometry dimensions via HasDimensions trait
+use crate::{+ CoordinateType, Geometry, GeometryCollection, Line, LineString, MultiLineString, MultiPoint,+ MultiPolygon, Point, Polygon, Rect, Triangle,+};++/// Geometries can have 0, 1, or two dimensions. Or, in the case of an [`empty`](#is_empty)+/// geometry, a special `Empty` dimensionality.+///+/// ## Examples
/// # Examples
https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#using-markdown-1
comment created time in 6 days
Pull request review commentgeorust/geo
Geometry dimensions via HasDimensions trait
+use crate::{+ CoordinateType, Geometry, GeometryCollection, Line, LineString, MultiLineString, MultiPoint,+ MultiPolygon, Point, Polygon, Rect, Triangle,+};++/// Geometries can have 0, 1, or two dimensions. Or, in the case of an [`empty`](#is_empty)+/// geometry, a special `Empty` dimensionality.+///+/// ## Examples+///+/// ```+/// use geo_types::{Point, Rect, line_string};+/// use geo::algorithm::dimensions::{HasDimensions, Dimensions};+///+/// let point = Point::new(0.0, 5.0);+/// let line_string = line_string![(x: 0.0, y: 0.0), (x: 5.0, y: 5.0), (x: 0.0, y: 5.0)];+/// let rect = Rect::new((0.0, 0.0), (10.0, 10.0));+/// assert_eq!(Dimensions::ZeroDimensional, point.get_dimensions());+/// assert_eq!(Dimensions::OneDimensional, line_string.get_dimensions());+/// assert_eq!(Dimensions::TwoDimensional, rect.get_dimensions());+///+/// assert!(point.get_dimensions() < line_string.get_dimensions());+/// assert!(rect.get_dimensions() > line_string.get_dimensions());+/// ```+#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd)]+pub enum Dimensions {+ /// Some geometries, like a `MultiPoint` or `GeometryColletion` may have no elements - thus no+ /// dimensions. Note that this is distinct from being `ZeroDimensional`, like a `Point`.+ Empty,+ /// Dimension of a point+ ZeroDimensional,+ /// Dimension of a line or curve+ OneDimensional,+ /// Dimension of a surface+ TwoDimensional,+}++/// Operate on the dimensionality of geometries.+pub trait HasDimensions {+ /// Some geometries, like a `MultiPoint`, can have zero coordinates - we call these `empty`.+ ///+ /// Types like `Point` and `Rect`, which have at least one coordinate by construction, can+ /// never be considered empty.+ /// ```+ /// use geo_types::{Point, Coordinate, LineString};+ /// use geo::algorithm::dimensions::HasDimensions;+ ///+ /// let line_string = LineString(vec![+ /// Coordinate { x: 0., y: 0. },+ /// Coordinate { x: 10., y: 0. },+ /// ]);+ /// assert!(!line_string.is_empty());+ ///+ /// let empty_line_string: LineString<f64> = LineString(vec![]);+ /// assert!(empty_line_string.is_empty());+ ///+ /// let point = Point::new(0.0, 0.0);+ /// assert!(!point.is_empty());+ /// ```+ fn is_empty(&self) -> bool;++ /// The dimensions of some geometries are fixed, e.g. a Point always has 0 dimensions. However+ /// for others, the dimensionality depends on the specific geometry instance - for example+ /// typical `Rect`s are 2-dimensional, but it's possible to create degenerate `Rect`s which+ /// have either 1 or 0 dimensions.+ ///+ /// ## Examples+ ///+ /// ```+ /// use geo_types::{GeometryCollection, Rect, Point};+ /// use geo::algorithm::dimensions::{Dimensions, HasDimensions};+ ///+ /// // normal rectangle+ /// let rect = Rect::new((0.0, 0.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::TwoDimensional, rect.get_dimensions());+ ///+ /// // "rectangle" with zero height degenerates to a line+ /// let degenerate_line_rect = Rect::new((0.0, 10.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::OneDimensional, degenerate_line_rect.get_dimensions());+ ///+ /// // "rectangle" with zero height and zero width degenerates to a point+ /// let degenerate_point_rect = Rect::new((10.0, 10.0), (10.0, 10.0));+ /// assert_eq!(Dimensions::ZeroDimensional, degenerate_point_rect.get_dimensions());+ ///+ /// // collections inherit the greatest dimensionality of their elements+ /// let geometry_collection = GeometryCollection(vec![degenerate_line_rect.into(), degenerate_point_rect.into()]);+ /// assert_eq!(Dimensions::OneDimensional, geometry_collection.get_dimensions());+ ///+ /// let point = Point::new(10.0, 10.0);+ /// assert_eq!(Dimensions::ZeroDimensional, point.get_dimensions());+ ///+ /// // An `Empty` dimensionality is distinct from, and less than, being 0-dimensional+ /// let empty_collection = GeometryCollection::<f32>(vec![]);+ /// assert_eq!(Dimensions::Empty, empty_collection.get_dimensions());+ /// assert!(empty_collection.get_dimensions() < point.get_dimensions());+ /// ```+ fn get_dimensions(&self) -> Dimensions;
thoughts on removing the get_ prefix? getters in rust tend to not have 'get'
https://rust-lang.github.io/api-guidelines/naming.html#getter-names-follow-rust-convention-c-getter
comment created time in 5 days
push eventgeorust/gpx
commit sha 0eb4f8b56bc6faf3be28b9090e24981d8604a357
Update to the latest rustfmt
commit sha 9bc7e060cb68018f5e6a5d3ec52c622146b37795
Merge pull request #43 from NathanHowell/rustfmt Update to the latest rustfmt
push time in 6 days
PR merged georust/gpx
Travis builds are failing due to changes in rustfmt. I've updated the CI scripts following the guidance in https://github.com/rust-lang/rustfmt#on-the-nightly-toolchain.
pr closed time in 6 days
push eventgeorust/geocoding
commit sha 444829de1b281a11a6e139c7a58c3ae4e930c768
Prepare for 0.3.1 release
push time in 6 days
push eventrust-fuzz/trophy-case
commit sha 2e6dca475185cebb7afbf19a377197e52d008474
lz4_flex heap-buffer-overflow
commit sha 1a878baa446fceee238b5657e2bfd1c5d6297631
Merge pull request #99 from PSeitz/patch-2 lz4_flex heap-buffer-overflow
push time in 7 days
pull request commentrust-lang/rust
Clean up small, surprising bits of code
oh and looks like it was already approved, oops
comment created time in 8 days
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 😅
comment created time in 8 days
pull request commentrust-lang/rust
Clean up small, surprising bits of code
@bors r+
comment created time in 8 days
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
comment created time in 8 days
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
comment created time in 8 days
issue closedgeorust/topojson
Why does TopoJSON has not been added to (crates.io) ?
closed time in 8 days
tredoeissue commentgeorust/topojson
as of https://github.com/georust/topojson/pull/6, the topojson crate is on crates.io
comment created time in 8 days
push eventrust-fuzz/trophy-case
commit sha a03f158b19a577f9a2d1440d37ff275beebfde49
Update README.md
commit sha 9bd9c96e5667ec257caa75faa7f836023efa4a89
Merge pull request #98 from PSeitz/patch-1 add lz4_flex issue
push time in 8 days
push eventfrewsxcv/who-hosts-hate
commit sha d74b59b53a01295acc945ea9e2c801db505bdbbe
pipenv update
commit sha 3cccbce4bc3afcae71104b04aea0e7a974f863ef
install python 3.8
push time in 10 days
startedEloston/ungoogled-chromium
started time in 11 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 => {}
}
}
};
comment created time in 12 days
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 13 days
issue commentrust-lang/crates.io
Show github teams in "Manage owners" view
this appears to be resolved https://crates.io/crates/rustfix/owners
comment created time in 13 days
issue openedfrewsxcv/tech-organizing-handbook
https://twitter.com/MNYCWorkers/following
https://twitter.com/MNYCWorkers/following
created time in 14 days
startedralfbiedert/cheats.rs
started time in 14 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)?
comment created time in 14 days
issue openedfrewsxcv/tech-organizing-handbook
https://www.opeiu.org/NeedAUnion/WhatAreMyLegalRights.aspx
created time in 15 days
push eventfrewsxcv/who-hosts-hate
commit sha 9a663ac1db8688e994a61b19d29593b250304be1
there is a new column
push time in 15 days
startedHironsan/HateSonar
started time in 18 days
push eventrust-fuzz/trophy-case
commit sha cb6418b7c55bf1317e4fedc934d1416b467609f2
added my latest fuzzing findings
commit sha f6eed333921ea55cf956351620e5823a311cde66
Merge pull request #97 from alexanderkjall/patch-3 added my latest fuzzing findings
push time in 18 days
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.
comment created time in 18 days
push eventfrewsxcv/who-hosts-hate
commit sha 43de436616af63dbd195d341d3337b402b096cc7
Revert "Temporary whois usage to debug CI" This reverts commit d567aa5e7b56a8f6ca01bbf89e308a13d9cc72da.
commit sha 690bf1de7989b901cd9c482050fa98ded916a1d3
Do not whois for now
push time in 18 days
push eventfrewsxcv/who-hosts-hate
commit sha d567aa5e7b56a8f6ca01bbf89e308a13d9cc72da
Temporary whois usage to debug CI
push time in 18 days
push eventfrewsxcv/who-hosts-hate
commit sha 760b6eec06c692dfc2925f570796da55bf30ae8e
use new variable name
push time in 19 days
push eventfrewsxcv/who-hosts-hate
commit sha a33960e1af63147112551651b1d6d3e43890d9c6
sudo?
push time in 19 days
push eventfrewsxcv/who-hosts-hate
commit sha 7630dc7cd344565e75988cf1bb614cab8ec1e424
whitespace
commit sha 393a42a2bb8c83630f893f27a0e59d890b381189
install whois
push time in 19 days
push eventfrewsxcv/who-hosts-hate
commit sha 3d140b5f3e712c4744b637284635a06a6e83bbc4
bump to python 3.8
commit sha 19760624ce8d08dfef61ba8b7905aa38d6eb112e
add classification to csv; add domain registrar
commit sha 58ff9195c88879c555befb65428801187f932f7b
merge from originmaster
push time in 19 days
issue commentfrewsxcv/who-hosts-hate
https://github.com/frewsxcv/who-hosts-hate/commit/ec35113ee42205417151bcc689ecc4729446a88c
comment created time in 19 days
push eventfrewsxcv/who-hosts-hate
commit sha ec35113ee42205417151bcc689ecc4729446a88c
Update main.yml
push time in 19 days
Pull request review commentgeorust/geo
+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
comment created time in 20 days
Pull request review commentgeorust/geo
+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()?;
comment created time in 20 days
Pull request review commentgeorust/geo
+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))
comment created time in 20 days
issue openedfrewsxcv/tech-organizing-handbook
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 20 days
created tagfrewsxcv/rust-chunked-transfer
Encoder and decoder for HTTP chunked transfer coding (RFC 7230 § 4.1)
created time in 20 days
push eventfrewsxcv/rust-chunked-transfer
commit sha 5404933038a8663ad20248a0d99cb3632ce5a16d
Prepare for 1.3.0 release
push time in 20 days
push eventfrewsxcv/rust-chunked-transfer
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.
commit sha cd1dfcacd58ee2025b8d9bd905c18e9a842e46ec
Use chunks.min(MAX_CHUNK_SIZE) Co-authored-by: Corey Farwell <[email protected]>
commit sha 8a816e4a98a129d4e690265a4b03ddd279d3b6cd
Remove stray println
commit sha 9befa34cbed84f776143af139736afa86600657f
Merge branch 'just-one-write' of github.com:jsha/rust-chunked-transfer into just-one-write
commit sha 3c3b5196aeb71d731cb44b29d001c1a4bb63e863
Merge remote-tracking branch 'origin/master' into just-one-write
commit sha d80fc6b4be11dcd1abf6ee23d3777e4e061d5b8e
Prefix boolean method with is_
commit sha 218ba3b9fbdffd1a742273b59c4abacac9ec4aa5
Replace conditional+panic with assert
commit sha 3dbd1eceadc94be1a6950c560f4bf3ed0ad54ad9
Rename header constant; add helper method to find size of buffer data
commit sha deb1a60b66512005521772a3501ff41c4ae62f9b
Prefer `resize` over populating with an arbitrary string.
commit sha 7e8712d93cc765ce4fb2ab1fa5cd7cfb8937bb33
Fix bug with reversed assertion condition
commit sha e27823ac29bb3db5f16314ac3ceaf21e2a3b3f66
Remove placeholder in favor of MAX_HEADER_SIZE.
commit sha d29434fea0279606d9dd71c766d65a88036c180a
Merge pull request #6 from jsha/just-one-write Performance: One write syscall per chunk.
push time in 20 days
PR merged frewsxcv/rust-chunked-transfer
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.
pr closed time in 20 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);
Nvm, we initialize the buffer vec to have 6 elements, so I think truncate should work
comment created time in 20 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);
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!
comment created time in 20 days
push eventrust-fuzz/book
commit sha fda3e5ef7aac3767cbedadf79f015bf5ad8e07de
rebuild pages at
push time in 21 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/
comment created time in 21 days
push eventjsha/rust-chunked-transfer
commit sha 7e8712d93cc765ce4fb2ab1fa5cd7cfb8937bb33
Fix bug with reversed assertion condition
push time in 21 days
push eventjsha/rust-chunked-transfer
commit sha deb1a60b66512005521772a3501ff41c4ae62f9b
Prefer `resize` over populating with an arbitrary string.
push time in 21 days
push eventjsha/rust-chunked-transfer
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.
commit sha 426c2d3cdaf6613061d94e5a904a8102e90b2892
Merge pull request #5 from jsha/update-documentation-link Update documentation link to point to docs.rs.
commit sha a27d73f5b837c4d9cffb76fdd4abeac307d8ef47
Add benchmark for encoding
commit sha 3c3b5196aeb71d731cb44b29d001c1a4bb63e863
Merge remote-tracking branch 'origin/master' into just-one-write
commit sha d80fc6b4be11dcd1abf6ee23d3777e4e061d5b8e
Prefix boolean method with is_
commit sha 218ba3b9fbdffd1a742273b59c4abacac9ec4aa5
Replace conditional+panic with assert
commit sha 3dbd1eceadc94be1a6950c560f4bf3ed0ad54ad9
Rename header constant; add helper method to find size of buffer data
push time in 21 days
created tagfrewsxcv/cargo-all-features
A Cargo subcommand to build and test all feature flag combinations.
created time in 21 days
push eventfrewsxcv/cargo-all-features
commit sha 448d3f6eaf39df7af438673d01870c1df6ad5387
Prepare for 1.2.1 release
push time in 21 days
push eventfrewsxcv/cargo-all-features
commit sha 8e90e014369327300fcbfb5e45ffc50eeaf53286
Prepare for 1.2.1 release
push time in 21 days
push eventfrewsxcv/cargo-all-features
commit sha 5c32159213b47799ccfe9903cb077aaccc0cf785
Add support for using renamed optional dependency
commit sha 5e18c1dc7447c06666dd90bb581a0b2da240a0a5
Filter out features starting with "__"
commit sha 15b71a3fd9543dd355b6e80d4d9eda885142f0c7
Merge pull request #6 from oherrala/renamed-crates Renamed crates and filter out features staring with "__"
push time in 21 days
PR merged frewsxcv/cargo-all-features
Two issues found while trying to get this crate to work with reqwest crate:
-
Add support for renamed dependencies. For example
reqwesthas renamedcookietocookie_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
pr closed time in 21 days
pull request commentfrewsxcv/cargo-all-features
Renamed crates and filter out features staring with "__"
thanks!
comment created time in 21 days
push eventfrewsxcv/rust-chunked-transfer
commit sha eed12723329866c70a917795b800f5d7c18856e5
Black box the test
push time in 22 days
push eventfrewsxcv/rust-chunked-transfer
commit sha a27d73f5b837c4d9cffb76fdd4abeac307d8ef47
Add benchmark for encoding
push time in 22 days
push eventfrewsxcv/tech-organizing-handbook
commit sha 6747ab4adb4c2e7a8b20a6da0a7402430a9d8130
resources
commit sha 5cb93d1acf7182e97533f4fe6eb78a39069295fe
Merge branch 'master' of github.com:frewsxcv/organizing
push time in 23 days
startedbuttplugio/buttplug
started time in 23 days