Successfully convert model through full-integer, but leave nodes with int8 instead of uint8

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-55-generic x86_64)
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: would run on Raspberry Pi4 +edge TPU or Dev-board
TensorFlow installed from (source or binary): source
TensorFlow version (use command below): v1.15.0-0-g590d6eef7e 1.15.0
Python version: 3.7.4
Bazel version (if compiling from source): 0.24.1
GCC/Compiler version (if compiling from source): GCC 7.3.0
CUDA/cuDNN version: Cuda compilation tools, release 10.1, V10.1.243
GPU model and memory: 2080Ti
(but TensorFlow was not compiled with CUDA support)
You can collect some of this information using our environment capture
script
You can also obtain the TensorFlow version with: 1. TF 1.0: python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" 2. TF 2.0: python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

Describe the current behavior
I convert my model from pytorch->onnx->tensorflow->tensorflow lite. And I would run on Edge TPU, thus my tensorflow version should be 1.15.0 as suggestion. However, due to lack of "split", and incorrect of "min and max". I rebuild from source based on the two links below.
https://github.com/tensorflow/tensorflow/commit/3c2be61e68acea533030b8f70fa0db3339b19f93
https://github.com/tensorflow/tensorflow/pull/32582/files?file-filters%5B%5D=.cc&file-filters%5B%5D=.h&file-filters%5B%5D=No+extension#diff-71a783b5a7624430897d44e42f816444
I use full-integer quantization, and all the conversion is successful. The tflite file works fine on interpreter. Input and Output datatype are tf.uint8 correctly. But almost every node in the model except input and output is tf.int8 (quantization).
Describe the expected behavior
I think these nodes should be tf.uint8. And I wonder that whether I could just load the tflite file via "JSON" format and change the model["subgraphs"][0]["tensors"]["type"] "INT8" to "UINT8".
This idea based on the link below.
https://towardsdatascience.com/hacking-google-coral-edge-tpu-motion-blur-and-lanczos-resize-9b60ebfaa552
Actually, it failed. I want to know the reasons.
Code to reproduce the issue

import tensorflow as tf
import torch
from PIL import Image
import numpy as np
import pathlib

#tf.compat.v1.enable_eager_execution()
#tf.logging.set_verbosity(tf.logging.DEBUG)

#import matplotlib.pyplot as plt
print(tf.__version__)
print(torch.__version__)

val = "./ILSVRC2012_img_val/"
val=pathlib.Path(val)
item=np.array([i.name for i in val.glob("*")])

image_generator = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255,data_format="channels_first")

train_data_gen = image_generator.flow_from_directory(directory=str(val),
                                                     batch_size=100,
                                                     shuffle=True,
                                                     target_size=(320,320),
                                                     classes = list(item))

image_batch, label_batch = next(train_data_gen)
image_batch=np.expand_dims(image_batch,1)

print(((image_batch).dtype))

image_batch, label_batch = next(train_data_gen)
mean=([0.485, 0.456, 0.406])
std=([0.229, 0.224, 0.225])
for i in range(3):
    image_batch[:,i,:,:]=(image_batch[:,i,:,:]-mean[i])/(std[i])
print(image_batch.shape)
image_batch=(np.expand_dims(image_batch,1))

def representative_data_gen():
    for i in range(100):
        yield [image_batch[i]]

graph_def_file = "test_320.pb"
inputs=['input.1']
outputs=['655']
converter = tf.lite.TFLiteConverter.from_frozen_graph(graph_def_file,inputs, outputs)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
#converter.inference_type=tf.uint8
converter.representative_dataset = representative_data_gen
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
converter.inference_input_type = tf.uint8
converter.inference_output_type = tf.uint8
#converter.experimental_new_quantizer= True
#converter.experimental_enable_mlir_converter = True
tflite_model_op= converter.convert()
open("cvted_model_320_quant_op.tflite", "wb").write(tflite_model_op)

Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
I tried compile with Edge TPU Compiler, and find out "unsupported data type". Then I use netron find that most of them are tf.int8.
Here is the Edge TPU compiler log, result of Netron and my model.
Edge TPU Compiler version 2.0.291256449

Model compiled successfully in 45 ms.

Input model: /home/xxxxx01/39dstest/cvted_model_320_quant_op.tflite
Input size: 6.28MiB
Output model: cvted_model_320_quant_op_edgetpu.tflite
Output size: 6.03MiB
On-chip memory available for caching model parameters: 0.00B
On-chip memory used for caching model parameters: 0.00B
Off-chip memory used for streaming uncached model parameters: 0.00B
Number of Edge TPU subgraphs: 0
Total number of operations: 7950
Operation log: cvted_model_320_quant_op_edgetpu.log

Model successfully compiled but not all operations are supported by the Edge TPU. A percentage of the model will instead run on the CPU, which is slower. If possible, consider updating your model to use only operations supported by the Edge TPU. For details, visit g.co/coral/model-reqs.
Number of operations that will run on Edge TPU: 0
Number of operations that will run on CPU: 7950

Operator                       Count      Status

SPLIT                          36         Operation is working on an unsupported data type
QUANTIZE                       3729       Operation is otherwise supported, but not mapped due to some unspecified limitation
MUL                            74         Operation is working on an unsupported data type
MAXIMUM                        38         Operation is working on an unsupported data type
MINIMUM                        38         Operation is working on an unsupported data type
ADD                            74         Operation is working on an unsupported data type
CONCATENATION                  56         Operation is working on an unsupported data type
PAD                            37         Operation is working on an unsupported data type
CONV_2D                        38         Operation is working on an unsupported data type
DEPTHWISE_CONV_2D              3680       Operation is working on an unsupported data type
TRANSPOSE                      148        Operation is working on an unsupported data type
MEAN                           1          Operation is working on an unsupported data type
FULLY_CONNECTED                1          Operation is working on an unsupported data type

Result of Netron

My model
test_320.zip
New to Github, Thx ><

So looks like the TFLite converter does the right job and you are asking for a good approach to post-processing all the nodes to uint8 for edge TPU execution? As far as I know, the current edge TPU runtime will automatically convert int8 activation to uint8, so you don't need to handle them by yourself.

Can you set both the converter.inference_input_type = tf.int8, converter.inference_output_type = tf.int8 and converter.inference_type=tf.int8 and then give it another try? I noticed the extra Quatize op is converting uint8 to int8. So if you set all all the inference types to int8, the nodes of the model will be in int8 and the edge tpu converter should be able to do the right job.

Hello I found the bug is hard to reproduce since it is required to rebuild tensorflow.
Can you attach the post-training quantized tflite model if possible? Thanks!

@liufengdb @nicci1771 Thanks for your reply.
Sure, here are all the tflite model with different inference input/output type.
https://drive.google.com/file/d/1cQ2vZ1pwyGh9__huOIXZFrxF_-_QgdMV/view
Yes, you got it. All the inference on cpu was fine. However, in edge TPU failed.
"the current edge TPU runtime will automatically convert int8 activation to uint8"
Did you mean Edge TPU runtime 13? I think edgetpu compiler maybe is another problem.
From their official website
"* These models do not compile properly with Edge TPU Compiler version 2.0.2xx (from our September update). You can instead use the previous compiler version and run them with the latest runtime."
Unfortunately, I don't know where to get older version.
And, I have tried your suggestions. I set the input/output type to tf.int8, but I cannot set "converter.inference_type=tf.int8". It said that it should be float32.
Does this error relate to my representative dataset?
Thanks a lot.

Hi There,
We are checking to see if you still need help on this, as you are using an older version of tensorflow which is officially considered end of life . We recommend that you upgrade to the latest 2.x version and let us know if the issue still persists in newer versions. Please open a new issue for any help you need against 2.x, and we will get you the right help.
This issue will be closed automatically 7 days from now. If you still need help with this issue, please provide us with more information.


Appearance dark does not seem to do anything.

Hello there. I have a basic setup with this theme, and I'm noticing that the specifying "dark" will not change the color scheme of the theme when building. I have the following _config.yml
title: nassredean nasseri
tagline: "| nasseri.io"
author:
  name: Nassredean Nasseri
email<EMAIL_ADDRESS>description: "the personal website of nassredean nasseri"
url: "https://nasseri.io"
baseurl: ""
exclude: [scripts/]
favicon: "favicon.png"
permalink: /:slug.html
theme: no-style-please
theme_config:
  appearance: "dark"
  back_home_text: ".." # customize text for homepage link in post layout
  date_format: "%Y-%m-%d" # customize how date is formatted
  show_description: false # show blog description in home page
timezone: America/New_York
plugins:
  - jekyll-sitemap
  - jekyll-feed

I observe that the <body> tag, is not being given an a attribute of any kind after running jekyll build. So it seems like, somehow this line <body a="{{ site.theme_config.appearance | default: "auto" }}"> in https://github.com/riggraz/no-style-please/blob/3432e31045f14ee57dedd1e0653c3d94d19eed01/_layouts/default.html is not working for me.
Is there anything else I need to do to get the dark theme applying correctly? Note that I have no _layouts, _includes, or _posts directory in my site. Not sure if that makes a difference.

hey, this happens to me too when I host the page locally through "jekyll serve" on my computer
but once I uploaded it to githubpages, it works correctly,
may be the "remote-theme" thing

hey, this happens to me too when I host the page locally through "jekyll serve" on my computer
but once I uploaded it to githubpages, it works correctly,
may be the "remote-theme" thing

Indeed this has been happening when using jekyll serve. I don't use githubpages, I just host my stuff in a public s3 bucket and then put a cloudfront distribution in front of it.
Strangely, when I first deployed, I was getting a mixed content warning trying to load the CSS file (despite it being served over http). Somehow this issue got resolved, then I made some change trying to fix the dark theme issue, and the mixed content warning came back. I hacked around it my just inlining the style in the _site directory and deploying that. Obviously not a great solution at all, but my site basically never changes so for that time being I'm just leaving it as is.

+1


fix: use pointer instead of reference of unique_ptr

