dart:io HttpClient's request force-transforms the header names to lowercase

The toLowerCase() transformation may be useful when processing the response headers, but when sending, the server could be checking the cased version and fail if it doesn't find it that way. (Yeah, bad server.)

Sounds like #25120

Yeah, very similar problem.

I think the reason for the lowercase transform is HTTP/2: it standardizes all header names to be lowercase, and with that it makes somewhat sense to do the same here.

I've spent half a day debugging to find out http client forces headers as lowercase.
Guess what, I'm stuck with 10 year old client devices with HTTP server's using case sensitive headers.
Why force anything? Let me decide what I want to send with MY request

Same here, I ended up copying over a bunch of code from the SDK after debugging a broken WebSocket connection for a few days. I get the rationale but this isn't documented anywhere which is really annoying.

Since I can't say to thousands of users to update their receivers or fix their HTTP server implementation, and I don't expect Dart team to change this behavior, I had no other choice but to change default HTTP client.
I took current HttpClient from master branch (requires Dart 2.5, Flutter 1.8+), changed it to leave headers alone and packed in the package. Hopefully it will save someone someone from crying and pulling up their hair. Just use it as a drop in replacement for HttpClient.  Tested and works with Dio.
You can find package HERE.

There seems to be a suggestion that we should add an option to not change the case.

@lrhn Any idea? This would be a breaking change if adding one more flag.

To be more specific, A flag is probably needed to be passed from httpclient all the way down to httpheader.
https://github.com/dart-lang/sdk/blob/a1fdfb8fc8abb758f17c070cebfea3026ca53973/sdk/lib/_http/http_impl.dart#L2071
https://github.com/dart-lang/sdk/blob/a1fdfb8fc8abb758f17c070cebfea3026ca53973/sdk/lib/_http/http_impl.dart#L770
https://github.com/dart-lang/sdk/blob/a1fdfb8fc8abb758f17c070cebfea3026ca53973/sdk/lib/_http/http_impl.dart#L1078
Inside headers,
https://github.com/dart-lang/sdk/blob/4102e63f378ea585c6c6e02107e60017912aadde/sdk/lib/_http/http_headers.dart#L41
https://github.com/dart-lang/sdk/blob/4102e63f378ea585c6c6e02107e60017912aadde/sdk/lib/_http/http_headers.dart#L44
https://github.com/dart-lang/sdk/blob/4102e63f378ea585c6c6e02107e60017912aadde/sdk/lib/_http/http_headers.dart#L44

Thats the one way to look at it.
Why would HttpClient assume anything?
You have bunch of Abstract classes in HTTP client that are used only as internal implementations. Take HttpHeaders for instance. It's abstract, and HttpClient uses one single concrete implementation, which is internal, and has no way to use some other implementation.
Why making abstract class in a first place if you're forcing it to be used in a single way?
Good and probably non breaking start would be to

move internal implementations to separate public classes/files
refactor existing calls to new classes
add a way for user to provide specific implementation of abstract class
if no specific implementation is provided use default one
Last two can be done as optional class constructor with default value params (better) or as public properties (less transparent IMHO).
I'm speaking from top of my head now, but this shouldn't breake anything.
Dart has no reflection, and internal calls can be easily refactored.
And once you're there, in default HttpHeaders expose map of all headers as public property, leave current behaviour, as is, but let user modify the map directly however he/she wants. That's extra, I'd be fine if I could make HttpClient use my HttpHeaders instead default ones.

Just my 2 cents.

any update?

Still in progress. I expect this cl to be landed within next few weeks.

Is there any ETA when this will land in a Dart release?

The cl is pretty much done. But it has to wait for breaking change request getting approved.

Creating an API Client using HTTPClient with the following request headers:
I/flutter (32611): headers: {
I/flutter (32611):   "Content-type": "application/json",
I/flutter (32611):   "Accept": "application/json",
I/flutter (32611):   "Authorization": "Bearer: E7HlYmfiXwhLQT1nYApOAE4wqhvCZZXndrT7kiRv8tUBycj3npVnYwnQnH34"
I/flutter (32611): }
I/flutter (32611):
I/flutter (32611):
I/flutter (32611):
I/flutter (32611): request.headers:
I/flutter (32611): content-type: application/json
I/flutter (32611): accept: application/json
I/flutter (32611): authorization: Bearer: E7HlYmfiXwhLQT1nYApOAE4wqhvCZZXndrT7kiRv8tUBycj3npVnYwnQnH34

And the server (nginx/1.15.8) is returning a 400 error:
I/flutter (32611):
I/flutter (32611): <title>400 Bad Request</title>
I/flutter (32611):
I/flutter (32611):
400 Bad Request

I/flutter (32611):
nginx/1.15.8
I/flutter (32611):
I/flutter (32611):

Using the same headers in android with the following request headers:
E: Called doInBackground w/ headers: [Accept: application/json, Content-type: application/json, Authorization: Bearer E7HlYmfiXwhLQT1nYApOAE4wqhvCZZXndrT7kiRv8tUBycj3npVnYwnQnH34]

And the same server is returning a 200 response, so I'm really looking forward to integrating the change by @ZichangG : https://github.com/dart-lang/sdk/issues/39657#issue-533108500

I/flutter (32611):   "Authorization": "Bearer: E7HlYmfiXwhLQT1nYApOAE4wqhvCZZXndrT7kiRv8tUBycj3npVnYwnQnH34"

It looks like the colon : after Bearer should not be there.

Thanks @accek, that was definitely an oversight. I just tried it again with these headers:
I/flutter ( 3473): headers: {
I/flutter ( 3473):   "Content-type": "application/json",
I/flutter ( 3473):   "Accept": "application/json",
I/flutter ( 3473):   "Authorization": "Bearer E7HlYmfiXwhLQT1nYApOAE4wqhvCZZXndrT7kiRv8tUBycj3npVnYwnQnH34"
I/flutter ( 3473): }
I/flutter ( 3473):
I/flutter ( 3473):
I/flutter ( 3473):
I/flutter ( 3473): request.headers:
I/flutter ( 3473): content-type: application/json
I/flutter ( 3473): accept: application/json
I/flutter ( 3473): authorization: Bearer E7HlYmfiXwhLQT1nYApOAE4wqhvCZZXndrT7kiRv8tUBycj3npVnYwnQnH34

But the result was still the same:
I/flutter ( 3473): responseString:
I/flutter ( 3473): <title>400 Bad Request</title>
I/flutter ( 3473):
I/flutter ( 3473):
400 Bad Request

I/flutter ( 3473):
nginx/1.15.8
I/flutter ( 3473):
I/flutter ( 3473):

I didn't think to add the nginx logs before, but here are all the nginx logging from last night:
2019/12/29 03:15:05 [error] 3653#3653: *65 open() "/var/www/reely-api/testing/public/api/version" failed (2: No such file or directory), client: <IP_ADDRESS>, server: reely.the-mac.local, request: "POST /api/version HTTP/1.1", host: "reely.the-mac.local"

Currently there are no logs showing, but I think that error was from using the wrong url protocol.

@accek We're working to make the breaking change, but it's a workaround for bad servers. The standard requires the protocol headers are case insensitive and you get the server fixed instead of debugging the issue here. I assume those bearer tokens are for debugging and have no actual access.

Yes the token is not usable @accek , it only worked for a private internal server. Could the solution be to use the HTTP/2 standard optionally @isoos , similar to @ZichangG 's solution (but an opt in solution)?
@sortie I looked into the Server side, and according to the creator of Laravel, Laravel literally does not touch request headers in any form or fashion.

Issues are to be expected when forcing things like these..
Same as dictating the multipart_request boundary to "dart-http-boundary-xxxx" in https://github.com/dart-lang/http/issues/295

Landed in https://github.com/dart-lang/sdk/commit/d39cdf03f83a4b76d0bda122b3745109fcd03299

anyone has find an solution ?

@MiriDevAndro: If I understand correctly, the fix has been landed, it may be in the 2.8.0-dev branch already, and it will be in 2.8.0 stable.

@isoos  yes i have see but i dont have this path/file sdk_nnbd/lib/_http/http.dart in my sdk , i use windows andoid studio and i have download sdk from official page

Landed in d39cdf0

there is no such dir like sdk_nnbd/lib/_http/http.dart on my sdk

@MiriDevAndro the fix has landed in sdk/lib/_http/http.dart the other path (sdk_nnbd) that you refer to is an internal branch of the libraries that we are using for the null safety feature.

@MiriDevAndro the fix has landed in sdk/lib/_http/http.dart the other path (sdk_nnbd) that you refer to is an internal branch of the libraries that we are using for the null safety feature.

why then is not working , i have modify all like thi d39cdf0

What is not working, can you send us a test case that still exhibits the problem,
It looks like you are not using the sdk as is and instead have your own version of the build into
which you are applying this patch, it is possible there is some inconsistency there.

@a-siva im using flutter in android studio ,how can i fix lowercase headers?

@MiriDevAndro you might have an older version of the Dart SDK that doesn't have this change. If you run flutter --version, the Dart SDK needs to be  2.8.0-dev.10.0 or later.

@mit-mit thnx for answers , can i use dart sdk 2.8.0-dev.10.0 +  in android studio manually or not will work?

If you are doing Flutter development, you need to upgrade your Flutter SDK. That contains an embedded Dart SDK inside it (as reported by flutter --version).

The flutter channel dev  dart sdk 2.8.0-dev.15.0 has  to much bug and stable has ver dart sdk 2.7.0 max

Sorry, you will have to wait for the dev channel to stabilize then.

ok thnx for explanation

I'm also struggling with a server only accepting cased headers.
How can I use the above solution?
Tried:
final body = '{"hello":"world"}';
final client = new HttpClient();
final req = await client.put('localhost', 8000, '/');
req.headers.add('Content-Type', 'application/json', preserveHeaderCase: true);
req.headers.add('Content-Length', body.length, preserveHeaderCase: true);
req.write(body);
await req.close();

Versions:
> flutter --version
Flutter 1.15.21 • channel master • /home/eirikb/.cache/yay/flutter-git/flutter
Framework • revision e2b4edd286 (3 weeks ago) • 2020-03-13 02:46:02 -0400
Engine • revision d7a00b8b09
Tools • Dart 2.8.0 (build 2.8.0-dev.14.0 eb9c26bd37)

But headers are still lower-cased.
Tested by running Flutter in Android Emulator and dart in terminal:
> /opt/flutter/bin/cache/dart-sdk/bin/dart --version
Dart VM version: 2.8.0-dev.14.0.flutter-eb9c26bd37 (Fri Mar 13 01:41:41 2020 +0000) on "linux_x64"
> /opt/flutter/bin/cache/dart-sdk/bin/dart api_test.dart

Output from nc (also see same result in Wireshark):
> nc -l -p 8000
PUT / HTTP/1.1
user-agent: Dart/2.8 (dart:io)
content-type: application/json
accept-encoding: gzip
content-length: 17
host: localhost:8000

{"hello":"world"}

@mit-mit I'm having exactly the same issue as @eirikb .
preserveHeaderCase as far as I can see is currently not working.
Using

Dart VM version: 2.8.2 (stable) (Mon May 11 15:06:42 2020 +0200) on "windows_x64"

Can someone please explain what's current status on this, is it working, if yes how, if not what's happening with it? Should this be re-opened?

