Phlex ActionView template handler

Not a full implementation yet but I wanted to get your thoughts on this. What do you think of Phlex as a templating engine in rails?
I've been doing this in a static site generator I've been hacking away on and noticed some people discussing on the phlex-ruby: https://github.com/orgs/phlex-ruby/discussions/589
# app/views/posts/show.phlex

h1 { @post.title }
article(class: "prose") { @post.body }

I had this thought a while back, but as I used Phlex more I’m glad I didn’t go down the templating path.
What I realized I was getting tired of is initializing classes with the same arguments in the controller, so I created https://github.com/rubymonolith/superview
In the README I only show examples of inline views, which is great for prototyping (think Sinatra), but in your case you probably want the view files in your ./app/views directory. For that create your view files at ./app/views/foo/show.rb, then in the controller:
class FooController
  include Superview::Actions
  include Views::Foo
end

This will use Zeitwork conventions to load the view files that correspond with your actions, just like you’d expect with Rails templates, but it perseveres the OO-composability goodness of Phlex.

Very cool, I'm in love with Superform. Should have checked out more of your repos.

Hey @nolantait 👋
Thanks for proposing this feature through your PR. The community has voiced similar requests, so it's clearly a point of interest.
However, I believe incorporating this into phlex-rails poses challenges, as it conflicts with some of the library's fundamental principles:

Safety: Phlex minimizes dependency on distant instance variables, reducing bug risks—a benefit that could be compromised with your proposed feature.

Performance: Phlex's speed gains come from bypassing ActionView template lookups. Introducing templating capabilities would negate this advantage.

Consistency: While Phlex may initially seem at odds with ActionView, its object-oriented approach to views actually aligns closely with idiomatic Ruby. Over time, this consistency proves beneficial.

Given these constraints, it seems more fitting for your feature to exist as an extension gem rather than a core addition.


[browser] Native scroll prevented on iOS Safari

On iOS Safari native scroll gets blocked by call of event.preventDefault() when scrolling direction is same than swipe direction and momentum scrolling is enabled (-webkit-overflow-scrolling: touch;).
This can be reproduced by adding "WebkitOverflowScrolling: 'touch'" to styles of third slide container of demo 9 in documentation.
Probably fix involves ensuring that event.preventDefault() would not be called until native scroll detection is done.

It was fixed with #389.


1.36 is incredibly "bright"

VSCode Version: 1.36
OS Version: Windows 10 1903 (Slow Ring Build 18362.175)

Steps to Reproduce:

Open VS Code

Does this issue occur when all extensions are disabled?: Yes
I tried this with both VS Code stable and my VS Code Insiders install (mostly since I had not updated the Insiders install since before 1.35).
Before:

After:

Both of these images are the same theme and everything. I also have an HDR monitor connected, but VS Code is not running on the HDR monitor. The HDR monitor makes it a little better, but it still far brighter than on 1.35.

@AngellusMortis any difference if you run from the command line: code --force-color-profile=srgb?

Yep, that actually fixes it.

/duplicate https://github.com/microsoft/vscode/issues/65816


Improve Documentation

Hello, i love the project but i feel like the exploring the features via the --help command is very tedious. Specifically the commands --ignore and --cut_out are not explained in a way that i understand. Please add some more explanation or maybe a markdown file with all the commands. This would make the software so much more user friendly.
I think a great way would be a config file where all settings with their default values are commented out, and as a user you can easily comment in the desired settings and see the default value very easily. That way you could create different config files for different usages and are very flexible. Maybe it could look something like this:
auto-editor myFile.mp4 -load_cfg standard.aecfg
Hope you find my idea helpful.

Some commands do need more things written about them.
The configuration idea intrigues me but I think having a portable config file would make the learning curve too steep.
It would be better to have a single config file that auto-editor always looks, and it could be changed users.

Some commands do need more things written about them.
The configuration idea intrigues me but I think having a portable config file would make the learning curve too steep.
It would be better to have a single config file that auto-editor always looks, and it could be changed users.

I understand your concern. Maybe you could have the option to load a custom config file like mentioned above.
On installation there could be a command like:
auto-editor --init_config
which creates a standard config file (which contains command descriptions for beginners) and is used unless you use a command like --load_custom_config myConfig.cfg--
This is just a suggestion of course. I appreciate that you like the idea and think having the option to load different configs would make the software very convenient for frequent use.

I understand your concern. Maybe you could have the option to load a custom config file like mentioned above.
On installation there could be a command like:
auto-editor --init_config
which creates a standard config file (which contains command descriptions for beginners) and is used unless you use a command like --load_custom_config myConfig.cfg--
This is just a suggestion of course. I appreciate that you like the idea and think having the option to load different configs would make the software very convenient for frequent use.

closing since a config file is now available. Feel free for anyone to make attention comments here or in another issue on this topic.


IndicatorExtensions cannot be used with PythonIndicator

Expected Behavior
IndicatorExtensions can be used with PythonIndicator for all method (Of, Over,...)
Actual Behavior
For Of:
It will throw error of Cannot perform runtime binding on a null reference in PythonIndicator.cs:line 143
It looks like it didn't read the PythonIndicator's value correctly.
For others:
The combination method didn't get called at all, just like https://github.com/QuantConnect/Lean/issues/3565#issuecomment-1113254800
Potential Solution
NA
Reproducing the Problem
https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_8bbd321995671f7f48427d27a4bd29d6.html
System Information
QC cloud
Checklist

[X] I have completely filled out this template
[X] I have confirmed that this issue exists on the current master branch
[X] I have confirmed that this is not a duplicate issue by searching issues

[X] I have provided detailed steps to reproduce the issue

I am reopening this issue because IndicatorExtensions.sma (fc02262) is not working and https://github.com/QuantConnect/Lean/issues/6615 didn't test it.

After debugging the regression test attached to this issue, I found the second indicator wasn't being updated since the first indicator was being updated manually. When calling self.range_indicator.update(data.bars.get(self.qqq)), instead of calling the base implementation of the indicator BaseIndicator<T>.Update()  it called directly the python definition of the update method. Therefore, the method OnUpdated was never called, so the action attached to Updated was also never called, and thus the second indicator was not updated. Still, you can fix the algo by doing this:
Instead of defining an update method in the custom python class, you can define a method called compute_next_value which overrides the base method ComputeNextValue. That way, when you call self.range_indicator.update(data.bars.get(self.qqq)), LEAN will call the base implementation BaseIndicator<T>.Update() that will call on its time the attached action in Updated.

is_ready doesn't seem to work with custom python indicators
from collections import deque

class CustomSimpleMovingAverage(PythonIndicator):
    def __init__(self, name, period):
        self.name = name
        self.warm_up_period = period
        self.time = datetime.min
        self.value = 0
        self.queue = deque(maxlen=period)

    def update(self, input: BaseData) -> bool:
        self.queue.appendleft(input.value)
        count = len(self.queue)
        self.time = input.time
        self.value = sum(self.queue) / count
        print(count == self.queue.maxlen)
        return count == self.queue.maxlen

sma = CustomSimpleMovingAverage('sma', 3)
qb = QuantBook()
spy = qb.add_equity('SPY').symbol
for bar in qb.history[TradeBar](spy, 5, Resolution.DAILY):
    sma.update(bar)
print(f'Done: {sma.is_ready}')

False
False
True
True
True
Done: False


Node command not found

After upgrading from v0.7.7 to v1.0.4, lefthook stopped resolving module paths. Maybe I'm missing something.

The same problem when migrate to v0.8.0.

Hey @vanyauhalin ! Could you tell about your nodejs installation? Do you update PATH env in .bashrc to point to node? I think this is crucial for understanding the reasons of this bug :thinking:

At first, I thought that maybe this is the fnm changing $PATH and because of it node command are not found, but no. I'm attaching a little more detailed command run history.

fish, fnm, lefthook v0.7.7
~/Documents/development/self/lefthook-command-0.7.7 on main
$ node -v
v18.4.0
~/Documents/development/self/lefthook-command-0.7.7 on main
$ fnm current
system
~/Documents/development/self/lefthook-command-0.7.7 on main
$ pnpm i
Packages: +83
~/Documents/development/self/lefthook-command-0.7.7 on main
$ sh node_modules/.bin/lefthook install
SYNCING lefthook.yml
SERVED HOOKS: pre-commit, prepare-commit-msg

~/Documents/development/self/lefthook-command-0.7.7 on main
$ vim src.js
~/Documents/development/self/lefthook-command-0.7.7 on main
$ git add src.js
~/Documents/development/self/lefthook-command-0.7.7 on main
$ git commit -m 'should be failed'
Lefthook v0.7.7
RUNNING HOOKS GROUP: pre-commit

  EXECUTE > lint

/Users/vanyauhalin/Documents/development/self/lefthook-command-0.7.7/src.js
  1:13  error  Strings must use singlequote  quotes

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

SUMMARY: (done in 0.45 seconds)
🥊  lint

~/Documents/development/self/lefthook-command-0.7.7 on main
$ echo $PATH
/Users/vanyauhalin/Library/Caches/fnm_multishells/7854_1662306441420/bin /opt/homebrew/bin /opt/homebrew/sbin /opt/homebrew/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /Library/Apple/usr/bin
~/Documents/development/self/lefthook-command-0.7.7 on main
$ ps
  PID TTY           TIME CMD
 7844 ttys000    0:01.68 -fish

zsh, lefthook v0.7.7
~/Documents/development/self/lefthook-command-0.7.7 on main
$ node -v
v18.4.0
~/Documents/development/self/lefthook-command-0.7.7 on main
$ fnm current
error: `fnm env` was not applied in this context.
~/Documents/development/self/lefthook-command-0.7.7 on main
$ pnpm i
Packages: +83
~/Documents/development/self/lefthook-command-0.7.7 on main
$ sh node_modules/.bin/lefthook install
SYNCING lefthook.yml
SERVED HOOKS: pre-commit, prepare-commit-msg

~/Documents/development/self/lefthook-command-0.7.7 on main
$ vim src.js
~/Documents/development/self/lefthook-command-0.7.7 on main
$ git add src.js
~/Documents/development/self/lefthook-command-0.7.7 on main
$ git commit -m 'should be failed'
Lefthook v0.7.7
RUNNING HOOKS GROUP: pre-commit

  EXECUTE > lint

/Users/vanyauhalin/Documents/development/self/lefthook-command-0.7.7/src.js
  1:13  error  Strings must use singlequote  quotes

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

SUMMARY: (done in 0.50 seconds)
🥊  lint

~/Documents/development/self/lefthook-command-0.7.7 on main
$ echo $PATH
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
~/Documents/development/self/lefthook-command-0.7.7 on main
$ ps
  PID TTY           TIME CMD
 8647 ttys002    0:00.15 -zsh