The lifetime of unique_ptr itself (not DragAndDropWindowsPlugin's that unique_ptr has) is restricted to the parent scope.
When the delegate lambda is called, plugin references the freed unique_ptr and it causes crash.
This PR will replace that reference by unique_ptr::get, and use pointer to call MessageHandler.

Like this: https://github.com/flutter/plugins/blob/c48a5f87757ddfa08c863c1cbb899fe10e76f5ca/packages/camera/camera_windows/windows/camera_plugin.cpp#L203


[Bug]: Could not create the webpack TS Project

Contact Details
<EMAIL_ADDRESS>What happened?
When I click on the Create Dataverse TS Project option in the Dev Tools, it normally ask to create the name space and project type as Typescript only Or webpack. it is no longer working in current version.
I have used this fucntionality in the past in oldder versions and created the webpack TS Project.
What version of the tool are you using?
2.0.2
What version of Visual Studio Code are you running?
1.63.2
Relevant log output
No response

@Power-Maverick  FYI When I installed the version of 1.1.11, It works perfectly.

Thank you for reporting the issue. I will try to replicate the bug on my end and will report back.

Resolved in v2.0.3


Filter out posts, comments, and replies that the observer account has muted.

If a post/comment/reply is entered by a muted account:

It should not be included in the list of accounts that will trigger the browser notification.
It should not be displayed on the activity list page.

Maybe there can be a toggle to turn this filtering on or off, but it should default to off.

Tentatively implemented in branch: addObserverAccount.  Needs testing.

Ran into some initial problems, but testing looks good now.  Continuing to watch it.

This seems to be fixed in the addObserverAccount branch.  Merged into master so I can move on with comment/reply threads.

Reopening.  Some muted account activities are sneaking through.

Now fixed in filterMutedAccounts.  Testing before merging back into the mater branch.

Fixed again.


can not set recursion_limit in config with langserve

Checked other resources

[X] I added a very descriptive title to this issue.
[X] I searched the LangChain documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangChain rather than my code.

Example Code
I create a graph with langserve.
workflow = StateGraph(PlanExecute)
.... add the nodes and edges...
c =  workflow.compile()

.....
app = FastAPI(
    title="AI Agent Sever",
    version="0.2.9",
    description="AI Agent Sever"
)
add_routes(
    app,
    c,
    path="/pe"
)

when I use following request invoke. I found the "recursion_limit" parameter config not used.
{
    "input": {
        "transaction": "xxxxxxxx.",
        "conversation_id": ""
    },
    "config": {
        "configurable": {
            "recursion_limit": 2
        }
    }
}

Error Message and Stack Trace (if applicable)
No response
Description
I create a graph with langserve.
workflow = StateGraph(PlanExecute)
.... add the nodes and edges...
c =  workflow.compile()

.....
app = FastAPI(
    title="AI Agent Sever",
    version="0.2.9",
    description="AI Agent Sever"
)
add_routes(
    app,
    c,
    path="/pe"
)

when I use following request invoke. I found the "recursion_limit" parameter config not used.
{
    "input": {
        "transaction": "xxxxxxxx.",
        "conversation_id": ""
    },
    "config": {
        "configurable": {
            "recursion_limit": 2
        }
    }
}

System Info
System Information

OS:  Linux
OS Version:  #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar 12 10:22:43 UTC 2
Python Version:  3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]

Package Information

langchain_core: 0.1.43
langchain: 0.1.16
langchain_community: 0.0.33
langsmith: 0.1.31
langchain_openai: 0.1.3
langchain_text_splitters: 0.0.1
langchainhub: 0.1.15
langgraph: 0.0.37
langserve: 0.1.0

Seems this is resolved? Will mark as closed unless others run into this.


chore(main): release 0.37.0

:robot: I have created a release beep boop
0.37.0 (2024-12-28)
Features

Add code-lens action to view all mise settings (62248f1)
Improve settings editor (968da8d)
preserve webview state (1a69efb)
show all settings in settings view if none are modified (2c284de)
show source in settings view (e89d529)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

v0.37.0
:sunflower:


Improved and corrected some alt texts to improve accessibility

Hi, I checked the alt texts of the images in Introduction to Galaxy Analyses hands-on tutorial materials and I found out that some alt texts were not descriptive enough.
This defeats our goal of making the materials accessible to visually impaired users.
Out of the 9 tutorial materials, 5 materials needed the improvement which I have done.
I also corrected an error in status description image alt text of Introduction to Genomics and Galaxy tutorial: It read 'successful' instead of 'failed'.
What do you think?

I'm glad it was helpful.


Cannot build container

running

docker build --rm -f Dockerfile" -t docker-clamav:latest

will fail at step 9

COPY --chown=clamav:clamav eicar.com /

with the error:
COPY failed: stat /var/lib/docker/tmp/docker-builder403330422/eicar.com: no such file or directory
I have tried to look inside the image and there is no eicar file anywhere

Its because your local virus scanner has quarantined the file, most likely. The eicar.com file is committed to git, so you should be able to confirm this.


Fixed several small issues with package.py and upgraded version.properties to 37 (Summer ' 16)

Issues solved with package.py:

Dashboard types not generated when folder present.
.DS_Store elements were included on Mac
CustomMetadata now properly generated inside of CustomObject

Upgraded version.properties to 37

Thanks for the contribution, SalesforceRocks! I made a couple more changes after merging this pull request:
https://github.com/SalesforceFoundation/CumulusCI/commit/926e22be7f77efccbd0a27fabbe1f8d372d14cba
https://github.com/SalesforceFoundation/CumulusCI/commit/5981958688c16013e4207d44e0011c2ce5679393

Perfect @cpolcyn! Working on some CumulusCI implementations with a couple of Salesforce biggest partners. TBH I not always 'generalize' the changes I make when doing that ;-)


"setup.py install" has been deprecated in setuptools

from: https://github.com/spyder-ide/qtawesome/pull/199#issuecomment-1000848847
"setup.py install" has been deprecated in setuptools 58.3.0 (05 Nov 2021).
pypa/setuptools@fc5c308#diff-d9f946e5d366d670898f9cfaa80a8f892853686b6533a07c40ba9e9d4ee0e862
but, qtawesome imports setuptools.command.install in setup.py
https://github.com/spyder-ide/qtawesome/blob/a31fa284c6cd038c5fa9b36a1ca1a56358615585/setup.py#L6
Maybe, we need to consider about "setup.py install" and "setuptools.command.install".

I think the work done on QtPy could be useful as guide here: https://github.com/spyder-ide/qtpy/pull/272

Seems like there a deprecation warning appeared when building the package distribution (probably since I updated setuptools to release v1.2.2 or maybe it was happening before but I didn't see it):
SetuptoolsDeprecationWarning:     Installing 'qtawesome.fonts' as data is deprecated, please list it in `packages`.
    !!

    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'qtawesome.fonts' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'qtawesome.fonts' has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that 'qtawesome.fonts' is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.

More info about that at https://github.com/pypa/setuptools/issues/3340


Modify tour banlist to become scrollable

Right now, if you create a tour with a lot of bans or unbans, it will spam the chat.

They're all important, though...

Well, you can still see around 100 bans, and of course see them all if they're scrollable. Most banlists will be shorter, but for the few that are longer, people are unlikely to read them all anyway (As there will probably be some kind of special ruleset), but it'll make sure that the chat isn't spammed by the banlist.

...who uses more than 100 bans?
...I guess if you only allow a small list of Pokémon...

It doesn't happen often, but it'd help when it does happen. I don't see a negative effect either. Sometimes tours could have a specific rule that needs a lot of bans to happen successfully. (Think not allowing any status moves, only allowing status moves, having a Metronome-only tour, etc.)

@Snaquaza if that's the case I think having an option to just ban specific categories would be better. IE: having /tour ban status moves then the ban list just showing "status moves" would be better. And if you wanted some status moves un-banned it could say "Status moves - (whatever move)". Although that may be too much work.

unbanlist does exist for this reason...

Well, there isn't a format that has everything banned from the start, as far as I know.

I don't think this is important. Normally when people make tournaments with a ton banned/unbanned, the auth announces what the tour is, like "Only Pokemon with a BST of 300 or lower", and things similar to that.

@sirDonovan's #3437 seems to be the correct solution to this problem. I'm closing under the assumption that this is no longer necessary; feel free to reopen if you think this is still a problem.


RANGER-3161: Add ARM64 support in travis CI configuration

This change try to enable building and testing Ranger in ARM64 platform
in Travis CI configuration

https://github.com/apache/ranger/pull/98 (https://reviews.apache.org/r/73283/) provides more complete implementation for ARM64 build.

Thank you @martin-g ! let me drop this.


How to find a certain field?

I want to select the symbol is in strong buy rating

Finding the "Technical Rating" Column:
To access the "Technical Rating" data in your DataFrame, you'll need to do some additional steps beyond retrieving the raw data. Here's how:

Locate the Column: Use ctrl + f to search for the desired column in the file tradingview_screener/constants.py. In this case, the column is named Recommend.All.

Raw Data vs. Formatted Data: This package retrieves raw data directly from TradingView's API. The website then uses JavaScript to format the values for user readability.

Formatting the Data: You'll need to create a custom function to convert the raw rating values into human-readable strings like "Buy" or "Sell".

The raw data:
from tradingview_screener import Query

count, df = Query().select('Recommend.All').get_scanner_data()
print(df)

         ticker  Recommend.All
0      AMEX:SPY       0.466667
1   NASDAQ:TSLA       0.512121
2    NASDAQ:QQQ       0.466667
3   NASDAQ:NVDA       0.378788
4    NASDAQ:AMD       0.557576
..          ...            ...
45     NYSE:CRM       0.490909
46     NYSE:UNH       0.400000
47  NASDAQ:CRSP      -0.024242
48  NASDAQ:VCIT       0.354545
49     NYSE:BAC       0.557576

[50 rows x 2 columns]

And the data nicely formatted:
# define a function to format rating values
def format_technical_rating(rating: float) -> str:
    if rating >= 0.5:
        return 'Strong Buy'
    elif rating >= 0.1:
        return 'Buy'
    elif rating >= -0.1:
        return 'Neutral'
    elif rating >= -0.5:
        return 'Sell'
    else:
        return 'Strong Sell'

# apply the formatting function to the column
df['rating'] = df['Recommend.All'].apply(format_technical_rating)

print(df)

         ticker  Recommend.All      rating
0      AMEX:SPY       0.466667         Buy
1   NASDAQ:TSLA       0.512121  Strong Buy
2    NASDAQ:QQQ       0.466667         Buy
3   NASDAQ:NVDA       0.378788         Buy
4    NASDAQ:AMD       0.557576  Strong Buy
..          ...            ...         ...
45     NYSE:CRM       0.490909         Buy
46     NYSE:UNH       0.400000         Buy
47  NASDAQ:CRSP      -0.024242     Neutral
48  NASDAQ:VCIT       0.354545         Buy
49     NYSE:BAC       0.557576  Strong Buy

[50 rows x 3 columns]

And just like that we got the same data as in the website, now you can follow the same process for the Analyst Rating field.

As a side note, I don't intend to automatically format these values. This package is supposed to give the user the data in its raw format, which can be more useful in some cases.
However, I'm not against adding formatters for the most commonly used fields so users don't need to rewrite them from scratch each time.

But I don't want the rating of "Technical Rating", I want to find the rating of "Analyst Rating", like the rating in the stock forecast page

@jet-c-21 Yes I understand, follow the same process and you will find it. Its really easy.

@jet-c-21 Sorry I misunderstood your initial question.
I did some digging and I found the fields you are looking for:
cols = [
    'recommendation_over',
    'recommendation_total',
    'recommendation_sell',
    'recommendation_under',
    'recommendation_hold',
    'recommendation_mark',
    'recommendation_buy',
]

_, df = Query().select( *cols).set_tickers('NASDAQ:AAPL').get_scanner_data()
df.to_dict('records')

[{'ticker': 'NASDAQ:AAPL',
  'recommendation_over': 5,
  'recommendation_total': 44,
  'recommendation_sell': 2,
  'recommendation_under': 1,
  'recommendation_hold': 14,
  'recommendation_mark': 1.5,
  'recommendation_buy': 22}]

And you can use the formatter from above for the recommendation_mark column. cheers


Mapping ResourceIndex from Rust exactly analogous structure in Kotlin

At the moment, we extract path2id map from Rust and reconstruct new ResourceIndex from this collection.
It could be more performant to map all fields of Rust structure to Kotlin analogue.

Example: see how result of updateNative function is handled in Rust before being passed to Kotlin side.


Handoff to regular replication does not work?

Hey!
I have a remote db with 50,000 docs. When the user starts the webapp for the first time he has to download all docs, so I use pouchdb-load together with express-pouchdb-replication-stream to deliver the stream. The import works but after importing and then enable syncing, pouchdb makes 2000+ requests which takes several minutes. I guess it checks each document, so the proxy function does not work as intended. Here is my code:
http://pastebin.com/GciHNH8u
And here is the sync function:
http://pastebin.com/B2s65X9k

Found the error!
I had to add since: 'now' to my sync options!

That doesn't sound right. You shouldn't need to do that. I'm going to reopen this issue because it sounds like we have a regression.

I can't easily reproduce this. @nicozimmermann94 is the database that you're generating the dump from the same one you're syncing to (exactly the same URL)?

@willholley Yes it was the exact same URL.

@nicozimmermann94 I attempted to reproduce this using the code you posted and a local CouchDB 1.6.1 instance (via the proxy you posted). I still don't see a problem with handoff. Are you able to share a HAR / network trace of the issue occurring?

Yes exactly the same setup for me and adding since: 'now' fixed it for me too.

Just went through this; what seems to happen is that it has to write the remote checkpoint for every change, so when loading 50K documents it has to make tens of thousands of requests. It's all just requests to _local/[random id] and _changes.
It's not actually trying to do redo any documents/changes, just writing the remote checkpoint thousands of times. Seems like this could be solved by only putting the latest checkpoint once and stopping there, instead of starting from scratching and adding checkpoints one by one. I figured that's what proxy would do.
The since option does it, and instead of "now" I used remote_db.info() to get the remote update_seq and use that as the value for since (because my dumps are not live, and may be slightly out of date by the time a user goes to import them).
That is a perfect workaround for me, but it seems like proxy could handle it by itself. If this is something @nolanlawson is interested in resolving, I'd love a chance to go in, sort it out, and come up with a PR for it.

@BrunoDeBarros a checkpoint for every change sounds wrong - the since value should ensure those existing documents are skipped when the replication starts. If it's re-comparing the documents that pouchdb-load inserted, that implies the checkpoint used to create the dump isn't valid for the remote database. This is certainly possible - sequence values are unique to a database instance so this kind of thing could happen if the dump was created using different parameters / source databases to the one you're ultimately syncing against.
What environment are you syncing against and how are you initiating the load/sync?

If you add the since, the problem goes away; that works as expected. It's just that without it, it does trigger the remote checkpoints, as it did for the two other people in this issue. PouchDB is not re-comparing any documents.
It's just that without the since, with just proxy, it does the remote checkpointing for every document. @nolanlawson said that that seemed wrong, so I figured I'd throw in my 2 cents and offer to help.

Having said that, here's the requested info:
To create the dump, I just pouchdb-dump https://couchdb.example.com/my_db > dump.txt. The server is a CouchDB 2.0.0 instance.
To load it on the browser, I just do:
db = new PouchDB('my_db');
db.load("https://example.com/dump.txt", {proxy: "https://couchdb.example.com/my_db"})

The CouchDB server itself is hidden behind nginx, following these instructions. _changes

thanks @BrunoDeBarros. So it's possible that the checkpoint being written to CouchDB is incorrect / not being picked up. The other point to make is that the handoff only valid for remote -> local replication, so if local -> remote replication is initiated (or db.sync is used) then all the local documents will need to be compared with the remote.

In my code I do db.sync(remote), not remote.sync(db), so after reading your message, I swapped them around to see if it'd work, and I'm afraid the issue is still there.
If this doesn't seem worth chasing, it doesn't matter; the since option resolves it. But it does seem odd that it's not being picked up correctly. The DB hasn't been wiped since the dump was generated, so there doesn't seem to be any reason for things not to match up. When I have a bit of free time I'm going to try and look into this, just to see if I can pin down the why or if it's something wrong on my end.

@BrunoDeBarros the issue is sync vs replicate. Sync is essentially shorthand for local.replicate.to(remote); and local.replicate.from(remote). Replication is inherently uni-directional, so sync requires independent local -> remote and remote -> local replications in parallel. pouchdb-load only provides handoff for the remote -> local component, so you need to explicitly provide a since value to the local -> remote replication in order to skip comparison of all the local documents with the remote.

That makes perfect sense, and also explains why myself and the other posters were having problems; we're all doing sync (OP says they're doing sync and even includes source code) and stumbled across this. Regarding local.replicate.from(remote) though, it's important to note that that is explicitly mentioned as being OK in the documentation.
Thanks for helping figure out what's going on though! 👍  Seems like this is just a matter of updating the documentation then, since it doesn't mention anything but proxy, and anyone trying to do sync would be bit by this.

