profile
viewpoint
Joshua Chaitin-Pollak jbcpollak @Pickle-Robot Boston Area http://code.joshpollak.com/ At @Pickle-Robot. Alumni of @6RiverSystems (now Shopify) and Kiva Systems (now Amazon Robotics)

jbcpollak/cloudinary_angular 32

Deprecated: Cloudinary now offers an official Angular library -

jbcpollak/AStar-Clojure 1

An implementation of AStar Search in Clojure

jbcpollak/barkette 0

Meowbify

jbcpollak/blob_boundaries 0

Sample C++ Code

jbcpollak/blueshell 0

Blueshell is a Promise-based Behavior Tree implementation using modern ES6 syntax.

jbcpollak/cacache 0

💩💵 but for your data. If you've got the hash, we've got the cache ™

jbcpollak/cfg 0

My shell config

jbcpollak/chgo 0

Change your go versions with ease.

jbcpollak/cloudinary_js 0

Cloudinary JavaScript library

issue commentros-infrastructure/roswiki

Docker instruction does not tell tell you to start `roscore`

If you follow the tutorial by the letter you don't get a functioning instance of the container because roscore isn't running and there is no instructions to start it.

This is confusing for a newbie.

As a new user you aren't able to edit the wiki, where are we supposed to request content changes? The wiki says to request edit access to edit from this repo.

jbcpollak

comment created time in 9 days

issue commentmicrosoft/WSL

Docker daemon fails with following output

I just installed Docker For Windows using the WSL2 on Windows 10 Home - would this issue explain why my app in a Docker container barfs with this error:

what():  PThread::start FATAL: Cannot spawn thread. Error code: 11 (Resource temporarily unavailable)

as far as I can tell without cgroups and systemd all the typical tools to raise the thread limits don't exist.

HanJoHibender

comment created time in 19 days

startedgramaziokohler/roslibpy

started time in 22 days

issue openedros-infrastructure/roswiki

Docker instruction does not tell tell you to start `roscore`

this page: http://wiki.ros.org/action/login/docker/Tutorials/Docker

tells the user to start the ros container with this command:

docker run -it ros

but this should be:

docker run -it ros roscore

At least when using melodic.

created time in 25 days

issue commentExpediaGroup/pino-rotating-file

Add option to echo filtered lines to stdout

I'm trying to accomplish something similar, I filed this ticket on the underlying library (I thought I was filing it here!): https://github.com/iccicci/rotating-file-stream/issues/53

It looks like all that needs to be done is update the dependency and re-release this package, and we'll be able to use teeToStdout (https://github.com/iccicci/rotating-file-stream/commit/04bb0b2a7fb1a70f32120537671437058d0f8b23)

TY!

micalevisk

comment created time in a month

issue openediccicci/rotating-file-stream

tee functionality?

For debugging I'd like to be able to tee output to stdout and to file. Is that possible?

created time in a month

push eventPickle-Robot/node-fluent-ffmpeg

Joshua Chaitin-Pollak

commit sha aaa845592525845145263f82f4bb99b930c822ab

removed extra done() call

view details

push time in a month

PR opened fluent-ffmpeg/node-fluent-ffmpeg

Support for gracefully exiting ffmpeg

If you exit ffmpeg sending it the 'q' key, it will exit with status code 0, but if you send it SIGINT it exits with 255 and if you send it SIGTERM it exits with 147. (from versions of ffmpeg 4.1-4.2)

In all cases it seems to shutdown gracefully, however the second two trigger the 'error' event in fluent-ffmpeg, and when I checked, the error codes from ffmpeg were not documented and not encouraged to be used in scripting.

I added an FfmpegCommand.quit() to gracefully exit by sending the 'q' key to ffmpeg and wrote a unit test to verify it functions. I also verified in my own application this works as expected and does not produce errors.

It would be great if this could be merged and a new version published to npmjs - it seems the current version on the repo lags quite a bit from a lot of bug fixes.

+52 -1