fish, fnm, lefthook v0.8.0
~/Documents/development/self/lefthook-command-0.8.0 on main
$ node -v
v18.4.0
~/Documents/development/self/lefthook-command-0.8.0 on main
$ fnm current
system
~/Documents/development/self/lefthook-command-0.8.0 on main
$ pnpm i
Packages: +83
~/Documents/development/self/lefthook-command-0.8.0 on main
$ sh node_modules/.bin/lefthook install
SYNCING lefthook.yml
SERVED HOOKS: pre-commit, prepare-commit-msg

~/Documents/development/self/lefthook-command-0.8.0 on main
$ vim src.js
~/Documents/development/self/lefthook-command-0.8.0 on main
$ git add src.js
~/Documents/development/self/lefthook-command-0.8.0 on main
$ git commit -m 'should be failed'
Lefthook v0.8.0
RUNNING HOOKS GROUP: pre-commit

  EXECUTE > lint
 sh: eslint: command not found

SUMMARY: (done in 0.01 seconds)
🥊  lint

~/Documents/development/self/lefthook-command-0.8.0 on main
$ echo $PATH
/Users/vanyauhalin/Library/Caches/fnm_multishells/7854_1662306441420/bin /opt/homebrew/bin /opt/homebrew/sbin /opt/homebrew/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /Library/Apple/usr/bin
~/Documents/development/self/lefthook-command-0.8.0 on main
$ ps
  PID TTY           TIME CMD
 7844 ttys000    0:02.11 -fish

zsh, lefthook v0.8.0
~/Documents/development/self/lefthook-command-0.8.0 on main
$ node -v
v18.4.0
~/Documents/development/self/lefthook-command-0.8.0 on main
$ fnm current
error: `fnm env` was not applied in this context.
~/Documents/development/self/lefthook-command-0.8.0 on main
$ pnpm i
Packages: +83
~/Documents/development/self/lefthook-command-0.8.0 on main
$ sh node_modules/.bin/lefthook install
SYNCING lefthook.yml
SERVED HOOKS: pre-commit, prepare-commit-msg

~/Documents/development/self/lefthook-command-0.8.0 on main
$ vim src.js
~/Documents/development/self/lefthook-command-0.8.0 on main
$ git add src.js
~/Documents/development/self/lefthook-command-0.8.0 on main
$ git commit -m 'should be failed'
Lefthook v0.8.0
RUNNING HOOKS GROUP: pre-commit

  EXECUTE > lint
 sh: eslint: command not found

SUMMARY: (done in 0.01 seconds)
🥊  lint

~/Documents/development/self/lefthook-command-0.8.0 on main
$ echo $PATH
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
~/Documents/development/self/lefthook-command-0.8.0 on main
$ ps
  PID TTY           TIME CMD
 8647 ttys002    0:00.25 -zsh

$ where node
/opt/homebrew/bin/node

By the way, if you explicitly specify in the configuration where to run the command, then everything will work.
pre-commit:
  commands:
    lint:
      glob: "*.js"
      run: sh node_modules/.bin/eslint {staged_files}

Hmm, so node_modules/.bin/ is dynamically added to PATH right? Is it pnpm, or fnm magic? Even with v0.7.7 version but without pnpm and fnm I can't run eslint. I guess in this case you rely on a dev environment a lot.
Can you provide the tweaks for fnm and pnpm? Maybe they add something in ~/.zshrc? Maybe they change the way cd behaves or something like that? Sorry for the long answering, but it's just hard for me to reproduce this without this context.


[Feature] Interpolate the grapple with a cubic spline, then draw it.

See FoCG 3rd chapter 15 for a mathematical discussion regarding curves and splines.

[x] Implement Cardinal cubic splines
[x] Convert ccs -> cubic bezier spline
[x] Plumb together with the grapple postion and render.
[x] Implement controls for debug drawings

Note: Cardinal cubic splines are splines which interpolates all control points (except first and last), has local control, and has C1 continuity. (see 15.5.3 p363)

Regarding the debug drawing controls, they are only partial.
In a further issue, we should:

Control drawing of the rectangles constituting the rope
Draw the rectangles on top (probably use depth)


CFFL

CFFL

Linter check found the following problems:
The following problems have been found:
ERROR: /tmp/abs_1c4p_2hhn6/clone/recipe/meta.yaml:19: host_section_needs_exact_pinnings: Packages in host must have exact version pinnings, except python build tools.
ERROR: /tmp/abs_1c4p_2hhn6/clone/recipe/meta.yaml:21: missing_wheel: For pypi packages, wheel should be present in the host section
ERROR: /tmp/abs_1c4p_2hhn6/clone/recipe/meta.yaml:37: missing_pip_check: For pypi packages, pip check should be present in the test commands
ERROR: /tmp/abs_1c4p_2hhn6/clone/recipe/meta.yaml:44: missing_dev_url: The recipe is missing a dev_url
WARNING: /tmp/abs_1c4p_2hhn6/clone/recipe/meta.yaml:44: missing_description: The recipe is missing a description
ERROR: /tmp/abs_1c4p_2hhn6/clone/recipe/meta.yaml:44: missing_documentation: The recipe is missing a doc_url or doc_source_url
Errors were found

Linter check found the following problems:
The following problems have been found:
ERROR: /tmp/abs_ae2u67dly9/clone/recipe/meta.yaml:19: host_section_needs_exact_pinnings: Packages in host must have exact version pinnings, except python build tools.
ERROR: /tmp/abs_ae2u67dly9/clone/recipe/meta.yaml:21: missing_wheel: For pypi packages, wheel should be present in the host section
ERROR: /tmp/abs_ae2u67dly9/clone/recipe/meta.yaml:37: missing_pip_check: For pypi packages, pip check should be present in the test commands
WARNING: /tmp/abs_ae2u67dly9/clone/recipe/meta.yaml:44: missing_description: The recipe is missing a description
ERROR: /tmp/abs_ae2u67dly9/clone/recipe/meta.yaml:44: missing_dev_url: The recipe is missing a dev_url
ERROR: /tmp/abs_ae2u67dly9/clone/recipe/meta.yaml:44: missing_documentation: The recipe is missing a doc_url or doc_source_url
Errors were found


[NEW] Swag Opportunity  🎉

Name Of Organization
Activeloop
Description
Regardless of what issue you will be resolving, any contribution will be rewarded with Activeloop swag!
Swag Items
Headphones, T-shirts, Stickers
Link to proof
https://www.activeloop.ai/hacktoberfest/

Share the link for Activeloop X hacktoberfest 2022.


Building 0.2.4on osx using pip fails

Ran in to some problems related to pysam-developers/pysam @AndreasHeger
➜  ~  python -c "import pysam; print(pysam.__version__)"
0.8.4

Then, at some point, later on during pip install cgat:
cythoning scripts/_bam2peakshape.pyx to scripts/_bam2peakshape.c
  building 'CGAT._bam2peakshape' extension
  clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE= -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/lib/python2.7/site-packages/pysam -I/usr/local/lib/python2.7/site-packages/pysam/include/htslib -I/usr/local/lib/python2.7/site-packages/pysam/include/samtools -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scripts/_bam2peakshape.c -o build/temp.macosx-10.11-x86_64-2.7/scripts/_bam2peakshape.o
  In file included from scripts/_bam2peakshape.c:255:
  /usr/local/lib/python2.7/site-packages/pysam/pysam_stream.h:8:1: warning: unused function 'kseq_init' [-Wunused-function]
  KSEQ_INIT(gzFile, gzread)
  ^
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:244:35: note: expanded from macro 'KSEQ_INIT'
  #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read)
                                    ^
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:241:2: note: expanded from macro 'KSEQ_INIT2'
          __KSEQ_BASIC(SCOPE, type_t)                                     \
          ^
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:170:16: note: expanded from macro '__KSEQ_BASIC'
          SCOPE kseq_t *kseq_init(type_t fd)                                                                      \
                        ^
  In file included from scripts/_bam2peakshape.c:255:
  /usr/local/lib/python2.7/site-packages/pysam/pysam_stream.h:8:1: warning: unused function 'kseq_destroy' [-Wunused-function]
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:244:35: note: expanded from macro 'KSEQ_INIT'
  #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read)
                                    ^
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:241:2: note: expanded from macro 'KSEQ_INIT2'
          __KSEQ_BASIC(SCOPE, type_t)                                     \
          ^
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:176:13: note: expanded from macro '__KSEQ_BASIC'
          SCOPE void kseq_destroy(kseq_t *ks)                                                                     \
                     ^
  In file included from scripts/_bam2peakshape.c:255:
  /usr/local/lib/python2.7/site-packages/pysam/pysam_stream.h:8:1: warning: unused function 'kseq_read' [-Wunused-function]
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:244:35: note: expanded from macro 'KSEQ_INIT'
  #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read)
                                    ^
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:242:2: note: expanded from macro 'KSEQ_INIT2'
          __KSEQ_READ(SCOPE)
          ^
  /usr/local/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:190:12: note: expanded from macro '__KSEQ_READ'
          SCOPE int kseq_read(kseq_t *seq) \
                    ^
  scripts/_bam2peakshape.c:9413:28: warning: unused function '__Pyx_PyObject_AsString' [-Wunused-function]
  static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
                             ^
  scripts/_bam2peakshape.c:9410:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
  static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
                                 ^
  scripts/_bam2peakshape.c:343:29: warning: unused function '__Pyx_Py_UNICODE_strlen' [-Wunused-function]
  static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
                              ^
  scripts/_bam2peakshape.c:9587:33: warning: unused function '__Pyx_PyInt_FromSize_t' [-Wunused-function]
  static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
                                  ^
  scripts/_bam2peakshape.c:7759:32: warning: unused function '__Pyx_GetItemInt_List_Fast' [-Wunused-function]
  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                 ^
  scripts/_bam2peakshape.c:7774:32: warning: unused function '__Pyx_GetItemInt_Tuple_Fast' [-Wunused-function]
  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                 ^
  scripts/_bam2peakshape.c:8160:26: warning: unused function '__Pyx_PyUnicode_Equals' [-Wunused-function]
  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
                           ^
  scripts/_bam2peakshape.c:8274:27: warning: unused function '__Pyx_ErrFetch' [-Wunused-function]
  static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
                            ^
  scripts/_bam2peakshape.c:1574:26: warning: unused function 'resize' [-Wunused-function]
  static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
                           ^
  scripts/_bam2peakshape.c:6512:35: warning: unused function '__pyx_f_7cpython_5array_clone' [-Wunused-function]
  static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
                                    ^
  scripts/_bam2peakshape.c:6614:35: warning: unused function '__pyx_f_7cpython_5array_copy' [-Wunused-function]
  static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
                                    ^
  scripts/_bam2peakshape.c:6768:26: warning: unused function '__pyx_f_7cpython_5array_extend' [-Wunused-function]
  static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
                           ^
  scripts/_bam2peakshape.c:6842:27: warning: unused function '__pyx_f_7cpython_5array_zero' [-Wunused-function]
  static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
                            ^
  16 warnings generated.
  clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk build/temp.macosx-10.11-x86_64-2.7/scripts/_bam2peakshape.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -o build/lib.macosx-10.11-x86_64-2.7/CGAT/_bam2peakshape.so
  cythoning scripts/_bam2stats.pyx to scripts/_bam2stats.c

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          # Alternatives to dictionary
          # 1. POSIX hash tables (hsearch,...) or trees: very slow
          # 2. custom hash implementation: worth the effort?
          # 3. Sorted list and binary search: too slow for many lookups
          reads = {}
          fastqfile = Fastqfile(filename_fastq)
                              ^
  ------------------------------------------------------------

  scripts/_bam2stats.pyx:110:29: undeclared name not builtin: Fastqfile
  building 'CGAT._bam2stats' extension
  clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE= -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/lib/python2.7/site-packages/pysam -I/usr/local/lib/python2.7/site-packages/pysam/include/htslib -I/usr/local/lib/python2.7/site-packages/pysam/include/samtools -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scripts/_bam2stats.c -o build/temp.macosx-10.11-x86_64-2.7/scripts/_bam2stats.o
  scripts/_bam2stats.c:1:2: error: Do not use this file, it is the result of a failed Cython compilation.
  #error Do not use this file, it is the result of a failed Cython compilation.
   ^
  1 error generated.
  error: command 'clang' failed with exit status 1

