nixos/drone-server: init

Motivation for this change
#70519
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[ ] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

This change is

@filalex77 do you want to continue this? i would love to run drone natively on nixos. but in docker is also fine i guess

I also have drone-exec-runner packaged, so it works without docker: https://github.com/Mic92/dotfiles/blob/master/nixos/eve/modules/drone.nix

I also have drone-exec-runner packaged, so it works without docker: https://github.com/Mic92/dotfiles/blob/master/nixos/eve/modules/drone.nix

I'm interested in packaging it for nixpkgs, as my first real contribution.
I can't see a license on your repo, can I use your module as a base for a PR?

I also have drone-exec-runner packaged, so it works without docker: https://github.com/Mic92/dotfiles/blob/master/nixos/eve/modules/drone.nix

I'm interested in packaging it for nixpkgs, as my first real contribution.
I can't see a license on your repo, can I use your module as a base for a PR?

There you go: https://github.com/Mic92/dotfiles/blob/master/LICENSE.md

I also have drone-exec-runner packaged, so it works without docker: https://github.com/Mic92/dotfiles/blob/master/nixos/eve/modules/drone.nix

I'm interested in packaging it for nixpkgs, as my first real contribution.
I can't see a license on your repo, can I use your module as a base for a PR?

There you go: https://github.com/Mic92/dotfiles/blob/master/LICENSE.md

Thanks, I'll start hacking on it ASAP

I'm getting this error on every build, using the drone-exec-runner package linked above:
+ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
Initialized empty Git repository in /tmp/drone-3wNQW6gz5vVqH4j9/drone/src/.git/
+ git remote add origin https://github.com/pinpox/test-drone-ci.git
+ git fetch  origin +refs/heads/main:
fatal: unable to access 'https://github.com/pinpox/test-drone-ci.git/': Could not resolve host: github.com

I found a few related issues, e.g. https://github.com/drone-plugins/drone-git/issues/67#issuecomment-378268813 But the fixes all reference docker settings. Do you need any specific network settings for it to work? Not sure where or to what I should set DRONE_RUNNER_NETWORKS= or DRONE_NETWORK here

I found the cause for the error above. I had to add a few packages to get it to resolve DNS
   path = [
      pkgs.git
      pkgs.gnutar
      pkgs.bash
      pkgs.nixUnstable
      pkgs.gzip
      pkgs.bind
      pkgs.dnsutils
      pkgs.openssh
    ];

Drone doesn't seem to be able to run nix commands though:
+ nix shell 'nixpkgs#hello' -c hello
error: --- Error --- nix
cannot open connection to remote store 'daemon': error: --- SysError --- nix
reading from file: Connection reset by peer

I am pretty sure git does not use dnsutils/bind for resolving hostnames. I have the nscd socket bind mounted into the chroot. However this is completly off-topic since this module does not configure any runner.

Related to this drone-runner-exec pr: https://github.com/NixOS/nixpkgs/pull/115003

FYI: Drone is not fully open source anymore. There is a community fork of the last open version. https://woodpecker-ci.org/
We use it at https://codeberg.org/ and it works well. So i suggest to package that instead.

Drone still is fully open source, the licence just prohibits using certain parts for enterprise

That violates freedom 0 of FSFs Free Software definition and is therefore not open source! It is source-available.
You are right that woodpecker does not support all features (yet) that newer drone versions have.


Minion: Stop binding /usr/share/certificates

Ideally, the CA certificates that our containers need would be included directly into the container image.  To pull this off, we may need to make our own versions of etcd, and some other containers.

Done


Add @_SPI(Internal) to some of navigation apis

I'm working on back-porting iOS 16 NavigationStack and every TCA related apis. I managed to make a demo here but I needed to @testable  import ComposableArchitecture
This branch contains the apis required but keep them behind @_SPI(Internals) as the rest of those apis.

Related to #1674

Yeah I know but TCA + SwiftUI apis are too good to ignore and we are stuck on iOS 15 and might be for a while as it dropped devices.

Also I’d gladly switch to a TCA provided uinavigationcontroller solution if it could support both tree and stack navigation. I couldn’t make your branch work before iOS 16.


Clean up "c_string_type" and "c_string_encoding" for Py3

Make "c_string_type=str" a synonym of "c_string_type=unicode" and "c_string_encoding=default" a synonym of "c_string_encoding=utf8".
Closes https://github.com/cython/cython/issues/6280

Automatic conversions are controlled by the directives

I actually meant singular (conversion). Which do you think is better?

Automatic conversions are controlled by the directives
I actually meant singular (conversion). Which do you think is better?

Probably "conversions" but not a hugely strong preference

The crashes in Py3.13 are due to the release of Py3.13b3 and also appear in the master branch.

The crashes in Py3.13 are due to the release of Py3.13b3 and also appear in the master branch.

I can't reproduce them locally unfortunately. (I do agree with your assessment though - they appeared exactly when b3 appeated)


Should the tag podcast:locked have a value?

Since this tag has a boolean behavior, it could be empty and its meaning could be taken simply by it existing or not in the channel, it would not be necessary to specify a yes or no value.
I can understand though that with the current format it is more human readable.

I see your meaning.  But it feels better to have it be present and with a yes|no to me.  It's such an important declaration of intent that it feels better to have it in there always.


Pulling data from platform.sh multiple apps

Is there an existing issue for this?

[X] I have searched the existing issues

Is your feature request related to a problem?
No
Describe your solution
There is no way to pull data from platform.sh when you have more than one app in the environment.
Running ddev pull platform returning this error :
Specifying the --app or --worker is required in non-interactive mode
It would be great to support an additional variable for the app ID.
Something like :
web_environment:
- PLATFORM_PROJECT=project_id
- PLATFORM_ENVIRONMENT=main
- PLATFORM_APP=app ( Should be optional )
Describe alternatives
No response
Additional context
No response

[#5728 ]


[API] Set context of backend enabled

This commit sets vscode context of enabled backend.
ONE-vscode-DCO-1.0-Signed-off-by: Dayoung Lee<EMAIL_ADDRESS>

LGTM
We'll modulize EdgeTPU Compiler based on this context😊


While connecting to leather wallet it's giving me private key length is not valid (it only happens on react build hosted on server,works fine local )

*Describe the bug
Environment: Development environment deployed using Docker on a Digital Ocean droplet. Frontend is a React build.
Expected Behavior: When connecting the wallet to the frontend using stacks.js , the connection should be successful, regardless of whether the frontend is running locally or served from the server itself.
Actual Behavior:
Local Frontend: wallet gets connected successfully
Server-Hosted Frontend: fails with the error message " Error during auth request Error: Improperly formatted private-key. Private-key byte length should be 32 or 33. Length provided: 390".
Request for Assistance
I'd appreciate any help or insights into further troubleshooting this "private key has no valid length" error that specifically occurs when running the React build from the server.

Desktop (please complete the following information):

Browser [chrome]
Version [Latest]

This seems to have been fixed when switching http to https for the site hosting Connect.
This issue will be used to investigate more and figure out if it's possible to fix this.


Add soloScene to be able to define an OBS scene in case enterSolo in song

Please add a solo scene (or scenes) option what we could use to set up an automatic enter solo scene switch!
We should be able to set:

That is this automation turned on or off.
A list of solo scenes.
A timeout in seconds (should exists some default like 15 seconds)

In case, the song enters to solo (enterSolo), SW should switch to the first scene from the solo scenes in case it is allowed (not in a blacklisted scene for example).
If solo is over (leaveSolo), it should return to an allowed song scene.
If the timer is over, it should return to an allowed song scene.
If the song is over, it should switch back to menu scene.
If the song is paused, it should switch to pause scene.
Question: after resume, should switch back to last scene or to the first songScene?

I am thinking what could this bring to us...well...with SB it is just working. However, as the example shows below, it is working with SB, but if the charts are so unreliable, we must have some logic to switch off from solo scene automatically. So actually points 2-5 (and 6) are good.

I tested the enter and leave solo actions in SB yesterday and I am afraid that we can not use the chart's leave and enter solo attributes, because they are most likely missing the leave or enter, missing at all, are wrongly placed...so it is just not reliable. I do not know, but probably for bass chart, charters could define a different solo part. As the guitar solo, or a bass solo, could be in different parts of a song.
How ever, here is an example: Ozzy Osbourne -  Crazy Train (Studio) - on bass
Creator: fabianosan
https://ignition4.customsforge.com/cdlc/529
At 26:21 switcher detects the solo (how ever, there were no guitar or bass solo in that part of the song...it was verse):

And after 3-4 seconds it enters into solo scene of my:

Detects leaveSolo:

but did not switched back, so I kicked back to songScene:

In the middle of a guitar solo, it detects enterSolo:

And switches to solo scene:

Song ended, but because it was in solo scene and there was no leaveSolo, and I used whitelist settings, it stuck in the solo scene.

So, it is worked, but was not good.

My SB settings:
enterSolo:

leaveSolo:

Oh now I know why leaveSolo does not worked! Because I used whitelist, and it was not in the menu, pause or song scene, it just not switched back at leaveSolo detection to song. What is ok, so it was my fault :)

As this was mostly misusage. I close this request and add a warning to the readme


Switching across Multiple Tenant/Org with same Identity

**Is your feature request related to a problem? Please describe. **
As a multi-tenant identity (Identity from Tenant A is invited to Tenant B as B2B invite), I should be able switch the tenant while using the graph explorer.
Describe the solution you'd like
As a multi-tenant identity (Identity from Tenant A is invited to Tenant B as B2B invite), I should be able switch the tenant while using the graph explorer. This helps test the graph API behavior across tenants and permissions differences an AAD member user has Vs AAD Guest user.
Describe alternatives you've considered
NA
Additional context
I am testing some of the Teams related endpoints where I need to use the same identity across the tenants.

Found the resolution
16
If you want to sign into your own tenant in Graph explorer, use tenant query string parameter.
https://developer.microsoft.com/en-us/graph/graph-explorer?tenant=contoso.onmicrosoft.com
A simple url to go to Graph explorer is https://aka.ms/ge, when you land on the destination, just add tenant query string parameter (domain name or tenantId, both work).