@shaxxx Sorry for the delayed reply. Code reviews for my fix took some time, I'll land the fix today.

@zichangg Thanks for the update, as far I can understand preserveHeaderCase should work in the next flutter stable?
It wasn't really clear from this thread if this is currently working or not since no one confirmed this is still an issue and this bug is closed. Is there another bug tracking progress on this?

reopening issue so that we can track when the bug fix CL lands and update on when it gets rolled into Flutter. You will probably see it in the dev channel first.

reopening this issue because force lowercase http header make it breakable from legacy server that don't check for small letter. and http1 header is sensitive case.
Please make by default non force lowercase http header, and add an option to people to want to force it.
It break my communication with the server.
Also http in web, doing as http should. it non force lower case and adding automatically content-length in the header.
But, http in dart-io force you lowercase http header and not adding automatically content-length.
This is bad inconsistency. http request should be the same across all the platform. and doing the same as http in web.

im okay with you , they should insert support for http 1.1

Hey,
I also miss the case sensitive version of the headers. Any update in this topic?

@zichangg Why you hurt the community?

How u mean I hurt? I am not inted to...

@camsteffen my last message  I was write to @zichangg

@cesuper @talregev this issue was closed because HttpHeaders add and set methods were expanded with explicit support for case-sensitive header via preserveHeaderCase: true named argument.
If this does not work for you (meaning: you set preserveHeaderCase: true but headers are sent in forced lowercase) then you should file a separate issue and provide a minimal reproduction of the issue.
There are no plans to switch to case-sensitive headers by default.

Any update on this?
I think that this bug is on native compiled library, any idea ?

@MiriDevAndro https://github.com/dart-lang/sdk/issues/33501#issuecomment-913470214

@mraleph  why dev of flutter just use rules like java does , is very simple just copy java dude.

@MiriDevAndro I don't understand your question and in any case your question is off-topic for this bug.

@mraleph im saying that java is perfect but can be modify simply bytecode in other way flutter it compiles code in native so this is good but is not portable as java in implementation.


Can't reference assemblies

I am trying to use c# dynamics with the incremental compiler, but I keep getting this error:
error CS0656: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'

I did some searching, and according to this stackoverflow post, to use dynamics with Roslyn you need to add a project reference to Microsoft.CSharp.dll. I tried doing this in my IDE and by editing msc.rsp, but the errors are still there. How do I properly add an assembly reference?

Well, I FINALLY fixed it. Here's how you add assembly references with Unity's Incremental Compiler:

Find the path of your Unity Editor installation
Go into the following subfolder: [Version of Unity]\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\Facades
Copy-paste a copy of the dll you want to use into that folder. To use dynamics you need Microsoft.CSharp.dll, which can be found at C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5.

Dependencies seem to be automatically sorted out; even though Microsoft.CSharp.dll has like 5000 dependencies, I was still able to use it without copy-pasting any of them.

The process for doing this should really be made more obvious, I spent multiple days on this problem.


export ensureValid function

I have exported this function to outside. This will allow for developers to use this function for their custom logic, for example overriding processing of requests.

Thanks, makes a lot of sense!


OSError: Can't load tokenizer for hf uploaded model. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure hf upleaded is the correct path to a directory containing all relevant files for a PreTrainedTokenizerFast tokenizer.

Hello and thank you for the great work and support.
I have fine tuned "unsloth/Llama-3.2-11B-Vision-Instruct" model on my custom dataset and pushed the finetuned model as follow:
LoRA adapter:
model.push_to_hub("name/model_lora", token = "tt")
tokenizer.push_to_hub("name/model_lora", token = "tt")