If I use the since parameter in local -> remote, none of my changes on local get synced anymore. It only does it the comparison went through. I tried now and the lastUpdateSeq from the remote_db.info(). Is it relevant if stated local.replicate.to(remote) or remote.replicate.from(local)?

Ok, I found two issues:

the filter of the pouchdb load wasn't the exact same as in the remote->local operation. After that, the handover worked
the local->remote operation wasn't working with the remote last_update_seq, it uses the local last_update_seq to work. So I have to remember local last_update_seq after the pouchdb load and apply it as since param for every local->remote update. btw 'now' can't work, since it wouldn't pick up your latest local change that isn't synced to the remote, it just seems to work.

suggestion: the pouchdb load should also write the local->remote checkpoint if the proxy option is specified (or even a separate option)


03-components: Explain tab nav scrolling. Fixes #50.

Add at least some explanation of why you have to login 15 different times while we're at it.

The additional note about repetitive logins is one of two minimal updates addressing but not ~fixing #33 item 1


Creating a Contact Page with Python Django

Hi, apologies upfront if the question appears to be silly.
I understand it is a one-page template, yet I would like to ask whether you are able to add links to that would direct user to other pages, for example the Contact Page ?
Thank you.
P.S. I am using Python Django backend framework.

Yes you can add other pages. The best way to do this would probably to be using the menu bar as a component, and then linking out other pages using that. The menu bar, footer, and CSS/JS should remain consistent across all pages, but other pages you can modify as you please!


Add support for Ressource Accounting via systemd

Depends on https://github.com/camptocamp/puppet-systemd/pull/66

Depends on https://github.com/camptocamp/puppet-systemd/pull/67

#67 was merged, so  you can refactor this one.

@raphink rebased it.

Could you also fix the typo in the title of this PR? :)

I think I fixed it :D

With this enhancement, the module is working great for me. Any thoughts about cutting a new release or moving it to voxpupuli?


chore: replace ci with github actions using lerna

I just attempted lerna bootstrap --ci locally and got a failure due to package.json and package-lock.json out of sync in one of the packages (one of the benefits of using npm ci is to catch this state). I will look into the issue and we can merge this and watch it fail like it should. I can fix the issue in a follow up.

Updated to use recommendation from lerna FAQ to get us going. Also removed lower level package-locks as lerna manages all packages in the root package-lock when hoisting.


Grab Hardware Info

Can i grab the hardware info, example : IP and mac address ?
with using this library

You don't need a library at all for that, just go to this URL: http://{ip}:8001/api/v2/


Inconsistent and confusing behavior with with-redefs

lein spec and lein spec -a treat the following differently; the test fails in the former, and passes in the latter.
(ns myapp.test
  (:require [speclj.core :refer :all]))

(def db "database-a")

(with-redefs [db "database-b"]
  (describe "db"
    (it "should be called database-b"
      (should= db "database-b"))))