0 comment

2 changed files

pr created time in a month

create barnchPickle-Robot/node-fluent-ffmpeg

branch : feat/gracefully-quit

created branch time in a month

pull request comment6RiverSystems/eslint-config-6river

separate builtin imports from external libraries

merged as #91 due to CI constraints with forked repos.

TY @AdamVig!

jbcpollak

comment created time in a month

issue openedbobthemighty/punq

How To resolve class dependencies registered by key

lets say I have something like this:

class Dependency:
     pass

class ConsumerOfA:
    def __init__(self, dep: Dependency):
        self.dep = dep

container.register('depA', Dependency('a'))
container.register('depB', Dependency('b'))
container.register(ConsumerOfA)

cOA = container.resolve(ConsumerOfA)

How do I ensure that ConsumerOfA gets depA vs depB? Is there a way to add an annotation on init to make sure the right one is injected?

created time in 2 months

PR opened 6RiverSystems/eslint-config-6river

separate builtin imports from external libraries

This change separates NodeJS builtins and dependency libraries (externals) into two separate groups. Without this change, the are grouped together in the same block, which is fine, but they are also sorted alphabetically, which results in code like this:

import { Injectable, Inject } from '@nestjs/common';
import * as chokidar from 'chokidar';
import { promises as fs, Stats } from 'fs';
import { PinoLogger, InjectPinoLogger } from 'nestjs-pino';