I also pushed the merged model using:
model.push_to_hub_merged("name/model-merged", tokenizer,save_method = "merged_16bit", token = "tt")
when I tried to load the merged model I got the following error:
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
[<ipython-input-4-53a31af0a8e9>](https://localhost:8080/#) in <cell line: 4>()
      2 import torch
      3
----> 4 model = FastVisionModel.from_pretrained("Hessa/MMTQA-merged2", load_in_4bit = True) #use_gradient_checkpointing = "unsloth"

5 frames
[/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py](https://localhost:8080/#) in from_pretrained(cls, pretrained_model_name_or_path, cache_dir, force_download, local_files_only, token, revision, trust_remote_code, *init_inputs, **kwargs)
   2014         # loaded directly from the GGUF file.
   2015         if all(full_file_name is None for full_file_name in resolved_vocab_files.values()) and not gguf_file:
-> 2016             raise EnvironmentError(
   2017                 f"Can't load tokenizer for '{pretrained_model_name_or_path}'. If you were trying to load it from "
   2018                 "'https://huggingface.co/models', make sure you don't have a local directory with the same name. "

OSError: Can't load tokenizer for 'name/model-merged'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'name/model-merged' is the correct path to a directory containing all relevant files for a PreTrainedTokenizerFast tokenizer.

1- How to solve this error?
2- If I load the lora adapter using:
model, tokenizer = FastVisionModel.from_pretrained(
        model_name = "name/model_lora",
        load_in_4bit = False, # Set to False for 16bit LoRA
    )
FastVisionModel.for_inference(model) # Enable for inference!

Is it gonna be merged with the base model or I need to do that myself?
Thanks in advance

there is no tokenizer in your repo https://huggingface.co/Hessa/MMTQA-merged2/tree/main
push tokenizer on hub,
delete cache from ~/.cache/huggingface
repull


TouchableOpacity setOpacityTo is not a function

Originally reported in expo/expo#9026, I ran into the same problem so I'm re-reporting this here
Description
The setOpacityTo on TouchableOpacity is no longer available.
React Native version:
0.62.2
  Expo CLI 3.20.3 environment info:
    System:
      OS: macOS Mojave 10.14.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.20.1 - /var/folders/qt/10542x9d2wbg0x93mmh1xsw00000gn/T/yarn--1593777562592-0.5909086070884821/node
      Yarn: 1.22.4 - /var/folders/qt/10542x9d2wbg0x93mmh1xsw00000gn/T/yarn--1593777562592-0.5909086070884821/yarn
      npm: 6.14.4 - ~/.asdf/installs/nodejs/10.20.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.5 AI-191.8<IP_ADDRESS>91312
      Xcode: 11.0/11A420a - /usr/bin/xcodebuild
    npmPackages:
      expo: ^38.0.0 => 38.0.4
      react: 16.11.0 => 16.11.0
      react-dom: 16.11.0 => 16.11.0
      react-native: https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz => 0.62.2
      react-native-web: ^0.12.0 => 0.12.3
      react-navigation: ^4 => 4.3.9

Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.

Create a reference to TouchableOpacity
Try calling setOpacityTo

Expected Results
Opacity of the element is changed
Actual Results
Fatal crash due to missing method
Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/@zanona/3cb338

This is the commit that introduced the issue: 88ae24f719d365b004696aff6461535188ca9f41
The documentation still contains references to setOpacityTo so I'm assuming this was not an intentional change.

Appreciate root causing this. Given the introduction of 'Pressable' I believe 'TouchableOpacity' is on the path to deprecation, so this may just be a "won't fix": https://reactnative.dev/docs/next/touchableopacity
(it's not officially tagged as deprecated, but note the comment in the docs there starting to redirect)

It looks like we didn’t realize that was a public API. I think we should accept a PR that removes the prefix. Especially because this API is in the documentation https://reactnative.dev/docs/touchableopacity#docsNav

Still a problem, react-native 0.63.3

Can the documentation at-least be changed so that setOpacityTo is removed?

Can the documentation at-least be changed so that setOpacityTo is removed?

I made a pull request to remove the documentation https://github.com/facebook/react-native-website/pull/2464

I made a pull request to remove the documentation https://github.com/facebook/react-native-website/pull/2464


Using electron-remote in production (packaging fails)

Hi , i need help with a specific module , https://github.com/electron-userland/electron-remote .
in dev mode , everything works , but in production mode , this will show up .
WARNING in ./~/electron-remote/lib/renderer-require.js
Critical dependencies:
23:19-46 the request of a dependency is an expression
 @ ./~/electron-remote/lib/renderer-require.js 23:19-46

WARNING in ./~/electron-remote/lib/renderer-require-preload.html
Module parse failed: D:\Node\Emr\node_modules\electron-remote\lib
\renderer-require-preload.html Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (D:\Node\Emr\node_modules\acorn\dist\aco
rn.js:2221:15)
    at Parser.pp.unexpected (D:\Node\Emr\node_modules\acorn\dist\
acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (D:\Node\Emr\node_modules\acorn\
dist\acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (D:\Node\Emr\node_modules\
acorn\dist\acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (D:\Node\Emr\node_modules\acor
n\dist\acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (D:\Node\Emr\node_modules\acorn\d
ist\acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (D:\Node\Emr\node_module
s\acorn\dist\acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (D:\Node\Emr\node_modules\aco
rn\dist\acorn.js:1597:21)
    at Parser.pp$3.parseExpression (D:\Node\Emr\node_modules\acor
n\dist\acorn.js:1573:21)
    at Parser.pp$1.parseStatement (D:\Node\Emr\node_modules\acorn
\dist\acorn.js:727:47)
    at Parser.pp$1.parseTopLevel (D:\Node\Emr\node_modules\acorn\
dist\acorn.js:638:25)
    at Parser.parse (D:\Node\Emr\node_modules\acorn\dist\acorn.js
:516:17)
    at Object.parse (D:\Node\Emr\node_modules\acorn\dist\acorn.js
:3098:39)
    at Parser.parse (D:\Node\Emr\node_modules\webpack\lib\Parser.
js:902:15)
    at DependenciesBlock.<anonymous> (D:\Node\Emr\node_modules\we
bpack\lib\NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (D:\Node\Emr\node_modules\
webpack-core\lib\NormalModuleMixin.js:310:10)
    at nextLoader (D:\Node\Emr\node_modules\webpack-core\lib\Norm
alModuleMixin.js:275:25)
    at D:\Node\Emr\node_modules\webpack-core\lib\NormalModuleMixi
n.js:259:5
    at Storage.finished (D:\Node\Emr\node_modules\webpack\node_mo
dules\enhanced-resolve\lib\CachedInputFileSystem.js:38:16)
    at D:\Node\Emr\node_modules\graceful-fs\graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:439:3)
 @ ./~/electron-remote/lib ^\.\/.*$

WARNING in ./~/electron-remote/lib/renderer-require-preload.js
Critical dependencies:
16:26-68 the request of a dependency is an expression
 @ ./~/electron-remote/lib/renderer-require-preload.js 16:26-68

ERROR in ./app/main.js from UglifyJs
SyntaxError: Unexpected token: name (evalRemoteMethod) [./~/electron-remote/lib/execute
-js-func.js:24,0]

I found a couple of posts discussing about this specific issue but none of the methods they gave worked for me , https://github.com/electron-userland/electron-remote/issues/1 , https://github.com/electron-userland/electron-remote/pull/20
I think that this module will be useful for almost anyone in here , if you don't know what it is you should definitely give it a try.
Thank you

Try adding this to your dep to your ./app/package.json

yep i did , but the real problem isn't there  , this module was simply not written for webpack ,i had to change different things in different files ,  install all the librarires that the worker uses twice (local package.json) and so on , but i am still convinced that this is worth it ! let it open  i'll post all what i did soon  it will help people i am sure . ty for the suggestion

Closing this because this was resolved in dev-master. Feel free to test it out. Will merge dev-master with master and push v0.11.1on Monday


Can't open chinese_sp.model

Check before submitting issues

[X] Make sure to pull the latest code, as some issues and bugs have been fixed.
[X] Due to frequent dependency updates, please ensure you have followed the steps in our Wiki
[X] I have read the FAQ section AND searched for similar issues and did not find a similar problem or solution
[X] Third-party plugin issues - e.g., llama.cpp, text-generation-webui, LlamaChat, we recommend checking the corresponding project for solutions
[X] Model validity check - Be sure to check the model's SHA256.md. If the model is incorrect, we cannot guarantee its performance

Type of Issue
Other issues
Base Model
None
Operating System
Linux
Describe your issue in detail
I am looking at how the tokenizer for the model was created. The merge script looks fine, but the chinese_sp.model file doesn't seem to open in SentencePiece, and I get an error. Is there an issue with the file in the repo, or am I doing something wrong?
I thought this might be a protobuf error, but using the os.environ setting from the merge script doesn't change the error.
import sentencepiece as spm
model = spm.SentencePieceProcessor("chinese_sp.model")
# same result as ...
model = spm.SentencePieceProcessor()
model.Load("chinese_sp.model")

Dependencies (must be provided for code-related issues)
sentencepiece==0.1.97

Execution logs or screenshots
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/pool/work/stability/tokenizers/chinese-llama-alpaca/env/lib/python3.11/site-packages/sentencepiece/__init__.py", line 447, in Init
    self.Load(model_file=model_file, model_proto=model_proto)
  File "/mnt/pool/work/stability/tokenizers/chinese-llama-alpaca/env/lib/python3.11/site-packages/sentencepiece/__init__.py", line 905, in Load
    return self.LoadFromFile(model_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/pool/work/stability/tokenizers/chinese-llama-alpaca/env/lib/python3.11/site-packages/sentencepiece/__init__.py", line 310, in LoadFromFile
    return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Internal: src/sentencepiece_processor.cc(1101) [model_proto->ParseFromArray(serialized.data(), serialized.size())]

import sentencepiece as spm
model = spm.SentencePieceProcessor("chinese_sp.model")
# same result as ...
model = spm.SentencePieceProcessor()
model.Load("chinese_sp.model")

I encountered no error with the code above.
My sentencepiece version is sentencepiece==0.1.99

Thanks for the quick reply. I tried re-downloading the model and it was fine, I must have gotten a bad version somehow. Sorry for the noise.


Ported the library to C#

Just wanted to say that I've ported this library to C#: https://github.com/rds1983/DdsKtxSharp

Cool. Nice work!
I'll link this to readme

Thanks for the link.
But it has small error.

DdsKtxSharp: C# Wrapper for dds-ktx by Roman Shapiro
DdsKtxSharp isn't wrapper(aka bindings), but port. C code had been converted to C#.

sorry my bad.
fixed.


debuggability : add --debug option to istioctl kube-inject (with default on for 0.2)

Right now we do inject debug images but
a) they ship with readOnlyRoot fs so not much can be done with them
b) they ship without privileges - so for instance you can't run iptables
c) they have too much unnecessary stuff that could be installed only if needed by the person debugging / needing them (using sudo proxy-redirection-clear && sudo apt-get install favortitepkg && sudo proxy-redirection-restore if a & b are fixed)
the flag would turn on
diff --git a/platform/kube/inject/inject.go b/platform/kube/inject/inject.go
index b8d5da6..2d5ed1c 100644
--- a/platform/kube/inject/inject.go
+++ b/platform/kube/inject/inject.go
@@ -263,7 +263,7 @@ func injectIntoPodTemplateSpec(p *Params, t *v1.PodTemplateSpec) error {
 		})
 	}

-	readOnly := true
+	readOnly := false
 	sidecar := v1.Container{
 		Name:  ProxyContainerName,
 		Image: p.ProxyImage,
@@ -294,6 +294,8 @@ func injectIntoPodTemplateSpec(p *Params, t *v1.PodTemplateSpec) error {
 		SecurityContext: &v1.SecurityContext{
 			RunAsUser:              &p.SidecarProxyUID,
 			ReadOnlyRootFilesystem: &readOnly,
+			// TODO: Determine SELINUX options needed to remove privileged
+			Privileged: &privTrue,
 		},
 		VolumeMounts: volumeMounts,
 	}

also with --debug=false the non debug image would be injected
(and we should test both)
cc @andraxylia

going to do this now

Fixed


Docs Update -- Contact/Help

In the nav-bar, we have a section Contact with links for people to contact us, get help, etc. This could use a cleanup pass. Some things to figure out:

What's the purpose of this section?
What should be the label?
Should we merge the GitHub and Twitter icons on the right, or keep them separate?

Some similar projects to consult to see how they structure things:

https://fairlearn.org
https://pandas.pydata.org
https://scikit-learn.org/stable/
https://www.tensorflow.org
https://pytorch.org
https://www.rust-lang.org

@raprasad just mentioned that if we change the URL from https://docs.opendp.org/en/stable/contact/index.html to please let him know so he can make the adjustment in DP Creator.

I just made pull request #277 as a minimal clean up pass but I'll comment below on specific questions @andrewvyrros has raised:

What's the purpose of this section?

I'm influenced by https://dataverse.org/contact where a variety of ways to contact the project are presented, like this:

The idea is that somebody wants to contact the project for one reason or another. They found a bug. They have a question. They want to discuss something on a forum. They want to discuss something privately.
In the pull request, I added a few more items (mailing list, issue tracker, security email) so that it looks like this:

What should be the label?

If we're fine with how things are, "Contact" is fine. If we want something fairly different, we should pick an appropriate label like "Community" or whatever we're going for.

Should we merge the GitHub and Twitter icons on the right, or keep them separate?

I think they're fine. They're small.

Some similar projects to consult to see how they structure things:

I looked briefly at these with question "From the header can I tell how I'd contact people involved in the project?" Generally, it seems like these projects are coming more from the perspective of "Given how many people are asking for support, how can I get them talking to each other?" We're doing this with GitHub Discussions but at this early stage I think it's ok to promote the idea of reaching out to us (in addition to each other).
I hope this makes sense! I'm totally fine with a complete re-do of "Contact" into something else.


FIX: Avoid unnecessary connections based on branching logic

After #2444, init_bbreg_wf would crash when bold2t1w_init == 'register' and use_bbr is False.
Originally implemented in https://github.com/nipreps/nibabies/pull/95

@mgxd I just upstreamed this to master, just to be sure - Was that expected?

yes, as long as #2444 was upstreamed as well

Yes, that was upstreamed already.


Laravel 10.x Compatibility

This is an automated pull request from Shift to update your package code and dependencies to be compatible with Laravel 9.x.
Before merging, you need to:

Checkout the l10-compatibility branch
Review all comments for additional changes
Thoroughly test your package

If you do find an issue, please report it by commenting on this PR to help improve future automation.

:warning: Shift detected GitHub Actions which run jobs using a version matrix. Shift attempted to update your configuration for Laravel 10. However, you should review these changes to ensure the desired combination of versions are built for your package.

:alembic: Using this package? If you would like to help test these changes or believe them to be compatible, you may update your project to reference this branch.
To do so, temporarily add Shift's fork to the repositories property of your composer.json:
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/laravel-shift/laravel-sqlite-fluent-drop-foreign.git"
        }
    ]
}

Then update your dependency constraint to reference this branch:
{
    "require": {
        "exolnet/laravel-sqlite-fluent-drop-foreign": "dev-l10-compatibility",
    }
}

Finally, run: composer update

Already updated.


HOWTOs

Collection of useful HOWTOs
:warning:  Warning

These modifications will override the default behavior and configuration of TSDX. As such they can invalidate internal guarantees and assumptions. These types of changes can break internal behavior and can be very fragile against updates. Use with discretion!

How to correctly transpile spread on iterables (Set, Map)
How to change output folder name from "dist" to "build"
How to 'play nicely' with tsdx + VS Code + eslint
How to setup app with live reload for React Native
How to configure project to use aliases
How to configure aliases and avoid specifying folders manually
How to ship components with images properly
How to load a font into the code
How to configure a static assets folder

How to run tests in stream (non-watch) mode
package.json
{
  "scripts":
    {
       "test": "CI=true tsdx test --color"
    }
}

How to collect test coverage
package.json
{
  "scripts":
    {
       "test:coverage": "CI=true tsdx test --color --coverage"
    },
    "jest":
    {
        "collectCoverageFrom": [
            "<rootDir>/src/**/*.{ts,tsx}"
         ],
         "coverageReporters": [
            "lcov",
            "text-summary"
         ]
    }
}

How to correctly transpile spread on iterables (Set, Map) https://github.com/jaredpalmer/tsdx/issues/376
tsconfig.json
  "downlevelIteration": true

package.json
{
  "scripts":
    {
       "build": "tsdx build --target node"
    }
}

How to cange output folder name from "dist" to "build" https://github.com/jaredpalmer/tsdx/issues/351
tsdx.config.js
module.exports = {
  rollup(config, options) {
    config.output.file = config.output.file.replace('dist', 'build');

    return config;
  },
};

How to 'play nicely' with tsdx + VS Code + eslint https://github.com/jaredpalmer/tsdx/issues/354
https://github.com/jaredpalmer/tsdx#npm-run-lint-or-yarn-lint
run npm run lint --write-file or yarn lint --write-file to generate .eslintrc.js file

nice. worth adding to docs when you think its ready.

@sw-yx  yep) can you plz add label documentation for this issue?

How to override rollup-plugin-typescript2 configuration https://github.com/jaredpalmer/tsdx/issues/294
tsdx.config.js
import rpts2 from "rollup-plugin-typescript2";

module.exports = {
  rollup(config, options) {
    config.plugins = config.plugins.map(plugin => {
      if (plugin && plugin.name === "rpt2") {
        return rpts2({
          // properties that I added for demonstration purposes
          clean: true,
          objectHashIgnoreUnknownHack: true,
          // properties in the current internal implementation of tsdx
          typescript: require("typescript"),
          cacheRoot: `./.rts2_cache_${options.format}`,
          tsconfig: options.tsconfig,
          tsconfigDefaults: {
            compilerOptions: {
              sourceMap: true,
              declaration: true,
              jsx: "react"
            }
          },
          tsconfigOverride: {
            compilerOptions: {
              target: "esnext"
            }
          }
        });
      }

      return plugin;
    });

    return config;
  }
};

How to setup Example app with live reload for React Native
Note: This is a hack, rather than a solution. This hack requires the example app to be in Javascript  instead of TypeScript to prevent additional configuration needed.

Init a react-native app using your favorite CLI. (I use ReactNative CLI) in the root dir of the library (aka example should stay on the same level of src)
Create tsdx.config.js in the root dir if you haven't already
Overide TSDX config with the following:

module.exports = {
   rollup(config, options) {
      const { localDev, name } = options; // localDev can be whatever name you want
      if (localDev) {
          config.output.file = config.output.file.replace('dist', `example/${name}`);
          return config;
      }
      return config;
   }
}

Setup a script in package.json

{
   ...
   scripts: {
      "watch": "tsdx watch",
      "dev": "tsdx watch --localDev", // <-- add this line, localDev is just a property name
   }
}

Could we pin this issue like the who is using this lib issue? :)

How to configure project to use aliases for importing modules to avoid '../../../' hell https://github.com/jaredpalmer/tsdx/pull/374#issuecomment-567687288 https://github.com/jaredpalmer/tsdx/issues/336
package.json
"devDependencies": {
  "babel-plugin-module-resolver": "^4.0.0"
}

tsconfig.json
"compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "comp": ["./src/comp"],
      "utils": ["./src/utils"],
      "*": ["src/*", "node_modules/*"]
    }
 }