In general, we find that running lein spec requires with-redefs to be specified within it blocks (and lein spec -a doesn't), making it harder to mock out e.g. a database connection for a whole set of tests.  Can this be improved somehow?

Usually I've used around for this, something like
(ns myapp.test
  (:require [speclj.core :refer :all]))

(def db "database-a")

(describe "db"
  (around [it] (with-redefs [db "database-b"]))

  (it "should be called database-b"
    (should= db "database-b")))

Not sure why the difference between lein spec -a and lein spec, or if this gets rid of the problem completely, but that's at least a workaround in case you're not familiar with around.

I wonder if this could have to do with Speclj internally requiring a different version of Clojure when run with the vigilant runner than with the standard, so that, when lein spec is run, certain forms do nothing when rebound with with-redefs and require binding instead.

@trptcolin thanks for the suggestion.  That works; however, the following does not:
(ns myapp.test
  (:require [myapp.test :refer :all]
            [speclj.core :refer :all]))

(def db "database-a")

(defmacro describe-with-db [text & body]
  `(describe ~text
     (around [it] (with-redefs [db "database-b"] (it)))
     ~@body))

(describe-with-db "db"
  (it "should be called database-b"
    (should= db "database-b")))

Throws
1) java.lang.RuntimeException: Can't use qualified name as parameter: speclj.core/it, compiling:(myapp/test.clj:20:1) [...]

-- this more closely matches what we want to do (dry out DB mocking to use an in-memory test DB rather than a "real" one).
Any suggestions (I know you know one or two things about macros AND speclj :-) )?  Thanks in advance!

@eigenhombre I believe this is solved by changing db in your with-redefs with #'db (which is short-hand for (var-get db)).

@sdegutis  It's complaining about it, not db ... it looks like one of the macros is expanding into (let [it ...] ...) which wants a gensym inside the (remaining) macro.

@eigenhombre Yep! it -> it# (auto-gensym), as below:
(ns myapp.test
  (:require [myapp.test :refer :all]
            [speclj.core :refer :all]))

(def db "database-a")

(defmacro describe-with-db [text & body]
  `(describe ~text
     (around [it#] (with-redefs [db "database-b"] (it#)))
     ~@body))

(describe-with-db "db"
  (it "should be called database-b"
    (should= db "database-b")))

Does that do the trick for you?

@trptcolin works for our minimal test case -- trying it in our app.  I also called it foo# instead of it# and that also worked.  So I guess the name is just a temporarily alias for all the forms in the body?

Yep, inside around, it (or whatever you name it) is just a function that represents all the tests to be executed inside that describe/context.

@trptcolin We're unblocked -- that worked for us.  I guess there's still the open question of why this is only needed with lein spec and not lein spec -a -- anyways, thanks for the help!

I'm running into the same issue. It seems to be a difference between the standard runner and the vigilant runner.
Using around works, but I'm also curious why the runners are treating with-redefs differently.


Move disclaimer under list of restaurants

I thing that would be better to move it to a separate page (something like terms of service / podmínky služby). Link to the page may be located in the footer of the main page.

Terms were moved to a separate page.


Implement HOG as a neural network

Written my pseudo code. Now beginning Implementation.

This is going to take longer than expected. For backpropagation to work, everything must be done through tensor operations (who knew!).

See 243cc1cd98afe26224c025579bb7f3bd92706ae1

Performance has gotten worse for some reason, trying to fix.


[bug] Erratic ghost element position animation during drag with substantial amount of elements

When dragging an element in a Sortable grid container with a considerable number of other elements, the starting position for the ghost element's animation is not updated correctly, resulting in the occasional erratic behavior visible in the video below, where it can be seen flickering and jumping from previous path positions. forceFallback: true seems to somewhat alleviate the problem but only slightly.
This issue is reproducible in this Codepen.
https://user-images.githubusercontent.com/22925356/198093907-387d3a17-afc3-4fa0-8d33-7b7194126010.mov
Versions
sortablejs = ^1.15.0
@types/sortablejs = ^1.13.0
Chrome v106

I am having the same problem as well! forceFallback does help a bit, but glitching still occurs


Update getup to use filtered sensors

This PR updates the getup to use filtered sensors and increases the number of last sensors used in the average.
Fixes:

The getup being executed while walking due to noisy raw sensors
The getup being executed before the robot hits the ground (by increasing the number of last sensors msgs used)

Potential improvements:

Use the actual time since fallen to execute getup rather then the average of last X msg's

Have you checked if the old odometry method works? Since pitch and roll are fine, it would be much better to use odometry than raw sensors.

Good point, I for some reason assumed the sensors.accelerometer was filtered...
Will investigate with Htw.

I think we want a small delay after it detects it's fallen before it executes getup, just enough so that it doesn't try to start before it's even hit the ground and to let it settle into a stable state.
We could potentially increase the fallen angle to help with this as well.

I think we want a small delay after it detects it's fallen before it executes getup, just enough so that it doesn't try to start before it's even hit the ground and to let it settle into a stable state.
We could potentially increase the fallen angle to help with this as well.

Yeah fallen angle would help, but also the get up scripts usually have a long initial frame. If we had an angular velocity measurement for the robot we could use that.

The recent change looks much better. How does it go in webots?

Works fine in webots.

Have you tested on the robot? Also probably fix up your PR description.


Rename and pool again

I wonder if we should add a with conn.cursor() as curs everywhere.

Good point, done :)


Learn open breaks if Atom is already open

this is no longer an issue (or at least not the same issue) with > 2.0


nodemailer: Add support to pass transport as string

Currently, the nodemailer's transport option only takes the transport module directly. However, it could prove difficult when using env-specific config overrides as I am not sure how the property will be merged. It might be better to allow users to specify the name of the module to require() and let the service require it.

Implemented via 4fd1b4ad49c8008e192e5045fa216971aa776bb0. 🎉


Update package.json to reference italia

We moved swagger-ui to /italia. Update references accordingly

Duplicate of #4.


C++ Support doesn't work

Problem
When trying to use Zephyr with C++ I noticed that a lot of the headers contain code that isn't valid in C++ and causes compile errors when included in C++ files. I noticed this mainly with the Bluetooth subsystem but I wouldn't be surprised if other parts of are affected too as I haven't tested them.
So even though my examples focus on Bluetooth this issue concerns Zephyr as a whole.
The documentation claims that Zephyr has C++ support, but at the moment not even the most basic things work.
After asking on IRC about this @SebastianBoe confirmed those problems and submitted PR #5642 with some small fixes. While that was a first step in the right direction a lot more has to be done still.
As far as I know there are absolutely no automated tests in Zephyr for C++ compatibility at the moment. I would suggest changing that to properly ensure C++ compatibility in the future. If possible maybe just reuse/adopt existing C tests and additionally compile them in C++.
Solution

Fix any headers that contain invalid C++ code to be valid in both C and C++.
Add automated tests for C++ compatibility

Minimal Example
#include <zephyr.h>

#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/conn.h>
#include <bluetooth/uuid.h>
#include <bluetooth/gatt.h>

static const struct bt_data ad[] = {
    BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR))
};

void on_bt_ready(int err) {
    bl_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), NULL, NULL);
}

int main() {
    bt_enable(on_bt_ready);
}

The following configuration was used in prj.conf:
CONFIG_CPLUSPLUS=y
CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_DEVICE_NAME="Test beacon"

Built with the current master branch of zephyr and zephyr-sdk-0.9.2 for the nrf52 platform using the following commands:
mkdir build && cd build
cmake -DBOARD=nrf52_pca10040 ..
make

This minimal example will generate the following errors:
In file included from /home/zigarrre/coding/zephyr_test/src/test.cpp:3:0:
/home/zigarrre/coding/zephyr_test/src/test.cpp: In function ‘void on_bt_ready(int)’:
/home/zigarrre/coding/z/zephyr/include/bluetooth/bluetooth.h:149:4: error: taking address of temporary [-fpermissive]
    })
    ^
/home/zigarrre/coding/z/zephyr/include/bluetooth/bluetooth.h:151:24: note: in expansion of macro ‘BT_LE_ADV_PARAM’
 #define BT_LE_ADV_CONN BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, \
                        ^~~~~~~~~~~~~~~
/home/zigarrre/coding/zephyr_test/src/test.cpp:14:21: note: in expansion of macro ‘BT_LE_ADV_CONN’
     bl_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), NULL, NULL);
                     ^~~~~~~~~~~~~~
In file included from /home/zigarrre/coding/z/zephyr/include/kernel.h:27:0,
                 from /home/zigarrre/coding/z/zephyr/include/zephyr.h:18,
                 from /home/zigarrre/coding/zephyr_test/src/test.cpp:1:
/home/zigarrre/coding/z/zephyr/include/misc/util.h:42:35: error: ‘__builtin_types_compatible_p’ was not declared in this scope
            __typeof__(&(array)[0])))
                                   ^
/home/zigarrre/coding/z/zephyr/include/misc/util.h:34:66: note: in definition of macro ‘ZERO_OR_COMPILE_ERROR’
 #define ZERO_OR_COMPILE_ERROR(cond) ((int) sizeof(char[1 - 2 * !(cond)]) - 1)
                                                                  ^~~~
/home/zigarrre/coding/z/zephyr/include/misc/util.h:48:20: note: in expansion of macro ‘IS_ARRAY’
  ((unsigned long) (IS_ARRAY(array) + \
                    ^~~~~~~~
/home/zigarrre/coding/zephyr_test/src/test.cpp:14:41: note: in expansion of macro ‘ARRAY_SIZE’
     bl_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), NULL, NULL);
                                         ^~~~~~~~~~
/home/zigarrre/coding/z/zephyr/include/misc/util.h:34:51: error: expected primary-expression before ‘char’
 #define ZERO_OR_COMPILE_ERROR(cond) ((int) sizeof(char[1 - 2 * !(cond)]) - 1)
                                                   ^
/home/zigarrre/coding/z/zephyr/include/misc/util.h:40:2: note: in expansion of macro ‘ZERO_OR_COMPILE_ERROR’
  ZERO_OR_COMPILE_ERROR( \
  ^~~~~~~~~~~~~~~~~~~~~
/home/zigarrre/coding/z/zephyr/include/misc/util.h:48:20: note: in expansion of macro ‘IS_ARRAY’
  ((unsigned long) (IS_ARRAY(array) + \
                    ^~~~~~~~
/home/zigarrre/coding/zephyr_test/src/test.cpp:14:41: note: in expansion of macro ‘ARRAY_SIZE’
     bl_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), NULL, NULL);
                                         ^~~~~~~~~~
/home/zigarrre/coding/z/zephyr/include/misc/util.h:34:51: error: expected ‘)’ before ‘char’
 #define ZERO_OR_COMPILE_ERROR(cond) ((int) sizeof(char[1 - 2 * !(cond)]) - 1)
                                                   ^
/home/zigarrre/coding/z/zephyr/include/misc/util.h:40:2: note: in expansion of macro ‘ZERO_OR_COMPILE_ERROR’
  ZERO_OR_COMPILE_ERROR( \
  ^~~~~~~~~~~~~~~~~~~~~
/home/zigarrre/coding/z/zephyr/include/misc/util.h:48:20: note: in expansion of macro ‘IS_ARRAY’
  ((unsigned long) (IS_ARRAY(array) + \
                    ^~~~~~~~
/home/zigarrre/coding/zephyr_test/src/test.cpp:14:41: note: in expansion of macro ‘ARRAY_SIZE’
     bl_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), NULL, NULL);
                                         ^~~~~~~~~~
/home/zigarrre/coding/zephyr_test/src/test.cpp:14:68: error: expected ‘)’ before ‘;’ token
     bl_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), NULL, NULL);
                                                                    ^