Similar errors occur during cythoning of _bam2bam.pyx, _bam2bed.pyx, _bam2geneprofile.pyx, all originating with KSEQ_INIT, but there they only throw errors and don't break during cythoning.

FWIW, pip install from the git repo worked fine.

The github code refers to Fastxfile, rather than Fastqfile.
pysam 0.8.4 exports FastxFile and FastqFile (note the capitals) python classes, but I don't know about the C classes.
This suggests that indeed the code on pip was not updated properly for the lastest version of pysam.
@sebastian-luna-valero - any ideas on this?

Yeah, I thought as much. At least according to the release notes of pysam 0.8.1 the old Fastqfile-API is still available and marked as depricated. I haven't looked at the code, but either it was completely removed until 0.8.4, or something's off there.

Did you ever sort this? My suggestion is that after installing all the dependencies via pip, you clone and install the code github.
Let me know if you need any help with that.

Yes, thanks!. I installed cgat through git using pip install git+https://github.com/CGATOxford/cgat after checking making sure that the dependencies were up to date, that seemed to work fine. I haven't checked the pysam codebase to see if the deprecated API calls were removed, however.

Thanks both,
There are specific instructions on how to install the CGAT code on OSX:
https://www.cgat.org/downloads/public/cgat/documentation/CGATInstallationOSX.html
However, it might need an update as well.
I was working on the conda installation for OSX but then got distracted with other tasks.

Hi Sebastian,
The problem here seems to be that the code on PyPy is sufficiently behind
that on GitHub that it no longer works with the current versions of the
dependencies (the main culprit, surprise, surprise, being pysam).
From: Sebastian Luna Valero<EMAIL_ADDRESS>Sent: 01 February 2016 16:45
To: CGATOxford/cgat
Cc: Ian Sudbery
Subject: Re: [cgat] Building 0.2.4on osx using pip fails (#244)
Thanks both,
There are specific instructions on how to install the CGAT code on OSX:
https://www.cgat.org/downloads/public/cgat/documentation/CGATInstallationOSX.html
However, it might need an update as well.
I was working on the conda installation for OSX but then got distracted
with other tasks.
—
Reply to this email directly or view it on GitHub
https://github.com/CGATOxford/cgat/issues/244#issuecomment-178062459.

This issue has been consolidated with several others on issue #252, please see there for further developments.


new: builder images tags via OCI

What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area cmd
/area pkg
/area docs
What this PR does / why we need it:
Multiple things are fixed:

no more docker search; instead we will use falcoctl OCI utilities to retrieve list of tags for a docker repository
moved our builder image name protocol to properly use a docker repo + tag (see below notes for reviewers)
added back a default builder image tag, so that eg: driverkit releases will, by default, use builder images tagged together with them. This was a behavior once upon a time that was completely dropped some months ago.
I think it still makes sense therefore i added it back.
For FileImageLister make explicit the arch and tag shipped by an image entry
Improved docs

Which issue(s) this PR fixes:
Fixes #256
Special notes for your reviewer:
CI will fail because we changed the builder image names protocol.
Old protocol:

falcosecurity/driverkit-builder-any-x86_64_gcc8.0.0_gcc6.0.0_gcc5.0.0_gcc4.9.0_gcc4.8.0:latest

New protocol:

falcosecurity/driverkit-builder:any-x86_64_gcc8.0.0_gcc6.0.0_gcc5.0.0_gcc4.9.0_gcc4.8.0-latest

As you can see, we now properly have a docker repository; to still be able to retrieve desired image tag (ie: latest) we had to add the -latest suffix.
As always, we might want to:

either push the new builder images to a different repo (eg: fededp/driverkit-builder)
or disable integration tests, merge this, and enable them back; this way master CI will take care of pushing new builder images for us

I'd go with the first (as it was the case other times we broke the builder images names), but i am currently using my smartphone internet data, therefore am not able to do so :)
Does this PR introduce a user-facing change?:
new: fetch list of builder images via falcoctl OCI utilities

There is not a label identifying the kind of this PR.
Please specify it either using /kind <group> or manually from the side menu.

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

/cc @dwindsor @EXONER4TED @Lowaiz

/hold until we decide what to do with integration tests.

The changes look good, I'm fine to just disable tests for this PR to let it build the new images for us.

I'm not familiar with CircleCI... how do we disable those temporarily? Can you just comment them out in code? I suspect the project rules will require it though.

We can just skip the make integration_test step: https://github.com/falcosecurity/driverkit/blob/master/.circleci/config.yml#LL19C7-L19C7

I think we can wait a little bit more and then eventually consider any non-answer as yes :)
Thank you!

Dropped integration tests! :pray: for CI

Imho we can go now @EXONER4TED ! :) Thank you!

I added some more tests around FileImagesLister in latest commit!

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: EXONER4TED, FedeDP
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [EXONER4TED,FedeDP]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


Document update  for url-path-map create option

We have identified the issues with our current document. It needs to be corrected. Document in question -  https://learn.microsoft.com/en-us/cli/azure/network/application-gateway/url-path-map?view=azure-cli-latest
CLI - az network application-gateway url-path-map create
We have optional parameters that need to be part of the required field. Details in this document -
https://microsoft-my.sharepoint.com/:w:/p/rnautiyal/EZADAhQMm81KgLKMxrWW8WQB-a9Y96Ok1QHrh5MkDjIeZQ?e=iLGxIX
AppGW url-path-map document update.docx

@necusjz for awareness

@rnautiyal Is it a breaking change when such optional parameters (--default-address-pool and --default-http-settings) become required?

@necusjz  -   There is no impact. Nothing is new. It was a document error that we are correcting now. Please let me know when we can update.  Thanks

@necusjz  - Are we on track for 4/4?

@rnautiyal No, since we haven't reached a consensus on "mandatory or not". What's our finial solution now?

@necusjz  - This is mandatory. The only time it will not be used is if the target type is redirection.
Update is in document.
--default-address-pool
Name or ID of the default backend address pool. This is not required if the target type is redirection.
--default-http-settings
Name or ID of the default HTTP settings. This is not required if the target type is redirection.
https://microsoft-my.sharepoint.com/:w:/p/rnautiyal/EZADAhQMm81KgLKMxrWW8WQB-a9Y96Ok1QHrh5MkDjIeZQ?e=ypch92


[INTEL MKL] Change order for remapper

This PR is to test if there will be any regression if the order of remapper in grappler meta_optimizer is moved before arithmetic_optimizer.

@ezhulenev could you please if this PR would have any regression or not?

Though I did not test for perf regressions, they still could show up after the change will be submitted.

Though I did not test for perf regressions, they still could show up after the change will be submitted.

@ezhulenev I see this has been reverted. Could you please explain me the reason?

@ezhulenev I see this has been reverted. Could you please explain me the reason?

I caused ~8% perf regression in multi-gpu (and I think single GPU as well) Resnet benchmark on V100. Still don't know the root cause.

I caused ~8% perf regression in multi-gpu (and I think single GPU as well) Resnet benchmark on V100. Still don't know the root cause.

@ezhulenev Thanks for your quick reply. If this PR is not the root cause, may I request to bring this PR back.
I have work for couple of fusions (with DNNL aka INTEL_MKL) based on this PR, i.e., an assumption that remapper runs before arithmetic_optimizer.

@ezhulenev Thanks for your quick reply. If this PR is not the root cause, may I request to bring this PR back.
I have work for couple of fusions (with DNNL aka INTEL_MKL) based on this PR, i.e., an assumption that remapper runs before arithmetic_optimizer.

The problem is unfortunately in this PR, I'm just not sure what exactly happens, my guess is that some fusion prevents an important arithmetic rewrite from happening. I have 2 perf profiles, will try to find the clue there. Unfortunately it takes an order of hours to reproduce the benchmark in multi-gpu setup...
What are the current problems with remapper running after arithmetic?

The problem is unfortunately in this PR, I'm just not sure what exactly happens, my guess is that some fusion prevents an important arithmetic rewrite from happening. I have 2 perf profiles, will try to find the clue there. Unfortunately it takes an order of hours to reproduce the benchmark in multi-gpu setup...
What are the current problems with remapper running after arithmetic?

@ezhulenev Thanks again for your kind reply.
I have been preparing a PR for a fusion (MatMul + BiasAdd + Gelu) through remapper optimizer, using pattern matcher that we have contributed earlier. Subgraph for gelu is generated from the api tf.nn.gelu(feature, approximate=True). This optimization is very useful for BERT_LARGE model inference on Intel CPU. It gives us 20% performance improvement. Below are sample subgraphs: (left) generated from python api (middle) input graph to remapper when arithmetic_optimizer runs before remapper and (right) input graph to remapper when arithmetic_optimizer does not run before remapper. So arithmetic_optimzer changes the graph that is not obvious from python APIs. Although I can provide middle graph as an input to the pattern matcher, for future complex fusion it becomes unpredictable pattern for a potential fusion.

Adding @agramesh1  in the discussion.