.babelrc
  "plugins": [
    [
      "module-resolver",
      {
        "root": "./",
        "alias": {
          "comp": "./src/comp",
          "utils": "./src/utils",
          "*": ["src/*", "node_modules/*"]
        }
      }
    ]
  ]

How to ship components with images properly https://github.com/jaredpalmer/tsdx/issues/278#issuecomment-563184800 https://github.com/jaredpalmer/tsdx/issues/386
tsdx.config.js
const rpts2 = require('rollup-plugin-typescript2')
const url = require('@rollup/plugin-url')

module.exports = {
  rollup(config, options) {
    config.plugins = [
      // Force the `url` plugin to emit files.
      url({ limit: 0, incude: ['**/*.png', '**/*.jpg'] }),
      ...config.plugins,
    ]

    // @rollup/plugin-url uses async/await, so we need to ensure
    // `objectHashIgnoreUnknownHack` is enabled on rpts2
    config.plugins = config.plugins.map(plugin => {
      if (plugin && plugin.name === 'rpt2') {
        return rpts2({
          clean: true,
          objectHashIgnoreUnknownHack: true,

          typescript: require('typescript'),
          cacheRoot: `./.rts2_cache_${options.format}`,
          tsconfig: options.tsconfig,
          tsconfigDefaults: {
            compilerOptions: {
              sourceMap: true,
              declaration: true,
              jsx: 'react',
            },
          },
          tsconfigOverride: {
            compilerOptions: {
              target: 'esnext',
            },
          },
        })
      }

      return plugin
    })

    return config
  },
}

@ambroseus why is your version so complex? What is the value going out of this?
This results in a data string: const img = 'data:image/png;base64,iVBORw0KGgoAAAANSUh......
I ended up doing this
const images = require('@rollup/plugin-image');

module.exports = {
  rollup(config, options) {
    config.plugins = [
      images({ incude: ['**/*.png', '**/*.jpg'] }),
      ...config.plugins,
    ]

    return config
  },
}

How to load a font into the code.
This uses @rollup/plugin-url, and therefore I want @ambroseus suggestion to still be here. This long complex thing is needed because there is some async mechanism being used inside this library. Therefore we need to tackle that inside typescript with the following solution
Force inline wrapping the option in url plugin, tolimit:Infinity,.
Force the plugin to emit files, use limit:0,
const rpts2 = require('rollup-plugin-typescript2')
const url = require('@rollup/plugin-url')

module.exports = {
  rollup(config, options) {
    config.plugins = [
      // Force the `url` plugin to emit files.
      url({ include: ['**/*.ttf'] }),
      ...config.plugins,
    ]

    // @rollup/plugin-url uses async/await, so we need to ensure
    // `objectHashIgnoreUnknownHack` is enabled on rpts2
    config.plugins = config.plugins.map(plugin => {
      if (plugin && plugin.name === 'rpt2') {
        return rpts2({
          clean: true,
          objectHashIgnoreUnknownHack: true,

          typescript: require('typescript'),
          cacheRoot: `./.rts2_cache_${options.format}`,
          tsconfig: options.tsconfig,
          tsconfigDefaults: {
            compilerOptions: {
              sourceMap: true,
              declaration: true,
              jsx: 'react',
            },
          },
          tsconfigOverride: {
            compilerOptions: {
              target: 'esnext',
            },
          },
        })
      }

      return plugin
    })

    return config
  },
}

Then you can use this wherever you need in the code, also as a Global font face in emotion.
import React from 'react';
import { Global, css } from '@emotion/core'
import RalewayRegular from './assets/fonts/Raleway-Regular.ttf';

export default () => {
  return (
    <Global
      styles={css`
        @font-face {
          font-family: 'Raleway';
          font-style: normal;
          font-weight: 100 400;
          src: url(${RalewayRegular}) format('truetype');
        }
        body, button {
          font-family: 'Raleway', sans-serif;
        }
      `}
    />
  )
}

@vongohren  thanks for the solution!
@jaredpalmer  @agilgur5  ^^^ +1 configuration hack :)  , +1 to think about tsdx-plugins approach

Slightly better approach to configure aliases to avoid specifying folders manually:
package.json
"devDependencies": {
  "babel-plugin-module-resolver": "^4.0.0"
}

tsconfig.json (no paths)
"compilerOptions": {
  "include": [ "src" ],
  "baseUrl": "./src"
 }

babel.config.js
const { readdirSync } = require('fs');

const resolveAlias = readdirSync("./src", { withFileTypes: true })
    .filter(entry => entry.isDirectory())
    .reduce(
        (aliases, dir) => {
            aliases[dir.name] = "./src/" + dir.name;
            return aliases;
    }, { "*": ["src/*", "node_modules/*"] });

module.exports = function (api) {
  api.cache(true);

  return {
    plugins: [
      [ "module-resolver", { root: "./", alias: resolveAlias } ]
    ]
  };
}

There should be HOWTO for Visual Studio Code's Jest plugin as well (maybe something like eslint's "write to file")

@ambroseus @vongohren I tried using your @rollup/plugin-image solution. Unfortunately, it is still not working.
I have tested it by using tsdx in my library while using CRA for my app.

@arvinsim that is strrange, because I use it in prod right now, and it works even fine in storybook
The D is an image

Are you using this comment? Because that is what im using

@vongohren May I know what version of TSDX and plugins that you are using? My package versions
"tsdx": "^0.12.3",
"@rollup/plugin-image": "^2.0.0"

@vongohren Okay so I found the issue. It was because babel-plugin-file-loader was set up. It overrode the output directory of @rollup/plugin-image. Once I remove it, it now works.

There should be HOWTO for Visual Studio Code's Jest plugin as well (maybe something like eslint's "write to file")

I was able to get the Jest plugin working by adding a jest.config.js file to my top level and adding:
module.exports = {
  transform: {
    '^.+\\.tsx?$': 'ts-jest'
  }
}

Updating here as I did in #294 that async Rollup plugins are now supported out-of-the-box with v0.13.0, which was just released.
I've taken the liberty of editing some of the examples here to reflect that.

@agilgur5  awesome! HOWTO with rpt2 & objectHashIgnoreUnknownHack was removed

How to configure a static assets folder
// tsdx.config.js
let static_files = require('rollup-plugin-static-files');

module.exports = {
  rollup(config) {
    config.plugins.push(
      static_files({
        include: ['./static'],
      })
    );
    return config;
  },
};

Let’s get these into the new docs site

I'm posting this here in case it saves someone setup time with @rollup/plugin-image.
It needs to be added as the 1st plugin in your config.plugins array to work correctly!!!
module.exports = {
  rollup(config, options) {
    config.plugins.push(
	  ... your plugins here ...
    );

    // Per docs for @rollup/plugin-image it needs to be first plugin
    config.plugins.unshift(
      image({
        include: ['**/*.png', '**/*.jpg']
      })
    );

    return config;
  }
};

@brandoneggar comments above already state that and put it first, so that is duplicative

I tried to follow @vongohren's Font How-To https://github.com/formium/tsdx/issues/379#issuecomment-569011510
I added the rollup dependency:
yarn add --dev @rollup/plugin-url

Instead of .ttf files I use .woff2 in the tsdx.config.js example posted in the comment.
I had to add a fonts.d.ts file to the types folder for VSCode to not complain about my font imports:
declare module '*.woff2';

However, I'm having an issue in which the fonts are not being found when running yarn build
Error: Could not resolve './assets/fonts/MyFont/MyFont-Regular.woff2' from src/fonts.ts

    at error (/<user-path>/react-component-library/node_modules/rollup/dist/shared/node-entry.js:5400:30)

My fonts.ts file looks like:
import { css } from '@emotion/react'

import MyFontRegular from './assets/fonts/MyFont/MyFont-Regular.woff2';

export const fontStyles = css`
@font-face {
  font-family: 'My Font';
  font-style: normal;
  font-weight: 400;
  src: url(${MyFontRegular}) format('woff2');
}
`

I'm not sure where I am going wrong.  This is basically off a vanilla tsdx project using the react-storybook template.

@ambroseus I struggled for some time with the .babelrc config for rewriting paths until I realized that module-resolver doesn't handle TypeScript files by default.
In your example, the options object should include an array of TypeScript extensions:
  "plugins": [
    [
      "module-resolver",
      {
        "root": "./",
        "alias": {
          "comp": "./src/comp",
          "utils": "./src/utils",
          "*": ["src/*", "node_modules/*"]
        },
        "extensions": [".ts", ".tsx"]
      }
    ]
  ]

I'm still struggling with Cannot find module 'xxx' or its corresponding type declarations in the file where I want to use an alias

@arvigeus , I think there's a small typo in your comment for aliasing for the tsconfig.json (link)
I believe this

"compilerOptions": {
  "include": [ "src" ],
  "baseUrl": "./src"
 }

should be this:

  "include": [ "src" ],
"compilerOptions": {
  "baseUrl": "./src"
 }

(include is not a compilerOption in tsconfig)

@arvigeus
this solution doesn't appear to work for test execution, is there any workaround?

I have an Issue. I want to know how to change port number when running an development mode.

How to configure a static assets folder
// tsdx.config.js
let static_files = require('rollup-plugin-static-files');

module.exports = {
  rollup(config) {
    config.plugins.push(
      static_files({
        include: ['./static'],
      })
    );
    return config;
  },
};

good for shipping static CSS that the user can import without assuming bundler setup

Hey, is it possible to include these static files within a specified directory, instead of just the root of dist

How to configure a static assets folder
// tsdx.config.js
let static_files = require('rollup-plugin-static-files');

module.exports = {
  rollup(config) {
    config.plugins.push(
      static_files({
        include: ['./static'],
      })
    );
    return config;
  },
};

good for shipping static CSS that the user can import without assuming bundler setup

Hey, is it possible to include these static files within a specified directory, instead of just the root of dist

up

I got HTML files within a node module that are being used as an email template.
I got them under /template folder, but when I pack them, they are at /dist root, is there a way to save them under dist/template?
Thanks!