/home/zigarrre/coding/zephyr_test/src/test.cpp:14:68: error: expected ‘)’ before ‘;’ token
/home/zigarrre/coding/zephyr_test/src/test.cpp:14:68: error: expected ‘)’ before ‘;’ token
/home/zigarrre/coding/zephyr_test/src/test.cpp: In function ‘int main()’:
/home/zigarrre/coding/zephyr_test/src/test.cpp:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
make[2]: *** [CMakeFiles/app.dir/build.make:303: CMakeFiles/app.dir/src/test.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:228: CMakeFiles/app.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Full Examples
For additional, more complete code samples just use the various (Bluetooth) examples that Zephyr already provides and compile them as C++ by changing the extensions of the files as well as in the CMakeFiles.txt to .cpp.
I would suggest starting with bluetooth/beacon which is the most simple example and working our way up from there to more complex examples.

Note that you don't need to use the BT_MESH_ADV_CONN macro if you don't want to. Creating a "normal" struct bt_mesh_adv_param stack variable and passing a reference to that to bt_mesh_adv_start() should make a C++ compiler happy.

As I was trying to port my freeRTOS C++ applications, I'm sad this has stagnated and that I won't be able to use the full functionality/abstraction zephyr has to offer.
Given issues like this still exist, I think it's only fair to ATLEAST put a caveat in the documentation, which seems to sell zephyr as conveniently c++ compatible, or just remove the claim completely.

Much of this has been addressed in the past 18 months.  As soon as #18243, #18245, and #18242 are merged Zephyr should be pretty compatible with C++.

Per above comment  #18243, #18245, and #18242 are closed so we'll call this done.

Nope, sorry.  This references Bluetooth specifically so #18551 blocks it.


Support for EPUB3 navigator.epubReadingSystem

This should be implemented in navigator, but app should be able to specify the actual contents of the injected navigator.epubReadingSystem object.
http://www.idpf.org/epub/31/spec/epub-contentdocs.html#app-epubReadingSystem

Test EPUB:
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/epubReadingSystem.epub

NAME and VERSION are the most important fields.
Readium1 generates additional versioning information (not a standard feature, specific to the reading system):
https://readium.firebaseapp.com/?epub=epub_content%2FepubReadingSystem

Please merge this PR ( https://github.com/edrlab/readium-desktop/pull/129 ) to update to the latest r2-xxx-js packages and correctly synchronize other dependencies.
The navigator API that allows the host app to specify the navigator.epubReadingSystem name + version information works in exactly the same way as the ReadiumCSS one, i.e. using a "pull" pattern via a "getter" function (see setReadiumCssJsonGetter()) which will be invoked by the underlying Electron/WebView/preload.js code, at the appropriate time.
Code example:
import { setEpubReadingSystemJsonGetter } from "@r2-navigator-js/electron/renderer/index";
import { INameVersion } from "@r2-navigator-js/electron/renderer/webview/epubReadingSystem";

const getEpubReadingSystem: () => INameVersion = () => {
    return { name: "Readium2 Electron/NodeJS desktop app", version: "1.0.0-alpha2" };
};
setEpubReadingSystemJsonGetter(getEpubReadingSystem);

If I may, a quick question: will docs provide guidance on setting name/version?
A lot of Readium1-based apps are indeed sharing the same name, which completely defeats the purpose of the object: implementations sometimes varying greatly, it becomes kind of useless for a lot of use cases where sniffing the epubReadingSystem is the last resort.

@JayPanoz see https://github.com/readium/readium-2/issues/67


IPAddress::toString() needed

Hello Brian, could you please add this patch to IPAddress
I need this in order to enhance my tests around EspMock / TinyMqtt
Best regards
diff --git a/cores/epoxy/IPAddress.cpp b/cores/epoxy/IPAddress.cpp
index a7df382..3e835d6 100644
--- a/cores/epoxy/IPAddress.cpp
+++ b/cores/epoxy/IPAddress.cpp
@@ -114,3 +114,17 @@ size_t IPAddress::printTo(Print& p) const
     n += p.print(_address.bytes[3], DEC);
     return n;
 }
+
+String IPAddress::toString() const
+{
+    String s;
+
+    size_t n = 0;
+    for (int i =0; i < 3; i++)
+    {
+        s += String(_address.bytes[i]);
+        s += '.';
+    }
+    s += String(_address.bytes[3]);
+    return s;
+}
diff --git a/cores/epoxy/IPAddress.h b/cores/epoxy/IPAddress.h
index 2c0c1b6..5e1e504 100644
--- a/cores/epoxy/IPAddress.h
+++ b/cores/epoxy/IPAddress.h
@@ -67,6 +67,7 @@ public:
     IPAddress& operator=(uint32_t address);

     virtual size_t printTo(Print& p) const;
+    String toString() const;
 };

 const IPAddress INADDR_NONE(0,0,0,0);

As far as I can tell, IPAddress::toString() is defined only for ESP8266 and ESP32. So I guarded the method around a #if defined(EPOXY_CORE_ESP8266) so that it is available when EPOXY_CORE := EPOXY_CORE_ESP8266 is defined in the Makefile.
Added some tests to validate.
If you need this on AVR, STM32, and other non-ESP platforms, you can use the printTo(Print&) function into the PrintStr<N> class from my AceCommon library. See the IPAddressTest.ino file for an example).

Thanks a lot Brian


Only attempt vc operations on packages with avaliable repos, fixes #110

In straight--select-package add a new parameter repo-present which filters recipes by whether they have an available repository.
User vc operations (e.g. straight-pull-package) have been modified to filter for package with available repositories when using straight--select-package.
Only map over recipes with available repos in straight--map-repos.

This breaks straight-freeze-versions by causing the revisions of packages which are registered but not currently installed to be silently dropped.


door can switch to closing while opening

While opening, door might switch from opening to closing in home app before completion of operation

reopen since the issue is still there if you close / open the home app after opening the door (it switches to closing), in 1.0


Problem running in browser

I copied the ReadMe for running in the browser, and below is the code in  my .js file:
kuroshiro.init(new KuromojiAnalyzer({ dictPath: "/dict" }))     .then(function () {         return kuroshiro.convert("手を繋ご", { to: "hiragana" });     })     .then(function(result){         console.log(result);     })
I've imported the .min.js file
	<script src="kuroshiro.min.js"></script>
It works with Node.JS, but I can't seem to have it working via the browser version of it. var kuroshiro = new Kuroshiro(); works but I it returns "Uncaught ReferenceError: KuromojiAnalyzer is not defined" on the browser when I try to initiate. Is this related to the browser spec under "test".

Hello keldenl, thanks for feedback. You should go for kuroshiro-analyzer-kuromoji, build it and get the dist file KuromojiAnalyzer.min.js, then import it into your project. And now everything should be ok. Try it and  feel free to contact me later if you have other questions. And I'll later update READMEs to make the procedure clear.

Hello @keldenl . I have updated kuroshiro and several analyzers. The document of kuroshiro has been revised. Please notice that, from the new version (1.1.0) of kuroshiro-analyzer-kuromoji, the dist file is renamed to kuroshiro-analyzer-kuromoji.min.js.

I see. Thank you so much! Things are fixed. Another question though, I seem to be able to run this in a local server (via http-server), but it doesn't work when I upload it online (there's an error when initializing the dict in kuromoji-analyzer, it can't read the dict files – Uncaught Error: invalid file signature:1,1 at $.g (kuroshiro-analyzer-kuromoji.js:9225) at XMLHttpRequest.xhr.onload (kuroshiro-analyzer-kuromoji.js:7700), and this happens around 20-30 times in a row)

Just a note to others that might waste 3 days on this like I did: I had to copy the dat files in the kuromoji dict folder to my React app public folder, then configured the analyzer to point to the files relative to the homepage URL:
  const kuroshiro = new Kuroshiro();
  const analyzer = new KuromojiAnalyzer({
    dictPath: "/data/ja-dict"
  });

I also posted this in an issue of the kuroshiro-analyzer-kuromoji since it's related to that plugin, but since this question seems to pop up here a lot I'll post it here too.
I am using Next.js, which can serve static files only from a specific directory /static. the /dict directory of the Kuromoji analyzer is outside the /static directory by default (/node_modules/kuromoji/dict), which results in the following console error:
GET http://localhost:3000/node_modules/kuromoji/dict/base.dat.gz 404 (Not Found)
(the same error is repeated for every other file in the /dict directory)
I solved this issue by copying the /dict directory from /node_modules/kuromoji, pasting it inside the /static directory of my project and specifying the new dictPath like this.
const analyzer = new KuromojiAnalyzer({
dictPath: '/static/dict/',
});
This way the browser can server the files correctly.
This doesn't feel like a good solution though. It would be nice to have this fixed so it works out of the box.

@RobertB4 I think it does work out of the box. The manual (or automatic, if you script it) copying files to a statically served area of the site is a good idea. I think the kuromoji dat files total ~18mb, so best is to manage them outside the app codebase (if it is a client-side app) and to serve them statically with longer cache expiry dates from the server to reduce users needing to download them again or frequently.
Alternatively, I've also created a simple express API app that performs the translation, since I had to also translate from chinese to latin characters using the pinyin library.

Hi, I have some issue...
I'm testing kuroshiro using https://npm.runkit.com/kuroshiro/lib/core.js?t=1552138294313
and it returns an error on the convert...
this is my code:
var Kuroshiro = require("kuroshiro")
var KuroshiroAnalyzer = require("kuroshiro-analyzer-kuromoji")
const kuroshiro = new Kuroshiro();

kuroshiro.init(new KuroshiroAnalyzer());

//console.log(Kuroshiro.Util.isHiragana('た'));
const result = await kuroshiro.convert("感じ取れたら手を繋ごう、重なるのは人生のライン and レミリア最高！", {mode:"furigana", to:"hiragana"});

The following solved for me in a Vue project.
const kuroshiro = new Kuroshiro.default();

im trying to use kursohiro on my browser but it seem to work only on one page. and on the other page i get the error /distfile/dict/tid.dat.gz 404 (Not Found). even i copied the dict file from kuromoji inside node_modules. this thing is not finding it. i put dict file inside this distfile like this.
let kuroshiro = new Kuroshiro();
kuroshiro.init(new KuromojiAnalyzer({
dictPath: 'distfile/dict/',
}));
please can anyone help im not undestanding how kuroshiro library actually works on the browser . im encountering many problem not only this.


Best way to use a finetuned/customised LM for downstream task e.g. sequence classification?