@ezhulenev Thanks again for your kind reply.
I have been preparing a PR for a fusion (MatMul + BiasAdd + Gelu) through remapper optimizer, using pattern matcher that we have contributed earlier. Subgraph for gelu is generated from the api tf.nn.gelu(feature, approximate=True). This optimization is very useful for BERT_LARGE model inference on Intel CPU. It gives us 20% performance improvement. Below are sample subgraphs: (left) generated from python api (middle) input graph to remapper when arithmetic_optimizer runs before remapper and (right) input graph to remapper when arithmetic_optimizer does not run before remapper. So arithmetic_optimzer changes the graph that is not obvious from python APIs. Although I can provide middle graph as an input to the pattern matcher, for future complex fusion it becomes unpredictable pattern for a potential fusion.

Adding @agramesh1  in the discussion.


Doesn't compile with Boost 1.74

The master branch does not compile with the latest Boost release: 1.74.
A similar compile error is emitted both on macos with clang and on linux with gcc.

Tested with boost.1.73 and the project compiles.


Text Artifacts in Rename Window with Rust Attributes

Describe the bug
I just tried out dressing and I'm getting text artifacts in the rename window when the line above the to be renamed item has Rust attributes. See below for example code.
The green text below is the artifact, it should just say Webpage.
The extra text is overwritten and disappears when typing over it.

System information

OS: Linux
Neovim version: 0.6.1
Dressing config: default config, no changes

require('dressing').setup({})

To Reproduce
Steps to reproduce the behavior:

Open a Rust file
Trigger lsp rename (on Webpage below)

#[derive(Serialize, Deserialize, Entity, Clone)]
#[factor(namespace = "semantic")]
pub struct Webpage {
}

Additional context
The relevant LSP is rust-analyzer, if that makes any difference.

It looks like your terminal may not support the fake transparency? Try setting winblend = 0
require('dressing').setup({
  input = {
    winblend = 0
  }
})

Yeah, that was it indeed.
The terminal is kitty.

Since Kitty is fairly popular, maybe a note in the README would be good.

Huh... that's interesting because I use kitty. Perhaps it's the font you're using? I will admit I am no expert on terminal rendering

Also relatively odd. I'm using DejaVu Sans Mono, so a pretty standard font.
I'm using the Sway Wayland compositor, maybe that's related.


Remove "enabled" flag for plugins

Some plugins, such as docker machine, have an enabled variable. If the plugin is loaded, it should be considered enabled, otherwise the user wouldn't have added it to the plugin list.
It's also not intuitive having to add the plugin to a plugin list and setting an environment variable.

It think most built-in plugins have a *_ENABLED configuration variable available.
It should be an easy fix for anybody interested.


drivers/ieee802154: Fix coverity #178236, #178237 Out of bounds access

Fixed the exposure to an out of bounds access of data structure due to
improper size test ("off by one") in two places.

 If you open your commit message, then that has now different text than the PR description.

Incorrect change that introduced its own "off-by-one". Correct fix already captured in different PR.

commit comment changed according to requests.

You changed the PR description, the actual commit is still unchanged. To change the commit message, you need to resend the patch. Add also coverity ids (both) to commit message, the syntax is
Coverity-CID: 178236
Coverity-CID: 178237

@jukkar , I'm trying to close this PR. I don't want it merged as this was fixed in a different pull request that has been merged.


Malformed HTML in CDDL 1.0

There's a misplaced
 in CDDL 1.0, starting around line 71. The code block should end with
 rather than
 (the
 must be nested inside the
).
Malformed

                  <var class="replacable-license-text"> 1.9.</var>
            "Modifications" means the Source Code and Executable form of any of the following:

 --- this line closes the list item prematurly

  --- this line is in error

                     <var class="replacable-license-text"> A.</var>
              Any file that results from an addition to, deletion from or modification of the contents of a
                 file containing Original Software or previous Modifications;

                     <var class="replacable-license-text"> B.</var>
              Any new file that contains any part of the Original Software or previous Modification; or

                     <var class="replacable-license-text"> C.</var>
              Any new file that is contributed or otherwise made available under the terms of this License.

Revised

          <var class="replacable-license-text">1.9.</var> "Modifications" means the Source Code and Executable form of
          any of the following:

<var class="replacable-license-text">A.</var> Any file that results from an addition to, deletion from
            or modification of the contents of a file containing Original Software or previous Modifications;

<var class="replacable-license-text">B.</var> Any new file that contains any part of the Original
            Software or previous Modification; or

<var class="replacable-license-text">C.</var> Any new file that is contributed or otherwise made
            available under the terms of this License.

Pardon the reformatting.

This is due to an incorrectly placed </item> in the source XML: https://github.com/spdx/license-list-XML/blob/03c58ca3e2c4470a072eb4f3c9f6c8bb0b2d796a/src/CDDL-1.0.xml#L64
Transferring to the license-list-XML repo


Add to requirements php-xml module or check if enabled.

Describe the bug: if the php-xml module is not active, the plugin goes into a endless loop while checking the template.
To Reproduce the error: disable the php-xml module
OS | any
WordPress version | any
PHP version | any
Browser | any
From the apache log:
PHP Fatal error:  Uncaught Error: Call to undefined function PHP_CodeSniffer\\Util\\simplexml_load_string() in /my/theme/folder//wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Util/Standards.php:119\nStack trace:\n#0 /my/theme/folder//wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Runner.php(324): PHP_CodeSniffer\\Util\\Standards::getInstalledStandardDetails()\n#1 /my/theme/folder//wp-content/plugins/theme-sniffer/src/callback/class-run-sniffer-callback.php(593): PHP_CodeSniffer\\Runner->init()\n#2 /my/theme/folder//wp-content/plugins/theme-sniffer/src/callback/class-run-sniffer-callback.php(464): Theme_Sniffer\\Callback\\Run_Sniffer_Callback->get_sniff_results(Array)\n#3 /my/theme/folder//wp-includes/class-wp-hook.php(286): Theme_Sniffer\\Callback\\Run_Sniffer_Callback->callback('')\n#4 /my/theme/folder//wp-includes/class-wp-hook.php(31 in /my/theme/folder//wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Util/Standards.php on line 119, referer: https://my/theme/folder/wp-admin/admin.php?page=theme-sniffer

Thanks for reporting this bug. I'll keep this in mind when writing an update, and try to check if the module is present, or if the function simplexml_load_string() exists on activation, and exit if it doesn't.

Was closed with #180


Register OpenRefine in Windows application registry to avoid cleanup of app data

Describe the bug
There are reports that recent versions of CCleaner could potentially erase workspace files of OpenRefine on Windows:
https://groups.google.com/forum/#!topic/openrefine/pE9kXmiNRqU
To Reproduce
Not sure if this is reproducible, someone with a Windows machine should investigate.
Current Results
All projects are deleted.
Expected behavior
CCleaner should detect the application data for OpenRefine should not be deleted by default. Perhaps this data is deleted because OpenRefine is not formally installed in the application registry, so we might want to ship proper Windows installers (such as with InnoSetup) which do this.
Desktop:

OS: Windows

OpenRefine :

All versions are probably affected.

I am a forum helper/moderator at the CCleaner forum and have investigated this issue.
CCleaner is not removing the workspace itself.
However if a user runs 'Health Check' in CCleaner then as part of the process CCleaner runs a software updater which will find if OpenRefine has a newer version available.
The user does have the option not to update any apps that the software updater finds, but by default Health Check will launch the apps own updater.
It is the OpenRefine update which is removing the workspace, as it always does.
For more info see my replies here on a thread on the CCleaner forum:
https://community.ccleaner.com/topic/58424-delete-good-workspace-when-updating-a-software/?tab=comments#comment-320365
It is an issue that users using Health Check may not be aware that they don't have to accept any updates found/offered, and this has been elevated to the attention of the CCleaner staff.

Thanks for chiming in!

It is the OpenRefine update which is removing the workspace, as it always does.

OpenRefine certainly does not delete the workspace when it is updated - we maintain compatibility with existing workspaces, which are read from the application data.
I do not think CCleaner is able to detect updates for OpenRefine since it is not even installed in the apps registry…

Sorry, but your own update page and backup page clearly state that a user should backup their workspace before updating.
CCleaner does not clean anything from OpenRefine by default.
The only problem we have ever seen reported with OpenRefine is that one particular thread where the user clearlt states that OpenRefine had been updated by the user running Health Check and getting 3/4 software updates.
Obviously if CCleaner had been set to somehow clear his workspace then it would have happened before.

PS the user on the CCleaner forum appears to be the same guy who posted on google groups, your link in your OP.

PPS. as it is only this one person who is reporting this then I'm wondering if the actual issue is something else.
If CCleaner was indeed clearing OpenRefine workspace then I'd expect to see a lot more reports of that.

I've been working with the affected user and they report that this issue is resolved and they have their workspace back.
They had run the Registry Cleaning tool in CCleaner, which seems to have deleted an entry that was redirecting from appdata\roaming to appdata\local.
So although the OpenRefine data was still there in 'Local' OpenRefine was looking in 'Roaming' for it.
They have now copied the data from Local to Roaming and it's working again for them.
I've advised not to run the Registry Cleaner (or any Registry Cleaner) again.
(PS. I wish that CCleaner would make that Reg Cleaner less prominent so people weren't tempted to use it. They have promised to do so but it's not happened yet).
Sorry for my earlier misunderstanding about the update.


ReactNative Action

Goal

Testing

Release Notes

WHAT:
WHY:
WHO:

#829  👈
master

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @nelsitoPuglisi and the rest of your teammates on  Graphite


Support for integer keys in the SAX interface when parsing CBOR

Currently parsing CBOR with this library can only handle string keys. At the project I am working on, we want to use integer keys to reduce the size of our responses by using them as an alias for the long string keys. As such it would be very helpful to have some way to transform those to integer keys. While this would probably not fit into the STL-like interface, there is place to add it to the SAX interface.
My proposal would be to add overloads for bool key(string_t& val);, which take an integer or similar types. The default version of those functions should still emit a parse error, but a library user would be able to override them and decide how to handle them differently. That way I can transform the CBOR into something, that can be handled via the STL interface (or one could even use that to build some native structs).
One issue I see with that, is how to handle the default implementation, which should call bool parse_error(std::size_t position, const std::string& last_token, const detail::exception& ex); imo. This has more parameters, which may have gotten lost already? This may be solveable by accessing some internal state, but I am not familiar enough with the library to be able to tell, if this is actually doable.
Alternatives
One could probably also implement the parsing in the parse_error callback, but that would be difficult and error prone. Maybe there is also already a way to do this already, but I don't know how.
PS: How do I tag this as enhancement?

