fix(ngAnimate): ensure that all jqLite elements are deconstructed properly

Prior to this fix if a form DOM element was fed into parts of the
ngAnimate queuing code it would attempt to detect if it is a jqLite
object in an unstable way which would allow a form element to return an
inner input element by index. This patch ensures that jqLite instances
are properly detected using a helper method.
Closes #11658

I have two comments—one about the naming of getDomElement and another about a naming convention for jQuery objects vs DOM nodes.
On naming getDomElement
As an example, when you replaced (in animateQueue.js:411) clearElementAnimationState(element) with clearElementAnimationState(getFirstNode(element)), to the reader, it looks like you already had an element and then you got the first node from it.  The reader will typically wonder if element is a jQuery object or some DOM node collection or if getFirstNode returns some kind of child node.  If instead, one writes, clearElementAnimationState(asDomNode(element)) / clearElementAnimationState(toDomNode(element)) / clearElementAnimationState(ensureDomNode(element)) or some such call, then it becomes very clear that while element itself might be a DOM node or a jQuery element, the result of the call is not a jQuery element but an actual plain DOM node.
Naming conventions for jQuery instances vs DOM nodes
There are parts of the code that require DOM nodes, some that require jQuery (or angular.element) instances, and some that can work with either.  To the reader (and all future maintainers), it can become pretty hard to keep track of this given the lack of a type safe language.  Perhaps we should use a naming convention—element always means it's a jQuery instance, node always means it's a DOM node, and perhaps elementOrNode or some such name is used for the few places where it could be either.  That would greatly simplify the cognitive load for the reader, allow one to get rid of gratuitous wrapping/unwrapping calls and help catch bug more easily.  Thoughts?

In areAnimationsAllowed(element, parent, event), I take it that element and parent are always jQuery instances.  What functions/methods require DOM nodes instead of jQuery elements?  If it's the rare function that requires a raw DOM node, maybe just those parameters/variables can use a naming convention to indicate that (e.g. with a prefix like domNode, domParent, etc.)?