0.50.0-b3

Does the 0.40.1 version commit not also do into develop?
https://github.com/ripple/rippled/commit/e91aacc9a3d2f332a93981270c3812e26189226e

Since I didn't know what the current (default) setting was: This doubles the default setting and allows for up to ~2 TB of SQLite databases at the default page size of 1 KB. Most likely the issue is with the transaction.db database which keeps a copy of all transactions in the ledger.

@MarkusTeufelberger: correct; I believe that newer versions of sqlite use a 4KB page, but on systems where the database was created with earlier versions of sqlite, the limit was 1TB, and machihes will full history could bump up against it because of transaction.db.
We have a plan to reduce the amount of data that needs to be stored in transaction.db and reclaim a lot of space from existing databases.


Remove default node pool creation from kubectl gs template cluster

This removes the default node pool creation from the cluster templating.
Reason: With this function, there are two ways for users to think about node pools. One for the first node pool, the other for all other node pools. This actually complicates things for users. Plus it bloats the code base.
In gsctl we introduced the "default node pool" concept when we added node pool functionality for AWS, so that it would still be easy and simple to create a functional cluster by using a relatively short command. We basically had existing users with adopted behaviour in mind. This is not relevant for kubectl-gs.
So for user, with this change it will be:

Run kubectl gs template cluster once
Run kubectl gs template nodepool as often as required

Didn't like either. +1


Fixed #29427 -- Ensured request has _body even when RequestDataTooBig is raised