Hi,
Starting from pretrained GPT2 hf_model, I finetuned a custom LM using unlabelled dataset, using the model_cls = AutoModelForCausalLM method, and have saved/exported the resulting Learner object (let's call that finetuned_LM_learn).
What is the best way for me to then load that finetuned LM, and use it for downstream task (e.g. sequence classification) on labelled dataset? Should I just go through the same steps here, and then switch out the base_model before starting to train? Something like below?
learn.model.hf_model.base_model = finetuned_LM_learn.model.hf_model.base_model
learn.fit_one_cycle(epoch, lr)

Or is that not the correct / best way? Thanks.

Ok I think I should be using finetuned_LM_learn.hf_model.save_pretrained(path) and then for downstream classification task do AutoModelForSequenceClassification.from_pretrained(path) instead. Please do correct me if I am wrong.. Thank you.

Yup. That is correct.
Just use the transformer model's save_pretrained to the path you want to save your HF artifacts in (you should do the same with the tokenizer) and the use as you are above.


conflict in generated code if imported in multiple projects

im unable to use Mediator.SourceGenerator in project, that is referencing different project which is already using Mediator.SourceGenerator - second project will throw at me this message: (CS0436)
Error	CS0436	The type 'MediatorDependencyInjectionExtensions' in 'Mediator.SourceGenerator.Roslyn40\Mediator.SourceGenerator.IncrementalMediatorGenerator\Mediator.g.cs' conflicts with the imported type 'MediatorDependencyInjectionExtensions' in 'ProjectA'. Using the type defined in 'Mediator.SourceGenerator.Roslyn40\Mediator.SourceGenerator.IncrementalMediatorGenerator\Mediator.g.cs'.
(technically it is 'only' warning, but i have TreatWarningsAsErrors enabled and therefore my build fails... )
affected types:
Mediator.MediatorOptions
Mediator.MediatorOptionsAttribute
Microsoft.Extensions.DependencyInjection.MediatorDependencyInjectionExtensions

ideas how to fix this:

move Mediator.MediatorOptions and Mediator.MediatorOptionsAttribute to Mediator.Abstractions package
- they looks like they do not need to be generated
generate MediatorDependencyInjectionExtensions in namespace defined by MediatorOptions:Namespace property
- this way i can use multiple generated AddMediator() methods

-or-
make all 3 affected classes internal
- this will force to call AddMediator method from within project, that generated it but is simple fix

Thanks for reporting! To understand the usecase more, why is this dependency there? Are there two DI containers? one in each project? or can ProjectA run both independently and as part of the failing project (so that there is only one DI container)?
My initial feeling is that your second suggestion is the most appropriate in this case, but I'd like to understand the whole context. I never considered that there could be 2 projects having separate Mediator implementations in the same output binary basically.

hello, sorry for late reply
im experimenting with onion architecture / domain driven developement so my project structure is probably wrong ...
im using single DI provided by asp.net core.
my host project is basically program.cs from aspnet core minimal api template; modules are registered here
plan is to have separate modules, that can be enabled in host in random order
each module is using mediator internaly for CQRS and exporting extension methods to register itself in host project
module may be dependent on another module domain / use internal parts of that module
PS: now im also with te idea of making mediator classses internal - theyere implementation details after all ...

Hi. I think I have a related question, apologies if this isn't connected to this issue.
I am wanting to know how to use Mediator where multiple projects (separate assemblies) have Mediator handlers. Currently, it looks like there can be multiple "Mediator"s, there can only be one IMediator. Originally this wasn't a problem because I had all my handlers in the same project, but this has become cumbersome as the number of handlers and their interdependencies has grown.
Please let me know if there is a straightforward way of achieving what I am describing. There is a good possibility that I've made a mistake with my project setup. The rest of this message only relates to the scenario where what I am trying to do isn't currently possible.
To explain the situation better, here is a simplified project layout I am working with:
Assembly1: ServiceGroupA (containing handlers)
Assembly2: ServiceGroupB (containing handlers)
Assembly3: Models
Assembly4: Program (an executable of some type)
ServiceGroupA and ServiceGroupB depend on "Models"; but each has 99% of its classes marked as internal.  No project dependency is allowed between ServiceGroupA and ServiceGroupB.
Program creates a service container including services both ServiceGroupA and ServiceGroupB (using a public extension method in each "AddServiceGroup[A|B]")
Program wants to do Mediator.Send(some IRequest type from "Models") and sometimes (rarely) one of the ServiceGroups will want to send a message to one another via the Mediator.  In either case, this should work out which ServiceGroup to send the request to.
However, I see now that only one IMediator is registered, so there is only one Send and any messages sent to the second Service Group's handlers will respond with MissingMessageHandlerException.
I'd have expected that all mediators are registered in their own namespaces (implementing ISender).  Then the global IMediator implementation would send by looping over each Sender. Only if all of the sub-mediators failed to send would a MissingMessageHandlerException be thrown. I'd probably agree with CzBuCHi that MediatorOptions doesn't need to be generated.
Note: I am using 2.0.29.

So the SourceGenerator package is what is generating the options class, the DI extension method and the mediator implementation itself. It was meant to be used in the outermost package, typically where you use the generic host or ASP.NET Core to construct the runtime, DI container etc.
To create queries, commands, requests and their handlers you only have to reference the abstractions package. So in the dependency graph from single output binary project (console, web, backgroundservice etc) there should only be 1 PackageReference and it should be at the outermost level (project file for the console, web or backgroundservice), everywhere else you should only need the abstractions package.
This is how I've designet it so far, and I am using this in clean/onion architecture setups at work as well. On to your examples
From @CzBuCHi

each module is using mediator internaly for CQRS and exporting extension methods to register itself in host project
module may be dependent on another module domain / use internal parts of that module

As far as I can understand this should be fine, the module projects just depend on the abstractions package and inject IMediator or similar where necessary. The host project references the sourcegenerator and from there it will handle messages and their handles across modules.
From @michaeljfarr

To explain the situation better, here is a simplified project layout I am working with:
Assembly1: ServiceGroupA (containing handlers)
Assembly2: ServiceGroupB (containing handlers)
Assembly3: Models
Assembly4: Program (an executable of some type)
ServiceGroupA and ServiceGroupB depend on "Models"; but each has 99% of its classes marked as internal. No project >dependency is allowed between ServiceGroupA and ServiceGroupB.
Program creates a service container including services both ServiceGroupA and ServiceGroupB (using a public extension >method in each "AddServiceGroup[A|B]")

Same as above, this seems to me like it should work. If only Assembly4|Program is referencing the SourceGenerator package, it should map out all the requests and handlers from there and it will know about all the other servicegroups. Note that a request from Models can't be handled from multiple service groups, then it would have to be a notification. But apart from this it doesn't seem like it should fail.
To summarize, you should typically only have 1 outermost project referencing  the sourcegenerator package, and in a single DI container there should only be 1 AddMediator call, this library doesnt expect there to be multiple implementations of IMediator etc in the dependency graph.
Hopefully I've understood your examples and clarified how this package works. If I'm wrong here please correct me. I will make sure to clarify this in the README as well as I'm not sure if this is specified anywhere apart from maybe the clean architecture sample in this repo.
Also related question in #71

Ah, ok - yes that does solve the issue I was having - thanks.
It has meant that all my handlers need to be public accessible to the Program though. They are marked as internal, so I have just included an InternalsVisibleTo(Program) in Assembly1 and Assembly2. This is so the generated Mediator can add the services and associated RequestClassHandlerWrapper.
It would be slightly better if I could keep those handlers private within their respective Assemblies. However, it does seem more convenient to have one source generator. It is not a bother for the moment, my project still isn't big enough to worry too much about these kinds of things.
Thanks again.

I don't think source generating in a single project is an acceptable solution. There may be a case where:

One can't make handlers visible to the consumer;
The consumer wants to selectively register handlers from specific projects.
Reading through the discussion, none of this seems to be possible.

Thanks for the feedback @AntonC9018 !

One can't make handlers visible to the consumer;

So Mediator has the same limitation here as any other C# code. Say if you were to implement a plain service in project B, mark it internal, and then try to call it from project A - you would get a compiler error (ignoring InternalsVisibleToAttribute), becaues you've just said that it should be internal. If you install Mediator in project A here, it has the exact same limitations as you would have trying to call the handlers manually yourself.

The consumer wants to selectively register handlers from specific projects.

I'm not sure what this means. Since for any request/command/query there should be exactly 1 handler, so we can't have multiple handlers for a single message (regardless of the location of the handlers).
What kind of architecture are you going for? Does it look like the one described by @michaeljfarr?
One idea that I've been thinking about that would let you stick with internal handlers would be to "shard" the Mediator implementations kind of by assembly. If both Mediator packages included source generators, where the current Mediator.SourceGenerator package kind of routed based on the message handler assembly.
flowchart TB
    IMediator-->IMediatorProxyA
    IMediator-->IMediatorProxyB
    subgraph Program
    IMediator
    end
    subgraph ServiceGroupB
    IMediatorProxyB-->HandlerB
    end
    subgraph Models
    Request0
    Request1
    end
    subgraph ServiceGroupA
    IMediatorProxyA-->HandlerA
    end

Request0..N can still just have 1 handler, so the "main" source generator would still have diagnostics based on that. But the DI container would cover all these modules and only the IMediatorProxy's (and messages/requests) would have to be public

@martinothamar Actually, I think you're right about the service group thing. To make the separate projects more modular, we have put the mediator registrations in a separate method in each project, then we call those methods for each project, from the main project. Each of those initialization methods registers all handlers from the executing assembly (it seems like we just call services.AddMediatR(Assembly.GetExecutingAssembly())). I just assumed each of these methods would add on to the central mediator registration, but it seems like I was wrong.
The benefit of modularly registering the handlers by assembly is that we can choose to not register handlers from certain projects from the main project.
Right now, I'm starting at the task of factoring out common logic into pipeline behaviors, so I will need to include the "common" assembly with the pipeline behaviors shared between all implementations for them to be resolved at registration time. Just including them once in their own registration method will not be enough.
So it will have to look kinda like this, graphically.
flowchart TB
    Main-->RegisterMediatorB
    Main-->RegisterMediatorA
    subgraph Program
    Main
    end
    subgraph ProjectA
    RegisterMediatorA-->HandlerA
    RegisterMediatorA-->HandlerB
    end
    subgraph ProjectB
    RegisterMediatorB-->HandlerC
    RegisterMediatorB-->HandlerD
    end
    RegisterMediatorA -->RegisterBehaviors
    RegisterMediatorB -->RegisterBehaviors
    subgraph Models
    RequestA
    RequestB
    RequestC
    RequestD
    end
    subgraph CommonBehaviors
    RegisterBehaviors-->PipelineBehaviorA
    end

I can't simplify it to just the following, because each registration is separate.
flowchart TB
    Main-->RegisterMediatorB
    Main-->RegisterMediatorA
    subgraph Program
    Main
    end
    subgraph ProjectA
    RegisterMediatorA-->HandlerA
    RegisterMediatorA-->HandlerB
    end
    subgraph ProjectB
    RegisterMediatorB-->HandlerC
    RegisterMediatorB-->HandlerD
    end
    Main -->RegisterBehaviors
    subgraph Models
    RequestA
    RequestB
    RequestC
    RequestD
    end
    subgraph CommonBehaviors
    RegisterBehaviors-->PipelineBehaviorA
    end

@martinothamar I came across a similar problem while writing my own source generator today. I have it construct a tree graph from all types in all projects, but the problem is that source generators run for each project separately. So now I'm thinking of ways I can process subgraphs instead and then join the results in a single root project. Also, can you explain at a high level how you managed to input the sources of all projects in a single source generator run, because, allegedly, it's impossible? I though it might give me some ideas.

Thanks for elaborating @AntonC9018

The benefit of modularly registering the handlers by assembly is that we can choose to not register handlers from certain projects from the main project.

Yeah so I think this is what's missing currently, that @CzBuCHi is also pointing out. I'll think about this in my 3.0 prototype, will need to come up with a way to make these methods easily consumable, since we now need to differentiate as you say.

Also, can you explain at a high level how you managed to input the sources of all projects in a single source generator run, because, allegedly, it's impossible? I though it might give me some ideas.

Yeah the source generator is supposed to only care about the code in the "current" project, so the way that I've done this here is kind of hacky and not super-scalable (although I haven't run into any perf issues in my prod apps).
This is the relevant code: https://github.com/martinothamar/Mediator/blob/b1a560d06cf5021276891fc4612798e46b2d41af/src/Mediator.SourceGenerator.Implementation/Analysis/CompilationAnalyzer.cs#L288-L352
We fetch symbols from project/compilation references (that have a Mediator reference) recursively (within some limit). This is to map requests to handlers where they might be in separate projects. Again, this is pretty hacky and is not really intended usage from the source generator API, so I will be trying to get away from this model in 3.0.0. Current plan is to have source generation as part of every project, and let each project generate metadata in well known symbols (like a MediatorSourceGenMeta static class or something). I'm planning to start experimenting on this in the next couple of days hopefully

This problem also occurs, when you reference API/Worker (host project) in your Unit/Integration test project. Source generator package included only in host project, but leaked into test and generates duplicate types.
I found workaround - add to test csproj to disable source gen in it:
  <Target Name="DisableAnalyzers"
          BeforeTargets="CoreCompile">
    <ItemGroup>
      <Analyzer Remove="@(Analyzer)"
                Condition="'%(Filename)' == 'Mediator.SourceGenerator.Roslyn40'"/>
    </ItemGroup>
  </Target>