:+1: for having some naming conventions to indicate whether the value is expected to be a DOM node, JQLite object or any.
I am not sure that element vs node will cut it though, since there are cases where we need to reference a parent or container.
I some projects I have tried prefixing JQLite variables with jq. E.g.:
DOM elements: element, node, body, parent
JQLite elements: jqElement, jqNode, jqBody, jqParent
(But somehow (and without being sure why) I wasn't too happy about it.)

I thought that the convention in the angular code base was that "wrapped" DOM nodes (i.e. jqLite elements always start with a $? See https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L20

I don't think this is consistently the case in all files (maybe just compaile.js).
In practice, I don't like that convention (although it would be indeed very convenient), because everything $-prefixed is supposed to be Angular stuff (i.e. usually injectable stuff). So having to write function someFunc($element) while $element is not injectable makes me very unhappy.
--
I particularly hate DDOs with link: function ($scope, $element) {...} even if the arguments are not injectable. E.g. compare it to controller: function ($scope, $element) {...} where the arguments are injectable (and order does not make a difference).
But it's a matter of personal preferrence I guess and it is very common (even in Angular core :cry:).

Merged as https://github.com/angular/angular.js/commit/64d05180a667e586328fbdbd328889d3b003571d

We'll have another PR in RC2+ which renames things properly.


How to require rtsp via ffmpeg-python and show it via opencv?

thanks for your working!!!
now,i want to require rtsp via ffmpeg-python and show it via opencv.
here is my code
`
import ffmpeg
import subprocess
import numpy as np
import cv2
def get_video_size(filename):
probe = ffmpeg.probe(filename)
video_info = next(s for s in probe['streams'] if s['codec_type'] == 'video')
width = int(video_info['width'])
height = int(video_info['height'])
return width, height
def start_ffmpeg_process1(video_in):
args = (
ffmpeg
.input(video_in)
.output('pipe:', format='image2pipe', pix_fmt='rgb24',vcodec = 'rawvideo')
.compile()
)
return subprocess.Popen(args,stdout = subprocess.PIPE)
def start_ffmpeg_process2(width,height):
args = (
ffmpeg
.input('pipe:', vsync='0', format='image2pipe', pix_fmt='rgb24', s='{}x{}'.format(width, height))
.output('-',pix_fmt = 'bgr24')
.overwrite_output()
.compile()
)
return subprocess.Popen(args,stdin = subprocess.PIPE)
def read_frame(process1, width, height):
# Note: RGB24 == 3 bytes per pixel.
frame_size = width * height * 3
in_bytes = process1.stdout.read(frame_size)
if len(in_bytes) == 0:
frame = None
else:
assert len(in_bytes) == frame_size
frame = (
np
.frombuffer(in_bytes, np.uint8)
.reshape([height, width, 3])
)
return frame
def show_frame(frame):
#img1 = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
cv2.imshow('img', frame)
cv2.waitKey(0)
cv2.destroyAllWindows()
def run(in_filename):
width, height = get_video_size(in_filename)
process1 = start_ffmpeg_process1(in_filename)
process2 = start_ffmpeg_process2( width, height)
while True:
in_frame = read_frame(process1, width, height)
if in_frame is None:
print('End of input stream')
break
show_frame(in_frame)
process1.wait()
process2.stdin.close()
process2.wait()
if name =='main':
rtsp = "rtsp://xxx.xxx.x.xxx/xxx"
’
but the result is not as my expected. The opencv window only show the first frame.I think the mistake is the prossess that I do not set correctly.And the while cyclic sentence does not work.I do not know how to solve this question.

can you please format your code properly? it's hard to read it otherwise.
In addition to this, consider that your problem just reduces to read a frame from a capture (showing it with OpenCV should be trivial once it is solved).
Did you solve it? I come here looking for related problem. Promise to share the answer if I find it.
Thanks!

ok, I wrote back your code with proper format (check it out please, let me know if there is something wrong)
import ffmpeg
import subprocess
import numpy as np
import cv2

def get_video_size(filename):
    probe = ffmpeg.probe(filename)
    video_info = next(s for s in probe['streams'] if s['codec_type'] == 'video')
    width = int(video_info['width'])
    height = int(video_info['height'])
    return width, height

def start_ffmpeg_process1(video_in):
    args = (
        ffmpeg
        .input(video_in)
        .output('pipe:', format='image2pipe', pix_fmt='rgb24',vcodec = 'rawvideo')
        .compile()
    )

    return subprocess.Popen(args,stdout = subprocess.PIPE)

def start_ffmpeg_process2(width,height):
    args = (
        ffmpeg
        .input('pipe:', vsync='0', format='image2pipe', pix_fmt='rgb24', s='{}x{}'.format(width, height))
        .output('-',pix_fmt = 'bgr24')
        .overwrite_output()
        .compile()
    )

    return subprocess.Popen(args,stdin = subprocess.PIPE)

def read_frame(process1, width, height):
    # Note: RGB24 == 3 bytes per pixel.
    frame_size = width * height * 3
    in_bytes = process1.stdout.read(frame_size)

    if len(in_bytes) == 0:
        frame = None
    else:
        assert len(in_bytes) == frame_size
        frame = (
        np
        .frombuffer(in_bytes, np.uint8)
        .reshape([height, width, 3])
        )
    return frame

def show_frame(frame):
    #img1 = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
    cv2.imshow('img', frame)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

def run(in_filename):
    width, height = get_video_size(in_filename)
    process1 = start_ffmpeg_process1(in_filename)
    process2 = start_ffmpeg_process2( width, height)
    while True:
        in_frame = read_frame(process1, width, height)

        if in_frame is None:
            print('End of input stream')
            break
        show_frame(in_frame)
        process1.wait()
        process2.stdin.close()
        process2.wait()

if __name__ =='__main__':
    rtsp = "rtsp://xxx.xxx.x.xxx/xxx"
    run(rtsp)

The first point I don't understand is why are you using subprocess module, as I see it, this is unnecesary (or solved on the background by ffmpeg wrapper).
disclaimer: I'm newby to this ffmpeg wrapper


Site playbook throws a syntax error on architecture check

When running site playbook on a cluster of pi's it throws a syntax error.
Hardware
7x Pi 4 (8GB RAM)
Software

OS - Buster Lite (32bit)
Ansible  2.9.9
Python  2.7.17

Steps to reproduce

Run ansible-playbook site.yml -i inventory/my-cluster/hosts.ini
Watch the tasks completing until ansible hits TASK [raspbian : Activating cgroup support] and throws a syntax error.

Screenshot

Configurations
// inventory/my-cluster/group_vars/all.yml
---
k3s_version: v1.17.5+k3s1
ansible_user: pi
systemd_dir: /etc/systemd/system
master_ip: "{{ hostvars[groups['master'][0]]['ansible_host'] | default(groups['master'][0]) }}"
extra_server_args: "--docker --no-deploy traefik"

// inventory/my-cluster/hosts.ini
[master]
192.168.1.xx

[node]
192.168.1.xx
192.168.1.xx
192.168.1.xx
192.168.1.xx
192.168.1.xx
192.168.1.xx

[k3s_cluster:children]
master
node

I believe this is a duplicate of https://github.com/rancher/k3s-ansible/issues/40.
https://github.com/rancher/k3s-ansible/pull/42 should fix this, can you try that and report back?

@fnord123 thanks, I've just tested it, that's indeed fixes it


Airdrop not happening this month

Why you guys skipped Oct 15th Airdrop? https://keybase.io/a/i/r/d/r/o/p/spacedrop2019 site now says next Airdrop happening on Nov 15th :(

Really?? WTF KEYBASE?????  Why october airdrop skipped???

If you would read the link you posted, it states why.

So even though that i registered back in september (after the hacking problems) i will not get anything until november (to be exact one month of airdrop instead of 3) ?


Speed up man page generation

Speed up man page generation by a factor of 3 (from 18 to 6 seconds in the single-CPU case)
by not building every man page and html page several times (e.g. 24x)

I think, both the original code and my current patch are not doing everything right.
What we really want is to have hub generate all .ronn files and only when all those are done, then (in 1 ronn call) render those to man pages and html files (with cross-links between each other)

I pushed a new version, that works nicely with any level of parallelism. The code might be a bit less straight-forward, though.
I was wondering, if we could drop the $(HELP_ALL:=.ronn) after man-pages:
so that the intermediate files get deleted by make.

When looking at the bison example I would think that this should do the trick, but it does not.
$(HELP_ALL): bin/ronn $(HELP_ALL:=.ronn)
        bin/ronn --organization=GITHUB --manual="Hub Manual" share/man/man1/*.ro

Filed a GNU make bug with a minimal reproducer based on what hub did.
Also pushed a workaround where man-pages are generated in a non-parallel make run.

Further refined the workaround with the help of my SUSE colleagues. Looks much nicer now. Can you please test/review/merge this?

ping. anything left to do?

@bmwiedemann Thank you for your contribution and assistance!


error  'propTypes' is not defined  when using Esprint

Got error  'propTypes' is not defined no-undef when running esprint but works fine when using eslint.
Is esprint using fixed version of eslint and babel-lint?

Is esprint using fixed version of eslint and babel-lint?
We use the eslint version which is installed as a peer dependency

Please provide a valid repro case if this is still an issue.


Sending and receiveing data containing None

Expected vs. Actual Behavior
I am sending data through our Speckle server as a dict stored as an attribute of a Base object. The dict contains a bunch of key value pairs, and sometimes, a value might be None.
When sending this Base containing None in previous specklepy versions, it would be stored on the server with the value set as the string null, which I interpret to be a json version of the Python None. This is ok, but when receiving the object back, the value of the received object is still the string null and not None. This would cause hickups in my system on the receiving side, since as a safety measure I need to verify that the hash of the data is unchanged before processing the data.
After upgrading to specklepy 2.6.0, sending a Base with a value equal to None triggers an exception. See details on how to reproduce the behaviour below.
Reproduction Steps & System Config
Python 3.9.7 and 3.10.1, specklepy 2.6.0, speckle.xyz 2.3.13
Initialize client and transport:
from specklepy.api.client import SpeckleClient
from specklepy.api.credentials import get_default_account
from specklepy.transports.server import ServerTransport
from specklepy.api import operations
from specklepy.objects.geometry import Base

# Set host and stream id
host = 'https://speckle.xyz'
stream_id = '##########'

# Authenticate client and initialize transport
account = get_default_account()

client = SpeckleClient(host=host)
client.authenticate_with_token(token=account.token)

server_transport = ServerTransport(stream_id=stream_id, client=client)

Create and send object:
# Send object
object_to_send = Base()
data = {'some_data_that_could_be_none': None}
object_to_send.data = data
object_id = operations.send(object_to_send, transports=[server_transport])
client.commit.create(stream_id=stream_id, object_id=object_id)

heya, thanks so much for reporting this!
I'm about to merge a fix for this in #168 and will release 2.6.1 for ya shortly! you should now be able to serialize and deserialize nulls as expected, but let me know if you run into any other issues!
ps client now has an authenticate_with_account method you can use instead if you wish!

Great! Thanks for a speedy solution 😄 and thanks for the tip.


Add oneDNN support for reduce operators

Description
Add oneDNN support for reduction operators: sum and mean, for both nd and np interfaces

@mxnet-bot run ci [unix-cpu, unix-gpu, centos-gpu]

@mxnet-bot run ci [unix-cpu]

@mxnet-bot run ci [website, unix-gpu, unix-cpu, miscellaneous]

@mxnet-bot run ci [website, unix-gpu]

@mxnet-bot run ci [miscellaneous, windows-gpu]

Perf results on CLX8280 (28 cores):

Script:
import mxnet
import mxnet.gluon.nn as nn
import mxnet.numpy as np
import time

dims = [128, 512, 1024, 4096]
print("shape;axis;time;mean")
for ndim in range (2):
   for dim1 in dims:
     for dim2 in dims:
        shape = (dim1, dim2) if ndim == 0 else (32, dim1, dim2)
        a = np.random.uniform(-1.0, 1.0, shape).astype(np.float32)
        for axis in range(2 + ndim):
            tic = time.time()
            for i in range(100):
                out = np.mean(a, axis=axis)
                out.wait_to_read()
            toc = time.time()
            print(f"{shape};{axis};{toc-tic}")

Merging, @szha if there is any procedure of merging own commits let me know


Introduce post_hook for filesystem storage

This pull request adds the possibility to invoke external programs on new / updated local files, e.g. to post-process ics files and remove certain alerts.
Example:
[storage bob_calendar_local]
type = filesystem
path = ~/.calendars/
fileext = .ics
post_hook = /usr/local/bin/remove_alerts.sh

@michaeladler BTW, did you find a way to achieve your goal without this functionality?
I want to implement concurrent item changes in vdirsyncer at some point (writing to multiple files at the same time, within the same collection), so I'm not sure if this makes sense then.

@untitaker: No, I sticked to the current solution as it perfectly fits my use case. Building something that manually scans the folder and looks for changes is kinda like rebuilding the logic in vdirsyncer. One downside I see with my solution is the initial sync process as it launches an external program for every new ics file that comes in. After that, it's usually just a couple of ics files per day so I don't mind. Currently I have a cron job running vdirsyncer every 30 minutes.

What about diffing the file listing after synchronization?

@michaeladler I've been thinking about this quite a lot, and I think that a general purpose solution would be independent of the storage, i.e. work for singlefile storage too. Are you interested in writing this?

@untitaker: Maybe. What kind of solution do you have in mind?

I thought about adding this parameter to the Storage baseclass, making it available in all storages. Inside the init method we would then have to wrap the relevant methods.

Let's talk about it from a high-level perspective. What should the behavior be? Launch the external program whenever we write something to disk (e.g. multiple .ics-Files or one single, large ics-File) and provide the file path as argument? I also thought about piping all the file names that have changed to the external program - this way only one process would have to be started (of course, this process might be xargs ;) )

Sorry for the late reply, was on mobile earlier.
Yeah, I didn't think too clearly about what we'd actually pass the commands. My initial intuition when writing that comment was that we'd simply invoke the command with the  href (internal identifier) of the updated item:

for filesystem, this would be the file's basename
for CardDAV/CalDAV, this would be the path relative to the collection URL
for singlefile and the other storages, this is basically something completely useless for the user. It's sometimes the UID of the item, sometimes a hash.

Whether we call a single command with all the files, or with only one at a time, I don't care.
Another idea would be not to call any commands, and just output machine-readable lines to stdout, which can be enabled via a special flag. It's up to the user to parse and handle these messages then.

I know I'm really indecisive on this topic, but I fear of extending the user interface of vdirsyncer so much it would be a pain to maintain. The idea that the exposed interface would at least be generally usable would somewhat comfort me, however.

@michaeladler In the end I decided to merge your PR. I suppose I have been overly eager with making everything "generally usable".


Response wont get cached if request header has no-cache

Brief overview
EasyHttp wont cache a response if the request header contains Cache-Control: no-cache directive inside it. According to RFC, a no-cache request directive means that any available cache response should not be used satisfy the request. Caching the response is allowed however.
Expected behavior
Response is cached.
Actual behavior
Response is not cached.
Steps to reproduce

Create a request with Cache-Control: no-cache header.
Execute it
Response is not cached.

Fixed with https://github.com/sony/easyhttpcpp/releases/tag/2.0.0


Disable  DATABASECHANGELOG table creation when running offline

https://liquibase.jira.com/browse/CORE-2334

Thanks! I think I'm going to change the flag passed around a bit, though. I'm thinking either making outputLiquibaseSql take values of "true", "false", or "data_only" or making an outputLiquibaseUpdateSql and an outputLiquibaseCreateSql with the old outputLiquibaseSql flag just set both of those to true. Leaning toward the different options for outputLiquibaseSql, though. I'm trying to wrap up a 3.3.4 release and then I'll look at it more closely.

I can change this PR if you wish, tell me what solution you prefer.

Yes, those look like good changes. Thanks!


upload ng-idle with browserify fix to npm

Hi,
Would it be possible to upload to npm ng-idle with the browserify fix?
The fix is at https://github.com/HackedByChinese/ng-idle/pull/92
I have otherwise problems to distribute the program i wrote.
Thanks,
David

Yes. Thanks.


Incorporate ejmr's Code Review

Read this: https://gist.github.com/ejmr/3cc404387af3bff2c7db
Modify code based on review.
Here is my attempt to cross things off from aforementioned review: https://gist.github.com/lillian-lemmer/89ea5ac33716725d9661

I've made a few commits that finalize the implmeentation of the notes in develop. I'll trace back to particulars, e.g., the velocity stuff in a later update.


Chore: add unit test for export func

Changes

add unit test for export functions. ref: #6364
/kind cleanup
Submitter Checklist
As the author of this PR, please check off the items in this checklist:

[ ] Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
[x] Has Tests included if any functionality added or changed
[x] Follows the commit message standard
[ ] Meets the Tekton contributor standards (including functionality, content, code)
[x] Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
[ ] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
[ ] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes
NONE

/kind cleanup

/ok-to-test

/retest

/retest

Hi,@jerop , thanks for your review! please see last commit, thanks!

/cc @dibyom @Yongxuanzhang @jerop thanks!

/cc @dibyom @Yongxuanzhang @jerop thanks!

Thanks! There's one commit in your PR(feat: support to extract failed task results) seems not belongs to your PR, is it possible to remove it?

@Yongxuanzhang yes,fixed!

/test pull-tekton-pipeline-unit-tests

/test pull-tekton-pipeline-unit-tests

@yyzxw Thanks for your work on this PR. Are you still interested in bringing this to completion?
It looks like most review comments have been addressed, so once the PR is rebased it should be possible to merge it soon.


RTEMIS-1941 Preserve AMQP body section type on "large" messages

When "large" messages are converted to / from core in order to be stored
in the large message store the type of the AMQP body section is being
lost and reconstituted incorrectly in some cases.  The message needs to
be annotated with the original AMQP type for the body and that used to
manage the conversion back to AMQP from Core.

Checkstyle violations in JMSMappingOutboundTransformerTest.

I went ahead and fixed the checkstyle issues and pushed.

I forgot the merge commit so you will have to close this PR manually.

I took for granted that the checkstyle issues were the only problems. However, there were 4 tests failing.  I've sent #2174 to deal with them, but I'm not 100% certain they are correct.  Could you review, @tabish121?

What I had planned for large messages in amqp was to not convert them at all. What would make this moot.


Fix/disable taskbar

notfoundpage render lines decreased

:tada: This PR is included in version 3.13.6 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Default bar status_command

So the default status_command doesn't exit when sway exits. I think this is due to the sigterm not being sent to the child process correctly. There are ways to get bash (maybe other shells) to catch the trap and terminate but it is kinda ugly. Could we add the trap code or come up with a sane alternative for a default status_command?

The commit https://github.com/SirCmpwn/sway/commit/529ee83ef63d69f3cc045f2e9cc52c7ec2fe1334 doesn't fix this case (well for me at least)


When I want to visualize the efficientNet, a runtime error occurs.

import json
from PIL import Image
import torch
from torchvision import transforms
from  torchviz import make_dot
import hiddenlayer as hl
from efficientnet_pytorch import EfficientNet
model = EfficientNet.from_pretrained('efficientnet-b3')
model.eval()
hl.build_graph(model, torch.zeros([1, 3, 224, 224]))
hl_graph
Traceback (most recent call last):
File "example.py", line 30, in
hl.build_graph(model, torch.zeros([1, 3, 224, 224]))
File "/home/tianhui/hiddenlayer/hiddenlayer/graph.py", line 143, in build_graph
import_graph(g, model, args)
File "/home/tianhui/hiddenlayer/hiddenlayer/pytorch_builder.py", line 71, in import_graph
torch.onnx._optimize_trace(trace, torch.onnx.OperatorExportTypes.ONNX)
File "/home/lanqiang/anaconda3/lib/python3.6/site-packages/torch/onnx/init.py", line 40, in _optimize_trace
trace.set_graph(utils._optimize_graph(trace.graph(), operator_export_type))
File "/home/lanqiang/anaconda3/lib/python3.6/site-packages/torch/onnx/utils.py", line 188, in _optimize_graph
graph = torch._C._jit_pass_onnx(graph, operator_export_type)
File "/home/lanqiang/anaconda3/lib/python3.6/site-packages/torch/onnx/init.py", line 50, in _run_symbolic_function
return utils._run_symbolic_function(*args, **kwargs)
File "/home/lanqiang/anaconda3/lib/python3.6/site-packages/torch/onnx/utils.py", line 589, in _run_symbolic_function
return fn(g, *inputs, **attrs)
File "/home/lanqiang/anaconda3/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 130, in wrapper
args = [_parse_arg(arg, arg_desc) for arg, arg_desc in zip(args, arg_descriptors)]
File "/home/lanqiang/anaconda3/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 130, in
args = [_parse_arg(arg, arg_desc) for arg, arg_desc in zip(args, arg_descriptors)]
File "/home/lanqiang/anaconda3/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 90, in _parse_arg
raise RuntimeError("Failed to export an ONNX attribute, "
RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things (e.g., kernel size) static if possible

I am

`import torch
from torch import nn
from torch.nn import functional as F
from .utils import (
relu_fn,
round_filters,
round_repeats,
drop_connect,
Conv2dSamePadding,
get_model_params,
efficientnet_params,
load_pretrained_weights,
)
class MBConvBlock(nn.Module):
"""
Mobile Inverted Residual Bottleneck Block
Args:
    block_args (namedtuple): BlockArgs, see above
    global_params (namedtuple): GlobalParam, see above

Attributes:
    has_se (bool): Whether the block contains a Squeeze and Excitation layer.
"""

def __init__(self, block_args, global_params):
    super().__init__()
    self._block_args = block_args
    self._bn_mom = 1 - global_params.batch_norm_momentum
    self._bn_eps = global_params.batch_norm_epsilon
    self.has_se = (self._block_args.se_ratio is not None) and (0 < self._block_args.se_ratio <= 1)
    self.id_skip = block_args.id_skip  # skip connection and drop connect

    # Expansion phase
    inp = self._block_args.input_filters  # number of input channels
    oup = self._block_args.input_filters * self._block_args.expand_ratio  # number of output channels
    if self._block_args.expand_ratio != 1:
        self._expand_conv = Conv2dSamePadding(in_channels=inp, out_channels=oup, kernel_size=1, bias=False)
        self._bn0 = nn.BatchNorm2d(num_features=oup, momentum=self._bn_mom, eps=self._bn_eps)

    # Depthwise convolution phase
    k = self._block_args.kernel_size
    s = self._block_args.stride
    self._depthwise_conv = Conv2dSamePadding(
        in_channels=oup, out_channels=oup, groups=oup,  # groups makes it depthwise
        kernel_size=k, stride=s, bias=False)
    self._bn1 = nn.BatchNorm2d(num_features=oup, momentum=self._bn_mom, eps=self._bn_eps)

    # Squeeze and Excitation layer, if desired
    if self.has_se:
        num_squeezed_channels = max(1, int(self._block_args.input_filters * self._block_args.se_ratio))
        self._se_reduce = Conv2dSamePadding(in_channels=oup, out_channels=num_squeezed_channels, kernel_size=1)
        self._se_expand = Conv2dSamePadding(in_channels=num_squeezed_channels, out_channels=oup, kernel_size=1)

    # Output phase
    final_oup = self._block_args.output_filters
    self._project_conv = Conv2dSamePadding(in_channels=oup, out_channels=final_oup, kernel_size=1, bias=False)
    self._bn2 = nn.BatchNorm2d(num_features=final_oup, momentum=self._bn_mom, eps=self._bn_eps)

def forward(self, inputs, drop_connect_rate=None):
    """
    :param inputs: input tensor
    :param drop_connect_rate: drop connect rate (float, between 0 and 1)
    :return: output of block
    """

    # Expansion and Depthwise Convolution
    x = inputs
    if self._block_args.expand_ratio != 1:
        x = relu_fn(self._bn0(self._expand_conv(inputs)))
    x = relu_fn(self._bn1(self._depthwise_conv(x)))

    # Squeeze and Excitation
    if self.has_se:
        x_squeezed = F.adaptive_avg_pool2d(x, 1)
        x_squeezed = self._se_expand(relu_fn(self._se_reduce(x_squeezed)))
        x = torch.sigmoid(x_squeezed) * x

    x = self._bn2(self._project_conv(x))

    # Skip connection and drop connect
    input_filters, output_filters = self._block_args.input_filters, self._block_args.output_filters
    if self.id_skip and self._block_args.stride == 1 and input_filters == output_filters:
        if drop_connect_rate:
            x = drop_connect(x, p=drop_connect_rate, training=self.training)
        x = x + inputs  # skip connection
    return x

class EfficientNet(nn.Module):
"""
An EfficientNet model. Most easily loaded with the .from_name or .from_pretrained methods
Args:
    blocks_args (list): A list of BlockArgs to construct blocks
    global_params (namedtuple): A set of GlobalParams shared between blocks

Example:
    model = EfficientNet.from_pretrained('efficientnet-b0')

"""

def __init__(self, blocks_args=None, global_params=None):
    super().__init__()
    assert isinstance(blocks_args, list), 'blocks_args should be a list'
    assert len(blocks_args) > 0, 'block args must be greater than 0'
    self._global_params = global_params
    self._blocks_args = blocks_args

    # Batch norm parameters
    bn_mom = 1 - self._global_params.batch_norm_momentum
    bn_eps = self._global_params.batch_norm_epsilon

    # Stem
    in_channels = 3  # rgb
    out_channels = round_filters(32, self._global_params)  # number of output channels
    self._conv_stem = Conv2dSamePadding(in_channels, out_channels, kernel_size=3, stride=2, bias=False)
    self._bn0 = nn.BatchNorm2d(num_features=out_channels, momentum=bn_mom, eps=bn_eps)

    # Build blocks
    self._blocks = nn.ModuleList([])
    for block_args in self._blocks_args:

        # Update block input and output filters based on depth multiplier.
        block_args = block_args._replace(
            input_filters=round_filters(block_args.input_filters, self._global_params),
            output_filters=round_filters(block_args.output_filters, self._global_params),
            num_repeat=round_repeats(block_args.num_repeat, self._global_params)
        )

        # The first block needs to take care of stride and filter size increase.
        self._blocks.append(MBConvBlock(block_args, self._global_params))
        if block_args.num_repeat > 1:
            block_args = block_args._replace(input_filters=block_args.output_filters, stride=1)
        for _ in range(block_args.num_repeat - 1):
            self._blocks.append(MBConvBlock(block_args, self._global_params))

    # Head
    in_channels = block_args.output_filters  # output of final block
    out_channels = round_filters(1280, self._global_params)
    self._conv_head = Conv2dSamePadding(in_channels, out_channels, kernel_size=1, bias=False)
    self._bn1 = nn.BatchNorm2d(num_features=out_channels, momentum=bn_mom, eps=bn_eps)

    # Final linear layer
    self._dropout = self._global_params.dropout_rate
    self._fc = nn.Linear(out_channels, self._global_params.num_classes)

def extract_features(self, inputs):
    """ Returns output of the final convolution layer """

    # Stem
    x = relu_fn(self._bn0(self._conv_stem(inputs)))

    # Blocks
    for idx, block in enumerate(self._blocks):
        drop_connect_rate = self._global_params.drop_connect_rate
        if drop_connect_rate:
            drop_connect_rate *= float(idx) / len(self._blocks)
        x = block(x) # , drop_connect_rate) # see https://github.com/tensorflow/tpu/issues/381

    return x

def forward(self, inputs):
    """ Calls extract_features to extract features, applies final linear layer, and returns logits. """

    # Convolution layers
    x = self.extract_features(inputs)

    # Head
    x = relu_fn(self._bn1(self._conv_head(x)))
    x = F.adaptive_avg_pool2d(x, 1).squeeze(-1).squeeze(-1)
    if self._dropout:
        x = F.dropout(x, p=self._dropout, training=self.training)
    x = self._fc(x)
    return x

@classmethod
def from_name(cls, model_name, override_params=None):
    cls._check_model_name_is_valid(model_name)
    blocks_args, global_params = get_model_params('efficientnet-b0', override_params=None)
    return EfficientNet(blocks_args, global_params)

@classmethod
def from_pretrained(cls, model_name):
    model = EfficientNet.from_name('efficientnet-b0')
    load_pretrained_weights(model, model_name)
    return model

@classmethod
def get_image_size(cls, model_name):
    cls._check_model_name_is_valid(model_name)
    _, _, res, _ = efficientnet_params(model_name)
    return res

@classmethod
def _check_model_name_is_valid(cls, model_name, also_need_pretrained_weights=False):
    """ Validates model name. None that pretrained weights are only available for
    the first four models (efficientnet-b{i} for i in 0,1,2,3) at the moment. """
    num_models = 4 if also_need_pretrained_weights else 8
    valid_models = ['efficientnet_b'+str(i) for i in range(num_models)]
    if model_name.replace('-','_') not in valid_models:
        raise ValueError('model_name should be one of: ' + ', '.join(valid_models))

`

def import_graph(hl_graph, model, args, input_names=None, verbose=False):
    # TODO: add input names to graph
    # Run the Pytorch graph to get a trace and generate a graph from it
    trace, out = torch.jit.get_trace_graph(model, args)
    torch.onnx._optimize_trace(trace, torch.onnx.OperatorExportTypes.ONNX)
    torch_graph = trace.graph()

  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/hiddenlayer/pytorch_builder.py", line 71, in import_graph
    torch.onnx._optimize_trace(trace, torch.onnx.OperatorExportTypes.ONNX)

Traceback (most recent call last):
  File "/home/boyun/PycharmProjects/EfficientNet-1852/train_new_io.py", line 179, in <module>
    main()
  File "/home/boyun/PycharmProjects/EfficientNet-1852/train_new_io.py", line 153, in main
    hl_graph = hl.build_graph(model, input)
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/hiddenlayer/graph.py", line 143, in build_graph
    import_graph(g, model, args)
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/hiddenlayer/pytorch_builder.py", line 71, in import_graph
    torch.onnx._optimize_trace(trace, torch.onnx.OperatorExportTypes.ONNX)
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/torch/onnx/__init__.py", line 40, in _optimize_trace
    trace.set_graph(utils._optimize_graph(trace.graph(), operator_export_type))
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/torch/onnx/utils.py", line 188, in _optimize_graph
    graph = torch._C._jit_pass_onnx(graph, operator_export_type)
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/torch/onnx/__init__.py", line 50, in _run_symbolic_function
    return utils._run_symbolic_function(*args, **kwargs)
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/torch/onnx/utils.py", line 589, in _run_symbolic_function
    return fn(g, *inputs, **attrs)
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 130, in wrapper
    args = [_parse_arg(arg, arg_desc) for arg, arg_desc in zip(args, arg_descriptors)]
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 130, in <listcomp>
    args = [_parse_arg(arg, arg_desc) for arg, arg_desc in zip(args, arg_descriptors)]
  File "/home/boyun/anaconda3/envs/pytorch1_1_0/lib/python3.6/site-packages/torch/onnx/symbolic.py", line 90, in _parse_arg
    raise RuntimeError("Failed to export an ONNX attribute, "
RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things (e.g., kernel size) static if possible

import torch
from torch import nn
from torch.nn import functional as F

from .utils import (
    relu_fn,
    round_filters,
    round_repeats,
    drop_connect,
    Conv2dSamePadding,
    get_model_params,
    efficientnet_params,
    load_pretrained_weights,
)

class MBConvBlock(nn.Module):
    """
    Mobile Inverted Residual Bottleneck Block

    Args:
        block_args (namedtuple): BlockArgs, see above
        global_params (namedtuple): GlobalParam, see above

    Attributes:
        has_se (bool): Whether the block contains a Squeeze and Excitation layer.
    """

    def __init__(self, block_args, global_params):
        super().__init__()
        self._block_args = block_args
        self._bn_mom = 1 - global_params.batch_norm_momentum
        self._bn_eps = global_params.batch_norm_epsilon
        self.has_se = (self._block_args.se_ratio is not None) and (0 < self._block_args.se_ratio <= 1)
        self.id_skip = block_args.id_skip  # skip connection and drop connect

        # Expansion phase
        inp = self._block_args.input_filters  # number of input channels
        oup = self._block_args.input_filters * self._block_args.expand_ratio  # number of output channels
        if self._block_args.expand_ratio != 1:
            self._expand_conv = Conv2dSamePadding(in_channels=inp, out_channels=oup, kernel_size=1, bias=False)
            self._bn0 = nn.BatchNorm2d(num_features=oup, momentum=self._bn_mom, eps=self._bn_eps)

        # Depthwise convolution phase
        k = self._block_args.kernel_size
        s = self._block_args.stride
        self._depthwise_conv = Conv2dSamePadding(
            in_channels=oup, out_channels=oup, groups=oup,  # groups makes it depthwise
            kernel_size=k, stride=s, bias=False)
        self._bn1 = nn.BatchNorm2d(num_features=oup, momentum=self._bn_mom, eps=self._bn_eps)

        # Squeeze and Excitation layer, if desired
        if self.has_se:
            num_squeezed_channels = max(1, int(self._block_args.input_filters * self._block_args.se_ratio))
            self._se_reduce = Conv2dSamePadding(in_channels=oup, out_channels=num_squeezed_channels, kernel_size=1)
            self._se_expand = Conv2dSamePadding(in_channels=num_squeezed_channels, out_channels=oup, kernel_size=1)

        # Output phase
        final_oup = self._block_args.output_filters
        self._project_conv = Conv2dSamePadding(in_channels=oup, out_channels=final_oup, kernel_size=1, bias=False)
        self._bn2 = nn.BatchNorm2d(num_features=final_oup, momentum=self._bn_mom, eps=self._bn_eps)

    def forward(self, inputs, drop_connect_rate=None):
        """
        :param inputs: input tensor
        :param drop_connect_rate: drop connect rate (float, between 0 and 1)
        :return: output of block
        """

        # Expansion and Depthwise Convolution
        x = inputs
        if self._block_args.expand_ratio != 1:
            x = relu_fn(self._bn0(self._expand_conv(inputs)))
        x = relu_fn(self._bn1(self._depthwise_conv(x)))

        # Squeeze and Excitation
        if self.has_se:
            x_squeezed = F.adaptive_avg_pool2d(x, 1)
            x_squeezed = self._se_expand(relu_fn(self._se_reduce(x_squeezed)))
            x = torch.sigmoid(x_squeezed) * x

        x = self._bn2(self._project_conv(x))

        # Skip connection and drop connect
        input_filters, output_filters = self._block_args.input_filters, self._block_args.output_filters
        if self.id_skip and self._block_args.stride == 1 and input_filters == output_filters:
            if drop_connect_rate:
                x = drop_connect(x, p=drop_connect_rate, training=self.training)
            x = x + inputs  # skip connection
        return x

class EfficientNet(nn.Module):
    """
    An EfficientNet model. Most easily loaded with the .from_name or .from_pretrained methods

    Args:
        blocks_args (list): A list of BlockArgs to construct blocks
        global_params (namedtuple): A set of GlobalParams shared between blocks

    Example:
        model = EfficientNet.from_pretrained('efficientnet-b0')

    """

    def __init__(self, blocks_args=None, global_params=None):
        super().__init__()
        assert isinstance(blocks_args, list), 'blocks_args should be a list'
        assert len(blocks_args) > 0, 'block args must be greater than 0'
        self._global_params = global_params
        self._blocks_args = blocks_args

        # Batch norm parameters
        bn_mom = 1 - self._global_params.batch_norm_momentum
        bn_eps = self._global_params.batch_norm_epsilon

        # Stem
        in_channels = 3  # rgb
        out_channels = round_filters(32, self._global_params)  # number of output channels
        self._conv_stem = Conv2dSamePadding(in_channels, out_channels, kernel_size=3, stride=2, bias=False)
        self._bn0 = nn.BatchNorm2d(num_features=out_channels, momentum=bn_mom, eps=bn_eps)

        # Build blocks
        self._blocks = nn.ModuleList([])
        for block_args in self._blocks_args:

            # Update block input and output filters based on depth multiplier.
            block_args = block_args._replace(
                input_filters=round_filters(block_args.input_filters, self._global_params),
                output_filters=round_filters(block_args.output_filters, self._global_params),
                num_repeat=round_repeats(block_args.num_repeat, self._global_params)
            )

            # The first block needs to take care of stride and filter size increase.
            self._blocks.append(MBConvBlock(block_args, self._global_params))
            if block_args.num_repeat > 1:
                block_args = block_args._replace(input_filters=block_args.output_filters, stride=1)
            for _ in range(block_args.num_repeat - 1):
                self._blocks.append(MBConvBlock(block_args, self._global_params))

        # Head
        in_channels = block_args.output_filters  # output of final block
        out_channels = round_filters(1280, self._global_params)
        self._conv_head = Conv2dSamePadding(in_channels, out_channels, kernel_size=1, bias=False)
        self._bn1 = nn.BatchNorm2d(num_features=out_channels, momentum=bn_mom, eps=bn_eps)

        # Final linear layer
        self._dropout = self._global_params.dropout_rate
        self._fc = nn.Linear(out_channels, self._global_params.num_classes)

    def extract_features(self, inputs):
        """ Returns output of the final convolution layer """

        # Stem
        x = relu_fn(self._bn0(self._conv_stem(inputs)))

        # Blocks
        for idx, block in enumerate(self._blocks):
            drop_connect_rate = self._global_params.drop_connect_rate
            if drop_connect_rate:
                drop_connect_rate *= float(idx) / len(self._blocks)
            x = block(x) # , drop_connect_rate) # see https://github.com/tensorflow/tpu/issues/381

        return x

    def forward(self, inputs):
        """ Calls extract_features to extract features, applies final linear layer, and returns logits. """

        # Convolution layers
        x = self.extract_features(inputs)

        # Head
        x = relu_fn(self._bn1(self._conv_head(x)))
        x = F.adaptive_avg_pool2d(x, 1).squeeze(-1).squeeze(-1)
        if self._dropout:
            x = F.dropout(x, p=self._dropout, training=self.training)
        x = self._fc(x)
        return x

    @classmethod
    def from_name(cls, model_name, override_params=None):
        cls._check_model_name_is_valid(model_name)
        blocks_args, global_params = get_model_params('efficientnet-b0', override_params=None)
        return EfficientNet(blocks_args, global_params)

    @classmethod
    def from_pretrained(cls, model_name):
        model = EfficientNet.from_name('efficientnet-b0')
        load_pretrained_weights(model, model_name)
        return model

    @classmethod
    def get_image_size(cls, model_name):
        cls._check_model_name_is_valid(model_name)
        _, _, res, _ = efficientnet_params(model_name)
        return res

    @classmethod
    def _check_model_name_is_valid(cls, model_name, also_need_pretrained_weights=False):
        """ Validates model name. None that pretrained weights are only available for
        the first four models (efficientnet-b{i} for i in 0,1,2,3) at the moment. """
        num_models = 4 if also_need_pretrained_weights else 8
        valid_models = ['efficientnet_b'+str(i) for i in range(num_models)]
        if model_name.replace('-','_') not in valid_models:
            raise ValueError('model_name should be one of: ' + ', '.join(valid_models))


Fixnum is deprecated

/home/efranco/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/forgery-0.6.0/lib/forgery/forgery/lorem_ipsum.rb:51: warning: constant ::Fixnum is deprecated

Duplicate of #79

Fixed by #84.


Color' is from 'dart:ui

../../../.pub-cache/hosted/pub.dev/data_table_2-2.5.18/lib/src/data_table_2.dart:596:44: Error: The method 'withValues' isn't defined for the class 'Color'.

'Color' is from 'dart:ui'.
Try correcting the name to the name of an existing method, or defining a method named 'withValues'.
return theme.colorScheme.primary.withValues(alpha: 0.08);

Run flutter upgrade or revert to data_table_2 2.5.16

i'm already try it and my flutter version is 3.24.3
On Wed, Dec 18, 2024 at 4:36 PM Maxim Saplin @.***>
wrote:

Run flutter upgrade or revert to data_table_2 2.5.16
—
Reply to this email directly, view it on GitHub
https://github.com/maxim-saplin/data_table_2/issues/329#issuecomment-2551029451,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BCBNJAREF7D7GGQQCEXE2SL2GFJKBAVCNFSM6AAAAABT2NRAE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJRGAZDSNBVGE
.
You are receiving this because you authored the thread.Message ID:
@.***>

i'm already try it and my flutter version is 3.24.3

The most recent stable version is 3.27.0


Scrcpy starts and then stops, no error is being thrown

[x] I have read the FAQ.
[x] I have searched in existing issues.

Environment

OS: Windows
scrcpy version: 1.23
installation method: extracted from the package
device model: Google Pixel 2
Android version: 11

Describe the bug
The scrcpy executable runs and stops without any indication of the problem.
I attached the logcat.log file as well to help you with finding a root cause.
.\scrcpy.exe
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
C:\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 27.6 MB/s (41123 bytes in 0.001s)
[server] INFO: Device: Google Pixel 2 (Android 11)

logcat.log

Hi,
I ran the command a second time and redirected the logcat output to the file.
Let me know if it is useful for you.
Thanks,
Martin
logcat.log

Try with another encoder: https://github.com/Genymobile/scrcpy#encoder


Update DB utility version

@fermujica, we are closing this contribution because it has exceeded the age limit for a timely merge.
If the contribution is still valid, please, open a separate GitHub issue or pull request.


Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.

Inbound call ringer is not audible due to chrome's new autoplay policies. The policy requires a "user gesture" before allowing media to pass. I cannot figure out how to satisfy that requirement for inbound calls to function correctly.
Has anyone come up with a solution for this?

What version of Chrome was this introduced?

I feel like this has been here for a while (April 2018?).  This is only on the first call, correct?  After that, the agent has probably interacted with the softphone at some point (ie, to accept or end the call) so the ringer should play on subsequent calls.
We use logic, for other reasons, to prevent users from being set to available when they first log in.  The effect of this is to require them to interact with the softphone to set their status, so when the first call comes in Chrome is ready to allow it to play.
I don't think there's any way around this except to "trick" the user into interacting before they first get a call, and I think the only way to do that is to set them away from available when they first start.

I guess this behavior changed in April 2018. I was a little bit confused by the error message while I was trying to fix another bug in my code.
The following link show delegation for autoplay to an iframe: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe
There could be made additional fixes to the play() method to check that it has permission - like suggested in the link before:
`var promise = this._audio.play();
if (promise !== undefined) {
promise.then(_ => {
// Autoplay started!
}).catch(error => {
// Autoplay was prevented.
// Show a "Play" button so that user can start playback.
});`
The pull request should improve the rights delegation, so when the page already has permission it will be passed to the iframe.


Specific composition of features

The length of the feature for each time instant is 2048; I want to know which part of the feature comes from the RGB stream, the first half or the second half?

First RGB then FLOW.


How to get pull request related work items ?

Discussed in https://github.com/rfennell/AzurePipelines/discussions/1368

Originally posted by metinbulak October 26, 2022
I am using Generate Release Notes (Crossplatform) extension on azure devops.
I can not get related items on pullrequest
Handlbars templates content
## Associated Pull Requests ({{pullRequests.length}})
{{#forEach pullRequests}}
* **[{{this.pullRequestId}}]({{replace (replace this.url "_apis/git/repositories" "_git") "pullRequests" "pullRequest"}})** {{this.title}}
* Associated Work Items ({{this.associatedWorkitems.length}})
{{#forEach this.associatedWorkitems}}
   {{#with (lookup_a_work_item ../../relatedWorkItems this.url)}}
    - [{{this.id}}]({{replace this.url "_apis/wit/workItems" "_workitems/edit"}}) - {{lookup this.fields 'System.Title'}}
   {{/with}}
{{/forEach}}
* Associated Commits (this includes commits on the PR source branch not associated directly with the build)
{{#forEach this.associatedCommits}}
    - [{{this.commitId}}]({{this.remoteUrl}}) -  {{this.comment}}
{{/forEach}}
{{/forEach}}

Output
Associated Pull Requests (1)
Associated Work Items (0)
I have 5 items on pull requests
(https://azuredevops.kocsistem.com.tr/tfs/KocDigitalCollection/DevOps/_apis/git/repositories/gitflowtest/pullRequests/32326/workitems?api-version=6.0)
{"count":6,"value":[{"id":"60147","url":"https://azuredevops.kocsistem.com.tr/tfs/KocDigitalCollection/_apis/wit/workItems/60147"},{"id":"43915","url":"https://azuredevops.kocsistem.com.tr/tfs/KocDigitalCollection/_apis/wit/workItems/43915"},{"id":"48446","url":"https://azuredevops.kocsistem.com.tr/tfs/KocDigitalCollection/_apis/wit/workItems/48446"},{"id":"39996","url":"https://azuredevops.kocsistem.com.tr/tfs/KocDigitalCollection/_apis/wit/workItems/39996"},{"id":"60148","url":"https://azuredevops.kocsistem.com.tr/tfs/KocDigitalCollection/_apis/wit/workItems/60148"},{"id":"60150","url":"https://azuredevops.kocsistem.com.tr/tfs/KocDigitalCollection/_apis/wit/workItems/60150"}]}
How can I get related work items ?

#1368


Is it possible to use blocks in the html-header.twig file?

Hi i try to adapt my thinking to the twig approach and drop some possibly unnecessary PHP logic while converting an existing theme. One thing I still stumble across. For "normal" pages you are able to alter blocks used in the base.twig view. For a page you extend the base.twig file and then you are able to exchange its blocks. That is all fine and good.
But i wonder if it would be possible to exchange blocks for the html-header.twig somehow which is basically included into the base.twig file? So that you are e.g. able to add into the html tag on the front page a class of start and on another page exchange it with a class of foo and so on.
Somehow the html-header.twig file seems a bit unreachable for block exchange action? Best regards r.

Ok i was able to work around by dropping the html-header.twig and adding its content to the base.twig file. That way i was able to use blocks also for the header parts. But i am still curious if it would be basically possible to use block also if the html-header.twig file is included into the base.twig file.

Yes. You should be able to use blocks in any twig file.

This seems to be solved, let me know if there's anything else related to this.


Quit button in game screen causes weird error

When pressing the quit button in game screen following console log error will appear.
proxyConsole.js:54 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Game component.

I was wondering about that too earlier and now realized that the time counter only resets when you clear a level, not when you click quit so it stays running. Fixed in commit aaae8c5.


Priority: AlignMultilineComment should run before every PhpdocFixer

I made use of the graph I generated with https://github.com/dmvdbrugge/fixer-prio-graph
I also found a hidden priority between LineEnding and Braces, which I had to add in this PR as well, because otherwise the @Symfony_whitespace.test would fail.
Fixes #3879

I see plenty changes of getPriority methods for Fixers that are not Phpdoc*/Braces/LineEnding, without any reasoning added for those changes (keep in mind that when we do non-0 prio, we put a comment why - and those comments were either not added in your PR, or not updated while update of prio)

@keradus the answer to all your "why" is because of all the existing priorities. See the graph I mentioned, see all defined priorities, and see that all tests still pass.

See the graph I mentioned, see all defined priorities, and see that all tests still pass.

half of priorities are not covered with i-tests, eg even the one you are just saying you are fixing in this PR:

AlignMultilineComment should run before every PhpdocFixer

You added a priority relation between AlignMultilineComment and Phpdoc*Fixers, but you did not added integration tests for that.
For that, I'm not happy to change a priority without adding comment with reasoning and integration test for it.

Priority is one of the most tricky part of this tool. Maybe let's try to split this PR into atomic pieces, eg for what I understand, LineEnding and Braces can be extracted to separated PR.
Smaller PRs, easier to review & manual QA, easier to spot code changes that shall not be done or are missing tests.

Smaller PRs

This really is not that big of a PR...

You say this PR is small in terms of diff size. Indeed, it is.
Yet, I'm saying this PR is huge in terms of complexity, impact and potential risk.
Don't get me wrong - your work here is super nice, simply part of the code you are touching is super fragile, and any mistake here has big consequences.
And it's not trivial to validate if the changes are good or not. "small diff" you say? few lines to read, hard to understand the changes, impact impossible to predict, especially with missing tests.
And well, outcome of it is clear, nobody wants to review it (don't worry, I don't want to sound harsh here, this PR is on my watchlist and won't get forgotten for sure (even if I can't spend as much time with it as I would like to)), as nobody can say "it's safe to release this PR" - I'm trying to ask you for changes, that would make us more safe to release it.

I see plenty changes of getPriority methods for Fixers that are not Phpdoc*/Braces/LineEnding, without any reasoning added for those changes

As I mentioned before, it's a cascading change (again, see the graph, which visualises all current defined relations).

and for that, as it's all-in-one, hard to see out of the box which change in code is related to what change we want to accomplish.

half of priorities are not covered with i-tests

So we should write them. Please don't let that stop existing PRs that try to fix priority-problems.
(...)
Yes, sorry, none of the "special phpdoc cases" have integration tests as far as I could see.

So, if some legacy code has no tests, it's not an excuse to not create tests for new code/scenarios.
I'm not asking you to add in this PR tests for existing-not-covered cases.
I'm asking you to add them for new priority relation cases you are adding.
You added changes in "special cases" - provideFixersPrioritySpecialPhpdocCases https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/56557496da75f1feec1e12377c500f7a9b4688c2/tests/AutoReview/FixerFactoryTest.php#L219 . Those are that legacy cases without proper testing, and those are ignored in our test guard: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/56557496da75f1feec1e12377c500f7a9b4688c2/tests/AutoReview/FixerFactoryTest.php#L310 .
We shall not add more tests that are not covered by the guard.

For that, I'm not happy to change a priority without adding comment with reasoning and integration test for it.

The comment is there though. I could link to the issue as well. The reasoning I hope is clear to you: It fixes the *s of docblocks, they could be missing. And while that still is a valid docblock, there are fixers that won't run (correctly) in that case.

The comment part, especially after I will boyscout these (kudos :) ), is good part of the changes.
Lack of integration tests for newly configured priority relationship, is not.

Maybe let's try to split this PR into atomic pieces, eg for what I understand, LineEnding and Braces can be extracted to separated PR.

In theory yes, however that would block the current PR which needs to change those priorities, that's why it was found in the first place, and needed to be fixed as well.

I prefer to merge multiple small, easy and safe PRs, one after another, steps by steps, instead of having one problematic, long-living PR.

@dmvdbrugge #4245 was merged, can you please rebase this PR?

@julienfalque rebase done, had to work in a "new" (since a year ago) fixer, but all seems good again.

( i rebase to re-trigger the CIs with newest changes )

Hi @dmvdbrugge ,

AlignMultilineComment should run before every PhpdocFixer

where does this come from? I would like to right the priority integration test so we can move forward with this PR :)

a lot of integration tests were already added to cover some of those missing priority cases.
would you mind rebase and see what is still missing to cover with tests, @dmvdbrugge ?
i know it's a lot to ask, no need to rush on it ;)

I let myself integrate the integration test into the PR, with having the actual test proving the changes are solving the issue, I'm feeling much more comfortable merging this.
I synced the branch (ignore the merge commit and fabbot complain, I gonna squash it during merging anyway) and put milestone back.

Coverage remained the same at 91.901% when pulling 7919af966f3bbf838b84b2fb539858b48107c465 on dmvdbrugge:3879-AlignMultiline-before-Phpdoc into 76af6ebe7cd4fa51c6e2de5b540286642229fa0b on FriendsOfPHP:2.18.

@kubawerlos , i believe we should aim to drop numbers and have relations, like @SpacePossum described here: https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/5078#issuecomment-683424449

The failure we see in the test for PHP8 build is caused by not-known-before fixers relation between method_argument_space and function_declaration, and as we were not aware about the relation, we did not have explicit test for it.
Now, we accidentally discovered it with PHP8 integration test.
Having all relations discovered and documented with dedicated test is almost impossible, and changing the priorities like in this PR is putting us at risk to introduce such issues.
This time we were lucky that one of the test, even when not designed for it, discovered the problem.
FYI @dmvdbrugge @julienfalque @SpacePossum @kubawerlos

Trying to solve above issue in #5552 ,
then we should unblock this PR

Thank you @dmvdbrugge.

Thanks a lot for finishing this @keradus and my apologies for being awol.


Invalid memory access when mapping tuple of generic enumerables

This snippet, when run, produces a segfault in the compiler.
class Foo(T, U)
    def initialize(@var : Enumerable(T), @var2 : Enumerable(U))
        {@var, @var2}.map &.each
    end
end

# This works fine when T and U are the same type
puts Foo.new([1], [1])
# but causes a crash when they are not
puts Foo.new([1], [1.0])

$ crystal run test.cr
Invalid memory access (signal 11) at address 0x0
[0x5649ce0dc376] ???
[0x5649ce02b2c2] __crystal_sigfault_handler +514
[0x7fb1dc174870] ???
[0x7fb1dd12a404] _ZN4llvm11PointerType3getEPNS_4TypeEj +20
[0x7fb1dd0341eb] LLVMBuildInBoundsGEP +267
[0x5649cdc4981d] ???
[0x5649cdc54d7c] ???
[0x5649cdc6224d] ???
[0x5649cdc61f34] ???
[0x5649cdc5fa9a] ???
[0x5649cdc6ecf4] ???
[0x5649cdc94940] ???
[0x5649cdc8b88d] ???
[0x5649cdc6bc56] ???
[0x5649cdc8ce4e] ???
[0x5649cdc6bc56] ???
[0x5649cdc69a08] ???
[0x5649cdc7d4c1] ???
[0x5649cdc9617b] ???
[0x5649cdc8baa8] ???
[0x5649cdc6bc56] ???
[0x5649cdc69a08] ???
[0x5649cdc7d4c1] ???
[0x5649cdc9617b] ???
[0x5649cdc8baa8] ???
[0x5649cdc6bc56] ???
[0x5649cdc94940] ???
[0x5649cdc8b88d] ???
[0x5649cdc6bc56] ???
[0x5649cdc69a08] ???
[0x5649cdc1a745] ???
[0x5649ce04a4fb] ???
[0x5649ce0b3816] ???
[0x5649ce037e5a] ???
[0x5649cd70b54b] __crystal_main +15995
[0x5649cd71017b] main +59
[0x7fb1dbf3fb25] __libc_start_main +213
[0x5649cd7075fe] _start +46
[0x0] ???

This is happening on Arch with crystal v1.0.0:
$ crystal -v
Crystal 1.0.0 (2021-03-29)

LLVM: 10.0.1
Default target: x86_64-pc-linux-gnu

I built the compiler from master and tried using it - the problem persists, but the output is much more verbose there:
Using compiled compiler at .build/crystal
Invalid memory access (signal 11) at address 0x0
[0x55ac304ed8e6] *Exception::CallStack::print_backtrace:(Int32 | Nil) +118
[0x55ac304d4f8a] ~procProc(Int32, Pointer(LibC::SiginfoT), Pointer(Void), Nil) +330
[0x7f6230ca7870] ???
[0x7f6231d02e94] _ZN4llvm11PointerType3getEPNS_4TypeEj +20
[0x7f6231bfc696] LLVMBuildInBoundsGEP +262
[0x55ac314334ba] *LLVM::Builder#inbounds_gep<LLVM::Value, LLVM::Value, LLVM::Value, String>:LLVM::Value +218
[0x55ac31476561] *Crystal::CrystalLLVMBuilder#inbounds_gep<LLVM::Value, LLVM::Value, LLVM::Value, String>:LLVM::Value +241
[0x55ac313c338b] *Crystal::CodeGenVisitor +91
[0x55ac313c331f] *Crystal::CodeGenVisitor +127
[0x55ac313c6618] *Crystal::CodeGenVisitor +72
[0x55ac313c65bf] *Crystal::CodeGenVisitor#aggregate_index<LLVM::Value, Int32>:LLVM::Value +47
[0x55ac313c6579] *Crystal::CodeGenVisitor#union_type_id<LLVM::Value>:LLVM::Value +41
[0x55ac313ca477] *Crystal::CodeGenVisitor#union_type_and_value_pointer<LLVM::Value, Crystal::MixedUnionType>:Tuple(LLVM::Value, LLVM::Value) +39
[0x55ac313ca431] *Crystal::CodeGenVisitor#type_id_impl<LLVM::Value, Crystal::MixedUnionType>:LLVM::Value +49
[0x55ac313ca3ae] *Crystal::CodeGenVisitor#type_id<LLVM::Value, Crystal::Type+>:LLVM::Value +974
[0x55ac313d2320] *Crystal::CodeGenVisitor#store_in_union<Crystal::MixedUnionType, LLVM::Value, Crystal::Type+, LLVM::Value>:LLVM::Value +64
[0x55ac313d2233] *Crystal::CodeGenVisitor#assign_distinct<LLVM::Value, Crystal::MixedUnionType, Crystal::MixedUnionType, LLVM::Value>:(Bool | LLVM::Value) +3235
[0x55ac313d05a9] *Crystal::CodeGenVisitor#assign<LLVM::Value, Crystal::Type+, Crystal::Type+, LLVM::Value>:(Bool | LLVM::Value | Nil) +1673
[0x55ac3141a21f] *Crystal::CodeGenVisitor#visit<Crystal::Yield>:Bool +4767
[0x55ac30846e81] *Crystal::ASTNode+ +4545
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac313fd516] *Crystal::CodeGenVisitor#prepare_call_args_non_external<Crystal::Call, Crystal::Def+, Crystal::Type+>:Tuple(Array(LLVM::Value), Bool) +2150
[0x55ac313fb0e1] *Crystal::CodeGenVisitor#prepare_call_args<Crystal::Call, Crystal::Type+>:Tuple(Array(LLVM::Value), Bool) +129
[0x55ac313f6b1b] *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool +299
[0x55ac30846f5d] *Crystal::ASTNode+ +4765
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac31400106] *Crystal::CodeGenVisitor#codegen_call_with_block<Crystal::Call, Crystal::Block, Crystal::Type+, Array(LLVM::Value)>:LLVM::Value +1046
[0x55ac313f6c48] *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool +600
[0x55ac30846f5d] *Crystal::ASTNode+ +4765
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac3140c304] *Crystal::CodeGenVisitor#visit<Crystal::Expressions>:Bool +276
[0x55ac30846294] *Crystal::ASTNode+ +1492
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac313e68ab] *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+, Bool, Crystal::CodeGenVisitor::ModuleInfo, Bool, Bool>:LLVM::Function +3499
[0x55ac313fe9a8] *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+>:LLVM::Function +184
[0x55ac313fe2cc] *Crystal::CodeGenVisitor#target_def_fun<Crystal::Def+, Crystal::Type+>:LLVM::Function +412
[0x55ac31402379] *Crystal::CodeGenVisitor#codegen_call<Crystal::Call, Crystal::Def+, Crystal::Type+, Array(LLVM::Value)>:(Bool | LLVM::Value | Nil) +329
[0x55ac313f6bf0] *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool +512
[0x55ac30846f5d] *Crystal::ASTNode+ +4765
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac3140c304] *Crystal::CodeGenVisitor#visit<Crystal::Expressions>:Bool +276
[0x55ac30846294] *Crystal::ASTNode+ +1492
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac313e68ab] *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+, Bool, Crystal::CodeGenVisitor::ModuleInfo, Bool, Bool>:LLVM::Function +3499
[0x55ac313fe9a8] *Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+>:LLVM::Function +184
[0x55ac313fe2cc] *Crystal::CodeGenVisitor#target_def_fun<Crystal::Def+, Crystal::Type+>:LLVM::Function +412
[0x55ac31402379] *Crystal::CodeGenVisitor#codegen_call<Crystal::Call, Crystal::Def+, Crystal::Type+, Array(LLVM::Value)>:(Bool | LLVM::Value | Nil) +329
[0x55ac313f6bf0] *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool +512
[0x55ac30846f5d] *Crystal::ASTNode+ +4765
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac313fd516] *Crystal::CodeGenVisitor#prepare_call_args_non_external<Crystal::Call, Crystal::Def+, Crystal::Type+>:Tuple(Array(LLVM::Value), Bool) +2150
[0x55ac313fb0e1] *Crystal::CodeGenVisitor#prepare_call_args<Crystal::Call, Crystal::Type+>:Tuple(Array(LLVM::Value), Bool) +129
[0x55ac313f6b1b] *Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool +299
[0x55ac30846f5d] *Crystal::ASTNode+ +4765
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac3140c304] *Crystal::CodeGenVisitor#visit<Crystal::Expressions>:Bool +276
[0x55ac30846294] *Crystal::ASTNode+ +1492
[0x55ac313da131] *Crystal::CodeGenVisitor#accept<Crystal::ASTNode+>:Nil +17
[0x55ac3069a70f] *Crystal::Program#codegen<Crystal::ASTNode+, (Bool | Crystal::Compiler::EmitTarget | Nil), Crystal::Debug>:Hash(String, Crystal::CodeGenVisitor::ModuleInfo)+ +95
[0x55ac3069a6aa] *Crystal::Program#codegen:debug:single_module<Crystal::ASTNode+, Crystal::Debug, (Bool | Crystal::Compiler::EmitTarget | Nil)>:Hash(String, Crystal::CodeGenVisitor::ModuleInfo)+ +74
[0x55ac312d7987] *Crystal::Compiler#codegen<Crystal::Program, Crystal::ASTNode+, Array(Crystal::Compiler::Source), String>:(Tuple(Array(Crystal::Compiler::CompilationUnit), Array(String)) | Nil) +615
[0x55ac312dc4dc] *Crystal::Compiler#compile<Array(Crystal::Compiler::Source), String>:Crystal::Compiler::Result +188
[0x55ac31556e29] *Crystal::Command::CompilerConfig#compile<String>:Crystal::Compiler::Result +57
[0x55ac3154a8df] *Crystal::Command#run_command<Bool>:Nil +415
[0x55ac315453d3] *Crystal::Command#run:(Bool | Nil) +2099
[0x55ac31544a69] *Crystal::Command::run<Array(String)>:(Bool | Nil) +25
[0x55ac31544a2d] *Crystal::Command::run:(Bool | Nil) +29
[0x55ac304b66b9] __crystal_main +2377
[0x55ac310b7486] *Crystal::main_user_code<Int32, Pointer(Pointer(UInt8))>:Nil +6
[0x55ac310b7295] *Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32 +53
[0x55ac304c1b56] main +6
[0x7f6230a67b25] __libc_start_main +213
[0x55ac304b5c9e] _start +46
[0x0] ???

I looked through the other segfault issues on here, and to the best of my knowledge this hasn't been reported yet. I tried to reduce the code further, but changing anything here seems to make the bug go away.
For now, I'm using the following workaround:
class Foo(T, U)
    private def initialize(@var : T, @var2 : U)
        {@var, @var2}.map &.each
    end

    def self.new(t : Enumerable, u : Enumerable)
        new(var: t, var2: u)
    end
end

puts Foo.new([1], [1.0])

It isn't totally equivalent (you have Foo(Array(Int32), Array(Float64)) rather than Foo(Int32, Float64)), but it's likely better practice.

Reduced:
def foo
  x = uninitialized Enumerable(Int32)
  y = uninitialized Enumerable(Float64)
  yield x
  yield y
end

foo { |v| }

While this produces an infinite recursion:
x = uninitialized Enumerable(Int32)
y = uninitialized Enumerable(Float64)
true ? x : y

I'm almost sure this is a duplicate of https://github.com/crystal-lang/crystal/issues/7044

Both errors occur during codegen, not semantic analysis, so I doubt that.

I don't know why it doesn't and I haven't been able to pinpoint yet where in the code is this decision made. If somebody knows where this is, please point me in the right direction.

There's a method called remove_indirection in Crystal::Type. A module implements it by returning a union of all including types (actually calling remove_indirection on this subtypes, recursively.)
It seems to be missing from Union. I guess I never thought of this case.
This patch seems to fix this issue:
diff --git a/src/compiler/crystal/types.cr b/src/compiler/crystal/types.cr
index 20cd36d2f..5ccda0d39 100644
--- a/src/compiler/crystal/types.cr
+++ b/src/compiler/crystal/types.cr
@@ -3165,6 +3165,10 @@ module Crystal
       union_types.all? { |union_type| yield union_type }
     end

+    def remove_indirection
+      Type.merge!(union_types.map(&.remove_indirection))
+    end
+
     def to_s_with_options(io : IO, skip_union_parens : Bool = false, generic_args : Bool = true, codegen : Bool = false) : Nil
       io << '(' unless skip_union_parens
       union_types = @union_types

That said, I'm not sure if that patch is correct, and whether it has some (bad) side effects (for instance, no idea if CI passes.)

I also confirm the patch above fixes all faulty snippets.

Ok, so I've been chipping away at this for the past few days. @asterite's solution works and it fixes all the snippets mentioned in this issue. However, it breaks the compiler in a bunch of ways. The problem is it sometimes reduces a union into a virtual type and that changes the binary representation and the pass-by-value/reference semantics of the variable. The union is passed by value, the virtual type by reference. Example:
class Base; end
module Mixin; end

class T1 < Base; include Mixin; end
class T2 < Base; end

Here (Base | Mixin) is reduced to Base+, which is correct for the efficient binary representation (it's loose on the type requirements but we're in the codegen stage so it shouldn't matter much).
Since remove_indirection is used sparingly in the codegen, sometimes it considers the variable to be of type union, sometimes as a virtual type. I've seen all kinds of errors arising from this: from straight up crashes to the compiler generating invalid LLVM IR code.
I switched to a slightly different solution which is a bit less aggressive and will reduce a union of subtypes/modules to a virtual type in much fewer cases. Instead of
def remove_indirection
  Type.merge!(union_types.map(&.remove_indirection))
end

I used
def remove_indirection
  program.type_merge_union_of(union_types.map(&.remove_indirection)).not_nil!
end

In the previous example, (Base | Mixin) is reduced to (Base | T1). Still a union but from the concrete implementers of Mixin, so a ReferenceUnionType that is represented with a pointer.
This will preserve the union in most cases. But not all of them :disappointed:  I've been playing whack-a-mole with the parts of codegen that break when that happens, but I'm starting to grow tired of it. With my solution the problem exists anyway, it just happens less often. So, even if I have all the specs passing (which I have), the compiler will still be broken for a lot of untested cases. Plus of course, sprinkling #remove_indirection here are and there is a hack.
IMHO the solution is to "reify" all the types (ie. compute the type with remove_indirection) right before the codegen stage and use the computed types onwards. That's a big change, and from what I've seen there are a lot of places where we don't have test coverage. Also, before even embarking on such enterprise I'd like to hear other people's opinions.
My changes are here.

I think Ary and Quinton's input is more relevant here, but here I go:

This will preserve the union in most cases. But not all of them 😞
What do you mean? That sometimes it'll merge the union into a virtual type? If so, why is that bad?

IMHO the solution is to "reify" all the types (ie. compute the type with remove_indirection) right before the codegen stage and use the computed types onwards.
I suppose you mean to have a Normalize types pass after the last semantic pass. I think this is reasonable.

What do you mean? That sometimes it'll merge the union into a virtual type? If so, why is that bad?

It's bad because since the original type is a union, the codegen expects it to be passed by value and will generate incorrect code when handling it.

I suppose you mean to have a Normalize types pass after the last semantic pass. I think this is reasonable.

Yeah, I guess normalization is a better term. Reify stuck with me because of the original failing samples, in which we needed to replace the generic module types Enumerable(Int32) | Enumerable(Float64) for the concrete types.

Currently there isn't a clear separation between the semantic phase and the codegen phase, because MainVisitor may be used inside the latter:
https://github.com/crystal-lang/crystal/blob/bc0198932160de0279d2a68512b7ac576d20def2/src/compiler/crystal/codegen/codegen.cr#L1366-1395
These can theoretically create new types and affect the existing type hierarchy, so I think they belong in the clean-up phase instead (or even a new phase between clean-up and type normalization).

I see there's a cleanup_types phase, wouldn't it make sense to add it there?

With the example from https://github.com/crystal-lang/crystal/issues/10967#issuecomment-883154021 in 1.8.0 the error is the same as in #12894


Minor VeriFast proof changes to match V10.4.3

Description
Updated proof hashes; re-checked diff against implementation (one minor change)
Test Steps
On Mac:
$ wget https://github.com/verifast/verifast/releases/download/19.12/verifast-19.12-macos.tar.gz
$ tar zxvf verifast-19.12-macos.tar.gz
$ VERIFAST=./verifast-19.12/bin/verifast make synced_with_source_check queue list
Cloning into 'no-change-check-freertos-kernel'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 151664 (delta 0), reused 0 (delta 0), pack-reused 151660
Receiving objects: 100% (151664/151664), 104.46 MiB | 8.72 MiB/s, done.
Resolving deltas: 100% (109640/109640), done.
queue/create.c
0 errors found (325 statements verified)
queue/prvCopyDataFromQueue.c
0 errors found (308 statements verified)
queue/prvCopyDataToQueue.c
0 errors found (336 statements verified)
queue/prvIsQueueEmpty.c
0 errors found (289 statements verified)
queue/prvIsQueueFull.c
0 errors found (289 statements verified)
queue/prvLockQueue.c
0 errors found (290 statements verified)
queue/prvUnlockQueue.c
0 errors found (304 statements verified)
queue/uxQueueMessagesWaiting.c
0 errors found (292 statements verified)
queue/uxQueueSpacesAvailable.c
0 errors found (290 statements verified)
queue/vQueueDelete.c
0 errors found (287 statements verified)
queue/xQueueGenericSend.c
0 errors found (335 statements verified)
queue/xQueueGenericSendFromISR.c
0 errors found (317 statements verified)
queue/xQueueIsQueueEmptyFromISR.c
0 errors found (287 statements verified)
queue/xQueueIsQueueFullFromISR.c
0 errors found (287 statements verified)
queue/xQueuePeek.c
0 errors found (335 statements verified)
queue/xQueuePeekFromISR.c
0 errors found (300 statements verified)
queue/xQueueReceive.c
0 errors found (337 statements verified)
queue/xQueueReceiveFromISR.c
0 errors found (314 statements verified)
list/listLIST_IS_EMPTY.c
0 errors found (314 statements verified)
list/uxListRemove.c
0 errors found (440 statements verified)
list/vListInitialise.c
0 errors found (325 statements verified)
list/vListInitialiseItem.c
0 errors found (316 statements verified)
list/vListInsertEnd.c
0 errors found (410 statements verified)
list/vListInsert.c
0 errors found (456 statements verified)

Related Issue
None
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

/bot run checks

Thanks Joe. Could someone with write access merge at their earliest convenience?


how can i use calico with mesos decision my ip with env

i see the docs Mesos with Calico networking, but i don't understand it,when i complete Calico with Docker Containerizer - Manual Install Guide，it tell me Key = net
Value =   but how can i designated a ip address?

If you have created a Calico Docker network, e.g. "net1" then you specify key=net, value=net1 to use that network.  You can also specify a key=ip value= to select a particular IP address from a Calico pool.

Hi @245347881 - did the above sort out the issue - or did I misunderstand what you were asking?

hi, @robbrockbank  thank you very much ,i Success


Exploit not working on certain SCPH-5501 models

Hello,
I have a SCPH-5501 PU-18\1-664-537-62\September 1997 model Playstation and have verified the Bios is 3.0 , checksum 8d8cb7e4, and a date of 11/18/96.
I've written the freepsxboot-unirom-fastload-20210419-bios-3.0.mcd image to a first party memory card using PSXGameEdit 1.6 and a DexDrive.  This method has been confirmed to be working in issue #22 .
Selecting Memory Card from the Playstation menu makes the screen flash from orange to a pale light blue very quickly and then it locks there.  I've left the Playstation in that state for hours.  Tonyhax also does not work using the Castrol Superbike save game exploit.  It will load the save game successfully but starting a race to initialize the payload locks up the Playstation.
I've read a few posts about some 5501's just not working with the exploit. Let me know if there is some information I can provide about my Playstation which may help get it working.
Thanks.

A new image got uploaded specifically for your BIOS-date:
https://github.com/brad-lin/FreePSXBoot/blob/master/images/freepsxboot-unirom-fastload-20210421-bios-3.0-19961118.mcd

If you get to the pale blue screen, it means the exploit triggered. From there, it's very unlikely to crash, so maybe your memory card was not properly written?
Can you try again with the 20210421 images? If it still fails, please dump your memory card and compare it to the memory card image.

So progress..maybe.
Firstly Tonyhax does actually work.  I had just tried it for testing and missed that the loader save also needed to be imported and not just the game save exploit.  It also works across the various memory cards I have.
The new 1996118 image still doesn't work but there is some interesting behavior.  I have 4 completely different 3rd party mem cards (Interact, Joytech, generic, and a 2x Performance with a button to switch between the banks) and a Sony card.  PSXGameEdit has 2 different read and write methods, quick and full.  Using either on any of the 3rd party cards results in the Playstation reading them as empty.
When using the full write method on the Sony card the screen scales way up where the "Memory Card" graphic takes up the full bottom of the screen and locks there.  Using the quick write method actually shows the light blue screen with vertical yellow columns filling in from left to right making the screen greenish.  It get's to the end but then just locks on the greenish screen.
I also tried the quick write method with the previous 3.0 image and it just locks on the main playstation screen.
Regarding the memory card dump I tested PSXGameEdit's export functionality.  First I loaded the image to the apps buffer and then exported what it had loaded.  This does not actually write anything to a card.  There were no differences between the images so the app is not making any changes when it loads to it's buffer.  I then wrote the image to the Sony memory card using the full method, read it back using the full method, and exported it.  The images were different unfortunately.  I also did the same using the quick write method and while they were also different it was much less different.  Using the full write the differences stopped at position 0171FF and the quick image differences stopped at just 1FFF.  So it does look like the app makes changes when actually writing to a device but maybe the quick write only changes the initial header and writes whatever data is left and the full will try to 'fix' things.
I don't know why it worked for @hurda or why all my 3rd party cards are read as empty.

Haven't said it worked for me, was just linking the new image for you.
Do you have any other way of writing the memorycard-images? Changing that first block can't be helping with launching the exploit.

Haven't said it worked for me, was just linking the new image for you.
Do you have any other way of writing the memorycard-images? Changing that first block can't be helping with launching the exploit.

Sorry, I tagged the wrong person.  I meant @mgarcia-org said it worked with PSXGameEdit.
Good news though.  I wrote my own writer for the DexDrive with the help of @ShendoXT memcardrex code and @fbriere protocol.txt information.  It just writes the raw data as is without trying to change header/slot data,  Now the freepsxboot-unirom-fastload-20210421-bios-3.0-19961118.mcd image works fine on the Sony memory card and all the 3rd Party cards.  Not sure why the 3rd party cards behaved differently with the memory managers but at least it's not anything wrong with FreePSXBoot or my playstation.

Thanks for the feedback, and great news.
Memcardrex being open source, it should be relatively easy to add a "write raw card data without any checks" option to it.

Issue was caused by memory managers for the dexdrive changing the image and not freepsxboot.  Writing the raw image was successful.


[BUG] Auto-backport is failing: permission denied

Describe the bug
remote: Permission to opensearch-project/OpenSearch.git denied to github-actions[bot].

To Reproduce
Steps to reproduce the behavior:

Label an issue backport 1.x.
See failed job.

https://github.com/opensearch-project/OpenSearch/runs/4509880595?check_suite_focus=true

@VachaShah Do you know how to fix this?

Tried the approach where in the workflow, we fork the repo and then create a branch to backport, cherry-pick the commit and create a PR from it. But the Github actions was not able to fork a repo, got error failed to fork: HTTP 403: Resource not accessible by integration while doing so.

@VachaShah try with a pre-created fork (say backport/OpenSearch) to which this backport GH has access, and use the checkout@v2 action to backport, push and raise PR from this backport fork. This would also help keep the permissions of this GH restricted to the backport fork alone and track the workflow retries better.

@setiah Wouldn't the pre-created fork have to belong to a user?

Update, the following things are needed to fix the permissions issue:

The token needs write permissions for pull requests and content in order to create pull requests on the repos. This is fixed in PR #1845.
The GHA for backport creates branches (backport-<PR-number>-to-<release-branch>) to cherry-pick commits for backport. Hence, the branch permissions need to be defined for such branches. In order to better manage permissions, I have PRed the change to allow custom branch names in the GHA repo and use it in the OpenSearch repo. Details: #1862.

This issue is resolved and the backport workflow is able to create PRs. Example PR: #1959


fix(a11y): added aria-controls & aria-expanded to SearchInput

Description

adds aria-controls and aria-expanded to SearchInput
types and unit test

I'm inclined to leave the formatting fixes in the test file, but am open to reverting them.


variable names filteredPosts fixed

I think there are some mistakes in variable names so I fixed them.

README has been rewritten (a few times), so this is no longer applicable. Thanks though 👍


feat: update the Dockerfile with emulator dependencies

I'm assuming it would be preferable to have a single commit for most of the changes related to the emulator and the CI. In that case, it would be helpful it the commit contained a more thorough explanation about their purpose as the commit message does not convey much about it.
Also, in order to make the changes clearer in the diff, I'd suggest either creating a separate commit for the formatting changes or reverting them altogether. This would help a lot with reviewing Dockerfile and build/docker-bake.hcl (it's a bit hard to identify the upgrades being made to the versions)

I've update the commit message with more information.
Separating the refactor in another commit would further delay this commit.
I think we can get together in a call for me to explain stuff.

Let's just reinstate the linux/arm64 platform now that we know that xgenext2fs has a build for it. Other than that, it looks good to me 👌🏽

Please close #439 when this is done, @renan061

Fixed platform/arm64. Now working!
Regarding the documentation for targets, the same text is still there.
What changes is that we are not identifying which stages are targets in the Dockerfile anymore.
Because docker-bake.hcl is very explicit about which stages are targets,
I don't think we need to document it elsewhere.


feat: skip namespacing when already prefixed

This goes some way to fixing #6071 (@sipsma up to you if you want to leave it open for tracking the subpackage aspect, or splitting up core)
This allows a module "foo" to define it's own "FooContainer" type that won't be additionally namespaced into "FooFooContainer".

Previously, we skipped namespacing if the object was named the same as the module.
However, with this patch we can now additionally skip namespacing if the object if prefixed with the namespace.

@helderco curious if you've seen this python flake before: https://github.com/dagger/dagger/actions/runs/7194438979/job/19594973142#step:5:3880 (not a blocker for this PR, it just happened here last)
I've seen it across a few PRs (and started happening recently), but it always seems to disappear with a re-run.

@helderco curious if you've seen this python flake before: https://github.com/dagger/dagger/actions/runs/7194438979/job/19594973142#step:5:3880 (not a blocker for this PR, it just happened here last)
I've seen it across a few PRs (and started happening recently), but it always seems to disappear with a re-run.

Yeah, I've seen that but put it back of mind. It's the garbage collector in automatic provisioning during a stress test:
https://github.com/dagger/dagger/blob/970bcfe512cfc699005c46992f52a8f1d17c2af3/sdk/python/tests/engine/test_download.py#L137
I'll see if I can replicate locally and fix it.


server, performance: no need to notify individual servers by making extra UDP connection.

We are wasting CPU cycles while notifying servers whenever aardvark
performs a refresh, we don't need to do that anymore after we switched
to mpmc ( multi-producer, multi-consumer ) design for notification here
: https://github.com/containers/aardvark-dns/pull/48

/lgtm


TypeError: Cannot read property 'setLibraryName' of null, js engine: hermes

I am junior developer using amplitude react-native.
Ios works fine but when I try to build android, it shows this error.
Can anyone give me some help?

Hi @borijuyeong, which amplitude react-native versions are you using? And what's the version of your react-native?

I'm having similar issue, too. It happens when I call Amplitude.getInstance();
Version

@amplitude/react-native: 2.5.0
react-native: 0.63.4

Screenshot

Any of you solved this?

nope, not yet

Run into same error today after installing RN amplitude package.
Re-install my app using react-native run-android after npm install @amplitude/react-native@latest solved the issue for me.

Same issue with version 2.7.0.
Any workaround?

I use Hermes by following this docs.
I tried with react-native 0.63.4  & 0.66.1 with "@amplitude/react-native": "2.3.2", "@amplitude/react-native": "2.5.0". However I'm not able to reproduce this issue.
Could you provide an example app in order to reproduce this issue?

@borijuyeong I get this error if I forgot to install pods after installing @amplitude/react-native package. Also after that need npm run ios for building ios dependencies.
FYI: For installing pods needs in terminal run bundle exec pod install in ios folder

the same issue is it fixed

Hi @minaairsupport, did you install the pods in ios folder?

I am using Expo, should I install the pods ?

Any solution? Im also using Expo and couldn't   make it work

This amplitude-ReactNative doesn't support EXPO. However, we have a new ReactNative SDK.
It supports React Native Web, Reacts Native Android, React Native iOS, and compatibility with Expo.
It also supports custom plugins and has built-in type definitions.
Please check here. https://github.com/amplitude/Amplitude-ReactNative/issues/138
I will provide a document for migration soon.
Thanks.


nfts not showing on opensea testnet rinkeby<EMAIL_ADDRESS>

opensea https://testnets.opensea.io/assets/rinkeby/0x2301334d923434Ff569ba4fD7FC19C35758086bE/1
rinkeby solidity code https://rinkeby.etherscan.io/address/0x2301334d923434ff569ba4fd7fc19c35758086be#code
nfts were showing in version 3.3.0 erc721a but not on erc721a 4.1.0

Please don't create issues relating to OpenSea specific issues, as this is unrelated to Seaport.


add option to pass 'api_key' to gen_answers, judge_answers

I notice the api_key is hard-coded which is preventing from using an external judge server. This adds an optional api_key to provide an openai_client in gen_answers and judge_answers. Note, candidate-server & judge-server may have unique tokens so the env var OPENAI_API_KEY should not be used.

@sallyom thanks for the contribution! some CI failures here - you can run the checks locally with make verify - ping me if you have any issues there :smile:

thanks for your review @danmcp, if I keep making PRs to this repo or any repo you maintain I just might learn python 😄

thanks for your review @danmcp, I really appreciate your help.

Thanks for the commit and working through the minutia!


firebase_auth: Getting DisplayName after creating account with email returns 'null'

I came across a bug which returns null for displayName and photoUrl after creating a new account with email and password. This happens until the user signs out and signs back in. Or the app restarts. Uid, email, and token all seem to work fine. I have not yet tested Google Sign in or Facebook Sign in.
The error reproduces even after making sure to wait for updateProfile() to finish updating the displayName and photoUrl.
Right now my workaround is to logout and log back in, right after creating the new account.

Just experienced this myself but I was using phone auth, haven't had a chance to test with Google sign in. The photoUrl and displayName properties of the auth object don't appear to return a value on iOS, however on Android it works as expected. Signing out and signing back in on iOS appears to fix the problem.

// get signed in user
FirebaseUser firebaseUser = await _auth.currentUser();
// reload it
await firebaseUser?.reload();
// get user again
firebaseUser = await _auth.currentUser();

@jmen900
This issue has been moved to https://github.com/FirebaseExtended/flutterfire/issues/744. Any further collaboration will be done there.


Inpainting + FaceID IPAdapter

Hello,
Anyone done the combination of both?

Today I attempted to set up a ComfyUI workflow combining Segment Anything + Kolors Inpaint + Kolors FaceID. However, the results when using FaceID for inpainting were not satisfactory; likely, my IPAdapterFaceID parameters aren't properly tuned. The faces always show a color discrepancy with their surroundings. Without using FaceID, the seg plus inpaint workflow performs well, but I aim to better integrate FaceID's face swapping control.

@leetraman822 I can confirm that the ComfyUI node is broken. Something is completely off even without the inpainting. Use the original code and compare it. I actually started to write the code necessary to combine it on a code level - however my time is currently limited and was hoping someone else worked on this already.

Today I attempted to set up a ComfyUI workflow combining Segment Anything + Kolors Inpaint + Kolors FaceID. However, the results when using FaceID for inpainting were not satisfactory; likely, my IPAdapterFaceID parameters aren't properly tuned. The faces always show a color discrepancy with their surroundings. Without using FaceID, the seg plus inpaint workflow performs well, but I aim to better integrate FaceID's face swapping control.

Have you solved the problem yet? Can we discuss it further


Adding Roundtrip

The directory Roundtrip_Examples has an example notebook to show the interactive tree.

interactiveTree.js: this has the Hatchet-specific interactive tree visualization
require.config: a file that JS-Require uses to incorporate in the Javascript library d3 into my visualization (interactiveTree.js) (JS-Require is built into Jupyter notebooks and is used for handling external libraries)
roundtrip-query-demo.ipynb: the Jupyter notebook that walks through an example tree
roundtrip.py: the Python file that passes data from the Jupyter Python cells into a named Javascript visualization (via the %loadVisualization line in the notebook) and passes Javascript data back into Python variables (via the %fetchData line in the notebook)

@kawilliams why is there a commit here that merges pull request #1 from develop

Also, if this code is going to be integrated into hatchet, we probably want to rename the directory.

I'm not sure @bhatele, I had some issues getting my local fork up to date. Suggestions on how to fix this?
And what should I rename the directory to? Thank you!

I'm sorting through my git troubles now. Once it's fixed, I'll submit a new PR. I'm sorry for the confusion.


Issue with k8s.io/docs/concepts/containers/container-lifecycle-hooks/

This is a Bug Report

Problem:
PostStart and PreStop start from capital letter. I get an error like following
unknown field "PostStart" in io.k8s.api.core.v1.Lifecycle
Proposed Solution:
Use postStart and preStop
Page to Update:
https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/

@voron note that PostStart  , PreStop   start with capital letter because they are the names of Container hooks.
they are not the fields in lifecycle spec, as you thought.

Got it, correct manual page is here


Define module name for AMD when output as UMD

I'm submitting a feature request
Possibility to have a custom name for the AMD module when output the library as UMD.
Current behavior:
Now with a configuration like this, only the entry name is set in the module name.
module.exports = {
  context: __dirname + '/src',

  entry: {
    text: 'componentA/text',
    button: 'componentB/button',
  },

  output: {
    path: 'dist/',
    filename: '[name].js',
    libraryTarget: 'umd',
    library: ['mylib', '[name]'],
    umdNamedDefine: true
  },

  resolve: {
    modulesDirectories: ['src']
  }
};

The output looks like this:
    if(typeof exports === 'object' && typeof module === 'object')
        module.exports = factory();
    else if(typeof define === 'function' && define.amd)
        define("button", [], factory);
    else if(typeof exports === 'object')
        exports["button"] = factory();
    else
        root["mylib"] = root["mylib"] || {}, root["mylib"]["button"] = factory();

Expected/desired behavior:
I think it might be interesting be possible to pass a string in umdNamedDefine and use this string as a name for the AMD module.
So in the above config instead of umdNamedDefine: true it would be possible to write umdNamedDefine: 'mylib/[name]' and this would output this:
    if(typeof exports === 'object' && typeof module === 'object')
        module.exports = factory();
    else if(typeof define === 'function' && define.amd)
        define("mylib/button", [], factory);
    else if(typeof exports === 'object')
        exports["button"] = factory();
    else
        root["mylib"] = root["mylib"] || {}, root["mylib"]["button"] = factory();

What is the motivation / use case for changing the behavior?

I have been using require.js for a long time, and for most of my libraries I set the module name, to be able to request modules by name.
Now I'm trying to use webpack and looks like webpack lacks this feature.
I post a question here related to this subject, but I think the question is not clear.

I think output.library can be an object. output.library.amd is the name.

I'm sorry @sokra but I think output.library can not be a object, at least using libraryTarget: umd, I test and doesn't work.
I will have a look at this when I have some time, I will start from here I think.

This would be really helpful to have baked in WebPack. I wrote this hack plugin to allow you to set a different module name for VAR libraryTarget while using umd. To archive something like what rollup allows https://github.com/rollup/rollup/wiki/JavaScript-API#moduleid.
https://github.com/glena/webpack-custom-var-library-name-plugin
The main issue with the implementation is that there is no way to actually know which one is being processed (amd, commonjs or standalone) so it check for a string starting with root[ (not proud of).

Thank you @glena

I will try out your plugin @glena, but I agree with that it would be wonderful if this was built into webpack

Thank you @glena and @spatialillusions


Proxy support?

It seems the API does not support proxy tunnels?
I might fork node-ftp and try to implementate it, I've found a good description here:
http://www.codeproject.com/Articles/9547/How-Proxy-Server-serves-FTP-clients

It doesn't, but as far as I know there is no standard mechanism for proxying FTP connections.