Hi @claudep, this looks fine. (In your looking at this, did you happen to see why/where the response fails to be sent because the request is missing the _body? (It's curious...)
(That looks like the underlying bug (?) but it's not exercised here...)
Thanks!

Sure, it makes sense to test creating a response from the request, I will explore a bit more.

Hey @claudep, thanks. (I attached a project to the ticket, that fails to reproduce the issue with the suggested middleware... — maybe that's handy. 🙂)


[Feature Request] Muh raspberry pi

🚀 Feature Request
I would like to tinker with libra on my raspberry pi.
Motivation
admin@jeffpi:~/code/libra $ ./scripts/dev_setup.sh
Unknown OS. Abort.
admin@jeffpi:~/code/libra $ uname -a
Linux jeffpi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
admin@jeffpi:~/code/libra $ cat /etc/*release*
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

@jdimarco218 did you try other Raspberry Pi OS's? I wonder if Ubuntu MATE would work. Another question is what Raspberry Pi model did you try this out on?

Hi @jdimarco218, we aren't currently targeting Raspberry Pi for the validators.  To ensure high throughput/performance, we are expecting the validator nodes to run on higher-end systems, so we likely won't be focusing on adding Raspberry Pi support in the near-term


fix: remove the button in the aside panel to drag and drop

The current version can also be dragged and dropped on the buttons in the aside panel, sometimes affecting the operation.
https://s2.svend.cc/temp/motrix-1.gif
now!
https://s2.svend.cc/temp/motrix-2.gif

Thanks : )


Moved the add row to the beginning of the if checks for new group tes…

Both the Trans Executor step and the Job executor step is always off by one when submitting rows to the sub transforms they are executing.
This example is for the Trans executor step.  If you set a root Trans to have the first step to continuously generate rows every 5 second and then put a log in front of the trans executor you will see that the row will not be passed until the next row is generated.  This is a problem if you are reading from a stream that never terminates and flushes the results to the executor.   So if your grouping is for N rows it will not send the N rows until the N+1 row read.
I have moved the groupBuffer.add above the if checks so that they will work properly and create a newGroup.

Let me know if I need to do this to a different branch.  I have also ran the ant test and appears that all tests have passed

It appears that pull requests need to come from Master?  I will reissue a pull from the master branch and test.


Compiler message: /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.5/lib/src/datetime_picker_theme.dart:4:7: Error: The type 'Diagnosticable' can't be used as supertype. class DatePickerTheme extends Diagnosticable {

At last update of dart Language on my windows PC and Flutter package I can't start my Project anymore, I get every time this error message:
Compiler message:
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.5/lib/src/datetime_picker_theme.dart:4:7: Error: The type 'Diagnosticable' can't be used as supertype.
class DatePickerTheme extends Diagnosticable {

C:\Users\me\Desktop\bh_app>flutter doctor -v
[√] Flutter (Channel master, v1.15.22-pre.24, on Microsoft Windows [Version 10.0.18363.657], locale de-DE)
    • Flutter version 1.15.22-pre.24 at C:\src\flutter
    • Framework revision aba0e2dc8f (2 days ago), 2020-03-13 23:21:03 -0400
    • Engine revision e48761e5bb
    • Dart version 2.8.0 (build 2.8.0-dev.14.0 c3a0bb086a)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\me\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.4.6)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.4.29905.134

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] IntelliJ IDEA Ultimate Edition (version 2019.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3
    • Flutter plugin version 44.0.3
    • Dart plugin version 193.6494.35

[√] VS Code (version 1.43.0)
    • VS Code at C:\Users\me\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.8.1

[√] Connected device (3 available)
    • Windows    • Windows    • windows-x64    • Microsoft Windows [Version 10.0.18363.657]
    • Chrome     • chrome     • web-javascript • Google Chrome 80.0.3987.132
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

name: bh_app
description: A new Flutter project.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.2
  provider: ^4.0.1
  google_fonts: ^0.3.2
  outline_material_icons: ^0.1.1
  flutter_datetime_picker: ^1.3.5 <----- here is the package
  intl: ^0.16.1
  http: ^0.12.0+4
  sqflite: ^1.2.0
  path: ^1.6.4
  loading: ^1.0.2
  dio: ^3.0.8
  jose: ^0.1.2
  pdf: ^1.5.0
  printing: ^3.1.0
  js: ^0.6.1+1
  crypted_preferences: ^0.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

I’m also dealing with the same problem if you want your code to run just comment datetime_picker functions

Hy @myousfi96
where exactly, in which file in the package?

I don't no if this is the best fixt for this bug, after deleting extends Diagnosticable from the DatePickerTheme class  in the lib/src/datetime_picker_theme.dart file in the package, works again.

change the

pubspec.yaml

flutter_datetime_picker:
    git:
      url: https://github.com/derohimat/flutter_datetime_picker.git

change the

pubspec.yaml

flutter_datetime_picker:
    git:
      url: https://github.com/derohimat/flutter_datetime_picker.git

thank you

I has this problem too, use git version to go.

When will the version with the bug-fix be published?

because of Convert Diagnosticable to a mixin, code that use extends Diagnosticable now need use with mixin keyword.
https://github.com/flutter/flutter/pull/51495
temporarily tweak line to "class DatePickerTheme with Diagnosticable {" in .pub_cache/
but we need new version in pub.dev.

Ok.. many plugins break at the moment in master channel..

same issue has been fixed in https://pub.dev/packages/flutter_svg#0172

You can also just replace extends with with in DatePickerTheme and be good to go unless you use CI to build your apps

You can also just replace extends with with in DatePickerTheme and be good to go unless you use CI to build your apps

Thank you!


Stdouts of instances is buffered

Instances' stdout is not a terminal, so C stdio library uses a fixed size buffer as opposed to single-line buffer. This causes some output to be lost when an instance segfault or terminates unexpectedly in some other fashion.
It seems that the simplest way to fix this is changing stdout's buffering in zeus_local's initialization (with setvbuf).

A workaround is to use stderr instead of stdout: stderr is always either unbuffered or line buffered, unless that is manually changed with setvbuf.


Add volatile to 'idx_func' to fix NetSurf issue

Technically the volatile shouldn't be needed: idx_func is written before setjmp() and only read afterwards so its value should be well defined.

How does this impact performance, if at all?

Don't know until it's measured - I don't think it could be reliably measured in microbenchmarks though.

Impact on code footprint is +60 bytes so it does have a measurable effect on the emitted code.
Quick performance test on call handling shows no measurable difference.


Split main workflow

Add dedicated workflow for:

[x] lint
[ ] unit test suite
[ ] doc

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


Example implementation of Image changes

Improvements to Image Caching and Loading
Background
The high level goals of this design are an improvement to the image caching system:

Intuitive and reasonable default behavior for the ImageCache

Image cache limit based on image size instead of image count
More aggressive cache flushing on low memory events.
Diagnostics and logging support of the current state of the image cache for tooling.

Support for better customization of image caching and loading behavior.

Changing how images load without updating ImageProviders.
Better APIs for pre-caching and evicting of imaages.
Addition of the missing common image providers Placeholder and Fallback.

This will involve some breaking changes to the ImageCache and ImageProvider APIs, and introduce several new classes for customizing image behavior.
Proposed Changes
An example of these changes is implemented in flutter/flutter#17614.  This PR is not complete and currently exists only as a reference for this proposal - much of the described behavior has not been fully implemented.  There are two breaking changes in this proposal:

A second parameter has been added to ImageProvider.load.
ImageCache.maximumSize has been deprecated and no longer has any effect on cache size.

ImageCache
A new setter/getter named maximumSizeBytes will be added to adjust the maximum cache size based on size of the image in memory. This will default to 10MB and can be updated by developers.
The ImageCache will add a second listener to each newly created ImageStreamCompleter which adds the image size information to the cache when it completes.  This may break tests which expect a certain number of listeners. Image size will be estimated from ImageInfo objects using width * height * 4.  Only images which have completed contribute to cache size and when the cache limit is reached only images which have contributed some size will be removed.  The putIfAbsent method used to interact with the cache is unchanged otherwise.
Additionally, to support more caching customization I've added a method which removes a single entry from the cache.  Examples of this API are given further down.
Deprecated:
set maximumSize(int value) { … }

Added:
/// The maximum size that the image cache will grow to before evicting images.
set maximumSizeBytes(int value) {..}

int get maximumSizeBytes => ...

/// Removes the image associated with [key] from the cache and decreases the cache
/// size.
void remove(Object key) {...}

ImageProvider
The ImageProvider has two responsibilities:

Identifying an image; for NetworkImage this is the scale and url, for FileImage this is the file handle and scale.
Creating an ImageStream from the information above and providing this information to an ImageWidget.

To support the changes below in ImageService, a second parameter has been added to the load method.  A custom ImageProvder that doesn't use the ImageService is free to ignore this parameter.
Modified:
ImageStreamCompleter load(T key, ImageConfiguration configuration);

ImageBehavior & ImageService
The logic for producing an Image from a key will be moved to a new class named ImageService.  An instance of this service is provided via the ImageConfiguration object from an InheritedWidget named ImageBehavior.
The ImageService base class will contain the logic for loading images from the NetworkImage, AssetImage, MemoryImage, and FileImage. However, usage of the new ImageBehavior widget is entirely optional, since a provider is still free to provide its own load implementation.
The design of the ImageService is based on the assumption that new or custom ImageProviders are uncommon, and instead it is preferable to allow extending the loading logic of the existing ImageProviders.
Added:
class ImageBehavior extends StatefulWidget {
  const ImageBehavior({
    @required this.child,
    @required this.service,
    /// Immediately begins precaching images when this widget is constructed.
    this.precachedImages = const <ImageProvider<Object>>[],
  });

  /// The subtree which the delegate applies to.
  final Widget child;

  /// Images which Flutter will start to load and cache when this widget is built.
  final List<ImageProvider<Object>> precachedImages;

  /// See below for API
  final ImageService service;

  /// Look up the nearest `ImageService` from the build context.
  static ImageService of(BuildContext context);

  ...
}

/// Customizes the behavior of images in a subtree.
class ImageService {
  const ImageService();

  /// Called once when the subtree containing this widget is torn down.
  void dispose() {}

  /// Proxies call to ImageCache.evict.
  void evict(Object key) {}

  /// Proxies call to ImageCache.putIfAbsent.
  ImageStreamCompleter putIfAbsent(Object key, ImageStreamCompleter loader());

  /// Loads a network image.
  ImageStreamCompleter loadUrl(NetworkImage key);

  /// Loads a file image.
  ImageStreamCompleter loadFile(FileImage key);

  /// Loads an asset image.
  ImageStreamCompleter loadAsset(AssetImageKey key);

  /// Loads a memory image.
  ImageStreamCompleter loadMemory(MemoryImage key);
}

Examples
To demonstrate the usefulness of the above changes, I've prepared some example implementations below.
Example: Early Eviction
An ImageService which automatically evicts any images which were cached by the subtree below it when it is destroyed.  This is implemented by saving the keys which are cached and then evicting them when dispose is called.  The ImageService can be stateful since the ImageBehavior widget will only replace it if the runtimeType changes.
Consider a "search page" in an application which displays a grid of network images.  If it is unlikely that exactly the same search will be made again, we could preemptively evict all cached images when the subtree is destroyed.
class EarlyEvictionImageService extends ImageService {
  final Set<Object> _imageKeys = new Set();

  @override
  void putIfAbsent(Object key, ImageStreamCompleter loader()) {
    _imageKeys.add(key);
    super.putIfAbsent(key, loader);
  }

  @override
  void dispose() {
    _imageKeys.forEach(imageCache.evict);
  }
}

Example Use
In the example below, all the images loaded in the ListView will be evicted when this widget is destroyed.
Widget build(BuildContext context) {
  return new ImageBehavior(
    service: new EarlyEvictionImageService(),
    child: new ListView(
      children: imageQuery.map((String url) {
        return new Image.network(url, ...);
      });
    ),
  )
}

Example: Mocking ImageProviders in Tests
The following delegate will cause all ImageProviders to return the test image in the subtree below it.  This can be used to provide images to Image.network without mocking the HttpClient.  This can be useful for testing a large custom widget which includes network images that must be loaded, for hit-testing or layour purposes.  The bits themselves can be loaded by the test harness.
class TestImageService extends ImageService {
  const TestImageService(this.testImage);

  final List<int> testImage;

  @override
  ImageStreamCompleter loadUrl(NetworkImage key) => _load(key.scale);

  @override
  ImageStreamCompleter loadFile(FileImage key) => _load(key.scale);

  @override
  ImageStreamCompleter loadAsset(AssetImageKey key) => _load(key.scale);

  @override
  ImageStreamCompleter loadMemory(MemoryImage key) => _load(key.scale);

  ImageStreamCompleter _load(double scale) {
   return new MultiFrameImageStreamCompleter(
      codec: ui.instantiateImageCodec(testImage),
      scale: key.scale,
    );
  }
}

Example use
In the example below, the image loaded by Image.network will be created from the bits passed to TestImageService.
void main() {
  testWidgets('widget that contains a network image', (WidgetTester tester) async {
    await tester.pumpWidget(
      ImageBehavior(
        delegate: const TestImageService(testImage: testImage),
        child: MyWidget(
         child: Image.network('...'),
        ),
      ),
    );

    ...
  });
}

Example: Adding automatic retry with backoff to Image.network
Using the ImageBehavior widget with a custom ImageService it is now possible to change how images load over the network while still using the Image.network constructor.  The AutomagicBackoffImageService overrides the default behavior of loadUrl to autmatically retry failed HTTP requests up to five times.  This is a fairly naive implementation for demonstration purposes only!
class AutomagicBackoffImageService extends ImageService {
  static final _httpClient = new HttpClient();
  bool _isDisposed = false;

  @override
  void dispose() {
    _isDisposed = true;
  }

  @override
  ImageStreamCompleter loadUrl(NetworkImage key) {
   final Uri uri = Uri.base.resolve(key.url);
   return new MultiFrameImageStreamCompleter(
     codec: _load(uri, key.headers),
     scale: scale,
   );
  }

  /// Not a complete implementation, doesn't handle certain errors.
  Future<ui.Codec> _load(Uri uri, Map<String, String> headers) async {
    for (int i = 0; i < 5; i++) {
      if (_isDisposed)
        break;
      final HttpClientRequest request = await _httpClient.getUrl(uri);
      headers?.forEach(request.headers.add);
      final HttpClientResponse response = await request.close();
      if (response.statusCode == HttpStatus.OK) {
        final Uint8List bytes = await consolidateHttpClientResponseBytes(response);
        return ui.instantiateImageCodec(bytes);
      }
      await new Future.delayed(new Duration(seconds: i + 1));
    }
    return null;
  }
}

Example: Placeholder and Fallback image
A common feature for Android image libraries like Picasso or Glide is the ability to specify placeholder or fallback images.

A placeholder is an image which displays before another resource loads.
A fallback image displays in case a resource fails to load..

Using the new APIs we can still easily implement these as an ImageProvider without requiring a new widget.  This is done by creating a custom ImageStream and exposing an error callback for the ImageStreamCompleter.
class CombinedImageStream extends ImageStream {
  void add(ImageInfo info);
  ...
}

///  Shows [placeholder] until [image] loads.
class PlaceholderImage extends ImageProvider<PlaceholderImage> {
  const PlaceholderImage({this.placeholder, this.image});

  final ImageProvider<Object> placeholder;
  final ImageProvider<Object> image;

  @override
  ImageStream resolve(ImageConfiguration configuration) {
    final CombinedImageStream stream = new CombinedImageStream();
    bool imageLoaded = false;
    image.resolve(configuration).addListener((ImageInfo info, bool syncCall) {
      imageLoaded = true;
      stream.add(info);
    });
    placeholder.resolve(configuration).addListener(
     (ImageInfo info, bool syncCall) {
      if (imageLoaded)
        return;
      stream.add(info);
    });
    return stream;
  }

  ...
}

class FallbackImage extends ImageProvider<FallbackImage> {
  const FallbackImage({this.fallback, this.image});

  final ImageProvider<Object> fallback;
  final ImageProvider<Object> image;

  @override
  ImageStream resolve(ImageConfiguration configuration) {
    final CombinedImageStream stream = new CombinedImageStream();
    image.resolve(configuration)
      ..addListener((ImageInfo info, bool syncCall) {
        stream.add(image);
      })
      ..addErrorListener((Object error, StackTrace stackTrace) {
        fallback.resolve(configuration).addListener(
          (ImageInfo image, bool syncCall) {
            stream.add(image);
          });
      });
     return image;
  }

  ...
}

Github Issues

https://github.com/flutter/flutter/issues/16241
https://github.com/flutter/flutter/issues/16375

The ImageService is dependency injection for image loading, so it solves**** all of the normal problems DI does. Of course a user could write their own widgets which had the exact behavior they wanted, but if everyone did that it would sort of defeat the point of having an Image widget.
Why does it exist as a widget and not a binding somewhere? because I think that a very useful feature for image loading/caching logic is "awareness" of the widget tree.  If one widget subtree corresponds to an infinite scrolling search and another corresponds to a details-like page, then we might want different behavior between the two - early eviction versus persisting to a local file.  However the two pages might share a consider amount of widgets.  I could instead create two different custom image providers and drill them into the right components, but now I have to manage that myself. But with some DI like system, someone could write a widget like CacheToDisk(directory: '..', child: ...) which knows how to check the file system for an image, regardless of the provider/key type.
So the connection to the widget tree is useful, but maybe behavior this isn't collected together in the right place. It's possible just by exposing some general callbacks on the ImageCache/PaintingBindings and getting users more comfortable with those APIs then we could also support some of these features.

What's the immediate problem that you ran into for which you need a dependency injection solution?

I wouldn't call it a problem, more of an immediate un-niceness. This might be an indication we should hold off on the second part and fix the more immediate issue of cache sizes.
as a hypothetical user:

I want to remove an image I loaded from the cache. Currently I have to create a new ImageProvider and pass that to the ImageCache API.  But I never created an ImageProvider since I just used the named Image constructor, and the ImageCache APIs all accept Object/dynamic.  So I'm passing a string but nothing is happening.

I want to cache certain images to disk from the network and load them disk if present.  Is this an Image.network or an Image.file? I don't know so I assume that flutter doesn't support this.  Plus I already have a bunch of custom widgets which use Image.network and such.

We could wait for people to write libraries on top of the widget and cache system instead, like https://github.com/renefloor/flutter_cached_network_image.

Reduced implementation of image cache changes here: https://github.com/flutter/flutter/pull/18135

Based on those use cases I would hold off on the solution until we have people actually asking for this. Just in time problem solving is a core value of the project. :-)

SG

@Hixie  Hi,
I'm asking for ImageBehavior and EarlyEvictionImageService
Related: https://github.com/flutter/flutter/issues/36631

is it possible to tell the ImageCache to only cache images smaller than 3KB?


Fix Issue #21: Renamed python import module

This change migrates the fivetran python package to use the more
standard naming convention for Airflow provider module naming.
e.g, "airflow_provider_fivetran" >> "fivetran_provider"

Merging, but please leave comments or open an issue if anything seems amiss.


module: fix security issue of /dev/video* in NNStreamer apptest

Fixed the issue 651 (https://github.com/nnsuite/nnstreamer/issues/651).
This commit is to fix a potential security issue of /dev/video* in NNStreamer
apptest module.
Note that the server administrator must add 'www-data' (webapp id) account to
'video' group to access /dev/video*. Do not use '777' permission  to avoid a
security vulnerability.
Changes proposed in this PR:

Improved access method of /dev/video* (device node file)
Added dependent commands

Signed-off-by: Geunsik Lim<EMAIL_ADDRESS>
[Template] PR Description
In general, github system automatically copies your commit message for your convenience.
Please remove unused part of the template after writing your own PR description with this template.
$ git commit -s filename1 filename2 ... [enter]

Summarize changes in around 50 characters or less

More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical;
various tools like `log`, `shortlog` and `rebase` can get confused
if you run the two together.

Further paragraphs come after blank lines.

**Changes proposed in this PR:**
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded
  by a single space, with blank lines in between, but conventions vary here.

Resolves: #123
See also: #456, #789

**Self evaluation:**
1. Build test: [ ]Passed [ ]Failed [*]Skipped
2. Run test: [ ]Passed [ ]Failed [* ]Skipped

**How to evaluate:**
1. Describe how to evaluate in order to be reproduced by reviewer(s).

Add signed-off message automatically by running **$git commit -s ...** command.

$ git push origin <your_branch_name>

:memo: Version: 1.20180820. Thank you for submitting PR #298. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://taos-ci.mooo.com/.


Allow triggering a rollback of a HelmRelease

Short description
As a Developer I want to be able to rollback to a prior image tag in a HelmReleases in the UI so that I don't need to fiddle with the CLI.
I'm not sure if this is already on your roadmap. But it would be nice to be able to switch to an older image tag for a HelmRelease. This could be selected in a dropdown list. When you're switching away from the current(latest) tag, then it would be convenient to have the ImageUpdateAutomation set to suspended state so it doesn't override the selected tag again instantly.
In the past we (a joint effort across several teams in our company) enhanced the old Flux Web (which was a UI for the old Flux v1) with exactly this functionality. Please find attached a screenshot of this feature in action.

It would be great to have such functionality in weave-gitops as well. What do you think?

@spr-mweber3 thanks for sharing this idea.
It would be great to understand your scenario a little more:

what is the reason (or reasons) you'd be looking to rollback?
to confirm, you would see the alternative as doing helm rollback (and I guess still suspending the flux automation to prevent reapplying a newer release?)
in this scenario, were you doing anything to manipulate the helm chart version or app version when the image changed, or was that not really a concern?
in the UI you built previously, the list of available tags - is that coming from Flux or directly querying a registry?

Hey @sympatheticmoose, thanks for picking this up. Really good questions. I think I could answer some of them but I was only partly involved in developing this feature and it's already some time ago.
Maybe @dekinderfiets can jump in on that. I think he supported us in implementing this feature.
Additionally I'll try to gather the information you asked for within this week and prepare a detailed answer for you.

Per @bigkevmcd, we would need to go via Git for this (making it a WGE feature) or we’d need to add writability back


First page problem in pagination

The first Page in a pagination is duplicated and there is no way or option that allow removing number "1" from its URL
The problem simply is books/index returns the same output as books/index/1 In the case of pagination of books titles for example.
I think that it is important to be an option that allows remove the number of the first page from the URL.

I think it could be done via url manager rules.

Should work with this rule:
['pattern' => 'books/index/<page:\d+>', 'route' => 'controller/action', 'defaults' => ['page' => 1]]

I think it is better to be handled inside pager widget.
Otherwise, if you do not use 'pretty URLs', you will be unable to solve such SEO problem.

There is no issue here: you need to disable Pagination::forcePageParam if you don't want page param appear for the first page.
Unit tests cover added: bc6cc9b

@klimov-paul @samdark Well, using forcePageParam with the pager options in ListView widget is not possible:
<?= ListView::widget([
	  'dataProvider' => $dataProvider,
	  'options' => ['class'=>'v1', 'tag'=>'ul'],
	  'itemOptions' => ['tag'=>'li', 'class' => 'a2'],
	  'pager' => ['options'=>['class' => 'fox-page pagination'],'forcePageParam' => false],
....

It will generates Unknown property error:

Setting unknown property: yii\widgets\LinkPager::forcePageParam

forcePageParam property belongs to Pagination class, not to the LinkPager - do not mix this entities.

@klimov-paul You are right and I've found the solution of @kidol works so perfect with ListView.
The conclusion
Pagination::forcePageParam  has no any effect or could not be used if the LinkPager is called by another Widget.


BUG：There is an error in the judgment of the upgrade script execution process

Deploy the openelb 0.5.1 version
Execute the upgrade script (0.6.0)
During the script execution process, a prompt appears saying "New version of OpenELB installed successfully"
Check whether the actual pods have been successfully installed and deployed, including some pods that have not been deployed successfully (including openelb-admission and openelb-controller)
Check the upgrade script and find that some logic is not executed

The upgrade script test passed


ng add is broken when ran from root of yarn workspace

Versions
     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 6.0.0
Node: 8.9.3
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, upgrade

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@angular/pwa                      0.6.1
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Repro steps
We have our code in a monorepo, using yarn workspaces, organized as such:
.
└─── packages
     └─── example-lib
└─── public
     └─── mobile
      |     package.json
     └─── site
      |     package.json
angular.json
package.json

Our angular.json file has a project called site, which is located in the public folder.  Yarn considers all package/* and public/* directories as separate workspaces.
Observed behavior
From the repo root, the following command fails:
ng add @angular/pwa --project site

Error:
Installing packages for tooling via yarn.
yarn add v1.6.0
error Running this command will add the dependency to the workspace root rather than workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag
(or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Package install failed, see above.

Desired behavior
Our expectation is that the desired schematic be added to our workspace appropriately.
Mention any other details that might be useful (optional)
I was able to work around the issue by modifying @angular/cli/tasks/npm-install.ts (really the compile javascript, which is a pain because the file is reinstalled) to add the -W or ---ignore-workspace-root-check flags.
Ideally, the root configuration file would be interrogated to find out if workspaces are in use, and add the switch intelligently.
Also, a quick note: we have discarded karma in favor of jest in our testing setup, so when I ported our .angular-cli file to angular.json, I didn't add an architect.test property.  Once I was able to workaround the described issue, the installation still failed because the configuration was provided differently than expected.  A better error message than cannot read property 'options' of undefined would be an improvement.

Closing this, since as @clarkorz mentioned above, Yarn config should be specified in .yarnrc and not Angular CLI.


xDnsServer: Publish content to GitHub repository wiki

Pull Request (PR) description

xDnsServer

Added the build task Publish_GitHub_Wiki_Content to publish content
to the GitHub repository wiki.
Added new source folder WikiSource which content will be published
to the GitHub repository wiki.

Add the markdown file Home.md which will be automatically updated
with the latest version before published to GitHub repository wiki.

Uses PublishPipelineArtifact in  Azure Pipelines pipeline.
Unit tests are now run in PowerShell 7 in the Azure Pipelines pipeline (issue #160).
Removing resource parameter information from README.md in favor of
GitHub repository wiki.
Added back the build task to create releases on GitHub.
Fix property descriptions in schema throughout.

xDnsRecordSrv

Now uses [CimInstance]::new() both in the resource code and the resource
unit test to clone the existing DNS record instead of using the method
Clone() that does not exist in PowerShell 7.

This Pull Request (PR) fixes the following issues

Fixes #160

Task list

[x] Added an entry to the change log under the Unreleased section of the
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
[x] Resource documentation added/updated in README.md.
[x] Resource parameter descriptions added/updated in README.md, schema.mof
and comment-based help.
[ ] Comment-based help added/updated.
[ ] Localization strings added/updated in all localization files as appropriate.
[ ] Examples appropriately added/updated.
[x] Unit tests added/updated. See DSC Community Testing Guidelines.
[ ] Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
[x] New/changed code adheres to DSC Community Style Guidelines.

This change is

Merging this to fix the pipeline and also remove no longer required content in the README.md so that PR's does not have to consider changing that.


Support this.addWatchFile in rollup.js v1.x

Thanks for publishing such the nice plugin ✨ This plugin helped some my Elm projects.
What this PR does
In compilation with rollup.js 1.x, we will see this warning:

(!) Returning "dependencies" from the "transform" hook as done by plugin elm is deprecated. The "this.addWatchFile" plugin context function should be used instead.

This PR provides supporting this.addWatchFile instead of returning .dependencies on the result of transform
To catch the context of transform; this on transform(), moved its scope.

Thanks for the contribution. I will check this out at some point today and get it merged.

Thanks for releasing as 2.0.1 🎁


CAMEL-15920 - removed trailing tabs trimming for tab separator

Removed trailing tabs trimming for tab separator

@anestoruk Great! Thanks a lot for this fix!


Update invoke_rust_agent_expect_result to handle various exceptions

Signed-off-by: Will Johnson<EMAIL_ADDRESS>

Codecov Report

Merging #1025 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1025   +/-   ##
=======================================
  Coverage   95.42%   95.42%
=======================================
  Files           2        2
  Lines         153      153
=======================================
  Hits          146      146
  Misses          7        7

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2962687...ad05e02. Read the comment docs.


Add a operator alias for connect

I really liked using a @ b as an alias for net.contract_between, and I want something similar for net.connect. What symbol should we use?

Yeah, was wondering about this too! Perhaps * or &? At some point, Martin suggested -, which is kind of neat, since it looks like and edge :). ~ is also quite edgy...

~ or - would be a good. I personally prefer ~ if possible to differentiate it from tensor subtraction. (Is the tilde actually supported in python?)
We'll keep it as the same API since new_edge = edge1 ~ edge2 would likely be very common. We already have checks for when you try to run connect with a non-dangling edge so e1 ~ e2 ~e3 should already throw an error.

This syntax does not make it possible to put multiple connections into one expression, unlike with contract_between.

You're not thinking out of the box enough!
edges = [a[0] ~ b[0], a[1] ~ b[1], a[2] ~ b[2]]

You're not thinking out of the box enough!

You seem to be putting things in boxes! Feels like cheating :)
Btw, just realized that ~ is only unary (according to this), so that one's out :/

yeah I just say that too. Sad!

How about ^? It kind of looks like a line joining things up, and it's harder to mistake for tensor arithmetic.

a ^ b is another good option.

Gah you beat me to it. Ok, since we both came to the same conclusion let's go with it.

It also just feels positive and optimistic. ^_^

^-^

Also, the logical operation on indices is pretty much the inverse of XOR...


Argument 2 passed to Amp\Artax\ConnectionInfo::__construct() must b…

Argument 2 passed to Amp\Artax\ConnectionInfo::__construct() must be of the type string, null given.
In some cases cannon retrieve remote address, method  $socket->getRemoteAddress() return null, but for class ConnectionInfo second argument must be a string only.

If this is the case, the connection probably broke already?

Yes, it's not happy path, after my fix exception is: "Amp/ByteStream/StreamException" with message:
"The stream was closed by the peer"
But it's better than type error :)
It's case like: I need fix error to see Error :)


Joint Columns Missing When Inserting to Views

Hi CAP Team,
I am following the Resolvable View and Projection section to implement a view for CRUD. My definition is shown below
// schema.cds
entity HeaderAsso {
    key id : UUID;
        displayId : String(32);
        exc_from : String(8);
        exc_to : String(8);
        tcurr: Association to one TCURR on tcurr.FCURR = exc_from and tcurr.TCURR = exc_to;
}
entity TCURR {
    key MANDT : String(3);
    key KURST : String(4);
    key FCURR : String(5);
    key TCURR : String(5);
    key GDATU : String(8);
        UKURS : Decimal(9, 5);
        FFACT : Decimal(9, 0);
        TFACT : Decimal(9, 0);
}

// MyService.cds
entity HeaderJoinAsso as projection on HeaderAsso{
        *,
        tcurr.UKURS as UKURS,
    };

My design is that I could insert into HeaderJoinAsso, and the payload will go to both HeaderAsso and TCURR.
I post the following payload and it succeed, but only HeaderAsso is inserted.
{
	"id": "34642296-8b91-4145-a579-0e4d5a51cdb6",
	"displayId": "ID-1",
	"exc_from": "EUR",
	"exc_to": "USD",
	"type": "M",
	"effective_date": "2021-08-09",
	"UKURS": 1.15
}

Does it mean that, while inserting to a view, I can only get the validation for the associated entity columns but no deep insertion? I will need to create a handler class to do insertion for associated entities?
Thanks a lot!

Hi @Lynnes001 ,
probably this helps: https://cap.cloud.sap/docs/java/query-execution#cascading-over-associations
Note, that cascading over annotations is not considered best practice.

Okay then, I went on doing with handlers.


Documentation for Metrics ingestion in Data Prepper 1.4.0.

Description
This add documentation for the new Metrics ingestion features in Data Prepper 1.4.0.
Issues Resolved
N/A
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@KarstenSchnitter, @kmssap: This PR adds documentation to OpenSearch.org for metrics ingestion. Feel free to comment.


Pyocd speed under Mbed Studio for NUCLEO_F767ZI (25.5sec -> 4.9sec)

I would like to share some recent speedup I made in my pyocd setup.
First I would like to indicate that this was done for STM32F767, on NUCLEO_F767ZI board (with st-link v2), Mac OS X and optimized to run directly from Mbed Studio. So this is a mix of Mbed Studio issues, mac and pyocd issues. I will list them all at the end - please help to advise if you can follow up on some of them.
So default setup of programming small example program (65Kb) under Mbed Studio takes 25.5sec. STM32F767 has 2MB of flash and Mbed Studio run chip erase by default. Mbed Studio also hardcodes SWD frequency to 1.8Mhz for unknown to me reason. Both things are not configurable... How can we hack it with pyOCD? Project user scripts!
def will_connect(board):
    # Set SWD to 4MHz
    probe.set_clock(int(4e6))

    # Force sector chip errase
    flash_loader_init = pyocd.flash.loader.FlashLoader.__init__
    def init_and_overwrite_chip_erase(self, *args, **kwargs):
        flash_loader_init(self, *args, **kwargs)
        self._chip_erase = 'sector'
    pyocd.flash.loader.FlashLoader.__init__ = init_and_overwrite_chip_erase

It's ugly, but it works. It is even more ugly as Mbed Studio sets project directory to... python binary directory instead of the project itself (so under Mac I have to put my user scripts to '/Library/Application Support/Mbed Studio/mbed-studio-tools/python/bin' and is shared across all the project).
This change already reduce time to 12.5sec, but we can do better.
To understand where the time is going, two techniques are useful: logs messages timestamps and profiler.
Log messages timestamps are giving a very nice timeline of what is happening, but it is sometimes hard to identify where in the there is a problem.
To run profiler I've simply used cProfiler:
python -m cProfile -s cumulative venv3/bin/pyocd ...pyocd...flags...

This immediately shows another bottleneck: disconnecting.
5.006s coresight_target.py:301(disconnect)

It looks like for unknown to me reason NUCLEO_F767ZI never confirms turn down of debugging system, so disconnect wait for hardcoded 5sec timeout. This probably should be somehow configurable, but it also can be hacked with user script to save 4.9sec:
def will_connect(board):
  pyocd.coresight.dap.DP_POWER_REQUEST_TIMEOUT = 0.1

At this point there is no major chunk of wasted time, but we can still do better.
The first problem is Mac specific.
0.813s helpers.py:118(choose_probe)

Probe lookup is slow. The reason is simple - implementation of 'probe/stlink/detect/darwin.py' is slow. Unfortunately it can't be hacked with user script. The user script code is executed after the probe lookup (but still thanks to open sourced nature of pyocd it can be tweaked). Ideally Mbed Studio could just pass already identified probe to Pyocd.
The last easy speedup is driven by two pyocd options: keep_unwritten and smart_flash. As in most cases I need to program new binary completely to the chip these options are slowing down instead of speeding up the process.
The first one will makes sure that if we write part of the sector, the remaining part will be unchanged. But if you program the entire binary you care about it will cause read of chip garbage and attach it to your binary to align it to full sector. The second one (smart_flash) will compute crc32 of existing data to avoid writing sectors that are not changed - again as my binary is almost always changed (it is enough to remove/add single byte in first block of the binary to cause unalignment of all sectors). Disabling it will speedup programming. Disabling both options give 0.9sec of speedup.
In total the all these tweaks decrease program time in Mbed Studio from 25.5s to 4.9sec. So after executing programming 30 times, you can save 10 minutes of your life (and spend 2 hours on optimizing Pyocd :D ).
Can we do better ?
Let's look at STM32_Programmer_CLI: It takes 2.1sec to write the test binary (1.52s of actual programming). Where is the next improvements hidden ?
Profiler gives some hints: 3.9sec (out of 5.1sec total) is used by file_programmer.py:94(program). So the speedup can be done in two places:

initialization 1.2sec to connect to target is quite a lot.
programming is done page, by page. It takes a lot of communication back and forth between host and probe and not use bulk transfer effective. It should be possible to use more ram on the chip to program multiple pages at once.

Issues mention in the entire above - please let me know if you can follow up with Mbed Studio or recommend alternative solution:

Mbed Studio - allow configuration of pyocd flags.
Mbed Studio setting project directory correctly (project directory instead of python bin directory).
Pyocd disconnect timeout - configuration or decrease disconnect timeout default to 0.1sec.
Speedup probe/stlink/detect/darwin.py or allow passing probe configuration without running detection code.
Recommend keep_unwritten=false and smart_flash=false options in documentation to speedup programming.
Programming multiple pages at once without halting core between pages.

edit: sector vs page

Thanks for the Mbed Studio feedback. I’ll capture it in our backlog.


Finish and fix float printing

WIP: See #375.
A start at finishing off the float printing once and for all. I've pushed early since I want to confirm the changed behaviour.
For now, I've only done the formatFloatDecimal function. I've adjusted the code so we now round the last digit if required so we are in line with what glibc is doing. Was there any reason behind truncating or has we just not got around to implementing rounding? I've also fixed the negative exponential cases which were not handled previously. Infinity and NaN were renamed to match C.
Here is a test program which I'd like to get passing before merging this. We'll need one for formatFloat, too, and should also randomly generate f64/double values and ensure coverage looks good on that area too.
Currently we print the first 713620 values the same as libc. I'll work through the ones which don't and add test cases as new errors are encountered.
const std = @import("std");

const c = @cImport(@cInclude("stdio.h"));

pub fn main() !void {
    var i: u32 = 0;
    while (true) : (i += 1) {
        // Need a double since c only prints double representations.
        var f = f64(@bitCast(f32, i));

        var c_buf: [64]u8 = undefined;
        var c_len = usize(c.snprintf(&c_buf[0], c_buf.len, c"%.5f", f));

        var z_buf: [64]u8 = undefined;
        var z_len = (try std.fmt.bufPrint(z_buf[0..], "{.5}", f)).len;

        if (c_len != z_len or !std.mem.eql(u8, c_buf[0..c_len], z_buf[0..z_len])) {
            _ = c.printf(c"full repr: %e\n", f);
            std.debug.warn(
                \\not equal: (i = {})
                \\
                \\   c: {}
                \\ zig: {}
                \\
                \\
                ,
                i,
                c_buf[0..c_len],
                z_buf[0..z_len],
            );
            break;
        }

        const progress = 1 << 16;
        if (i % progress == progress - 1) {
            std.debug.warn("i = {}\n", i);
        }

        if (i == @maxValue(u32)) {
            std.debug.warn("all ok!\n");
            break;
        }
    }
}

Currently tested up to i = 916,964,780 with no errors. Will finish the remainder tomorrow.

which build mode are you testing in?

Debug mode only. Since there are outstanding issues for release modes I'll consider that in a separate PR once the base logic is known to work.

Up to<PHONE_NUMBER> now. I think there is an issue with the actual errol reference code right now on some larger inputs. Will double check and confirm tomorrow.
With the reference code:
#include <stdbool.h>
#include <stdio.h>

#include "lib/errol.h"

int main(void)
{
    double d =<PHONE_NUMBER>6965632;
    char buf[64];

    errol3u_dtoa(d, buf);

    printf("libc:  %f\n", d);
    printf("errol: %s\n", buf);
}

We get:
libc:<PHONE_NUMBER>6965632.000000
errol:<PHONE_NUMBER>696563

In the zig port we actually seem to fill the buffer correctly (with the trailing 2) but the length of the slice is one short. I don't think I've overlooked anything obvious here. I'll try diagnose the issue and make a fix before reporting just yet.

Also, here is an updated test script to ignore the wierd y.xxx25 rounding that libc is doing.
const std = @import("std");
const c = @cImport(@cInclude("stdio.h"));

pub fn main() !void {
    var i: u32 =<PHONE_NUMBER>;
    outer: while (true) : (i += 1) {
        // Need a double since c only prints double representations.
        var f = f64(@bitCast(f32, i));

        var c_buf: [64]u8 = undefined;
        var c_len = usize(c.snprintf(&c_buf[0], c_buf.len, c"%.5f", f));

        var z_buf: [64]u8 = undefined;
        var z_len = (try std.fmt.bufPrint(z_buf[0..], "{.5}", f)).len;

        if (c_len != z_len or !std.mem.eql(u8, c_buf[0..c_len], z_buf[0..z_len])) {
            // 0.015625 rounds to 0.01562 with libc but we round it to 0.01563.
            // Ignore these error cases.
            var ec_buf: [64]u8 = undefined;
            var ec_len = usize(c.snprintf(&ec_buf[0], ec_buf.len, c"%.6f", f));

            if (ec_buf[ec_len-2] == '2' and ec_buf[ec_len-1] == '5') {
                // ignore (these are moderately common (every few million) for small values.
            } else {
                _ = c.printf(c"full repr: %e\n", f);
                std.debug.warn(
                    \\not equal: (i = {})
                    \\
                    \\   c: {}
                    \\ zig: {}
                    \\
                    \\
                    ,
                    i,
                    c_buf[0..c_len],
                    z_buf[0..z_len],
                );
                break;
            }
        }

        const progress = 1 << 20;
        if (i % progress == progress - 1) {
            std.debug.warn("i = {}\n", i);
        }

        if (i == @maxValue(u32)) {
            std.debug.warn("all ok!\n");
            break;
        }
    }
}

Feels like floating point is one edge case after another.

That's really frustrating. It might be worth giving up errol and having simpler, smaller code for parsing and printing floats. This is what I started in the floats branch. Although looking at it, I guess I didn't start the work on formatting, just parsing.
Even if we had errol in the standard library for speed, we still might want this smaller code implementation, and the default implementation would choose based on --release-fast or --release-small.

I'm not convinced that optimization is worth it. I think the 2 or 3 branches that check for non-finite float values are a negligible slice of the pie chart that is formatting float values.
Also, even though the default float mode is Optimized, we still support Strict at a scope level. My stance is that formatting floats should work for all values.

I've had a bit of a closer look into this and I'm fairly certain there is no bug in errol. This looks like a non-optimal rounding accuracy in the libc implementation.
You can test Grisu3 as well, which is used by most major browser engines, by pasting<PHONE_NUMBER>6965632 into your console. You should see it rounded down to<PHONE_NUMBER>6965630. I'll instead see if I can skip these large integer examples from the remaining tests and proceed as normal.

I've tested the {.5} format against libc now for all 32-bit floating point numbers and we are now identical with the following exceptions:

0.015625 rounding as 0.01562 in libc vs. zigs 0.01563
Errol3 performs different rounding of integer values above ~9e10 as mentioned above.

What remains now is to do the following:

Implement rounding/corrections to the 0.00e-43 formatting code. This is largely the same except we can remove the leading zero printing and print only the sf fractional digits.
Test some of the edge case formatting specifiers e.g. {.1}, {.20} with randomly generated doubles.
Test the exp code when written with some randomly generated doubles
Check the Windows failure on appveyor

Few thoughts/questions:

We default to scientific notation as this is most consistent for large/small numbers.
I think it would be useful if the default float format printed in full precision to get the property that we can always re-parse values back to the original value.
In saying that, we could specify {.} to print full precision by default (instead of 5)? Although that is less useful. Some way to print full precision decimals may be nice however.
Do we want a new float format specific (such as {e}) for scientific notation so one can specify the precision?

I think it would be useful if the default float format printed in full precision to get the property that we can always re-parse values back to the original value.

I agree with this. My proposal would be {} to print a value that we could parse back into the original value. Users can use {.5} if they want smaller output.

Do we want a new float format specific (such as {e}) for scientific notation so one can specify the precision?

This makes sense to me. Perhaps we can find some inspiration from Python3's docs for formatting.

This is mostly complete now. The windows test failure is a bit annoying. I'll see if I can test under wine or otherwise I'll set up a vm for it. Consider the formatting notation of scientific values temporary. I would like to review this the formatting string language completely and revamp as needed.
I've tested scientific/decimal rounding to a precision of 5 of all f32 values against libc and they all match with a few minor exceptions which are noted in the tests.
const std = @import("std");

pub fn main() void {
    const a = f64(1.2345678);
    std.debug.warn("{}\n", a);
    std.debug.warn("{.}\n", a);
    std.debug.warn("{e}\n", a);
    std.debug.warn("{.0}\n", a);
    std.debug.warn("{e0}\n", a);
    std.debug.warn("{.1}\n", a);
    std.debug.warn("{e1}\n", a);
    std.debug.warn("{e9}\n", a);
    std.debug.warn("{.9}\n", a);

    std.debug.warn("\n");

    const b = f64(1.5e-20);
    std.debug.warn("{}\n", b);
    std.debug.warn("{.}\n", b);
    std.debug.warn("{e}\n", b);
    std.debug.warn("{.0}\n", b);
    std.debug.warn("{e0}\n", b);
    std.debug.warn("{.1}\n", b);
    std.debug.warn("{e1}\n", b);
    std.debug.warn("{e9}\n", b);
    std.debug.warn("{.9}\n", b);

    std.debug.warn("\n");

    const c = f64(1.52314e+29);
    std.debug.warn("{}\n", c);
    std.debug.warn("{.}\n", c);
    std.debug.warn("{e}\n", c);
    std.debug.warn("{.0}\n", c);
    std.debug.warn("{e0}\n", c);
    std.debug.warn("{.1}\n", c);
    std.debug.warn("{e1}\n", c);
    std.debug.warn("{e9}\n", c);
    std.debug.warn("{.9}\n", c);
}

1.2345678e+00
1.2345678
1.2345678e+00
1
1e+00
1.2
1.2e+00
1.234567800e+00
1.234567800

1.5e-20
0.000000000000000000015
1.5e-20
0
2e-20
0.0
1.5e-20
1.500000000e-20
0.000000000

1.52314e+29
152314000000000000000000000000
1.52314e+29
152314000000000000000000000000
2e+29
152314000000000000000000000000.0
1.5e+29
1.523140000e+29
152314000000000000000000000000.000000000

more details about the windows failure
integer division by zero
stack trace from msvc:
>	test.exe!00007ff7e995b0ad() Line 45	udivmod.zig
 	test.exe!00007ff7e9959732() Line 6	     udivmodti4.zig
 	test.exe!00007ff7e995b7aa() Line 8	    umodti3.zig
 	test.exe!errolInt(FloatDecimal * val, double buffer, []u8 *) Line 325	errol/index.zig
 	test.exe!errol3u(FloatDecimal * val, double buffer, []u8 *) Line 103	C
 	test.exe!errol3(FloatDecimal * value, double buffer, []u8 *) Line 95	C
 	test.exe!formatFloatDecimal(StackTrace * value, double maybe_precision, ?usize * context, BufPrintContext * output, error (StackTrace *, BufPrintContext *, []u8 *)) Line 421	C
 	test.exe!format(StackTrace * context, BufPrintContext * output, error (StackTrace *, BufPrintContext *, []u8 *) arg2, double) Line 167	C
 	test.exe!bufPrint(@typeOf(bufPrint).ReturnType.ErrorSet![]u8 * buf, StackTrace * arg1, []u8 *) Line 688	C
 	test.exe!fmt.format(StackTrace *) Line 859	fmt/index.zig
 	test.exe!main(StackTrace *) Line 11	C
 	test.exe!callMain() Line 96	C
 	test.exe!WinMainCRTStartup() Line 45	C
 	[External Code]

I'm quite puzzled. Happy to try anything you suggest.

Some ideas I thought of to try next time I get a chance to look into this:

inspect the registers and make sure the calling convention is respected
using gdb check what happens on linux in this test case and see if the control flow matches on windows

I did not solve it but I have a bunch of clues.
One I believe is a red herring, but it is rather interesting - in this test case, we are invoking udivmodti4 with
a=152313999999999991610955792383
b=10000000000000000000

The correct answer for division is<PHONE_NUMBER>0 but udivmodti4 gives<PHONE_NUMBER>9. This matches upstream behavior with llvm compiler-rt. I sent a message to llvm-dev.
However I think this is a red herring because the answer is consistent on linux and windows. Also note that on windows udivmodti4 passes the quite comprehensive test suite, but this uses normal zig function calls and does not try to use u128 types across .o file boundaries.
Another clue is https://github.com/JuliaLang/julia/issues/3081
I am not sure if this is still true, this was from LLVM 3.x.
But according to MSVC the division by zero happens in an if statement that checks if maybe_rem is not null, even though we passed null. So it seems the arguments are not being passed correctly.
This seems to point to a bug in LLVM since LLVM is the one generating calls to udivmodti4 in the first place, and we build compiler_rt.o with LLVM using the C calling convention. I will put together a small test case and send another email to llvm-dev.

Here's a small test that fails on windows:
const std = @import("std");

test "aoeu" {
    var a: u128 =<PHONE_NUMBER>99999991610955792383;
    var b: u128 =<PHONE_NUMBER>0000000000;
    var c = a / b;
    std.debug.assert(c ==<PHONE_NUMBER>9);
}

Later I'll work on turning this into LLVM IR and trying to trigger the problem using only clang and LLVM, which should get some attention on a bug report.

Here's the latest mail I sent to llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2018-April/122775.html

It seems that the problem here is that there is no ABI specification for how to handle i128 on Windows. It's not clear to me what calling convention LLVM is using to call udivmodti3, but the problem is that it is not matching the calling convention in std/special/compiler-rt/*:
export fn __udivti3(a: u128, b: u128) u128 {
    @setRuntimeSafety(builtin.is_test);
    return __udivmodti4(a, b, null);
}

So here's how to solve this problem:

[ ] Determine what is the calling convention that LLVM is using when it
generates a call to __udivti3. Theoretically we should be able to inspect
the assembly of the function call and that tells us the CC.
[ ] Update the definition of __udivti3 to match that CC. Ideally it would
be one of the calling conventions we already have available. If
necessary, use inline assembly,

I believe the commit I just pushed should fix the compiler-rt ABI for windows.

Thanks for tracking that down and fixing.

Thank you for doing the floating point fixes!


Different naming for files

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
In general I would advise never to start a filename with a number.
When there is multiple txt files generated, they might be mixed with some other temporary download files,
so it's best to have same starting name, which is obvious, so bookmarks is fine name.
Ideally it should have the name of the folder at the start.
For example if the folder is Music the file name could be:
bookmarks_Music_2023-05-09_10-27-17.txt
So if updated they will be next to each other in proper lineup.
Thanks.

While i dont really see a valid reason not to start a filename with a number ...i personally dont have an issue with changing the output format to something like bookmarks_${BookmarkFolder}_YYYY-MM-DD_hh-mm-ss.txt
notes:
Since the download filename has the following browser built-in restrictions

no special characters allowed
filename length limit

all special characters will need to be replaced with _ underscores
and if necessary the bookarkfolder name parts will be truncated to not exceed the length limit.

Regarding the start of the file name with number is because many tools can't read that file names properly, from the DOS time etc.
but also name conventions is important when working in big studios and this is one of the rules.
In this case maybe it wouldn't matter as much, but starting with bookmarks as a name is certainly better, since they will all be next to each other, easy to move, copy or just plain read and find the file ones need.
No special characters allowed is excellent, just like a filename length limit, so cool they are there as well.
Also it would be much easier to code let's say python script to read these bookmark files if named like that.
Regarding the name conventions, this is just first google explanation I found, but I hope I don't need to explain more then that.
https://gis.stackexchange.com/questions/7886/is-starting-names-with-numbers-a-bad-data-naming-convention
Thanks
-----Original Message-----
From: igorlogius @.>
To: igorlogius/export-bookmarks-as-text @.>
Cc: Aleksandar Stiglic @.>; Author @.>
Sent: Mon, May 8, 2023 10:29 pm
Subject: Re: [igorlogius/export-bookmarks-as-text] Different naming for files (Issue #2)
While i dont really see a valid reason not to start a filename with a number ...i personally dont have an issue with changing the output format to something like bookmarks_${BookmarkFolder}_YYYY-MM-DD_hh-mm-ss.txtnotes:Since the download filename has the following browser built-in restrictions

no special characters allowed
filename length limit
all special characters will be replaced with _ underscores
and if necessary the bookarkfolder name part will be truncated to not exceed the length limit.—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

Fantastic, thank you...
I tried everything to find the culprit for the other thing, but no luck so far...
Anyway, still it works in other profile which is great.
Thank you so much, this is excellent tool.
-----Original Message-----
From: igorlogius @.>
To: igorlogius/export-bookmarks-as-text @.>
Cc: Aleksandar Stiglic @.>; Author @.>
Sent: Tue, May 9, 2023 12:20 pm
Subject: Re: [igorlogius/export-bookmarks-as-text] Different naming for files (Issue #2)
Should be "fixed/improved" in 1.1.6.And thanks again for the suggestion/request.—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>


[v1.7] java.lang.NoClassDefFoundError: com/typesafe/config/ConfigMergeable

Hi Vaga!
So upon starting the pack, everything is fine until this happens while loading:
Log: http://pastebin.com/FCqJQTaH
Pack Version: <IP_ADDRESS>

hmm seems that OC is causing a problem when it launches. I will look into this and try to see what is causing it. There was a slight problem between FTB and curse when I pushed the 1.7 update. This crash might be caused by that.

This also happens with version 1.7.0.

Ok for anyone have this Issue. Please launch from the FTB launcher. It is a bug with the curse launcher. and I am looking into a fix.

We now have a work around for this crash. I will try and explain it as best as I can
step 1: Install version 1.6
Step 2: launch the pack, Once the pack has loaded up quit.
step 3: Update the pack to release version, and relaunch.
This should allow you run the newer versions of the pack on the curse launcher.

Seems to have fixed its self. Will reopen if the problem returns

Guess whats back!


Use dotted vector clocks as general causality tracking mechanism

Replaces the current combined vector clock and plausible clock approach
Clock sizes scale with the number of locations per replicated log
Can track causality within a location

Will be discontinued because:

it is not compatible with batch write semantics to the same local event log by different actors
it makes conflict management more complex for event-sourced actors with stateSync = false

It will be replaced by plausible clock system (see also #280)


potential vulnerability

A potential vulnerability was posted to the BigTree-CMS repo, who said the issue is in less.php. The original reported hasn't opened an issue here, so I am.
https://github.com/bigtreecms/BigTree-CMS/issues/333

Hi,
I use this project with composer and the test directory is not present. Maybe it should be used with composer in bigtreecms instead of adding a submodule in a public path ?


Feature: add track_id in log file

This saves your time when you search something in ton's of the messages
Signed-off-by: Huang Yuzhen<EMAIL_ADDRESS>

If you can remember a random string with 20 characters length, why wouldn't you remember the actual line number of an entry? :)

Maybe it helps you, somehow. But that's because it's your own, homegrown hack ... not something that most people would enjoy.


File upload is required

Description
Block upload if no file is selected. Note: it is still possible to skip the upload by clicking the skip button.
Checklist

[ ] Created tests which fail without the change (if possible)
[ ] Extended the README / documentation, if necessary

Issue(s)
#1210

I'm just trying to block this in case you didn't see my slack message. I want to chat before this gets merged in.

Chatted offline. Will have followup PRs to address some UX confusion.


Several missing MIME type extension detections

these should be caught by the content sniffing, are they not?

these should be caught by the content sniffing, are they not?

They indeed should be. Even .ico has a known magic byte definition.
@richardanaya are you noticing extensions are not correctly inferred? If so there might a deeper issue we should track down.

  Basically I was writing a handler for a function that would check if a file exists, and if it existed, i'd returrn the file with correct Mime, but if it didn't exist, i'd just return "index.html"
app.at("/*").get(move |req: tide::Request<()>| {
                let server_dir3 = server_dir2.clone();
                async move {
                    let index = server_dir3.join("index.html");
                    let p = server_dir3.to_str().unwrap();
                    let p2 = req.url().path();
                    let s = format!("{}{}", p, p2).to_string();
                    let p3 = std::path::Path::new(&s);
                    if p3.exists() {
                        tide::Result::Ok(
                            tide::Response::builder(200)
                                .body(std::fs::read(p3).unwrap())
                                .content_type(
                                    from_extension(p3.extension().unwrap().to_str().unwrap())
                                        .unwrap(),
                                )
                                .build(),
                        )
                    } else {
                        tide::Result::Ok(
                            tide::Response::builder(200)
                                .body(std::fs::read(index).unwrap())
                                .content_type(tide::http::mime::HTML)
                                .build(),
                        )
                    }
                }
            });

I'd humbly offer to the convo if you all are making this function public, it should probably handle the cases it can from file extension so n00bs like me don't accidently wander into traps :P

these should be caught by the content sniffing, are they not?

I don't think we should sniff these. They are very common and this check is much cheaper.

@richardanaya I can see an argument against this function being public, as it is an http-types implementation detail. However, as a tide user, you should not have to write code like the above.  Have you looked at serve_dir? Does it not meet your needs? How could we improve it so that you don't need to write your own file-serving endpoint?

@jbr thanks for your comments! I looked at serve_dir.  I think part of me just didn't know this existed. The logic I was trying to implement fundamentally was:

listen to all paths /*
does this path exist realtive to a certain directory?
if I didn't exist, how do I provide a fallback.

I see now how serve dir could handle 1 & 2
app.at("/*").serve_dir("dist/")?;

not yet sure about #3 :) my assumption is a fallback route exists somewhere though

@richardanaya default not-found handling is a known issue with serve_dir. until we add a way to configure serve_dir, you probably want something like:
#[async_std::main]
async fn main() -> Result<(), std::io::Error> {
    tide::log::start();
    let mut app = tide::new();

    app.with(tide::utils::After(|response: tide::Response| async move {
        if response.status() == tide::StatusCode::NotFound {
            Ok(tide::Response::builder(200)
                .body(tide::Body::from_file("./dist/index.html").await.unwrap())
                .build())
        } else {
            Ok(response)
        }
    }));

    app.at("/").serve_dir("./dist")?;

    app.listen("<IP_ADDRESS>:8080").await?;

    Ok(())
}

I'm going to close this issue, because all of these MIME types are currently handled correctly by content-sniffing.
Adding these extensions won't provide any performance improvement over content-sniffing, because we do content-sniffing first and only check extensions as a fallback. Changing that would be a much more substantial and breaking change, and would need consideration on its own merits.
If there's an issue with files not having their MIME types detected correctly, I'd suggest opening that as a separate issue.

I'm going to close this issue, because all of these MIME types are currently handled correctly by content-sniffing.
Adding these extensions won't provide any performance improvement over content-sniffing, because we do content-sniffing first and only check extensions as a fallback. Changing that would be a much more substantial and breaking change, and would need consideration on its own merits.
If there's an issue with files not having their MIME types detected correctly, I'd suggest opening that as a separate issue.


Socket controller not returns ID

Hello!
I'm having trouble getting the current socket ID, how can i do that correctly?
'use strict'
var currentSocket;
class TestController {
	constructor (socket,request) {
		this.socket = socket;
		this.socket = request;

		currentSocket = socket;

		console.log("Client connected",socket.id);
	}

	onTestApp () {
		//console.log("Client ID",socket.id); This not works socket undefined
		console.log("Client ID",this.socket.id);  // Returns undefined
		console.log("Client ID",currentSocket.id); // Return the ID of the first socket connected
	}
}
module.exports = TestController ;

Hi,
On the constructor, you overrides this.socket with this.request (this.socket = request) property ;)

Closing since there is typo in code and no updates from the issue reporter


Consolidate .open() and .openAndYieldController()

I'm submitting a feature request

Library Version:
1.0.0-beta.3.0.1

Please tell us about your environment:

Operating System:
Windows [7|10]

Node Version:
6.2.0

NPM Version:
3.8.9

JSPM OR Webpack AND Version
JSPM 0.16.32

Browser:
all

Language:
all

Current behavior:
Two methods to open a dialog:

.open(settings: DialogSettings): Promise<DialogResult>
.openAndYieldController(setings: DialogSettings): Promise<DialogController & { result: Promise<DialogResult> }>

Expected/desired behavior:

What is the expected behavior?
To consolidate the two methods as follows:
rename DialogResult => CloseDialogResult
add new dialog result interface

interface OpenDialogResult {
  controller: DialogController | null;
  wasCancelled: boolean;
  result: Promise<CloseDialogResult>
}

the merged .open() definition

open(settings: DialogSettings):
        { openResult: Promise<OpenDialogResult>, closeResult: Promise<CloseDialogResult> };
// OR
open(settings: DialogSettings & { yieldController: false | undefined }): Promise<CloseDialogResult>;
open(settings: DialogSettings & { yieldController: true }): Promise<OpenDialogResult>;
open(settings: DialogSettings & { yieldController: boolean | undefined }): Promise<OpenDialogResult | CloseDialogResult>;

What is the motivation / use case for changing the behavior?
First of all, I get that openAndYieldController was introduced so that new functionality could be added in non-breaking way, but
confusion when to use .open() and when .openAndYieldController() - I think there was at least 1 issue, also on the gitter channel, and at work(I shouldn't have said that).
adding the result: Promise<DialogResult> property on DialogController doesn't feel right, also it's somewhat hard to type currently #216
with the current impl .open() is a subset of .openAndYieldController()
in the context of #223 we can propagate cancellation in consistent way - having .wasCancelled in both DialogOpenResult and DialogCloseResult(cancelable promises do seem far 😞)

I'll make a PR to comment on actual code if these changes will be considered.

I would be willing to consider them. I thin we would likely want to make some changes but if you are willing to put a PR together, we can use that as a point of conversation and refine from there.

Will do tomorrow, it's too late for me now.

For reference - https://github.com/aurelia/dialog/pull/218

@StrahilKazlachev @EisenbergEffect We've discussed going back to a promise that gets resolved or if not it would get thrown and need to be caught by the consuming developer.  Now that we are talking about working on open and what gets returned do we want to re-hash this conversation?

I went over #22, but I like the current approach, rejecting only under error conditions. At a point I experimented with an API that cancelled with rejection. Found it easier to reason cancellation on resolve rather then on reject.
We could add to the returned promises a .throwOnError() method to opt-in to throw on cancel:
service.open(settings)
  .then(() => { /* success or cancellation */ })
  .catch(() => { /* error */ })

service.open(settings).throwOnError()
  .then(() => { /* success */ })
  .catch(() => { /* cancellation or error */ })

But I don't like how it has to be typed, without union types.
Cancelable Promises - the proposal TC39 discusses is at stage 1 - I think, and there are a couple other proposals. I wouldn't go with them in the dialog now.

What do you think about a throwOnCancel flag in DialogSettings? But with a restriction:

false by default
the default can not be configured

This way if a plugin depends on the dialog it will not break.

I personally like that approach, @EisenbergEffect seem reasonable?

That sounds good to me.

Closed #225.


ci: alert systematic failures only from main or release branches

Closes #3851

/test

/ok-to-merge update to workflow


Changes to fix ios issues and add CI for ios platforms

Remove keychain when on ios platform, this requires the latest master from https://github.com/sfackler/rust-security-framework.
Uses https://github.com/SSheldon/rust-test-ios to build and run tests on ios simulator.

Seems some upstream components have stopped building on ios.

The incoming changes are quite significant and I have no way of testing (or even building) them locally. There might be a lot of "commit and hope" changes while I figure it out.

All tests are passed.

Thanks!


check grpcClient before ding to avoid unexpected error

Sometimes the discoverHostieIp call takes too long to complete, so the grpcClient won't be initialized before we make the first ding() from wechaty-puppet. So it would be better to check the grpcClient existence before we actually do the ding() call to grpc layer.

It seems that the GitHub Action is buggy and blocked our PR.
LGTM, let's merge by force.


adding int8 to int32 and int8 to float32 casts

It looks like the errors are not related to the changes. Should we merge this PR?

Errors seems to be from unrelated platforms, this should be safe to merge for our purposes.


Adding a new label after loading from stored workspace

Load a new dataset.
Create a two new labels
Predict
Save and exit
Load from previous workspace
Add new label
Traceback (most recent call last):
File "/apps/anaconda/2.4/envs/ccpi/lib/python3.6/site-packages/survos/plugins/annotations.py", line 515, in on_add_label
self.save_labels(level)
File "/apps/anaconda/2.4/envs/ccpi/lib/python3.6/site-packages/survos/plugins/annotations.py", line 630, in save_labels
parent_labels = self.LBLM.parent_labels(level)))
File "/apps/anaconda/2.4/envs/ccpi/lib/python3.6/site-packages/survos/core/model.py", line 218, in set_attrs
f['data'].attrs[k] = v
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/apps/anaconda/2.4/envs/ccpi/lib/python3.6/site-packages/h5py/_hl/attrs.py", line 95, in setitem
self.create(name, data=value, dtype=base.guess_dtype(value))
File "/apps/anaconda/2.4/envs/ccpi/lib/python3.6/site-packages/h5py/_hl/attrs.py", line 171, in create
htype = h5t.py_create(original_dtype, logical=True)
File "h5py/h5t.pyx", line 1611, in h5py.h5t.py_create
File "h5py/h5t.pyx", line 1633, in h5py.h5t.py_create
File "h5py/h5t.pyx", line 1694, in h5py.h5t.py_create
TypeError: No conversion path for dtype: dtype('<U10')