Search Editor: Can't open result with any keybindings, only with double-click

Type: Bug
Repro:

Open Search Editor → make a search with results
Double-click a result to open it → correctly opens editor for the result
Do any keybinding on a result to open it → fails to open the result

cmd+enter → inserts a blank line in the Search Editor buffer
cmd+down → jumps to the bottom of the Search Editor buffer
enter → inserts a blank line in the Search Editor buffer
ctrl+enter → nothing happens

It seems like the Search Editor is mapping all these keys to normal editing commands instead of the search actions? (Should the Search Editor be editable in the first place?)

VS Code version: Code - Insiders 1.83.0-insider (Universal) (11bfd76a61a299156a9f3138ecfad70937af3527, 2023-09-21T05:35:46.439Z)
OS version: Darwin arm64 22.6.0
Modes:

System Info

Item
Value

CPUs
Apple M1 Max (10 x 24)

GPU Status
2d_canvas: enabledcanvas_oop_rasterization: enabled_ondirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmultiple_raster_threads: enabled_onopengl: enabled_onrasterization: enabledraw_draw: disabled_off_okvideo_decode: enabledvideo_encode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabledwebgpu: enabled

Load (avg)
3, 3, 3

Memory (System)
64.00GB (1.42GB free)

Process Argv
--crash-reporter-id cb425818-8a3a-4635-a2ba-c031aec9b12c

Screen Reader
no

VM
0%

Extensions: none
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30404738
py29gd2263:30784851
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
pynewext54:30618038
2i9eh265:30646982
showlangstatbar:30737417
7ij38806:30687742
pythonfmttext:30716741
fixshowwlkth:30771523
showindicator:30805243
pythongtdpath:30726887
i26e3531:30792625
welcomedialog:30812478
pythonnosmt12:30779711
pythonidxpt:30768918
pythonnoceb:30776497
copilotsettingt:30808721
synctok:30821570
dsvsc013:30777762
dsvsc014:30777825
diffeditorv2:30786206
pythonlinttypecf:30823782
pythonmpsinfo:30842935
dsvsc015:30821418
pythontestfixt:30826906
pythonfb280951:30830809
pythonregdiag:30842812
pythonmypyd1:30841190

These are actually shortcuts for the search viewlet (which can be accessed from the sidebar). For example, from the sidebar search viewlet, you can use cmd+enter to show the equivalent results in the search editor. This is different from double-clicking a result when you're already in the search editor.

Oh thanks. I just found the paragraph in the docs that explains how to use the Go To Definition keybindings to open results from the Search Editor, that's what I was missing:

https://code.visualstudio.com/docs/editor/codebasics#_search-editor

Turned my question into a feature request:

https://github.com/microsoft/vscode/issues/194044


Implement JWT token auth for registering devices

[ ] Make users to be able to register a device
[ ] Generate a JWT token that can be used for the device
[ ] Send the JWT token with each web socket message

Use different secret for devices


Android how to create view like this in Circular shape having imageview and text view

i want to create a view like this , i will post picture ,is it possible with your library. please guide me.

I think it will be very hard to achieve something like this using the library. You could however, look at the source code and modify it to fit your custom needs.


puzzles at end for hammer and worm

You need to bust off the LOCK CAPS to open the Snowflake Special.
hammer = away, home, down
Worm ring = bits and pieces of worm
HOLLOW RING

mentality crowd = equally divided if you should stay or go
TONE RING
CHANGE RING


Consider creating a root-level OWNERS file

Example such file: https://github.com/GoogleCloudPlatform/testgrid/blob/master/OWNERS
Does this repo use tide?
If you do you can have prow's blunderbuss auto-assign PRs for people to review
{
 insertId: "hhe0klg19qto38"
 jsonPayload: {
  author: "hopkiw"
  component: "hook"
  event-GUID: "fabaa5a0-eabf-11e9-9d1c-e83845a44c3d"
  event-type: "pull_request"
  file: "prow/plugins/approve/approvers/owners.go:164"
  func: "k8s.io/test-infra/prow/plugins/approve/approvers.Owners.GetSuggestedApprovers"
  level: "warning"
  msg: "Couldn't find/suggest approvers for each files. Unapproved: [""]"
  org: "GoogleCloudPlatform"
  plugin: "approve"
  pr: 858
  repo: "compute-image-packages"
  url: "https://github.com/GoogleCloudPlatform/compute-image-packages/pull/858"
 }
 labels: {…}
 logName: "projects/oss-prow/logs/hook"
 receiveTimestamp: "2019-10-09T18:09:53.708324141Z"
 resource: {…}
 severity: "ERROR"
 timestamp: "2019-10-09T18:09:52Z"
}

this is a legacy repo that we've done some prow testing with; the entire repo is slated for deprecation. you can feel free to set up a sync on our use of prow if you'd like to consolidate your feedback

/assign @illfelder @hopkiw
Will one of you please create a root OWNERS file? See https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md for what this looks like (or the link to a concrete example in the desc)
{
 insertId: "506i77g1eg0aw9"
 jsonPayload: {
  author: "illfelder"
  component: "hook"
  event-GUID: "b3666c00-17a8-11ea-80f2-bff4cf51329d"
  event-type: "pull_request"
  file: "prow/plugins/approve/approvers/owners.go:164"
  func: "k8s.io/test-infra/prow/plugins/approve/approvers.Owners.GetSuggestedApprovers"
  level: "warning"
  msg: "Couldn't find/suggest approvers for each files. Unapproved: [""]"
  org: "GoogleCloudPlatform"
  plugin: "approve"
  pr: 876
  repo: "compute-image-packages"
  url: "https://github.com/GoogleCloudPlatform/compute-image-packages/pull/876"
 }
 labels: {…}
 logName: "projects/oss-prow/logs/hook"
 receiveTimestamp: "2019-12-05T21:46:38.824663700Z"
 resource: {…}
 severity: "ERROR"
 timestamp: "2019-12-05T21:46:35Z"
}

Any thoughts here?

deleted testing webhook for this non-prow-integrated repo.


Is there a cross-platform plan for this project?

Could you elaborate on your questions? Currently you can I've tested it on CentOS, Ubuntu and macOS.

Could you elaborate on your questions? Currently you can I've tested it on CentOS, Ubuntu and macOS.

for example windows? I have tested on CentOS. Thank for your help.

Regarding Windows support the conversation will continue in https://github.com/awegrzyn/influxdb-cxx/issues/65


ScrollView doesn't scroll to focused element

Environment
Android API: 28
Device: AndroidTV emulator and Xiaomi MI BOX
React Native: 0.61.5
Description
Sometimes ScrollView doesn't scroll to currently focused element on AndroidTV devices. Looks like issue is triggered because of two scroll events, one from ReactScrollView.java arrowScroll method and one from requestChildFocus. Issue seems to occur only when scrolling on the bottom of ScrollView.
React Native version:
"0.61.5"
Steps To Reproduce

Navigate with keyboard/remote controller up and down on between last rows of ScrollView.

Expected Results
Scroll follows focused element
Snack, code example, screenshot, or link to a repository:
App.ts example:
import React from 'react';
import {View, StyleProp, TextStyle, ViewStyle, TouchableOpacity, ScrollView, Text} from 'react-native';
const styles: {[name: string]: StyleProp<ViewStyle> | StyleProp<TextStyle>} = {
  container: {
    position: 'absolute',
    width: '100%',
    height: '100%',
    backgroundColor: '#000',
    justifyContent: 'flex-end',
    alignContent: 'center'
  }
};
const rows = [1,2,3,4,5,6,7,8,9];
const columns = ['a', 'b', 'c', 'd', 'e', 'f'];
type Props = {
  text: string;
  number: number;
}
const MyButton = (props: Props) => {
  return (
    <TouchableOpacity
      style={{width: 200, height: 200, margin: 50, backgroundColor: `rgba(100,255,0,0.3)`}}
      key={props.text + props.number}
      onPress={() => {}}
    >
      <Text>{props.text + props.number}</Text>
    </TouchableOpacity>
  );
};
const App = () => {
  return (
    <View style={styles.container}>
      <ScrollView>
        {rows.map((number) => (
          <ScrollView
            horizontal={true}
            key={'scrollview' + number}
          >
            {columns.map((text) => <MyButton text={text} number={number} key={text + number} />)}
          </ScrollView>
        ))
        }
      </ScrollView>
    </View>
  );
};
export default App;

In gif below i navigated up and down only:

Android TV is not officially supported, though folks from the community have contributed code to enable it. I'm going to label this issue as something that would need to be fixed by a pull request from the community if needed.

@Zahoq could you link a minimal reproduction repo (preferably on GitHub as well)?

repo: https://github.com/Zahoq/ScrollViewBug
Issue still reproduces on react-native: 0.62.2


Some queries never stop executing

Issue Type: Bug
Starting with the latest release I'm seeing issues running simple queries. In one case I had a T-SQL error in the query but in another the query looks fine (having just run it on another machine's instance of ADS). However when I click Run it starts running the query and never ends. Clicking Cancel does nothing. This is for an arbitrary query. For example the one I was trying to run was this.
BEGIN TRY
  sys.xp_create_subdir N'G:\Temp'
END TRY BEGIN CATCH
  SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_SEVERITY() AS ErrorSEverity, ERROR_MESSAGE AS ErrorMessage
END CATCH

I don't think it has anything to do with the query itself, other than perhaps a compiler error or something, as I have other queries that do this as well. I can copy the query, close ADS, open it back up, paste the query in and it then runs fine. It is intermittent at best.
This started with the latest release.
Azure Data Studio version: azuredatastudio 1.26.1 (796abbdf5fdd341e3528e30a6b777c93e115eb02, 2021-02-24T23:42:55.085Z)
OS version: Windows_NT x64 10.0.19042

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3696)

GPU Status
2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onoop_rasterization: disabled_offopengl: enabled_onprotected_video_decode: unavailable_offrasterization: enabledskia_renderer: disabled_off_okvideo_decode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
31.93GB (9.38GB free)

Process Argv

Screen Reader
no

VM
0%

Extensions: none

@CoolDadTx Are you saying the query you posted can be executed just fine? I see two problems with it. in line 2 you are missing exec and in line 4, there should be a pair of parenthesis after ERROR_MESSAGE.

@alanrenmsft No. I'm saying that if I take the same query and put it into SSMS then it fails immediately. However in ADS it starts and never completes. Once in this state the only way to recover is to restart ADS. If I take a working query in SSMS and drop it into a new instance of ADS then it executes. I can also see query errors in ADS for some queries but others just refuse to stop.
It almost appears like it is having an issue running a query with errors for the first time but I don't know for sure.