Well, Mr. bot, I just didn't have time to work on that yet. I would like to have this feature at some point though, since it will be needed for low bandwidth support in my Matrix client. ;-)


How to use a custom pooling function for a model?

I am new to Keras and trying to implement a convolution neural network for predicting handwritten digits in the MNIST dataset using the theano backend.
I tried with having a MaxPooling2D layer in my model and it gives a good result. I am planning to try on a pooling method that will give the max value and the min value on the feature map (essentially doing two poolings on the feature map). I realized that Keras uses pool2d function from theano and they don't have a implementation of a min pooling.
I am wondering is there any way to implement a custom pooling layer in Keras just like using a custom objective function?
Thanks!

For this particular case, you can just do a max pool of the negation of the
input.
pool2d(x)
and pool2d(-x)
If you want other pooling there is the images2neibs that you could use:
http://deeplearning.net/software/theano/library/tensor/nnet/neighbours.html#libdoc-tensor-nnet-neighbours
On Wed, May 25, 2016 at 7:26 PM, matthewmok<EMAIL_ADDRESS>wrote:

I am new to Keras and trying to implement a convolution neural network for
predicting handwritten digits in the MNIST dataset using the theano
backend.
I tried with having a MaxPooling2D layer in my model and it gives a good
result. I am planning to try on a pooling method that will give the max
value and the min value on the feature map (essentially doing two poolings
on the feature map). I realized that Keras uses pool2d function from theano
and they don't have a implementation of a min pooling.
I am wondering is there any way to implement a custom pooling layer in
Keras just like using a custom objective function?
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/fchollet/keras/issues/2816

Thank you for your reply! Would you mind to provide more technical details on the implementation? I am not sure how to change the input in the tensor in the max pooling layer...
Currently, my neural net is set up as follow:
cnn.add(conv.ZeroPadding2D( (1,1), input_shape = (1,28,28), ))
cnn.add(conv.Convolution2D(nb_filters_1, nb_conv, nb_conv, activation = "relu"))
cnn.add(conv.MaxPooling2D(strides=(2,2) ))

cnn.add(conv.ZeroPadding2D((1,1)))
cnn.add(conv.Convolution2D(nb_filters_2, nb_conv, nb_conv, activation = "relu"))
cnn.add(conv.MaxPooling2D(strides=(2,2) ))

cnn.add(core.Flatten())
cnn.add(core.Dropout(0.5))
cnn.add(core.Dense(256, activation = "relu"))
cnn.add(core.Dense(nb_classes, activation = "softmax"))

cnn.summary()
cnn.compile(loss = "categorical_crossentropy", optimizer = 'adadelta', metrics = ['accuracy'])

Thanks!

Use lambda layer to customize your own layer.
def min_max_pool2d(x):
    max_x =  K.pool2d(x, pool_size=(2, 2), strides=(2, 2))
    min_x = -K.pool2d(-x, pool_size=(2, 2), strides=(2, 2))
    return K.concatenate([max_x, min_x], axis=1) # concatenate on channel

def min_max_pool2d_output_shape(input_shape):
    shape = list(input_shape)
    shape[1] *= 2
    return tuple(shape)

# replace maxpooling layer
cnn.add(Lambda(min_max_pool2d, output_shape=min_max_pool2d_output_shape))

Please try it.

Thank you for the suggestion! It works except I have to change the output_shape dimension a little since when I was using a 2-by-2 stride, the output width and height will become half.
Everything else works just perfectly and I changed the min_max_pool2D_output_shape as follow:
def min_max_pool2d_output_shape(input_shape):
    shape = list(input_shape)
    shape[1] *= 2
    shape[2] /= 2
    shape[3] /= 2
    return tuple(shape)

Thank you once again and please correct me if you catch something is wrong!

@matthewmok You are correct, I forget about the stride. LOL

Thank you for your help!

To make this work for both backends with Keras 2, it has to be
from keras import backend as K
from keras.layers.core import Lambda
from keras.layers.merge import Concatenate

def min_max_pool2d(x):
    max_x =  K.pool2d(x, pool_size=(2, 2), strides=(2, 2))
    min_x = -K.pool2d(-x, pool_size=(2, 2), strides=(2, 2))
    if K.image_dim_ordering() == 'th':
        channel = 1
    else:
        channel = -1
    return Concatenate([max_x, min_x], axis=channel)  # concatenate on channel

def min_max_pool2d_output_shape(input_shape):
    shape = list(input_shape)
    if K.image_dim_ordering() == 'th':
        shape[1] *= 2
        shape[2] /= 2
        shape[3] /= 2
    else:
        shape[3] *= 2
        shape[1] /= 2
        shape[2] /= 2
    return tuple(shape)

# replace maxpooling layer
cnn.add(Lambda(min_max_pool2d, output_shape=min_max_pool2d_output_shape))

Sorry to get back to this old thread but I don't understand this line :
min_x = -K.pool2d(-x, pool_size=(2, 2), strides=(2, 2))
Why min_x equals to minus the max_x function?
If someone can explain that'd be great.

I tried to use it instead of max pooling but i have error
TypeError: can't pickle module objects


Fail to randomize

We are seeing a consistent failure to randomize to groups where the raw value of the randomization is 0.
For example setup where the randomization choices are:
0,control
1,experimental
The tool will only randomize records in the experimental group.
Records that meet the criteria to randomize to control would take on randomization action.  We can manually randomize these after the save.

I would recommend not using 0 for code as the quick fix.  I'm sure there is some type coersion going on there.    Will leave this open and if type permits maybe we can find the bug...


See if can upgarde pypy on CI

coverage: 85.765% (+0.5%) from 85.255% when pulling f3f3c7e82a6445ed7fcb0da1ccc513949200a83f on trypypyupgrade into 5187fe68c9dd770e38e7dea8f54ccde2df28a644 on master.


Add Transloadit logo

For convenience, here's how it looks among the others

On a side note, I noticed most companies post their full logo here (so I did as well) but it does result in a wide range of sizes:
$ du -hs * |gsort -h
4.0K	2gis.svg
4.0K	brigade.svg
4.0K	disqus.svg
4.0K	fingerproof.png
4.0K	millenium.svg
8.0K	cerner.png
8.0K	domain.svg
8.0K	paypal.svg
8.0K	schibsted.png
 12K	algolia.svg
 12K	alianza.png
 12K	atlassian.svg
 12K	computerbase.svg
 12K	the-native-web.png
 16K	qualitybath.png
 20K	geekpark.png
 24K	box.png
 24K	kahoot.png
 24K	transloadit.png
 24K	valor-software-sm.png
 28K	paypal.png
 32K	angular-formly.png
 44K	codinum.png
 44K	facebook.png
 48K	getable.png
 64K	simplifield.png
108K	windsorcircle.png
136K	cocktailjs.png

Some logos weighing in at 136KB as you can see.
I thought it would be bad to temper with the status quo it in this particular PR - but would you be interested in a PR that optimizes these images and sets a max dimension of e.g. 800px width? Ideal dimensions up for discussion ofc, I would imagine the companies still want crisp logos on retina for instance.
PPS
(we have started using ESLint in our open source project tus here and will be using it for all our other js projects as well)

@ilyavolodin are max 800 pixel images OK?

Yes, 800px should be more than enough.


helmfile: 0.138.2 -> 0.138.4

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/roboll/helmfile/releases.
meta.description for helmfile is: "Deploy Kubernetes Helm charts"
meta.homepage for helmfile is: "https://github.com/roboll/helmfile"
meta.changelog for helmfile is: ""
Updates performed

Golang update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact

Checks done (click to expand)

built on NixOS

The tests defined in passthru.tests, if any, passed

0 of 0 passed binary check by having a zero exit code.

0 of 0 passed binary check by having the new version present in output.

found 0.138.4 with grep in /nix/store/2pmr8cb41r58hdsl8dsdw61w2dqvlpnn-helmfile-0.138.4

directory tree listing: https://gist.github.com/7e15cc86860a284043f162838d4860b2

du listing: https://gist.github.com/a05978af4266c22580003c405d3b71f7

Rebuild report (if merged into master) (click to expand)

4 total rebuild path(s)

1 package rebuild(s)

1 x86_64-linux rebuild(s)
1 i686-linux rebuild(s)
1 x86_64-darwin rebuild(s)
1 aarch64-linux rebuild(s)

First fifty rebuilds by attrpath
helmfile

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/2pmr8cb41r58hdsl8dsdw61w2dqvlpnn-helmfile-0.138.4 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A helmfile https://github.com/r-ryantm/nixpkgs/archive/96c451192da88d1d819a74c7b5fa3c16f89f8bcc.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/2pmr8cb41r58hdsl8dsdw61w2dqvlpnn-helmfile-0.138.4
ls -la /nix/store/2pmr8cb41r58hdsl8dsdw61w2dqvlpnn-helmfile-0.138.4/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

helmfile

Maintainer pings
cc @pneumaticat @yurrriq @kalbasit for testing.

I can test as soon as tomorrow, but in general these have worked fine.

It seems like there are some important bug fixes in .3 and .4

Seemed to work for me.


NER dataset instructions

NER dataset shapes:

Key information file:    Containing a list of entities, which serves as key information for the training data
Training data: Training data consists of a file (.txt, .tsv) containing columns separated by TAB. One of these columns is a sentence column, while the others represent labels for tokens within that sentence column.

@michaelgsharp for thoughts ?

did  you got any idea?

Is there a related example?


fix(config): Make ONNX Runtime DirectML an optional configuration for  better compatibility

This commit introduces an optional configuration for using ONNX Runtime DirectML.
DirectML can significantly improve performance on newer devices, but it has stricter requirements and may not be suitable for all users.
By making it an optional configuration, we ensure better compatibility for users with older devices or who are running the CLI version, where the GPU's potential may not be fully utilized due to single inference models.
For more information on DirectML requirements, please refer to: https://github.com/microsoft/DirectML
根据讨论 https://github.com/RapidAI/RapidOCR/discussions/175
dml ep 在旧设备上表现不好，而且cli版本无法充分利用gpu 故切换至可选项