After this change this the imports would look like the following (note the Node builtins are presented before the external dependencies:

import { promises as fs, Stats } from 'fs';

import { Injectable, Inject } from '@nestjs/common';
import * as chokidar from 'chokidar';
import { PinoLogger, InjectPinoLogger } from 'nestjs-pino';

Frontend apps don't have "builtins" so this change shouldn't affect them, but will make the lives of backend developers easier.

cc/ @AdamVig @mgabeler-lee-6rs

+2 -1

0 comment

1 changed file

pr created time in 2 months

create barnchjbcpollak/eslint-config-6river

branch : fix/import-order

created branch time in 2 months

fork jbcpollak/eslint-config-6river

Typescript, Angular and Mocha configs based on Google's JS formatting rules, with some extra flavor

fork in 2 months

startediamolegga/nestjs-pino

started time in 2 months

pull request commentPickle-Robot/dacite

types: add literal support for python 3.7

I didn't think this was a candidate for upstream master. If we think it should be, would do from a separate branch.

since its compatible with both 3.7 and 3.8 I'd throw the PR upstream and see what they say.

I think we can just make another PR from the existing enhance/support-literals-in-py37 branch and see what they think?

ajeisens

comment created time in 2 months

Pull request review commentPickle-Robot/dacite

add option to catch ambiguous union resolution

 def _build_value_for_union(union: Type, data: Any, config: Config) -> Any:     types = extract_generic(union)     if is_optional(union) and len(types) == 2:         return _build_value(type_=types[0], data=data, config=config)+    valid_resolutions = {}     for inner_type in types:         try:             value = _build_value(type_=inner_type, data=data, config=config)             if is_instance(value, inner_type):-                return value+                if not config.no_ambiguous_resolution:+                    return value+                else:+                    valid_resolutions[inner_type] = value         except DaciteError:             pass-    if not config.check_types:-        return data+    if config.no_ambiguous_resolution:+        if len(valid_resolutions) > 1:+            raise AmbiguousResolutionError(valid_resolutions)+        else:+            return valid_resolutions.popitem()[1]+    else:

this doesn't need an else since the previous if raises or returns. I think taking it out might help make the code flow a bit easier to read.

sinback

comment created time in 2 months

Pull request review commentPickle-Robot/dacite

add option to catch ambiguous union resolution

 def _build_value_for_union(union: Type, data: Any, config: Config) -> Any:     types = extract_generic(union)     if is_optional(union) and len(types) == 2:         return _build_value(type_=types[0], data=data, config=config)+    valid_resolutions = {}     for inner_type in types:         try:             value = _build_value(type_=inner_type, data=data, config=config)             if is_instance(value, inner_type):-                return value+                if not config.no_ambiguous_resolution:

maybe invert this conditional so it matches the one below?

sinback

comment created time in 2 months

push eventjbcpollak/edgar-vis

dependabot[bot]

commit sha f87ea91c05fc108ebc20457558aef45d5a629b00

build(deps): bump acorn from 5.7.3 to 5.7.4 (#1) Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

push time in 2 months

PR merged jbcpollak/edgar-vis

build(deps): bump acorn from 5.7.3 to 5.7.4 dependencies

Bumps acorn from 5.7.3 to 5.7.4. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/acornjs/acorn/commit/6370e90067552022710190319cbbbd8c43001957"><code>6370e90</code></a> Mark version 5.7.4</li> <li><a href="https://github.com/acornjs/acorn/commit/fbc15b1344f6dfb992f67b4bbf1357436247c8a0"><code>fbc15b1</code></a> More rigorously check surrogate pairs in regexp validator</li> <li>See full diff in <a href="https://github.com/acornjs/acorn/compare/5.7.3...5.7.4">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+6 -6

0 comment

1 changed file

dependabot[bot]

pr closed time in 2 months

issue commentUltimateHackingKeyboard/agent

UX idea: OS + Intention -> Keybinding mappings to Agent

Hi @mondalaci - I realize you'd not into this idea, so that's fine, but I wanted to clarify one thing:

This would result in an ever-growing list of shortcuts in the scancode select2 field, making simple scancodes harder to find, and due to the never-ending shortcut suggestions, it'd pose a long-term mainteance burden.

Agreed it would confusing in the scancode drop down, which is why I'd suggest a separate UI section entirely, either another tab, or a "Find Combo" button that pops up a new control.

I'm not familiar with the Agent architecture, but I don't think this would be a terrible maintenance headache since I think it could be done as data files and separate UI controls.

Maybe someday I'll have a chance to take a crack at it.

jbcpollak

comment created time in 2 months

issue commentUltimateHackingKeyboard/agent

UX idea: OS + Intention -> Keybinding mappings to Agent

There are a number of window managers on Linux for example, and each have their own shortcuts.

This is just like an i18n problem, like "en-us" and "en-gb" - you can have "linux-gnome" and "linux-kde" for example.

Also, some users would connect their UHKs to different OSes, then wonder why these functions don't work there.

I don't get this - the UHK already ships with layouts for different OSs, this just eases setting those up. It doesn't change the keyboard behavior. You'd still have "QWM" (Mac) and "QWP" (PC) layouts and users would need to switch them when they move between computers.

In fact, I have this exact problem now, and thought of this feature as a fix for it. I just brought my UHK from work (Linux) to my house (Windows) and the key combos do all sorts of different things. So I created a new Windows layout, and I'm in the process of mapping my mod layer to the correct Windows hotkeys. But I have a problem: what Windows hotkeys do the right thing? If the agent had a table I could just look up "windows->next desktop" and apply it to my Windows config. Right now I need to google a mess of hotkeys to get the right combos.

BTW, This proposal isn't a replacement for the regular keypress tab, its just a way to serve 80% of the usecases.

jbcpollak

comment created time in 2 months

issue openedUltimateHackingKeyboard/agent

UX idea: OS + Intention -> Keybinding mappings to Agent

How about having a mapping of intentions to hotkeys by OS? Then when configuring a key you could choose the intention/OS combo you want instead of having to remember the key combos for multiple OS.

What I mean is, imagine the agent has a mapping JSON structure like this:

{
    "windows10": {
        "next-desktop": "super+ctrl+left-arrow"
    },
    "linux": {
        "next-desktop": "ctrl+pageup"
    }
}

When the user selects a key in the agent, add an "Intention" tab to the popup, or add a "find Intention" button to the Keypress tab. There, the user can choose from a drop down (or search) their OS, then choose the intention from another (drop down or search). The selected key sequence gets applies to the key just as if you configured it via the Keypress tab.

In other words, its just a utility to find the key sequence you want, because looking them all up is a pain and for the most part people don't re-map the keys in their OS. The UHK firmware doesn't change because its just a regular keypress, and the agent doesn't need to be running.

As a nice enhancement, maybe the agent could remember that an intention was used to select the keypress, so it could show the user (to help them remember) but maybe that's not possible. Its not critical.

Users could create their own key mappings for lesser used OS's / desktop environments and make PRs back to the agent.

This is a continuation of this thread:

https://twitter.com/joshpollak/status/1240720134177804288?s=20

created time in 2 months

issue commentkonradhalas/dacite

Support for Literal?

Yeah - I think you'd have to add code to check for the Python version then programmatically choose which library to import from.

We can't upgrade to 3.8 yet, a library we depend on doesn't support it.

jbcpollak

comment created time in 2 months

issue commentkonradhalas/dacite

Support for Literal?

Hi @konradhalas - we just tried this and it turns out this doesn't work with Python 3.7.6. We aren't sure if we can upgrade to 3.8 or not (we are going to look into it), but I wanted to mention it.

jbcpollak

comment created time in 2 months

issue commentkonradhalas/dacite

Support for Literal?

Fantastic, TY!

jbcpollak

comment created time in 3 months

push eventjbcpollak/strap-core

jbcpollak

commit sha b95578d63198333bed0c27eb22feaf9ecc0a0610

updated (untested) to new Octokit API. Test is broken

view details

push time in 3 months

push eventjbcpollak/strap-core

Joshua Chaitin-Pollak

commit sha 2082159be319266485fbfc56035925a3cf22df84

created ci.yaml

view details

push time in 3 months

push eventjbcpollak/strap-core

jbcpollak

commit sha 22206b982bbcf75b0cb3ecde808022e83b13b204

update dependecies

view details

jbcpollak

commit sha 2547dc36f0f977a74a6a8e76d71f6849831f5ed7

audit fixes

view details

push time in 3 months

issue openedkonradhalas/dacite

Support for Literal?

I'd like to be able to deserialize from_dict() a Union of overlapping types based on the Literal values. Is that possible?

    @dataclass
    class AType:
        # changing type to str doesn't help
        type: Literal['A'] = 'A'

    @dataclass
    class BType:
        type: Literal['B'] = 'B'

    @dataclass
    class AorB:
        u: Union[AType, BType]

        obj = dacite.from_dict(
            data_class=AorB,
            data=loaded_dict,
            config=dacite.Config(strict=False)
       )

created time in 3 months

issue commentsamuelcolvin/pydantic

Support Generic Container Types

Thank you. I was able to get this to functionally work however mypy gives this error on Array[float]:

error: "Array" expects no type arguments, but 1 given

I can life without type assertions though.

jaheba

comment created time in 3 months

issue commentsamuelcolvin/pydantic

Support Generic Container Types

Or to close to what you originally had

class TypedArray(numpy.ndarray):
    @classmethod
    def __get_validators__(cls):
        yield cls.validate_type

    @classmethod
    def validate_type(cls, val):
        return numpy.array(val, dtype=cls.inner_type)

class ArrayMeta(type):
    def __getitem__(self, t):
        return type('Array', (TypedArray,), {'inner_type': t})

class Array(numpy.ndarray, metaclass=ArrayMeta):
    pass

class Model(BaseModel):
    values: Array[float]

m = Model(values=[1, 2, 3])
print(m)

Hi, I am trying to get this exact thing working but I get this error:

E RuntimeError: no validator found for <class 'Array'>, see arbitrary_types_allowed in Config

Also, Array isn't recognized as a generic, so I just defined my class as:

    @dataclass
    class HasNpArray:
        values: Array

I don't care so much about the generics functionality, I just want to be able to serialize/deserialize numpy arrays.

jaheba

comment created time in 3 months

more