Here's another query.
DECLARE @kundres_local TABLE (invoice_number BIGINT, Reminder INT)
DECLARE @OOF TABLE (SALDO_KR INT, DOKNR BIGINT, Datum2 DATETIME)

INSERT INTO @kundres_local ( invoice_number, Reminder )
SELECT OOF.DOKNR, -1 AS Uttryck1
FROM @OOF oof LEFT JOIN @kundres_local kundres_local ON OOF.DOKNR = kundres_local.invoice_number
WHERE (((OOF.SALDO_KR)>0) AND (DATEDIFF(day, GETDate(), Datum2) >0) AND ((kundres_local.invoice_number) Is Null));

This query is valid. When I originally ran it the first 2 times it had errors such as bad alias and unknown function. It correctly reported the errors. After I fixed those errors and got to this query I ran it and ADS started running the query and never stopped.  Closing ADS and opening it back up, opening a new query window, pasting the above query in and then running it has it return 0 results like I expected.

thanks @CoolDadTx  I will take a look at this issue.

I am not able to reproduce the issue, are you still seeing the issue with the latest ADS release? if so please reactivate and add the logs mentioned in the comment (https://github.com/microsoft/azuredatastudio/issues/14496#issuecomment-791063311) above.


Pulsate the drag and drop label

@LarsJK What do you think? Also notice how it scales to the right. Any idea how I can make it scale centered? Maybe setting an anchor point or something.
Oh and I made the window light in https://github.com/sindresorhus/gifski-app/commit/eaaafe2fda6645aec335bfeda0c13ebeda701bec in preparation for macOS 10.14.

Also notice how it scales to the right. Any idea how I can make it scale centered? Maybe setting an anchor point or something.

Solved it in https://github.com/sindresorhus/gifski-app/pull/39/commits/b367536917a6370381a1333cab46007eacd2d898


OSX Travis failure: signal: 5, SIGTRAP: trace/breakpoint trap

The Mac jobs on travis are failing:
https://travis-ci.org/tomassedovic/tcod-rs/jobs/139118914
Here's a bit of the text:
     Running `/Users/travis/build/tomassedovic/tcod-rs/target/debug/tcod-f2e2dde9935e1437`
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
error: Process didn't exit successfully: `/Users/travis/build/tomassedovic/tcod-rs/target/debug/tcod-f2e2dde9935e1437` (signal: 5, SIGTRAP: trace/breakpoint trap)
Caused by:
  Process didn't exit successfully: `/Users/travis/build/tomassedovic/tcod-rs/target/debug/tcod-f2e2dde9935e1437` (signal: 5, SIGTRAP: trace/breakpoint trap)

I'm not quite sure what's wrong and I don't have a Mac to debug this locally, but we need to fix this.

Deleting some libs and relinking them fixed the problem for me, as found at stack overflow:
http://stackoverflow.com/a/35070568
Issue seems to be related to the ImageIO framework package having some sort of conflict with homebrew libs.

This is fixed, stable OSX builds are passing now:
https://travis-ci.org/tomassedovic/tcod-rs/builds/259341303
Closing this issue.


Consider adding an immutable tuple type

This would be an immutable, array access zval buffer which would serve as the groups in operations such as groupBy. Instead of a Map<mixed, Sequence> it would be Map<mixed, Tuple>. It would be very easy to convert those tuples into sequences if you need the extra mutability and functionality.
$map->groupBy('key')->apply('sequence'); // assuming sequence is a function

$map->groupBy('key')->apply(function($key, $value) {
    return new Sequence($value);
});

API I'm thinking of is basically:

__construct(iterable|array)
get(int)
toArray()
count()
clear() ??
isEmpty() ??

Have decided that this is a good idea. Will replace Pair and Vector, Deque becomes Sequence.


Android - Drawback of Fixing Error (Regular TensorFlow ops) is increasing the app size to 195MB!

Object detection Android TF LITE EXAMPLE
I am running the example of object detection Android version, which need about 14MB storage on the physical phone.
My trained Object detection Android TF LITE
However, when I used my object detection trained model, (which is converted to TF LITE using this link), I got the following exception when the app started:
org.tensorflow.lite.examples.detection E/AndroidRuntime: FATAL EXCEPTION: inference
    Process: org.tensorflow.lite.examples.detection, PID: 5086
    java.lang.IllegalArgumentException: Internal error: Failed to run on the given Interpreter: Regular TensorFlow ops are not supported by this interpreter. Make sure you apply/link the Flex delegate before inference.
    Node number 223 (FlexSize) failed to prepare.

        at org.tensorflow.lite.NativeInterpreterWrapper.run(Native Method)
        at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:158)
        at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:347)
        at org.tensorflow.lite.examples.detection.tflite.TFLiteObjectDetectionAPIModel.recognizeImage(TFLiteObjectDetectionAPIModel.java:196)
        at org.tensorflow.lite.examples.detection.DetectorActivity$2.run(DetectorActivity.java:181)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.os.HandlerThread.run(HandlerThread.java:67)

My tf-Lite model size: 5MB
The app size on the mobile is about 15 MB

To Solve This Error:

I include the following dependency on the build.gradle (Modle app):

    // This dependency adds the necessary TF op support.
    implementation 'org.tensorflow:tensorflow-lite-select-tf-ops:0.0.0-nightly'

That solves the problem and my object detection app is working very well.
However, The app is now 195MB size (storage) on the physical mobile! Does this (-tf-ops) dependency has this large size! If so how can I fix the previous exception without including this dependency in the android app?

Which model are you using from the TF2 detection zoo? I am working on a script to convert SSD models to a more TFLite-friendly format, which should make the usage of TF-Select ops unnecessary.

@srjoglekar246
I follow this tutorial to train object detection on a custom dataset.

In the tutorial, the following model is used as a backbone model.

wget http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

Then convert it to TF LITE using this script

@srjoglekar246
This is TF-Select ops converting script I used to convert the model to the lite.

How about using the selective build? https://www.tensorflow.org/lite/guide/reduce_binary_size

@hahmad2008 That unfortunately isn't the best way to convert SSD models to TFLite, since it includes parts of the graph not intended for on-device inference. I have an upcoming script to do this for TF2 models, please refer to this: https://github.com/tensorflow/models/issues/9033

Thanks @srjoglekar246
But where can I see that script?

In internal review, hopefully will land soon :-)

Then, I have to follow the thread.

@srjoglekar246 I used the same script.
# From the tensorflow/models/research/ directory
python object_detection/export_tflite_graph_tf2.py \
    --pipeline_config_path path/to/ssd_model/pipeline.config \
    --trained_checkpoint_dir path/to/ssd_model/checkpoint \
    --output_directory path/to/exported_model_directory

I got a 544 byte lite model, but when I tried to test the lite model, I got the error:
interpreter = tf.lite.Interpreter(model_content=tflite_quant_model)
interpreter.allocate_tensors()

# Get input and output tensors.
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()

# Test the model on random input data.
input_shape = input_details[0]['shape']
print(input_shape)

Error for this line interpreter = tf.lite.Interpreter(model_content=tflite_quant_model)

/usr/local/lib/python3.6/dist-packages/tensorflow/lite/python/interpreter.py in __init__(self, model_path, model_content, experimental_delegates, num_threads)
    206               custom_op_registerers_by_func))
    207       if not self._interpreter:
--> 208         raise ValueError('Failed to open {}'.format(model_path))
    209     elif model_content and not model_path:
    210       custom_op_registerers_by_name = [

ValueError: Did not get operators, tensors, or buffers in subgraph 0.

Any idea? how to solve this?

@srjoglekar246
I have successfully converted the tf model, but now the output detection was 100 now is only 10! the performance is so bad now! I had converted the model previously using supported_ops and the performance was really good but now is very bad :(

@hahmad2008 Please use the latest nightly for tflite_convert. Otherwise you won't get the latest convertor changes. Looks like you got it converting now, how big is the model?
export_tflite_graph_tf2.py has some parameters that you can use to fine-tune how many results it provides, and the accuracy.
See ssd_use_regular_nms & ssd_max_detections here. provide a higher value to ssd>max_detections and/or set ssd_use_regular_nms to True.
But note that these changes will increase latency.

@srjoglekar246 Thank you so much. it works now. the app is now 15 MB size 👍

@srjoglekar246 but why the performance of the model is not natural, I mean the percentage of scores + when there is no object is trained on is visible it then detect the view as on of the trained objects with a high score :( -_-

Did you try these params? --ssd_use_regular_nms=true while exporting will make your model more accurate, so will increasing ssd_max_detections.


Catch-all routes

We should design and implement a feature akin to Next's catch-all routes and Svelte Kit's rest parameters.

Added in 0.6.


Sync some missing entries; fix some typos; etc.

Syncs some missing entries (not all translated yet, but all language versions should at least all have the same entries now):

"Do not forget to turn the DEBUG mode OFF." (README-ja.md). I've tried to translate it (I'm somewhat confident in it, but checking/reviewing it is still invited).
"If you are parsing XML files, make sure entity expansion is not enabled to avoid Billion Laughs/XML bomb via exponential entity expansion attack." (README-lo.md and README-pl.md). I haven't tried to translate those entries though (I have zero confidence in my ability to translate Lao or Polish; better to either leave it be, or let someone else try to translate those entries, I think).
"Feel free to contribute by forking this repository ..." etc (README-pl.md). Also haven't tried to translate that.

Fixes some typos:

Some sentences missing full stops (README-id.md, README-ja.md, README-lo.md, README-mk.md, README-vi.md, README-zh.md).
multipart/form-data ,application/json -> multipart/form-data, application/json (README-id.md, README-lo.md, README-nl.md).
id -> ID (README-id.md, README-lo.md, README-th.md)
etc -> ໆລໆ (README-lo.md). (Based on examples already in the file).
e.g. -> п.р. (README-mk.md). (Based on examples already in the file).
e.g. -> b.v. (README-nl.md). (bijvoorbeeld...).

The etc part:

Slightly rewords one of the original English entries (not a typo fix; just to try to improve it a little).
Normalises some spacing (README-lo.md).

(Review requested).

Thanks, merged


language/python: bug fix

[ ] Have you followed the guidelines in our Contributing document?
[ ] Have you checked to ensure there aren't other open Pull Requests for the same change?
[ ] Have you added an explanation of what your changes do and why you'd like us to include them?
[ ] Have you written new tests for your changes? Here's an example.
[ ] Have you successfully run brew style with your changes locally?
[ ] Have you successfully run brew typecheck with your changes locally?
[ ] Have you successfully run brew tests with your changes locally?

Fixes a bug introduced in 09570fc7a66af8c43626a869888ebc484745c587.

Review period skipped due to critical label.


Removed delimiter from EDA file

@paradise1260 Oh sorry I did not see this pull request before I git pull and editted things. But I also removed delimiter in EDA pd.read_csv and modified some extra staff.
Could you take a look at the pull request I opened just now? If you agree with that version, we may not incorporate this pull request because I guess merge conflict could happen?

@GloriaWYY I merged your pull request and will close this one. No worries.