Usage example
cpu version
(p311) D:\work\RapidOCR\python>python -m rapidocr_onnxruntime.main -img testimg.png
<frozen runpy>:128: RuntimeWarning: 'rapidocr_onnxruntime.main' found in sys.modules after import of package 'rapidocr_onnxruntime', but prior to execution of 'rapidocr_onnxruntime.main'; this may result in unpredictable behaviour
[[[[25.0, 36.0], [251.0, 36.0], [251.0, 71.0], [25.0, 71.0]], 'Introduction', 0.9092294665483328], [[[86.0, 164.0], [776.0, 166.0], [775.0, 203.0], [85.0, 200.0]], 'OCR known to support rapid
offline deployment.', 0.9705755609147092], [[[65.0, 222.0], [1593.0, 222.0], [1593.0, 258.0], [65.0, 258.0]], ' Supported Languages: The default is Chinese and English, other language recognition requires self-service', 0.9868534831243141], [[[87.0, 272.0], [633.0, 272.0], [633.0, 305.0], [87.0, 305.0]], 'conversion. For specific reference here.', 0.9651962751295509], [[[79.0, 327.0], [1665.0, 327.0], [1665.0, 360.0], [79.0, 360.0]], ' Cause: PaddleOCR is not well engineered, and to make it easier for people to do OCR inference on various ends,', 0.9737989907818181], [[[84.0, 372.0], [1445.0, 375.0], [1445.0, 411.0], [83.0, 408.0]], 'we converted the model in PaddleOCR to ONNX format and ported it to various platforms using', 0.985789726609769], [[[94.0, 426.0], [373.0, 425.0], [373.0, 456.0], [95.0, 457.0]], 'Python/C++/Java/C#', 0.9460111009447199], [[[70.0, 481.0], [1677.0, 482.0], [1677.0, 515.0], [70.0, 514.0]], ' Name Source: Light, fast, economical and smart. OCR technology based on deep learning technology focuses on', 0.9736786440971794], [[[87.0, 530.0], [1596.0, 530.0], [1596.0, 562.0], [87.0, 562.0]], 'artificial intelligence advantages and small models, with speed as the mission and effect as the leading role.', 0.9896172558939135], [[[65.0, 583.0], [186.0, 586.0], [185.0, 621.0], [64.0, 618.0]], 'Usage:', 0.854411244392395], [[[150.0, 735.0], [1027.0, 734.0], [1027.0, 771.0], [150.0, 772.0]], 'this repo is helpful to you, please click on a small star ★ Bah!', 0.9612960668710562]]

dml version
(p311) D:\work\RapidOCR\python>python -m rapidocr_onnxruntime.main --img testimg.png --rec_use_dml --det_use_dml --cls_use_dml
<frozen runpy>:128: RuntimeWarning: 'rapidocr_onnxruntime.main' found in sys.modules after import of package 'rapidocr_onnxruntime', but prior to execution of 'rapidocr_onnxruntime.main'; this may result in unpredictable behaviour
Windows 10 or above detected, try to use DirectML as primary provider
[[[[25.0, 36.0], [251.0, 36.0], [251.0, 71.0], [25.0, 71.0]], 'Introduction', 0.9092294665483328], [[[86.0, 164.0], [776.0, 166.0], [775.0, 203.0], [85.0, 200.0]], 'OCR known to support rapid
offline deployment.', 0.9705755609147092], [[[65.0, 222.0], [1593.0, 222.0], [1593.0, 258.0], [65.0, 258.0]], ' Supported Languages: The default is Chinese and English, other language recognition requires self-service', 0.9868534831243141], [[[87.0, 272.0], [633.0, 272.0], [633.0, 305.0], [87.0, 305.0]], 'conversion. For specific reference here.', 0.9651962751295509], [[[79.0, 327.0], [1665.0, 327.0], [1665.0, 360.0], [79.0, 360.0]], ' Cause: PaddleOCR is not well engineered, and to make it easier for people to do OCR inference on various ends,', 0.9737989907818181], [[[84.0, 372.0], [1445.0, 375.0], [1445.0, 411.0], [83.0, 408.0]], 'we converted the model in PaddleOCR to ONNX format and ported it to various platforms using', 0.985789726609769], [[[94.0, 426.0], [373.0, 425.0], [373.0, 456.0], [95.0, 457.0]], 'Python/C++/Java/C#', 0.9460111009447199], [[[70.0, 481.0], [1677.0, 482.0], [1677.0, 515.0], [70.0, 514.0]], ' Name Source: Light, fast, economical and smart. OCR technology based on deep learning technology focuses on', 0.9736786440971794], [[[87.0, 530.0], [1596.0, 530.0], [1596.0, 562.0], [87.0, 562.0]], 'artificial intelligence advantages and small models, with speed as the mission and effect as the leading role.', 0.9896172558939135], [[[65.0, 583.0], [186.0, 586.0], [185.0, 621.0], [64.0, 618.0]], 'Usage:', 0.854411244392395], [[[150.0, 735.0], [1027.0, 734.0], [1027.0, 771.0], [150.0, 772.0]], 'this repo is helpful to you, please click on a small star ★ Bah!', 0.9612960668710562]]

testimg  example

我看到你们的讨论了，作为一个可选项，在当前来看，的确是较为稳妥的做法。
我低估了在旧设备上的推理速度，想当然认为再慢，也就是onnxruntime本来的速度。看来，我错了。


Missing Recipes and Features

I am using Apotheosis in a custom modpack and when playing my friends and myself can not see some recipes in JEI nor can we create the rarity shards for Affixes. In curse forge it states that you place an affixed item on a soul camp fire (we can't do that), and in the changelog it mentions a new scrapping table (not visible in JEI). I have run Apotheosis in a single player world with no other mods and have run it in single player with just JEI, yet these problems persist.
Also looking at the config files I can't see any settings for the affixes anywhere. Is this normal?
Running Curse Forge 40.1.74
Minecraft 1.18.2
We are playing on a locally hosted server.

sounds like you didn't read the big red notice that says the curseforge page is outdaded.

hello I'm having the same problem as him in version 1.16.5 and I don't see any warning about the curseforge page being out of date I would like help with this if possible

The curseforge page is not valid for old versions.

A página do curseforge não é válida para versões antigas.

and what would be ?

The Chronicle of Shadows, the in-game guidebook.

The Chronicle of Shadows, the in-game guidebook.

ok


Update system message examples

Update system message examples
Remove stat related to number of turns per conversation

@satarupaguha11 - when you're ready for @aahill to review the changes in this PR, please make this 'Ready for review' and tag @aahill '
@aahill - when it's ready, can you review this PR?

IMPORTANT: When this content is ready to merge, you must add #sign-off in a comment or the approval may get overlooked.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@satarupaguha11 - Is this PR still in progress? When you're ready for the changes in this PR to be reviewed, select 'Ready for review' and tag @aahill.

Thank you for contributing to this Azure documentation. Unfortunately, changes to AI Services content can't be accepted this week. The Skilling Content group is migrating this content to a new repository: azure-ai-docs.
In the meantime, we are closing this PR and tagging it so that when the content is available in the new repo, we can follow up with new location information.
#label:"migrate-followup"
#please-close

@satarupaguha11 We’re happy to share that contributions to machine-learning, ai-studio, ai-services, genomics, open-datasets, search are once again possible at azure-ai-docs. We appreciated your patience during this migration.
Find your article in the new repository and make the changes there (or copy/paste the raw markdown from your changed file) and open a new PR.
#remove-label:"migrate-followup"


TO BE DISCUSSED: Removing property chain

Removing property chain transports_or_maintains_localization_of o part_of -> occurs_in
This was not in RO, it's injected via GO (we should check we are not injecting more)
It was causing unusual inferences. We propagate over occurs_in, so annotations to SVT were being grouped under cytoplasm. (found by @lpalbou)
See explanation:

I think we are injecting other property chains. Have a look at the regulates relations. I'm adding this for discussion on an editors' call.

OK good. We should remove this or move them to RO.
This is particular one is an interesting case. At first I thought it was
biologically bogus but not so sure now
On Wed, Oct 31, 2018 at 10:20 AM David Hill<EMAIL_ADDRESS>wrote:

I think we are injecting other property chains. Have a look at the
regulates relations. I'm adding this for discussion on an editors' call.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/geneontology/go-ontology/pull/16546#issuecomment-434770277,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADGOa6tj4YuGXFG2N341R8NDCfa0zfWks5uqduwgaJpZM4YDKRJ
.

You also fixed this in #17195, which I just merged. So I'll close this. I think everyone was in agreement to get rid of it.


Validation prevents multiple relationship actions

Bug description
In order to do a nested upsert/set of N-to-Many entities, one needs to tell prisma to do something like this:
ctx.prisma.entity.update({
  where: { id },
  data: {
    nestedEntities: {
      deleteMany: {
        parentId: id,
      },
      createMany: {
        data: [{...}]
      },
    },
  },
})

(e.g. https://github.com/prisma/prisma/issues/2255#issuecomment-683811551)
The deleteMany removes all the nested entities, and then the createMany creates all of them again. While this doesn't seem to be terribly efficient, I don't know of another way to handle a nested N-to-Many write in which you may be adding and updating existing entities.
...But, this generator prevents one from specifying more than one verb in a given data object by outputting validation like this:
const Schema: z.ZodType<Prisma.NestedEntityUpdateManyWithoutParentEntityNestedInput> =
  z.union([
    z
      .object({
        deleteMany: z
          .union([
            z.lazy(() => NestedEntityScalarWhereInputObjectSchema),
            z.lazy(() => NestedEntityScalarWhereInputObjectSchema).array(),
          ])
          .optional(),
      })
      .strict(),
    z
      .object({
        createMany: z
          .lazy(() => NestedEntityCreateManyParentEntityInputEnvelopeObjectSchema)
          .optional(),
      })
      .strict(),
     ...
])

which is a union of single attribute objects. The resultant validation error is something like this:
Failure to save filter TRPCClientError: [
  {
    "code": "unrecognized_keys",
    "keys": [
      "deleteMany",
      "createMany"
    ],
    "path": [
      "create",
      "filters"
    ],
    "message": "Unrecognized key(s) in object: 'deleteMany', 'createMany'"
  },
...
]

How to reproduce
Attempt to use more than one verb for a nested entity, e.g. deleteMany and createMany.
Expected behavior
Verbs like deleteMany and createMany can be used together.
Prisma information
n/a
Environment & setup

OS: MacOS
Database: PostgreSQL
Node.js version: v16.15.1

Prisma Version
prisma                  : 4.6.1
@prisma/client          : 4.6.1
Current platform        : darwin
Query Engine (Node-API) : libquery-engine 694eea289a8462c80264df36757e4fdc129b1b32 (at<EMAIL_ADDRESS>Migration Engine        : migration-engine-cli 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine    : introspection-core 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary           : prisma-fmt 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/prisma-fmt-darwin)
Format Wasm             : @prisma/prisma-fmt-wasm 4.6.1-3.694eea289a8462c80264df36757e4fdc129b1b32
Default Engines Hash    : 694eea289a8462c80264df36757e4fdc129b1b32
Studio                  : 0.476.0

I am working on this issue. Hopefully, we will have a PR soon

I find out that z.union is responsible for this problem. As we are wrapping the schemas inside z.union, we can not use multiple fields inside it. So in general, this problem will arise not only for deleteMany and createMany but also for any fields if we want to use multiple fields.
@omar-dulaimi, Could you please tell us why we need to wrap the schemas with z.union if the fields contain connectOrCreate: or connect: inside the addFinalWrappers function during generating object schemas? What is the insight of it? If I remove this logic and simply wrap the whole schemas with z.object, then I am not getting any issues.

@Shahidul1004 I remember it was for an old bug, but I guess it was solved with the later changes. I'll give your changes a try and see if it works well.


WIP: EDUCATOR-464: Change CourseSummaries.course_summaries to use POST instead of GET

(Description incoming)
JIRA Ticket: EDUCATOR-464.
TODO:

[x] Write tests
[ ] Get thumbs

@edx/educator-dahlia

Coverage decreased (-0.2%) to 99.832% when pulling 8377037e5e1e44f412bd5e8e56565b40a9ad2101 on edx/kdmccormick/post-course-summaries into e64dc8ca8bc48d41b9c592f750af75d38c172931 on master.

Coverage remained the same at 100.0% when pulling 22471dc5828a9039a9ead20dfac8a0e3b49b06a8 on edx/kdmccormick/post-course-summaries into e64dc8ca8bc48d41b9c592f750af75d38c172931 on master.

Coverage remained the same at 100.0% when pulling 22471dc5828a9039a9ead20dfac8a0e3b49b06a8 on edx/kdmccormick/post-course-summaries into e64dc8ca8bc48d41b9c592f750af75d38c172931 on master.

@dj @efischer19 All set to merge?


Request: Visualization for Gluon neural networks

Here shows how to visualize mx.Symbol networks.
mx.viz.plot_network(net)
The same thing does not work for initialized gluon.Block  networks.

It's a good idea to have visualization tools. Currently, for standard blocks, you can print them directly, though the string representation doesn't reflect the computation graph.

@szha I just find it weird that it exists in symbol and not in gluon.
I understand the underlying differences between the two, but the visualization is nice regardless

We have open-sourced MXBoard which enables users to visualize MXNet data (including network structures) in TensorBoard. The current version on PyPI is 0.1.0rc3. You can either install from source or pip install. The GitHub site has rich examples and tutorials on installation and how to use it in MXNet. Could you try it and give us feedbacks? Thanks.

gluon plot_network will be released in gluoncv 0.5.0. see gluoncv.utils.viz.plot_network

@JustinhoCHN that feature is broken at the moment:
https://github.com/dmlc/gluon-cv/issues/895


typeof SomeClass is "function" in TS/JS but "object" in TSTL

class SomeClass{}
console.log(typeof SomeClass)

produces "object" is TSTL but "function" in TS (playground).
Since Typescript expects "function" for this, this creates problems when trying to narrow down types for functions that can take class constructors (e.g., JSX createElement).

I think this inconsistency is unavoidable given how TS classes are implemented (functions cannot have properties in lua).
For a workaround, here is one way to detect TSTL classes that should work for most cases:
function isClass(obj: unknown) {
    return type(obj) === "table" && rawget(obj as any, "prototype")?.constructor === obj
}

Yes, like the difference between Lua and Javascript notions of truthiness, I'm perfectly happy to declare that actually Javascript is wrong. But it would be nice to be able to tell the TS type checker this, without workarounds that require escaping into Lua (although you can write type-predicated functions like
function isActualFunction(f: unknown): f is ((...args: any[]) => any) {
  return luatype(f) == "function"
}

function callOrConstruct(f: (() => Elem) | typeof Elem): Elem {
  if (isActualFunction(f)) {
    return f()
  } else {
    return new f()
  }
}

which will satisfy the type checker and hide a lot of the ugliness).


Fix dual_normalize testing, closes #19

The function didn't properly test column normalization, or simultaneous dual normalization, and now it does

@kkloste let's split this into multiple functions, even if that will take some more lines of code. One idea of unit tests is that the function name is specific so when it fails, you know exactly what failed.
So we probably want:

test_dual_normalize_column_damping
test_dual_normalize_row_damping
test_dual_normalize_row_and_column_damping

Perhaps we should even move:
        # Test whether the original matrix is unmodified
        if copy or dtype != 'float64':
            assert numpy.array_equal(original, input_matrix)
        else:
            assert input_matrix is matrix

to its own test.

@dhimmel -- I split the tests into to functions: one for simultaneously using both row and column damping, and the other for individual uses of row and column. I tried splitting into three, but there was so much redundant code, it didn't seem worth it.
From my perspective, this pull request is ready to merge.


What milestones should we have for our project?

i think it should be based on our names

for this project.

@s4il3sh naming milestones as per group member? I don't think its a good idea.


Add "resume" and "stop" events to the force-directed layout

The motivation for this patch is to allow for a layout to hide the "whizzing and zooming" part of the process and only render the network once it is stable.
Note that "start" isn't implemented since it is functionally identical to "resume".

Related #459

Given that this is my first pull request ever, do let me know if I screwed things up royally....

Related #461

I understand why the stop event is useful, but what's the use case for the resume event? You're in control of when resume happens, with the exception of the drag behavior which automatically resumes the layout.
Also, I was considering the names "tickstart", "tick" and "tickend" (mostly for parity with the brush component, which uses "brushstart", "brush" and "brushend"). On the other hand, "forcestart", "forcemove" and "forceend" are probably better, if I were to pick names from scratch. The old adage: "There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors."

I added resume for a couple of reasons:

Completeness - the existence of "stop" suggested that "resume" should exist. This isn't necessarily a good reason....
The drag event's automatic restart, as you mentioned.
More generally, it seemed right to be able to put your logic for what happens when motion resumes in one place and not have to write your own wrapper for force.resume() that does all the stuff you want to do when you resume.

I don't have a specific personal requirement for a resume event.  It just seems like it should be present, and doesn't add terribly to the complexity of the code. Equally, it'd be trivial to add it in in the future if needed.
As to names, I'll defer to you as to your preferred house style. (I wrote this before I saw #459 and so didn't see your preferences there.) Personally, I'd go for "start", "move", and "end" since they're events on the force layout and therefore the "force" seems redundant. But, consistency would then suggest renaming the brush events too....
That aside, I can update this with a patch to change the names, and I can include "forcemove" (retaining a deprecated "tick" event for backwards compatibility) and update the various examples to use the new event name if that's what you would like. (Equally, I can do a rename job on the brush events if that takes your fancy.)

I like the names "start", "move", "end". I think we could use those for d3.svg.brush and d3.behavior.drag, too. I was originally thinking of using a prefix for parity with native events such as "mousemove" and "mouseup", but I think you're right; those prefixes only exist because there are many different types of events from the same source (a DOM element), whereas in this case, the source of the event is sufficient to disambiguate the type.

OK. I'll start work on this tonight. Did you want to keep the "resume" event for the force layout too, or shall I remove it?

Thanks for the offer, but I'll probably beat you to it. :) I need to figure out is whether we can make the new "move" name backwards-compatible with the old "tick" name. I'm also going to experiment with updating the other components to be consistent (such as d3.svg.brush and d3.behavior.drag). Might as well change everything simultaneously if possible. Of course, if you want to update things and don't mind potential duplication, have at it!

My assumption was that you could still fire the old events - anyone using the old ones would get the old ones, and anyone who updated to the new event names would get the new ones. There'd be some small overhead of course, but otherwise you'd probably have to keep track of which events had been registered, which doesn't seem to be the pattern currently.
And yes, feel free to do the work :)

Yeah, I'd like to avoid the overhead—the "tick" event is fired ~60 times per second.

https://gist.github.com/1886287 is about as efficient as I could make it, I think.  I punted on renaming "tick" to "move"; we'll just use "tick" for now. But we are using "start" and "end" for the new events. I also changed it so that setting the alpha property will automatically resume or stop the simulation as appropriate. So now resume and stop are simply aliases for setting the alpha to .1 and 0, respectively. Thanks for your help!

Hurrah! Thanks for D3 :)


Show cpu and memory usage in a table

Description
Changes proposed in this pull request:

...
...
...

Related issue(s)

Resolves #1343

/retest

/retest

/retest

/retest

/retest

/retest

/retest

/retest

/retest

/retest

/retest


How to make the Recognizer recognize an OPUS or RAW PCM encoded file

Hello,
Language Used: JAVA  1.8 on Windows
I have RAW PCM as well as OPUS files which i need to pass to the recognizer and get the speech recognition result.
I tried various options in the speech recognizer in java however it is not working.
Can anyone please guide me how to use the SDK to POST OPUS or RAW PCM files to the speech recognition (REST or WEBSOCKET ENDPOINT) and get the output transcript.
Currently i am able to do get output only with WAV files
Code I have tried..
InputStream inputStream = new FileInputStream("F:\Welcome.opus");
    com.microsoft.cognitiveservices.speech.internal.AudioStreamContainerFormat as =com.microsoft.cognitiveservices.speech.internal.AudioStreamContainerFormat.OGG_OPUS;

    PushAudioInputStream pushStream = AudioInputStream.createPushStream(AudioStreamFormat.getCompressedFormat(as));

    AudioConfig audioInput = AudioConfig.fromStreamInput(pushStream);

SpeechRecognizer recognizer = new SpeechRecognizer(config, audioInput);
    {
        // Subscribes to events.
        recognizer.recognizing.addEventListener((s, e) -> {
            System.out.println("RECOGNIZING: Text=" + e.getResult().getText());
        });

Hi, in order to use compressed audio input on Windows, first do the following steps:

Make sure you are using the Speech SDK version 1.11.0 or newer.
If you don't already have GStreamer for Windows installed, download https://gstreamer.freedesktop.org/data/pkg/windows/1.14.4/gstreamer-1.0-x86_64-1.14.4.msi and install. Note the target location!
Add the GStreamer bin directory to your system path. For example, if GStreamer was installed to C:\gstreamer then add C:\gstreamer\1.0\x86_64\bin to PATH (open Control Panel, go to System - Advanced system settings - Environment Variables, and modify PATH).

Example code for using an OPUS input file (with a pull stream):
import com.microsoft.cognitiveservices.speech.*;
import com.microsoft.cognitiveservices.speech.audio.*;
import com.microsoft.cognitiveservices.speech.internal.AudioStreamContainerFormat;
// ...
SpeechConfig config = SpeechConfig.fromSubscription(YourSubscriptionKey, YourServiceRegion);
String filePath = "YourOpusFile.opus";

AudioStreamFormat audioFormat = AudioStreamFormat.getCompressedFormat(AudioStreamContainerFormat.OGG_OPUS);
PullAudioInputStream pullStream = AudioInputStream.createPullStream(new BinaryAudioStreamReader(filePath), audioFormat);

AudioConfig audioInput = AudioConfig.fromStreamInput(pullStream);
SpeechRecognizer recognizer = new SpeechRecognizer(config, audioInput);

For the input stream, you need some implementation of a binary file reader. This example uses
https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/java/android/compressed-input/app/src/main/java/com/microsoft/cognitiveservices/speech/samples/compressedinput/BinaryAudioStreamReader.java
If you want to use it, copy the file to your project and modify the package statement at the top of the file.

Thank now I am able to send the OPUS file with the Above code.
How do i send RAW PCM file.
However i noticed that when i use OPUS the response time is higher than that for WAV. Any scope for performance optimization here. The File size of OPUS is considerably smaller than wav hence i am trying with OPUS.

For a raw PCM input file, please try the following code
String filePath = "YourPcmFile.pcm"; // 16kHz, 16-bit, 1 channel
AudioStreamFormat audioFormat = AudioStreamFormat.getWaveFormatPCM((long)16000, (short)16, (short)1);
PullAudioInputStream pullStream = AudioInputStream.createPullStream(new PcmFileAudioInputStream(filePath), audioFormat);
AudioConfig audioInput = AudioConfig.fromStreamInput(pullStream);

and use/adapt the attached example of PcmFileAudioInputStream class in you project (at minimum, adjust the package statement at the top).
PcmFileAudioInputStream.zip
The response time with compressed audio like OPUS is higher because the audio is uncompressed locally by GStreamer before it is sent to the service, which adds some delay. We will note this for potential future improvements.
If you have use cases where real-time operation is not required, there's also the batch transcription REST API:
https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/batch-transcription

To add, you may simply just rename PcmFileAudioInputStream to BinaryAudioStreamReader and use it instead of the previous BinaryAudioStreamReader implementation, it works either way.

I am Websocket endpoint as i plan to move to containerized version of speech to text. Containzers i believe dont support REST as of now.
Do containers support batch operations ?

For a raw PCM input file, please try the following code
String filePath = "YourPcmFile.pcm"; // 16kHz, 16-bit, 1 channel
AudioStreamFormat audioFormat = AudioStreamFormat.getWaveFormatPCM((long)16000, (short)16, (short)1);
PullAudioInputStream pullStream = AudioInputStream.createPullStream(new PcmFileAudioInputStream(filePath), audioFormat);
AudioConfig audioInput = AudioConfig.fromStreamInput(pullStream);

and use/adapt the attached example of PcmFileAudioInputStream class in you project (at minimum, adjust the package statement at the top).
PcmFileAudioInputStream.zip
The response time with compressed audio like OPUS is higher because the audio is uncompressed locally by GStreamer before it is sent to the service, which adds some delay. We will note this for potential future improvements.
If you have use cases where real-time operation is not required, there's also the batch transcription REST API:
https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/batch-transcription

Instead of gstreamer i beleive the LIBOPUS library could included inside the Java SDK and jni call could be made. May be it will speed up things

@viju2008 what is your scenario with OPUS. In speech SDK we do not send compressed data to the service. We currently decode the OPUS using gstreamer and send the PCM data to the service. Do let us know if you are looking for the same use case.

Closing this issue, since the original questions were answered and there are no further updates. We have a backlog item for creating a how-to on push/pull streams, in order to make it easier to use them in the future.


feat: dashboard: add min postgres version check to enable the ai service

fixes https://github.com/nhost/nhost/issues/2439

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.27%. Comparing base (b14fd2f) to head (f34a0e0).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2576   +/-   ##
=======================================
  Coverage   86.27%   86.27%
=======================================
  Files          86       86
  Lines        9403     9403
  Branches      483      483
=======================================
  Hits         8112     8112
  Misses       1291     1291

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Negative flux_threshold and negative apparant brightness cut (my hack) reveals weird behavior

Ian made an option for inputting a negative flux threshold, which would cut the bright sources instead of the normal option which would cut the faint sources. This has revealed interesting behavior...

The number of sources in each source list does not match the total number of possible source in the known catalog for a cut on flux. (Note, I usually use a cut on apparent brightness, not a cut on Stokes I flux, so the numbers might be different than what you're used to hearing from me). Negative cut, keep all sources below 0.3Jy: 1604 sources. Positive cut, keep all source above 0.3Jy: 5393 sources. Total from the two cuts: 6997. Total number of sources in catalog: 6995. PS for this test is uncomparable due to inclusion of diffuse.

The number of sources in each source list does not match the total number of possible source in the known catalog for a cut on apparant brightness. Negative cut, keep faint sources below brightest 4000: 2997 sources. Positive cut, keep brightest 4000 sources: 4000 sources. Total from the two cuts: 6997. Total number of sources in catalog: 6995. PS for this test is uncomparable due to inclusion of diffuse.

I'm going to work on running a new test without diffuse so PS are comparable. The difference in the source list is weird though.
/nfs/mwa-09/r1/djc/EoR2013/Aug23/fhd_nb_sim_perfect_cal_beamperchannel_novisflagbasic_modelnoflag_eor_weightfix_ones_dimcalsources/
/nfs/mwa-09/r1/djc/EoR2013/Aug23/fhd_nb_sim_perfect_cal_beamperchannel_novisflagbasic_modelnoflag_eor_weightfix_ones_dimfluxthreshold/

Here is a difference test that might help. I'll explain each constituent.

Residual of a 6995 input model, but calibrating and subtracting only the brightest 4000. No diffuse involved. Perfect calibration.

Model of a the remaining sources after 4000 of the brightest were cut. Metadata said this was 2950 sources (which appears to add to the source list problem, since that number should be 2995). No diffuse involved. Perfect calibration. Noteworthy: substantially more flagged tiles (16). Can transfer flags in a future test to avoid this.

The difference is thus case 1 minus case 2. Theoretically, they should be the same. I'm not sure how much contribution the extra flagged tiles would have had. However, I'm still perplexed about the difference in source lists! I did some quick sorting, and couldn't seem to find a matching source in the source lists made in my first comment, which one would expect since there is more than the allotted number of total input sources. I don't think we can really make comparisons in PS until we sort this out.

The source list problem definitely has to be sorted out first, but the blue
in the window is very interesting. Have you looked at the image cubes?
Differencing the cubes might show the source differences.
On Wed, Dec 9, 2015 at 10:43 PM, Nichole Barry<EMAIL_ADDRESS>wrote:

Here is a difference test that might help. I'll explain each constituent.

Residual of a 6995 input model, but calibrating and subtracting only
the brightest 4000. No diffuse involved. Perfect calibration.

Model of a the remaining sources after 4000 of the brightest were cut.
Metadata said this was 2950 sources (which appears to add to the source
list problem, since that number should be 2995). No diffuse involved.
Perfect calibration. Noteworthy: substantially more flagged tiles (16). Can
transfer flags in a future test to avoid this.

The difference is thus case 1 minus case 2. Theoretically, they should be
the same. I'm not sure how much contribution the extra flagged tiles would
have had. However, I'm still perplexed about the difference in source
lists! I did some quick sorting, and couldn't seem to find a matching
source in the source lists made in my first comment, which one would expect
since there is more than the allotted number of total input sources. I
don't think we can really make comparisons in PS until we sort this out.
[image:
fhd_nb_sim_perfect_cal_eor_ones_nod__maxcalsources_res_xx_minus_dimcalsources_model_xx_dencorr_2dkpower]
https://cloud.githubusercontent.com/assets/5588290/11708650/dfa1c3b0-9ec5-11e5-94f0-f79b5911ee41.png
—
Reply to this email directly or view it on GitHub
https://github.com/miguelfmorales/FHD/issues/37#issuecomment-163516403.

Upon further inspection, I think I understand what is going on. I think the refraction correction that was implemented a few weeks ago has changed which sources fall out of the beam. This may have been implemented halfway through the runs of case 1 and case 2 (described above). However, it was implemented through the last two runs that were used for the above difference test, and the total source of 6950 is correct.
So, this means there is a significant difference when there should be none. I'll take a look at image cubes.

Mostly based off of a confusion between a refraction correction being applied to a simulation but not the model.


Discussion on the contribution rates of the NoC version’s contributors

As mentioned in issue #34, here are the contribution rates of the NoC version’s contributors from my point of view:

contributor
contribution rates

@fiatrete
45%

@maxwilliamdev
20%

@troy6en
10%

@DiligentCatCat
10%

@Synthintel0
10%

@suntodai
5%

Thank you for your contributions during the NoC phase. Please note that this is an approximate estimation as the nature and expertise required for tasks vary.
We started with a vague concept, and now the project's objectives are becoming clearer. A special shoutout to @troy6en, @Synthintel0, and @DiligentCatCat, who took on a significant amount of development work in addition to their full-time jobs. @maxwilliamdev has been an active community advocate, making outstanding contributions to the project's promotion in the AI community, and inspiring many creative ideas. And last but not least, @suntodai, a seasoned AI scientist, has provided invaluable advice for the project's evolution.
Please clearly reply to this issue with either 'agree' or 'disagree' to indicate your stance on the proposed contribution rate assessment. And attach your ETH address if you agree.

My eth address: 0x95809E7434e0350BDb59100e2DCBfCf7F885CFEC

Agree. Mine: 0x480A6bB983f9cDEB7fAB1C9EeA3Df3951420926B

I agree.
My eth address: 0xCE7E2d5C7eFC10960304DA879A9e0fB02c8b1713

Agree.
My eth address: 0x51Ce0bcB8C1fd434b52Ecc14f211Ff35a117448C


[Suggestion] Potion Tooltips for Food Effects

Much like the base FD mod does, I think it would be helpful to add tooltips to the different foods that grant additional potion effects when consumed.

Added in newest version
Use newest version mmlib and corn delight.


DBC does not build in product mode

./tools/build.py b -mproduct -asimdbc runtime
runtime/bin/log_android.cc:5:30: fatal error: platform/globals.h: No such file or directory
 #include "platform/globals.h"
                              ^
  CXX(host) out/ProductSIMDBC/obj.host/libdart_builtin/runtime/bin/crypto_linux.o
compilation terminated.
  CXX(host) out/ProductSIMDBC/obj.host/libdart_builtin/runtime/bin/crypto_macos.o
  CXX(host) out/ProductSIMDBC/obj.host/libdart_builtin/runtime/bin/crypto_win.o
  CXX(host) out/ProductSIMDBC/obj.host/libdart_builtin/runtime/bin/builtin_common.o
runtime/bin/log_win.cc:5:30: fatal error: platform/globals.h: No such file or directory
 #include "platform/globals.h"
                              ^
compilation terminated.
runtime/bin/log_linux.cc:5:30: fatal error: platform/globals.h: No such file or directory
 #include "platform/globals.h"
                              ^
compilation terminated.

etc

@zanderso @mraleph