Import your assets like:
const asset = require('..//*.png');**
and in your tsdx.config.js
module.exports = {
rollup(config, options) {
config.plugins.push(
images({ include: ['/.png', '**/.jpg'] }),**
url({ exclude: ['/.png', '**/.jpg'], limit: 0 }),**
...otherconfig
return config;
},
};

      static_files({
        include: ['./static'],
      })

This works but when I set include: ['./src/assets', './src/styles'], it copies the files and folders in assets and styles straight into dist folder not under dists>assets and dist>styles

      static_files({
        include: ['./static'],
      })

This works but when I set include: ['./src/assets', './src/styles'], it copies the files and folders in assets and styles straight into dist folder not under dists>assets and dist>styles

The answer is I should have simply set include: ['./src'].


JS does not respond with remove link

I'm integrating your excellent gem in a Rails app. Everything is working except the js callbacks to modify the form appearance. I can add and remove objects, but when I click on the add or remove links, my custom before-insert and before-remove actions are not triggering. Can you help me figure out what I am doing wrong?
custom_cocoon.js:
$(document).ready(function() {
alert('Custom Cocoon js is loaded.')
$('#special_diets')
.on('cocoon:before-insert', function() {
alert('Before insert')
})
.on('cocoon:after-insert', function() {
alert('After insert')
})
.on('cocoon:before-remove', function(e, special_diet) {
// allow some time for the animation to complete
$(this).data('remove-timeout', 1000);
special_diet.fadeOut('slow');
});
});
My form:

Special Diet Needs (Click on the 'Add a Special Diet' link below to tell us about special diet requirements, including food allergies)

<%= r.semantic_fields_for :special_diets do |special_diet| %>
<%= render 'roster_item/special_diet_fields', f: special_diet %>
<% end %>

<%= link_to_add_association 'Add a Special Diet', r, :special_diets, partial: 'roster_item/special_diet_fields' %>

The nested form partial:

  <%= f.inputs do %>
    <%= f.input :special_diet_type_id, label: 'Select your dietary need', as: :radio, collection: SpecialDietType.all %>
    <%= f.input :allergy_related, label: 'Is this related to an allergy?', as: :radio %>
    <%= f.input :severity, label: 'How severe is the allergy?', as: :select, collection: SpecialDiet::VALID_SEVERITY_VALUES %>
    <%= f.input :trigger, label: 'What causes or triggers the allergy?', as: :select, collection: SpecialDiet::VALID_TRIGGER_VALUES %>
    <%= f.input :note, label: 'What else would you like to share about this?', as: :string, maxlength: 255 %>
    <%= link_to_remove_association 'Remove This Special Diet', f %>
  <% end %>

Any guidance you can provide will be greatly appreciated!

Two remarks:

please format your code in a legible way (it is really easy)
to fix this problem, as documented please wrap your partial in a surrounding div, the default class is nested-fields, but you could also choose a different class (by specifying the wrapper_class option for your link_to_remove_association.

Thank you for responding. Sorry about the formatting.
The partial is wrapped in a nested-fields class as shown in the documentation:

<%= f.inputs do %>
    <%= f.input :special_diet_type_id, label: 'Select your dietary need', as: :radio, collection: SpecialDietType.all %>
    <%= f.input :allergy_related, label: 'Is this related to an allergy?', as: :radio %>
    <%= f.input :severity, label: 'How severe is the allergy?', as: :select, collection: SpecialDiet::VALID_SEVERITY_VALUES %>
    <%= f.input :trigger, label: 'What causes or triggers the allergy?', as: :select, collection: SpecialDiet::VALID_TRIGGER_VALUES %>
    <%= f.input :note, label: 'What else would you like to share about this?', as: :string, maxlength: 255 %>
    <%= link_to_remove_association 'Remove This Special Diet', f %>
  <% end %>

Could the problem be in my javascript code? None of the alerts, other than the first one, is firing.
`$(document).ready(function() {
    alert('Custom Cocoon js is loaded.')
    $('#special_diets')
        .on('cocoon:before-insert', function() {
            alert('Before insert')
        })
        .on('cocoon:after-insert', function() {
            alert('After insert')
        })
        .on('cocoon:before-remove', function(e, special_diet) {
            // allow some time for the animation to complete
            $(this).data('remove-timeout', 1000);
            special_diet.fadeOut('slow');
        });
});`

This looks better. In the initial question there was no wrapping class, right?
So clicking the link_to_add_association does work? But the callbacks do not? And the removal also does not?
If the link_to_add_association works, at least the cocoon js is loaded correctly, in which the remove should also work (if you use the correct wrapper-class).
For the callbacks it is essential to attach them to a surrounding div, that exists at the time the js code is run. Unfortunately it is impossible for me to see that #special_diets exists in your page (I see no such definition in what you have shown me).

Nathan,
Thanks again for your help with this. This is what the relevant part of the main form looks like, and it is working. It looks like

Special Diet Needs (Click on the 'Add a Special Diet' link below to tell us about special diet requirements, including food allergies)

              <%= r.semantic_fields_for :special_diets do |special_diet| %>
                <%= render 'roster_item/special_diet_fields', f: special_diet %>
              <% end %>

              <%= link_to_add_association 'Add a Special Diet', r, :special_diets, partial: 'roster_item/special_diet_fields' %>

Is everything working? Things I still see:

you have a class .special_diets and I do not see an #special_diets (to which you attached the callbacks)
to capture the events, you need the surrounding class of the link_to_add_association, which in your example would be .diet-section

If you need the erb examples, you can find those here

Nathan,
Thank you again for your help on this. This are working, but not quite the way I would like them to
This is the main form:

Special Diet Needs (Click on the 'Add a Special Diet' link below to tell us about special diet requirements, including food allergies)

    <%= r.semantic_fields_for :special_diets do |special_diet| %>
      <%= render 'roster_item/special_diet_fields', f: special_diet %>
    <% end %>

      <%= link_to_add_association 'Add a Special Diet', r, :special_diets, partial: 'roster_item/special_diet_fields' %>

And the subform:

  <%= f.inputs do %>
    <%= f.input :special_diet_type_id, label: 'Select your dietary need', as: :radio, collection: SpecialDietType.all %>
    <%= f.input :allergy_related, label: 'Is this related to an allergy?', as: :radio %>
    <%= f.input :severity, label: 'How severe is the allergy?', as: :select, collection: SpecialDiet::VALID_SEVERITY_VALUES %>
    <%= f.input :trigger, label: 'What causes or triggers the allergy?', as: :select, collection: SpecialDiet::VALID_TRIGGER_VALUES %>
    <%= f.input :note, label: 'What else would you like to share about this?', as: :string, maxlength: 255 %>
    <%= link_to_remove_association 'Remove This Special Diet', f, { wrapper_class: 'special_diet'} %>
  <% end %>

And the JS:
$(document).ready(function() {
alert('Custom Cocoon js is loaded.')
$('#special_diets')
.on('cocoon:before-insert', function() {
alert('Before insert')
})
.on('cocoon:after-insert', function() {
alert('This special diet will be added.')
})
.on('cocoon:before-remove', function(e, special_diet) {
// allow some time for the animation to complete
$(this).data('remove-timeout', 1000);
special_diet.fadeOut('slow');
});
});
What is working:

The js is firing. The alerts take place and the before-remove action (fade out) is taking place.
The subform’s models are being added and displayed correctly. The remove link is also removing the correct linked object.

But:

Since the special_diet class encloses the link_to_add_association, this link disappears when I remove a subform. This is not desired, since I still want to be able to add additional objects after removing one.
If I change the form so that the special_diet div does not include the link_to_add_association, it stops working.

Thoughts?
Rick Eaton
Eaton Nonprofit Solutions
916-718-5063
http://www.eatonnpsolutions.comhttp://www.eatonnpsolutions.com/
From: Nathan Van der Auwera<EMAIL_ADDRESS>Reply-To: nathanvda/cocoon<EMAIL_ADDRESS>Date: Monday, March 2, 2020 at 9:33 AM
To: nathanvda/cocoon<EMAIL_ADDRESS>Cc: Rick Eaton<EMAIL_ADDRESS>State change<EMAIL_ADDRESS>Subject: Re: [nathanvda/cocoon] JS does not respond with remove link (#574)
Is everything working? Things I still see:

you have a class .special_diets and I do not see an #special_diets (to which you attached the callbacks)
to capture the events, you need the surrounding class of the link_to_add_association, which in your example would be .diet-section

If you need the erb examples, you can find those herehttps://github.com/nathanvda/cocoon/wiki/ERB-examples
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHubhttps://github.com/nathanvda/cocoon/issues/574?email_source=notifications&email_token=AAHIDYY22L4XUECZBDBJE2LRFPUYDA5CNFSM4K7JB22KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENQGY4Y#issuecomment-593521779, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHIDY4WG24YXN2UJZTWH33RFPUYDANCNFSM4K7JB22A.

Why did you use wrapper_class: 'special_diet'  ? just remove that option in the link_to_remove_association. Your nested fields are wrapped in the default class .nested-fields so the default behaviour will work.

Nathan,
Thank you so much for your reply. That did it!
Rick
Rick Eaton
Eaton Nonprofit Solutions
916-718-5063
http://www.eatonnpsolutions.comhttp://www.eatonnpsolutions.com/
From: Nathan Van der Auwera<EMAIL_ADDRESS>Reply-To: nathanvda/cocoon<EMAIL_ADDRESS>Date: Monday, March 2, 2020 at 11:21 PM
To: nathanvda/cocoon<EMAIL_ADDRESS>Cc: Rick Eaton<EMAIL_ADDRESS>State change<EMAIL_ADDRESS>Subject: Re: [nathanvda/cocoon] JS does not respond with remove link (#574)
Why did you use wrapper_class: 'special_diet' ? just remove that option in the link_to_remove_association. Your nested fields are wrapped in the default class .nested-fields so the default behaviour will work.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHubhttps://github.com/nathanvda/cocoon/issues/574?email_source=notifications&email_token=AAHIDYYD3R25HJPJHJNNRVDRFSVYJA5CNFSM4K7JB22KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENSL72I#issuecomment-593805289, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHIDYZFT7L6NLIAVRI536DRFSVYJANCNFSM4K7JB22A.


Should allow for config-based external name generation

I.e. something like:
output: {
  externals: {
    'handlebars/dist/cjs/handlebars/safe-string': 'SafeString'
  }
}

This gives users more flexibility with export names, particularly when shimming and other requirements would make a lot of unnecessary overhead or an incorrect export. If the config entry conflicts with an existing entry, then the config entry will override.

Released in 2.0.0


[LITE] Add the missed header for osx platform in micro_speech example for makefile.

When we use the target specific "audio_provider.cc"[1], we should also add
its header dependency[2] in makefile.
[1]
tensorflow/lite/experimental/micro/examples/micro_speech/osx/audio_provider.cc
[2]
tensorflow/lite/experimental/micro/examples/micro_speech/simple_features/simple_model_settings.h

@petewarden
Could you please review this pr?

@JerryShih Could you please check failed build errors? Thanks!

@JerryShih Could you please check failed build errors? Thanks!

@gbaned
I have no idea for the failed windows build. I don't think these errors are related to my patch.
And I also check the same tests in other pr. They hit the same error too(e.g. https://source.cloud.google.com/results/invocations/bbcc967b-10dd-4e98-93f4-7bc7f5126ddb/targets).
Here are the logs:
external/local_config_mlir/lib/TableGen/Constraint.cpp(66): error C2061: syntax error: identifier 'StringRef'
external/local_config_mlir/lib/TableGen/Constraint.cpp(68): error C2511: 'mlir::tblgen::AppliedConstraint::AppliedConstraint(mlir::tblgen::Constraint &&)': overloaded member function not found in 'mlir::tblgen::AppliedConstraint'

@petewarden
I rebase to current master. Maybe the failed tests could pass.
I have no idea for the failed windows build. I don't think these errors are related to my patch.
And I also check the same tests in other pr. They hit the same error too(e.g. https://source.cloud.google.com/results/invocations/bbcc967b-10dd-4e98-93f4-7bc7f5126ddb/targets).

Can one of the admins verify this patch?

gentle ping @petewarden for review ? Thanks!

@JerryShih  Can you please resolve conflicts? Thanks!

@gbaned

@JerryShih Can you please resolve conflicts? Thanks!

I just rebase to the current master.


Add dynamic time stamp to build system

Add dynamic time stamp to build system
Description

Add dynamic time stamp to build system instead of the one marked manually programatically

Platform

Web Version [X]
Windows [X]
Linux [X]

Implemented!


Add PostFields Support to ClientRequest

This PR Add Postfields Suport to ClientRequest.
Description

Added postFileds to option enum and setup method for this. It's enabled send post with a data.
Motivation and Context
When sending external API request on Kitura, we generally use the ClientRequest.But ClientRequest isn't support a sending post with a data, so we can't use major external API by Kitura, Kitura-net.

How Has This Been Tested?
I confirmed it can post a data by requested to my own server and view logs. And  I added a test code of postFileds to ClientRequestTests.swift.

Checklist:

I have submitted a CLA form, just now 😸

[x] I have submitted a CLA form
[x] If applicable, I have updated the documentation accordingly.
[x] If applicable, I have added tests to cover my changes.

Hey we are actually moving all development to be PRs against master. Please reopen your PR against the master branch.


Update oqc path and python version

Context:
Newly released OQC packaged contains a path update.
Description of the Change:
scc.compiler.config -> qcaas_client.config
Also compatible with python 3.11 and 3.12.

[sc-70536]


Instagram Bridge - Hashtag feed keeps failing.

Hi,
All Instagram hashtag feed keeps failing and forcefully turn off by ifttt. I think something is wrong

Cannot reproduce. How many Instagram feeds are you retrieving at the same time, are you being rate limited?
Try to cool off for a couple of days for your IP address to be kicked off the blacklist.

I pull up to 3 hashtags and 3 feeds from 3 username.. what is the recommended number of feed ?

It's whatever Instagram's black magic deems acceptable. :)
I checked and I'm subscribed to 9 usernames every couple hours, so it's probably not rate limiting, unless IFTTT really spams the feeds.
Can you access the feeds directly? Might be an issue with IFTTT.

@realpassive Is this still an issue? Could this be related to #1368?

yes it is

@realpassive I think what @LogMANOriginal meant to say is have you tried with the latest RSS Bridge release? It was released yesterday.
https://github.com/RSS-Bridge/rss-bridge/releases/tag/2019-12-01

@realpassive Is this still an issue?


Add wrapper script for running gingko locally

This change is

Coverage decreased (-0.01%) to 45.365% when pulling 30f4cf2a418ccbcf89a7a3a5afbd35b554480960 on pr/ci-wrapper into 127e7d3f5c6756fda8918d9015bc366b8ca31f99 on master.


Varp updates should send varbit events

Could also limit variables from changing varbits, either way not a whole lot of benefit atm outside of removing PrayerStart/Stop. Won't do for now.


x/pkgsite: package docs missing for packages that use "//go:build" without "// +build"

What is the URL of the page with the issue?
https://pkg.go.dev/testing@master
What is your user agent?
Mozilla/5.0 (X11; CrOS x86_64 14150.64.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.104 Safari/537.36

Screenshot

What did you do?
Load docs for the testing package after CL 344955
What did you expect to see?
Docs for the testing package.
What did you see instead?
Only a listing of subdirectories.

This is fixed and deployed for the stdlib at the current tip. Since the problem was in our preprocessing stage, other modules might need to be reprocessed. I've already reprocessed<EMAIL_ADDRESS>and github.com/bcmills/more@main. If your module is still affected, comment here.


Fetch service in service instances card via store rather than inline

fixes #4397
accessing entity via this.serviceInstanceEntity.entity.service_plan.entity.service.entity.service_broker_guid can sometimes fail
fetch service, and thus service broker guid, from store instead
this matches the table way of getting the broker

Codecov Report

Merging #4417 into master will decrease coverage by 0.29%.
The diff coverage is 70.00%.

@@            Coverage Diff             @@
##           master    #4417      +/-   ##
==========================================
- Coverage   56.53%   56.23%   -0.30%
==========================================
  Files         886      891       +5
  Lines       28915    29158     +243
  Branches     4198     4217      +19
==========================================
+ Hits        16347    16398      +51
- Misses      12568    12760     +192


File open/save dialog is huge

Issue Type: Bug
My monitor is 1920x1080. The VS Code workspace looks great. However, the file open & save dialogs are enormous, with huge font sizes. Thes look fine in other apps. How can I control the font size and/or scaling of the open & save dialogs?
VS Code version: Code 1.42.1 (c47d83b293181d9be64f27ff093689e8e7aed054, 2020-02-11T14:45:59.656Z)
OS version: Windows_NT x64 10.0.18363

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2592)

GPU Status
2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmetal: disabled_offmultiple_raster_threads: enabled_onoop_rasterization: disabled_offprotected_video_decode: enabledrasterization: enabledskia_renderer: disabled_offsurface_control: disabled_offsurface_synchronization: enabled_onvideo_decode: enabledviz_display_compositor: enabled_onviz_hit_test_surface_layer: disabled_offwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
15.73GB (8.43GB free)

Process Argv

Screen Reader
no

VM
0%

Extensions: none

This is on a secondary monitor. On the primary monitor, it looks fine.

/duplicate of #88708


README: update URL for downloading the PHAR

Description
The GH Pages website has been re-activated under a new domain - phars.phpcodesniffer.com -.
The PHARs can now be downloaded from that domain and PHIVE should work as well, though a PR to phar.io will be needed to update the PHIVE alias redirect.
Suggested changelog entry
The permanent address for PHAR downloads and downloading the PHARs via PHIVE has changed to phars.phpcodesniffer.com
Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to change)

[ ] This change is only breaking for integrators, not for external standards or end-users.

[ ] Documentation improvement

Note: CI checks do not run on markdown file only changes.


[Bug] After installing V1.9.8, the application opens to a blank screen.

版本：1.9.8
现象：安装后打开，应用为白屏，只有顶部file菜单。
尝试：尝试删除mqttx.db文件、尝试以管理员身份启动，均无作用

Thank you for reporting this issue. To better understand and resolve this issue, please let us know which version of MQTTX you were using before upgrading to 1.9.8? Knowing the previous version could help us pinpoint any changes or updates causing this problem.

As a part of our troubleshooting process, we would like to check if the issue might be related to a database migration error when upgrading to version 1.9.8. Could you please look at your MQTTX database file, specifically the SettingEntity table, and see if there are any newly added fields?

This information will help us determine if the white screen issue is due to a failure in database migration from an older version to the latest version. Your cooperation is very important and will help us resolve this issue quickly.

same problem! help!

我这边也是<IP_ADDRESS>，这边出现白屏的可能是因为接收到的json数据比较大，有462k，软件先显示了json字符串，等一会软件就变成白板了，使用菜单[显示]->[重新加载]，会显示主界面，然后又变成白板。

Use two ways to handle the white screen situation at https://github.com/emqx/MQTTX/releases/tag/v1.10.0

By resetting the database
Optimizing the display of large messages in the message list

Thanks for your feedback. If there is any problem, I will reopen this issue.

这个问题仍然没有解决，我是通过打开MQTTX.db),删除MessageEntity表中的最新数据（订阅到的json数据大），然后点击菜单[显示]-->[强制重新加载]，显示正常。


[BUG] Double text input on Windows

https://user-images.githubusercontent.com/47496233/125538033-157e26b3-3f4a-4be5-b834-9397211c3034.mp4
one key press from the keyboard is registering as multiple inputs at once

Yes got this several times, previously an issue within master. If it isn't fixed flutter side within releasing the newer version then I'll manually build with stable

Yes got this several times, previously an issue within master. If it isn't fixed flutter side within releasing the newer version then I'll manually build with stable

Can't reproduce on stable


Create a socket for docker/docker Go API usage

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
gitlab-runner tries to call to docker using the socket HTTP API. This does not work on CentOS 8 because podman-docker doesn't expose that API. I think a simple daemon that set up the socket and listened for the API calls and turned them into podman commands to run would suffice.
Steps to reproduce the issue:

Install podman-docker on CentOS8
Install gitlab-runner via https://docs.gitlab.com/runner/install/linux-repository.html (no CentOS8 repo yet; just using the 7 binaries)
gitlab-runner can't use docker because it expects the socket to exist. Any docker/docker Go library user will fail

Describe the results you expected:
podman-docker should also support the socket communication.
Output of podman version:
Version:       1.0.5
Go Version:    go1.11.6
OS/Arch:       linux/amd64

Additional environment details (AWS, VirtualBox, physical, etc.):
Physical CentOS8 host.

hang tight and keep your eye on our repository.

The same problem with https://buildpacks.io/
✗ alias docker=podman
✗ pack build myapp --builder heroku/buildpacks:18
ERROR: failed to fetch builder image 'index.docker.io/heroku/buildpacks:18': Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

May greatly simplify getting podman supported https://github.com/buildpacks/pack/issues/413
https://github.com/buildpacks/pack/issues/413

If you guys would like to contribute, take a look at
https://github.com/containers/libpod/tree/apiv2

What to look at? Is it some sort of varlink wrapper?

No this is Podman implementing the Docker API.

I thought that varlink is the API and everything else should be a wrapper over that rather than rewrite.

There'll be more details in the future, but this is and will continue to be entirely separate from the Varlink API.

Can I somehow use this to create a podman socket where "legacy" docker applications can listen on?
I found this tutorial on setting up a varlink socket but it's incompatible or rather not a plug-in replacement to /var/run/docker.sock, right?

podman system service available starting in 1.8.1 (I believe) should do what you're looking for. Please note that HTTP API support is still very early and under heavy development.

The podman-docker package should be creating a link between the two sockets, at least that is what is supposed to happen.
ln -s /run/podman.sock /run/docker.sock

I am trying to use 3rd party utility that uses Docker socket. But running podman system service has no effect. podman 1.8.2 runs with the message This function is EXPERIMENTAL.
✗ pack build myapp --builder heroku/buildpacks:18
ERROR: failed to fetch builder image 'index.docker.io/heroku/buildpacks:18': Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

How is it supposed to work?

Podman service is created at /var/run/podman.sock (/run/podman.sock)
If you want to support docker, then ln -s /run/podman.sock /run/docker.sock
If you install podman-docker, it is supposed to create this link automatically, although I have not confirmed.

did you run as root? else you would have to look closer at whatever error messages it gave.  you can also curl the endpoint.

@baude run podman system service  without run. It didn't complain about anything, and I thought everything is fine. Running with sudo didn't change anything, and I guess that's because /run/docker.sock is not created.
@rhatdan there is no /run/podman.sock regardless of if podman system service runs with sudo or without it.
$ ls -la /run/podman.sock
ls: cannot access '/run/podman.sock': No such file or directory

Probably at /run/podman/podman.sock by default AFAIK

@mheon path appears only when podman is run under root. Is it possible to still keep podman run in userspace?
$ sudo ls -la /run/podman/podman.sock
srwxr-xr-x. 1 root root 0 Apr  6 17:02 /run/podman/podman.sock

The socket is not accessible without root.
$ nc -U /run/podman/podman.sock
Ncat: Permission denied.

I think that, when run without root, we make a socket somewhere in /run/user/$UID/ but I'm not 100% sure that is implemented yet.

(The intention is that, if you want to run Podman rootless with the API, the service will also be running without root, on a separate socket than root)

when run without root, we make a socket somewhere in /run/user/$UID/

That would be pretty great!
Could you tell me where the code for this feature is exactly? I don't really "get" the code yet.

podman indeed creates socket in /run/user/$UID/podman/podman.sock when running rootless.
$ nc -U /run/user/1000/podman/podman.sock
dsfsd
HTTP/1.1 400 Bad Request
...

Yes we definitely do NOT want /run/podman/podman.sock to be available to anything other then root.  This would open a Huge security hole if this is is available to non root users.

The man page says it all.  Yo might need to add the ˋ-tˋ parameter.
See https://www.mankier.com/1/podman-system-service

@Yajo the man page specified invalid number of slashes - it should be unix://$XDG_RUNTIME_DIR/podman/podman.sock. Otherwise works fine.
Maybe podman system service could output the path to the socket it is listening to? For use in scripts, for example.

The full example how to redirect Docker API application to podman (using pack project - https://github.com/buildpacks/pack/issues/564).
podman system service &
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
pack build myapp --builder heroku/heroku-buildpack-ruby -v

The command above fails, but connection to podman is successful.


Domínguez @$#%&+/%$

I'm closing this as off topic. Please see our Contributing.md for the types of feedback we're looking for on our Site Policies in this repo.

Please keep it open if possible this person is missing.
Sent from my iPhone

On Mar 2, 2022, at 3:11 PM, Margaret @.***> wrote:

Closed #538.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.


Ctrl + . vanishes on the first attempt

When you ctrl + . to get the smart tag helper up (e.g. open namespace), the first time you click it on a particularly symbol, the tag immediately vanishes. You need to then hit ctrl + . again to get it to stay.

Nobody is going to investigate it.

Seems to be fine in VS2015 anyway.

@isaacabraham great :)


Pre-commit and husky update

Is your feature request related to a problem? Please describe.
The current badge element is well behind recent versions of core support functions.
Describe the solution you'd like
Update the following core features of the badge element

husky pre-commit hooks
update to wc-test-runner

The following outlines the steps needed for updating any repo to the latest version of Husky.

npx husky-init
npm i @open-wc/testing@latest @web/test-runner@latest @web/dev-server@latest --save-dev
npm run prepare
chmod ug+x .husky/*
chmod ug+x .git/hooks/*
Update package.json - "test": "wtr --coverage", and "test:watch": "wtr --watch",
Add web-test-runner.config.mjs
Update .husky/pre-commit and necessary pre-commit actions
Delete legacy Husky configs from package.json
Delete karma.conf.js file
Uninstall @open-wc/testing-karma

Exit criteria
This issue will not be considered complete once the listed core features are updated along with all associated dependencies and all features work as previously expected with node 18 installed.

This issue was copied from #43 by @blackfalcon.

/duplicate


Simplify /model/predict results data structure

Is it possible to simplify the result data structure?
For example
{
  "text": [
    "Mary had a little lamb"
  ]
}

returns
{
  "status": "ok",
  "predictions": [
    [
      {
        "toxic": 0.0014839612413197756,
        "severe_toxic": 0.00009525173663860187,
        "obscene": 0.0003549971734173596,
        "threat": 0.00007228714093798772,
        "insult": 0.00022114443709142506,
        "identity_hate": 0.00010927908442681655
      }
    ]
  ]
}

Note that the prediction returns a list of lists of dicts, whereas it should be sufficient to return a list of dicts.
{
  "status": "ok",
  "predictions": [
      {
        "toxic": 0.0014839612413197756,
        "severe_toxic": 0.00009525173663860187,
        "obscene": 0.0003549971734173596,
        "threat": 0.00007228714093798772,
        "insult": 0.00022114443709142506,
        "identity_hate": 0.00010927908442681655
      }
   ]
}

Not sure which input would return a multi-dimensional response. The simplified version can accommodate multiple inputs:
{
  "text": [
    "Mary had a little lamb",
    "Little lamb, little lamb,"
  ]
}

would return
{
  "status": "ok",
  "predictions": [
      {
        "toxic": 0.0014839619398117065,
        "severe_toxic": 0.0000952516493271105,
        "obscene": 0.00035499755176715553,
        "threat": 0.00007228707545436919,
        "insult": 0.00022114443709142506,
        "identity_hate": 0.00010927919356618077
      },
      {
        "toxic": 0.1212717592716217,
        "severe_toxic": 0.00012042735033901408,
        "obscene": 0.0017211131053045392,
        "threat": 0.00017663949984125793,
        "insult": 0.0008766597020439804,
        "identity_hate": 0.00014419591752812266
      }
  ]
}

with predictions[0] returning the eval for the first string, .... second string.
What am I missing?

Hmm yes this is how it should be. I missed this in review. We should
certainly have the output return a list of dicts
On Wed, 29 May 2019 at 03:26, Patrick Titzler<EMAIL_ADDRESS>wrote:

Is it possible to simplify the result data structure?
For example
{
"text": [
"Mary had a little lamb"
]
}
returns
{
"status": "ok",
"predictions": [
[
{
"toxic": 0.0014839612413197756,
"severe_toxic": 0.00009525173663860187,
"obscene": 0.0003549971734173596,
"threat": 0.00007228714093798772,
"insult": 0.00022114443709142506,
"identity_hate": 0.00010927908442681655
}
]
]
}
Note that the prediction returns a list of lists of dicts, whereas it
should be sufficient to return a list of dicts.
{
"status": "ok",
"predictions": [
{
"toxic": 0.0014839612413197756,
"severe_toxic": 0.00009525173663860187,
"obscene": 0.0003549971734173596,
"threat": 0.00007228714093798772,
"insult": 0.00022114443709142506,
"identity_hate": 0.00010927908442681655
}
]
}
Not sure which input would return a multi-dimensional response. The
simplified version can accommodate multiple inputs:
{
"text": [
"Mary had a little lamb",
"Little lamb, little lamb,"
]
}
would return
{
"status": "ok",
"predictions": [
{
"toxic": 0.0014839619398117065,
"severe_toxic": 0.0000952516493271105,
"obscene": 0.00035499755176715553,
"threat": 0.00007228707545436919,
"insult": 0.00022114443709142506,
"identity_hate": 0.00010927919356618077
},
{
"toxic": 0.1212717592716217,
"severe_toxic": 0.00012042735033901408,
"obscene": 0.0017211131053045392,
"threat": 0.00017663949984125793,
"insult": 0.0008766597020439804,
"identity_hate": 0.00014419591752812266
}
]
}
with predictions[0] returning the eval for the first string, .... second
string.
What am I missing?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/IBM/MAX-Toxic-Comment-Classifier/issues/6?email_source=notifications&email_token=AAH5EB6X4R7GH5EPKO3ONLDPXXLWFA5CNFSM4HQIJKUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWLVTGQ,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAH5EB77POH5DUHUFLTZUDDPXXLWFANCNFSM4HQIJKUA
.


Point-In-Time Subscription Reset Capability

Suggesting pinned offsets at scheduled times (once daily, or part thereof - tag the latest offset for each partition).
This will make it very easy for subscribers to recover after incidents, without having to search for the offsets. It will be used for "point-in-time" subscription reset.
It's a small scheduled job with very little overhead and would greatly reduce a lot of the support we have to provide our consumers for finding the appropriate offsets and for minimising the recovery time after incidents.

A nice solution could be to provide hourly pinned offsets for the previous 24 hours, as well as daily pinned offsets for the previous 7 days


BUG REPORT - Not go installable

What happened?
I tried to go install
What should have happened?
it should have installed
More information:
go version go1.19.4 darwin/arm64
go install github.com/donuts-are-good/bearclaw@latest
go: downloading github.com/donuts-are-good/bearclaw v0.0.0-20230226015146-7af32f3755ea
go: github.com/donuts-are-good/bearclaw@latest: <EMAIL_ADDRESS>parsing go.mod:
module declares its path as: bearclaw
but was required as: github.com/donuts-are-good/bearclaw

This works now:
―❤―▶ go install github.com/donuts-are-good/bearclaw@latest

―❤―▶ bearclaw -h
Usage of bearclaw:
  -watch
    	watch the current directory for changes

I also took the liberty of renewing the Go modules proxy cache to have this commit :)

this works!


Do you have mock data associated with this demo

Do you have mock data associated with contentful and  commerce io.
Would like to setup data in my demo setup and try out the feature

When you create an organization in Commerce Layer, you can seed it with test data, the same that we used in our demo.


fix publish

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

Project coverage is 90.44%. Comparing base (bd068c4) to head (036da2e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #683   +/-   ##
=======================================
  Coverage   90.44%   90.44%
=======================================
  Files          41       41
  Lines       13309    13309
=======================================
  Hits        12037    12037
  Misses       1272     1272

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


Input display enhancement

Currently AIsaac's current input category(random/predicted) and inputs are displayed like this:

I'd like to suggest displaying this information in the visual debugger during runs, currently this is filled with the last set of flashbacks. I think a setup similar to input displays used by some speedrunners would be fitting. For these examples I used NohBoard with the Isaac layout.
Default:

Random:

Predicted:

This overlay is now over the game and can easily be reconfigured for other games and/or input schemes.


[RR Request]: PyBaMM v21.12

Open Source Project name
PyBaMM
What is your project?
PyBaMM (Python Battery Mathematical Modelling) solves physics-based electrochemical DAE models by using state-of-the-art automatic differentiation and numerical solvers.
Like the Doyle-Fuller-Newman model can be solved in under 0.1 seconds, while the reduced-order Single Particle Model and Single Particle Model with electrolyte can be solved in just a few milliseconds.
Version
v21.12
Date
January 1, 2022
Description of changes
In PyBaMM 21.12 we have added
-🔋Voltage termination criteria for experiments
-🔋New reaction kinetics
-🔋Cylindrical geometry
plus many other features and optimisations.
GitHub Repo
https://github.com/pybamm-team/PyBaMM
Website
https://www.pybamm.org/
https://pybamm.readthedocs.io/en/latest/ (docs)
Link to changelog
https://github.com/pybamm-team/PyBaMM/releases/tag/v21.12
Social media
https://twitter.com/pybamm_/status/1477347002409267210
Anything else to add?

PyBaMM have now moved to monthly releases to better suit the needs of the community.
Hence smaller releases, but more frequent. The version number format is now YEAR.MONTH

The introductory paper is now out in the Journal of Open Research Software! This paper explains the motivation and design philosophy behind PyBaMM
Find it here: https://doi.org/10.5334/jors.309

Dropping the images into the issue

Congrats on being featured in the January Release Radar 🥳

Read the blog here
Check out our GitHub Tweet
Feel free to retweet Mish's tweet featuring you
Keep an eye on our YouTube Channel for a January Release Radar promo video 😄


Update sql-data-warehouse-overview-load.md

Removed restrictions on UTF-16

Hi @Ckarst, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

It looks like you're a Microsoft contributor (Casey Karst). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@Ckarst : Thanks for your contribution to the Azure documentation! The author, @barbkess, has been notified to review your proposed change.

#sign-off


Question

I have built PHP binary for Linux by your scripts.

I have some discomfort with the console. When I type command appears "Genisys>" line. Screenshot

Now CTRL+C causes force stoping. Previously, it was the equivalent of the "stop" command.

Not sure that it matters, but after stopping said "zend_mm_heap corrupted"

UPD: "zend_mm_heap corrupted" appears very often, after level unloading. After that, the server stops

@ishitatsuyuki , someone, help((

I'm glad to help banning you for not following the rules.


OpenJDK: init 19.0.1

Description of changes
supporting work:
temurin-bin: 8.0.345 -> 8.0.352; 11.0.16 -> 11.0.17; 17.0.4 -> 17.0.5

simple run of generate_sources.py

openjdk: reduce number of places where default jdk version is specified

temurin-bin: init 18.0.2 and 19.0.1

... and the main event:
openjdk: init 19.0.1

as usual this is mostly copy-pasted from 18, so this commit is best
reviewed with '--find-copies-harder'

stop exposing openjdk 18 since it was not a long-term support release

change the default openjdk from 17 to 19 since nixpkgs is a
rolling-release repository

drop the ceremony around bootstrapping via adoptopenjdk for 64-bit
builds vs. via earlier openjdk builds for 32-bit, because, to be
frank, since we're using temurin now, it's not a simple copy-paste
job.  :-/  if someone needs a 32-bit openjdk, that work can be done
separately.

JavaFX revs from 17 to 19; it looks like 18 was never packaged along
with JDK 18.

* the gradle invocation used to build JavaFX must still be done with
  Java 18, as gradle does not yet support running itself on Java 19.

* a couple of patches need to be applied, since a new State enum was
  introduced in the JDK that collides with one in JavaFX.

* the hash of the gradle dependencies has not changed, which is
  surprising, but as far as I can tell correct.

cc @edwtjo @asbachb @xeals @Jonpez2
fixes #195638

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
22.11 Release Notes (or backporting 22.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

Just pushed a new version that pins libreoffice to jdk17, since it doesn't build with 19.
I've just updated my work machine to use this, including running Eclipse on 19; will report back in a few days on whether it's feeling stable or not.

This is feeling pretty stable to me after a week at work.

Should this be backported? On 22.11, openjdk18 is marked as insecure as it has reached EOL while openjdk19 is not available.

Sure, I don't see why not.  We'd just need to backport #203808 and #201321 too.

Noting that #232199 is the OpenJDK 20 initialization.


Problem with SPIFFS_lseek after exactly 26355 bytes written

Hi everyone!
I find interesting problem with SPIFFS_lseek which fails after exactly after 26355 bytes written to file.
There is code to reproduce:
TEST(seek_bug) {
  int res;
  fs_reset_specific(0, 0, 8*1024*1024, 4096, 4096, 256);
  int i = 0;
  do
  {
    spiffs_file fd = SPIFFS_open(FS, "EVENT", SPIFFS_CREAT | SPIFFS_RDWR, 0);
    if (SPIFFS_lseek(FS, fd, 0, SEEK_END) < 0)
    {
      printf("try number: %i\n", i);
      printf("seek errno %i\n", SPIFFS_errno(FS));
      SPIFFS_vis(FS);
      return SPIFFS_errno(FS);
    }
    static unsigned char buf[1] = {}; // data doesn't matter
    if (SPIFFS_write(FS, fd, &buf, sizeof(buf)) < 0) printf("errno %i\n", SPIFFS_errno(FS));
    SPIFFS_close(FS, fd);
  } while (i++ < 1000000);
  SPIFFS_vis(FS);
  return TEST_RES_OK;
} TEST_END

seek failed after exactly 26355 bytes written.
I look into it a little and figured that function spiffs_obj_lu_find_entry_visitor returns SPIFFS_VIS_END
and this is causing SPIFFS_ERR_NOT_FOUND return code from SPIFFS_lseek
Debug output (without cache):
out.zip
I checked that:

This is independent of cache setting
Writing 26355 x 1 byte has same effect that writing 1 x 26355 bytes
Writing 26355+1 byte is OK :-)
Number of writes that causing this issue depends of page size (or maybe another parameters of FS).

Maybe somebody have an idea what is reason?
All the best! Marian.

thanks for the report, got it fixed.


Use custom multihash and refactor plugin

Use a custom multihash. Requires two additional forks: go-verifcid and with it go-ipfs.
Related to and also depends on the changes in:

https://github.com/lazyledger/go-verifcid/pull/1,
https://github.com/lazyledger/go-ipfs/pull/1

TODO:

[x] get rid of the multihash fork and register the hasher from ll-core
[x] extract the hasher into the NMT library / use the existing leaf-/inner-hasher from the nmt lib (https://github.com/lazyledger/nmt/issues/18; done in https://github.com/lazyledger/nmt/pull/19)
[ ] split into two hashers (maybe another time / separate PR as this complicates this unneccessarily)
[x] only replace go-verifcid in go-ipfs fork (to accept the added hashers)
[x] re-skip test that requires running ipfs daemon
[x] split out into a separate PR (independent from #152)

closes: #153

Codecov Report

Merging #155 (3308e76) into master (5855663) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #155      +/-   ##
==========================================
- Coverage   60.83%   60.83%   -0.01%
==========================================
  Files         261      261
  Lines       23644    23644
==========================================
- Hits        14385    14384       -1
  Misses       7768     7768
- Partials     1491     1492       +1

Impacted Files
Coverage Δ

types/block.go
77.97% <100.00%> (ø)

privval/signer_server.go
89.47% <0.00%> (-10.53%)
:arrow_down:

libs/events/events.go
92.94% <0.00%> (-5.89%)
:arrow_down:

types/tx.go
81.13% <0.00%> (-3.78%)
:arrow_down:

privval/signer_endpoint.go
78.78% <0.00%> (-3.04%)
:arrow_down:

consensus/reactor.go
73.83% <0.00%> (-0.63%)
:arrow_down:

p2p/pex/pex_reactor.go
78.86% <0.00%> (-0.60%)
:arrow_down:

consensus/state.go
67.94% <0.00%> (-0.47%)
:arrow_down:

mempool/reactor.go
86.36% <0.00%> (ø)

blockchain/v0/pool.go
80.60% <0.00%> (ø)

... and 7 more

Any idea why the e2e test is failing here @marbar3778 ?
@Wondertan: I've removed the go-multihash fork in this PR and register the hashFunc locally. In its current form this still requires a go-verficid and hence a go-ipfs fork. Later, we can look into using  https://github.com/hsanjuan/ipfs-lite instead of a full-blown ipfs daemon - which would be cool! For now, this doesn't have the highest priority.

I'm running into some install issues for the plugin. The old version of the plugin using ipfs/go-ipfs installs fine, but when using the latest commit of the lazyledger/go-ipfs fork and this plugin, I'm getting the plugin was built with a different version of package internal/unsafeheader error. Is there something different I'm supposed to be doing for the installation of this plugin vs the old plugin besides using the new for fork of ipfs?
steps I'm following:

remove old %$HOME/.ipfs files
install latest commit lazyledger fork of ipfs c65604ccb2ed3b269bb0d9a674e98adf2bdae3c8
ipfs init
run ./set-target.sh home/evan/go/src/github.com/lazyledger/go-ipfs/
run make install for plugin
boot up ipfs with ipfs daemon

run ./set-target.sh home/evan/go/src/github.com/lazyledger/go-ipfs/

That part didn't really work and I manually had to add in a replace directive (that is why that line was commented out as Tomek noted). I don't remeber what the exact problem was. I'll look into it though.
Can you try again with a manual replace in the plugin's go.mod (to home/evan/go/src/github.com/lazyledger/go-ipfs/). Ideally, setting it to a local version wouldn't be necessary (especially not manually) but without that I ran into the same problem as you (different version of package internal/unsafeheader).

yep, that was it. Thanks!

What was causing the e2e CI test to fail? I briefly checked it out when it was breaking, but didn't find anything.

I didn't inspect it tbh.

I think I've addressed all your feedback @adlerjohn. Do you mind giving it one last pass? Will merge afterwards.

Hmm there are some points that weren't addressed! Did you forget to expand the hidden stuff with "Load more" ❓

Indeed ❗


Create hint.xml

Adding hint() reference (https://processing.org/reference/hint_.html) to py.processing.org/reference
Please advise if this is the way to do it :/
(my apologies in advance if it is not)

Re:your forum message -- the green checkmark at least means means that your commit passed automatic build without generating any errors -- you can click on it to see the logs.
If you want to set up local dev so that you can inspect the builds (which I needed to do at some point, because it wasn't clear what was failing) -- it depends on your OS. I had to do a bit of work with a local script setup and generate script to get builds working on macOS 10.12. What OS are you developing on?

Thanks Jeremy!
I'm sometimes on Xubuntu 18, sometimes on old Mac OS 10.11.6. Mac OS right now.

@villares -- also note that just because a change is merged doesn't mean it is live on the site yet.
When I was last doing this, I believe that I set up local install on Mac like this, using mkvirtualenv to set up a Python2 virtualenv with the requirements getting a local copy of the python mode jar to help build the example images.
#!/usr/bin/env bash
# * [Mac OS X](http://py.processing.org/processing.py-macosx.tgz)
# * Windows:
# [64-bit](http://py.processing.org/processing.py-windows64.zip),
# [32-bit](http://py.processing.org/processing.py-windows32.zip)
# * Linux: [64-bit](http://py.processing.org/processing.py-linux64.tgz)
#   [32-bit](http://py.processing.org/processing.py-linux32.tgz)

# 1. set up virtual environment
source ~/.bash_profile
mkvirtualenv processing-py-site

# 2. install requirements
pip install -r requirements.txt

# 3. identify correct processing.py version
case "$OSTYPE" in
  darwin*)  OSNAME="macosx" ;;
  linux*)   OSNAME="linux" ;;
  msys*)    OSNAME="windows" ;;
esac
archs=`uname -m`
case "$archs" in
    i?86) BITS=32 ;;
    x86_64) BITS=64 ;;
esac
if [ "${OSNAME}" == "macosx" ]; then
  BITS=""
fi
FILENAME=processing.py-${OSNAME}${BITS}.tgz
FILEURL=http://py.processing.org/${FILENAME}
echo ${OSTYPE}, ${archs}, ${OSNAME}, ${BITS}
echo ${FILENAME}, ${FILEURL}

# 4. optionally download and unpack processing.py
if [ -e "${FILENAME}" ]; then
  echo 'File already exists' >&2
else
  curl -L -O ${FILEURL}
fi
tar xfvz ${FILENAME}
cp processing.py-*-${OSNAME}${BITS}/*.jar .

...and then ran "generator.py" to build the site something like this:
#!/usr/bin/env bash
# local generation of the site.
# requires pointing the shell at java 8
workon processing-py-site
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
python generator.py build --images

Finally, in order to inspect the output directly, I made this change to generator.py:

work_dir   = tempfile.mkdtemp(prefix='processing-py-site-build')

work_dir   = 'processing-py-site-build'

These things could be made into an issue, cleaned up, and committed as install / build scripts, I suppose. I'm not really sure how jdf does setup and build.

Thank you very much @jeremydouglass!
I'll try to make time to explore this soon.
cheers!