Hi Sri,
We're having a similar issue when updating label annotations on SuRVoS 1.1.3 but using Python 2.7:
+ Updating labels for [Level 1]
Traceback (most recent call last):
  File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/survos/plugins/annotations.py", line 517, in on_add_label
    self.save_labels(level)
  File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/survos/plugins/annotations.py", line 632, in save_labels
    parent_labels = self.LBLM.parent_labels(level)))
  File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/survos/core/model.py", line 218, in set_attrs
    f['data'].attrs[k] = v
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/h5py/_hl/attrs.py", line 93, in __setitem__
    self.create(name, data=value, dtype=base.guess_dtype(value))
  File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/h5py/_hl/attrs.py", line 171, in create
    htype = h5t.py_create(original_dtype, logical=True)
  File "h5py/h5t.pyx", line 1543, in h5py.h5t.py_create
  File "h5py/h5t.pyx", line 1565, in h5py.h5t.py_create
  File "h5py/h5t.pyx", line 1626, in h5py.h5t.py_create
TypeError: No conversion path for dtype: dtype('<U7')
Aborted (core dumped)

Would you suggest that using Python 3.6 is the way to resolve?  I can try next week, I was thinking it could be an ongoing issue with h5py though
Thanks,
Olly

Hi Olly,
Try 3.6 and if it doesn't work then i will look into the the problem.
Thanks
Sri
On Fri, Nov 30, 2018 at 3:42 PM Olly King<EMAIL_ADDRESS>wrote:

Hi Sri,
We're having a similar issue when updating label annotations on SuRVoS
1.1.3 but using Python 2.7:

Updating labels for [Level 1]
Traceback (most recent call last):
File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/survos/plugins/annotations.py", line 517, in on_add_label
self.save_labels(level)
File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/survos/plugins/annotations.py", line 632, in save_labels
parent_labels = self.LBLM.parent_labels(level)))
File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/survos/core/model.py", line 218, in set_attrs
f['data'].attrs[k] = v
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/h5py/_hl/attrs.py", line 93, in setitem
self.create(name, data=value, dtype=base.guess_dtype(value))
File "/dls_sw/apps/SuRVoS_2018/lib/python2.7/site-packages/h5py/_hl/attrs.py", line 171, in create
htype = h5t.py_create(original_dtype, logical=True)
File "h5py/h5t.pyx", line 1543, in h5py.h5t.py_create
File "h5py/h5t.pyx", line 1565, in h5py.h5t.py_create
File "h5py/h5t.pyx", line 1626, in h5py.h5t.py_create
TypeError: No conversion path for dtype: dtype('<U7')
Aborted (core dumped)

Would you suggest that using Python 3.6 is the way to resolve? I can try
next week, I was thinking it could be an ongoing issue with h5py though
Thanks,
Olly
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/DiamondLightSource/SuRVoS/issues/51#issuecomment-443240793,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAovcZmo_gR4TTwXhvGUHPbsCRcVXzjMks5u0VHPgaJpZM4Wi8zf
.


updated hello-world

What does the program do ?
printing
In what programming language it is written?
c++

Thank you for participating  in hacktoberfest ❣ if you liked working on this repo you can share it with friends and star this project for helping others